[xep-support] dy attribute in tspan ignored when text-anchor != start

From: Darren Munt <darrenm@ardex.com.au>
Date: Tue Mar 12 2013 - 17:07:17 PST

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!

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Tue Mar 12 17:10:10 2013

This archive was generated by hypermail 2.1.8 : Tue Mar 12 2013 - 17:10:18 PST