-
Notifications
You must be signed in to change notification settings - Fork 448
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
Subset SVG table with pyftsubset #534
Comments
You can't just do that since SVG docs have references to glyph ids in them. If glyphIDs change (which does in subsetting unless you choose all glyphs), then the SVGs need to be rewritten. That's not impossible. Removing unused parts of the SVGs is harder. |
Ah, I see. I was working with a font that had one SVG doc per glyph, so it seemed simple. I suppose any subsetting should be done in the original font design software, or by hand. |
The way I would go about this is:
|
That should work, yes. Now find someone to do it please. :)) |
In the OT-SVG spec, I read
That's nice, as it could make subsetting a little easier since we wouldn't need to split SVG docs when subsetting leaves gaps in the GID ranges: we can simply make several records with continuous ranges whose offset points to the same SVG document containing discontinuous GID ranges. However the current implementation in I could fix that by building a cache or map of SVG docs to offsets as these are first seen and reuse the offsets for any following records that share the same SVG content. |
Can somebody point me to existing OT-SVG vector color fonts that I could use to test my in-the-works subsetting implementation? /cc @RoelN @miguelsousa @cjchapman |
/cc @twardoch |
thank you guys! However, both those OT-SVG fonts are quite simple as far as subsetting is concerned, as each color glyph is defined in its own distinct SVG document. I'd like to see real-world example of fonts that take advantage of all the reuse facilities provided by OT-SVG, e.g. multiuple (ranges of) color glyphs defined within the same SVG document, sharing shapes via |
Unfortunately I only know of OT SVG fonts that use individual SVG documents per glyph, like bixacolor.com. |
We can finally subset OT-SVG fonts! 🥳 |
It's noted in this issue that the subetter doesn't know how to subset the SVG table. It would be nice if it did as SVG fonts can use all the optimization they can get :)
Currently, I have to explicitly tell pyftsusbet to leave the SVG table alone, as per instructions in the mentioned issue, so that should change too:
The text was updated successfully, but these errors were encountered: