Remove text styles from shapes. Remove --inkscape styles. Fix path handling for multiple coords in first Move command. Add --set-precision N argument

This commit is contained in:
JSCHILL1 2009-05-19 10:02:47 -05:00
parent dcb6ed414c
commit 49b35bf6d1
8 changed files with 455 additions and 15 deletions

View file

@ -5,3 +5,6 @@ Thanks to the following contributors to scour:
- report file size reduction
- prettied up the report
* Martin:
- better methods of handling string-to-float conversions in Python
- document functions in the traditional Python way

360
fulltests/boom.svg Normal file
View file

@ -0,0 +1,360 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
sodipodi:docname="boom.svg"
inkscape:version="0.46+devel r21091"
sodipodi:version="0.32"
id="svg2"
height="11.74115"
width="51.220928"
version="1.0"
inkscape:export-filename="D:\Vector_Art\my_folder\boom.png"
inkscape:export-xdpi="980.45862"
inkscape:export-ydpi="980.45862">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.9195959"
inkscape:cx="38.929314"
inkscape:cy="4.1411478"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="673"
inkscape:window-x="-4"
inkscape:window-y="-4" />
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1"
transform="translate(-153.05758,-481.955)">
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 175.0629,491.71688 -0.83407,1.09766 0.27183,0.55361 0.56929,-1.65036 z"
id="path8077" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 189.8071,484.43615 -0.53125,0.0625 0.9375,0.125 -0.40625,-0.1875 z"
id="path8075" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 153.05758,485.66311 3,0.34375 0,-1 c 0.0277,-0.004 0.0807,-0.0292 0.125,-0.0312 0.0443,-0.001 0.1044,10e-6 0.1875,0 0.51508,10e-6 0.91057,0.0772 1.1875,0.21875 0.27692,0.14162 0.40625,0.36133 0.40625,0.625 0,0.17023 -0.13032,0.25469 -0.21875,0.375 l 2.8125,0.3125 c 0.21872,-0.25389 0.3125,-0.54948 0.3125,-0.875 0,-0.36458 -0.10837,-0.67056 -0.34375,-0.9375 -0.2354,-0.26692 -0.57157,-0.49349 -1.03125,-0.65625 -0.31017,-0.10742 -0.70131,-0.17325 -1.125,-0.21875 -0.42371,-0.0456 -1.11898,-0.0625 -2.09375,-0.0625 l -3.21875,0 0,1.90625 z"
id="path8073" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 154.18935,487.58762 7.59375,0.84375 c -0.28487,-0.25275 -0.6406,-0.47199 -1.15625,-0.625 0.48186,-0.24089 0.84372,-0.49608 1.0625,-0.75 l -2.8125,-0.3125 c -0.0688,0.0936 -0.0651,0.21784 -0.1875,0.28125 -0.2797,0.14478 -0.72542,0.21876 -1.3125,0.21875 l -0.1875,0 0,-0.6875 -3,-0.34375 0,1.375 z"
id="path8071" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 154.188,489.19062 3,-0.0312 0,-0.65625 0.21875,0 c 0.67015,0 1.15858,0.0707 1.46875,0.21875 0.18417,0.088 0.20644,0.25804 0.28125,0.40625 l 3.03125,-0.0312 c -0.0678,-0.22562 -0.10232,-0.47523 -0.28125,-0.65625 -0.0277,-0.028 -0.0947,-0.0356 -0.125,-0.0625 l -7.59375,-0.84375 0,1.65625 z"
id="path8069" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 162.07849,491.3724 c 0.0491,-0.0606 0.14563,-0.0916 0.1875,-0.15625 0.19387,-0.29947 0.28124,-0.6022 0.28125,-0.9375 0,-0.15409 -0.11494,-0.26873 -0.15625,-0.40625 l -3.03125,0.0312 c 0.0512,0.10139 0.1875,0.15167 0.1875,0.28125 -10e-6,0.34179 -0.15306,0.60873 -0.46875,0.78125 -0.3157,0.17249 -0.81166,0.25001 -1.4375,0.25 l -0.25,0 0,-1.28125 -3,0.0312 0,2.59375 0.0937,0 7.59375,-1.1875 z"
id="path8067" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 161.25156,492.03342 -7.59375,1.1875 3.46875,0 c 1.01908,0 1.79385,-0.0404 2.28125,-0.125 0.48739,-0.0846 0.88643,-0.23243 1.21875,-0.4375 0.27355,-0.16589 0.44675,-0.40509 0.625,-0.625 z"
id="path8065" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 176.96185,489.66616 -0.5625,0.53125 0.65625,0.1875 c -0.054,-0.19507 -0.0784,-0.39131 -0.0937,-0.71875 z"
id="path8063" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 183.93913,487.38273 2,-0.15625 -1.625,-0.25 -0.9375,0.1875 0.5625,0.21875 z"
id="path8061" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 199.45117,486.63786 0,0.25 0.75,3.03125 1.5625,0 0.65625,-3.03125 0,-0.5 -2.96875,0.25 z"
id="path8059" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 200.0064,485.9279 2.80392,-1.00699 -0.38675,-1.44929 -2.86838,0.76544 0.45121,1.69084 z"
id="path8057" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 187.25255,488.26814 -0.0625,-1.0625 -2.59375,0.21875 0,0.46875 2.65625,0.375 z"
id="path8055" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 190.39829,488.98188 c -0.0237,-0.10402 -0.0394,-0.20859 -0.0625,-0.3125 -0.0858,-0.38573 -0.15125,-0.6087 -0.15625,-0.625 l -0.25,-0.75 -2.1875,0.1875 0.40625,1.15625 2.25,0.34375 z"
id="path8053" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 194.18218,487.34807 -2.25,0.15625 -0.3125,0.875 c -0.0166,0.0456 -0.0795,0.25945 -0.1875,0.6875 -0.0312,0.12357 -0.0656,0.20046 -0.0937,0.3125 l 2.03125,0.28125 0.8125,-2.3125 z"
id="path8051" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 194.33554,489.27454 2.6875,0.40625 0,-3.0625 -2.59375,0.1875 -0.0937,2.46875 z"
id="path8049" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 184.40424,492.30409 -0.0625,-0.0625 0,0.0625 0.0625,0 z"
id="path8047" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 187.01276,492.0655 -2.78125,-1.03125 0,1.8125 0.0625,0.0625 2.75,0 -0.0312,-0.84375 z"
id="path8045" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 188.64947,491.96422 -1.30358,-0.48884 0.16295,0.48884 1.14063,0 z"
id="path8043" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 194.21718,493.13566 0.15625,0.0625 2.6875,0 0,-2.53125 -2.6875,-0.40625 -0.15625,2.875 z m 5.3125,-1.65625 0,1.71875 2.90625,0 0,-1.71875 -2.90625,0 z"
id="path8039" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 189.1633,492.07115 0.5,1.4375 0.5,0.1875 1.84375,0 0.1875,-0.59375 -3.03125,-1.03125 z"
id="path8037" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 189.13468,491.77839 3.03125,1.03125 0.875,-2.46875 -2.03125,-0.28125 c -0.0694,0.27609 -0.13628,0.57517 -0.1875,0.78125 -0.0688,-0.28302 -0.12315,-0.56159 -0.1875,-0.84375 l -2.25,-0.34375 0.75,2.125 z"
id="path8035" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 184.20237,489.47837 0,1.125 2.78125,1.03125 -0.0625,-1.21875 -2.71875,-0.9375 z"
id="path8033" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 184.56489,489.4341 2.71875,0.9375 -0.0625,-1.78125 -2.65625,-0.375 0,1.21875 z"
id="path8031" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 183.83587,487.87422 -0.1875,-0.0312 -2,0.15625 2.21875,0.75 c 7.1e-4,-0.0689 0.0312,-0.0842 0.0312,-0.15625 0,-0.32893 -0.0478,-0.45436 -0.0625,-0.71875 z"
id="path8029" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 182.63508,487.89376 -0.1875,0 0.1875,0.0312 c -6.4e-4,-0.0114 6.6e-4,-0.02 0,-0.0312 z"
id="path8027" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 182.62081,487.29212 -1.75,0.375 1.625,0.25 0.1875,0 c -0.0134,-0.22776 -0.0379,-0.44616 -0.0625,-0.625 z"
id="path8025" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 189.20039,484.32467 -0.3125,-0.90625 -4.1875,0 0,1.9375 4.5,-1.03125 z"
id="path8023" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 189.31866,485.02726 -4.5,1.03125 0,0.90625 2.59375,-0.21875 -0.0312,-0.90625 0.3125,0.90625 2.1875,-0.1875 -0.5625,-1.53125 z"
id="path8021" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 196.31482,483.20811 -1.3125,0 -0.125,0.3125 1.4375,-0.3125 z"
id="path8019" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 194.11743,483.92852 -1.4375,0.3125 -0.6875,2 2.25,-0.15625 0.15625,-0.4375 -0.0312,0.40625 2.59375,-0.1875 0,-1.9375 -2.84375,0 z"
id="path8017" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.31361,487.34873 1.28125,0.1875 1.75,-0.375 c -0.0233,-0.16998 -0.0291,-0.46797 -0.0625,-0.59375 -0.0721,-0.27107 -0.2373,-0.4297 -0.375,-0.625 l -2.59375,1.40625 z"
id="path8015" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.2312,487.39287 0.28125,0.0937 0.9375,-0.1875 -1.28125,-0.1875 c 0.0111,0.11189 0.0573,0.14843 0.0625,0.28125 z"
id="path8013" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.55726,488.08241 0.28125,-0.0625 -0.28125,-0.0937 c 0.003,0.0709 -0.001,0.0793 0,0.15625 z"
id="path8011" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.38728,487.53858 0.8125,-0.0625 -0.5625,-0.21875 -0.28125,0.0625 c 6.8e-4,0.0489 0.0312,0.0424 0.0312,0.0937 l 0,0.125 z"
id="path8009" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.89776,488.9688 2.9375,1.09375 c 0.035,-0.31864 0.0891,-0.58098 0.0937,-1.03125 l -2.21875,-0.75 -0.8125,0.0625 0,0.625 z"
id="path8007" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.48097,489.24636 2.6875,1.8125 c 0.0508,-0.1146 0.15234,-0.17969 0.1875,-0.3125 0.0439,-0.16575 0.036,-0.54011 0.0625,-0.78125 l -2.9375,-1.09375 0,0.375 z"
id="path8005" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 180.38054,490.11236 1.40625,2.375 c 0.3718,-0.14979 0.74421,-0.29766 1,-0.53125 0.18144,-0.16219 0.2658,-0.44117 0.375,-0.6875 l -2.6875,-1.8125 0,0.21875 c 0,0.23659 -0.0791,0.25222 -0.0937,0.4375 z"
id="path8003" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 179.63924,491.37228 0.21875,1.53125 c 0.41753,-0.0398 0.88046,-0.0317 1.21875,-0.125 0.17076,-0.0471 0.25475,-0.15772 0.40625,-0.21875 l -1.40625,-2.375 c -0.0363,0.45968 -0.0612,0.94991 -0.1875,1.09375 -0.0479,0.0545 -0.18115,0.054 -0.25,0.0937 z"
id="path8001" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 176.46769,490.76171 -1.1875,1.09375 c 0.34384,0.26758 0.73399,0.51453 1.25,0.65625 0.59261,0.16274 1.32547,0.21875 2.15625,0.21875 0.35432,0 0.59575,-0.0641 0.90625,-0.0937 l -0.21875,-1.53125 c -0.18615,0.10755 -0.34787,0.21875 -0.6875,0.21875 -0.47076,0 -0.82277,-0.10579 -1,-0.3125 -0.0147,-0.0171 -0.0178,-0.10374 -0.0312,-0.125 l -1.1875,-0.125 z"
id="path7999" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 163.11135,484.00569 1.17178,0.2296 c -0.0369,-0.0717 -0.006,-0.29724 -0.0263,-0.41019 l -0.63708,-0.24484 -0.50839,0.42543 z"
id="path7997" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 174.73148,490.5488 -0.5625,0.3125 c 0.11267,0.34387 0.24618,0.639 0.46875,0.84375 0.0472,0.0425 0.13645,0.054 0.1875,0.0937 l 1.1875,-1.09375 -1.28125,-0.15625 z"
id="path7995" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 172.59915,490.56053 1.28125,0.15625 0.46875,-0.46875 -0.8125,-0.25 -0.9375,0.5625 z"
id="path7993" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 174.80141,490.20604 c 0.0121,0.0599 0.0174,0.19776 0.0312,0.25 0.014,0.0527 0.0462,0.0753 0.0625,0.125 l 0.5625,-0.3125 -0.65625,-0.0625 z"
id="path7991" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 174.51502,490.06839 0.65625,0.0625 0.9375,-0.5625 -0.65625,-0.1875 -0.96875,0.28125 c 0.0151,0.117 0.0116,0.30933 0.0312,0.40625 z"
id="path7989" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 172.24261,491.00574 -6.25,1.84375 c 0.59262,0.16274 1.29421,0.21875 2.125,0.21875 0.83077,0 1.53515,-0.056 2.125,-0.21875 0.58985,-0.16276 1.07749,-0.42123 1.4375,-0.75 0.26583,-0.23764 0.45175,-0.58171 0.5625,-1 0.005,-0.0198 -0.005,-0.0729 0,-0.0937 z"
id="path7987" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 171.11293,489.7804 -2.0625,0.34375 2,0.21875 c 0.0247,-0.15035 0.0469,-0.37275 0.0625,-0.5625 z"
id="path7985" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 172.90125,488.72487 0.28125,0.0937 c 4.6e-4,-0.0275 0.0309,-0.0345 0.0312,-0.0625 l -0.3125,-0.0312 z"
id="path7983" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 170.14047,488.37905 2.71875,0.3125 -2.71875,-0.8125 0,0.5 z"
id="path7981" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 169.02891,489.6818 3.03125,-0.0312 c 0.0198,-0.24116 0.0261,-0.41395 0.0312,-0.71875 l -0.28125,-0.0937 -2.71875,-0.3125 0,0.84375 c 0,0.16856 -0.0551,0.16998 -0.0625,0.3125 z"
id="path7979" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 168.36672,489.9194 1,0.125 2.0625,-0.34375 -3.03125,0.0312 c -0.004,0.085 -0.0242,0.11176 -0.0312,0.1875 z"
id="path7977" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 169.20727,490.13996 1.0625,-0.15625 -1,-0.125 c -0.0107,0.11473 -0.0457,0.18778 -0.0625,0.28125 z"
id="path7975" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 166.92861,490.67952 -2.9375,0.4375 c 0.10955,0.27173 0.21849,0.54602 0.40625,0.71875 0.35929,0.32315 0.82756,0.58723 1.40625,0.75 0.0101,0.003 0.0211,-0.003 0.0312,0 l 6.25,-1.84375 c 0.0184,-0.0771 0.0162,-0.25201 0.0312,-0.34375 l -2,-0.21875 -1.0625,0.15625 c -0.0443,0.24681 -0.0385,0.65145 -0.125,0.75 -0.17724,0.20183 -0.50353,0.3125 -0.96875,0.3125 -0.47078,0 -0.79152,-0.10579 -0.96875,-0.3125 -0.047,-0.0548 -0.028,-0.30889 -0.0625,-0.40625 z"
id="path7973" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 166.75389,489.59554 -3.03125,0.0312 c 0.0276,0.30224 0.0106,0.74236 0.0625,0.9375 0.0291,0.1096 0.11715,0.15301 0.15625,0.25 l 2.9375,-0.4375 c -0.0664,-0.18742 -0.10465,-0.43596 -0.125,-0.78125 z"
id="path7971" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 166.27075,489.16777 -3.0625,-0.34375 c 0.008,0.17895 0.0486,0.31685 0.0625,0.46875 l 3.03125,-0.0312 c -0.003,-0.0426 -0.0294,-0.0488 -0.0312,-0.0937 z"
id="path7969" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 166.26936,487.64171 -3,-0.3125 c -0.0161,0.27394 -0.0625,0.40515 -0.0625,0.75 0,0.26813 0.0215,0.36849 0.0312,0.59375 l 3.0625,0.34375 c -0.005,-0.11607 -0.0312,-0.11794 -0.0312,-0.25 l 0,-1.125 z"
id="path7967" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 163.80987,485.17304 c -0.1403,0.19814 -0.30028,0.37513 -0.375,0.65625 -0.0685,0.25789 -0.0676,0.77382 -0.0937,1.21875 l 3,0.3125 0,-0.21875 c 0,-0.46253 0.10035,-0.60857 0.15625,-0.875 l -2.6875,-1.09375 z"
id="path7965" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 172.37527,486.50227 c -0.0274,-0.28076 -0.0133,-0.68993 -0.0625,-0.875 -0.11077,-0.41666 -0.29667,-0.73112 -0.5625,-0.96875 -0.36556,-0.33203 -0.8532,-0.58886 -1.4375,-0.75 -0.58432,-0.1611 -1.28869,-0.24999 -2.125,-0.25 -0.74502,10e-6 -1.35277,0.0892 -1.90625,0.21875 l 6.09375,2.625 z"
id="path7963" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 172.0584,486.55792 -6.09375,-2.625 c -0.0637,0.0149 -0.15757,0.0146 -0.21875,0.0312 -0.59263,0.16114 -1.07196,0.41797 -1.4375,0.75 -0.0829,0.0762 -0.11986,0.21697 -0.1875,0.3125 l 2.6875,1.09375 c 0.0436,-0.20796 0.0161,-0.59902 0.0937,-0.6875 0.17723,-0.20182 0.50905,-0.28124 0.96875,-0.28125 0.47077,1e-5 0.78873,0.0843 0.96875,0.28125 0.1765,0.19312 0.27783,0.72615 0.28125,1.53125 7e-5,0.0159 0,0.0151 0,0.0312 l 2.71875,0.8125 0.3125,0.0312 c 9.9e-4,-0.0807 0,-0.10247 0,-0.1875 -1e-5,-0.50119 -0.0595,-0.74241 -0.0937,-1.09375 z"
id="path7961" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 173.75279,483.00454 1.21534,0.72449 0.50945,0.16308 -1.42718,-1.54182 c -0.0676,0.13898 -0.11238,0.1717 -0.18368,0.32843 -0.0644,0.14154 -0.0584,0.19607 -0.11393,0.32582 z"
id="path7959" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 173.37065,492.40845 1.05517,-0.90835 -1.27872,0.60566 c 0.0842,0.12877 0.14544,0.19031 0.22351,0.30272 z"
id="path7957" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 188.51409,486.87386 2.57902,0.16158 c -0.0654,-0.10611 -0.17156,-0.19003 -0.23873,-0.28687 l -2.34015,0.12525 z"
id="path7955" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 162.83938,487.2489 -0.67465,-0.13229 c -0.0142,0.1248 -0.0344,0.26528 -0.0415,0.37399 l 1.00477,-0.0896 -0.28863,-0.15208 z"
id="path7953" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 174.35328,489.58537 1.03125,-0.28125 -0.0937,-0.0312 -0.9375,-0.125 -1.375,0.21875 0.71875,0.25 0.65625,-0.0312 z"
id="path7951" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 179.78821,483.30186 -0.20576,0.87322 0.27172,-0.15681 1.03066,-2.06327 -1.0962,1.34689 z"
id="path7947" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 165.41888,492.87127 -1.54538,0.43352 -0.59583,0.29697 1.2526,-0.15665 0.88861,-0.57384 z"
id="path7945" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 176.81056,490.23121 -0.8125,0 -0.53125,0.3125 0.8125,0.25 0.5625,-0.53125 c -7.6e-4,-0.0162 -0.0306,-0.0147 -0.0312,-0.0312 z"
id="path7941" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 178.40744,484.87664 -0.68079,-0.12575 -0.27231,0.2519 1.02118,0.88167 c -0.0109,-0.46782 -0.068,-0.47536 -0.068,-1.00762 z"
id="path7939" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 201.45976,485.94342 2.81875,-0.63505 -1.27513,0.0495 -1.55055,0.51347 0.007,0.0723 z"
id="path7935" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 184.21393,485.19417 -1.09375,0.15625 0.40625,0.1875 0.125,0 0.5625,-0.15625 0,-0.1875 z"
id="path7933" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 176.54569,488.65881 -2.875,-1.84375 c -0.0897,0.33739 -0.13918,0.93621 -0.15625,1.59375 l 1.9375,0.8125 1.09375,-0.15625 0,-0.40625 z"
id="path7931" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 176.56194,487.03348 -1.90625,-1.84375 c -0.17592,0.10306 -0.42074,0.15248 -0.5625,0.28125 -0.25477,0.23437 -0.42051,0.55209 -0.53125,0.96875 l 2.875,1.84375 0,-0.53125 c 0,-0.37966 0.0873,-0.47122 0.125,-0.71875 z"
id="path7929" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 177.06321,485.74966 -0.5625,-1.53125 c -0.22442,0.0358 -0.52089,0.04 -0.71875,0.0937 -0.36279,0.0987 -0.59731,0.30606 -0.875,0.46875 l 1.90625,1.84375 c 0.044,-0.28941 0.0295,-0.73496 0.125,-0.84375 0.0226,-0.0258 0.0978,-0.009 0.125,-0.0312 z"
id="path7927" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 178.79149,484.67123 0.53125,-1.5 c -0.38011,-0.0476 -0.70169,-0.12499 -1.15625,-0.125 -0.55339,1e-5 -0.98978,0.0848 -1.4375,0.15625 l 0.5625,1.53125 c 0.18606,-0.15359 0.44272,-0.24999 0.84375,-0.25 0.31852,1e-5 0.47084,0.0974 0.65625,0.1875 z"
id="path7925" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 181.75983,484.88035 c -0.29731,-0.19016 -0.56911,-0.38979 -0.96875,-0.5 -0.26674,-0.0735 -0.64951,-0.085 -0.96875,-0.125 l -0.53125,1.5 c 0.0886,0.0431 0.25429,0.0301 0.3125,0.0937 0.0827,0.0905 0.0803,0.49388 0.125,0.71875 l 2.03125,-1.6875 z"
id="path7923" />
<path
style="font-size:13.04389477px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ff0000;font-family:Swis721 BlkCn BT;-inkscape-font-specification:Swis721 BlkCn BT"
d="m 182.35606,484.87755 -2.03125,1.6875 c 0.0195,0.0982 0.0502,0.18865 0.0625,0.3125 l 2.59375,-1.40625 c -0.074,-0.10489 -0.0946,-0.26072 -0.1875,-0.34375 -0.11552,-0.10493 -0.30013,-0.16214 -0.4375,-0.25 z"
id="path2809" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 37 KiB

