freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font files and vertical text


From: Harold Hallikainen
Subject: Font files and vertical text
Date: Fri, 14 May 2021 12:47:56 -0700
User-agent: SquirrelMail/1.4.22-5.el6

I am trying to understand how font files are used when writing vertically
(such as for Japanese text). I'm pretty new to this, so please excuse my
ignorance.

https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html shows the
horizontal and vertical baselines for horizontal and vertical text. I
THINK the glyph "drawing instructions" are relative to the horizontal
origin. When writing horizontally, the horizontal origin of a character is
placed at the pen position passed into the renderer, and the glyph is
drawn with reference to that position. The next character starts with its
pen position at the old pen position plus the AdvanceWidth.

For vertical text, it looks like there is a vertical origin that is
typically centered above the glyph. The Y offset from the horizontal
origin is either in the VORG table or can be calculated from yMax and the
top side bearing. It is very unclear to me how one determines the X offset
from the horizontal origin to the vertical origin. Is there a drawing or
something that shows how this is done? When rendering vertical text, I
assume the renderer is passed a pen position for the top character. The
renderer then applies the offset to get to the horizontal origin and draws
the glyph based on the horizontal origin (just as for horizontal text). Is
this anything close to correct?

Character positions in a cell change depending on whether the character is
in a horizontal or vertical string. For example, in Japanese, the comma in
horizontal text is low and to the left (so it "hugs" the previous word).
In vertical text, it is high and to the right (so it, again, "hugs" the
previous word since text reads top to bottom and columns right to left).
It sees that this difference could be handled by changing the offset
between the horizontal and vertical position. It could also be handled
through glyph substitution. It could also be handled through the use of a
separate Unicode code point (for example, U+3001 for horizontal text and
U+FE11 for vertical text).

I look forward to any comments to help my understanding!

THANKS!

Harold







-- 
FCC Rules Updated Daily at http://www.hallikainen.com
Not sent from an iPhone.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]