# Combining Chinese, Japanese and Korean text with xeCJK

When combining Chinese, Japanese and Korean text in a document, is there a way to define individual fonts for the respective characters? Especially for Korean, since few fonts support Cn/Jp AND Korean. Right now I'm using a little workaround by wrapping all Korean text in \texttt{} and setting the font with \setCJKmonofont.

\usepackage{xeCJK}
\setCJKmainfont{Hiragino Mincho Pro} % for Cn & Jp
\setCJKmonofont{AppleMyungjo} % for Kr

\newcommand\cn[1]{\textnormal{#1}}
\newcommand\jp[1]{\textnormal{#1}}
\newcommand\kr[1]{\texttt{#1}}

-

Well, you can freely use \setCJKfamilyfont to define as many fonts as you need. And you can use \CJKfamily to change the font. This is quite similar to the way you have used.

On the other hand, current xeCJK does not have the ability to define different fonts for Chinese, Japanese and Korean individually. In fact, the three languages shares a lot of characters, and it is impossilbe to distinguish which language it is automatically.

An alternative solution is, use fallback option of xeCJK to define a main font (for Chinese & Japanese) and its fallback font (for Korean). For example,

\documentclass{article}
\usepackage[fallback]{xeCJK}[2011/05/01 v2.3.19]
% Fonts available on windows
\setCJKmainfont{SimSun}
\setCJKfallbackfamilyfont{\CJKrmdefault}{Batang}

\begin{document}

こんにちは

여보세요
\end{document}


However, for serious typesetting, the result using fallback font option is questionable. Some glyphs looks quite different among the three countries. A glyph in a Chinese font may be wrong in Korean or Japanese, and vice versa. Thus, a proper way is still change the font manually:

\documentclass{article}
\usepackage{xeCJK}[2011/05/20 v2.4.1]
\setCJKfamilyfont{zhrm}{SimSun}
\setCJKfamilyfont{jarm}{MS Mincho}
\setCJKfamilyfont{korm}{Batang}


\begin{document}
{\Chinese 你好}

{\Japanese こんにちは}

{\Korean 여보세요}
\end{document}

-
 This works, but I get square boxes for the Korean text using Baekmuk Batang (ttf-baekmuk package in Arch Linux). Curiously, if I use the \setCJKmainfont[Mapping=tex-text]{Baekmuk Batang} command by itself, XeTeX can output the correct glyphs just fine --- I would use this command all the time, if it weren't for the restriction that it can only be in the preamble. – opert 1 hour ago