Dienstag, 12. Juli 2011

Vertical writing

VSFilter, pretty much the reference renderer for SSA/ASS, can make use of an obscure Windows feature, often called "@font". When a font name is prefixed with an "@" symbol, Windows switches to a pseudo-vertical writing mode for CJK. Latin characters are written as usual, but CJK characters are rotated and substituted by their vertical forms, if possible. Until now, libass wasn't able to do these substitutions, that especially means punctuation, brackets, parentheses and so on were wrong and and/or wrongly positioned.

With HarfBuzz shaping in place, it is easy to do these substitutions. The OpenType features vert and vkna are responsible for them. vert enables support for vertical writing in general (substitution of brackets, punctuation, et cetera) and vkna enables alternate forms for Kana, if available.

Here's a side-by-side comparison of some random Japanese text. On the left a rendering without substitutions, on the right with both features enabled. The Meiryo font was used.

Keine Kommentare:

Kommentar veröffentlichen