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