You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on implementing support for subsetting OT-SVG table (#534), I was reminded that our S_V_G_.py module supports two formats, whereas the OT spec defines only one format version 0.
There's an older, deprecated, format, unintuitively numbered format 1, whereas the current one is 0:
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>
...
I have never encountered a font with OT-SVG format 1. I wonder if we can drop support for it to simplify the code and reduce maintainance cost, as I set out to write unit tests for it.
Another thing I noticed is that, even for the current format 0, the fontTools S_V_G_.py module supports decompiling and compiling embedded color palettes, but the OpenType SVG spec has the corresponding field reserved to 0 and there is no mention of color palettes defined inside the SVG table itself, only references to external color palettes from the CPAL table.
I haven't followed these developments back in the days, but I imagine that this module was written at the same time as the OT-SVG spec was being drafted and it may contain legacy stuff that would later be dropped from the OT spec.
git log says the author is @readroberts so Adobe folks may know more/be interested in this
While working on implementing support for subsetting OT-SVG table (#534), I was reminded that our
S_V_G_.py
module supports two formats, whereas the OT spec defines only one format version 0.There's an older, deprecated, format, unintuitively numbered format 1, whereas the current one is 0:
fonttools/Lib/fontTools/ttLib/tables/S_V_G_.py
Lines 19 to 37 in 71a986e
I have never encountered a font with OT-SVG format 1. I wonder if we can drop support for it to simplify the code and reduce maintainance cost, as I set out to write unit tests for it.
Another thing I noticed is that, even for the current format 0, the fontTools
S_V_G_.py
module supports decompiling and compiling embedded color palettes, but the OpenType SVG spec has the corresponding field reserved to 0 and there is no mention of color palettes defined inside the SVG table itself, only references to external color palettes from the CPAL table.I haven't followed these developments back in the days, but I imagine that this module was written at the same time as the OT-SVG spec was being drafted and it may contain legacy stuff that would later be dropped from the OT spec.
git log says the author is @readroberts so Adobe folks may know more/be interested in this
/cc @behdad @miguelsousa @cjchapman @justvanrossum
The text was updated successfully, but these errors were encountered: