Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should text following <textPath> be positioned? #104

Closed
progers opened this issue Apr 14, 2016 · 6 comments
Closed

How should text following <textPath> be positioned? #104

progers opened this issue Apr 14, 2016 · 6 comments

Comments

@progers
Copy link

progers commented Apr 14, 2016

Where should after be positioned in the following scenario:
<text>before<textPath xlink:href="#path">on path</textPath>after</text>
(I've created an example showing this at http://jsbin.com/gugoje)

Currently, WebKit, Blink, and Edge position after above before in the y-axis, and after on path in the x-axis. Gecko appars to just reset the position of after to 0,0.

One approach is to position after as if on path was a tspan.

@fsoder
Copy link

fsoder commented Apr 14, 2016

To me it looks like Gecko reset the current text position (to 0,0) on the (not at "after"; easily observable by replacing the textPath with a tspan with x=y=0). That seems to be closer to the last approach - albeit with a bug somewhere... (My guess would be an incorrect computation of the initial CTP.)

Edit: I see the Gecko behavior is now "documented" in the spec (step 10.2.1; https://svgwg.org/svg2-draft/text.html#ResolveGlyphPositioning)

@nikosandronikos
Copy link
Member

RESOLUTION: text following textPath text is positioned as if the x,y is at the end point of the equivalent path

https://www.w3.org/2016/04/22-svg-minutes.html#resolution07

Note the equivalent path hasn't been written up yet, but see https://www.w3.org/2016/04/22-svg-minutes.html#resolution02.

@BigBadaboom
Copy link
Contributor

Sorry for the late comment...

Wouldn't it be most logical that the x,y of "after" would be whatever the current text position was after the last character rendered on the path (ie. the "h")?

@AmeliaBR
Copy link
Contributor

@BigBadaboom That was the other possibility we discussed, and seems to match the current Edge/Blink behavior. The Gecko behavior is definitely undesirable, and spec will be changed where it suggests that is correct.

The reason we resolved on using the end of the path, rather than the position of the last character, is that it would provide more precise author control, with less variability based on font, etc.

If other authors or implementers want to argue for keeping the Edge/Blink behavior, now would be the time.

@BigBadaboom
Copy link
Contributor

Thanks for the explanation. I didn't see that point made in the minutes. It's a reasonable approach.

@Tavmjong
Copy link
Contributor

Tavmjong commented Jun 9, 2016

Fix committed: 780fb0f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants