fontations icon indicating copy to clipboard operation
fontations copied to clipboard

Match hb-draw more precisely

Open rsheeter opened this issue 1 year ago • 0 comments

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.

rsheeter avatar Apr 29 '24 23:04 rsheeter