CleverRaven/Cataclysm-DDA — pull request #4506 by Gatleos (2013-11-19 21:35:27+00:00)
Title: Adds support for bitmap and png "fonts"

This is basically feature-complete, but could probably use some heavy optimization to speed it up and reduce the memory footprint. I'm just throwing it out now in case anybody had suggestions for improvements.

This should allow Cataclysm to load in image files (.bmp or .png) in place of font files for curses mode. Obviously it will only work in the SDL version. It's perfectly compatible with tiles mode, and doesn't appear to have a larger memory footprint than loading a font and caching glyphs. To use an image font, just put it in the fonts folder and put its name (with file extension!) in FONTDATA. Set the font dimensions as normal.

There are a few issues that need to be worked out:
* It's about time the FONTDATA file was made a little easier to use, now that I've complicated the way it works a bit (image files use an extension, font files don't). It should probably be converted to JSON and made more readable.
* Currently, Cataclysm will load in an image file and remove a magenta (255,0,255) background from it. Then it makes 15 copies, one for each color of ascii character. This process could probably be optimized, since Cataclysm appears to only use the first 128 ascii characters. I need confirmation on this.