\documentclass{ctexart}
\usepackage{xeCJK}
\newfontfamily{\con}{Consolas}
\newfontfamily{\mo}{Monaco}
\newfontfamily{\st}{宋體}
\newfontfamily{\yh}{微軟雅黑}
\newfontfamily{\kt}{楷體}
\newfontfamily{\ht}{黑體}
%\newcommand{\erhao}{\fontsize{21pt}{\baselineskip}\selectfont}
%\newcommand{\kai}{\CJKfamily{kai}}
\setmainfont{Times New Roman} % LaTeX默認(rèn)Computer Modern/Latin Modern
% Arial/Helvetica/Futura也不錯(cuò)
\setsansfont{Adobe Garamond Pro} % 無襯線字體艇棕,一般用于標(biāo)題搏予。Adobe Garamond Pro/Caslon
\setmonofont{Monaco} % 等寬字體巡扇,一般用于排版代碼
\setCJKmainfont{宋體} %設(shè)置字體族突琳,\textrm{這樣就顯示宋體} =\rmfamily
\setCJKsansfont{微軟雅黑} %設(shè)置字體族窥突,\textsf{這樣就顯示微軟雅黑} =\sffamily
\setCJKmonofont{楷體} %設(shè)置字體族火焰,\texttt{這樣就顯示打字機(jī)字體monofont} =\ttfamily
\begin{document}
\noindent
hello this is a small~ \&\&\&\fontname\font \\
\noindent
\con{hello this is a consolas~ \&\&\&\fontname\font }\\
\noindent
\mo{hello this is a monaco~ \&\&\&\fontname\font }\\
正文 \textrm{Times New Roman宋體} \& \textsf{Adobe Garamond Pro微軟雅黑} \& \texttt{monaco楷體}
正文 \textup{直立} \& \textit{a b c Italy 意大利(數(shù)學(xué)公式)} \& \textsl{a b c Italy 傾斜(手寫體)} \& A\scshape{A小型大寫} % 然而字體形狀對中文沒用吵聪,只用字體族進(jìn)行區(qū)分
正文 \textmd{中等} \& \textbf{加寬加粗}
\end{document}
可以用fc-list :lang=zh >> D:\zh.txt
來把電腦所有中文字體全輸出到文件中
同理凌那,fc-list :lang=en >> D:\en.txt
來把電腦所有英文字體全輸出到文件中
若新安裝字體則應(yīng)該在命令行下刷新字體緩存:fc-cache -fsv