Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 45

Thread: OpenGL should provide direct font support

Hybrid View

  1. #1
    Intern Newbie
    Join Date
    Dec 2012
    Posts
    42

    OpenGL should provide direct font support

    in my opinion a next OpenGL release should support direct font support !

    What do other´s think ?

    Who could push such a development ?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Apr 2004
    Posts
    228
    My opinion is that opengl should stay narrowly specialized in it's field, that is, interface to 3D graphics hardware. It is big and complex enough as it is. If we must have some kind of standard font api, then lets make a separate one like OpenAL, OpenCL etc.
    Imagine font support was added (i don't know what exactly it would be). But most opengl users really need just the 3d graphics. Still all opengl vendors will need to implement support for fonts, only to stay unused most of the time - unneeded burden for them.
    Keeping the things as separate as possible is the best way. Otherwise it gets bloated and messier out of control.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,098
    nVidia have arleady made moves towards a font system with their NV_path_rendering. I would like to see this promoted. I disagree with I_belev that opengl uses just do 3d. Every 3D app I have written has required 3D text to some extend whether it was a game or commerical software.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2009
    Posts
    578
    I agree with I_believ. I do like NV_path_rendering, but font support is a terribly hairy affair. First off: fonts come in lots and lots of formats, loading and using all those formats is non-trivial. Then we get to rendering: many SVG fonts (such as TTF, etc) have a hinting system which is a dedicated virtual machine. The need for hinting is because letters are usually drawn pretty low-resolution compared to the complexity of the path defining them. Going further, for formatting text kerning is only the beginning there is also shaping. Next comes font selection, i.e. selecting a font from a generic-ish description. Different OS's have different ways of selecting fonts... and then comes font merging, there are situations where the glyphs of a font are broken into multiple files.

    AFAIK, NV_path_rendering, likely uses freetype to load fonts and the uses a very specific OS mechanism for selecting a font (for example under Linux it likely uses fontconfig, which is, in my opinion, garbage). Moreover, AFAIK, NV_path_rendering does not support shaping either...

    What would be nice: an official utility library backed by Khronos where these bits can be implemented. GLU was the last one official utility library but it is OOOOLLD, out dated etc... https://github.com/p3/regal is coming along but it's main purpose is NOT a utility library, but it does have GLU within it.
    Last edited by kRogue; 01-01-2013 at 08:49 AM.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Apr 2004
    Posts
    228
    Quote Originally Posted by tonyo_au View Post
    Every 3D app I have written has required 3D text to some extend whether it was a game or commerical software.
    Every 3D app also for example loads textures form files. Does this mean file input/output functions should be added to opengl too?

  6. #6
    Junior Member Newbie
    Join Date
    Dec 2012
    Posts
    8
    I've been programming Opengl as a hobby for over 10 years and the hardest thing to get right is decent font rendering. Either libraries are old and unmaintained, not cross platform, or have horrible documentation/complete tutorials. While I agree with I_belev that fonts probably don't belong in the spec itself, there needs to be something a little more official.

  7. #7
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    Quote Originally Posted by abdd0e77 View Post
    I've been programming Opengl as a hobby for over 10 years and the hardest thing to get right is decent font rendering. Either libraries are old and unmaintained, not cross platform, or have horrible documentation/complete tutorials. While I agree with I_belev that fonts probably don't belong in the spec itself, there needs to be something a little more official.
    There will never be anything official. Even GLU is no longer maintained and that has been like 13 years.
    Your best bet is to write your own code. You have been doing it for years, so invest some time into your own font system. The easiest is to create a "font map".
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  8. #8
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    I was gonna write something harsh, but in between I reached my intellectual limit.

  9. #9
    Intern Newbie
    Join Date
    Dec 2012
    Posts
    42
    here two other intellectual limits are reached by OpenGL:

    The near clipping plane, and the far clipping plane.
    How can I tell those guys that these limits are not necessary ?

    Therefore here are my suggestions for the next release of OpenGL :
    - native font support
    - no near clipping plane
    - no far clipping plane
    - better polygonal functions

    best regards
    Luis

    Life is too short to fret around with inadequate systems.

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Apr 2009
    Posts
    578
    Quote Originally Posted by LuisAK
    here two other intellectual limits are reached by OpenGL:
    http://www.naturewizard.com/Tutorial...s/image005.jpg
    The near clipping plane, and the far clipping plane.
    How can I tell those guys that these limits are not necessary ?

    Therefore here are my suggestions for the next release of OpenGL :
    - native font support
    - no near clipping plane
    - no far clipping plane
    - better polygonal functions

    This has got to be a joke, right? The near and far clipping plane are only _concepts_ and not even a part of the OpenGL core profile specifications. I strongly urge you to read the specification and learn what are normalized device coordinates. Once you kind of understand what those are, then read what a projection matrix is, and then about various standard projection matrices.

    Going further, the "native font support", did you even read what people wrote? OpenGL is a specification meant to exist on many platforms: MS-Windows, Mac OS-X, Unix .. and even to a lesser extent mobile platforms in some cases [at the very least OpenGL ES, but some mobile do OpenGL as well]. A specification needs to specify what to do with the files, what is rendered, etc in a way possible on all these platforms. On the subject of font rendering, hardware font rendering is a highly non-trivial action. Indeed, once hinting gets into play, then without truly extraordinary and heroic efforts one must use the CPU to render a glyph... in truth, I think even with such efforts, once hinting is required, then one must still use a CPU.

    As for "better polygonal functions", do you mean triangulation or arbitrary polygons? If you want that, then use GLU to freaking do it for you.. or rip it out of Regal and call it a day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •