googlefonts / vf2symbols

Apache License 2.0
4 stars 6 forks source link

"Must have exactly one ligature lookup" error #7

Open davelab6 opened 3 years ago

davelab6 commented 3 years ago

Fails on https://github.com/Ancymonic/Signika/tree/master/fonts/signikavf

$ vf2symbols Signika\[NEGA,wght\].ttf 
I0430 13:23:47.745712 4575391232 vf2symbols.py:158] Generating build/build.ninja
Traceback (most recent call last):
  File "/Users/dcrossland/Library/Python/3.9/bin/vf2symbols", line 33, in <module>
    sys.exit(load_entry_point('vf2symbols', 'console_scripts', 'vf2symbols')())
  File "/Users/dcrossland/src/github.com/googlefonts/vf2symbols/src/vf2symbols/vf2symbols.py", line 175, in main
    app.run(_run)
  File "/Users/dcrossland/Library/Python/3.9/lib/python/site-packages/absl/app.py", line 303, in run
    _run_main(main, args)
  File "/Users/dcrossland/Library/Python/3.9/lib/python/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/Users/dcrossland/src/github.com/googlefonts/vf2symbols/src/vf2symbols/vf2symbols.py", line 163, in _run
    _write_vf_symbol_builds(nw, root_font, font_files)
  File "/Users/dcrossland/src/github.com/googlefonts/vf2symbols/src/vf2symbols/vf2symbols.py", line 137, in _write_vf_symbol_builds
    for icon_name in icon_font.extract_icon_names(
  File "/Users/dcrossland/src/github.com/googlefonts/vf2symbols/src/vf2symbols/icon_font.py", line 61, in extract_icon_names
    for first_glyph_name, ligatures in _ligature_roots(ttfont).items():
  File "/Users/dcrossland/src/github.com/googlefonts/vf2symbols/src/vf2symbols/icon_font.py", line 41, in _ligature_roots
    assert len(lookups) == 1, "Must have exactly one ligature lookup"
AssertionError: Must have exactly one ligature lookup
$
rsheeter commented 3 years ago

This particular limitation is purely me being lazy (the font I was testing with had one lookup and I was in a hurry) but in general beware that this tool currently assumes the conventions of what I'll call a Google-style icon font.

Was the idea to generate SF Symbols for some of the icon shapes from Signika?

rsheeter commented 3 years ago

It may make sense to approach slightly differently: write a script to make Signika "look like" a Google style icon font and then tools like this will Just Work