Previously, the space added was quite a lot, since it was calculated so
that it would be enough to accommodate a heavily FreeType-slanted glyph
in the worst case. In many cases this was too much spacing, especially
if the italic font was only slightly angled.
The new fix simply ensures that the glyph is inside the bounds of the
advance.
while (back && og->bbox.xMax - og->bbox.xMin == 0
&& og->italic)
og = &glyphs[--back];
- if (og->bbox.xMax > og->cluster_advance.x) {
- // The FreeType oblique slants by 6/16
- og->cluster_advance.x += og->bbox.yMax * 0.375;
- }
+ if (og->bbox.xMax > og->cluster_advance.x)
+ og->cluster_advance.x = og->bbox.xMax;
}
// add horizontal letter spacing