mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-12 16:19:29 -10:00
bitmapfont.bin and bitmapfont.bmp are the source forms of the glyph
data that gfx/bitmapfont.c compiles in: the .bin is the raw 1792
bytes, the .bmp a 256x256 4bpp sheet of 16x16 cells that can be opened
in an image editor. Neither is read at build time or at runtime.
They had drifted. The C array disagreed with the .bin in 104 bytes
across 36 glyphs - %, &, @, ~ and a run through the high Latin-1 range
- because the array had been edited directly and the other two forms
left behind. A source file that disagrees with what it claims to
generate is worse than no source file.
Regenerate both from the C array, which is what actually ships, and
move them to tools/ where build-time inputs belong rather than gfx/
where they looked like part of the driver.
Add tools/bitmapfont_convert.py, which produced them and can convert
in either direction:
bitmapfont_convert.py export bitmapfont.c --bin F --bmp F
bitmapfont_convert.py import bitmapfont.bmp --carray F
bitmapfont_convert.py check bitmapfont.c bitmapfont.bin bitmapfont.bmp
'check' verifies all three agree, and is what would have caught the
drift. The importer round-trips the exported .bmp back to a
byte-identical array, so editing the sheet and regenerating is now a
supported path rather than folklore.
Also drops the references to these two files from seven Apple Xcode
projects. They pointed at gfx/drivers_font_renderer/, which no longer
holds them.
1.8 KiB
1.8 KiB