Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building COLR v0 OTF font #1028

Open
gredler opened this issue Sep 16, 2024 · 1 comment
Open

Error building COLR v0 OTF font #1028

gredler opened this issue Sep 16, 2024 · 1 comment

Comments

@gredler
Copy link

gredler commented Sep 16, 2024

The changes in #610 assume that the font has a "glyf" table, which OTF fonts do not.

gftools builder sources/config.yaml

[...]

[42/60] fix
FAILED: ../fonts/otf/MyFont-ExtraBold.otf 
/home/user/myfont/.venv/bin/python3 -m gftools.builder.jobrunner gftools-fix-font -o ../fonts/otf/MyFont-ExtraBold.otf  /tmp/tmpf2k52f6_ 

Command failed:
gftools-fix-font -o ../fonts/otf/MyFont-ExtraBold.otf /tmp/tmpf2k52f6_

INFO:gftools.fix:Updated license strings
INFO:gftools.fix:Added GASP and prep tables for unhinted font
Traceback (most recent call last):
  File "/home/user/myfont/.venv/bin/gftools-fix-font", line 8, in <module>
    sys.exit(main())
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/gftools/scripts/fix_font.py", line 50, in main
    font = fix_font(font, args.include_source_fixes, args.rename_family, axis_dflts)
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/gftools/fix.py", line 914, in fix_font
    result = fixer(fixed_font)
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/gftools/fix.py", line 808, in fix_colr_font
    return fix_colr_v0_gid1(ttfont)
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/gftools/fix.py", line 702, in fix_colr_v0_gid1
    glyf_table = ttfont["glyf"]
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/fontTools/ttLib/ttFont.py", line 455, in __getitem__
    table = self._readTable(tag)
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/fontTools/ttLib/ttFont.py", line 462, in _readTable
    data = self.reader[tag]
  File "/home/user/myfont/.venv/lib/python3.10/site-packages/fontTools/ttLib/sfnt.py", line 108, in __getitem__
    entry = self.tables[Tag(tag)]
KeyError: 'glyf'
@gredler
Copy link
Author

gredler commented Sep 16, 2024

Is there a way to configure the tool to skip some fixes (like this one)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant