vertical-lr and sideways-left

[starting a separate thread - was Styling vertical text, initial article 
and interactive tests]

On 27/05/2015 17:32, Richard Ishida wrote:> On 26/05/2015 20:58, Florian 
Rivoal wrote:
 >> The key is that text-orientation isn't used alone, but together with
 >> the writing-mode property.
 >>
 >> If you're setting latin text on book spines or captions of the side of
 >> images or tables, you pick vertical-lr or vertical-rl as the value of
 >> writing-mode depending on which side of the figure you want your
 >> caption on or which way spines go in your country or which side of the
 >> arch you're on, and "text-orientation:sideways" automatically picks
 >> the right one between sideways-right and sideways-left to make the
 >> orientation of glyphs in a line match the stacking order of lines.
 >> Setting the text-orientation to "sideways" on the entire document for
 >> latin text (or any natively horizontal script) will give you the right
 >> thing. You could just used sideways-right and sideways-left
 >> explicitly, but you'd have to make sure to keep them in sync with
 >> vertical-lr and vertical-rl, which could be tedious and error prone.
 >>
 >> For pieces of latin text in vertical CJK, sideways also computes to
 >> sideways-right since they use which use vertical-rl), and that's what
 >> you want, So latin-in-CJK, it doesn't matter if you specify sideways
 >> or sideways-right explicitly.
 >>
 >> However, vertical Mongolian, which uses vertical-lr, also uses
 >> sideways-right for inline pieces of latin text, so it must be set
 >> explicitly to sideways-right.
 >>
 >> There's one more use case for sideways-left I am aware of. RTL scripts
 >> such as Arabic or Hebrew, when embedded in vertical CJK text, are
 >> often set with sideways-right, so that the glyph orientation matches
 >> latin text. However, sometimes it is set with sideways-left. Doing so
 >> means that the CJK text and the RTL text both flow downwards, removing
 >> the need for bidi.
 >
 > hi Florian,
 >
 > the bit i don't understand is this:
 >
 > [
 > However, vertical Mongolian, which uses vertical-lr, also uses
 > sideways-right for inline pieces of latin text, so it must be set
 > explicitly to sideways-right.
 > ]
 >
 > what does 'it' refer to? I'm assuming it refers to 'inline pieces of
 > latin text' rather than 'vertical Mongolian'?
 >
 > either way, i don't see why there's any need to explicitly set
 > sideways-right.  Try the interactive tests.  Writing-mode: vertical-lr
 > on its own produces correctly oriented vertical mongolian with embedded
 > latin (and/or arabic) text automatically because the default value for
 > text-orientation is mixed. Latin and arabic characters are typically
 > rotated 90° clockwise in mongolian text.
 >
 > (Note that 90° clockwise rotation also makes sense for rtl scripts,
 > since the wrapping algorithms work the same way as for horizontal text
 > when you get to the end of a line. You can try this out by reducing the
 > height of the bounding box in the interactive tests, and you'll see that
 > all the browsers do the right thing. The few times i've seen
 > sideways-left orientation for Latin or other characters was in very
 > short runs that had no line breaks.)
 >
 > i also don't understand why the spec says, in the explanation of
 > 'sideways' value:
 >
 > "This value is equivalent to sideways-right in vertical-rl writing mode
 > and equivalent to sideways-left in vertical-lr writing mode."
 >
 > sideways-left is not the natural orientation for text in mongolian.
 >
 > what am i missing?

I'm beginning to suspect that this confusion may arise from 
consideration of the case where, say, a table cell is only in Latin 
script and the author wants the text to from bottom to top (see the 
attached image, adapted from something Dave Storey created).

I actually think that this is a different use-case and should not be 
conflated with vertical-lr.

You could make something simple (such as the example in the image) look 
like this using sideways-left, but if the text becomes long enough to 
wrap onto another line i think you have a problem, because you'd want 
the *last read* words to go on the new line to the right, rather than 
those nearest the bottom of the cell.  This is the kind of thing that 
regularly happens and is handled well for rtl text, but i'm not sure 
that there's a precedent for this when dealing with ltr text, and it 
seems that the CSS spec would have to specify it if that's what was 
expected.  I also suspect that trying to do so would significantly 
overcomplicate the spec.

I actually think that what we are looking at in the image is 
bottom-to-top-lr writing mode (bt-lr), where the text naturally starts 
at the bottom of the cell and travels upwards in leftwards orientation, 
then breaks at the top of the cell onto the next line and simply continues.

I think that trying to do the example in the image with 
writing-mode:vertical-lr and text-orientation:sideways-left is a hack. 
Sure, there are occasional cases of mixed CJK text where the Latin runs 
up the column (and sideways-left may be appropriate), but those i've 
seen are set fixed in print with no line-breaks. I'm not sure it's 
appropriate for a dynamically-sized environment such as the Web unless 
you fix the text to a single line for display.

ri


PS: Btw, there seems to be a problem for extending the value names in 
the future now that we adopted the vertical-xx naming rather than the 
original tb-xx.  If we want to implement bottom to top support (bt-lr in 
IE) what would we call that? vertical-bt-lr?

Received on Wednesday, 27 May 2015 17:49:55 UTC