fontgoggles icon indicating copy to clipboard operation
fontgoggles copied to clipboard

Trouble compiling features when "languagesystem math dflt;" has been defined

Open BoldMonday opened this issue 1 year ago • 3 comments

(I realise this problem might not be FontGoggles-specific but an update will be necessary when this issue has been fixed upstream.)

Working on a UFO file containing features with the following declarations for languagesystems:

languagesystem DFLT dflt;   # Default
languagesystem latn dflt;   # Latin default
languagesystem cyrl dflt;   # Cyrillic default
languagesystem grek dflt;   # Greek default
languagesystem math dflt;

FontGoggles is not able to compile the features, reporting:

Traceback (most recent call last):
  File "fontgoggles/compile/ufoCompiler.pyc", line 52, in compileUFOToFont
  File "ufo2ft/featureCompiler.pyc", line 133, in compile
  File "ufo2ft/featureCompiler.pyc", line 285, in setupFeatures
  File "ufo2ft/featureWriters/baseFeatureWriter.pyc", line 128, in write
  File "ufo2ft/featureWriters/kernFeatureWriter.pyc", line 118, in setContext
  File "ufo2ft/featureWriters/kernFeatureWriter.pyc", line 260, in _groupScriptsByTagAndDirection
  File "fontTools/unicodedata/__init__.pyc", line 204, in script_horizontal_direction
KeyError: 'Zmth'

It appears that the line languagesystem math dflt; is the culprit here. If I remove that line there is no problem.

BoldMonday avatar May 07 '24 12:05 BoldMonday

possibly related https://github.com/fonttools/fonttools/issues/3013

anthrotype avatar May 07 '24 12:05 anthrotype

i think the error you're seeing was fixed in ufo2ft already see https://github.com/googlefonts/ufo2ft/pull/717 (it should be in since v2.31.0 at least)

anthrotype avatar May 07 '24 12:05 anthrotype

I will try to release an update with updated dependencies soon.

justvanrossum avatar May 07 '24 15:05 justvanrossum

This should be fixed by #410, part of the 1.8 release: https://github.com/justvanrossum/fontgoggles/releases/tag/v1.8

justvanrossum avatar May 25 '24 17:05 justvanrossum