svg/svgo

mergeText plugin to consolidate text/tspan elements

johnkenny54 opened this issue · 0 comments

The Inkscape text tool creates verbose and redundant elements, with a <tspan> inside a <text> element. These can often be consolidated, by merging adjacent <text> elements, resulting in a single <text> element containing multiple <tspan> elements.

For example:

   <text x="45.869" y="38.606">
        <tspan x="45.869" y="38.606">Part one</tspan>
    </text>
    <text x="87.151" y="89.826">
        <tspan x="87.151" y="89.826">Part two</tspan>
    </text>

becomes

   <text>
        <tspan x="45.869" y="38.606">Part one</tspan>
        <tspan x="87.151" y="89.826">Part two</tspan>
    </text>

A <text> element containing a single <tspan> can also be consolidated - see issue #964