W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2019

Re: [csswg-drafts] [css-writing-modes] Support rtl Chinese (#2754)

From: r12a via GitHub <sysbot+gh@w3.org>
Date: Wed, 06 Feb 2019 13:46:19 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-461028084-1549460775-sysbot+gh@w3.org>
I believe that no-one is disagreeing with the suggestion that some texts in Chinese and Japanese run, or used to run, RTL in horizontal text.  I want to move on to discuss the proposal that was made in the opening comment of this issue for handling that.

The proposal was to create a new `writing-mode` property.  I don't think that is appropriate.  In CSS, writing-modes describe the direction in which lines are arranged and sequenced - not the direction of the text on those lines.  In fact, CSS intentionally distanced itself from older models that tried to munge the two together (eg. SVG, XSL).  Proposing a new writing-mode property, in my mind, is  shooting arrows at the wrong target.

For the use cases described above the writing-mode direction is still horizontal-tb. What's needed is a way to change the arrangment of characters _within_ a line during display. 

The way that's normally done is to use the `dir` attribute in HTML or the `direction` property in CSS elsewhere, but that approach relies on the directional properties of the characters involved in a way  that doesn't hold here.

I made a [counter-proposal](https://github.com/w3c/csswg-drafts/issues/2754#issuecomment-396234698) that says use overrides (with nesting where necessary to change direction). I'm not yet convinced that anything else is needed.  Note also that this is very similar to the advice we give authors using Arabic, Hebrew, etc - ie. [ tightly wrap every opposite-direction phrase in markup, and use the dir attribute on that markup. Be sure to nest markup to show the structure.](https://www.w3.org/International/articles/inline-bidi-markup/index.en#quick)

It's true that override markup or styling doesn't inherit well (i never understood why that was always treated differently from normal direction - or for that matter, why we need an inline bdo element rather than an rlo/lro attribute on an element, but i digress...), but i think that an override approach should probably suffice for the amount of text that needs this special treatment. In modern use it seems to be mostly short runs of text alongside vertically aligned content (eg. for titles or captions shown above).  For archaic uses, it is probably only needed for short expository texts too, i suspect.

By the way...

Also, let's bear in mind that this is not only about Chinese and Japanese. Many archaic scripts could be written RTL in horizontal lines.  And also let's bear in mind that RTL directionality is often not all that's need. Often scripts that ran RTL but who's modern Unicode properties are LTR also tended to mirror the characters at the same time, eg, Egyptian hieroglyphs, Tifinagh berber script, and Old Norse runes. (You can do this using CSS. See an example here https://r12a.github.io/scripts/tifinagh/index#dir.  Or go to my pickers for any of those scripts, click on the + top left of the text area, then click on the ⭅︎ at the bottom right of the text area to see the effect.)

So, in summary, a new `writing-mode` value is the wrong solution. Applying overrides seems like an adequate one for the use cases involved.


-- 
GitHub Notification of comment by r12a
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2754#issuecomment-461028084 using your GitHub account
Received on Wednesday, 6 February 2019 13:46:20 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:43 UTC