scour icon indicating copy to clipboard operation
scour copied to clipboard

group-collapsing

Open JoKalliauer opened this issue 6 years ago • 2 comments

Running scour for InputOutput.svg.txt does not collapse groups.

scour -i InputOutput.svg.txt -o InputOutput.svg.txt

If I understand --disable-group-collapsing correctly then it should collapse groups by default.

Input=Output

InputOutput.svg.txt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg viewBox="0 0 1e3 1e3" xmlns="http://www.w3.org/2000/svg">
 <g font-family="Liberation Sans,Arial,Helvetica,sans-serif">
  <g text-anchor="middle">
   <g font-weight="400">
    <g font-size="64">
     <text x="99" y="99">Text</text>
    </g>
   </g>
  </g>
 </g>
</svg>

desired output

whish.svg.txt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg  PUBLIC '-//W3C//DTD SVG 1.1//EN'  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg viewBox="0 0 1e3 1e3" xmlns="http://www.w3.org/2000/svg">
 <text x="99" y="99" font-family="Liberation Sans,Arial,Helvetica,sans-serif" font-size="64" font-weight="400" text-anchor="middle">Text</text>
</svg>

Or what does group collapsing mean? (maybe one example)

JoKalliauer avatar Oct 22 '18 19:10 JoKalliauer

One group would be also ok. For groups and text there are much more optimizations possible, e.g. including anti-groups and full transformation resolution.

Perhelion avatar Oct 23 '18 19:10 Perhelion

Yes id love to see support for removing all groups where possible

Gibbz avatar Sep 06 '19 01:09 Gibbz