📜 ⬆️ ⬇️

Vertical writing in modern IT

Hi, Habr! A bidirectional letter in our time does not surprise anyone. It is supported by Unicode control characters, an HTML <bdo> tag was created for it. But horizontal scripts are not the only ones that exist and are used to record human speech. In addition to the usual left-to-right and right-to-left, there are two more options for vertical writing. The first is East Asian, used in languages ​​based on Chinese. In them, the hieroglyphs go from top to bottom, and the lines - from right to left. This style of writing is called Japanese " Tategaki ", " shuffle " in Chinese and " Tongso " in Korean. I note that the European style, familiar to us, from left to right in these three languages ​​is also used and is called, respectively, “ yokogaki ” in Japanese, “ henpai ” in Chinese and “ Hinso ” in Korean. That is, from left to right, the Asian people write and read using computers today. The second option is Mongolian, the characters also go top-down, but the lines are left-to-right. In modern Mongolia, this style of writing has long been replaced by the European, but in some areas of China it still serves to write the Mongolian language. So how much do computers support such a letter? Let's look for vertical artifacts in different information technology applications.

Code Pages


The first thing that comes to mind is encodings. In Unicode, there are control characters for changing, inserting, and replacing the direction of writing in two directions, but there is nothing of the above for vertical writing. The only thing is that there are “vertical forms” blocks from the U + FE10 position to the U + FE1F position, and the “CQF compatibility form” from U + FE30 to U + FE4F, containing some punctuation marks used in Asian scripts. Is there any support for vertical writing in other encodings? The answer is no. I checked many different code page families: BIG, BS, CP, CZA, EBCDIC, EUC, GB, HP, IBM, INIS, ISO, JIS, MAC, TRON, and nowhere did I even find a hint of the ability to write vertically. Unfortunately, in this section we put a huge minus.

Desktop Publishing


Consider two systems: Microsoft Office Word 2007 and LibreOffice Writer 6. I wanted to add OpenOffice Writer 4 here, but they are with the LibreWriter one berry field. First, let us figure out whether the interface of these programs generally allows the text to rotate vertically, and then save and open the document sequentially in the formats docx, odt, xml DocBook, rtf, and pdf.

* Rotate the text - it means to rotate, set the direction. We will not consider a method with one character in a line and a diminished leading.
')
So, the only way to write vertically in the above-mentioned word processors is to create an “inscription” object and change the text direction with the help of inscription tools on the panels. Let's try. Take any Asian text, for example, "こ ん に ち は 世界!" and do the indicated actions.

Microsoft Office Word :



Yes, the Word disappointed me. Along with the direction of the text, he turned all the characters, as if it were an ordinary European text. Save this result does not make sense. Let's see what happens in other editors.

LibreOffice Writer :



Another thing. Moreover, LibreOffice knows the difference between European and Asian characters, and the usual “Hello world” turns with the letters:



Of all formats, only .odt and .pdf could transfer the vertical text to the caption. In addition, I was not able to change the order of lines using LibreOffice Writer. Lines went only from top to bottom or from right to left and nothing else.

HTML


Or rather, its subspace CSS. There is a universal writing-mode property that specifies the direction of text in an element. Let's check how it is handled by the Mozilla Firefox and Google Chrome browsers of the newest versions at the time of this writing. Apply the property to a combined paragraph from Latin, Kana and Chinese characters (<p style = " writing-mode: vertical-rt; "> に ち は 世界! <br /> Hello, world! </ P>).

Mozilla Firefox :



Google Chrome :



Both browsers managed and showed what was expected. To change the direction of the lines (from left to right), you need to specify the writing-mode: vertical-lt; .

But wait. In Asian languages, with vertical writing, some punctuation marks are rotated 90 degrees. Is this true for browsers?

Mozilla Firefox :



Google Chrome :



Unfortunately, for some reason, the second browser failed, instead of showing Japanese punctuation, showing three characters.

And once the Mozilla Firefox browser has come out as the winner, we will try on it another such thing as a vertical furigan. This is something like annotations over hieroglyphs, suggesting how to pronounce them correctly. In the text from left to right, they are written above the hieroglyphs, and in the text from top to bottom to the right of the hieroglyphs. Let's try to add a furigana to a paragraph with the help of <ruby> and <rt> tags:



Mozilla coped.

And now I will leave some links.

WPF library that adds vertical text to a Windows application
Vertical iOS Reader
Her git
Another reader .
You can add to this list in the comments.

Thus, we found out that a full-fledged vertical text can only be obtained using CSS in Mozilla Firefox browser. Sad conclusion. In order to improve the work of the Tategak and Mongolian letters, at least for myself, I created the code system DKOTI (Binary Code for the Exchange of Text Information). About its content and how to add the appropriate locale in Linux, I will write a separate article if you express such a desire.

Source: https://habr.com/ru/post/459568/


All Articles