[Tex/LaTex] Why doesn’t the Chinese character display properly

cjkfontsxecjkxetex

I'm trying to produce the character 𡰞, which is in unicode and as far as I'm able to ascertain included in my font HanaMinA. The character displays properly in Firefox as well as when I copy it into the .tex document. But in the PDF output, it's replaced by a square. Does anyone know what I'm doing wrong?

I've also tried with HanaMinB and with the font Han Nom A; still a square.

MWE:

\documentclass[utf8,12pt,letterpaper]{article}
\usepackage{xeCJK}
\setCJKmainfont{HanaMinA}
\begin{document}
 這些字打的出來,問題是: %These character appear properly

 𡰞 %This one does not
\end{document}

I'm compiling with xelatex.

Best Answer

The Unicode of the character 𡰞 is U+21C1E. So it is in font HanaMinB rather than HanaMinA.

There are two mechanisms to deal with such problems in xeCJK.

The first one is the fallback font feature. Say

\documentclass[12pt,letterpaper]{article}
\usepackage{xeCJK}

%% enable fallback font feature
\xeCJKsetup{AutoFallBack}

\setCJKmainfont{HanaMinA}

% set fallback fonts to `HanaMinA'
\setCJKmainfont[FallBack]{HanaMinB}

\begin{document}
 這些字打的出來,問題是: %These character appear properly

 𡰞 % This one too
\end{document}

Another mechanism is more efficient. But it seems a little complicated. This mechanism can be specify particular fonts to some Unicode block.

\documentclass[12pt,letterpaper]{article}
\usepackage{xeCJK}

% declare a Unicode block for Supplementary Ideographic Plane (U+20000 - U+2FFFF)
% Font HanaMinB support CJK Ext-B, Ext-C and Ext-D.
\xeCJKDeclareSubCJKBlock{SIP}
  {
    "20000 -> "2A6DF , % CJK Unified Ideographs Extension B
    "2A700 -> "2B73F , % CJK Unified Ideographs Extension C
    "2B740 -> "2B81F   % CJK Unified Ideographs Extension D
  }

\setCJKmainfont{HanaMinA}

% set fonts to block `SIP' declared above
\setCJKmainfont[SIP]{HanaMinB}

\begin{document}
 這些字打的出來,問題是: %These character appear properly

 𡰞 % This one too
\end{document}
Related Question