-
Notifications
You must be signed in to change notification settings - Fork 28
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
[skrifa] tthint working checkpoint #832
Conversation
This wires up the TrueType hinting code in a working state that matches FreeType for all of Noto and Google Fonts collections with the following exceptions: 1. Some fonts with buggy bytecode 2. Fonts with control value programs that are not idempotent over multiple runs (these are newish Win11 fonts) 3. Variable fonts with a cvar table (#831)
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.
you're wandering in the wilderness; all I can do is stand on a distant hill, holding a torch.
@@ -151,7 +151,11 @@ impl<'a> Engine<'a> { | |||
pub(super) fn op_spvfs(&mut self) -> OpResult { | |||
let y = self.value_stack.pop()? as i16 as i32; | |||
let x = self.value_stack.pop()? as i16 as i32; | |||
let vector = math::normalize14(x, y); | |||
let vector = if x == 0 && y == 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.
totally unnecessary but you could write this as, if (x, y) == (0, 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.
yes, I like this better
@@ -47,6 +47,45 @@ pub struct Engine<'a> { | |||
} | |||
|
|||
impl<'a> Engine<'a> { | |||
#[allow(clippy::too_many_arguments)] |
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 mean, clippy has my sympathies here...
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.
and mine... I actually wrote the clippy allow before the arguments because I knew what was coming. I'll likely just make all the fields in this thing public in the future anyway. I have aspirations to expose the guts of the hinting code to allow for debugging in which case users will likely want to poke at all the internal state
This wires up the TrueType hinting code in a working state that matches FreeType for all of Noto and Google Fonts collections with the following exceptions: