Debian Codegraph @

texmf-dist/doc/xetex/font-change-xetex/font-change-xetex.tex

raw
1 % The author of this work is Amit Raj Dhawan.
2 % This work is licensed under the
3 % Creative Commons Attribution-ShareAlike 4.0 International License
4 % on April 07, 2016. For details visit:
5 % http://creativecommons.org/licenses/by-sa/4.0/.
6 %
7 %%%%%%%%% Fonts %%%%%%%%%%
8 \font\webomints=WebOMintsGd at40pt
9 \font\titlefont=artemisiarg8a at36pt
10
11 %%%%%%%%%% Packages %%%%%%%%%%
12 %%% Eplain
13 \input eplain % Add Eplain before AmSTeX
14 \beginpackages
15 \usepackage{url}
16 \usepackage{color}
17 \usepackage{graphicx}
18 \endpackages
19 \enablehyperlinks[dvipdfm] % Enables hyperlinks using Eplain
20 %\hlopts{colormodel=named,color=Black} % Produces links in black color
21 %% Color
22 \definecolor{brown}{rgb}{.7,.2,.2}%
23 \definecolor{grey}{rgb}{0.5,0.5,0.5}%
24
25
26 %%% AmSTeX
27 \input amstex
28 \UseAMSsymbols
29
30 \catcode`@=12
31
32
33
34
35 %%%%%%%%%% Page characteristics %%%%%%%%%%
36 \magnification=1120
37 \parindent=20pt
38 \parfillskip=\parindent plus1fil
39 \everypar{\looseness=-1}
40 \headline{} \footline{}
41 \vsize=25truecm
42 \hoffset-2mm
43 \voffset-3mm
44 \settabs 20 \columns
45 \exhyphenpenalty10000
46 \hyphenpenalty200
47
48
49
50 %%%%%%%%%% Definitions %%%%%%%%%%
51 \def\bs{\bigskip}%
52 \def\ms{\medskip}%
53 \def\sk{\smallskip}%
54 \def\cl{\centerline}%
55 \def\ii{\noindent}%
56 \def\pic#1#2#3{\bigskip\cl{\epsfxsize#1\epsfbox{#2.eps}}\par\cl{\eightrm #3}}%
57 \def\amstex{{\amstexfont A\kern-.1667em\lower.5ex\hbox{M}\kern-.125em S}-\capstex}%
58 \def\xetex{X\lower0.5ex\hbox{\kern-0.11em\reflectbox{E}}\kern-0.165em\TeX}%
59 \def\latex{L\setbox0=\hbox{\sc A}\kern-0.5766\wd0\raise0.41ex\hbox{\sc A}\setbox1=\hbox{T}\kern-.177\wd1\TeX}%
60 \def\xelatex{X\lower0.5ex\hbox{\kern-0.11em\reflectbox{E}}\kern-0.13em\latex}%
61 \def\capstex{{\caps t\kern-.122em\lower.38ex\hbox{e}\kern-.11em x}}%
62 \def\capslatex{{\caps l\setbox0=\hbox{\sevencaps a}\kern-0.5888\wd0{\raise0.33ex\hbox{\sevencaps a}}\setbox1=\hbox{t}\kern-.2\wd1\capstex}}%
63 \def\capsxetex{{\caps x\lower0.38ex\hbox{\kern-0.1em\reflectbox{e}}\kern-0.13em\capstex}}%
64 \def\capsxelatex{{\caps x\lower0.38ex\hbox{\kern-0.1em\reflectbox{e}}\kern-0.122em\capslatex}}%
65 \def\footnote#1{\numberedfootnote{\hskip-7mm\hbox to 20cm{\vtop{\hangindent\parindent\hangafter1\eightrm\fontss #1}}}}%
66 \def\quote#1{\sk\leftskip10mm{\sl\noindent #1}\sk \leftskip0mm\rightskip0mm}%
67 \def\emdash{\hbox{\kern0.15em---\kern0.15em}\relax}%
68 \def\endash{\hbox{\kern0.15em--\kern0.15em}\relax}%
69 \def\code#1{{\color{brown}\tt #1}}%
70 \def\bsl{\char'134}%
71 \def\inbox#1{\hbox{\vbox{\hrule\hbox{\strut\vrule\hbox{\kern0.3em #1\kern0.3em}\strut\vrule}\hrule}}}%
72 \def\coderesult#1{\vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm \vbox{\vskip0.5\baselineskip \parindent=0pt{#1}\vskip0.5\baselineskip}\vrule}}\hrule}}%
73
74
75
76
77 \hyphenpenalty200%
78 \exhyphenpenalty0%
79 \hfuzz=3pt%
80
81 %%%%%%%%%% Chapter, Section %%%%%%%%%%
82 \newcount\sectionno\sectionno=0 % For sections
83 \newcount\subsectionno\subsectionno=0 % For subsections
84 \newcount\subsubsectionno\subsubsectionno=0 % For subsubsections
85 \definecolor{sectioncolor}{rgb}{0.22,0.38,0.62}
86
87
88 \def\section#1#2{%
89 \subsectionno=0%
90 \subsubsectionno=0%
91 \global\advance\sectionno by 1
92 {\special{pdf: outline 1 << /Title (#2)/F 0 /Dest [@thispage /FitH @ypos ] >> }}
93 \bigskip\bigskip\medskip\goodbreak
94 \noindent{\textcolor{sectioncolor}{\sanssixteenbf\fontss \the\sectionno\ \; #1}}
95 {\definexref{#2}{\number\sectionno\ #2}{}}
96 {\writetocentry{section}{\refs{#2}}}
97 \nopagebreak\medskip\nopagebreak\noindent}
98
99 \def\subsection#1{%
100 \global\advance\subsectionno by 1
101 {\special{pdf: outline 2 << /Title (#1)/F 0 /Dest [@thispage /FitH @ypos ] >> }}
102 \bigskip\medskip\goodbreak
103 {\definexref{#1}{\number\sectionno.\number\subsectionno\ #1}{}}
104 {\writetocentry{subsection}{\kern5mm\refs{#1}}}
105 {\noindent{\textcolor{sectioncolor}{\sansfourteenbf\fontss\the\sectionno.\the\subsectionno\ \; #1}}}
106 \nopagebreak\medskip\nopagebreak\noindent}
107
108 \def\subsubsection#1{%
109 \global\advance\subsubsectionno by 1
110 {\special{pdf: outline 2 << /Title (#1)/F 0 /Dest [@thispage /FitH @ypos ] >> }}
111 \bigskip\medskip\goodbreak
112 {{\definexref{#1}{\number\sectionno.\number\subsectionno.\number\subsubsectionno\ #1}{}}
113 {\writetocentry{subsubsection}{\kern5mm\refs{#1}}}
114 \noindent{\textcolor{sectioncolor}{\sanstwelvebf\fontss\the\sectionno.\the\subsectionno.\the\subsubsectionno\ \; #1}}}
115 \nopagebreak\medskip\nopagebreak\noindent}
116
117
118 \input font_kp
119
120 %\input multiple-z-font-change-xetex
121 \input font-change-xetex
122 \def\fontss{\parindent=2em%
123 \baselineskip=2.9ex%
124 \spaceskip=0.30001em plus0.13em minus0.13em}%
125
126 \mysanzfont{Calibri}{11}{}
127 \myzfont{Warnock Pro}{10}{}
128 \fontss \hangpun \frenchspacing
129 \font\tt="Consolas" at 8.7pt%
130 \font\eighttt="Consolas" at 7pt%
131 %\mymathfont{Warnock Pro}{10}
132
133
134
135
136
137
138 %%%%%%%%%% Cover %%%%%%%%%%
139 {\special{pdf: outline 1 << /Title (Cover)/F 0 /Dest [@thispage /FitH @ypos ] >> }}
140 {\centerline{{\color{brown}\webomints\char'160}\hskip8mm\titlefont\color{sectioncolor} font-change-xetex\hskip8mm{\color{brown}\webomints\char'161}}\bs
141 \centerline{{\color{brown}\webomints\char'125\char'126}}
142 \bs
143 \centerline{Version \ 2016.1}
144 \bs\bs
145 {\color{sectioncolor}\fourteenbf\fontss\centerline{Macros to use OpenType and TrueType fonts}\kern3mm
146 \centerline{with \XeTeX}}
147
148 \vskip2cm
149 \centerline{\color{brown}\webomints \char'063}
150 \vskip2cm
151 \centerline{\twelvebf\fontss Amit Raj Dhawan}\sk
152 \centerline{\href{mailto:[email protected]}{\sansrm amitrajdhawan\@gmail.com}}\sk
153 \centerline{\rm April 07, 2016}
154
155 \vskip7cm
156
157 % Licence
158 \hrule\kern1pt\hrule\sk
159 \ii{\includegraphics[scale=0.5]{creative_commons_sa-il_4.pdf}}
160 \vskip-7mm
161 \vbox{\leftskip2.5cm\parindent=0pt\eightrm\fontss\ii This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. You are free to {\eightitbf Share\/} (to copy, distribute and transmit the work) and to {\eightitbf Remix\/} (to adapt the work) provided you follow the {\eightitbf Attribution\/} and {\eightitbf Share Alike\/} guidelines of the licence. For the full licence text, please visit:
162 \href{http://creativecommons.org/licenses/by-sa/4.0/}{\eightrm http://creativecommons.org/licenses/by-sa/4.0/}.}\leftskip0cm
163 \sk\hrule\kern1pt\hrule
164
165 \BlackBoxes
166
167
168 \newpage
169
170 \cl{\sanstwentycapsbf\fontss {\color{sectioncolor}Table of Contents}}\bs\ms
171 {\special{pdf: outline 1 << /Title (Contents)/Dest [@thispage /FitH @ypos ] >> }}%
172
173 \readtocfile
174
175 \pageno=-1
176 \footline{\cl{\folio}}
177
178
179 \newpage
180 \pageno=1
181 \headline{\textcolor{grey}{\capsxetex\ macro {\tt font-change-xetex}} \hfill\folio}
182 \footline{}
183
184 \section{Introduction}{Introduction}\capsxetex\ is a typesetting system based on \capstex~\cite{xetex_package} that supports Unicode~\cite{unicode_webpage} and modern fonts like True~Type fonts~({\caps ttf}), Open Type fonts~({\caps otf}), and Apple Advanced Typography ({\caps aat}) fonts~\cite{phinney_2001_ttf_otf}. The possibility of using almost any kind of font format---either installed as a system font or just placed any \capstex\ working-directory---has significantly improved the utility of \capstex. Moreover, the incorporation of Unicode encoding in \capstex\ documents is a progressive step as non-Latin scripts can now easily exploit the power of \capstex. Variants of \capstex\ like \capsxetex, \capsxelatex, and Lua\capstex\ have made this~feasible.
185
186
187
188 This document will describe the features of the package \code{font-change-xetex}. The package provides a simple way to use system-installed TrueType or OpenType fonts with \capsxetex. The package \code{fontspec}~\cite{fontspec_package}, which works with \capsxelatex\ and Lua\capstex, is a very good tool for using TrueType and OpenType fonts, but to my knowledge, a similar package has not been proposed for \capsxetex. Following the ``plain \capstex'' way of working, the macro package \code{font-change-xetex} allows users to employ {\it external} fonts with~\capsxetex. The macro has been designed to change the text fonts in \capsxetex\ documents but one definition of the macro can be used to change some math mode fonts. The text fonts called by \code{font-change-xetex} can be used with the math fonts declared by another package called \code{font-change}~\cite{font-change_package} to obtain harmonious text and math font~combinations.
189
190 I have been using \code{font-change-xetex} to typeset documents in English and Hindi from the year 2008, and from 2010, the macro has remained almost unchanged. The macro has worked with all the versions of \capsxetex\ so far, and it works with most font families installed on a computer system. Rarely, due to some font file issues, these fonts might not work properly but this is not a problem of the macro as~such.
191
192 The macro \code{font-change-xetex} has been tested with the {\tt xdvipdfmx} driver. Please pay attention to driver-related~issues.
193
194
195 \section{Using font-change-xetex}{Using font-change-xetex}The package \code{font-change-xetex} can be downloaded from \href{http://www.ctan.org}{\caps ctan} and it will be included in the future versions of MiK\TeX\ and \TeX Live. If \code{font-change-xetex} is installed in the \capstex\ installation on your system, then it can be invoked~by:
196 \ms
197 \code{\bsl input font-change-xetex}
198 \ms
199 \ii If the package is not installed in the \capstex\ directory, the package file {\tt font-change-xetex.tex} can be saved on the computer system, say in {\tt C:/}, and can be invoked by typing the following in the {\tt .tex} source~file:
200 \ms
201 \code{\bsl input C:/font-change-xetex.tex}
202 \bs
203 Once the package has been invoked, the commands included in it can be used. The following sections will discuss the font-changing commands of \code{font-change-xetex}.
204
205
206 \section{Text font selection}{Text font selection}The main font~(font family) of a \capsxetex\ document can be changed by using the following definition:
207 \ms
208 \ii\inbox{\code{\bsl myzfont\{\textcolor{blue}{\sl font name}\}\{\textcolor{blue}{\sl font size in points}\}\{\textcolor{blue}{\sl optional font features}\}}}
209 \sk
210 \ii where \textcolor{blue}{\sl font name} is the name of the installed font~family (e.g., Warnock Pro, Minion Pro, Linux Libertine, etc.) or an individual font file (e.g., WarnockPro-Regular, WarnockPro-Semibold, etc.), \textcolor{blue}{\sl font size in points} is the size of the font in points stated as a positive integer without {\tt pt} at the end~(e.g., 9, 10, 31, etc.), and \textcolor{blue}{\sl optional font features} are declared to use or suppress advanced font features like ligatures, proportional figures, etc.~(some of them will be discussed in the following section).
211
212
213 The definition \code{\bsl myzfont} can be declared anywhere in the document. It is recommended to declare it only once somewhere at the beginning of the \capstex\ document---this implements a regular change of fonts without exhausting \capstex's memory.\footnote{\ \; The definition \textcolor{brown}{\eighttt \bsl myfont} provides a way to use multiple font families within the same document but only at the declared size. Though all font style and weight variants like {\eightbf boldface}, {\eightit italics}, {\eightsl slanted}, {\eightitbf italic boldface}, {\eightslbf slanted boldface}, {\eightcaps Caps}, {\eightcapsbf Caps in Bold}, {\eightcapssl Slanted Caps}, and {\eightcapsslbf Slanted Caps in Boldface} will be available. Still, if someone wants to use \textcolor{brown}{\eighttt \bsl myzfont} multiple times in a document, please send me an email. I have not included the variant of \textcolor{brown}{\eighttt font-change-xetex} that allows multiple declarations of \textcolor{brown}{\eighttt \bsl myzfont} and \textcolor{brown}{\eighttt \bsl mysanzfont} because the present variant works better with hanging punctuation.} Once a font~family is declared, the font~weight and style commands like {\bf boldface}~(\code{\bsl bf}), {\it italics}~(\code{\bsl it}), {\sl slanted}~(\code{\bsl sl}), {\itbf italic boldface}~(\code{\bsl itbf}), {\slbf slanted boldface}~(\code{\bsl slbf}), {\caps Caps}~({\code{\bsl caps}), {\capsbf Caps in Bold}~(\code{\bsl capsbf}), {\capssl Slanted Caps}~(\code{\bsl capssl}), and {\capsslbf Slanted Caps in Boldface}~(\code{\bsl capsslbf}) automatically use the corresponding fonts. If the declared font~family does~not have all features, then the features of the preceding font are used. \footnote{\ \; This works even with custom definitions like \textcolor{brown}{\eighttt \bsl itbf}, \textcolor{brown}{\eighttt \bsl caps}, etc. if a macro from \textcolor{brown}{\eighttt font-change} is declared before \textcolor{brown}{\eighttt font-change-xetex}.}
214
215 With respect to the base font size declared in \code{pt}, for each font weight and style, the definition \code{\bsl myzfont} includes several pre-defined relative font~sizes of 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, and 20\,pt. That is, if we declare a base font size of 10\,pt by \code{\bsl myzfont\{Minion Pro\}\{10\}\{\}}, we will obtain the sizes of 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, and 20\,pts, and if we declare a base font size of 20\,pt by \code{\bsl myzfont\{Minion Pro\}\{20\}\{\}}, we get pre-defined sizes of 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, and 40\,pts.
216
217 \code{font-change-xetex} also provides the choice of a sans~serif font through the~definition:
218 \ms
219 \ii\inbox{\code{\bsl mysanzfont\{\textcolor{blue}{\sl font name}\}\{\textcolor{blue}{\sl font size in points}\}\{\textcolor{blue}{\sl optional font features}\}}}
220 \sk
221 \ii This definition provides the same font styles, weights, and sizes as \code{\bsl myzfont}. The font~commands are also the same but each command has a prefix \code{sans} like \code{\bsl sansrm}, \code{\bsl sansit}, \code{\bsl sanstwelvebf}, etc. The next section will mention all the included~commands.
222
223 To change the font locally, \code{font-change-xetex} provides the following~macro:
224 \ms
225 \ii\inbox{\code{\bsl myfont\{\textcolor{blue}{\sl font name}\}\{\textcolor{blue}{\sl font size in points}\}\{\textcolor{blue}{\sl optional font features}\}}}
226 \sk
227 \ii The above command invokes the declared font (or font~family) at the mentioned size with the same font styles and weights as provided by \code{\bsl myzfont}. This command does not provide size variants, thereby easing the burden on \capstex's font~memory.
228
229
230
231
232
233
234 \subsection{Examples of use}The following definition selects Warnock Pro as the main document font~family at 10\,pt. The \capstex\ code is given in \code{brown} on the left and the corresponding results are given on the~right.
235
236 \ms
237 \ii{\code{\bsl myzfont\{Warnock Pro\}\{10\}\{\}}
238 \baselineskip21pt
239 \+\code{\bsl rm \ This is regular} &&&&&&&&&& \rm This is regular\cr
240 \+\code{\bsl bf \ This is bold} &&&&&&&&&& \bf This is bold\cr
241 \+\code{\bsl it \ This is italic} &&&&&&&&&& \it This is italic\cr
242 \+\code{\bsl sl \ This is slanted} &&&&&&&&&& \sl This is slanted\cr
243 \+\code{\bsl itbf \ This is italic bold} &&&&&&&&&& \itbf This is italic bold\cr
244 \+\code{\bsl slbf \ This is slanted bold} &&&&&&&&&& \slbf This is slanted bold\cr
245 \+\code{\bsl caps \ This is Caps} &&&&&&&&&& \caps This is Caps\cr
246 \+\code{\bsl capsbf \ This is Bold Caps} &&&&&&&&&& \capsbf This is Bold Caps\cr
247 \+\code{\bsl capssl \ This is Slanted Caps} &&&&&&&&&& \capssl This is Slanted Caps\cr
248 \+\code{\bsl capsslbf \ This is Slanted Bold Caps} &&&&&&&&&& \capsslbf This is Slanted Bold Caps\cr
249
250 \bs
251
252 \+\code{\bsl fiverm \ This is 5\,pt} &&&&&&&&&& \fiverm This is 5\,pt\cr
253 \+\code{\bsl sixbf \ This is 6\,pt} &&&&&&&&&& \sixbf This is 6\,pt\cr
254 \+\code{\bsl sevenit \ This is 7\,pt} &&&&&&&&&& \sevenit This is 7\,pt\cr
255 \+\code{\bsl eightsl \ This is 8\,pt} &&&&&&&&&& \eightsl This is 8\,pt\cr
256 \+\code{\bsl nineitbf \ This is 9\,pt} &&&&&&&&&& \nineitbf This is 9\,pt\cr
257 \+\code{\bsl slbf \ This is 10\,pt} &&&&&&&&&& \slbf This is 10\,pt\cr
258 \+\code{\bsl caps \ This is 11\,pt} &&&&&&&&&& \elevencaps This is 11\,pt\cr
259 \+\code{\bsl capsbf \ This is 12\,pt} &&&&&&&&&& \twelvecapsbf This is 12\,pt\cr
260 \+\code{\bsl capssl \ This is 14\,pt} &&&&&&&&&& \fourteencapssl This is 14\,pt\cr
261 \+\code{\bsl capsslbf \ This is 16\,pt} &&&&&&&&&& \sixteencapsslbf This is 16\,pt\cr\nopagebreak
262 \+\code{\bsl eighteenrm \ This is 18\,pt} &&&&&&&&&& \eighteenrm This is 18\,pt\cr\nopagebreak
263 \+\code{\bsl twentybf \ This is 20\,pt} &&&&&&&&&& \twentybf This is 20\,pt\cr
264 }
265
266 \bs\bs
267
268 The following statement selects Calibri as the sans~serif font at 11\,pt. The \capstex\ code in \code{brown}, after compilation, gives the result displayed on its~right.
269 \ms
270 \ii{\code{\bsl mysanzfont\{Calibri\}\{11\}\{\}} %\mysanzfont{Aller}{11}{}
271 \baselineskip19pt
272 \+\code{\bsl sansrm \ This is regular} &&&&&&&&&& \sansrm This is regular\cr
273 \+\code{\bsl sansbf \ This is bold} &&&&&&&&&& \sansbf This is bold\cr
274 \+\code{\bsl sansit \ This is italic} &&&&&&&&&& \sansit This is italic\cr
275 \+\code{\bsl sanssl \ This is slanted} &&&&&&&&&& \sanssl This is slanted\cr
276 \+\code{\bsl sansitbf \ This is italic bold} &&&&&&&&&& \sansitbf This is italic bold\cr
277 \+\code{\bsl sansslbf \ This is slanted bold} &&&&&&&&&& \sansslbf This is slanted bold\cr
278 \+\code{\bsl sanscaps \ This is Caps} &&&&&&&&&& \sanscaps This is Caps\cr
279 \+\code{\bsl sanscapsbf \ This is Bold Caps} &&&&&&&&&& \sanscapsbf This is Bold Caps\cr
280 \+\code{\bsl sanscapssl \ This is Slanted Caps} &&&&&&&&&& \sanscapssl This is Slanted Caps\cr
281 \+\code{\bsl sanscapsslbf \ This is Slanted Bold Caps} &&&&&&&&&& \sanscapsslbf This is Slanted Bold Caps\cr
282
283 \bs\bs
284
285 \+\code{\bsl sansfiverm \ This is 5.5\,pt} &&&&&&&&&& \sansfiverm This is 5.5\,pt\cr
286 \+\code{\bsl sanssixbf \ This is 6.6\,pt} &&&&&&&&&& \sanssixbf This is 6.6\,pt\cr
287 \+\code{\bsl sanssevenit \ This is 7.7\,pt} &&&&&&&&&& \sanssevenit This is 7.7\,pt\cr
288 \+\code{\bsl sanseightsl \ This is 8.8\,pt} &&&&&&&&&& \sanseightsl This is 8.8\,pt\cr
289 \+\code{\bsl sansnineitbf \ This is 9.9\,pt} &&&&&&&&&& \sansnineitbf This is 9.9\,pt\cr
290 \+\code{\bsl sansslbf \ This is 11\,pt} &&&&&&&&&& \sansslbf This is 11\,pt\cr
291 \+\code{\bsl sanscaps \ This is 12.1\,pt} &&&&&&&&&& \sanselevencaps This is 12.1\,pt\cr
292 \+\code{\bsl sanscapsbf \ This is 13.2\,pt} &&&&&&&&&& \sanstwelvecapsbf This is 13.2\,pt\cr
293 \+\code{\bsl sanscapssl \ This is 15.4\,pt} &&&&&&&&&& \sansfourteencapssl This is 15.4\,pt\cr
294 \+\code{\bsl sanscapsslbf \ This is 17.6\,pt} &&&&&&&&&& \sanssixteencapsslbf This is 17.6\,pt\cr
295 \+\code{\bsl sanseighteenrm \ This is 19.8\,pt} &&&&&&&&&& \sanseighteenrm This is 19.8\,pt\cr
296 \+\code{\bsl sanstwentybf \ This is 22\,pt} &&&&&&&&&& \sanstwentybf This is 22\,pt\cr
297 }
298
299 \bs\bs
300
301 \hrule\vbox{\noindent\vrule\NoBlackBoxes\vbox{\vskip2mm\leftskip7mm\rightskip7mm
302 {\parindent0pt
303 \verbatim
304 \myzfont{Warnock Pro}{10}{+pnum:+lnum}
305 \mysanzfont{Calibri}{11}{+pnum:+lnum}
306 %
307 \noindent{\sanstwelvecapsbf Text font change in action}
308 \medskip
309 \noindent The command {\tt \char'134 myzfont} changes the main text body font family to Warnock Pro at 10\,pt with the current font set to regular. This is {\bf bold} and this is {\sixteenitbf italic bold at 16\,pt}. {\sansrm The {\sanscaps sans serif} document font is set to Calibri at 11\,pt.} In both the cases we have invoked the {\it proportional figures}~(pnum) and {\it lining figures}~(lnum) features.
310
311 We can change the font locally to {\myfont{Tangerine}{20}{} Tangerine font at 20\,pt} or {\myfont{Chaparral Pro}{11.4}{} Chaparral Pro at 11.4\,pt (this is {\bf Chaparral bold}).
312 |endverbatim
313 }
314 }\vrule}\hrule\BlackBoxes}
315 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
316 \hrule\vbox{\noindent\vrule\NoBlackBoxes\vbox{\vskip2mm\leftskip7mm\rightskip7mm
317 \noindent{\sanstwelvecapsbf Text font change in action}
318 \medskip
319 \noindent The command {\tt \char'134 myzfont} changes the main text body font family to Warnock Pro at 10\,pt with the current font set to regular. This is {\bf bold} and this is {\sixteenitbf italic bold at 16\,pt}. {\sansrm The {\sanscaps sans serif} document font is set to Calibri at 11\,pt.} In both the cases we have invoked the {\it proportional figures}~(pnum) and
320 {\it lining figures}~(lnum) features.
321
322 We can change the font locally to {\myfont{Tangerine}{20}{} Tangerine font at 20\,pt} or
323 {\myfont{Chaparral Pro}{11.4}{} Chaparral Pro at 11.4\,pt (this is {\bf Chaparral bold}).}
324 \medskip}\vrule}\hrule\BlackBoxes\bigskip\bigskip
325
326
327 \section{Hanging punctuation}{Hanging punctuation}Utilizing the character protrusion capability of \capsxetex~(also possible with plain \capstex), the \code{\bsl hangpun} command of \code{font-change-xetex} provides a way to employ hanging punctuation, where the punctuation marks fall out of the text margin. From a typographic perspective, the use of hanging punctuation is debatable. In my opinion, it leads to more harmonious text justification and more elegant typesetting. The following text sample includes the same text with and without hanging~punctuation.
328
329
330
331 \bs\ms
332 \ii\hbox{\vbox{\hrule\hbox{\vrule\hskip2mm\hbox{
333 \vbox to 4.3cm{\hsize=6cm \eightrm\fontss \nohangpun
334 \ms{\bf\hskip1mm Without hanging punctuation}\sk
335 \ii Some people are for using hanging punctuation, and some against. In the end, it is a matter of personal choice. He said, ``I use hanging punctuation.'' ``But does it really lead to better text justification?'' asked~Joe.
336
337 \indent One may argue that protruding punctuation marks draw unnecessary attention but this is questionable. You should try it to find it out yourself\,! Well, let's see\dots
338 \vfill
339 }{\color{green}\vrule} \hskip2mm\vrule}}
340 \hrule}
341 \hskip1.3cm
342 \vbox{\hrule\hbox{\vrule\hskip2mm\hbox{
343 \vbox to 4.3cm{\hsize=6cm \eightrm\fontss \hangpun
344 \ms{\bf\hskip5mm With hanging punctuation}\sk
345 \ii Some people are for using hanging punctuation, and some against. In the end, it is a matter of personal choice. He said, ``I use hanging punctuation.'' ``But does it really lead to better text justification?'' asked~Joe.
346
347 \indent One may argue that protruding punctuation marks draw unnecessary attention but this is questionable. You should try it to find it out yourself\,! Well, let's see\dots
348 \vfill
349 }{\color{green}\vrule} \hskip2mm\vrule}}
350 \hrule}\NoBlackBoxes}
351
352
353 To activate hanging punctuation, the command \code{\bsl hangpun} has to be declared after declaring \code{\bsl myzfont} or \code{\bsl myfont}. It can be deactivated by \code{\bsl nohangpun}.
354
355
356 \section{The OpenType layout}{The OpenType layout}Vector scalable fonts~(which includes most computer fonts) consist of glyph outlines and font layout tables. The glyph outlines of most Windows fonts are either TrueType or PostScript, and these font files are either in TrueType format~({\tt .ttf} extenstion) or OpenType format~({\tt .otf} extension). Generally, most modern PostScript outline fonts are in {\tt .otf} format. The font layout tables of all {\tt .otf} fonts~(e.g., Warnock Pro, Minion Pro, Linux Libertine~O, Calluna, etc.) and many {\tt .ttf} fonts~(e.g., Calibri, Georgia, Constantia, etc.) use the OpenType layout. This means that the OpenType font features included in these {\tt .otf} and {\tt .ttf} fonts can be accessed via OpenType layout tags~\cite{opentype_tag_registry}.
357
358 An OpenType layout tag is an {\caps ascii} character string of 4~bytes that is used to identify the writing scripts, language systems, features and baselines of the font. Using \capsxetex's \code{\bsl font} command, the macros included in the package \code{font-change-xetex} can declare these tags by incorporating them as \textcolor{blue}{\sl optional font features}. A knowledge of some of these tags can be quite useful because different fonts have different default features, which the user may want to change. For example, the main font used in this document, Warnock Pro, invokes oldstyle figures~(745.12) by default but scientific texts demand lining figures~({\myfont{Warnock Pro}{10}{:+pnum:+lnum}745.12}). By using the tag {\tt lnum}, which overrides oldstyle figures with lining figures, we can make the desired switch. There are four categories of OpenType layout tags: Script, Language, Feature, and~Baseline.
359
360 \subsection{Script tags}Script tags generally correspond to a Unicode script and allow the user to provide information about the writing script. This feature is of great value when using non-Latin writing scripts or typesetting a document using multiple scripts. The sample texts below have been written in Devanagari using the Adobe Devanagari font but in the former case, the Latin script tag~(non-default for this font) has been used. Due to this, the Devanagari ligatures are missing in the first text and the Hindi is syntactically~incorrect.
361
362 \bs
363 \vbox{\hrule\hbox{\vrule\hbox{
364 \vbox{\vskip0.5\baselineskip
365 {\myfont{Adobe Devanagari}{12}{:script=latn}
366 \verbatim \myfont{Adobe Devanagari}{12}{:script=latn}|endverbatim
367
368 विद्या अर्जन का प्रयास
369
370 Some vowels are misplaced and the ligatures are missing.}
371 \vskip0.5\baselineskip}\vrule}}\hrule}
372
373 \ms
374
375 \vbox{\hrule\hbox{\vrule\hbox{
376 \vbox{\vskip0.5\baselineskip
377 {\myfont{Adobe Devanagari}{12}{:script=deva}
378 \verbatim \myfont{Adobe Devanagari}{12}{:script=deva}|endverbatim
379
380 विद्या अर्जन का प्रयास
381
382 All vowels and ligatures are well placed.}
383 \vskip0.5\baselineskip}\vrule}}\hrule}
384
385 \ms
386 Generally, font files have a default writing script. For example, all the fonts used in this document, except the ones used to typeset Devanagari, use Latin~({\tt latn}) as the default script. A complete list of script tags can be found~\href{https://www.microsoft.com/typography/otspec/scripttags.htm}{here}.
387
388 \subsection{Language tags}Language tags decide how text written in a given script is presented. For example, both English and French typesetting use the same writing script but the presentation of text is language dependent. A list of language tags is available \href{https://www.microsoft.com/typography/otspec/languagetags.htm}{here}.
389
390
391 \subsection{Feature tags}Feature tags allow the user to choose between different glyph forms. For example, we can choose whether to use standard ligatures (like ffi) or not~(\hbox{f}\hbox{f}\hbox{i}). A table of feature tags is given \href{https://www.microsoft.com/typography/otspec/featurelist.htm}{here}, and their description on this \href{https://www.microsoft.com/typography/otspec/features_ae.htm}{page}.
392 To use a font feature which has a tag called {\tt ftag} via \code{font-change-xetex}, we have to type \code{:+ftag} in the \textcolor{blue}{\sl optional font features}. Suppose that the same feature is a default feature of the font, then in order to deactivate this feature we have to type \code{:-ftag} in the \textcolor{blue}{\sl optional font features}. The following example clarifies this usage.
393
394 \bs
395 \vbox{\hrule\hbox{\vrule\hbox{
396 \vbox{\vskip0.5\baselineskip \parindent=0pt\leftskip7mm\rightskip7mm
397 {\hyphenpenalty10000
398 \verbatim \myfont{Warnock Pro}{10}{}% Declares Warnock Pro font at 10pt with the default settings
399
400 The font Warnock Pro considers {\bf Ţh Ťh ff fi fl ffi ffl fj ffj Th} as {\it standard ligatures} ({\tt liga}), and {\bf st ct sp} as {\it discretionary ligatures}~({\tt dlig}). The default settings of this font allow standard ligatures and suppress
401 discretionary ligatures. We will deactivate standard ligatures and turn on discretionary ligatures with
402
403 \myfont{Warnock Pro}{10}{:-liga:+dlig}
404 % Standard Ligatures deactivated and Discretionary Ligatures activated
405
406 Now the standard ligatures ({\bf Ţh Ťh ff fi fl ffi ffl fj ffj Th}) have been turned off and discretionary ligatures ({\bf st ct sp}) have been turned on.
407 |endverbatim
408 }
409 \vskip0.5\baselineskip}\vrule}}\hrule}
410 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
411 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
412 \vbox{\vskip0.5\baselineskip
413 {The font Warnock Pro considers {\bf Ţh Ťh ff fi fl ffi ffl fj ffj Th} as {\it standard ligatures}~({\tt liga}), and {\bf st ct sp} as {\it discretionary ligatures}~({\tt dlig}). The default settings of this font allow standard ligatures and suppress discretionary ligatures. We will deactivate standard ligatures and turn on discretionary ligatures with
414
415 \myfont{Warnock Pro}{10}{:-liga:+dlig}
416 % Standard ligatures deactivated and discretionary ligatures activated
417
418 Now the standard ligatures ({\bf Ţh Ťh ff fi fl ffi ffl fj ffj Th}) have been turned off and discretionary ligatures ({\bf st ct sp}) have been turned on.
419 }
420 \vskip0.5\baselineskip}\vrule}}\hrule}
421
422 \bs
423
424 The following example shows how the statements of the \code{font-change-xetex} can be used within a paragraph and how \code{\bsl myfont} is used to exploit some features of Bickham Script Pro~font.
425
426 \bs
427 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
428 \vbox{\vskip0.5\baselineskip \parindent=0pt
429 {\verbatim
430 \myfont{Bickham Script Pro}{30}{}
431 % Declares Bickham Script Pro font at 30pt with default features
432
433 This final statement is Crucial.
434
435 \myfont{Bickham Script Pro}{30}{:-calt:-clig}
436 % Contextual Alternates and Contextual Ligatures deactivated
437
438 This final statement is Crucial.
439
440 {\myfont{Bickham Script Pro}{30}{:+swsh}
441 % Swash glyphs activated
442
443 This final statement is Crucial.
444
445 % Alternate available fonts are accessed to locally change some glyphs
446 {\myfont{Bickham Script Pro}{30}{+aalt}T}his
447 {\myfont{Bickham Script Pro}{30}{+aalt=2}f}inal
448 statemen{\myfont{Bickham Script Pro}{30}{+aalt=3}t} is Crucial.}
449 |endverbatim
450 }
451 \vskip0.5\baselineskip}\vrule}}\hrule}
452 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
453 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
454 \vbox{\vskip0.5\baselineskip \parindent=0pt
455 {
456 \myfont{Bickham Script Pro}{30}{}
457 % Declares Bickham Script Pro font at 30pt with default features
458
459 This final statement is Crucial.
460
461 \myfont{Bickham Script Pro}{30}{:-calt:-clig}
462 % Contextual Alternates and Contextual Ligatures deactivated
463
464 This final statement is Crucial.
465
466 {\myfont{Bickham Script Pro}{30}{:+swsh}
467 % Swash glyphs activated
468
469 This final statement is Crucial.
470
471 % Alternate available fonts are accessed to locally change some glyphs
472 {\myfont{Bickham Script Pro}{30}{+aalt}T}his {\myfont{Bickham Script Pro}{30}{+aalt=2}f}inal statemen{\myfont{Bickham Script Pro}{30}{+aalt=3}t} is Crucial.}
473 }
474 \vskip0.5\baselineskip}\vrule}}\hrule}
475
476
477
478
479
480
481 \subsection{Baseline tags}These convey information about the baseline and about writing modes like horizontal, vertical, and math. More details about these tags can be found \href{https://www.microsoft.com/typography/otspec/baselinetags.htm}{here}.
482
483
484
485 \section{Other features}{Other features}This section will describe some font features provided by \capsxetex.
486
487 \subsection{Font options}When an installed font is declared using \code{font-change-xetex}, its size and style variant are selected as well. However, if the user would like to force a particular variant of a font family, the following arguments can be~used:\ms
488
489 \+/B && Selects the {\bf bold} variant of the declared font.\cr
490 \+/I && Selects the {\it italic} variant of the declared font.\cr
491 \+/BI && Selects the {\itbf bold italic} or {\itbf italic bold} variant of the declared font.\cr
492 \+/IB && Same as /BI.\cr
493 \+/S${}=x$ && Uses the font version corresponding to the optical size of $x$\,pt.\cr
494 \+/AAT && only for Mac OS~X.\cr
495 \+/ICU && only for Mac OS~X.\cr
496
497 \bs
498 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
499 \vbox{\vskip0.5\baselineskip \parindent=0pt
500 {
501 \verbatim {\myfont{Warnock Pro/B}{10}{} sets Warnock Pro bold font as the regular font but it is better to say} \myfont{Warnock Pro}{10}{} and then type {\bf some in bold} and {\rm some in regular.}|endverbatim
502 }
503 \vskip0.5\baselineskip}\vrule}}\hrule}
504 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
505 \coderesult{\fontss {\bf sets Warnock Pro bold font as the regular font but it is better to say} and then type {\bf some in bold} and some in regular.}
506
507
508
509 \subsubsection{Optical sizes}If a font family includes optical sizes then they can be employed using the {\tt /S} option. Fonts with optical size variants produce finely adjusted typefaces according to type-size---this can improve text legibility and typesetting appeal. The default \capstex\ font---Donald Knuth's Computer Modern font---has eight optical sizes: 5, 6, 7, 8, 9, 10, 12, and 17\,pt. Because of these optical fonts, Computer Modern can typeset subscripts, sub-subscripts, superscripts, super-superscripts, and mathematics with elegance. The font used to typeset this document, Warnock Pro, offers four optical sizes: Caption, Regular, Subhead, and Display. Similar optical fonts are provided by other Adobe Pro fonts like Minion Pro, Chaparral Pro, Adobe Garamond Pro,~etc.
510
511 When an installed font family is declared in \capsxetex, the optical sizes are chosen automatically. On my system~(Windows~7 with \capsxetex~version~0.99992), depending on the instructed font~size, the Adobe Pro optical font variant is chosen automatically~as:
512 \ms
513 \+{\it Caption} (<8.9\,pt) &&&&&& \font\try="WarnockPro-Regular/S=5" at 10pt \try This is at 10\,pt.\cr
514 \+{\it Regular} (8.9\,pt, 12.9\,pt] &&&&&& \font\try="WarnockPro-Regular/S=10" at 10pt \try This is at 10\,pt.\cr
515 \+{\it Subhead} (12.9\,pt, 22.9\,pt] &&&&&& \font\try="WarnockPro-Regular/S=13" at 10pt \try This is at 10\,pt.\cr
516 \+{\it Display} (>22.9\,pt) &&&&&& \font\try="WarnockPro-Regular/S=23" at 10pt \try This is at 10\,pt.\cr
517 \ms
518 If a font family supports optical sizes, then the definitions \code{\bsl myzfont} and \code{\bsl mysanzfont} select the appropriate sizes automatically. Using \code{\bsl myfont}, we can force a particular optical font size~(see the following example) as well. If the declared font family does~not support optical sizes or if \capsxetex\ is not able to use them, then the usual font is used at the instructed~size.
519
520 \bs
521 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
522 \vbox{\vskip0.5\baselineskip \parindent=0pt
523 {\verbatim
524 \twentyrm% Uses the 20 pt variant, that is, Subhead
525 \noindent Triangles-un-zybfi
526
527 \myfont{Warnock Pro/S=5}{20}{}% Forces the 5 pt variant, that is, Caption at 20 pt
528 \noindent Triangles-un-zybfi|endverbatim
529 }
530 \vskip0.5\baselineskip}\vrule}}\hrule}
531 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
532 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
533 \vbox{\vskip0.5\baselineskip \parindent=0pt
534 {
535 \noindent \twentyrm Triangles-un-zybfi
536
537 \noindent \myfont{Warnock Pro/S=5}{20}{}
538 Triangles-un-zybfi
539 }
540 \vskip0.5\baselineskip}\vrule}}\hrule}
541
542
543
544
545
546
547
548
549
550 \subsection{Color}In the \textcolor{blue}{\sl optional font features} of the definitions of \code{font-change-xetex}, the user can declare the font color using the argument:
551
552 \cl{\code{color=RRGGBB}}
553 \sk
554 \ii where {\tt RR}, {\tt GG}, and {\tt BB} are the three respective pairs of \textcolor{red}{Red}, \textcolor{green}{Green}, and \textcolor{blue}{Blue} hexadecimal values. Many RGB colors and their corresponding hexadecimal values can be found \href{http://cloford.com/resources/colours/500col.htm}{here}.
555
556 \bs
557
558 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
559 \vbox{\vskip0.5\baselineskip \parindent=0pt
560 {
561 \verbatim \myfont{Warnock Pro}{10}{color=800080} This is somewhat purple.|endverbatim
562 }
563 \vskip0.5\baselineskip}\vrule}}
564 \hrule}
565 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
566 \coderesult{\font\try="WarnockPro-Regular:color=800080" at 10pt \try This is somewhat purple.}
567
568
569
570 \subsection{Letter-spacing}The letters of a declared font~(installed on the system) can be spaced using the \capsxetex's \code{letterspace} option. The following example illustrates~this.
571
572 \bs
573 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
574 \vbox{\vskip0.5\baselineskip \parindent=0pt
575 {
576 \verbatim \myfont{Warnock Pro}{10}{letterspace=10} The letters are too spaced.|endverbatim
577 }
578 \vskip0.5\baselineskip}\vrule}}
579 \hrule}
580 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
581 \coderesult{\font\try="WarnockPro-Regular:letterspace=10" at 10pt \try The letters are too spaced.}
582
583
584
585
586 \subsection{Inter-line and inter-word spacing}When a font is declared using \code{\bsl myzfont}, \code{\bsl mysanzfont}, or \code{\bsl myfont} at a given size, the inter-line and inter-word spacing is done automatically depending on size of the font. This is done through the definition \code{\bsl fontss}~(declared in the macro \code{font-change-xetex}), which~is:
587
588 \ms
589 {\color{brown}
590 \verbatim \def\fontss{\parindent=2em%
591 \baselineskip=2.8ex%
592 \spaceskip=0.30001em plus0.11em minus0.11em}%
593 |endverbatim}
594 \ms
595
596 If other---small or large---font sizes are used via definitions like \code{\bsl fourteenbf} or \code{\bsl sevenrm}, it is recommended to declare \code{\bsl fontss} immediately after declaring font-size commands. If one wants to change the parameters of the \code{\bsl fontss} definition, a new definition with the same name but different parameters can be declared anywhere in the document---this will effect the following text. Also, it is possible to declare the just parameters included in \code{\bsl fontss}~differently.
597
598 \bs
599 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
600 \vbox{\vskip0.5\baselineskip \parindent=0pt
601 {\verbatim
602 \myzfont{Warnock Pro}{15}{} The type is large but the inter-line and inter-word space have been taken into account.
603 \bigskip\bigskip
604 \twentyrm This is 30\,pt; the inter-line and inter-word spacing is not good.
605 \bigskip\bigskip
606 \twentyrm\fontss This is 30\,pt; the inter-line and inter-word spacing is better.
607 |endverbatim
608 }
609 \vskip0.5\baselineskip}\vrule}}\hrule}
610 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
611 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
612 \vbox{\vskip0.5\baselineskip \parindent=0pt
613 {
614 {\font\try="WarnockPro-Regular" at 15pt \try \fontss
615 The type is large but the inter-line and inter-word space have been taken into account.}
616 \bigskip\bigskip
617 \font\try="WarnockPro-Regular" at 30pt \try
618 \indent This is 30\,pt; the inter-line and inter-word spacing is not good.
619 \bigskip\bigskip
620 \fontss
621 This is 30\,pt; the inter-line and inter-word spacing is better.
622 }
623 \vskip0.5\baselineskip}\vrule}}\hrule}
624
625
626
627 \section{Special characters using Unicode}{Special characters using Unicode}The package \code{font-change-xetex} includes several commands to typeset special Unicode characters. If the active font has the required glyph, then the following commands produce the corresponding special characters. Note that there is a prefix {\tt u} before the character's common~name.
628
629 \quadcolumns
630 {\myfont{Cambria Math}{10}{}
631 \settabs5\columns
632 \+{\color{brown} \verbatim \uAlpha |endverbatim} &&&{Α}\cr
633 \+{\color{brown} \verbatim \uBeta |endverbatim} &&&{Β}\cr
634 \+{\color{brown} \verbatim \uGamma |endverbatim} &&&{Γ}\cr
635 \+{\color{brown} \verbatim \uDelta |endverbatim} &&&{Δ}\cr
636 \+{\color{brown} \verbatim \uEpsilon |endverbatim} &&&{Ε}\cr
637 \+{\color{brown} \verbatim \uZeta |endverbatim} &&&{Ζ}\cr
638 \+{\color{brown} \verbatim \uEta |endverbatim} &&&{Η}\cr
639 \+{\color{brown} \verbatim \uTheta |endverbatim} &&&{Θ}\cr
640 \+{\color{brown} \verbatim \uIota |endverbatim} &&&{Ι}\cr
641 \+{\color{brown} \verbatim \uKappa |endverbatim} &&&{Κ}\cr
642 \+{\color{brown} \verbatim \uLambda |endverbatim} &&&{Λ}\cr
643 \+{\color{brown} \verbatim \uMu |endverbatim} &&&{Μ}\cr
644 \+{\color{brown} \verbatim \uNu |endverbatim} &&&{Ν}\cr
645 \+{\color{brown} \verbatim \uXi |endverbatim} &&&{Ξ}\cr
646 \+{\color{brown} \verbatim \uOmicron |endverbatim} &&&{Ο}\cr
647 \+{\color{brown} \verbatim \uPi |endverbatim} &&&{Π}\cr
648 \+{\color{brown} \verbatim \uRho |endverbatim} &&&{Ρ}\cr
649 \+{\color{brown} \verbatim \uSigma |endverbatim} &&&{Σ}\cr
650 \+{\color{brown} \verbatim \uTau |endverbatim} &&&{Τ}\cr
651 \+{\color{brown} \verbatim \uUpsilon |endverbatim} &&&{Υ}\cr
652 \+{\color{brown} \verbatim \uPhi |endverbatim} &&&{Φ}\cr
653 \+{\color{brown} \verbatim \uChi |endverbatim} &&&{Χ}\cr
654 \+{\color{brown} \verbatim \uPsi |endverbatim} &&&{Ψ}\cr
655 \+{\color{brown} \verbatim \uOmega |endverbatim} &&&{Ω}\cr
656 \+{\color{brown} \verbatim \ualpha |endverbatim} &&&{α}\cr
657 \+{\color{brown} \verbatim \ubeta |endverbatim} &&&{β}\cr
658 \+{\color{brown} \verbatim \ugamma |endverbatim} &&&{γ}\cr
659 \+{\color{brown} \verbatim \udelta |endverbatim} &&&{δ}\cr
660 \+{\color{brown} \verbatim \uepsilon |endverbatim} &&&{ε}\cr
661 \+{\color{brown} \verbatim \uzeta |endverbatim} &&&{ζ}\cr
662 \+{\color{brown} \verbatim \ueta |endverbatim} &&&{η}\cr
663 \+{\color{brown} \verbatim \utheta |endverbatim} &&&{θ}\cr
664 \+{\color{brown} \verbatim \uiota |endverbatim} &&&{ι}\cr
665 \+{\color{brown} \verbatim \ukappa |endverbatim} &&&{κ}\cr
666 \+{\color{brown} \verbatim \ulambda |endverbatim} &&&{λ}\cr
667 \+{\color{brown} \verbatim \umu |endverbatim} &&&{μ}\cr
668 \+{\color{brown} \verbatim \unu |endverbatim} &&&{ν}\cr
669 \+{\color{brown} \verbatim \uxi |endverbatim} &&&{ξ}\cr
670 \+{\color{brown} \verbatim \uomicron |endverbatim} &&&{ο}\cr
671 \+{\color{brown} \verbatim \upi |endverbatim} &&&{π}\cr
672 \+{\color{brown} \verbatim \urho |endverbatim} &&&{ρ}\cr
673 \+{\color{brown} \verbatim \usigmaf |endverbatim} &&&{ς}\cr
674 \+{\color{brown} \verbatim \usigma |endverbatim} &&&{σ}\cr
675 \+{\color{brown} \verbatim \utau |endverbatim} &&&{τ}\cr
676 \+{\color{brown} \verbatim \uupsilon |endverbatim} &&&{υ}\cr
677 \+{\color{brown} \verbatim \uphi |endverbatim} &&&{φ}\cr
678 \+{\color{brown} \verbatim \uchi |endverbatim} &&&{χ}\cr
679 \+{\color{brown} \verbatim \upsi |endverbatim} &&&{ψ}\cr
680 \+{\color{brown} \verbatim \uomega |endverbatim} &&&{ω}\cr
681 \+{\color{brown} \verbatim \uthetasym |endverbatim} &&&{ϑ}\cr
682 \+{\color{brown} \verbatim \uupsih |endverbatim} &&&{ϒ}\cr
683 \+{\color{brown} \verbatim \upiv |endverbatim} &&&{ϖ}\cr
684 \+{\color{brown} \verbatim \ubull |endverbatim} &&&{•}\cr
685 \+{\color{brown} \verbatim \uhellip |endverbatim} &&&{…}\cr
686 \+{\color{brown} \verbatim \uprime |endverbatim} &&&{′}\cr
687 \+{\color{brown} \verbatim \uPrime |endverbatim} &&&{″}\cr
688 \+{\color{brown} \verbatim \uoline |endverbatim} &&&{‾}\cr
689 \+{\color{brown} \verbatim \ufrasl |endverbatim} &&&{⁄}\cr
690 \+{\color{brown} \verbatim \uweierp |endverbatim} &&&{℘}\cr
691 \+{\color{brown} \verbatim \uimage |endverbatim} &&&{ℑ}\cr
692 \+{\color{brown} \verbatim \ureal |endverbatim} &&&{ℜ}\cr
693 \+{\color{brown} \verbatim \utrade |endverbatim} &&&{™}\cr
694 \+{\color{brown} \verbatim \ualefsym |endverbatim} &&&{ℵ}\cr
695 \+{\color{brown} \verbatim \ularr |endverbatim} &&&{←}\cr
696 \+{\color{brown} \verbatim \uuarr |endverbatim} &&&{↑}\cr
697 \+{\color{brown} \verbatim \urarr |endverbatim} &&&{→}\cr
698 \+{\color{brown} \verbatim \udarr |endverbatim} &&&{↓}\cr
699 \+{\color{brown} \verbatim \uharr |endverbatim} &&&{↔}\cr
700 \+{\color{brown} \verbatim \ucrarr |endverbatim} &&&{↵}\cr
701 \+{\color{brown} \verbatim \ulArr |endverbatim} &&&{⇐}\cr
702 \+{\color{brown} \verbatim \uuArr |endverbatim} &&&{⇑}\cr
703 \+{\color{brown} \verbatim \urArr |endverbatim} &&&{⇒}\cr
704 \+{\color{brown} \verbatim \udArr |endverbatim} &&&{⇓}\cr
705 \+{\color{brown} \verbatim \uhArr |endverbatim} &&&{⇔}\cr
706 \+{\color{brown} \verbatim \uforall |endverbatim} &&&{∀}\cr
707 \+{\color{brown} \verbatim \upart |endverbatim} &&&{∂}\cr
708 \+{\color{brown} \verbatim \uexist |endverbatim} &&&{∃}\cr
709 \+{\color{brown} \verbatim \uempty |endverbatim} &&&{∅}\cr
710 \+{\color{brown} \verbatim \unabla |endverbatim} &&&{∇}\cr
711 \+{\color{brown} \verbatim \uisin |endverbatim} &&&{∈}\cr
712 \+{\color{brown} \verbatim \unotin |endverbatim} &&&{∉}\cr
713 \+{\color{brown} \verbatim \uni |endverbatim} &&&{∋}\cr
714 \+{\color{brown} \verbatim \uprod |endverbatim} &&&{∏}\cr
715 \+{\color{brown} \verbatim \usum |endverbatim} &&&{∑}\cr
716 \+{\color{brown} \verbatim \uminus |endverbatim} &&&{−}\cr
717 \+{\color{brown} \verbatim \ulowast |endverbatim} &&&{∗}\cr
718 \+{\color{brown} \verbatim \uradic |endverbatim} &&&{√}\cr
719 \+{\color{brown} \verbatim \uprop |endverbatim} &&&{∝}\cr
720 \+{\color{brown} \verbatim \uinfin |endverbatim} &&&{∞}\cr
721 \+{\color{brown} \verbatim \uang |endverbatim} &&&{∠}\cr
722 \+{\color{brown} \verbatim \uand |endverbatim} &&&{∧}\cr
723 \+{\color{brown} \verbatim \uor |endverbatim} &&&{∨}\cr
724 \+{\color{brown} \verbatim \ucap |endverbatim} &&&{∩}\cr
725 \+{\color{brown} \verbatim \ucup |endverbatim} &&&{∪}\cr
726 \+{\color{brown} \verbatim \uint |endverbatim} &&&{∫}\cr
727 \+{\color{brown} \verbatim \uthere4 |endverbatim} &&&{∴}\cr
728 \+{\color{brown} \verbatim \usim |endverbatim} &&&{∼}\cr
729 \+{\color{brown} \verbatim \ucong |endverbatim} &&&{≅}\cr
730 \+{\color{brown} \verbatim \uasymp |endverbatim} &&&{≈}\cr
731 \+{\color{brown} \verbatim \une |endverbatim} &&&{≠}\cr
732 \+{\color{brown} \verbatim \uequiv |endverbatim} &&&{≡}\cr
733 \+{\color{brown} \verbatim \ule |endverbatim} &&&{≤}\cr
734 \+{\color{brown} \verbatim \uge |endverbatim} &&&{≥}\cr
735 \+{\color{brown} \verbatim \usub |endverbatim} &&&{⊂}\cr
736 \+{\color{brown} \verbatim \usup |endverbatim} &&&{⊃}\cr
737 \+{\color{brown} \verbatim \unsub |endverbatim} &&&{⊄}\cr
738 \+{\color{brown} \verbatim \usube |endverbatim} &&&{⊆}\cr
739 \+{\color{brown} \verbatim \usupe |endverbatim} &&&{⊇}\cr
740 \+{\color{brown} \verbatim \uoplus |endverbatim} &&&{⊕}\cr
741 \+{\color{brown} \verbatim \uotimes |endverbatim} &&&{⊗}\cr
742 \+{\color{brown} \verbatim \uperp |endverbatim} &&&{⊥}\cr
743 \+{\color{brown} \verbatim \usdot |endverbatim} &&&{⋅}\cr
744 \+{\color{brown} \verbatim \ulceil |endverbatim} &&&{⌈}\cr
745 \+{\color{brown} \verbatim \urceil |endverbatim} &&&{⌉}\cr
746 \+{\color{brown} \verbatim \ulfloor |endverbatim} &&&{⌊}\cr
747 \+{\color{brown} \verbatim \urfloor |endverbatim} &&&{⌋}\cr
748 \+{\color{brown} \verbatim \ulang |endverbatim} &&&{⟨}\cr
749 \+{\color{brown} \verbatim \urang |endverbatim} &&&{⟩}\cr
750 \+{\color{brown} \verbatim \uloz |endverbatim} &&&{◊}\cr
751 \+{\color{brown} \verbatim \uspades |endverbatim} &&&{♠}\cr
752 \+{\color{brown} \verbatim \uclubs |endverbatim} &&&{♣}\cr
753 \+{\color{brown} \verbatim \uhearts |endverbatim} &&&{♥}\cr
754 \+{\color{brown} \verbatim \udiams |endverbatim} &&&{♦}\cr
755 \+{\color{brown} \verbatim \ufnof |endverbatim} &&&{ƒ}\cr
756 \+{\color{brown} \verbatim \uensp |endverbatim} &&&{ }\cr
757 \+{\color{brown} \verbatim \uemsp |endverbatim} &&&{ }\cr
758 \+{\color{brown} \verbatim \uthinsp |endverbatim} &&&{ }\cr
759 \+{\color{brown} \verbatim \uzwnj |endverbatim} &&&{‌}\cr
760 \+{\color{brown} \verbatim \uzwj |endverbatim} &&&{‍}\cr
761 \+{\color{brown} \verbatim \ulrm |endverbatim} &&&{‎}\cr
762 \+{\color{brown} \verbatim \urlm |endverbatim} &&&{‏}\cr
763 \+{\color{brown} \verbatim \undash |endverbatim} &&&{–}\cr
764 \+{\color{brown} \verbatim \umdash |endverbatim} &&&{—}\cr
765 \+{\color{brown} \verbatim \ulsquo |endverbatim} &&&{‘}\cr
766 \+{\color{brown} \verbatim \ursquo |endverbatim} &&&{’}\cr
767 \+{\color{brown} \verbatim \usbquo |endverbatim} &&&{‚}\cr
768 \+{\color{brown} \verbatim \uldquo |endverbatim} &&&{“}\cr
769 \+{\color{brown} \verbatim \urdquo |endverbatim} &&&{”}\cr
770 \+{\color{brown} \verbatim \ubdquo |endverbatim} &&&{„}\cr
771 \+{\color{brown} \verbatim \udagger |endverbatim} &&&{†}\cr
772 \+{\color{brown} \verbatim \uDagger |endverbatim} &&&{‡}\cr
773 \+{\color{brown} \verbatim \upermil |endverbatim} &&&{‰}\cr
774 \+{\color{brown} \verbatim \ulsaquo |endverbatim} &&&{‹}\cr
775 \+{\color{brown} \verbatim \ursaquo |endverbatim} &&&{›}\cr
776 \+{\color{brown} \verbatim \ueuro |endverbatim} &&&{€}\cr
777 \+{\color{brown} \verbatim \ucirc |endverbatim} &&&{ˆ}\cr
778 \+{\color{brown} \verbatim \utilde |endverbatim} &&&{˜}\cr
779 \+{\color{brown} \verbatim \uOElig |endverbatim} &&&{Œ}\cr
780 \+{\color{brown} \verbatim \uoelig |endverbatim} &&&{œ}\cr
781 \+{\color{brown} \verbatim \uScaron |endverbatim} &&&{Š}\cr
782 \+{\color{brown} \verbatim \uscaron |endverbatim} &&&{š}\cr
783 \+{\color{brown} \verbatim \uYuml |endverbatim} &&&{Ÿ}\cr
784 \+{\color{brown} \verbatim \uquot |endverbatim} &&&{"}\cr
785 \+{\color{brown} \verbatim \uamp |endverbatim} &&&{\&}\cr
786 \+{\color{brown} \verbatim \uapos |endverbatim} &&&{'}\cr
787 \+{\color{brown} \verbatim \ult |endverbatim} &&&{<}\cr
788 \+{\color{brown} \verbatim \ugt |endverbatim} &&&{>}\cr
789 \+{\color{brown} \verbatim \unbsp |endverbatim} &&&{}\cr
790 \+{\color{brown} \verbatim \uiexcl |endverbatim} &&&{¡}\cr
791 \+{\color{brown} \verbatim \ucent |endverbatim} &&&{¢}\cr
792 \+{\color{brown} \verbatim \upound |endverbatim} &&&{£}\cr
793 \+{\color{brown} \verbatim \ucurren |endverbatim} &&&{¤}\cr
794 \+{\color{brown} \verbatim \uyen |endverbatim} &&&{¥}\cr
795 \+{\color{brown} \verbatim \ubrvbar |endverbatim} &&&{¦}\cr
796 \+{\color{brown} \verbatim \usect |endverbatim} &&&{§}\cr
797 \+{\color{brown} \verbatim \uuml |endverbatim} &&&{¨}\cr
798 \+{\color{brown} \verbatim \ucopy |endverbatim} &&&{©}\cr
799 \+{\color{brown} \verbatim \uordf |endverbatim} &&&{ª}\cr
800 \+{\color{brown} \verbatim \ulaquo |endverbatim} &&&{«}\cr
801 \+{\color{brown} \verbatim \unot |endverbatim} &&&{¬}\cr
802 \+{\color{brown} \verbatim \ushy |endverbatim} &&&{­}\cr
803 \+{\color{brown} \verbatim \ureg |endverbatim} &&&{®}\cr
804 \+{\color{brown} \verbatim \umacr |endverbatim} &&&{¯}\cr
805 \+{\color{brown} \verbatim \udeg |endverbatim} &&&{°}\cr
806 \+{\color{brown} \verbatim \uplusmn |endverbatim} &&&{±}\cr
807 \+{\color{brown} \verbatim \usup2 |endverbatim} &&&{²}\cr
808 \+{\color{brown} \verbatim \usup3 |endverbatim} &&&{³}\cr
809 \+{\color{brown} \verbatim \uacute |endverbatim} &&&{´}\cr
810 \+{\color{brown} \verbatim \umicro |endverbatim} &&&{µ}\cr
811 \+{\color{brown} \verbatim \upara |endverbatim} &&&{¶}\cr
812 \+{\color{brown} \verbatim \umiddot |endverbatim} &&&{·}\cr
813 \+{\color{brown} \verbatim \ucedil |endverbatim} &&&{¸}\cr
814 \+{\color{brown} \verbatim \usup1 |endverbatim} &&&{¹}\cr
815 \+{\color{brown} \verbatim \uordm |endverbatim} &&&{º}\cr
816 \+{\color{brown} \verbatim \uraquo |endverbatim} &&&{»}\cr
817 \+{\color{brown} \verbatim \ufrac14 |endverbatim} &&&{¼}\cr
818 \+{\color{brown} \verbatim \ufrac12 |endverbatim} &&&{½}\cr
819 \+{\color{brown} \verbatim \ufrac34 |endverbatim} &&&{¾}\cr
820 \+{\color{brown} \verbatim \uiquest |endverbatim} &&&{¿}\cr
821 \+{\color{brown} \verbatim \uAgrave |endverbatim} &&&{À}\cr
822 \+{\color{brown} \verbatim \uAacute |endverbatim} &&&{Á}\cr
823 \+{\color{brown} \verbatim \uAcirc |endverbatim} &&&{Â}\cr
824 \+{\color{brown} \verbatim \uAtilde |endverbatim} &&&{Ã}\cr
825 \+{\color{brown} \verbatim \uAuml |endverbatim} &&&{Ä}\cr
826 \+{\color{brown} \verbatim \uAring |endverbatim} &&&{Å}\cr
827 \+{\color{brown} \verbatim \uAElig |endverbatim} &&&{Æ}\cr
828 \+{\color{brown} \verbatim \uCcedil |endverbatim} &&&{Ç}\cr
829 \+{\color{brown} \verbatim \uEgrave |endverbatim} &&&{È}\cr
830 \+{\color{brown} \verbatim \uEacute |endverbatim} &&&{É}\cr
831 \+{\color{brown} \verbatim \uEcirc |endverbatim} &&&{Ê}\cr
832 \+{\color{brown} \verbatim \uEuml |endverbatim} &&&{Ë}\cr
833 \+{\color{brown} \verbatim \uIgrave |endverbatim} &&&{Ì}\cr
834 \+{\color{brown} \verbatim \uIacute |endverbatim} &&&{Í}\cr
835 \+{\color{brown} \verbatim \uIcirc |endverbatim} &&&{Î}\cr
836 \+{\color{brown} \verbatim \uIuml |endverbatim} &&&{Ï}\cr
837 \+{\color{brown} \verbatim \uETH |endverbatim} &&&{Ð}\cr
838 \+{\color{brown} \verbatim \uNtilde |endverbatim} &&&{Ñ}\cr
839 \+{\color{brown} \verbatim \uOgrave |endverbatim} &&&{Ò}\cr
840 \+{\color{brown} \verbatim \uOacute |endverbatim} &&&{Ó}\cr
841 \+{\color{brown} \verbatim \uOcirc |endverbatim} &&&{Ô}\cr
842 \+{\color{brown} \verbatim \uOtilde |endverbatim} &&&{Õ}\cr
843 \+{\color{brown} \verbatim \uOuml |endverbatim} &&&{Ö}\cr
844 \+{\color{brown} \verbatim \utimes |endverbatim} &&&{×}\cr
845 \+{\color{brown} \verbatim \uOslash |endverbatim} &&&{Ø}\cr
846 \+{\color{brown} \verbatim \uUgrave |endverbatim} &&&{Ù}\cr
847 \+{\color{brown} \verbatim \uUacute |endverbatim} &&&{Ú}\cr
848 \+{\color{brown} \verbatim \uUcirc |endverbatim} &&&{Û}\cr
849 \+{\color{brown} \verbatim \uUuml |endverbatim} &&&{Ü}\cr
850 \+{\color{brown} \verbatim \uYacute |endverbatim} &&&{Ý}\cr
851 \+{\color{brown} \verbatim \uTHORN |endverbatim} &&&{Þ}\cr
852 \+{\color{brown} \verbatim \uszlig |endverbatim} &&&{ß}\cr
853 \+{\color{brown} \verbatim \uagrave |endverbatim} &&&{à}\cr
854 \+{\color{brown} \verbatim \uaacute |endverbatim} &&&{á}\cr
855 \+{\color{brown} \verbatim \uacirc |endverbatim} &&&{â}\cr
856 \+{\color{brown} \verbatim \uatilde |endverbatim} &&&{ã}\cr
857 \+{\color{brown} \verbatim \uauml |endverbatim} &&&{ä}\cr
858 \+{\color{brown} \verbatim \uaring |endverbatim} &&&{å}\cr
859 \+{\color{brown} \verbatim \uaelig |endverbatim} &&&{æ}\cr
860 \+{\color{brown} \verbatim \uccedil |endverbatim} &&&{ç}\cr
861 \+{\color{brown} \verbatim \uegrave |endverbatim} &&&{è}\cr
862 \+{\color{brown} \verbatim \ueacute |endverbatim} &&&{é}\cr
863 \+{\color{brown} \verbatim \uecirc |endverbatim} &&&{ê}\cr
864 \+{\color{brown} \verbatim \ueuml |endverbatim} &&&{ë}\cr
865 \+{\color{brown} \verbatim \uigrave |endverbatim} &&&{ì}\cr
866 \+{\color{brown} \verbatim \uiacute |endverbatim} &&&{í}\cr
867 \+{\color{brown} \verbatim \uicirc |endverbatim} &&&{î}\cr
868 \+{\color{brown} \verbatim \uiuml |endverbatim} &&&{ï}\cr
869 \+{\color{brown} \verbatim \ueth |endverbatim} &&&{ð}\cr
870 \+{\color{brown} \verbatim \untilde |endverbatim} &&&{ñ}\cr
871 \+{\color{brown} \verbatim \uograve |endverbatim} &&&{ò}\cr
872 \+{\color{brown} \verbatim \uoacute |endverbatim} &&&{ó}\cr
873 \+{\color{brown} \verbatim \uocirc |endverbatim} &&&{ô}\cr
874 \+{\color{brown} \verbatim \uotilde |endverbatim} &&&{õ}\cr
875 \+{\color{brown} \verbatim \uouml |endverbatim} &&&{ö}\cr
876 \+{\color{brown} \verbatim \udivide |endverbatim} &&&{÷}\cr
877 \+{\color{brown} \verbatim \uoslash |endverbatim} &&&{ø}\cr
878 \+{\color{brown} \verbatim \uugrave |endverbatim} &&&{ù}\cr
879 \+{\color{brown} \verbatim \uuacute |endverbatim} &&&{ú}\cr
880 \+{\color{brown} \verbatim \uucirc |endverbatim} &&&{û}\cr
881 \+{\color{brown} \verbatim \uuuml |endverbatim} &&&{ü}\cr
882 \+{\color{brown} \verbatim \uyacute |endverbatim} &&&{ý}\cr
883 \+{\color{brown} \verbatim \uthorn |endverbatim} &&&{þ}\cr
884 \+{\color{brown} \verbatim \uyuml |endverbatim} &&&{ÿ}\cr
885 \+{\color{brown} \verbatim \uhbar |endverbatim} &&&{ħ}\cr
886 }
887
888 \singlecolumn
889
890
891 \ii We used the font Cambria Math to typeset the special unicode characters above. Other fonts, such as the main font family used in this document can be used as well. Note that some fonts may~not include many Unicode characters.
892
893 \bs
894
895 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
896 \vbox{\vskip0.5\baselineskip \parindent=0pt
897 {\verbatim
898 The life of \ualpha\ was made better after tilting and becoming {\it \ualpha}---the tilt was about 15\udeg. Even small {\sevenbf \uGamma} and elder {\fourteenbf \uGamma} want to be {\sevenitbf \uGamma} and {\fourteenitbf \uGamma}. But \umu\ prefers to stay upright when used in $2$\,\umu l.|endverbatim
899 }
900 \vskip0.5\baselineskip}\vrule}}\hrule}
901 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
902 \coderesult{The life of \ualpha\ was made better after tilting and becoming {\it \ualpha}---the tilt was about 15\udeg. Even small {\sevenbf \uGamma} and elder {\fourteenbf \uGamma} want to be {\sevenitbf \uGamma} and {\fourteenitbf \uGamma}. But \umu\ prefers to stay upright when used in $2$\,\umu l.}
903
904
905
906
907
908
909
910
911
912 \section{Changing some math fonts}{Changing some math fonts}This feature changes some math fonts and is currently under development. The changed math fonts belong to {\sl family $0$}; this means that regular numerals~({\myfont{Warnock Pro}{10}{:+pnum:+lnum}0--9}), regular letters~(a--z and A--Z), upright Greek capitals~(\uGamma, \uDelta, \uTheta, \uLambda, \uXi, \uPi, \uSigma, \uUpsilon, \uPhi, \uPsi, \uOmega), and hat~(\;$\hat{}$\;) are changed. As a consequence of this change, numbers in text mode~(e.g., {\tt 149.75}) and in math mode~(e.g., {\tt \$149.75\$}) will be typeset using the same font. The change can be implemented~by:
913 \ms
914 \ii\inbox{\code{\bsl mymathfont\{\textcolor{blue}{\sl font name}\}\{\textcolor{blue}{\sl font size in points}\}}}
915 \sk
916 \ii It is possible to use \code{\bsl mymathfont} multiple times in the same document. However, before reusing \code{\bsl mymathfont}, the font size has to be reset by using the macro \code{\bsl resetfontsize}, which is included in \code{font-change-xetex}.
917
918 \bs
919 \ii\textcolor{red}{\bf Warning 1}: The macro \code{\bsl mymathfont} should be declared after \code{\bsl myzfont} or \code{\bsl myfont}, and after \code{\bsl hangpun} or \hbox{\code{\bsl nohangpun}}. In other words, the selection of the main body font and the choice between using hanging punctuation or not has to be made before invoking~\code{\bsl mymathfont}. If the definition \code{\bsl mymathfont} is invoked and the text font is selected multiple times using \code{\bsl myfont}, then after each selection, the math font must be redeclared using \code{\bsl mymathfont}. Otherwise, the capital upright Greek letters in math mode will be~missing.
920
921
922 \bs
923 \mymathfont{Warnock Pro}{10}
924 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
925 \vbox{\vskip0.5\baselineskip \parindent=0pt
926 {\verbatim
927 \mysanzfont{Calibri}{11}{:+pnum:+lnum}% To use Calibri as the sans serif font
928 \input font_kp% From the package font-change; math fonts compatible with Warnock Pro
929 \myzfont{Warnock Pro}{10}{:+pnum:+lnum}% To use Warnock Pro as the main font
930 \mymathfont{Warnock Pro}{10}% To typeset some math using Warnock Pro
931 \centerline{\sanstwelvecapsbf Math Font Test}
932 \bigskip
933 This font is Warnock Pro. The year is 2016. Check the number 2016 below
934 $$
935 2016 \sin(x) + e^{xy} + \Gamma.
936 $$
937 In the above expression 2016, $\sin$, (, ), and \uGamma\ are in Warnock Pro, whereas e, x, and y are in Kp font.|endverbatim
938 }
939 \vskip0.5\baselineskip}\vrule}}\hrule}
940 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
941 \coderesult{\centerline{\sanstwelvecapsbf Math Font Test}
942 \myfont{Warnock Pro}{10}{:+pnum:+lnum}
943 \resetfontsize\mymathfont{Warnock Pro}{10}%
944 \bigskip
945 This font is Warnock Pro. The year is 2016. Check the number 2016 below
946 $$
947 2016 \sin(x) + e^{xy} + \Gamma.
948 $$
949 In the above expression 2016, $\sin$, (, ), and \uGamma\ are in Warnock Pro, whereas e, x, and y are in Kp font.}
950
951
952
953
954
955
956 \bs
957 \ii\textcolor{red}{\bf Warning 2}: It may happen that the declared math font does not have Greek characters or there are some coding issues. As a result of this, the Greek letters will not be typeset! In the following example, we use the font Chaparral Pro for some maths but despite being a ``Pro'' font, it does~not have Greek letter support.
958
959 \bs
960 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
961 \vbox{\vskip0.5\baselineskip \parindent=0pt
962 {\verbatim
963 \mysanzfont{Calibri}{11}{:+pnum:+lnum}% To use Calibri as the sans serif font
964 \myzfont{Chaparral Pro}{11}{:+pnum:+lnum}% To use Chaparral Pro as the main font
965 \mymathfont{Chaparral Pro}{11}% To typeset some math using Chaparral Pro
966 \centerline{\sanstwelvecapsbf Failed Math Font Test}
967 \bigskip
968 This font is Chaparral Pro. Take a look at the following equation:
969 $$
970 \Psi(x) = 173x^2 + 22\cos(x) + \Gamma(x)
971 $$
972 In the above expression 173, 22, (, ), and $\cos$ are in Chaparral Pro, while x and = are in Kp font, but the Greek letters are missing.|endverbatim
973 }
974 \vskip0.5\baselineskip}\vrule}}\hrule}
975 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
976 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
977 \vbox{\vskip0.5\baselineskip \parindent=0pt
978 {\font\try="Chaparral Pro:+pnum:+lnum" at 11pt \try
979 \resetfontsize \mymathfont{Chaparral Pro}{11}% To typeset some math using Chaparral Pro
980 \centerline{\sanstwelvecapsbf Failed Math Font Test}
981 \bigskip
982 This font is Chaparral Pro. Take a look at the following equation:
983 $$
984 \Psi(x) = 173x^2 + 22\cos(x) + \Gamma(x)
985 $$
986 In the above expression 173, 22, (, ), and $\cos$ are in Chaparral Pro, while x and = are in Kp font, but the Greek letters are missing.}
987 \vskip0.5\baselineskip}\vrule}}\hrule}
988
989
990
991
992
993 \section{font-change-xetex with font-change}{font-change-xetex with font-change}The text font changing capabilities of \code{font-change-xetex} can be combined with the package \code{font-change}~\cite{dhawan_font-change-3} which can change both math and text fonts. A font-changing macro from \code{font-change} has to be declared before the definitions of \code{font-change-xetex} so that the math font is chosen from \code{font-change} and the text font is selected by \code{font-change-xetex}. The definition \code{\bsl mymathfont} can be used to change some math fonts as well. The following example shows~this.
994
995 \bs
996 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
997 \vbox{\vskip0.5\baselineskip \parindent=0pt
998 {\verbatim
999 \mysanzfont{Calibri}{11}{:+pnum:+lnum}% To use Calibri as the sans serif font
1000 \input font_kp% From the package font-change; math fonts compatible with Chaparral Pro
1001 \myzfont{Minion Pro}{10}{:+pnum:+lnum}% To use Minion Pro as the main font
1002 \mymathfont{Minion Pro}{10}% To use Minion Pro for some math
1003 \centerline{\sanstwelvecapsbf Text \& Math Font Test}
1004 \bigskip
1005 The text font is Minion Pro, most math is in Kp font, and some math is in Minion Pro. \TeX's Kp fonts go very well with many fonts like Warnock Pro, Adobe Garamond Pro, Minion Pro, etc. The text typed below shows how harmonious the mix of Minion Pro and Kp fonts is.
1006 $$
1007 \Psi(x) = 173x^2 + 22\cos(x) + \Gamma(x)
1008 $$
1009 |endverbatim
1010 }
1011 \vskip0.5\baselineskip}\vrule}}\hrule}
1012 \sk\cl{$\downarrow \downarrow \downarrow$}\sk
1013 \vbox{\hrule\hbox{\vrule\hbox{\leftskip7mm\rightskip7mm
1014 \vbox{\vskip0.5\baselineskip \parindent=0pt
1015 {
1016 %\mysanzfont{Calibri}{11}{:+pnum:+lnum}% To use Calibri as the sans serif font
1017 %\input font_kp% From the package font-change; math fonts compatible with Chaparral Pro
1018 \myfont{Minion Pro}{10}{:+pnum:+lnum}% To use Minion Pro as the main font
1019 \resetfontsize\mymathfont{Minion Pro}{10}% To use Minion Pro for some math
1020 \centerline{\sanstwelvecapsbf Text \& Math Font Test}
1021 \bigskip
1022 The text font is Minion Pro, most math is in Kp font, and some math is in Minion Pro. \TeX's Kp fonts go very well with many fonts like Warnock Pro, Adobe Garamond Pro, Minion Pro, etc. The text typed below shows how harmonious the mix of Minion Pro and Kp fonts is.
1023 $$
1024 \Psi(x) = 173x^2 + 22\cos(x) + \Gamma(x)
1025 $$}\vskip0.5\baselineskip}\vrule}}\hrule}
1026
1027 \bs
1028 The following sample texts display some combinations of math fonts (\capstex\ fonts invoked using \code{font-change}) and text fonts ({\caps otf} or {\caps ttf} fonts invoked using \code{font-change-xetex}).
1029
1030 \newpage \ \ms
1031 \ii\includegraphics[scale=0.87]{font_samples_1.pdf}
1032
1033 \newpage \ \ms
1034 \ii\includegraphics[scale=0.87]{font_samples_2.pdf}
1035
1036 \newpage \ \ms
1037 \ii\includegraphics[scale=0.87]{font_samples_3.pdf}
1038
1039 \newpage \ \ms
1040 \ii\includegraphics[scale=0.87]{font_samples_4.pdf}
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063 \newpage%
1064 {\special{pdf: outline 1 << /Title (Bibliography)/Dest [@thispage /FitH @ypos ] >> }}%
1065 \headline{}%
1066 \centerline{\textcolor{sectioncolor}{\sanssixteenbf Bibliography}}%
1067 {\definexref{Bibliography}{Bibliography}{}}%
1068 \writetocentry{section}{\refs{Bibliography}}%
1069 \bigskip\bigskip%
1070
1071
1072
1073 \bibliographystyle{ieeetran}
1074 \bibliography{c:/bib}
1075 \footline{\cl{\folio}}
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108 \special{pdf: docinfo << /Author (Amit Raj Dhawan)
1109 /Title (Macros to use OpenType and TrueType fonts with XeTeX)
1110 /Creator(XeTeX: Based on TeX---The Genius of Knuth)
1111 /Subject(Using system-installed fonts with XeTeX)
1112 /Keywords(TeX, XeTeX, fonts, math font, text, maths font, font-change, font-change-xetex, OpenType, TrueType, hanging punctuation, Unicode characters, macro, macros)>>}
1113
1114 \special{pdf: docview <</PageMode /UseOutlines>> }
1115
1116
1117
1118
1119 \bye