From a1d9afb12f7ef1741415fbe66fd1f37d2330f1fe Mon Sep 17 00:00:00 2001 From: JSCHILL1 Date: Mon, 3 Aug 2009 08:50:48 -0500 Subject: [PATCH] Remove all empty path segments. Scour polyline coordinates --- scour.py | 85 +++++++++++++++++++++++++++++++++++++++++++--------- testscour.py | 12 ++++++++ 2 files changed, 83 insertions(+), 14 deletions(-) diff --git a/scour.py b/scour.py index 96157b9..017843a 100755 --- a/scour.py +++ b/scour.py @@ -31,15 +31,38 @@ # * Process quadratic Bezier curves # * Collapse all group based transformations +# Even more ideas here: http://esw.w3.org/topic/SvgTidy +# * namespace cleanup -> +# * removal of more default attribute values (gradientUnits, spreadMethod, x1, y1, etc) +# * analysis of path elements to see if rect can be used instead? +# * removal of unused attributes in groups: +# +# +# +# +# +# in this case, fill="blue" should be removed +# * Move common attributes up to a parent group: +# +# +# +# +# +# becomes: +# +# +# +# +# + # Suggestion from Richard Hutch: # * Put id attributes first in the serialization (or make the d attribute last) # This would require my own serialization of the DOM objects (not impossible) # Next Up: # + remove duplicate gradients -# - scour polyline coordinates just like path coordinates -# - if after reducing precision we have duplicate path segments, then remove the duplicates and -# leave it as a straight line segment +# + remove all empty path segments +# + scour polyline coordinates just like path coordinates # - enable the precision argument to affect all numbers: polygon points, lengths, coordinates # - remove id if it matches the Inkscape-style of IDs (also provide a switch to disable this) # - prevent elements from being stripped if they are referenced in a