Mailing List Archive

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

[tlug] Truetype fonts and japanese vertical text (was: Re: [BUG] libass: Japanese font with '@'-Prefix rendered wrong])

Hi all,

maybe someone knowledgeable here can/wants to comment on this?
The substation alpha subtitle rendering engine used in MPlayer
currently handles vertical fonts wrong. (@-prefixed Truetype fonts)



----- Forwarded message from Evgeniy Stepanov <> -----

Message-Id: <>
User-Agent: KMail/1.10.1 (Linux/2.6.27-2-generic; KDE/4.1.1; i686; ; )
Date: Sun, 14 Sep 2008 18:09:12 +0400
From: Evgeniy Stepanov <>
To: Tobias Diedrich <>
Subject: Re: [BUG] libass: Japanese font with '@'-Prefix rendered wrong


On Monday 08 September 2008 23:31:28 Tobias Diedrich wrote:
> I noticed that libass renders japanese 'top to bottom' text wrong:
> This is what mplayer does:
> This is Aegisub (which for some unknown reason renders 声 as the
> completely wrong character even though it's ok in the script...):
> Apparently, if a japanese fontname starts with @, the @ is stripped
> and all characters of the font are prerotated by 90 degree.
> This only happens for CJK characters though:
> Here are two screenshots of the font dialog to illustrate that:
> Font with @-Prefix (Note the sample area (サンプル)):
> Same font without @-Prefix:
> This is the fansubs I used for the screenshots and where I extracted the
> script+fonts from:
> I had a cursory glance at the code and I think it might be a bit
> more involving to add rotation based on fontname (and so far I haven't
> found the time to dig into the code a bit more), so I'm posting it
> to the list now. :)

It seems, according to
not all CJK glyphs have to be rotated. It is probably controlled by "vrt2" 
feature in GSUB table. This feature defines substitution of glyphs for vertical 
writing. As I guess, one needs to apply this substitution and then rotate all 
glyphs by 90 degrees.

This article
suggests that latin characters (among others) should be substituted by 
themselves rotated 90 degrees _clockwise_. Thus, the described procedure will 
result in horizontally oriented glyphs.

Can anyone confirm that this is the right way to deal with vertical text?

Unfortunately, FreeType does not parse GSUB table, so it has to be done in 
libass (or an OpenType library like HarfBuzz should be used). Or we could go 
the easy way and define a set of characters that should not be rotated (in 
addition to non-CJK characters, it includes half-width kana, various CJK 
punctuation marks and probably more). This is not reliable, but might work in 

----- End forwarded message -----

Tobias						PGP:

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links