robotools / fontParts

The replacement for RoboFab
MIT License
132 stars 44 forks source link

.isCompatible throws error lib/fontObjects/fontPartsWrappers.pyc:1341: DeprecationWarning: 'Glyph.index' #683

Closed JakobFangmeier closed 1 year ago

JakobFangmeier commented 1 year ago

steps to reproduce in RoboFont:

f = CurrentFont()

i1 = RGlyph()
i2 = RGlyph()

i1.appendContour(f["a"][0])
i2.appendContour(f["a"][0])

print(i1.isCompatible(i2))
justvanrossum commented 1 year ago

To be precise: these are warnings. The code otherwise seems to work.

Full output in RF 4.3:

/Applications/RoboFont-4.3.app/Contents/Resources/lib/python37.zip/lib/fontObjects/fontPartsWrappers.py:1325: DeprecationWarning: 'Glyph.index'
/Applications/RoboFont-4.3.app/Contents/Resources/lib/python37.zip/lib/fontObjects/fontPartsWrappers.py:1325: DeprecationWarning: 'Glyph.index'
/Applications/RoboFont-4.3.app/Contents/Resources/lib/python37.zip/lib/fontObjects/fontPartsWrappers.py:1325: DeprecationWarning: 'Glyph.index'
/Applications/RoboFont-4.3.app/Contents/Resources/lib/python37.zip/lib/fontObjects/fontPartsWrappers.py:1325: DeprecationWarning: 'Glyph.index'
(True, [OK] Glyph: [None] + [None])
typemytype commented 1 year ago

deprecated warning will be removed from RF.

FYI it happens here https://github.com/robotools/fontParts/blob/master/Lib/fontParts/base/compatibility.py#L61-L62

As the internal RF fontParts has a deprecated glyph.index attribute the compatibility reporter used it.