From 63920fb0bcf4ab6cf44452842d43d7ce9c1b4130 Mon Sep 17 00:00:00 2001 From: Connor Davenport Date: Wed, 16 Oct 2024 10:32:15 -0400 Subject: [PATCH 1/2] Transformation Matrix fix --- Lib/glyphConstruction.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Lib/glyphConstruction.py b/Lib/glyphConstruction.py index 8717f22..3c0b499 100644 --- a/Lib/glyphConstruction.py +++ b/Lib/glyphConstruction.py @@ -562,7 +562,7 @@ def parsePositions(baseGlyph, markGlyph, font, markTransformMap, advanceWidth, a xx, xy, yx, yy, x, y = 1, 0, 0, 1, advanceWidth, advanceHeight baseGlyphX = baseGlyphY = baseGlyph - markFixedX = markFixedY = False + markFixedX = markFixedY = matrix = False flipX = flipY = False @@ -572,7 +572,10 @@ def parsePositions(baseGlyph, markGlyph, font, markTransformMap, advanceWidth, a if positionXYSplit in position: positions = position.split(positionXYSplit) if len(positions) == 6: + matrix = True xx, xy, yx, yy, positionX, positionY = positions + x = float(positionX) + y = float(positionY) xx = float(xx) xy = float(xy) yx = float(yx) @@ -633,16 +636,17 @@ def parsePositions(baseGlyph, markGlyph, font, markTransformMap, advanceWidth, a elif (basePoint1, baseAngle1) == (basePoint2, baseAngle2): baseX, baseY = basePoint1 - # calculate the offset - if not markFixedX: - x += baseX - markX - else: - x += markX + if not matrix: + # calculate the offset + if not markFixedX: + x += baseX - markX + else: + x += markX - if not markFixedY: - y += baseY - markY - else: - y += markY + if not markFixedY: + y += baseY - markY + else: + y += markY if not markFixedX: baseTransform = markTransformMap.get(baseGlyphX) From 988bdde372eb36e6d14088aff797ccb19c8d1fae Mon Sep 17 00:00:00 2001 From: Connor Davenport Date: Wed, 16 Oct 2024 11:06:34 -0400 Subject: [PATCH 2/2] ignore matrix if baseglyph --- Lib/glyphConstruction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/glyphConstruction.py b/Lib/glyphConstruction.py index 3c0b499..26dfe44 100644 --- a/Lib/glyphConstruction.py +++ b/Lib/glyphConstruction.py @@ -572,7 +572,7 @@ def parsePositions(baseGlyph, markGlyph, font, markTransformMap, advanceWidth, a if positionXYSplit in position: positions = position.split(positionXYSplit) if len(positions) == 6: - matrix = True + matrix = True if not baseGlyph else False xx, xy, yx, yy, positionX, positionY = positions x = float(positionX) y = float(positionY)