-
Notifications
You must be signed in to change notification settings - Fork 24
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: graphics state #761
Conversation
First of a series of TrueType hinting patches. This one models the TT "graphics state" which is essentially all of the data involving outlines, measurement and rounding. Includes a tiny math module that provides support for working with fixed point values as raw i32s. This is not ideal but exists from the initial port from FreeType and will require some time and attention to correct. This will need to be deferred to a later time.
} | ||
|
||
impl Default for RetainedGraphicsState { | ||
fn default() -> Self { |
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.
Is there a reference for where the defaults came from?
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.
Added links to graphics state summary table in the spec which lists the default values.
(Wrapping(u.0 as i32) * sx / Wrapping(4)).0, | ||
(Wrapping(v.0 as i32) * sy / Wrapping(4)).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.
Some of these seems complex enough to warrant testing
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.
The normalize function is particularly nasty :/ Added test cases for mul_div_no_round
, mul14
and normalize14
with values generated by their respective FT functions. These also include sanity checks that compute the result in floating point and test with a tolerance.
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.
Two broad comments:
- Testing seems light
- The detailed references are most appreciated
- add links to table containing default values for graphics state - add tests for new fixed point math functions
First of a series of TrueType hinting patches.
This one models the TT "graphics state" which is essentially all of the data involving outlines, measurement and rounding.
Includes a tiny math module that provides support for working with fixed point values as raw i32s. This is not ideal but exists from the initial port from FreeType and will require some time and attention to correct. This will need to be deferred to a later time.