ot-spec says skewX angle should be counter-clockwise so we must negate

Transform.skew method assumes skewX angle goes clockwise.

verified using test_glyphs-glyf_colr_1.ttf test font from googlefonts/color-fonts repo.
Will add that to the tests.
This commit is contained in:
Cosimo Lupo 2023-03-10 12:35:52 +00:00
parent 55cc41a24e
commit c15e77cbc9
No known key found for this signature in database
GPG Key ID: DF65A8A5A119C9A8

View File

@ -1667,11 +1667,11 @@ class Paint(getFormatSwitchingBaseTableClass("uint8")):
.translate(-self.centerX, -self.centerY)
)
elif self.Format == PaintFormat.PaintSkew:
return Identity.skew(radians(self.xSkewAngle), radians(self.ySkewAngle))
return Identity.skew(radians(-self.xSkewAngle), radians(self.ySkewAngle))
elif self.Format == PaintFormat.PaintSkewAroundCenter:
return (
Identity.translate(self.centerX, self.centerY)
.skew(radians(self.xSkewAngle), radians(self.ySkewAngle))
.skew(radians(-self.xSkewAngle), radians(self.ySkewAngle))
.translate(-self.centerX, -self.centerY)
)
if PaintFormat(self.Format).is_variable():