views:

241

answers:

2

Hi,

I'm trying to add text rendering to a Carbon OpenGL app I'm developing for OS X.

Since the aglUseFont is now deprecated, I'm looking for another way to add text as well as be able to query the glyph properties (i.e. width, height, spacing, etc)

So far I've investigated CoreText and ATSUI but both without much luck.

Please help me!!

Thanks!

+2  A: 

You could take a look at the FreeType project: it's an open source, portable, font rendering engine that supports OpenType, TrueType, Postscript Type 1, and other formats. There are several open source integrations of FreeType with OpenGL; see for example OGLFT. Or you could just roll your own: it's not hard to make FreeType generate bitmaps in some suitable pixel format, and then pass these bitmaps to glTexImage2D.

Gareth Rees
+1  A: 

In the end I just went with good old glBitmap for my fonts.

Found an apple dev sample that created rendered each character and got its pertinent info (width, height, offset, etc.)

However, if I get the time to do some more work on it later, I plan on using the FreeType project as was suggested above.

Thanks!

mwahab