RE: [1.2T-LC] i18n comment 6: Direction and bidi-override attributes (ISSUE-2107)

> > How about this: [[ In many cases, the bidirectional algorithm from
> > [UNICODE] produces the desired result automatically, and in such
> > cases the author does not need to use these properties. For other
> > cases, when using right-to-left languages, it may sufficient to add
> > the direction property to the svg element, and allow that direction
> > to inherit to all text elements. ]]
> 
> Sounds good, thanks.  I've added that to the spec. [1]

Nit: I omitted 'be' between 'may' and 'sufficient', and that got into the spec.



> I've added an example [1], but I'm not very happy with it... I'd like to
> expand it, including passages in both Arabic as well as Hebrew, with a
> passage of ltr text in context.  If the i18n folks have a good example
> (maybe something canonical), I'll be grateful to include it.


This may be better:

<svg xmlns="http://www.w3.org/2000/svg"
     width="100%" height="100%" viewBox="0 0 400 400"
     direction="rtl">

  <title>Right-to-left Text</title>
  <desc>
    An example for using the 'direction' and 'unicode-bidi' properties
    in documents that predominantly use right-to-left languages.
  </desc>

  <text x="200" y="200" font-size="20"> כתובת 
 MAC:&#x200F;
     <tspan direction="ltr" unicode-bidi="embed">00-24-AF-2A-55-FC</tspan> 
 </text>

</svg>

It says: "Mac address: 00-..."  The right-to-left mark (U+200F) is needed to split 'MAC' and the number sequence into separate directional runs, so that they are ordered right to left, respectively. The embed is needed to stop the mac address looking like 'AF-2A-55-FC-00-24'

The problem with any bidi example is how to arrange the various mixed language elements, since many editors are not intelligent enough to interpret the markup properly in the source (see http://www.w3.org/TR/i18n-html-tech-bidi/#d2e283 ), and so that's why I laid it out as above.

The attached graphic shows what the result should look like.

Of course, another problem with this example is that you would probably put the direction property on the text element, since it is really an English document with some Hebrew in it. It would look more authentic if  the title and desc elements were in Hebrew, or if you missed those out, or substituted '...' in their place.  This may help also in making this look more like an ordinary SVG document.
  
I could provide another example, but I'm thinking it may be better for me to write a short article about handling bidi text in SVG, instead.


Hope that helps,
RI

============
Richard Ishida
Internationalization Lead
W3C (World Wide Web Consortium)

http://www.w3.org/International/
http://rishida.net/



> -----Original Message-----
> From: Doug Schepers [mailto:schepers@w3.org]
> Sent: 02 November 2008 20:29
> To: Richard Ishida
> Cc: www-svg@w3.org; public-i18n-core@w3.org
> Subject: Re: [1.2T-LC] i18n comment 6: Direction and bidi-override attributes
> (ISSUE-2107)
> 
> Hi, Richard-
> 
> Richard Ishida wrote (on 10/30/08 11:33 AM):
> >
> > Note that I still don't see direction or unicode-bidi in the element
> > table at
> > http://dev.w3.org/SVG/profiles/1.2T/publish/elementTable.html
> >
> > I assume that this is because they are 'properties', and that the
> > green tick in the third column of elements such as svg, text, etc.
> > means that any property can be used with those elements.
> 
> That's correct.  In future specs, we will take steps to make this more
> clear, but that will take modifications to our build script.
> 
> 
> >> How about this: [[ In many cases, the bidirectional algorithm from
> >> [UNICODE] produces the desired result automatically, and overriding
> >> this algorithm properly is usually quite complex. Therefore, in
> >> many cases, such as when using Western scripts, authors are
> >> discouraged from assigning values to these properties.  When using
> >> right-to-left languages, it is recommended that these properties be
> >> set appropriately. ]]
> >
> > Hmm.  It may appear complex if you don't know what you are doing, but
> > it's not really that bad for people who need to work with rtl scripts
> > all the time.
> >
> > How about this: [[ In many cases, the bidirectional algorithm from
> > [UNICODE] produces the desired result automatically, and in such
> > cases the author does not need to use these properties. For other
> > cases, when using right-to-left languages, it may sufficient to add
> > the direction property to the svg element, and allow that direction
> > to inherit to all text elements. ]]
> 
> Sounds good, thanks.  I've added that to the spec. [1]
> 
> 
> >>> Perhaps it would be helpful to provide an example of the most
> >>> straightforward case, ie. unicode-bidi="embed" direction="rtl",
> >>> that people can cut&paste.
> >>
> >> That's a great idea.  We will add a Hebrew and/or Arabic example.
> >
> > I don't see this yet. Is that an oversight?
> 
> I've added an example [1], but I'm not very happy with it... I'd like to
> expand it, including passages in both Arabic as well as Hebrew, with a
> passage of ltr text in context.  If the i18n folks have a good example
> (maybe something canonical), I'll be grateful to include it.
> 
> 
> >>> What *would really* be helpful, would be the possibility of
> >>> declaring the direction at the top of the document, ie. in the
> >>> svg element, and allowing it to cascade from there to all text
> >>> elements. In *that* case, you are much less likely to need to set
> >>> the properties on each text element, when working in a
> >>> right-to-left script. (And it will save a lot of typing for the
> >>> poor Middle Eastern authors.)
> >>
> >> This is indeed the case, because we inherit inheritance from CSS.
> >> How about we add an explanatory note for authors, explaining that
> >> this can be done?
> >
> > I think this is a very good idea.  See my proposed text above - maybe
> > that is enough?  Note also my assumption about applicability of
> > properties like direction and unicode-bidi to elements such as svg
> > and text etc.
> 
> Please review the revamped prose, and let me know if that works for that
> goal.  I think it does.
> 
> Let us know if this resolves this issue for you. (I will address the
> 'text-align' issue, ISSUE-2171, in another email.)
> 
> [1]
> http://dev.w3.org/SVG/profiles/1.2T/publish/text.html#RelationshipWithBiDirecti
> onality
> 
> Regards-
> -Doug

Received on Monday, 3 November 2008 11:01:42 UTC