-
Notifications
You must be signed in to change notification settings - Fork 13
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: get Vecs out of Options? #92
Comments
Yes, it's gross. my intention was to losslessly adhere to the UFO spec, and represent all fields that were optional as I defer to you, here; if you think it makes sense to use an empty vec to represent a missing field, and not serialize empty vecs, that sounds good to me. |
FWIW, ufoLib2 and defcon use empty lists for the above. |
Happy to see this change, it will be a nice ergonomics improvement. |
I just noticed: in the same vein, advance width and height are kept behind Option. The spec says https://unifiedfontobject.org/versions/ufo3/glyphs/glif/#advance, i.e. both could be regular fields defaulting to 0. There has been some thinking about changing 0 though: unified-font-object/ufo-spec#95 -- but @anthrotype decided to not go ahead with it? |
this also sounds good, the only reason these various things are awkward is because i did not feel knowledgeable enough to take any liberties. |
Good thing you now have extreme prejudice on your team. |
Currently, contours, components, anchors, codepoints and guidelines are Vecs hidden behind an
Option
, which seems to be because they allow for non-existence of attributes in a glif file. This leads to code likewhich I don't find especially, uh, ergonomic? Same goes for anchors, etc. I'd rather have a
Since empty Vecs can just not be serialized (and don't alloc until they have one member), I don't think making them optional holds semantic value? Same for
lib
maybe?Related to #27.
The text was updated successfully, but these errors were encountered: