googlefonts / googlefonts/fontations

Match hb-draw more precisely

Open
#887 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
826
Forks
75
Avg merge
22h 33m
Merged PRs (30d)
75

Description

As per https://github.com/googlefonts/fontations/pull/880#pullrequestreview-2029561181, "we should make sure we actually offer HB compatibility beyond 2 decimal places if we're going to promise it."

There are a couple of adjustments needed to match HB more precisely. For context #880 doesn't do the floating point math identically so while it matches at low precision (e.g. 2 decimal places for icons) there will be differences in output when the full floating point values are compared. Adjust the following:

* Advance, per https://github.com/googlefonts/fontations/pull/880#discussion_r1583727180
* Deltas, per https://github.com/googlefonts/fontations/pull/880#discussion_r1583734461
* Scale, per https://github.com/googlefonts/fontations/pull/880#discussion_r1583737726

For advance and deltas contrast with the sleipnir code in https://github.com/googlefonts/sleipnir/pull/15/commits/cae1b6320734a78bc3c4f115ec2a8569cd2d2ebf.

Deferring to this issue as #880 appears to be sufficient for icon use where a minute floating point difference doesn't really matter.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the three review discussions linked from #880 for the required Advance, Deltas, and Scale adjustments, then contrast the advance and delta behavior with the linked sleipnir commit. Verify that hb-draw matches HarfBuzz beyond two decimal places for all three values, including full floating-point comparisons.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.