justanotherfoundry / freemix-glyphsapp

Scripts to be used with the Glyphs font editor.
GNU General Public License v2.0
81 stars 23 forks source link

Error Expand Kerning #40

Open uebele opened 2 years ago

uebele commented 2 years ago

I get an error message:

Traceback (most recent call last): File "Expand Kerning.py", line 34 if value < 77000: TypeError: '<' not supported between instances of 'NoneType' and 'int'

Glyphs 3133

eweracs commented 1 year ago

I get the same. Adding a check like if value and value < 77000 resolves the issue (same for existing_value and exception_value).

This is fixed in pull request 35d4772829c6a87bbc0c49d37e39ebfbc32f8d7d

schriftgestalt commented 1 year ago

font.kerningForPair() will always return None if there is no pair so the check could be

    if value is not None:

Other API (specifically the core objc methods) might return NSNotFound. But in this case the check agains Null is fine.

eweracs commented 1 year ago

That's what I wrote, if value is not None is the same as if value, or am I mistaken?

Ah, wait. if value is 0, that would fail the check. So if value is not None is correct. Thanks!