[removeOverlaps] Fix CFF CharString width
The width argument of `T2CharStringPen()` is inserted directly into the CharString program, so it must be relative to Private.nominalWidthX, but CharString.width is a calculated absolute value. Some implementations, notably Adobe’s, will use the width from the CFF CharString instead of the one from hmtx table. Fixes https://github.com/fonttools/fonttools/issues/3658
This commit is contained in:
parent
f7ecc6fe65
commit
40b525c1e3
@ -87,7 +87,8 @@ def ttfGlyphFromSkPath(path: pathops.Path) -> _g_l_y_f.Glyph:
|
|||||||
def _charString_from_SkPath(
|
def _charString_from_SkPath(
|
||||||
path: pathops.Path, charString: T2CharString
|
path: pathops.Path, charString: T2CharString
|
||||||
) -> T2CharString:
|
) -> T2CharString:
|
||||||
t2Pen = T2CharStringPen(width=charString.width, glyphSet=None)
|
width = charString.width - charString.private.nominalWidthX
|
||||||
|
t2Pen = T2CharStringPen(width=width, glyphSet=None)
|
||||||
path.draw(t2Pen)
|
path.draw(t2Pen)
|
||||||
return t2Pen.getCharString(charString.private, charString.globalSubrs)
|
return t2Pen.getCharString(charString.private, charString.globalSubrs)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user