Comment 3 for bug 516216

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

I've tracked down the problem to lines 532-3 in sp-text.cpp. The "x" and "y" attributes are being stripped from the <tspan>s before the data is sent to the layout engine. As a result, the running total "dy" does not get reset to zero in Layout-TNG-compute.cpp.

According to SVG 1.1 spec:
    An absolute position adjustment occurs in the following circumstances:
    * At the start of a 'text' element
    * At the start of each 'textPath' element
    * For each character within a 'text', 'tspan', 'tref' and 'altGlyph' element which has an x or y attribute value assigned to it explicitly

So it is wrong to ignore the "x" and "y" attributes.

I don't want to change the code without checking with the authors to find out why it is written the way it is. This layout code is quite complicated due to the implementation of flowed text.