W3C home > Mailing lists > Public > www-style@w3.org > April 2003

RE: CSS3 Text: Multi-Directional Scripts in Vertical Inline Progression

From: Michel Suignard <michelsu@windows.microsoft.com>
Date: Mon, 14 Apr 2003 18:45:25 -0700
Message-ID: <84DD35E3DD87D5489AC42A59926DABE901032E2C@WIN-MSG-10.wingroup.windeploy.ntdev.microsoft.com>
To: "fantasai" <fantasai@escape.com>
Cc: <www-style@w3.org>

See my answers online.

Michel

| -----Original Message-----
| From: fantasai [mailto:fantasai@escape.com] 
| 
| Michel Suignard wrote:
| >
| > In the introduction [1] (The BIDI problem), there are examples of 
| > upright (Chinese and latin) with a left-to-right block progression. 
| > The normal 'block direction' of such a case is 'rtl' (top to bottom 
| > physically), this means that L characters (as shown in the 
| > picture) go 
| > top to bottom (through bidi reordering) when their glyph 
| > orientation 
| > is -90deg clockwise, but if upright, no bidi reordering 
| > occurs so they 
| > will flow with the normal block direction which is top to bottom 
| > (which is the desired effect). Of course you can force a block 
| > direction to be 'ltr' which would get you in trouble as you 
| > demonstrate, but why do it when simply using 'direction:rtl' on the 
| > block would avoid the issue.
| 
| The reason why you should /not/ use 'direction: rtl' on a 
| Chinese or English text:
| 
| author.css
|    element { writing-mode: tb-lr }
| 
| user.css
|    * { block-progression: tb !important }

I don't see this as a realistic scenario. A document styled with
vertical layout in mind cannot be rendered correctly by just changing
block-progression. The main reason is that CSS positioning and many
other properties have a 'physical' meaning. This is a debate we had in
CSS long ago and it was decided that physical propery names had a
'physical' meaning.

Furthermore, the normal usage of a 'block-progression:lr' is to have
'direction:rtl' as it will do the right thing for Mongolian which is the
typical usage for that combination, and the upright characters will flow
top to bottom which is again expected. 

| 
| The net result is "writing-mode: rl", which is 
| *inappropriate* for horizontal left-to-right scripts.
| 
| 'direction' controls the directionality of the element's 
| text. This is different from the stylistic inline 
| progression, and you get problems if you conflate the two.

I don't agree with this. 'direction' controls the inline-progression for
block element, it doesn't change the inherent character directionality
unless 'unicode-bidi:bidi-override' is also used. In that aspect,
'direction' is a bit overloaded, but imo we don't need another
property/concept to control inline-progression.

| 
| > The new case which is really fascinating is the 'context' 
| > orientation. 
| > ... It could be added as a new keyword to both 
| > glyph-orientation-horizontal and glyph-orientation-vertical.
| 
| Overloading glyph-orientation like this bothers me, as it's 
| not just the glyph's orientation that's affected, but the 
| ordering of characters as well. "glyph-orientation: context", 
| for example, makes no sense whatsoever. In the "upright" 
| style, the inline progression depends on the glyph 
| orientation -- but in the "context" style, the glyph 
| orientation depends on the inline progression. Nonetheless, 
| these two styles are parallel; they're either-or, and they 
| belong in one property.

In the latest draft of CSS3 text, I have added
'glyph-orientation-vertical: inline' which intends to do exactly that
effect, it says:
<<
Inline
------ 
All glyphs are laid out top to bottom regardless of inherent direction.
The embedding levels, as determined by the bidirectional algorithm
[UAX9], are used to set the orientation of some glyphs (see following
prose). 
- Full-width ideographic and full-width Latin glyphs are oriented as if
an <angle> of "0deg" had been specified. 
- Ideographic punctuation and other ideographic characters having
alternate horizontal and vertical glyphs MUST use the vertical glyph. 
- Glyphs from the Mongolian script are also oriented as if an <angle> of
"0deg" had been specified. 
- Glyphs for all characters in even embedding levels are rotated 90
degrees clockwise from the "0deg" orientation. 
- Glyphs for all characters in odd embedding levels are rotated 90
degrees counter-clockwise from the "0deg" orientation. 
For this value of 'glyph-orientation-vertical', the directionality of
characters cannot be changed by the 'direction' property.
>> 
 
| > In that case, each Mongolian word will (should?) be 
| > displayed top to 
| > bottom with each following word going on the right of the 
| > previous one 
| > (I have seen that layout in mixed German/Mongolian litterature 
| > samples). In that case each vertical fragment of the 
| > vertical script 
| > is by itself a 'L' entity. For that to work you need a 
| > line-stacking-strategy allowing these vertical fragments to 
| > expend the 
| > line height.
| 
| Yes, that's one possibility. However, longer runs of 
| Mongolian will often run horizontally, as you can see in the 
| Chinese/Mongolian pages. (I found an English book, too, in 
| which inline Mongolian runs left to right.) The kind of 
| layout you describe is like having each Mongolian word inside 
| its own inline block. It's therefore much more complicated, 
| and, I think, not a necessary addition to CSS3 Text.
| 
| If the inline progression is right-to-left, it would make 
| sense for Mongolian to also go from right to left. This kind 
| of contextual progression is what the "inline" (context) 
| value should do: if the block's inline progression is 
| right-to-left, it should go from right to left as well, not 
| left to right. Right now it seems they're using overrides for 
| this [1], which IMO should be avoided. (It doesn't handle 
| mixed scripts very well.)

This is a case I had not thought of, but it could be added as a
modification of the 'glyph-orientation-horizontal: auto' now reads like
this:
<<
auto 
----
The glyph orientation relative to the inline-progression is determined
automatically based on the Unicode character code of the rendered
character.
- Full-width ideographic and full-width Latin glyphs (excluding some
ideographic punctuation and bracket symbol) are oriented as if an
<angle> of "0deg" had been specified. 
- Ideographic punctuation and other ideographic characters having
alternate horizontal and vertical glyphs MUST use the horizontal glyph. 
- Glyphs from the Mongolian script are also oriented as if an <angle> of
"0deg" had been specified, however they are stacked vertically word by
word. 
- Other glyphs, including Hebrew and Arabic are set as if an <angle> of
"0deg" had been specified.
>>
We could change the the definition for Mongolian script in the case of
'auto' to read as follows:

- When the 'direction' value is 'ltr', glyphs from the Mongolian script
are also oriented as if an <angle> of "0deg" had been specified, however
they are stacked vertically word by word.
- When the 'direction' value is rtl, glyphs form the Mongolian script
are oriented as if an <angle> of "270deg" had been specified. 

| 
| > As I have already completely separated 'direction' and 
| > 'block-progression' in my current draft it is reasonably 
| easy to add 
| > these new concepts in the draft.
| 
| Wonderful!
| 
| ~fantasai
| 
| [1] http://uk.geocities.com/BabelStone1357/Test/Mongolian.html
| 
| 
| 
Received on Monday, 14 April 2003 21:45:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:21 GMT