-
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
Add support for subsetting OT-SVG table #2452
Commits on Nov 15, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 425e1af - Browse repository at this point
Copy the full SHA 425e1afView commit details -
subset: don't drop SVG table, add WIP subset/svg.py stub
simply pass-through for now
Configuration menu - View commit details
-
Copy full SHA for bd47bda - Browse repository at this point
Copy the full SHA bd47bdaView commit details -
subset: store original glyphOrder and map from old to new indexes in …
…Subsetter instance so that SVG tables' subset_glyphs method can use it to get glyph names from GISs and to remap from old to new GIDs
Configuration menu - View commit details
-
Copy full SHA for 16249d1 - Browse repository at this point
Copy the full SHA 16249d1View commit details -
basic subset.svg impl that simply remaps id='glyphXXX'
this drops svg document records when they no longer intersect the subset. It keeps them in their entirety (for now) when they still intersect the subset, only renaming all the id='glyphXXX' to point to the new glyph indices after subsetting. Unused, unreferenced elements are not pruned yet.
Configuration menu - View commit details
-
Copy full SHA for d44af9f - Browse repository at this point
Copy the full SHA d44af9fView commit details -
support for namespaces and xpath is insufficient in built-in ElementTree; supporting both lxml and ElementTree is too complicated, let's simply require lxml to be able to subset SVG for now
Configuration menu - View commit details
-
Copy full SHA for 0dc2be3 - Browse repository at this point
Copy the full SHA 0dc2be3View commit details -
subset: add --pretty-svg option to enable lxml pretty_print
False (more compact) by default
Configuration menu - View commit details
-
Copy full SHA for 05e6d57 - Browse repository at this point
Copy the full SHA 05e6d57View commit details -
subset/svg: support resolving cross-references and pruning elements
With this I can finally follow xlink:href and url(#...) sort of references within the SVG doc and subset the elements accordingly so that only those that are reachable from the initial set of glyph elements are kept.
Configuration menu - View commit details
-
Copy full SHA for a4df567 - Browse repository at this point
Copy the full SHA a4df567View commit details -
Configuration menu - View commit details
-
Copy full SHA for a79106d - Browse repository at this point
Copy the full SHA a79106dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 361544f - Browse repository at this point
Copy the full SHA 361544fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d1f2481 - Browse repository at this point
Copy the full SHA d1f2481View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7216ae - Browse repository at this point
Copy the full SHA a7216aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 863c9de - Browse repository at this point
Copy the full SHA 863c9deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92470ea - Browse repository at this point
Copy the full SHA 92470eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 12ed8b7 - Browse repository at this point
Copy the full SHA 12ed8b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d19cc6 - Browse repository at this point
Copy the full SHA 1d19cc6View commit details -
encode bytes before fromstring; decode to str after tostring
when decompiled from binary, the SVG.docList contains (unicode) strings, decoded as UTF-8. lxml fromstring accepts either bytes or str, but when given str with the xml header declaring an explicit encoding, it rejects them (since the header is lying). So we encode to bytes before calling fromstring in case the SVG contains an explicit encoding (UTF-8 is the only one allowed anyway). When serializing to XML with tostring, we similarly decode to str as UTF-8. Not only to match SVG decompile (which gives us str), but if we didn't do that, then attempting to dump to XML would fail, because XMLWriter.writecdata expects str, not bytes.
Configuration menu - View commit details
-
Copy full SHA for 27e4052 - Browse repository at this point
Copy the full SHA 27e4052View commit details
Commits on Nov 16, 2021
-
Configuration menu - View commit details
-
Copy full SHA for d45da5d - Browse repository at this point
Copy the full SHA d45da5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66ec30c - Browse repository at this point
Copy the full SHA 66ec30cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0745579 - Browse repository at this point
Copy the full SHA 0745579View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbcb9d6 - Browse repository at this point
Copy the full SHA dbcb9d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 155ff60 - Browse repository at this point
Copy the full SHA 155ff60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 247fa84 - Browse repository at this point
Copy the full SHA 247fa84View commit details