[xep-support] dy attribute in tspan ignored when text-anchor != start
Darren Munt
darrenm at ardex.com.au
Tue Mar 12 18:07:17 PDT 2013
I tried with this one already but got no reply, perhaps because I included a screenshot of the issue. I'll try again with text only.
When a tspan element has the text-anchor attribute set to anything other than 'start', the dy attribute appears to be ignored. I am trying to align text within a grid and I have left- and right-aligned labels which must appear on the same y coordinate.
In order to support web browsers and RenderX from the same code, and because they all use different baselines for text, I am using the dy attribute to apply an offset from the y coordinate of the enclosing text element. This allows all text to be positioned with a common set of coordinates, making allowances for different implementations of SVG. However the issue I am having is that RenderX appears to ignore the dy attribute for tspan elements that are within text elements with a text-anchor attribute set to 'end' or 'center'.
The upshot is that using the same bit of code to set up a tspan element, I get different y alignment when text-anchor is not 'start'. For example:
<text x="24" y="28" text-anchor="start" stroke="none" stroke-width="0" fill="#5c477a" font-size="16px" font-weight="bold">
<tspan dy="16">Change Agent</tspan>
</text>
<text x="316" y="28" text-anchor="end" stroke="none" stroke-width="0" fill="#5c477a" font-size="16px" font-weight="bold">
<tspan dy="16">Transformer</tspan>
</text>
According to my understanding, the above should produce two blocks of text which are aligned horizontally on the page. However in RenderX, the second line is 16 pixels (or the equivalent metric in the PDF) higher.
The same code in Google Chrome produces text that is horizontally aligned as expected.
Can you advise if this issue will be resolved, or will I need to build in a workaround?
!DSPAM:87,513fd1ef9851322784897!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20130313/5f564e5d/attachment.html>
More information about the Xep-support
mailing list