Skip to main content
GameDev.net gamedev.net
🔒 Locked

Unicode Strings and Bitmap Fonts

Started by PrincessDaisy Mar 30, 2006 at 5:05 PM 0 replies 550+ views
Original Post
PrincessDaisy
PrincessDaisy
I am in the process of converting some code to unicode based strings rather than char, and I am just looking for peoples opinions on how to deal with bitmap based fonts. When I was using char based strings, I could create a simple texture with the required characters and use that for rendering. Obviously, I cannot do this with unicode characters. How have people solved this in the past and what solutions did you come up with? Thanks Daisy
________________________
Pretty In Pink
Anon Mike
Anon Mike
What you do is to have some method of converting character values to glyph indexes. For example you might map 'A' to glyph #1 in your bitmap font.

Exactly how you do the mapping is up to you. If you want a real-life example, here all all the gory details of how truetype fonts do character to glyph mapping. In particular the sections called "Format 4" and "Format 12".
-Mike

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.