googlefonts / sleipnir

Memory safe implementations of Google Fonts specific font manipulations.
Apache License 2.0
1 stars 1 forks source link

Option to emit mildly optimized svg paths #18

Open rsheeter opened 3 months ago

rsheeter commented 3 months ago

To enable deletion of some java code and a somewhat slow step in icon svg processing provide an optional optimized svg path that does the following if/when it produces a shorter string:

That is, implement most optimizations from https://github.com/svg/svgo/blob/main/plugins/convertPathData.js but apply during generation of a String for a BezPath instead of as a standalone step. Consider not implementing arc conversion; arcs have a way of breaking things.

Impact: should cut minutes off the time to produce a complete set of icons.

See:

tomasdev commented 2 months ago

Collapse Repeated from SVGO https://github.com/svg/svgo/blob/main/plugins/convertPathData.js#L748-L767