From 73073be3c2a006e5eba85eabb67b81486cc6f82f Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 12 Oct 2020 14:32:18 +0100 Subject: [PATCH] Affine2x3 struct should be inlined inside PaintTransform Not pointed to by an Offset32. Thanks Dominik for spotting this! --- Lib/fontTools/ttLib/tables/otData.py | 2 +- Tests/ttLib/tables/C_O_L_R_test.py | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/otData.py b/Lib/fontTools/ttLib/tables/otData.py index 2dad181f1..e30b24f7f 100755 --- a/Lib/fontTools/ttLib/tables/otData.py +++ b/Lib/fontTools/ttLib/tables/otData.py @@ -1650,7 +1650,7 @@ otData = [ ('PaintFormat6', [ ('uint8', 'PaintFormat', None, None, 'Format identifier-format = 6'), ('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintTransformed table) to Paint subtable.'), - ('LOffsetTo(Affine2x3)', 'Transform', None, None, 'Offset (from beginning of PaintTrasformed table) to Affine2x3 subtable.'), + ('Affine2x3', 'Transform', None, None, 'Offset (from beginning of PaintTrasformed table) to Affine2x3 subtable.'), ]), ('PaintFormat7', [ ('uint8', 'PaintFormat', None, None, 'Format identifier-format = 7'), diff --git a/Tests/ttLib/tables/C_O_L_R_test.py b/Tests/ttLib/tables/C_O_L_R_test.py index 4afba940d..6da742ccd 100644 --- a/Tests/ttLib/tables/C_O_L_R_test.py +++ b/Tests/ttLib/tables/C_O_L_R_test.py @@ -134,8 +134,19 @@ COLR_V1_DATA = ( b"\x00\x00\x06" # Offset to Paint subtable from beginning of PaintGlyph (6) b"\x00\r" # LayerV1List.Paint[2].Glyph (13) b"\x06" # LayerV1List.Paint[2].Paint.Format (6) - b"\x00\x00\x08" # Offset to Paint subtable from beginning of PaintTransform (8) - b"\x00\x00\x00O" # Offset to Transform from beginning of PaintTransform (79) + b"\x00\x004" # Offset to Paint subtable from beginning of PaintTransform (52) + b"\xff\xf3\x00\x00" # Affine2x3.xx.value (-13) + b"\x00\x00\x00\x00" + b"\x00\x0e\x00\x00" # Affine2x3.xy.value (14) + b"\x00\x00\x00\x00" + b"\x00\x0f\x00\x00" # Affine2x3.yx.value (15) + b"\x00\x00\x00\x00" + b"\xff\xef\x00\x00" # Affine2x3.yy.value (-17) + b"\x00\x00\x00\x00" + b"\x00\x12\x00\x00" # Affine2x3.yy.value (18) + b"\x00\x00\x00\x00" + b"\x00\x13\x00\x00" # Affine2x3.yy.value (19) + b"\x00\x00\x00\x00" b"\x03" # LayerV1List.Paint[2].Paint.Paint.Format (3) b"\x00\x00(" # Offset to ColorLine from beginning of PaintRadialGradient (40) b"\x00\x07" # Paint.x0.value (7) @@ -162,18 +173,6 @@ COLR_V1_DATA = ( b"\x00\x07" # ColorLine.ColorStop[1].Color.PaletteIndex (7) b"\x19\x9a" # ColorLine.ColorStop[1].Color.Alpha.value (0.4) b"\x00\x00\x00\x00" - b"\xff\xf3\x00\x00" # Affine2x3.xx.value (-13) - b"\x00\x00\x00\x00" - b"\x00\x0e\x00\x00" # Affine2x3.xy.value (14) - b"\x00\x00\x00\x00" - b"\x00\x0f\x00\x00" # Affine2x3.yx.value (15) - b"\x00\x00\x00\x00" - b"\xff\xef\x00\x00" # Affine2x3.yy.value (-17) - b"\x00\x00\x00\x00" - b"\x00\x12\x00\x00" # Affine2x3.yy.value (18) - b"\x00\x00\x00\x00" - b"\x00\x13\x00\x00" # Affine2x3.yy.value (19) - b"\x00\x00\x00\x00" )