Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove support for deprecated SVG format 1 table and embedded colorPalettes? #2426

Closed
anthrotype opened this issue Oct 12, 2021 · 3 comments
Closed

Comments

@anthrotype
Copy link
Member

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

/cc @behdad @miguelsousa @cjchapman @justvanrossum

@anthrotype
Copy link
Member Author

also /cc @jfkthame

@behdad
Copy link
Member

behdad commented Oct 12, 2021

Yep. Remove those all. They were never part of any standard.

@anthrotype
Copy link
Member Author

Yep. Remove those all. They were never part of any standard.

ok, will do, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants