2020-02-04 17:15:39 +00:00
|
|
|
from fontTools import ttLib
|
|
|
|
from fontTools.misc.testTools import getXML, parseXML
|
2020-02-10 13:47:20 +00:00
|
|
|
from fontTools.ttLib.tables.C_O_L_R_ import table_C_O_L_R_
|
2020-02-04 17:15:39 +00:00
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
2020-03-11 18:47:24 +00:00
|
|
|
COLR_V0_DATA = (
|
|
|
|
b"\x00\x00" # Version (0)
|
|
|
|
b"\x00\x01" # BaseGlyphRecordCount (1)
|
2020-07-01 16:13:38 +01:00
|
|
|
b"\x00\x00\x00\x0e" # Offset to BaseGlyphRecordArray from beginning of table (14)
|
|
|
|
b"\x00\x00\x00\x14" # Offset to LayerRecordArray from beginning of table (20)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x03" # LayerRecordCount (3)
|
|
|
|
b"\x00\x06" # BaseGlyphRecord[0].BaseGlyph (6)
|
|
|
|
b"\x00\x00" # BaseGlyphRecord[0].FirstLayerIndex (0)
|
|
|
|
b"\x00\x03" # BaseGlyphRecord[0].NumLayers (3)
|
|
|
|
b"\x00\x07" # LayerRecord[0].LayerGlyph (7)
|
|
|
|
b"\x00\x00" # LayerRecord[0].PaletteIndex (0)
|
|
|
|
b"\x00\x08" # LayerRecord[1].LayerGlyph (8)
|
|
|
|
b"\x00\x01" # LayerRecord[1].PaletteIndex (1)
|
|
|
|
b"\x00\t" # LayerRecord[2].LayerGlyph (9)
|
|
|
|
b"\x00\x02" # LayerRecord[3].PaletteIndex (2)
|
2020-02-04 17:15:39 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-03-11 18:47:24 +00:00
|
|
|
COLR_V0_XML = [
|
2020-02-10 13:47:20 +00:00
|
|
|
'<version value="0"/>',
|
|
|
|
'<ColorGlyph name="glyph00006">',
|
|
|
|
' <layer colorID="0" name="glyph00007"/>',
|
|
|
|
' <layer colorID="1" name="glyph00008"/>',
|
|
|
|
' <layer colorID="2" name="glyph00009"/>',
|
2020-03-11 18:47:24 +00:00
|
|
|
"</ColorGlyph>",
|
2020-02-04 17:15:39 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def dump(table, ttFont=None):
|
|
|
|
print("\n".join(getXML(table.toXML, ttFont)))
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def font():
|
|
|
|
font = ttLib.TTFont()
|
2020-03-11 18:47:24 +00:00
|
|
|
font.setGlyphOrder(["glyph%05d" % i for i in range(30)])
|
2020-02-04 17:15:39 +00:00
|
|
|
return font
|
|
|
|
|
|
|
|
|
2020-03-11 18:47:24 +00:00
|
|
|
class COLR_V0_Test(object):
|
|
|
|
def test_decompile_and_compile(self, font):
|
|
|
|
colr = table_C_O_L_R_()
|
|
|
|
colr.decompile(COLR_V0_DATA, font)
|
|
|
|
assert colr.compile(font) == COLR_V0_DATA
|
2020-02-04 17:15:39 +00:00
|
|
|
|
2020-03-11 18:47:24 +00:00
|
|
|
def test_decompile_and_dump_xml(self, font):
|
|
|
|
colr = table_C_O_L_R_()
|
|
|
|
colr.decompile(COLR_V0_DATA, font)
|
2020-02-04 17:15:39 +00:00
|
|
|
|
2020-03-11 18:47:24 +00:00
|
|
|
dump(colr, font)
|
|
|
|
assert getXML(colr.toXML, font) == COLR_V0_XML
|
2020-02-04 17:15:39 +00:00
|
|
|
|
2020-03-11 18:47:24 +00:00
|
|
|
def test_load_from_xml_and_compile(self, font):
|
|
|
|
colr = table_C_O_L_R_()
|
|
|
|
for name, attrs, content in parseXML(COLR_V0_XML):
|
|
|
|
colr.fromXML(name, attrs, content, font)
|
|
|
|
|
|
|
|
assert colr.compile(font) == COLR_V0_DATA
|
|
|
|
|
|
|
|
|
|
|
|
COLR_V1_DATA = (
|
|
|
|
b"\x00\x01" # Version (1)
|
|
|
|
b"\x00\x01" # BaseGlyphRecordCount (1)
|
2020-07-01 16:13:38 +01:00
|
|
|
b"\x00\x00\x00\x16" # Offset to BaseGlyphRecordArray from beginning of table (22)
|
|
|
|
b"\x00\x00\x00\x1c" # Offset to LayerRecordArray from beginning of table (28)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x03" # LayerRecordCount (3)
|
2020-07-01 18:16:07 +01:00
|
|
|
b"\x00\x00\x00(" # Offset to BaseGlyphV1List from beginning of table (40)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00" # Offset to VarStore (NULL)
|
|
|
|
b"\x00\x06" # BaseGlyphRecord[0].BaseGlyph (6)
|
|
|
|
b"\x00\x00" # BaseGlyphRecord[0].FirstLayerIndex (0)
|
|
|
|
b"\x00\x03" # BaseGlyphRecord[0].NumLayers (3)
|
|
|
|
b"\x00\x07" # LayerRecord[0].LayerGlyph (7)
|
|
|
|
b"\x00\x00" # LayerRecord[0].PaletteIndex (0)
|
|
|
|
b"\x00\x08" # LayerRecord[1].LayerGlyph (8)
|
|
|
|
b"\x00\x01" # LayerRecord[1].PaletteIndex (1)
|
|
|
|
b"\x00\t" # LayerRecord[2].LayerGlyph (9)
|
2020-07-01 15:59:47 +01:00
|
|
|
b"\x00\x02" # LayerRecord[2].PaletteIndex (2)
|
2020-07-01 18:16:07 +01:00
|
|
|
b"\x00\x00\x00\x01" # BaseGlyphV1List.BaseGlyphCount (1)
|
2020-07-08 16:01:16 +01:00
|
|
|
b"\x00\n" # BaseGlyphV1List.BaseGlyphV1Record[0].BaseGlyph (10)
|
|
|
|
b"\x00\x00\x00\n" # Offset to LayerV1List from beginning of BaseGlyphV1List (10)
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x03" # LayerV1List.LayerCount (3)
|
|
|
|
b"\x00\x00\x00\r" # Offset to Paint from beginning of LayerV1List (13)
|
|
|
|
b"\x00\x00\x00\x1c" # Offset to Paint from beginning of LayerV1List (28)
|
|
|
|
b"\x00\x00\x00w" # Offset to Paint from beginning of LayerV1List (119)
|
|
|
|
b"\x04" # LayerV1List.Paint[0].Format (4)
|
|
|
|
b"\x00\x00\x06" # Offset to Paint subtable from beginning of PaintGlyph (6)
|
|
|
|
b"\x00\x0b" # LayerV1List.Paint[0].Glyph (11)
|
|
|
|
b"\x01" # LayerV1List.Paint[0].Paint.Format (1)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x02" # Paint.Color.PaletteIndex (2)
|
2020-07-02 10:27:47 +01:00
|
|
|
b" \x00" # Paint.Color.Alpha.value (0.5)
|
|
|
|
b"\x00\x00\x00\x00" # Paint.Color.Alpha.varIdx (0)
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x04" # LayerV1List.Paint[1].Format (4)
|
|
|
|
b"\x00\x00\x06" # Offset to Paint subtable from beginning of PaintGlyph (6)
|
|
|
|
b"\x00\x0c" # LayerV1List.Paint[1].Glyph (12)
|
|
|
|
b"\x02" # LayerV1List.Paint[1].Paint.Format (2)
|
|
|
|
b"\x00\x00(" # Offset to ColorLine from beginning of PaintLinearGradient (40)
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\x01" # Paint.x0.value (1)
|
|
|
|
b"\x00\x00\x00\x00" # Paint.x0.varIdx (0)
|
|
|
|
b"\x00\x02" # Paint.y0.value (2)
|
|
|
|
b"\x00\x00\x00\x00" # Paint.y0.varIdx (0)
|
|
|
|
b"\xff\xfd" # Paint.x1.value (-3)
|
|
|
|
b"\x00\x00\x00\x00" # Paint.x1.varIdx (0)
|
|
|
|
b"\xff\xfc" # Paint.y1.value (-4)
|
|
|
|
b"\x00\x00\x00\x00" # Paint.y1.varIdx (0)
|
|
|
|
b"\x00\x05" # Paint.x2.value (5)
|
|
|
|
b"\x00\x00\x00\x00" # Paint.x2.varIdx (0)
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x00\x06" # Paint.y2.value (6)
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\x00\x00\x00" # Paint.y2.varIdx (0)
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x01" # ColorLine.Extend (1 or "repeat")
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x03" # ColorLine.StopCount (3)
|
|
|
|
b"\x00\x00" # ColorLine.ColorStop[0].StopOffset.value (0.0)
|
|
|
|
b"\x00\x00\x00\x00" # ColorLine.ColorStop[0].StopOffset.varIdx (0)
|
|
|
|
b"\x00\x03" # ColorLine.ColorStop[0].Color.PaletteIndex (3)
|
2020-07-02 10:27:47 +01:00
|
|
|
b"@\x00" # ColorLine.ColorStop[0].Color.Alpha.value (1.0)
|
|
|
|
b"\x00\x00\x00\x00" # ColorLine.ColorStop[0].Color.Alpha.varIdx (0)
|
2020-03-11 18:47:24 +00:00
|
|
|
b" \x00" # ColorLine.ColorStop[1].StopOffset.value (0.5)
|
|
|
|
b"\x00\x00\x00\x00" # ColorLine.ColorStop[1].StopOffset.varIdx (0)
|
|
|
|
b"\x00\x04" # ColorLine.ColorStop[1].Color.PaletteIndex (4)
|
2020-07-02 10:27:47 +01:00
|
|
|
b"@\x00" # ColorLine.ColorStop[1].Color.Alpha.value (1.0)
|
|
|
|
b"\x00\x00\x00\x00" # ColorLine.ColorStop[1].Color.Alpha.varIdx (0)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"@\x00" # ColorLine.ColorStop[2].StopOffset.value (1.0)
|
|
|
|
b"\x00\x00\x00\x00" # ColorLine.ColorStop[2].StopOffset.varIdx (0)
|
|
|
|
b"\x00\x05" # ColorLine.ColorStop[2].Color.PaletteIndex (5)
|
2020-07-02 10:27:47 +01:00
|
|
|
b"@\x00" # ColorLine.ColorStop[2].Color.Alpha.value (1.0)
|
|
|
|
b"\x00\x00\x00\x00" # ColorLine.ColorStop[2].Color.Alpha.varIdx (0)
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x04" # LayerV1List.Paint[2].Format (4)
|
|
|
|
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)
|
2020-10-12 14:32:18 +01:00
|
|
|
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"
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x03" # LayerV1List.Paint[2].Paint.Paint.Format (3)
|
|
|
|
b"\x00\x00(" # Offset to ColorLine from beginning of PaintRadialGradient (40)
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\x07" # Paint.x0.value (7)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\x08" # Paint.y0.value (8)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\t" # Paint.r0.value (9)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\n" # Paint.x1.value (10)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
2020-07-02 12:11:40 +01:00
|
|
|
b"\x00\x0b" # Paint.y1.value (11)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
|
|
|
b"\x00\x0c" # Paint.r1.value (12)
|
|
|
|
b"\x00\x00\x00\x00"
|
2020-10-09 17:01:31 +01:00
|
|
|
b"\x00" # ColorLine.Extend (0 or "pad")
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x02" # ColorLine.StopCount (2)
|
|
|
|
b"\x00\x00" # ColorLine.ColorStop[0].StopOffset.value (0.0)
|
|
|
|
b"\x00\x00\x00\x00"
|
|
|
|
b"\x00\x06" # ColorLine.ColorStop[0].Color.PaletteIndex (6)
|
2020-10-09 17:01:31 +01:00
|
|
|
b"@\x00" # ColorLine.ColorStop[0].Color.Alpha.value (1.0)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
|
|
|
b"@\x00" # ColorLine.ColorStop[1].StopOffset.value (1.0)
|
|
|
|
b"\x00\x00\x00\x00"
|
|
|
|
b"\x00\x07" # ColorLine.ColorStop[1].Color.PaletteIndex (7)
|
2020-07-02 10:27:47 +01:00
|
|
|
b"\x19\x9a" # ColorLine.ColorStop[1].Color.Alpha.value (0.4)
|
2020-03-11 18:47:24 +00:00
|
|
|
b"\x00\x00\x00\x00"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
COLR_V1_XML = [
|
|
|
|
'<Version value="1"/>',
|
|
|
|
"<!-- BaseGlyphRecordCount=1 -->",
|
|
|
|
"<BaseGlyphRecordArray>",
|
|
|
|
' <BaseGlyphRecord index="0">',
|
|
|
|
' <BaseGlyph value="glyph00006"/>',
|
|
|
|
' <FirstLayerIndex value="0"/>',
|
|
|
|
' <NumLayers value="3"/>',
|
|
|
|
" </BaseGlyphRecord>",
|
|
|
|
"</BaseGlyphRecordArray>",
|
|
|
|
"<LayerRecordArray>",
|
|
|
|
' <LayerRecord index="0">',
|
|
|
|
' <LayerGlyph value="glyph00007"/>',
|
|
|
|
' <PaletteIndex value="0"/>',
|
|
|
|
" </LayerRecord>",
|
|
|
|
' <LayerRecord index="1">',
|
|
|
|
' <LayerGlyph value="glyph00008"/>',
|
|
|
|
' <PaletteIndex value="1"/>',
|
|
|
|
" </LayerRecord>",
|
|
|
|
' <LayerRecord index="2">',
|
|
|
|
' <LayerGlyph value="glyph00009"/>',
|
|
|
|
' <PaletteIndex value="2"/>',
|
|
|
|
" </LayerRecord>",
|
|
|
|
"</LayerRecordArray>",
|
|
|
|
"<!-- LayerRecordCount=3 -->",
|
2020-07-01 18:16:07 +01:00
|
|
|
"<BaseGlyphV1List>",
|
2020-03-11 18:47:24 +00:00
|
|
|
" <!-- BaseGlyphCount=1 -->",
|
|
|
|
' <BaseGlyphV1Record index="0">',
|
|
|
|
' <BaseGlyph value="glyph00010"/>',
|
2020-07-01 18:22:03 +01:00
|
|
|
" <LayerV1List>",
|
2020-03-11 18:47:24 +00:00
|
|
|
" <!-- LayerCount=3 -->",
|
2020-10-20 19:03:17 +01:00
|
|
|
' <Paint index="0" Format="4"><!-- PaintGlyph -->',
|
|
|
|
' <Paint Format="1"><!-- PaintSolid -->',
|
2020-03-11 18:47:24 +00:00
|
|
|
" <Color>",
|
|
|
|
' <PaletteIndex value="2"/>',
|
2020-07-02 10:27:47 +01:00
|
|
|
' <Alpha value="0.5"/>',
|
2020-03-11 18:47:24 +00:00
|
|
|
" </Color>",
|
|
|
|
" </Paint>",
|
2020-10-09 17:01:31 +01:00
|
|
|
' <Glyph value="glyph00011"/>',
|
|
|
|
" </Paint>",
|
2020-10-20 19:03:17 +01:00
|
|
|
' <Paint index="1" Format="4"><!-- PaintGlyph -->',
|
|
|
|
' <Paint Format="2"><!-- PaintLinearGradient -->',
|
2020-03-11 18:47:24 +00:00
|
|
|
" <ColorLine>",
|
|
|
|
' <Extend value="repeat"/>',
|
|
|
|
" <!-- StopCount=3 -->",
|
|
|
|
' <ColorStop index="0">',
|
|
|
|
' <StopOffset value="0.0"/>',
|
|
|
|
" <Color>",
|
|
|
|
' <PaletteIndex value="3"/>',
|
2020-07-02 10:27:47 +01:00
|
|
|
' <Alpha value="1.0"/>',
|
2020-03-11 18:47:24 +00:00
|
|
|
" </Color>",
|
|
|
|
" </ColorStop>",
|
|
|
|
' <ColorStop index="1">',
|
|
|
|
' <StopOffset value="0.5"/>',
|
|
|
|
" <Color>",
|
|
|
|
' <PaletteIndex value="4"/>',
|
2020-07-02 10:27:47 +01:00
|
|
|
' <Alpha value="1.0"/>',
|
2020-03-11 18:47:24 +00:00
|
|
|
" </Color>",
|
|
|
|
" </ColorStop>",
|
|
|
|
' <ColorStop index="2">',
|
|
|
|
' <StopOffset value="1.0"/>',
|
|
|
|
" <Color>",
|
|
|
|
' <PaletteIndex value="5"/>',
|
2020-07-02 10:27:47 +01:00
|
|
|
' <Alpha value="1.0"/>',
|
2020-03-11 18:47:24 +00:00
|
|
|
" </Color>",
|
|
|
|
" </ColorStop>",
|
|
|
|
" </ColorLine>",
|
2020-07-02 12:11:40 +01:00
|
|
|
' <x0 value="1"/>',
|
|
|
|
' <y0 value="2"/>',
|
|
|
|
' <x1 value="-3"/>',
|
|
|
|
' <y1 value="-4"/>',
|
|
|
|
' <x2 value="5"/>',
|
|
|
|
' <y2 value="6"/>',
|
2020-03-11 18:47:24 +00:00
|
|
|
" </Paint>",
|
2020-10-09 17:01:31 +01:00
|
|
|
' <Glyph value="glyph00012"/>',
|
|
|
|
" </Paint>",
|
2020-10-20 19:03:17 +01:00
|
|
|
' <Paint index="2" Format="4"><!-- PaintGlyph -->',
|
|
|
|
' <Paint Format="6"><!-- PaintTransform -->',
|
|
|
|
' <Paint Format="3"><!-- PaintRadialGradient -->',
|
2020-10-09 17:01:31 +01:00
|
|
|
" <ColorLine>",
|
|
|
|
' <Extend value="pad"/>',
|
|
|
|
" <!-- StopCount=2 -->",
|
|
|
|
' <ColorStop index="0">',
|
|
|
|
' <StopOffset value="0.0"/>',
|
|
|
|
" <Color>",
|
|
|
|
' <PaletteIndex value="6"/>',
|
|
|
|
' <Alpha value="1.0"/>',
|
|
|
|
" </Color>",
|
|
|
|
" </ColorStop>",
|
|
|
|
' <ColorStop index="1">',
|
|
|
|
' <StopOffset value="1.0"/>',
|
|
|
|
" <Color>",
|
|
|
|
' <PaletteIndex value="7"/>',
|
|
|
|
' <Alpha value="0.4"/>',
|
|
|
|
" </Color>",
|
|
|
|
" </ColorStop>",
|
|
|
|
" </ColorLine>",
|
|
|
|
' <x0 value="7"/>',
|
|
|
|
' <y0 value="8"/>',
|
|
|
|
' <r0 value="9"/>',
|
|
|
|
' <x1 value="10"/>',
|
|
|
|
' <y1 value="11"/>',
|
|
|
|
' <r1 value="12"/>',
|
|
|
|
" </Paint>",
|
2020-07-02 12:21:12 +01:00
|
|
|
" <Transform>",
|
2020-03-11 18:47:24 +00:00
|
|
|
' <xx value="-13.0"/>',
|
|
|
|
' <xy value="14.0"/>',
|
|
|
|
' <yx value="15.0"/>',
|
|
|
|
' <yy value="-17.0"/>',
|
2020-10-09 17:01:31 +01:00
|
|
|
' <dx value="18.0"/>',
|
|
|
|
' <dy value="19.0"/>',
|
2020-07-02 12:21:12 +01:00
|
|
|
" </Transform>",
|
2020-03-11 18:47:24 +00:00
|
|
|
" </Paint>",
|
2020-10-09 17:01:31 +01:00
|
|
|
' <Glyph value="glyph00013"/>',
|
|
|
|
" </Paint>",
|
2020-07-01 18:22:03 +01:00
|
|
|
" </LayerV1List>",
|
2020-03-11 18:47:24 +00:00
|
|
|
" </BaseGlyphV1Record>",
|
2020-07-01 18:16:07 +01:00
|
|
|
"</BaseGlyphV1List>",
|
2020-03-11 18:47:24 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class COLR_V1_Test(object):
|
|
|
|
def test_decompile_and_compile(self, font):
|
|
|
|
colr = table_C_O_L_R_()
|
|
|
|
colr.decompile(COLR_V1_DATA, font)
|
|
|
|
assert colr.compile(font) == COLR_V1_DATA
|
|
|
|
|
|
|
|
def test_decompile_and_dump_xml(self, font):
|
|
|
|
colr = table_C_O_L_R_()
|
|
|
|
colr.decompile(COLR_V1_DATA, font)
|
|
|
|
|
|
|
|
dump(colr, font)
|
|
|
|
assert getXML(colr.toXML, font) == COLR_V1_XML
|
|
|
|
|
|
|
|
def test_load_from_xml_and_compile(self, font):
|
|
|
|
colr = table_C_O_L_R_()
|
|
|
|
for name, attrs, content in parseXML(COLR_V1_XML):
|
|
|
|
colr.fromXML(name, attrs, content, font)
|
|
|
|
|
|
|
|
assert colr.compile(font) == COLR_V1_DATA
|