TTF Font Libraries?

Started by
3 comments, last by blueshogun96 10 years, 11 months ago

In your opinion, what do you think is the most feasible library to use when rendering TTF fonts in OpenGL... in regards to cross platform development? My current project is in need of a TTF font library that's portable to Windows, Mac, *NIX, iOS, Android, etc. and right now, I primarily use MacOSX for development purposes.

My initial thought was to stick with SDL_ttf, but I don't know whether that requires your application to use SDL for gfx or not. My game doesn't use SDL (this time, and was hoping to keep it that way for my own personal reasons). Why do I want to use TTF fonts? Because Segoe is not a native font to non-Windows platforms. I guess I could always use Frutiger instead if necessary. What do you think?

Shogun.

Advertisement

Yes, SDL_ttf depends on SDL library.

Try this one: https://code.google.com/p/freetype-gl/

It depends only on freetype2 for ttf rasterization.

It works on all three desktop OS just fine. And for Android or iOS it should work with minimal changes for renderer (last time I checked they used desktop GL, not GL ES one).

I looked into freetype, but since it uses the programmable pipeline, I can't use it for iOS since I only have an iPhone 3G right now. It will be some time until I get an OGL ES 2.0 device in my hands.

In the mean time, I can easily use it for other OSes.

I use freetype (the original, not freetype-gl), and rasterize my fonts to a texture when my game start up. Then to draw text on the screen, I just generate quads with the font texture, one character at a time. Doesn't require anything special, and works on all platforms.

Oops, silly me. I was thinking of freetype-gl. Freetype itself is API independent.

Anyway, I also found this: http://nothings.org/stb/stb_truetype.h

Doesn't require any special libraries and appears to be portable to all OSes. I haven't tried it yet because I couldn't focus on code last night.

Shogun.

This topic is closed to new replies.

Advertisement