-
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
build MVAR table from variable GlobalMetrics #648
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anthrotype
force-pushed
the
mvar
branch
5 times, most recently
from
December 18, 2023 10:44
55731da
to
80a35f4
Compare
rsheeter
reviewed
Dec 18, 2023
rsheeter
reviewed
Dec 18, 2023
rsheeter
reviewed
Dec 18, 2023
rsheeter
reviewed
Dec 18, 2023
rsheeter
reviewed
Dec 18, 2023
Comment on lines
+236
to
+242
assert_eq!(mvar.version(), MajorMinor::VERSION_1_0); | ||
assert_eq!(mvar.value_records().len(), 1); | ||
|
||
let rec = &mvar.value_records()[0]; | ||
assert_eq!(rec.value_tag(), Tag::new(b"xhgt")); | ||
assert_eq!(rec.delta_set_outer_index(), 0); | ||
assert_eq!(rec.delta_set_inner_index(), 0); |
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.
Optional, I continue to greatly prefer the test output of this sort of thing done as one assert, e.g.
assert_eq!(vec![(Tag::new(b"xhgt"), 0, 0),], mvar.value_records().iter().map(...)]
I've always found it much easier to troubleshoot and harder to forget to assert the length
rsheeter
reviewed
Dec 18, 2023
rsheeter
reviewed
Dec 18, 2023
rsheeter
reviewed
Dec 18, 2023
rsheeter
approved these changes
Dec 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #531
This matches fontmake's and fonttools' MVAR tables for a bunch of fonts I tested locally, will add more thorough unit tests soon.
Note how in ufo2fontir and glyphs2fontir we make sure that non-default global metrics masters are not sparse (the default metrics all populated based on basic metrics like UPEM or italic angle), that's because when varLib merges them into MVAR, it starts with whole OS/2 or post etc. tables, so it is never the case that, e.g., only the ascender or the descender provides masters.
Our fontir GlobalMetrics allow for sparse-ness but we currently want to match the output of fontmake in this regard, until maybe some new source format is designed for sparse variable-first use cases.