[Tex/LaTex] Chinese characters

cjkxecjk

In an article mostly in English in one quotation there are a few words in Chinese characters. Using the xecjk package for xelatex they mostly get displayed, but two of the word contain characters getting replaced by an F in a box. Now not knowing Chinese I don't really understand how to proceed, maybe change the font, or maybe do something about the characters? The default font seems to be Fandol, but I'm getting a message of it missing CJK script, although I'd guess that's not really related to my problem:

*************************************************
* fontspec warning: "script-not-exist"
* 
* Font 'FandolSong-Regular' does not contain script 'CJK'.
*************************************************

Anyway, here my example:

\documentclass{article}
\usepackage{fontspec}
\usepackage{xeCJK}
%\setCJKmainfont{SimSun}%this font is not installed, but it seems xeCJK happily uses a default.
\begin{document}
This is a document mostly in English, but containing a few words in Chinese characters.

大豊饒諸衆善法

瞋怒
\end{document}

Compiling to:

Chinese characters sample

Best Answer

The characters 豊 and 瞋 are rather uncommon in everyday use so I guess that's why they are not included in the default font. You need to pick a font that has these two characters. Personally I prefer Microsoft JhengHei for traditional Chinese and Microsoft YaHei for simplified, these two fonts should be available if you are using Windows.

\documentclass{article}
\usepackage{fontspec}
\usepackage{xeCJK}

\setCJKmainfont{Microsoft JhengHei UI}

\setCJKfamilyfont{YaHei}{Microsoft YaHei UI}

\begin{document}
    This is a document mostly in English, but containing a few words in Chinese characters.

    大豊饒諸衆善法

    瞋怒

\CJKfamily{YaHei}

    大豊饒諸衆善法

    瞋怒
\end{document}

enter image description here