zimmermann@webkit.org | 7208fe3 | 2011-03-15 20:15:17 +0000 | [diff] [blame] | 1 | <svg width="400" height="400" xmlns="http://www.w3.org/2000/svg"> |
aroben@apple.com | c51da1a | 2011-03-30 14:03:00 +0000 | [diff] [blame] | 2 | <style> |
| 3 | @import url(../../fast/text/international/resources/Mac-compatible-font-fallback.css); |
| 4 | </style> |
zimmermann@webkit.org | c741cd5 | 2011-03-30 08:36:42 +0000 | [diff] [blame] | 5 | <g font-size="16" transform="scale(3,3)"> |
zimmermann@webkit.org | 7208fe3 | 2011-03-15 20:15:17 +0000 | [diff] [blame] | 6 | <!-- The order of all characters in both lines should be the same, the spacing is different due the absolute positioning in the second line --> |
zimmermann@webkit.org | c741cd5 | 2011-03-30 08:36:42 +0000 | [diff] [blame] | 7 | <text y="20" x="10 20 30 40 50">Test אבגדה</text> |
zimmermann@webkit.org | 7208fe3 | 2011-03-15 20:15:17 +0000 | [diff] [blame] | 8 | |
| 9 | <!-- |
| 10 | Quoting SVG 1.1: Whenever the character data within a ‘tspan’ element is re-ordered, the corresponding |
| 11 | elements within the ‘x’, ‘y’, ‘dx’, ‘dy’ and ‘rotate’ are also re-ordered to maintain the correspondence. |
| 12 | |
| 13 | The text is processed in logical order (as defined in the markup). |
| 14 | 10 = T | LTR -> char 0 |
| 15 | 20 = e | LTR -> char 1 |
| 16 | 30 = s | LTR -> char 2 |
| 17 | 40 = t | LTR -> char 3 |
| 18 | 50 = | LTR -> char 4 |
| 19 | 88 = א | RTL -> char 9 |
| 20 | 79 = ב | RTL -> char 8 |
| 21 | 72 = ג | RTL -> char 7 |
| 22 | 64 = ד | RTL -> char 6 |
| 23 | 55 = ה | RTL -> char 5 |
| 24 | It's rendered according to the BiDi algorithm as: Test הדגבא |
| 25 | The Hebrew string is reordered, and the x/y/dx/dy/rotate lists as well to maintain correspondence. |
| 26 | --> |
zimmermann@webkit.org | c741cd5 | 2011-03-30 08:36:42 +0000 | [diff] [blame] | 27 | <text y="40"><tspan x="10 20 30 40 50 88 79 72 64 55">Test אבגדה</tspan></text> |
| 28 | |
| 29 | <text y="60" x="10 20 30 40 50">Test <tspan x="88 79 72 64 55">אבגדה</tspan></text> |
| 30 | |
| 31 | <text y="80" x="10 20 30 40 50 88 79 72 64 55">Test אבגדה</text> |
zimmermann@webkit.org | 7208fe3 | 2011-03-15 20:15:17 +0000 | [diff] [blame] | 32 | </g> |
| 33 | </svg> |