views:

270

answers:

2

Hi, I'm developing a cross-platform app w/ wxWidgets and opengl...

I'm not sure what the best way is to have fonts work in the glcanvas. I've tried using FTGL but I think the version included in Fedora 11 must be broken or something since I can't get the example code on the web site to compile. I could try using GLUT or SDL but I'm not sure I want to include those as dependencies...

EDIT: Turns out it's just a different version than the one that is documented on the web site and has a completely different API.

Even if I have a font library though, all the ones I've seen require a path to a font file, and I have no idea how to do that in a cross-platform manner.

A: 

Transliterate this tutorial to C++ and array-embed a gzipped copy of the GNU Unifont. QuesoGLC might also be an option, but watch out for performance gotchas.

genpfault
A: 

All platforms deal with fonts differently. There is no cross platform way to find fonts on a system. Alternatives include...

  • Package your fonts with your app so you know where they are.
  • Convert the fonts to a binary blob and embed them in your app.
  • Test for the OS and set the font path accordingly.
Henry