[HarfBuzz] vertical text for RTL scripts?
Phil M Perry
philperry at hvc.rr.com
Mon Jul 13 15:11:51 UTC 2020
(no digest yet with yesterday's posts... I hope one arrives soon)
Eli, I realize that (except for Chinese, Japanese, and possibly Korean),
text is normally written horizontally (LTR or RTL). Vertical text is for
special uses such as signage and advertising. (As an aside, my LTR
example text is a play and short-lived TV sitcom from 1975 about the
residents of a seedy hotel named The Hotel Baltimore. The sign's "e" in
"Hotel" was burned out and never fixed, leaving the sign a vertical "HOT
L BALTIMORE". Maybe there's a reason it only lasted half a season!)
There's not much call for vertical text in most languages, but I'd like
to know if it's being done correctly.
Anyway, I'm still not sure what the convention is for writing vertical
text in RTL languages. There's not much discussion of this online,
except for "I want to get a Hebrew tattoo down my spine saying 'daughter
of Jehovah' -- which way will read correctly?" The convention for LTR
scripts is to start at the top and grow downwards, which is like taking
the original LTR coordinate system and rotating it 90 degrees clockwise
(with individual letters rotated back). The next line (column) is to the
LEFT. For RTL, my sources suggest that the last letter input (first one
read) should be at the TOP of the text column, which means rotating the
original horizontal coordinate system 90 degrees COUNTERclockwise. For
TTB of a RTL script, it is like a clockwise rotation, with the first
input letter at the top, but reading from the bottom/original right.
Embedded LTR text is read TTB. For BTT, it is like a COUNTERclockwise
rotation, with the first input letter at the bottom, reading from
top/original right. Unfortunately, this leaves embedded LTR text
backwards from what would be expected, but the direction of growth is
now correct (upwards). Also, for BTT, is it correct that the next line
(column) is to the RIGHT? That would match the rotated horizontal
coordinate system. What I think I'm seeing here is that setting the
direction of the text simply overrides whatever HarfBuzz would do with
the natural/best guess ordering and orientation, and is outputting the
characters TTB or BTT in the original input order. Is that how it's
supposed to work?
I have a PDF of this, using HarfBuzz::Shaper:
https://www.catskilltech.com/HarfBuzz.pdf. Vertical text is on page 2. I
show Hebrew and Arabic (I don't think the text is real words... don't
sweat it) in both TTB and BTT orientations. Which is considered correct,
or do both have problems? You say that shop signs in Hebrew read
vertically from the bottom, which would be more or less TTB? Although, I
think the word order and direction of growth may be wrong... Hebrew and
Arabic are both bidirectional, so I want to get embedded LTR text
oriented correctly.
Finally, I tried some English (LTR Latin) text vertically with "field"
in it, WITHOUT explicitly turning off ligatures (-liga), and it kept the
"f" and "i" separate (good)... does this mean that HarfBuzz officially
knows not to do ligatures with vertical text? Kerning doesn't appear to
be a problem, either.
Thanks, Phil
On 7/12/2020 11:14 AM, Eli Zaretskii wrote:
>> From: Phil M Perry <philperry at hvc.rr.com>
>> Date: Sun, 12 Jul 2020 10:15:31 -0400
>>
>> Now, if I specify TTB direction, what should I see? Likewise, what
>> should BTT direction show? I know very little about RTL/bidi scripts,
>> and googling for examples gives ambiguous and conflicting information. I
>> realize that most scripts and languages are rarely written vertically,
>> except for East Asian (CJK) languages, but it would be nice to know that
>> the code is handling them correctly.
>>
>> If you want to write Hebrew vertically, would you choose TTB or BBT?
> Hebrew is not written vertically, no more than English or German are.
> So if you must write it vertically, I guess TTB would be the preferred
> layout, like with Latin scripts. For example, that's how
> vertically-laid-out shop signs are made.
>
More information about the HarfBuzz
mailing list