PDA

View Full Version : Opengl 3.0 Font library



chris2718
06-24-2009, 02:28 PM
Are there any font libraries that use non-deprecated Opengl calls? I assume no.
Which toolkit would be the best for updating to Opengl 3.0?

Stephen A
06-24-2009, 03:54 PM
Which programming language?

chris2718
06-25-2009, 01:04 AM
C++ on Linux

Stephen A
06-25-2009, 01:26 AM
In that case, modifying FTGL is probably the easiest solution. It builds display lists by default, but it should be easy to replace them with VBOs.

The other alternative is to use Pango and Pango-Cairo to take over text rendering completely. The advantage is great quality and excellent support for complex scripts; the disadvantage is that you'll have to do more work (cache the graphemes on textures, get the text extents and compose the graphemes into VBOs). It's also overkill if you only need support for latin scripts.

chris2718
07-12-2009, 06:36 PM
Thank you for the advice. I got FTGL working with Opengl 3.1.

I modified FTGL by adding classes for an Opengl 3.1 TextureFont and TextureGlyph and using shaders within those classes.
GL_ALPHA is deprecated for glTexImage*, so I use a RGBA buffer.

Filip
07-13-2009, 04:49 AM
Is this some code that you will be sharing? It would be really great to see essential libs like FTGL to become up to date and compatible with gl3.

chris2718
07-13-2009, 11:11 AM
I pulled out all the FTGL headers, changed a private constructor to be protected, and tightly integrated new classes with my own code. (Reused wrappers for shader programs, variables, etc.).
I do not plan on posting because it is integrated. If someone would like to modify FTGL directly:
Copy: FTTextureFontImpl and FTTextureFont to FTTexture3FontImpl and FTTexture3Font
Copy: FTTextureGlyphImpl FTTextureGlyph to FTTexture3GlyphImpl and FTTexture3Glyph
Modify those new files to use only Opengl 3 (add shaders).
Add friend to FTFont and FTGlyph

awhig
07-14-2009, 08:51 PM
Hi. I am new to FTGL. Not heard about it earlier. Does this library support raster fonts only? Just like MS TTFs? What about Vector fonts??

One of the posts mentions about complex scripts.Does this imply that Pango and Pango-Cairo also have support for multi-byte character fonts?
Eg: Symbolic , CJK ect ...

Just curious.

Ragnemalm
02-17-2010, 01:49 AM
awhig: FTGL is about vector fonts.

Are there any good alternatives to FTGL? My experience with FTGL is less than great. It renders nicely when it works but it is complex, messes up the system for me, installation in particular (I don't want to do it the Unix way on the Mac if I can help it). I know the problems can be solved but I don't like them to be there in the first place. I would prefer something simpler, smaller, something that integrates right inside my project without making it harder to manage. So, I am interested in whatever alternatives there are out there.

Right now I am working with some old TrueType sample code for the Mac from the 90's, adapted for OpenGL. Much smaller, pretty nice, but I havn't looked into its compatibility with OpenGL 3.0. I prefer it to FTGL, but there is a lot of old things to tidy up.

Speaking of raster fonts or texture fonts, that is much easier.