SVG: SVG (Scalable Vector Graphics) Table

Compiles/decompiles version 0 and 1 SVG tables from/to XML.

Version 1 is the first SVG definition, implemented in Mozilla before Aug 2013, now deprecated. This module will decompile this correctly, but will compile a version 1 table only if you add the secret element “<version1/>” to the SVG element in the TTF file.

Version 0 is the joint Adobe-Mozilla proposal, which supports color palettes.

The XML format is: <SVG>

<svgDoc endGlyphID=”1” startGlyphID=”1”>

<![CDATA[ <complete SVG doc> ]]

</svgDoc>

<svgDoc endGlyphID=”n” startGlyphID=”m”>

<![CDATA[ <complete SVG doc> ]]

</svgDoc>

<colorPalettes>

<colorParamUINameID>n</colorParamUINameID> … <colorParamUINameID>m</colorParamUINameID> <colorPalette uiNameID=”n”>

<colorRecord red=”<int>” green=”<int>” blue=”<int>” alpha=”<int>” /> … <colorRecord red=”<int>” green=”<int>” blue=”<int>” alpha=”<int>” />

</colorPalette> … <colorPalette uiNameID=”m”>

<colorRecord red=”<int> green=”<int>” blue=”<int>” alpha=”<int>” /> … <colorRecord red=<int>” green=”<int>” blue=”<int>” alpha=”<int>” />

</colorPalette>

</colorPalettes>

</SVG>

Color values must be less than 256.

The number of color records in each </colorPalette> must be the same as the number of <colorParamUINameID> elements.

class fontTools.ttLib.tables.S_V_G_.ColorPalette[source]
fromXML(name, attrs, content, ttFont)[source]
class fontTools.ttLib.tables.S_V_G_.ColorPalettes[source]
fromXML(name, attrs, content, ttFont)[source]
class fontTools.ttLib.tables.S_V_G_.ColorRecord[source]
class fontTools.ttLib.tables.S_V_G_.DocumentIndexEntry[source]
class fontTools.ttLib.tables.S_V_G_.table_S_V_G_(tag=None)[source]
compile(ttFont)[source]
compileFormat0(ttFont)[source]
compileFormat1(ttFont)[source]
decompile(data, ttFont)[source]
decompileEntryList(data)[source]
decompile_format_0(data, ttFont)[source]
decompile_format_1(data, ttFont)[source]
dependencies = []
fromXML(name, attrs, content, ttFont)[source]
merge(m, tables)
toXML(writer, ttFont)[source]