5

I need to display TrueType fonts in OpenGL, in a C program. This needs to work on fairly old hardware, so something using the old fixed function pipeline rather than making heavy use of shaders would be good. Can someone suggest a good alternative to FTGL?

Reasons FTGL doesn't quite work for me:

  • The C API leaves out an important feature of the C++ API: the ability to get a bounding box for a "partial string" from a layout (it should take a char pointer and a length argument, rather than just taking a char pointer and reading to the first null character).

    I need this feature so I can determine where pointer events fall within a string, because I need to implement caret insertion and text selection capability.

  • The font rendering doesn't look as nice as more modern techniques, like the technique discussed at http://contourtextures.wikidot.com/.

    I can live without this rendering technique, but it would be nice to have.

0
0

I'm using freetype-gl for now. It uses contour textures, they look great. It also uses shaders, but they seem to work alright on the hardware I tested on. It's pretty rough around the edges but I think it will handle my use cases.

0

stb_truetype by Sean Barrett is a Public Domain true type implementation in a single C (or C++) header.

There is some design information about it here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.