Font loading/Font Engines

Started by
2 comments, last by Drazgal 22 years, 7 months ago
I''ve reached the stage in my engine where I need to start work on fonts. I could just make a tileset holding characters on a bitmap and use that however I was wondering how easy it is to load fonts manually (not using the windows GDI functions as they are generally too slow). Could anyone point me towards infomation on the ttf font format or should I just stick with loading in bitmaps?
Advertisement
What graphics lib are you using? The DX8 SDK comes with a smurfy font class, that doesn''t use GDI for drawing the font( the class name is CD3DFont ). The font gets loaded(blt''d) to a surface, for later use.

If you opt for bitmaps, make each ''tile'' a power of 2, so you can take advantage of shift operators when building up the output( shifts are less expensive than multiplication or division ).

Using GDI to load a font is acceptable. However, try to avoid switching to GDI during rendering.





"It''s only after you''ve lost everything that you''re free to do anything." Tyler Durden
"It's only after you've lost everything that you're free to do anything." Tyler Durden
I just recently designed a textual handling module for my graphical wrapper (DX7). If you want I can send you the source or help you out with whatever you need. It''s done, but I haven''t had the chance to debug it or test it since school started. Either reply here or email me at OneHotCoconut@cs.com. It uses the method of loading the text images into bitmaps.


-Brent Robinson
"The computer programmer is a creator of universes for which he alone is the lawgiver...No playwright, no stage director, no emperor, however powerful, has ever exercised such absolute athority to arrange a stage or a field of battle and to command such unswervingly dutiful actors or troops." - Joseph Weizenbaum-Brent Robinson
http://www.wotsit.org has the file specs for font formats.

*Naku
APE

This topic is closed to new replies.

Advertisement