[XeTeX] Vertical Japanese in memoir with fontspec

Michiel Kamermans pomax at nihongoresources.com
Fri May 7 21:50:43 CEST 2010


Pander,

<<Too bad many fonts do not offer ō, at least fonts that support both 
Latin and Japanese. Your example nicely separates these by using 
different fonts. In that case I can refrain from using that math 
workaround. >>

I use the XeTeX interchar solution for that in my book. I use Palatino 
Linotype as main font, but it lacks a lot of extended latin characters, 
such as ǒ (o with caron). Luckily, FreeSerif's ǒ looks virtually 
identical to what Palatino Linotype's "should" look like, so I have ǒ 
assigned to interchar class 9, a la

     \XeTeXcharclass `\ǒ 9    % o with caron (used in Pinyin orthography 
for Chinese)
     \XeTeXcharclass `\′ 9    % prime and double prime for time 
(minute/second)
     \XeTeXcharclass `\″ 9

and simply let XeTeX deal with the switching for me, using

     \XeTeXinterchartoks 0 9 = {\extlatinfont}
     \XeTeXinterchartoks 1 9 = {\extlatinfont}
     \XeTeXinterchartoks 2 9 = {\extlatinfont}
     \XeTeXinterchartoks 3 9 = {\extlatinfont}
     \XeTeXinterchartoks 4 9 = {\extlatinfont}
     \XeTeXinterchartoks 5 9 = {\extlatinfont}
     \XeTeXinterchartoks 6 9 = {\extlatinfont}
     \XeTeXinterchartoks 7 9 = {\extlatinfont}
     \XeTeXinterchartoks 8 9 = {\extlatinfont}
     \XeTeXinterchartoks 10 9 = {\extlatinfont}
     \XeTeXinterchartoks 255 9 = {\extlatinfont}

(my book uses several character classes, simply because even if some 
font has glyphs for certain things, they might in fact be very ugly! 
Palatino has glyphs for unicode quotation marks, for instance, but 
they're horrible. Instead, I make XeTeX swap in Adobe Caslon Pro and 
things look peachy)

<<Very nice. Perhaps this can become a single macro that that will work 
in both vertical and horizontal mode. Then it will be a completely 
robust implementation. Is this specific to XeLaTeX or fontspec? Where 
should this macro be included? The current ruby package or fontspec 
package? >>

The code, as is, relies on fontspec, so technically it should work in 
other fontspec-supporting TeX flavours (such as LuaTeX). However, I 
never tested that, so I honestly don't know =) If it had to be moved to 
a package, I'd say move it to the ruby package, but it would have to 
become aware of horizontal vs. vertical text direction.

<<As I don't have 'Kozuka Mincho Pro R' I cannot contribute more to your 
example. What free high quality fonts are out there that support 
vertical mode like 'Kozuka Mincho Pro R' does? Is 'Kozuka Mincho Pro R' 
free? Please have a look free-japanese-fonts.pdf which I have assembled. 
Which  fonts in that overview do any of you know of, are also of the 
quality of 'Kozuka Mincho Pro R'? Is there a way, e.g. with ttx -d /tmp 
/usr/share/fonts/blahblahblah.ttf to find this out? >>

It's not free, but for non-commercial purposes it comes for free with 
Adobe's acrobat reader. For commercial purposes, it also comes with 
every normal windows/mac Adobe product.

You can use TTX to determine which features are supported but they're a 
bit fragmented. The easiest method I know of is windows's extended font 
properties method, which installs into windows and gives you lots of 
additional "properties" tabs when you check a font file's properties, 
amonst which is the list of supported opentype features per script.

As for your PDF of free fonts, I know most of these, but one very 
important thing you may want to consider is whether or not a font is 
useful for actually writing Japanese. Kana-only fonts, for instance, are 
basically just toy fonts. They serve no practical purpose, and I'm not 
quite sure what the people who make them think they're making, but 
Japanese font, they make not.

Limited-kanji fonts, too, are of questionable use. Hakushu offers free 
version of their fonts, for instance, but these are essentially the 
"shareware" versions of their real fonts, and only contain 1000 kanji, 
making them useless for actual Japanese text. You won't be able to use 
them for something even as basic as writing out the いろは poem, for 
instance. (Their real fonts cost between $100 and $200 each, if you buy 
then separately. And package deals don't start until $600 =)

On a note of completeness, you seem to be missing two rather important 
fonts: Hanazono (http://fonts.jp/hanazono/) and HAN NOM 
(http://vietunicode.sourceforge.net/fonts/fonts_hannom.html). The first 
is a large freeware alternative to the common OS-supplied gothic/mincho 
fonts, and the second is a full CJK-ExtA+B implementation, and while it 
does not use the Japanese kanji, but Chinese zi, it is an excellent 
fallback font for rare or old characters. In addition, you're also 
missing Code2000/2001/2002, which is perhaps not the prettiest, but 
certainly more complete than most fonts on that list! =P

- Mike




More information about the XeTeX mailing list