-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workingwaiting for releasemerged into main, yet not on PyPImerged into main, yet not on PyPI
Description
TL;DR: Font indices go OOB when writing fonts
Reported on Windows (ty @DragonMoffon) and confirmed on Linux.
Replication steps:
- Install
mainbranch from source in a fresh venv - Go to https://int10h.org/oldschool-pc-fonts/download/
- Download the latest font pack
- Navigate into the
ttf - Mx (mixed outline+bitmap)folder of the zip - Extract
MxPlus_IBM_BIOS.ttf fontknife convert -g " ! ~\$%&'()+*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\'abcdefghijklmnopqrstuvwxyz{|}~ ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " /home/user/Downloads/MxPlus_IBM_BIOS.ttf test.png- Observe issue below:
$ fontknife convert -g " ! ~\$%&'()+*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\'abcdefghijklmnopqrstuvwxyz{|}~ ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " /home/user/Downloads/MxPlus_IBM_BIOS.ttf test.png
Traceback (most recent call last):
File "/home/user/Projects/Fontknife/.venv/bin/fontknife", line 8, in <module>
sys.exit(main())
File "/home/user/Projects/Fontknife/fontknife/frontend/__main__.py", line 117, in main
args.callback(font, output_path, output_kwargs)
File "/home/user/Projects/Fontknife/fontknife/frontend/commands/convert.py", line 20, in main
write_font(font, output, **output_args)
File "/home/user/Projects/Fontknife/fontknife/formats/__init__.py", line 105, in write_font
writer.write_output(font, output, **kwargs)
File "/home/user/Projects/Fontknife/fontknife/formats/writers/spritesheet.py", line 62, in write_output
paste_bbox = grid_mapper.bbox_for_sheet_index(index)
File "/home/user/Projects/Fontknife/fontknife/formats/common/spritesheet.py", line 193, in bbox_for_sheet_index
coord = self.coord_for_sheet_index(index)
File "/home/user/Projects/Fontknife/fontknife/formats/common/spritesheet.py", line 185, in coord_for_sheet_index
raise e
KeyError: 'Index 96 not in grid'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwaiting for releasemerged into main, yet not on PyPImerged into main, yet not on PyPI