-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merge names from FEA into final table #1133
Conversation
fontbe/src/features.rs
Outdated
@@ -56,6 +58,8 @@ pub use marks::create_mark_work; | |||
|
|||
const DFLT_SCRIPT: Tag = Tag::new(b"DFLT"); | |||
const DFLT_LANG: Tag = Tag::new(b"dflt"); | |||
// https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids | |||
const FIRST_NON_RESERVED_NAME_ID: u16 = 256; |
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.
I think I've seen this twice, I suggest putting it in fontdrasil which both fea-rs and fontbe are entitled to reference
resources/scripts/ttx_diff.py
Outdated
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.
Nit: this would have been nicer as it's own PR
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.
As a compromise it's in its own commit 😬
Previously we were dropping these on the floor. The strategy here is simple enough: if FEA compilation generates any extra tables we now stash these in the context, and then we can merge them (so far, name only) into the final binary at the end.
Previously we were just dropping them on the floor.
This is one of a number of cases where it is possible for FEA to generate a table that is also generated (or could be generated) through the main compilation process.
This introduces an overall strategy for handling this: when FEA generates these extra tables we now stash them in the main context, where we can reference them when building the final font.
This patch also uses this mechanism to merge name records generated from FEA into the main name table; this looks to get us at least a +7 on crater.
As a bonus this includes a commit that fixes a little bug in ttx_diff where we were accidentally sorting name ids as if they were lookup ids, and which very briefly had me doubting my sanity.