- From: Evgeniy Reizner via GitHub <sysbot+gh@w3.org>
- Date: Mon, 21 Jan 2019 12:22:17 +0000
- To: public-svg-issues@w3.org
RazrFalcon has just created a new issue for https://github.com/w3c/svgwg:
== BIDI reordering across multiple 'tspan' ==
https://www.w3.org/TR/SVG11/text.html#TextLayoutIntroduction
According to the SVG spec, BIDI reordering should be done for a whole text chunk. But it doesn't explain the details.
>Reordering of characters due to bidirectionality only occurs within a text chunk.
```xml
<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" font-family="Arial" font-size="32">
<linearGradient id="lg1">
<stop offset="0" stop-color="white"/>
<stop offset="1" stop-color="green"/>
</linearGradient>
<rect fill="url(#lg1)" stroke="gray" x="80" y="40" width="93" height="10"/>
<text id="text1" x="30" y="90">Hel<tspan fill="url(#lg1)">lo مرح</tspan>با.</text>
<text id="text2" x="30" y="140">Hello مرحبا.</text>
<rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black"/>
</svg>
```

As you can see, everything is pretty much broken.
1. Before writing this test, I thought that librsvg behavior is correct. Meaning that the `tspan` span doesn't affected by reordering.
1. Mainly because this leads to the next problem: what is the correct bbox in that case? That's why I'm filling it with a gradient.
As you can see, Qt thinks that there are two separate objects. librsvg, in my opinion, has the right result (kinda). And the others have a stretched gradient without a white part, for some reasons (rect for the reference).
1. This is also affected by the https://github.com/w3c/svgwg/issues/634
What is the correct behavior?
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/635 using your GitHub account
Received on Monday, 21 January 2019 12:22:19 UTC