[transform] Change the DecomposedTransform skewX sign to match Transform
Unfortunate but for consistency's sake. This deviates from VarComposite convention. https://github.com/fonttools/fonttools/pull/2958#issuecomment-1416155600
This commit is contained in:
parent
c0d100f7e8
commit
8e981a1b28
@ -418,7 +418,7 @@ class DecomposedTransform:
|
|||||||
rotation: float = 0 # in degrees, counter-clockwise
|
rotation: float = 0 # in degrees, counter-clockwise
|
||||||
scaleX: float = 1
|
scaleX: float = 1
|
||||||
scaleY: float = 1
|
scaleY: float = 1
|
||||||
skewX: float = 0 # in degrees, counter-clockwise
|
skewX: float = 0 # in degrees, clockwise
|
||||||
skewY: float = 0 # in degrees, counter-clockwise
|
skewY: float = 0 # in degrees, counter-clockwise
|
||||||
tCenterX: float = 0
|
tCenterX: float = 0
|
||||||
tCenterY: float = 0
|
tCenterY: float = 0
|
||||||
@ -455,7 +455,7 @@ class DecomposedTransform:
|
|||||||
math.degrees(rotation),
|
math.degrees(rotation),
|
||||||
scaleX,
|
scaleX,
|
||||||
scaleY,
|
scaleY,
|
||||||
-math.degrees(skewX),
|
math.degrees(skewX),
|
||||||
math.degrees(skewY),
|
math.degrees(skewY),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@ -475,7 +475,7 @@ class DecomposedTransform:
|
|||||||
)
|
)
|
||||||
t = t.rotate(math.radians(self.rotation))
|
t = t.rotate(math.radians(self.rotation))
|
||||||
t = t.scale(self.scaleX, self.scaleY)
|
t = t.scale(self.scaleX, self.scaleY)
|
||||||
t = t.skew(-math.radians(self.skewX), math.radians(self.skewY))
|
t = t.skew(math.radians(self.skewX), math.radians(self.skewY))
|
||||||
t = t.translate(-self.tCenterX, -self.tCenterY)
|
t = t.translate(-self.tCenterX, -self.tCenterY)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
@ -1734,7 +1734,7 @@ VAR_COMPONENT_TRANSFORM_MAPPING = {
|
|||||||
VarComponentFlags.HAVE_SCALE_Y, 10, 1, 1
|
VarComponentFlags.HAVE_SCALE_Y, 10, 1, 1
|
||||||
),
|
),
|
||||||
"skewX": VarComponentTransformMappingValues(
|
"skewX": VarComponentTransformMappingValues(
|
||||||
VarComponentFlags.HAVE_SKEW_X, 12, 180, 0
|
VarComponentFlags.HAVE_SKEW_X, 12, -180, 0
|
||||||
),
|
),
|
||||||
"skewY": VarComponentTransformMappingValues(
|
"skewY": VarComponentTransformMappingValues(
|
||||||
VarComponentFlags.HAVE_SKEW_Y, 12, 180, 0
|
VarComponentFlags.HAVE_SKEW_Y, 12, 180, 0
|
||||||
@ -1988,7 +1988,7 @@ class GlyphVarComponent(object):
|
|||||||
controls.append("skew")
|
controls.append("skew")
|
||||||
coords.append(
|
coords.append(
|
||||||
(
|
(
|
||||||
fl2fi(self.transform.skewX / 180, 12),
|
fl2fi(self.transform.skewX / -180, 12),
|
||||||
fl2fi(self.transform.skewY / 180, 12),
|
fl2fi(self.transform.skewY / 180, 12),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -2027,7 +2027,7 @@ class GlyphVarComponent(object):
|
|||||||
i += 1
|
i += 1
|
||||||
if self.flags & (VarComponentFlags.HAVE_SKEW_X | VarComponentFlags.HAVE_SKEW_Y):
|
if self.flags & (VarComponentFlags.HAVE_SKEW_X | VarComponentFlags.HAVE_SKEW_Y):
|
||||||
self.transform.skewX, self.transform.skewY = (
|
self.transform.skewX, self.transform.skewY = (
|
||||||
fi2fl(coords[i][0], 12) * 180,
|
fi2fl(coords[i][0], 12) * -180,
|
||||||
fi2fl(coords[i][1], 12) * 180,
|
fi2fl(coords[i][1], 12) * 180,
|
||||||
)
|
)
|
||||||
i += 1
|
i += 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user