Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Feature request: remove duplicate x/y in tspan #224

Open
Artoria2e5 opened this issue Jan 9, 2021 · 2 comments
Open

Feature request: remove duplicate x/y in tspan #224

Artoria2e5 opened this issue Jan 9, 2021 · 2 comments

Comments

@Artoria2e5
Copy link

It is a common pattern for Inkscape to put x/y coordinates in a <text> element, only to repeat it again in the <tspan> element. There should be some space saving out of these cases, especially for files with a large number of these elements.

The below test case is from File:CtDNA.svg on Wikimedia Commons:

<g fill="#0bc056">
    <text letter-spacing="-5" x="3.643575" y="22.362129" text-align="center"><tspan dx="0 0 0 0 0 0 0 0 0 0 2.28" font-size="72.5" x="1.143574" y="22.362129" sodipodi:role="line">chloroplast dna</tspan></text>
    <g font-family="'Frutiger Neue 35','Segoe UI',Ubuntu,sans-serif" font-weight="200" letter-spacing="0">
        <text font-style="italic" x="3.279297" y="-57.637871" text-align="center"><tspan font-size="30" x="3.279297" y="-57.637871" sodipodi:role="line">nicotiana tabacum</tspan></text>
        <text font-size="25" x="1.579299" xml:space="preserve" y="72.362129" text-align="center"><tspan dx="0 -3.159999" fill="#0bc056" font-size="25" letter-spacing="0" text-anchor="middle" text-align="center">155,939</tspan><tspan fill="#0bc056" font-family="'Frutiger Neue 35','Segoe UI',Ubuntu,sans-serif" font-weight="200" font-size="25" letter-spacing="0" text-anchor="middle" text-align="center"> base pairs</tspan></text>
    </g>
</g>
@RazrFalcon
Copy link
Owner

Yes, text element optimization is pretty simple right now.

@JoKalliauer
Copy link
Contributor

There are some feature-requests relating to tspan/text: (beging with the most similar one)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants