Re: vertical-lr and sideways-left

> > 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'?

Correct. Sorry for the sloppy writing. it = "pieces of latin text meant
to be embedded in 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.

"text-orientation: mixed" is a code-point based heuristic. It is a fairly
good heuristic, and will often do the right thing, but not always. In particular,
for some punctuation characters, whether they should be upright or sideways
is context dependent, and therefore "mixed" will sometimes get it wrong.

So, while "mixed" will often give good enough results, with a sufficiently
well marked up piece of text, you should actually style the CJK as upright
and the embedded latin as sideways-right or equivalently as sideways.

If this was a piece of latin text in Mongolian, the latin text should
get sideways-right for the same reasons (and not sideways, as that
would compute to sideways left since we'd be in vertical-lr).


> > (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.)

Do you mean it also makes sense for rtl scripts embedded in CJK?

If that's what you mean, then yes, and it is commonly the preferred choice
(especially when you're embedding both rtl and ltr), but not the only one.
90° counter-clockwise is also sometimes used where you're only embedding rtl,
to have all the text flow downwards.

If you mean for text on the right side of tables/figures/arches/..,
then yes, and conversely, sidewways-left is also the right thing
for rtl text on the left side of tables/figures/arches/...

> > 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).

Correct. sideways computing to sideways-left in vertical-rl is not meant
for mongolian, but for english (or any horizontal language, ltr or rtl)
captions layed out on the (left) side of a figure / table / arch / ...,
or for the German / Russian / ... book spines.

> 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.
> 
> 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?

Is it really a hack if it works fine? You might need to add text-align to the mix of properties you need to set to get the desired behavior, but once you do, don't you get the right results?

Anyway, that's not the only used case for sideways-left. As I mentioned, rtl-in-CJK is occasionally styled that way as well. Not a huge use case, but not a fake one either.

My memory might be failing me, but I think we dropped bt-* because browsers said they'd never support it anyway. Discussions at the last F2F showed that willingness to implement sideways-left wasn't that strong either (but not entirely dead yet).

Fantasai, maybe you could chime in? You know these things so much better than me...

 - Florian

Received on Wednesday, 27 May 2015 21:43:51 UTC