1: texlive2008 installation
ignore
2: install zhspacing
i, go to zhspacing google code page Download the latest package
ii, extra the content of the package to /usr/local/texlive/texmf-local/tex/xelatex/zhspacing
3: zhspacing config
under the directory zhspacing, there are two files: zhfont.sty/zhspacing.sty need to be taken care of.
\newfontfamilywithslant\zhrmfont{SimSun}
\newfontfamilywithslant\zhsffont{SimHei}
\newfontfamilywithslant\zhttfont{FangSong_GB2312}
\else
\newfontfamilywithslantandbold\zhrmfont{SimSun}{SimHei}
\newfontfamilywithslant\zhsffont{SimHei}
\newfontfamilywithslantandbold\zhttfont{FangSong_GB2312}{KaiTi_GB2312}
\newfontfamilywithslant\zhsffont{SimHei}
\newfontfamilywithslant\zhttfont{FangSong_GB2312}
\else
\newfontfamilywithslantandbold\zhrmfont{SimSun}{SimHei}
\newfontfamilywithslant\zhsffont{SimHei}
\newfontfamilywithslantandbold\zhttfont{FangSong_GB2312}{KaiTi_GB2312}
You should change SimSun to whatever Chinese font you have in the computer(use 'fc-list' to check what you have). Personally, I found WenQuanYi Mico Hei Light is such a good look fonts, strongly recommend it. 3: using zhspacing
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec,xltxtra,xunicode} % 这里使用 xetex 相应的宏包
\usepackage{zhfont} % 这里调用 zhfont.sty
\zhspacing
\setzhmainfont{WenQuanYi Micro Hei Light}%这里设置中文粗体和普通字体
\setmainfont{Verdana} %这里设置英文衬线字体
\setmonofont{WenQuanYi Micro Hei Light} %英文等宽字体
%\setsansfont{Trebuchet MS} %英文无衬线字体
\begin{document}
Cowards die many times before their deaths.\\
懦夫在未死之前,已身历多次死亡的恐怖了。
\end{document}
\usepackage{fontspec,xltxtra,xunicode} % 这里使用 xetex 相应的宏包
\usepackage{zhfont} % 这里调用 zhfont.sty
\zhspacing
\setzhmainfont{WenQuanYi Micro Hei Light}%这里设置中文粗体和普通字体
\setmainfont{Verdana} %这里设置英文衬线字体
\setmonofont{WenQuanYi Micro Hei Light} %英文等宽字体
%\setsansfont{Trebuchet MS} %英文无衬线字体
\begin{document}
Cowards die many times before their deaths.\\
懦夫在未死之前,已身历多次死亡的恐怖了。
\end{document}
Here is the pdf output

1 条评论:
推荐 xeCJK 宏包
发表评论