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


Bitmap Fonts: how to load 2 fonts

Recommended Posts

porquilho    122
Hello. I''ve looked on the forum about the subject but nothing (some were close). How can I load more that one font and change between them. I''ve made some tests but the frist font to be loaded is the one selected. Thanks... (Sorry about my english)

Share this post

Link to post
Share on other sites
biovenger    122
Well, each bitmap font must have a seperate display list (if you used NeHe''s tutorial, then that''s the ''base'' variable).

I''m guessing your problem is that you first load in a font onto a display list, and then rewrite the display list with the next font.

A very simplified font data structure would be as follows:

typedef struct
GLint glDisplayList;
char fontName[64];
float fontColor[4];

So for each font that you load in, you give ogl its own glDisplayList variable. Then when you do glCallLists, you use the font.glDisplayList display list, which should make GL choose the correct font.

Final Frontier Trader