Last change of the day. I’ve conflated the text font and glyph font into the same bitmap, saving about 30K off the final ROM size. Initially tried putting the glyphs at the start of the file, but ran into problems with this - char(10) and char(13) are line feed and carriage return, and there are a few other non-printing characters that appear regularly in text. I’ve shifted the glyphs to char(128) onwards - the extended ASCII set isn’t used very often.
In order to achieve this, I’ve made a few changes:
- TextWriter has another function for printing chars
- GraphicsPort has another function for printing chars
- The base Gadget class contains a Font pointer
- All gadgets accept a Font pointer in their constructors
- Removed all references to _glyphFont
Just need to have a setFont(Font* font) method on there now.
Gadget::setFont() and Gadget::getFont() are now done. Woopsi creates its own font and deletes it in its destructor if no font is specified in its constructor. Also, passing in NULL as the font parameter is possible on some of the gadgets (I need to work out which ones don’t need a font for initialisation and make it an optional parameter). Any gadgets with a NULL font are automatically sent a pointer to their parent’s font when they are added to the parent’s child vector.