Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glyph: Treatment of empty values vs. None #27

Closed
madig opened this issue Jan 26, 2020 · 1 comment
Closed

Glyph: Treatment of empty values vs. None #27

madig opened this issue Jan 26, 2020 · 1 comment

Comments

@madig
Copy link
Collaborator

madig commented Jan 26, 2020

While (de)serializing a glif file's <outline> element, it is written if aGlyph.outline is Some(...) and not if it is None. The official(?) https://github.com/unified-font-object/ufoNormalizer/ will omit the element during "serialization" if it is empty. I think norad should do the same, but doing so makes the tests fail because no outline element is considered None and an empty one is Some(Outline { components: [], contours: [] }).

One way to handle this is to not de/serialize values if they are empty, assigning None instead if Some(empty_something).

Another option would be to treat some values with None and empty values as the same. This would need more thought because for some values, you need to distinguish between "no value set" and "empty value".

Yet another would be to not use Option in Glyph and test for emptiness when serializing.

@madig
Copy link
Collaborator Author

madig commented Jan 5, 2022

I removed a lot of Options and we skip empty contours and the like. This is now moot I think.

@madig madig closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants