[Tex/LaTex] What Chinese fonts can I rely on to be in Mac and Linux

cjkfontslinuxmac

See this comment; I am involved in a project that needs to have (automatic) XeLaTeX compilation of various language files on both Mac and Linux (usually Fedora or Debian or Ubuntu), and apparently the default fonts are not at all the same. Is there anything I can do to ensure this kind of portability without asking the user to install new fonts?

Currently apparently this works on Fedora:

\usepackage[noindent,UTF8]{ctexcap}
\setCJKmainfont{AR PL UMing CN}
\setCJKsansfont{WenQuanYi Zen Hei}
\setCJKmonofont{WenQuanYi Zen Hei Mono}

but I needed to change to e.g.

\setCJKmainfont[BoldFont=STHeiti,ItalicFont=STKaiti]{STSong}
\setCJKsansfont[BoldFont=STHeiti]{STXihei}
\setCJKmonofont{STFangsong}

(from this answer) though I know that Mac has lots of other Chinese fonts available too.

Ideally, there would be a solution with some sort of fallback option, but I don't know anything about xecjk (or cjk, for that matter) and in any case that option (as here) seems to be more related to when characters are not present in a font, not when a font isn't present.

Thanks!

Best Answer

Portable, and consistent solution

Fandol fonts are reliable portable fonts for typesetting Simplified Chinese in TeX.

Fandol fonts are not perfect: compared to the other commercial fonts, the character set of Fandol fonts is somewhat restricted, and the puncuations need to be tuned.

Luckily, Fandol is a complete series of Chinese fonts in OpenType format, and well designed for typesetting.

enter image description here

% !TEX program = XeLaTeX
% !TEX encoding = UTF-8
\documentclass[UTF8,nofonts]{ctexart}
\setCJKmainfont[BoldFont=FandolSong-Bold.otf,ItalicFont=FandolKai-Regular.otf]{FandolSong-Regular.otf}
\setCJKsansfont[BoldFont=FandolHei-Bold.otf]{FandolHei-Regular.otf}
\setCJKmonofont{FandolFang-Regular.otf}

\begin{document}

\begin{tabular}{|l|l|l|l|}
\hline
 & \multicolumn{3}{c|}{Series/Shape} \\ \cline{2-4}
Family & \verb=\mdseries= & \verb=\bfseries= & \verb=\mdseries\itshape= \\ \hline
\verb=\rmfamily= & 宋体 & \textbf{粗宋体} & \textit{楷体} \\
\verb=\sffamily= & \textsf{黑体} & \textsf{\textbf{粗黑体}} & \\
\verb=\ttfamily= & \texttt{仿宋体} &&\\ \hline
\end{tabular}

\end{document}

The problem is, most Chinese fonts are expensive commercial ones, you simply have little choice for free Chinese fonts. And what's more, Fandol font bundle is the only choice preinstalled in TeX Live (or MacTeX, MiKTeX) if you use XeTeX or LuaTeX. Therefore, it is now the only portable way to typesetting Simplified Chinese documents in TeX.

Yes there are also Arphic fonts, but only subfonts for CJK package in Type1 format are provided in TeX distributions. Only two families (gbsn and gkai) for Simplified Chinese, or two corresponding families (bsmi and bkai) for Traditional Chinese are provided by Arphic.

Some sort of fallback option for rare glyphs?

No. We don't have enough fonts available for that.

Now we have some good free fonts for large character sets. For example the Souce Han Sans fonts. But they are pre-installed neither in TeX distributions, nor in operation systems.

Something native?

Yes it is possible. In the developer version (ver 2.x) of ctex package, we defined several different font sets, and the package will detect the operation system and select a native font set if you wish.

  • SinoType fonts are automatically selected for Mac.
  • ZhongYi fonts are automatically selected for Windows.
  • Fandol fonts are automatically selcted otherwise. (No, we don't use the incomplete Arphic fonts as default fonts, let alone WenQuanYi.)

And we do provide options to select Arphic and WenQuanYi fonts (fontset=ubuntu option), there are also options for Adobe fonts and Founder fonts.