Closed Bug 641187 Opened 14 years ago Closed 11 years ago

Text on path positioning at zero startOffset

Categories

(Core :: SVG, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: j.tosovsky, Assigned: heycam)

References

()

Details

(Whiteboard: [good first verify])

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0 Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0 When text (a single character) is positioned on the path with text-anchor set to middle and startOffset set to zero percent, the letter is missing at all as can be seen in the URL provided. Reproducible: Always Steps to Reproduce: 1. Open the URL Actual Results: Missing letter. Expected Results: I would expect MSIE 9RC/Opera 11 behaviour (letter is displayed)
Removing the whitespace between the <text> and <textPath> elements makes the M display where you want it. I.e. <text><textPath xlink:href="#circle" startOffset="0%" font-size="18px" fill="red" text-anchor="middle">M</textPath></text>
Thanks, it fixes it, but in other browser it works even with whitespace. I would expect rendering whitespace just inside textPath element, not outside. Either FF or MSIE/Opera/Batik way is correct. I tend to believe the majority ;-)
The whitespace must be rendered, but I don't think it's clear from the SVG specification where the final whitespace should be drawn. Do you continue from where the M is drawn or do you go back to where the initial whitespace was drawn. Batik and Opera do things differently last I checked but they both do draw the whitespace. SVG specification beats the majority ;-) so if you can find something in there that supports your whitespace case then that would be much better.
The nsSVGTextFrame2 code sets x = y = 0 for the first character after a <textPath>, if there is nothing else that has given it an explicit position. IIRC. I don't believe the spec says anything about this yet. With svg.text.css-frames.enabled = true, the Ms render, but they don't look exactly centered on the top of the curves. So maybe there is something wrong with the new anchoring code on text paths.
Depends on: svgtext
bug 956513 makes it centered so it all works now.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Depends on: 956513
Resolution: --- → FIXED
Assignee: nobody → cam
Target Milestone: --- → mozilla29
Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.