Skip to content

Fix brace layer parsing to force int where there may be strings#783

Open
jpt wants to merge 1 commit intogooglefonts:mainfrom
jpt:fix-string-brace-layers
Open

Fix brace layer parsing to force int where there may be strings#783
jpt wants to merge 1 commit intogooglefonts:mainfrom
jpt:fix-string-brace-layers

Conversation

@jpt
Copy link

@jpt jpt commented Apr 1, 2022

I was running into this error while converting a file that uses brace layers:

    brace_layers.sort(key=lambda x: tuple(x.location.values()))
TypeError: '<' not supported between instances of 'str' and 'int'

The issue was that my Glyphs file had some integers in its brace layer axis locations, along with some strings. I'm not sure how or why this divergence occurred, but I think it would make sense to force an int for these values.

@anthrotype
Copy link
Member

i'm not sure the fix is correct. Can you provide a reproducer?

@jpt
Copy link
Author

jpt commented May 4, 2022

I'll work on putting together a minimal file that can reproduce this, thanks for looking into it

@bramstein
Copy link
Contributor

For what it is worth: we also ran into this issue with one of our families. It seems the most recent (unreleased) Glyphs version 3.2 automatically fixes this upon saving.

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

Successfully merging this pull request may close these issues.

3 participants