Hi all,

I have a document with both English and Chinese in which each language
automatically gets the proper font by means of XeTeXinterchartoks and
newfontfamily, see attachment with minimal example.

However, the current setup can only use one font for English and, look
at the FIXME entries, I need another font for the chapter heading.

Also the fontspec LetterSpace is not applied, see last FIXME entry.

Could someone please help me to upgrade this example to use working
fontspec commands and fix the aforementioned issues?

Regards,

Pander
%!xelatex
\documentclass{memoir}
\setstocksize{8.5in}{5.5in}
\settrimmedsize{8.5in}{5.5in}{*}
\setlrmarginsandblock{.75in}{.5in}{*}
\newlength{\HeadHeight}
\setlength{\HeadHeight}{12pt}
\newlength{\UpperMargin}
\setlength{\UpperMargin}{\HeadHeight}
\addtolength{\UpperMargin}{\onelineskip}
\addtolength{\UpperMargin}{.5in}
\newlength{\LowerMargin}
\setlength{\LowerMargin}{.5in}
\addtolength{\LowerMargin}{\onelineskip}
\setulmarginsandblock{\UpperMargin}{\LowerMargin}{*}
\setheadfoot{\HeadHeight}{10pt}
\setheaderspaces{*}{\onelineskip}{*}
\setmarginnotes{10pt}{30pt}{10pt}
\checkandfixthelayout
\usepackage[no-math,quiet]{fontspec} 
\frenchspacing
\renewcommand{\chapnamefont}{\fontspec{Droid Sans}\Huge\bfseries}%FIXME does not work
\renewcommand{\chapnumfont}{\fontspec{Droid Sans}\Huge\bfseries}%FIXME does not work
\renewcommand{\chaptitlefont}{\fontspec{Droid Sans}\Huge\bfseries}%FIXME does not work
\setmainfont[Mapping=tex-text,Ligatures={Common}]{TeX Gyre Pagella}

%% XeTeX adds code when switching latin (0) or boundary (255) to CJK (1, 2, 3)
\XeTeXinterchartokenstate = 1	

%% Fonts for Latin and CJK
\newfontfamily\rmfont{TeX Gyre Pagella}
\newfontfamily\cjkfont{Bitstream CyberCJK}

%% Ranges for Latin Font
\XeTeXinterchartoks 1 0 = {\rmfont}
\XeTeXinterchartoks 2 0 = {\rmfont}
\XeTeXinterchartoks 3 0 = {\rmfont}
\XeTeXinterchartoks 255 0 = {\rmfont}

%% Ranges for CJK Font
\XeTeXinterchartoks 0 1 = {\cjkfont}
\XeTeXinterchartoks 0 2 = {\cjkfont}
\XeTeXinterchartoks 0 3 = {\cjkfont}
\XeTeXinterchartoks 255 1 = {\cjkfont}
\XeTeXinterchartoks 255 2 = {\cjkfont}
\XeTeXinterchartoks 255 3 = {\cjkfont}

\begin{document}
\def\httpSS{http:\addfontfeature{LetterSpace=-24}//}%FIXME does not work
\chapter{Blah blah blah}

Blah blah blah

{\httpSS}blahblah.org

凡軍之所欲擊,城之所欲攻,人之所欲殺;必先知其守將,左右,謁者,門者,舍人之姓名,令吾間必索知之。必索敵間之來間我者,因而利之,導而舍之,故反間可得而使也。因是而知之,故鄉間內間可得而使也;因是而知之,故死間為誑事,可使告敵;因是而知之,故生間可使如期。五間之事,主必知之,知之必在于反間,故反間不可不厚也。

\end{document}

--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to