Archived

This topic is now archived and is closed to further replies.

Cross-platform fonts

This topic is 5382 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey (again), I''m trying to add font support to my engine. I don''t want to use wglCreateFontLists() (or whatever it is) because that''s dependant on the windows platform. Is there any decent method of creating fonts in GL, short of loading in a texture full of characters and extracting rectangles from it? Superpig - saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Share this post


Link to post
Share on other sites
If you want to have truly platform independent fonts you are going to have to use a cross-platform lib like freetype (not positive of the name) or develope you own font system. For my system I'm using the windows API to create textures that contain glyphs (characters) for a specific fonts at various sizes. Then I'll generate tex coords for each glyph. This information is then stored in a custom file format. The only drawback is your tool to create the custom format is Windows specific since it calls the Window API.

If you want to go all the way to platform independance with the tools you could read the truetype font files (.ttf) and use your own code to create the glyphs on the textures. This requires you know how to read the .ttf files. I'm sure it can be googled.

Journal

[edited by - Garrland on March 25, 2003 9:56:09 AM]

Share this post


Link to post
Share on other sites
Hmm... ok, thanks. I think I''ll just stick with a plain monospaced bitmap for the time being - I don''t expressly need to switch between fonts, it would just be good if I could.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Share this post


Link to post
Share on other sites
The red book (http://fly.cc.fer.hr/~unreal/theredbook/) has some stuff about (non-monospaced) bitmap fonts in it. I am using a system like that myself, but i guess i might look into true type when i get serious about my GUI.

Marijn

Share this post


Link to post
Share on other sites