As far as I understand the code, OpenRA normally takes TTF fonts and converts a certain range of glyphs into Sprites using FreeType, which are then used in the DrawText*(..) and Measure(..) methods.
Fonts already in bitmap form don't need the FreeType render step, so I was wondering what the 'correct' approach here would be to support non-freetype-needing SpriteFonts? One approach could be an interface between users of SpriteFont and actual SpriteFont implementations, another could be taking the initialization code out of SpriteFont and make it purely a glyph container with added DrawText etc methods.
Any ideas?
SpriteFont and non-'freetype based' fonts
How to fit bitmap fonts in there?
Yes, but in this case it's a decoded TD/RA95 'fnt' file. I've implemented a FntReader to be able to use the original fnt fonts from RA95 in OpenRA and am now wondering as to how to convert the bitmaps to glyphs SpriteFont can use.chrisf wrote: ↑You can use most popular bitmap font formats with FreeType as well.