Re: [css3-writing-modes] bidi in vertical writing modes

On 07/14/2011 06:25 PM, Alex Danilo wrote:
> Hi Fantasai,

Hi Alex,
Sorry for the late reply, I missed this one.

> Given that most of this is non-normative, and Appendix C is
> non-normative but marked as "This section needs careful review."
> your removal of the reference to BIDI in the context of vertical
> typesetting seems sufficient.
>
> The issue I _personally_ had was that in UTN22 (non-normative
> of course) there is no clear description of how the mixture
> of upright and rotated glyphs are laid out.
>
> e.g. If you have mixed orientation, then the rotated glyphs
> can be treated as 'text-orientation: right', the upright
> glyphs as 'text-orientation: upright'.
>
> The mappings for this mixed case are:
>
> (text-orientation: right):
> Map ttb and ltr to htl (high to low)
> Map btt and rtl to lth (low to high)
>
> (text-orientation: upright)
> Map ttb, ltr and rtl to htl (high to low)
> Map btt and to (sic) to lth (low to high)
>
> Then run BIDI (UTN22 detailed description left out).
>
> If you mix orientations in one vertical line, then which mapping do you use?
> ltr ->  htl&  rtl ->  lth or ltr and rtl->htl

You apply the mappings per-character, not per-line. So you use both.

> This is merely an implementation detail that rears its ugly head if you try
> to actually implement this as described. The fundamental problem with the
> spec as described is that LTR and RTL characteristics of the glyph runs
> must be identified by running UAX#9 on the character string _before_
> decisions about rotation or upright placement are made.

No, that's backwards. You must make your decision about rotation or upright
placement first. Then run UAX#9 after resolving those. See the section on
text-orientation: if a character is upright, it is treated as LTR.

> The swapping part of the runs in UAX#9 is all that really needs to be used
> for the vertical layout, so the references to BIDI served to confuse the issue.
>
> I don't know if that explanation makes sense but the main problem I had
> in converting your English sentences into code that actually produced
> correct results was to run BIDI as expected as the first pas to identify
> the LTR/RTL runs and then use script etc. as Koji and others have said
> and Appendix C describes to decide upright/rotation. The placement of
> the runs themselves _does_ follow one and only one step in the BIDI
> algorithm, namely the re-ording of placement of the runs.
>
> I believe the ambiguous mappings in (again non-normative) UTN22
> fail to handle the mixed orientation case which is what I thought the auto
> typesetting algorithm was attempting to solve.

I think you're getting confused by UTN22. If you *only* follow CSS3 Writing
Modes, then you will get the following rules:

1. Change directionality of text-orientation: upright characters to strong LTR.
2. Run bidi as usual.

This does not handle any bottom-to-top scripts or typesetting with
counter-clockwise rotated LTR/RTL. But for most cases it works, and the others
can be handled by manually tweaking script runs.

~fantasai

Received on Thursday, 13 October 2011 17:27:38 UTC