-
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
[fontbe] Fix incorrect feature deltas w/ sparse glyph sources #779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a few little notes inline!
) | ||
.unwrap(); | ||
&local_model | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree it's annoying that we have two versions of this impl, let's open an issue to try and fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah. If we do consolidate these two implementations of resolve_variable_metric, maybe we could use a struct and let the method take &mut self
so we can store a cache of prebuilt variation models to reuse when we see the same set of locations, instead of making new ones each time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2c0e2f5
to
1fb958d
Compare
1fb958d
to
326a91c
Compare
…ocations only excluding the locations for intermediate or sparse layers which only contribute glyph sources, not metrics nor kerning
….locations() or else reuse the global StaticMetadata.variation_model, which will now only includes 'full' masters (i.e. defining kerning) for both UFOs+DS and .glyphs input. This fixes 'incorrect feature deltas when sparse' #407
326a91c
to
a55c7b2
Compare
will be fixed by #779
the same test that failed in #817 passed with this PR branch |
given that Colin already LGTM'ed this PR before I had added the test, I'll just go on and merge it. |
This fixes 'incorrect feature deltas when sparse' #407
The global StaticMetadata.variation_model now only includes 'full' masters (i.e. defining kerning) for both UFOs+DS and .glyphs input (previously this was the case only for the latter).
When we call
resolve_variable_metric
we make new sub-model when locations != global_model.locations(), or just reuse the global model when locations are equal -- which is currently basically always true for the common source formats (DS and glyphs) in the case of kerning, as the latter is meant to be "dense" and can only be specified for the "full" or globally-defined masters. However, we don't preclude the possibility that in the future other (or newer) source formats may define sparse kerning data, and our fontbe is ready for that.I added a test file in #776, and verified locally that this patch fixes the issue #407, but
I haven't find the time to make an actual unit test yet. If I don't make it in time, you should be able connect the dots...EDIT: I have added a test case #817