Right-to-Left Styling 101
rtlstyling.com
rtlstyling.com
- "Make sure to set letter-spacing: 0 when working on a multilingual layout" is an advice that's too strong. Letter spacing breaks only with connected scripts, Arabic or Devanagari. (And it's a bug, Arabic script users make use of letter spacing heavily in real life.) Most other scripts - CJK, Cyrillic, Greek, Hebrew, Georgian - will work just fine with letter spacing, and it will have the same meaning as in Latin. But - just as with line height, letter spacing value sometimes needs to be customized.
- You probably don't need to flip the "?" icon for Hebrew users, they don't flip it as in Arabic.
- Arabic letters being rendered over themselves with custom opacity is an unfortunate bug in Webkit. Firefox doesn't have it. But yes, this means that font opacity has to be used sparingly until it's fixed.
[1] https://docs.microsoft.com/en-us/previous-versions/windows/i...
[0] http://mongol.people.com.cn/ (note this only renders correctly in Chrome for me)
It is pretty crazy though that these languages have chosen LtR for their horizontal text, but RtL for vertical text. And when you throw English text into a passage, and numerals too, it gets to be a big fucking mess.
EDIT: This page has an awesome summary of how complicated it gets (e.g. mixing vertical Chinese with RtL Arabic, "vertical" drop-down menus etc):
It’s not actually that crazy: if you rotate RTL vertical text counterclockwise to get text starting from the top of the page, you get LTR horizontal text.
Using dir=rtl or any text alignment css doesn't work, you need to go in and adjust the words individually by wrapping them in those entities.
By far my largest "tech support" issue is helping people _write_ in RTL properly, especially in applications that do not explicitly support RTL. I've written this guide to help, maybe OP will find it useful:
https://dotancohen.com/howto/rtl_right_to_left.html
Note that I've found it very helpful to have the LRE and RLE characters right on the keyboard. Linux users who want to add them might find my Unix.SE question helpful:
https://unix.stackexchange.com/questions/674997/new-keyboard...
Isn't there a simpler solution for supporting RTL? Why not render everything LTR and then flip horizontally? Could it work?
Designing an HTML page with RTL content is basically a nightmare because the tags are still in English.
Actually some programmers do exactly as you say and flip the view completely, including tags, when they work in a mixed document. I have seen this flow with programmers who use vim in the terminal.
But not, the cost is really not enormous nowadays. It's really a matter of really easy fixes and some testing. Similarly to many other accessibility features the issue is most often ignored completely, however.
Tl;dr: There is no perfect solution when your site has to support both LtR and RtL in the same page at the same time. Someone is going to suffer.
I agree. Take a look at Figma, it's a fantastic tool, but it doesn't even support writing in RTL languages without using a plugin!
For example western brand names or simply just digits, even the arabic versions of digits, are rendered as an embedded LTR word.
The dir="RTL" tag, apart from adjusting alignment, gives a hint whether this paragraph has RTL as a main direction. Otherwise the browser will pick the direction from the first letters in the paragraph (RTLness of a word is an intrinsic property of what unicode character is used). And if those first letters happen to be a western brand name or a digit, the whole sentence would be flipped.
Anyway great article! I cringe when I think about all the bugs and glitches arabic or hebrew readers have to endure in software. Not only in browsers though.
I'm the maintainer of BiDi Mail UI, an RTL language support plugin for Mozilla Thunderbird:
https://addons.thunderbird.net/en-US/thunderbird/addon/bidi-...
which you may want to check out if you get RTL content in your email (and you're not using webmail).
A few things to note:
* Additional noteworthy RTL languages besides Arabic: Farsi, Hebrew, Urdu, Suret (Syriac).
* The Unicode standard has an official bidirectional algorithm, which is quite involved:
https://unicode.org/reports/tr9/
hopefully, someone else has already implemented this for you (so use libraries for multi-language text layout).
* If you have trouble with RTL in any application - browser, mail client, office suite - be sure to _file a bug_ about it! The developers are often unaware of these issues. Specific link for LibreOffice, where I do a lot of RTL QA: https://bugs.documentfoundation.org/
Does anyone know why it doesn't? Is there a reason for it or is it just one of those backwards compatibility things where changing it would cause more trouble than it is worth?
We have similar issues in the world of music-related software, where so much is created entirely within the assumptions/defaults of western musical culture; it is gratifying to see that at least for page layout, browsers are doing a better (not perfect, but better) job of covering the whole world.