Archived

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

Lord Maz

Font engine

Recommended Posts

I''m trying to make a not too advanced but working font engine that I can use it my games later on, it currently loads a bmp with all the characters and scans for the size and so on automaticly, I only need to write what it should say and where to put it.. but it can only use simple characters, A-Z, a-z, 0-9.. I''m not sure how I should do if I want to add characters such as ".", "," and the famous swedish "Å", "Ä" and "Ö":s to it without too much change.. VC++ won''t let me write dots and stuff in the character strings.. any font engine gurus in this forum who wants to share their unlimited knowledge?

Share this post


Link to post
Share on other sites
In the font engine I wrote, I used an array of RECT''s for the letters. The letters had to be in the same order on the bitmap, but not necessarily the same size. This way, if I ever wanted to add an extra character to the font, all I would have to do is make the array bigger.
If you want a way to represent swedish letters in a string, you can pick a character, ie: "|" (don''t use "\" !!!). Then when you are parsing the string to draw it on the screen, you can get your routine to read one letter further if it comes up to the character you chose as your special character. Then the characters that come after the symbol you chose would determine what special character the string wants. This system is the same as the c++ "escape sequences".
I am not sure if this is the kind of answer you were looking for or not. If you want my help any more, reply or e-mail me.

Share this post


Link to post
Share on other sites