MFEK / glifparser.rlib

A parser and writer for UFO `.glif` files.
Other
8 stars 6 forks source link

<unicode> is of wrong type #7

Closed ctrlcctrlv closed 3 years ago

ctrlcctrlv commented 3 years ago

This is my fault obviously, I'm just documenting it so I don't forget.

https://github.com/MFEK/glifparser.rlib/blob/1d90286349c00fbadd362f2eb03cb260fa1eb26b/src/lib.rs#L182

As just discovered at ctrlcctrlv/FRBAmericanCursive#2 by @dscorbett, glifparser is wrong about the type of unicode.

It should actually be an Option<Vec<Codepoint>>. It can also be None, if it's None it's an unencoded glyph (used for e.g. OTLayout, Graphite, etc.)

I will fix this before FRBAmericanCursive v1.3, whenever that is. Fixing the round caps in MFEKmath is obviously something else that needs to be done for the next release of that font, so I'll bundle these bugs together into a release.

ctrlcctrlv commented 3 years ago

Oh wait I remember now. Codepoint is implemented as an enum. So that's probably also problematic and needs to change. Obviously it would make no sense to have vec![Codepoint::Undefined, Codepoint::Hex(0x20)]. That's invalid per OT standard, UFO standard, every standard really. So Codepoint itself needs to just become a dummy around char, (or be dropped entirely, although I do like its Display impl), and then it can be Option<Vec<Codepoint>>.

ctrlcctrlv commented 3 years ago

I fixed this ages ago.