-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-writing-modes] Support vertical CJK + ttb Arabic (rtl scripts generally) #3608
Comments
Leaving aside the question of which property to use to trigger this behavior, I'd like to focus on the use case first. When we were working on the current version of writing-modes, we used to have Implementing it was a little more complicated than the rest so browsers were reluctant, but I thought that this made a lot of sense, so I tried to look for evidence that this was needed. However, after asking around, I could only find people who agreed in theory that this could be nice, but no actual person who actually wanted to do that, or examples of (non-web) documents where this style was used (other than a limited body of Chinese Islamic calligraphic art). To be fair, my research was not particularly deep, but I asked a number of people who should know better than me, and nobody came back with anything useful. Given the lack of evidence of an actual use case, and the difficulty of implementing it, we dropped Now, I still think it makes sense in theory to support, so I'd be very interested to hear if you have evidence of an actual need (either people asking for it, or documents using it). |
Thank you for your opinion. @frivoal First, I, for one, am looking forward to applying this in my case. :) That's why I brought up this idea: I am currently learning Persian/Farsi. I also have a specific plan to develop a rich web editor which is adjustable to writing mode. So I want to design a Chinese/Japanese/Korean/Persian/Arabic language-learning website where people can learn from each other, and I want to make the whole website writing-mode-responsive. Second, one of the main reason of the lack of the reality of combining non-CJK characters in vertical-writing mode is simply the lack of the reality of the vertical-writing mode itself, which is, in my opinion, due to some other remaining issues needed to resolve, for example, you usually need to make greater effort to scroll a horizontal bar than the vertical one in PC. So this makes designers hesitant to design a whole lengthy vertical-writing page. So I don't think the lack of combining non-CJK characters in vertical-writing mode can be independently interpreted as lack of interest, multiple factors interplay. Third, this property is not only for vertical mode, it's also for RTL CJK characters in horizontal mode(See #2754). Fourth, I agree with you that this feature makes sense, especially because CSS is an international standard, since this feature is all about better internationalization, isn't it? ;) Fifth, for vertical mode, this is only about readablity improvement, not an actual functionality, even if UA implementers aren't reluctant in implementing this feature, nothing is going to be hurt at worst. These are my two cents. |
Writing specifications take time. Writing tests take more time. Discussing these with with lots of potential implementers... So we generally don't write specifications "just in case". As far as I can tell, people who actually use vertical CJK mixed with arabic/persian generally use the bidirectional version where the rtl language goes bottom to top. I find it a little surprising, but that's what it is. So CSS as it is today does support international usage. When I say I looked for evidence that the writing mode where both CJK and rtl languages go down, I didn't just look on the web. I asked a number of professor of arabic studies in Japanese universities, and the like, looking for any document that would be written like that. Maybe I just asked the wrong people, but nobody had seen anything like that before. Even if it makes sense to me, I'd be reluctant to draft the feature without seeing a single real world document written like that. I suspect they exist, or at least used to. The current system mostly make sense of you think of non-CJK text as primarily being english, and when you put some arabic into it, you do the usual bidi thing. But China has had many centuries of contact with Persia and the rest of the Arabic speaking world way before english was relevant, and I wouldn't be surprised if documents from back then where written so that everything flows down. But I have yet to see one. |
Unclear how this is a CJK-specific issue. The figures in the original post seem to be about whether RTL scripts take a TTB inline progression in vertical lines. A rather typical use case is how RTL/TTB scripts (such as historical scripts Sogdian and Old Uyghur) can be rendered properly. This is about how to override the default bidi behavior (as today’s common implementations of vertical writing simply rotate a whole horizontal line without changing the bidi behavior) with a unified direction for inline progression. |
Thank you for the reply. It's really about RTL/LTR, in CSS. "writing-mode: vertical-*" combined with "direction: ltr" creates TTB inline progression, It means in vertical mode in CSS, left is "mapped" to top, and right "mapped" to bottom. "cjk-dir" changes the left to the right mapping in vertical mode. |
I wanted to generalize the property to be also useful in horizontal mode. "cjk-dir: rtl" simply indicates CJK characters are treated like any other RTL characters, such as Arabic, Persian, so they goes the same direction all the way down, regardless in vertical or horizontal mode. |
Sorry to insist, but before we discuss the detail of how the property should work or should be called, I think sharing examples of documents (screenshots, pictures, scans...) would be very useful. As for Sogdian and Old Uyghur, aren't they already supported, as Mongolian and Manchu are, using |
As Florian wrote, we did some fairly extensive research on examples of mixed rtl and ttb scripts. I did find one example of Arabic written downwards, but it was very old: newer examples didn't follow this format. Therefore we didn't design any automatic mechanism for such layouts, instead we added a manual one (text-orientation: sideways-left), which is present in older drafts of Writing Modes. It was later removed because of implementation difficulty and lack of strong use cases. If at some point that balance changes, and a UA is willing to implement But at this point the focus is on getting UAs to support 'writing-mode: sideways-lr', which is much easier, has a wide variety of current use-cases, and last I checked is still only supported in Firefox. |
Thanks for reply. So from your replies, there are one common reason for not adding support for this: implementation difficulty. I think the implementation difficulty is primarily due to lack of support of such typography in low-level graphics layer, such as GDK/GTK. I am not sure, but I am interested in looking into this issue in the further. |
No, it's the combination of lack of usecase (and proof of usecase) and implementation difficulty. If something has strong usecase, and it's not terribly complicated to implement, browsers may still try to do that.
I don't think so. I believe the main problem is from calculating various metrics like text position and baseline in layout. There are way too many possible combinations of features can affect text layout. They all need to be taken into consideration when implementing. Graphics side of this should be identical to what other vertical writing modes require, so it's unlikely to be a problem I suppose. |
That's what I meant, it's one of the common reasons.
Thanks you for the suggestion @upsuper . I meant I am not sure whether typography is native supported by GTK itself, or an uper layer based on GTK. I don't know much about graphics layer programming, would like to look into it, just saying. |
In CJ text this can be seen even today but on the right side of vehicles. People are aware that it is read right-to-left. In old signage, as raised above, it is also common in Japan at shrines and temples. This usage is never mixed, so it is not exactly the same as bidi—I do not think mixed script usage is possible here without being too confusing for the contemporary reader. In fact, isn't it true that it was the introduction of Roman text into Japanese newspapers that began the practice of the horizontal headlines to be read LTR, prior to this they were read RTL? It is a cousin of vertical writing, but it is not single-character-per-line vertical; it is horizontal and uses horizontal glyphs, letter spacing, etc. Therefore I support the introduction of a mode of horizontal writing that is RTL for CJK, perhaps distinct from bidi modes already in use since this is archaic and unlikely to be used outside of very specific edge cases (like reproducing classical signage or in a game where trucks drive past with live text emblazoned on their sides). |
@macnmm Writing CJK horizontally can be done with bidi overrides. If we need mixed-script RTL Chinese for reasonably common use cases, then we might need to do something about that, but it'd be a separate issue: this issue seems to be mainly about mixing top-to-bottom RLT text (like Arabic) with vertical Chinese. (I think the summary is a bit misleading, but the OP makes it clear.) |
Does this fully solve the problem though?
|
@frivoal, it’s because Sogdian and Old Uyghur are RTL in horizontal text and TTB in vertical text, whereas Mongolian is LTR/TTB. Hieroglyphic Meroitic is another RTL/TTB script, though it’s different in that the glyphs are not rotated in vertical text. |
As @dscorbett has pointed out, the commonly implemented vertical layout mechanisms basically rotate a horizontal line 90 degrees (clockwise, typically) to create a vertical line, without rework bidi flows. The result is that RTL scripts have no way to be rendered in the same TTB inline direction in vertical lines as how LTR scripts are. |
I think traditional mongolian scripts must be written right to left direction in horizontal position because it originated from arabic scripts. |
I think rtl Mongolian in horizontal direction can also be supported like ttb Arabic in vertical direction. Maybe we need a solution to resolve both the two issues at once. |
The preferred fallback direction for a script is determined by a user community’s actual preference, not by evolutional or typological analysis. |
In Issue 2754 I proposed a new value
horizontal-tb-rl
towriting-mode
.Now I would like to bring up an improved proposal to replace the older one:
Instead of adding a new value
horizontal-tb-rl
towriting-mode
, it would be better to add a new propertycjk-dir
.Let's think about vertical CJK text together with LTR text. It is reasonably rendered in a consecutiveness way, because vertical CJK characters are "by default" mapped as Top-Left/Bottom-Right in vertical mode:
But when it comes to displaying vertical CJK together with RTL text, such as Persian, it is not as readably rendered as with LTR Latin text, because CJK and Persian text are rendered bi-directionally:
However, in vertical mode, it shouldn't have had to be in that way, bacause CJK characters can be mapped Top-Right/Bottom-Left as well as Top-Left/Bottom-Right. So here comes the new property
cjk-dir
, it changes the CJK characters' default directionality(remap them as Top-Right/Bottom-Left), without any necessary rendering change for CJK characters themselves:The image above shows the vertical text with
cjk-dir: ltr
on the left, and shows the other one withcjk-dir: rtl
on the right(being obviously more readable than the left bidi one).cjk-dir
can also as perfectly slove Issue 2754, which was about RTL CJK in horizontal mode.The text was updated successfully, but these errors were encountered: