W3C home > Mailing lists > Public > www-svg@w3.org > March 2011

text-intro in SVG 1.1 2nd Edition

From: Nikolas Zimmermann <zimmermann@physik.rwth-aachen.de>
Date: Wed, 09 Mar 2011 15:19:49 +0100
Message-id: <0F5DBC64-6841-462D-B3CC-F0D116C98817@physik.rwth-aachen.de>
To: www-svg@w3.org
Hey SVG crowd,

I've spent the last days assuring WebKits bidi implementation works as expected for SVG text according to the i18n tests originally designed for SVG Tiny 1.2:
http://www.w3.org/International/tests/svg/test-direction-unicode-bidi-0 & http://www.w3.org/International/tests/svg/test-direction-alignment-0

Cameron wrote a mail in December stating that text-intro-05-t.svg / text-intro-09-t.svg are broken on most viewers, aka. looks not equal to the reference image.
Erik said, http://lists.w3.org/Archives/Public/public-svg-wg/2010OctDec/0202.html, that the test is identical to the SVG 1.2 Tiny version.
I've looked a bit closer and found lots of inconsistencies that I'd like to see resolved once for all :-)

SVG 1.2 Tiny (from: http://dev.w3.org/SVG/profiles/1.2T/test/htmlObjectHarness/text-intro-05-t.html)
  <g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
    <text x="460" y="80" text-anchor="start" xml:lang="ar" font-size="30" font-family="Andalus">لماذا لا يتكلمون اللّغة العربية فحسب؟</text>

SVG 1.2 Tiny (from: http://www.w3.org/Graphics/SVG/Test/20080912/htmlObjectHarness/text-intro-05-t.html)
  <g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
    <text x="460" y="80" text-anchor="end" xml:lang="ar" font-size="30" font-family="Andalus">لماذا لا يتكلمون اللّغة العربية فحسب؟</text>
...

SVG 1.1 (First Edition) (from: http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-text-intro-05-t.html)
  <g id="test-body-content">
   <text x="460" y="80" text-anchor="end" xml:lang="ar" font-size="30" font-family="Andalus">لماذا لا يتكلمون اللّغة العربية فحسب؟</text>
...

SVG 1.1 Second Edition (from: http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/text-intro-05-t.html)
  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18" direction="rtl">
    <text x="460" y="80" text-anchor="start" xml:lang="ar" font-size="30" font-family="Andalus">لماذا لا يتكلمون اللّغة العربية فحسب؟</text>
...

Wow, a lot of confusion. The interpretation of text-anchor alone is a different topic.
I want to focus on unicode-bidi / direction properties.

SVG 1.2 Tiny says: (http://www.w3.org/TR/SVGTiny12/text.html#DirectionProperty)
This property specifies the base writing direction of text and the direction of embeddings and overrides (see 'unicode-bidi') for the Unicode bidirectional algorithm.
For the 'direction' property to have any effect on an element that does not by itself establish a new text chunk (such as the 'tspan' element in SVG 1.2 Tiny),  the 'unicode-bidi' property's value must be embed or bidi-override.

SVG 1.1 Second Edition says: (http://www.w3.org/TR/SVG11/text.html#RelationshipWithBiDirectionality)
This property specifies the base writing direction of text and the direction of embeddings and overrides (see ‘unicode-bidi’) for the Unicode bidirectional algorithm.
For the ‘direction’ property to have any effect,  the ‘unicode-bidi’ property's value must be embed or bidi-override.

Elements that define text chunks in SVG 1.2 Tiny: (http://www.w3.org/TR/SVGTiny12/text.html#TextLayoutIntroduction)
Adjustments to the current text position are either absolute position adjustments or relative position adjustments. An absolute position adjustment occurs in the following circumstances:
* At the start of a 'text' element
* At the start of a 'textArea' element
* For each character within a 'text' element which has an 'x' or 'y' attribute value assigned to it explicitly
...
Each absolute position adjustment defines a new text chunk.

Elements that define text chunks in SVG 1.1 Second Edition: (http://www.w3.org/TR/SVG11/text.html#TextLayoutIntroduction)
Adjustments to the current text position are either absolute position adjustments or relative position adjustments. An absolute position adjustment occurs in the following circumstances:
* At the start of a ‘text’ element
* At the start of each ‘textPath’ element
* each character within a ‘text’,  ‘tspan’,  ‘tref’ and ‘altGlyph’ element which has an ‘x’ or ‘y’ attribute value assigned to it explicitly
...
Each absolute position adjustment defines a new text chunk. 

To summarize: SVG 1.2 Tiny and SVG 1.1 Second edition have a different "direction" attribute handling. <text direction="rtl" ..> has no effect in SVG 1.1 Second Edition, as unicode-bidi is set to normal, per default.
SVG 1.2 Tiny explicitly allows elements that establish new text chunks to specify a direction attribute, regardless of the unicode-bidi value.

The aforementioned SVG 1.2 Tiny i18n tests rely on <text direction="rtl" unicode-bidi="normal" to take effect, other tests like text-intro-02-b.svg in SVG 1.1 Second Edition, verify that setting
text direction to rtl is ignored, when unicode-bidi is set to normal. What behaviour do we want to have for SVG 1.1 Second edition? Align with Tiny?

Looking for feedback!

Thanks a lot in advance,
Niko
Received on Wednesday, 9 March 2011 14:20:27 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:47 GMT