fonts – how to make the latex support traditional-Chinese characters – TeX


With ctex, set a traditional Chinese font with \setCJKmainfont. Pick one that matches the width of your Latin font and load it with an appropriate Scale= option and Renderer=HarfBuzz. You might optionally set up variations such as sans-serif, bold and slanted.

Here is an example requiring the (non-variable, OTF) Noto CJK fonts from Google:

\documentclass{article}
\usepackage[fontset=none]{ctex}
\usepackage[default]{fontsetup} % Load New Computer Modern

\defaultfontfeatures{Ligatures=TeX, Scale=MatchUppercase, Renderer=HarfBuzz}
\defaultfontfeatures[NotoSerifCJKtc]{
  UprightFont=*-Regular,
  BoldFont=*-Bold,
  Extension=.otf,
  AutoFakeSlant=0.15}
\defaultfontfeatures[NotoSansCJKtc]{
  UprightFont=*-Medium,
  BoldFont=*-Bold,
  Extension=.otf,
  AutoFakeSlant=0.15}

\setCJKmainfont{NotoSerifCJKtc}
\setCJKsansfont{NotoSansCJKtc}
% \setCJKmonofont or \setCJKfontfamily if needed.

\begin{document}
\noindent
靜 New Computer Modern Book \textbf{Bold 靜} \textit{Italic 靜} \\
\textsf{靜 New Computer Modern Sans \textbf{Bold 靜} \textit{Italic 靜}}
\end{document}

Noto CJK TC sample

If you need only a few words or short phrases of traditional Chinese in a document primarily in a Western language, you could instead do something like:

\usepackage{babel}
\usepackage{fontspec}

\defaultfontfeatures{Ligatures=TeX, Scale=MatchUppercase, Renderer=HarfBuzz}
\defaultfontfeatures[NotoSerifCJKtc]{
  UprightFont=*-Regular,
  BoldFont=*-Bold,
  Extension=.otf,
  AutoFakeSlant=0.15}
\defaultfontfeatures[NotoSansCJKtc]{
  UprightFont=*-Medium,
  BoldFont=*-Bold,
  Extension=.otf,
  AutoFakeSlant=0.15}

\babelprovide[import, onchar=ids fonts]{chinese-traditional}

\babelfont[chinese-traditional]{rm}
          {NotoSerifCJKtc}
\babelfont[chinese-traditional]{sf}
          {NotoSansCJKtc}



Source link

Leave a Comment