View file

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Before After
Before After

View file

@ -16,6 +16,10 @@
<ul>
<li>properly deal with fill="url(&amp;quot;#foo&amp;quot;)"</li>
<li>properly handle paths with more than 1 pair of coordinates in the first Move command</li>
<li>remove font/text styles from shape elements (font-weight, font-size, line-height, etc)</li>
<li>remove -inkscape-font-specification styles</li>
<li>added --set-precision argument to set the number of significant digits (defaults to 6)</li>
</ul>
</section>

View file

@ -42,6 +42,10 @@
# Next Up:
# + recognize that fill="url(&quot;#grd1&quot;)" is legal and do not remove grd1 gradient
# + properly handle paths with more than 1 pair of coordinates in the first Move command
# + remove font/text styles from non-text elements
# + remove -inkscape-font-specification styles
# + added --set-precision argument to set the number of significant digits (defaults to 6)
# - prevent elements from being stripped if they are referenced in a <style> element
# (for instance, filter, marker, pattern) - need a crude CSS parser
# - Remove any unused glyphs from font elements?
@ -61,7 +65,7 @@ from svg_regex import svg_parser
from decimal import *
import gzip
# set precision to 6 decimal places
# set precision to 6 decimal places by default
getcontext().prec = 6
APP = 'scour'
@ -455,10 +459,13 @@ numPathSegmentsReduced = 0
numBytesSavedInPathData = 0
numBytesSavedInColors = 0
# removes all unreferenced elements except for <svg>, <font>, <metadata>, <title>, and <desc>
# also vacuums the defs of any non-referenced renderable elements
# returns the number of unreferenced elements removed from the document
def removeUnreferencedElements(doc):
"""
Removes all unreferenced elements except for <svg>, <font>, <metadata>, <title>, and <desc>.
Also vacuums the defs of any non-referenced renderable elements.
Returns the number of unreferenced elements removed from the document.
"""
global numElemsRemoved
num = 0
removeTags = ['linearGradient', 'radialGradient', 'pattern']
@ -496,9 +503,12 @@ def removeUnreferencedElements(doc):
return num
# removes the unreferenced ID attributes
# returns the number of ID attributes removed
def removeUnreferencedIDs(referencedIDs, identifiedElements):
"""
Removes the unreferenced ID attributes.
Returns the number of ID attributes removed
"""
global numIDsRemoved
keepTags = ['font']
num = 0;
@ -773,6 +783,23 @@ def repairStyle(node, options):
del styleMap[uselessStrokeStyle]
num += 1
# remove font properties for non-text elements
if node.nodeName in ['rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'path']:
for fontstyle in [ 'font-family', 'font-size', 'font-stretch', 'font-size-adjust',
'font-style', 'font-variant', 'font-weight',
'letter-spacing', 'line-height', 'kerning',
'text-anchor', 'text-decoration', 'text-rendering',
'unicode-bidi', 'word-spacing', 'writing-mode'] :
if styleMap.has_key(fontstyle) :
del styleMap[fontstyle]
num += 1
# remove inkscape-specific styles
for inkscapeStyle in ['-inkscape-font-specification']:
if styleMap.has_key(inkscapeStyle):
del styleMap[inkscapeStyle]
num += 1
# TODO: what else?
# visibility: visible
@ -823,10 +850,6 @@ def repairStyle(node, options):
return num
# convert blue to rgb(r,g,b)
# convert rgb(r%,g%,b%) to rgb(r,g,b)
# convert rgb(r,g,b) to #RRGGBB
# finally convert #RRGGBB to #RGB if possible
rgb = re.compile("\\s*rgb\\(\\s*(\\d+)\\s*\\,\\s*(\\d+)\\s*\\,\\s*(\\d+)\\s*\\)\\s*")
rgbp = re.compile("\\s*rgb\\(\\s*(\\d*\\.?\\d+)\\%\\s*\\,\\s*(\\d*\\.?\\d+)\\%\\s*\\,\\s*(\\d*\\.?\\d+)\\%\\s*\\)\\s*")
def convertColor(value):
@ -962,7 +985,22 @@ def cleanPath(element) :
# convert absolute coordinates into relative ones (start with the second subcommand
# and leave the first M as absolute)
if len(path[0][1]) == 2:
(x,y) = path[0][1]
else:
# we have a move and then 1 or more coords for lines
N = len(path[0][1])
if path[0] == 'M':
# take the last pair of coordinates for the starting point
x = path[0][1][N-2]
y = path[0][1][N-1]
else: # m, accumulate coordinates for the starting point
(x,y) = path[0][1][0],path[0][1][1]
n = 2
while n < N:
x += path[0][1][n]
y += path[0][1][n+1]
n += 2
i = 1
for (cmd,data) in path[1:]:
# adjust abs to rel
@ -1124,9 +1162,11 @@ def serializePath(pathObj):
# pathStr += ' '
return pathStr
# converts raster references to inline images
# NOTE: there are size limits to base64-encoding handling in browsers
def embedRasters(element) :
"""
Converts raster references to inline images.
NOTE: there are size limits to base64-encoding handling in browsers
"""
global numRastersEmbedded
href = element.getAttributeNS(NS['XLINK'],'href')
@ -1343,11 +1383,13 @@ def printSyntaxAndQuit():
print ' --disable-style-to-xml : Scour will not convert style properties into XML attributes'
print ' --disable-group-collapsing : Scour will not collapse <g> elements'
print ' --enable-id-stripping : Scour will remove all un-referenced ID attributes'
print ' --set-precision N : Scour will set the number of significant digits (default: 6)'
print ''
quit()
# returns a tuple with:
# input stream, output stream, and a list of options specified on the command-line
# input stream, output stream, a list of options specified on the command-line,
# input filename, and output filename
def parseCLA():
args = sys.argv[1:]
@ -1362,6 +1404,7 @@ def parseCLA():
'--disable-style-to-xml',
'--disable-group-collapsing',
'--enable-id-stripping',
'--set-precision',
]
i = 0
@ -1390,6 +1433,13 @@ def parseCLA():
continue
else:
printSyntaxAndQuit()
elif arg == '--set-precision':
if i < len(args):
getcontext().prec = int(args[i])
i += 1
continue
else:
printSyntaxAndQuit()
elif arg in validOptions :
options.append(arg)
else :
@ -1401,7 +1451,6 @@ def parseCLA():
if __name__ == '__main__':
startTimes = os.times()
# print times[0], times[1]
(input, output, options, inputfilename, outputfilename) = parseCLA()

