RE: Text and Tspan and Anchors - OH MY

To partly answer my own question - the issue biting me again is the occurrence of spaces and newlines within the text content that the spacing engines get confused as heck about.


From: Smailus, Thomas O
Sent: Thursday, March 12, 2015 16:35
To: www-svg
Subject: Text and Tspan and Anchors - OH MY

I'm curious about what this SVG 1.2se should be rendered as:

The text specifies a location and length, the tspan elements should FILL that extent, yes?
But no, that's not the case (http://jsfiddle.net/thomassmailus/rxzatmnz/ )

These sorts of issues are creating grief in converting technical diagrams that were exported as CGM from authoring systems.
Sure, if one authored it well, the entire sequence would be in ONE tspan, but that's beyond our control.

However, a predictable and logical implementation of things isn't.

I'm expecting the text to evenly be distributed over the space (represented by the rectangle in the test).

Or am I misunderstanding what should happen?

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"                 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
                viewBox="0.0545419 -10.8756 129.657 82.6275" preserveAspectRatio="xMidYMid" xml:space="preserve"
                zoomAndPan="magnify"  >

                <rect stroke-width="0.0403194" stroke="rgb(180,180,0)"  fill="none"  x="3.54794" y="-7.77297" width="122.67" height="2.01597"  />

                <text id="T4" x="126.218" y="-5.757" textLength="122.67" cgmTextHeight="2.01597"
                                lengthAdjust="spacingAndGlyphs" text-anchor="end" >

                                <tspan  font-family="arial" fill="rgb(55,52,53)"  font-size="2.82236"
                                                >This is the first very long right alinged tspan in the text and</tspan>
                                <tspan  font-family="arial" fill="rgb(55,52,53)"  font-size="2.82236"
                                                >this is the second one</tspan>

                </text>
</svg>

Received on Friday, 13 March 2015 00:20:55 UTC