Skip to content
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

Merged
merged 4 commits into from
Mar 14, 2024
Merged

[skrifa] tthint working checkpoint #832

merged 4 commits into from
Mar 14, 2024

Conversation

dfrg
Copy link
Member

@dfrg dfrg commented Mar 13, 2024

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 ([read-fonts] add support for the cvar table #831)

dfrg added 3 commits March 13, 2024 12:11
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)
Copy link
Member

@cmyr cmyr left a 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 {
Copy link
Member

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)

Copy link
Member Author

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)]
Copy link
Member

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...

Copy link
Member Author

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

@dfrg dfrg merged commit 5dba11d into main Mar 14, 2024
9 checks passed
@dfrg dfrg deleted the tthint-engage branch March 14, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants