From 65ea95b9747e4863552a2a671000862c6ef14c6e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Apr 2023 11:52:56 -0600 Subject: [PATCH] [VarComposite] Optimize skew() --- src/OT/glyf/VarCompositeGlyph.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index 3a023d4f4..7a628d7ac 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -173,7 +173,11 @@ struct VarCompositeGlyphRecord // https://github.com/fonttools/fonttools/blob/f66ee05f71c8b57b5f519ee975e95edcd1466e14/Lib/fontTools/misc/transform.py#L255 skewX = skewX * HB_PI; skewY = skewY * HB_PI; - float other[6] = {1.f, tanf (skewY), tanf (skewX), 1.f, 0.f, 0.f}; + float other[6] = {1.f, + skewY ? tanf (skewY) : 0.f, + skewX ? tanf (skewX) : 0.f, + 1.f, + 0.f, 0.f}; transform (matrix, trans, other); }