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

[css-writing-modes] Confused about 'writing-mode' with 'direction' #3504

Closed
RazrFalcon opened this issue Jan 12, 2019 · 1 comment
Closed

Comments

@RazrFalcon
Copy link

Moved from w3c/svgwg#618

https://www.w3.org/TR/SVG/text.html#WritingModeProperty
https://www.w3.org/TR/SVG/text.html#DirectionProperty

Afaiu, writing-mode was completely changed in SVG 2, but I think that the problem should persist. I'm not sure if there are any SVG 2 ready applications, so I cannot test this. That's why the example below is SVG 1.1 based.

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" font-family="Arial" font-size="64">
    <path id="crosshair" d="M 20 100 L 180 100 M 100 20 L 100 180" stroke="gray" stroke-width="0.5"/>
    <text id="text1" x="100" y="150" writing-mode="tb" direction="rtl">Text</text>
    <rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black"/>
</svg>

a-direction-001

As you can see, the results are pretty different. Which one is the correct one and why?

PS: is the SVG 1.1, the writing-mode property could have 6 different values. But according to the SVG 2 spec, there are actually only two of them: left-to-right and top-to-bottom. So in the SVG 1.1 I can treat lr-tb, rl and rl-tb as lr and tb-rl as tb and it should not technically affect anything?

@fantasai
Copy link
Collaborator

Thanks very much for all your efforts in reporting these issues @RazrFalcon. I'm afraid @svgeesus was a bit too quick to dismiss this issue, it's not about CSS Writing Modes since the text is rendered correctly--it's just the placement in coordinate space that's varying, and it's up to SVG to define that , not CSS. I'm going to mark this as OutOfScope, but I'll leave it open until it's been reopened in the SVGWG repository.

Your testcases are very helpful, btw: super clear and easy to understand.

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

3 participants