Results 1 to 2 of 2

Thread: State of the text drawing solutions

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2010
    Posts
    1

    State of the text drawing solutions

    I'm trying to find the best way to display text in my OpenGL program. My objectives are:

    - Solution should be cross platform: Mac OS, Windows, Linux.
    - Standard system font types should be supported - no proprietary formats.
    - Small text size should draw clearly (without anti-aliasing).
    - 2D text is a must, 3D is nice but not required.

    I know the OpenGL is a hardware abstraction layer and does not support text drawing directly. I also know that almost all OpenGL programs do need to display some text, and I would expect some good standard solution to emerge. Looking at font survey font survey reveals that the situation is very lame. Most libraries mentioned are not in active development, some URLs are broken. I checked each library on the list - here is what I discovered:

    GLX: Unix only
    GLC: SGI only
    GLUT: very limited font support, no mention of Mac support, last updated 1998 (?)
    Texture Mapped Text: several solution mentioned here, broken URLs. glFont last updated 2005 does not seem like an actively developed library. FTN is TXF specific.
    GLTT: Last updated 2001. Mailing list full of spam. Does not seem like an actively developed library.
    WGL: Windows only.
    GLF: Uses proprietary font format, URL broken.
    FTGL: This looks like the only actively developed cross platform working solution. Mailing list active but many posts remain unanswered. Requires FreeType2.

    So I'm currently evaluating FTGL, but would like to learn from other people experience before committing. Rolling my own solution using native OS API is also possible.

    Thanks for any advice,

    Herman

  2. #2
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,678

    Re: State of the text drawing solutions

    - Small text size should draw clearly (without anti-aliasing).
    Small text looks pretty bad without antialiasing. Not unless you create specific glyph bitmaps for specific small text sizes, and that's usually not done by most standard font formats.

    I also know that almost all OpenGL programs do need to display some text, and I would expect some good standard solution to emerge.
    Well, most people tend to roll their own, using FreeType or some other glyph drawing system to render the glyphs to a bitmap, which then gets uploaded into a texture or whatever and rendered as needed. This isn't particularly difficult code (for simplistic cases of course. Full Unicode layout isn't so simple, and none of the public libraries have that), so it isn't something that people use often enough to matter. And to be honest, the layout code is the hardest part; simply rendering a glyph is not exactly demanding. It's getting the right glyphs in the right order that's tricky.

Similar Threads

  1. Text drawing in GL 4.3
    By sam_thedancer in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-19-2013, 07:09 PM
  2. Drawing Text
    By Atomic_Sheep in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-10-2012, 11:47 AM
  3. Text drawing
    By t3jem in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 06-09-2005, 10:49 PM
  4. CPW & drawing text using TTF
    By oshapir in forum OpenGL: General
    Replies: 2
    Last Post: 09-01-2002, 04:53 AM
  5. Drawing text
    By nnaro in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 05-11-2000, 10:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean