Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
rounding differences between harfbuzz and cairo #1892
In pango 1.44, we've replaced cairo by harfbuzz for getting glyph extents. Some people complain that fonts are 'stretched' now (https://gitlab.gnome.org/GNOME/pango/issues/404).
Comparing 1.43 and 1.44, I find that i get this returned from cairo (note that the values here are rounded to multiples of 1024:
And this is what i get from harfbuzz:
the harfbuzz values are not rounded, that is ok. The issue here is that 3652 rounds to 4096, giving us an extra pixel of width for that glyph.
I haven't gotten to the bottom of why these values are different. I did notice that the scales of the font are similar enough to not be the reason: 15024 (with 1.43) vs 15019 (with 1.44).
everything is default:
font options: antialias 0 subpixel_order 0 hint-style 0 hint-metrics 0
i can turn hint-metrics off if you think it matters for what cairo returns
Look at that, it does:
This is cairo with hint-metrics off
On 07/08/2019 01:38, Matthias Clasen wrote: Where does this leave us ? harfbuzz is giving me the same values are cairo with hint-metrics off. But rounding those values on the pango side does not reproduce the same values as cairo with hint-metrics on.
Simply rounding metrics to integer pixel values is not the same as hinting them. The instructions in the font may decide to modify the nominal metrics (e.g. to maintain consistent stem widths or counters or sidebearings across a glyph like "m") more extensively than just rounding to pixels.