googlefonts / sleipnir

Memory safe implementations of Google Fonts specific font manipulations.
Apache License 2.0
1 stars 1 forks source link

Confirm hb-draw style off-curve first resolution helps #5

Closed rsheeter closed 6 months ago

rsheeter commented 6 months ago

https://github.com/googlefonts/fontations/pull/818 appears to make 2/3 of our svg paths match. The last one is very close, for some reason the legacy code isn't putting in the line on the final Z:

M...Q513,-720 480,-720Z
M...Q513,-720 480,-720L480,-720Z
                      ^ a final line, but only for man.svg!

EDIT: ^ is fixed, all examples now match. Ty @anthrotype for pointing out the key code in hb-draw.

anthrotype commented 6 months ago

for some reason the legacy code isn't putting in the line on the final Z:

was the "legacy" code using fonttools pens? if so, i'm pretty sure this related to my comment about handling of implied closing line when converting points into segments: https://github.com/googlefonts/fontations/pull/818#discussion_r1521188624

you should match that behavior in skrifa if you care about losslessly converting between points and segments

anthrotype commented 6 months ago

was the "legacy" code using fonttools pens?

ah sorry, it was using hb-draw. Still, I think it's a symptom of the same issue about duplicate last and first points overlapping in a closed paths which should trigger an explicit closing line otherwise they'd be lost