View file

@ -160,6 +160,22 @@
<td>6381</td><td>47.22%</td>
<td>6381</td><td>47.22%</td>
</tr>
<tr>
<td><a href="fulltests/boom.svg">boom.svg</a></td>
<td>38021</td>
<td>34951</td><td>91.93%</td>
<td>34233</td><td>90.04%</td>
<td>34308</td><td>90.23%</td>
<td>34172</td><td>89.88%</td>
<td>35372</td><td>93.03%</td>
<td>35369</td><td>93.02%</td>
<td>35199</td><td>92.58%</td>
<td>36286</td><td>95.44%</td>
<td>36286</td><td>95.44%</td>
<td>N/A</td><td>N/A</td>
<td>N/A</td><td>N/A</td>
<td>N/A</td><td>N/A</td>
</tr>
<tr>
<td><a href="fulltests/dragonfly.svg">dragonfly.svg</a></td>
<td>679018</td>

View file

@ -543,5 +543,10 @@ class AllowQuotEntitiesInUrl(unittest.TestCase):
self.assertEquals( len(grads), 1,
'Removed referenced gradient when &quot; was in the url')
class RemoveFontStylesFromNonTextShapes(unittest.TestCase):
def runTest(self):
r = scour.scourXmlFile('unittests/font-styles.svg').getElementsByTagNameNS(SVGNS, 'rect')[0]
self.assertEquals( r.getAttribute('font-size'), '',
'font-size not removed from rect' )
if __name__ == '__main__':
unittest.main()

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg">
<rect style="font-size:20px" width="100" height="100" />
</svg>

After

Width:  |  Height:  |  Size: 106 B