4 available font features

40
The fontspec package Will Robertson 2005/03/07 v1.6 Abstract This package provides functionality for selecting families of fonts with exten- ded feature sets in X E T E X-based L A T E X in Mac OS X. \fontspec[opts]{font} selects arbitrary fonts; \defaultromanfont sets the default for the whole doc- ument, with analogous commands for sans and mono. Other commands are provided for the advanced selection of a large (and extensible) number of rich font features. Contents 1 Introduction 2 1.1 Usage 2 1.2 Warning 2 1.3 About this manual 2 2 Font selection 2 2.1 Default font families 3 2.2 Arbitrary bold/italic fonts 3 2.3 Font instances for effi- ciency 4 3 Selecting font features 4 3.1 Default settings 4 3.2 Changing the currently selected features 5 4 Available font features 5 4.1 Different features for dif- ferent font shapes 6 4.2 Font independent options 6 4.3 Ligatures 7 4.4 Letters 7 4.5 Number Options 8 4.6 Swashes 8 4.7 Diacritics 8 4.8 Vertical position 9 4.9 Fractions 9 4.10 Character Alternates 10 4.11 Variants 11 4.12 Style Options 11 4.13 AAT font axes 11 4.14 OpenType scripts and languages 11 5 Defining new features 12 6 fontspec in the future 14 7 The code 15 7.1 User commands 16 7.2 Internal macros 18 7.3 keyval definitions 24 7.4 Italic small caps 36 7.5 Selecting maths fonts 37 1

Upload: phamhanh

Post on 11-Jan-2017

222 views

Category:

Documents


0 download

TRANSCRIPT

The fontspec package

Will Robertson

2005/03/07 v1.6

Abstract

This package provides functionality for selecting families of fonts with exten-ded feature sets in X ETEX-based LATEX in Mac OS X. \fontspec[〈opts〉]{〈font〉}selects arbitrary fonts; \defaultromanfont sets the default for the whole doc-ument, with analogous commands for sans and mono. Other commands areprovided for the advanced selection of a large (and extensible) number of richfont features.

Contents1 Introduction 2

1.1 Usage 21.2 Warning 21.3 About this manual 2

2 Font selection 22.1 Default font families 32.2 Arbitrary bold/italic fonts 32.3 Font instances for effi-

ciency 4

3 Selecting font features 43.1 Default settings 43.2 Changing the currently

selected features 5

4 Available font features 54.1 Different features for dif-

ferent font shapes 64.2 Font independent options 64.3 Ligatures 74.4 Letters 7

4.5 Number Options 84.6 Swashes 84.7 Diacritics 84.8 Vertical position 94.9 Fractions 94.10 Character Alternates 104.11 Variants 114.12 Style Options 114.13 AAT font axes 114.14 OpenType scripts and

languages 11

5 Defining new features 12

6 fontspec in the future 14

7 The code 157.1 User commands 167.2 Internal macros 187.3 keyval definitions 247.4 Italic small caps 367.5 Selecting maths fonts 37

1

1 IntroductionWith the introduction of Jonathan Kew’s X ETEX,1 Mac OS X users can now easilyaccess system-wide fonts directly in a TEX variant, providing a best of both worldsenvironment. X ETEX eliminates the need for all those files required for installingfonts (.tfm, .vf, .map,…) and provides an easy way to select fonts in Plain TEX:\font\zapf="Times New Roman" at 10pt.

However, it was still necessary to write cumbersome font definition files forLATEX, since the NFSS had a lot more going on behind the scenes to allow easycommands like \bfseries and \emph.

This package almost entirely eliminates this need by providing a completelyautomatic way to select font families in LATEX for arbitrary fonts. Furthermore, itallows (again, almost) total control over the selection of rich font features suchas number case and fancy ligatures present in many modern fonts provided withMac OS X.

1.1 UsageThere are no options for this package: simply call it in your preamble somewhere.As of v1.6, it is necessary to explicitly request Ross Moore’s xunicode package ifyou want access to use LATEX’s various methods for accessing extra characters andaccents (for example, \textbullet, \"u, \O, and so on).

This is highly recommended, since macros such as \% will otherwise give youincorrect output. Note however that this will also break some characters in thedefault Computer Modern fonts, but you’re not using X ETEX to use them, are you!\usepackage{fontspec,xunicode}

1.2 WarningI still consider this package to be experimental, so I’m not ensuring backwardscompatibility at all costs. v1.6 has introduced some changes in font options. I don’twant to weigh the package down with old ways of doing things, so unfortunatelythis will mean that some old documents will need to be modified in order tocompile correctly again.

Such things, and some other comments, are noted in the margin like this (←),(→ An example warning!)

with a red arrow if the change is relevant to the current release of the package.

1.3 About this manualThis document has been typeset with X ETEX using a variety of fonts to displayvarious features that the package supports. Examples of AAT fonts are displayedin a shade of blue, whereas OpenType examples (which are a little more scarce;there will be more in the next version) are in red.

2 Font selection\fontspec[〈font features〉]{〈font name〉} is the base command of the package, used\fontspec

1http://scripts.sil.org/xetex

2

for selecting the specified 〈font name〉 (which is the Mac OS X display name of thefont) in a LATEX family. We shall look at font features later. As an example, lookhow easy it is to select the Hoefler Text typeface:

The five boxing wizards jump quickly.The five boxing wizards jump quickly.

T"# $%&# '()%*+ ,%-./01 2345 63%789:.T"# $%&# '()%*+ ,%-./01 2345 63%789:.

The five boxing wizards jump quickly.The five boxing wizards jump quickly.

T"# $%&# '()%*+ ,%-./01 2345 63%789:.T"# $%&# '()%*+ ,%-./01 2345 63%789:.

\fontspec{Hoefler Text}\shortpangram \\

{\itshape \shortpangram}\\{\scshape \shortpangram}\\{\itshape\scshape\shortpangram}\\\bfseries \shortpangram \\{\itshape \shortpangram}\\{\scshape \shortpangram}\\{\scshape\itshape\shortpangram}\\

The fontspec package takes care of the necessary font definitions for those shapesas shown above automatically. Furthermore, it is not necessary to install the fontfor X ETEX in any way whatsoever: every font that exists in one of Mac OS X’s fontfolders may be accessed.

Note that this package redefines the \itshape and \scshape commands inorder to allow them to select italic small caps in conjunction.

2.1 Default font familiesThe \setromanfont, \setsansfont, and \setmonofont commands are used to\setromanfont

\setsansfont

\setmonofont

select the default font families for the entire document. They take the same argu-ments as \fontspec. For example:

Pack my box with five dozen liquor jugs.Pack my box with five dozen liquor jugs.

Pack my box with five dozen liquor jugs.

\setromanfont{Baskerville}\setsansfont[Scale=0.86]{Skia Regular}\setmonofont[Scale=0.8]{Monaco}\rmfamily\pangram\par\sffamily\pangram\par\ttfamily\pangram

To match the families’ sizes, you should use the Scale option with trial and erroruntil the heights of the lowercase letters are equal. (Although there are morefactors involved, this can often give a reasonable result.)

Unlike \fontspec, these commands may also be used in the preamble. In fact,they must be used there if you wish to set the default math fonts (e.g., \mathrmet al.). The fontspec package must also be loaded after any maths-font–changingpackages (e.g., euler) for this to occur.

There are some warnings that get printed in this situation, but they don’t affectthe output (as far as I know). I don’t yet know enough about maths fonts to knowwhy this happens or how to prevent it.

2.2 Arbitrary bold/italic fontsThe automatic bold, italic, and bold italic font selections will not be adequatefor the needs of every font: while some fonts mayn’t even have bold or italicshapes, others can have many to chose between.2 The BoldFont and ItalicFont

2In the former case, a skilled (or lucky) designer may be able to chose well-matching accompanyingshapes from a different font altogether.

3

options (←) are provided for these situations. If only one of these is used, the bold(→ These options used to becalled Bold and Italic, and theseshorter names may still be used

if you desire.)

italic font is requested as the default from the new font.

Helvetica Neue UltraLightHelvetica Neue UltraLight Italic

Helvetica NeueHelvetica Neue Italic

\fontspec[BoldFont={Helvetica Neue}]{Helvetica Neue UltraLight}

Helvetica Neue UltraLight \\{\itshape Helvetica Neue UltraLight Italic} \\{\bfseries Helvetica Neue } \\{\bfseries\itshape Helvetica Neue Italic} \\

If a bold italic shape is not defined, or you want to specify both custom bold anditalic shapes, the BoldItalicFont option is provided (←).(→ Yes, BoldItalic also works)

OptimaOptima Italic

Optima ExtraBlackOptima ExtraBlack (italic?)

Optima Bold Italic

\fontspec[BoldFont={Optima ExtraBlack}]{Optima Regular}Optima \\

{\itshape Optima Italic } \\{\bfseries Optima ExtraBlack } \\{\bfseries\itshape Optima ExtraBlack (italic?) } \\\addfontfeature{BoldItalic={Optima Bold Italic}}{\bfseries\itshape Optima Bold Italic }

The \addfontfeature command is described in Section 3.2 on the following page.(By rights, the \bfseries\itshape declaration should have resulted in an errorbecause the shape doesn’t exist. I don’t know why it doesn’t in this case.)

2.3 Font instances for efficiencyFor cases when a specific font with a specific feature set is going to be re-usedmany times in a document, it is inefficient to keep calling \fontspec for everyuse. While the command does not define a new font instance after the first call,the feature options must still be parsed and processed.

For this reason, instances of a font may be created with the \newfontinstance\newfontinstance

command, as shown in the following example:

F(*; %*1;.*7#1 $(/#$$%7%#*7:

\newfontinstance\secfont[Letters=SmallCaps]{Hoefler Text}\secfont Font instances for efficiency

3 Selecting font featuresThe four commands discussed each take one optional argument for accessing thefeatures of the requested font. These features that are generally unavailable orharder to access in regular LATEX. These options are described in Section 4 on thenext page. There are, however, two other commands which are used to choosefont features, and they must be introduced first.

3.1 Default settingsIt is possible to define options that are applied with every subsequent font se-\defaultfontfeatures

lection command. This is done with the \defaultfontfeatures{〈options〉} com-mand, with the desired options as for any other font call.

This command was used to automatically colour all of the examples in thisdocument. New calls of \defaultfontfeatures overwrite previous ones.

4

Some ‘defaulť Hoefler Text 0123456789Now in green with lining figures:

?@ABCDEFGH

\fontspec{Hoefler Text}Some `default' Hoefler Text 0123456789 \par\defaultfontfeatures

{Numbers=Uppercase, Colour=009900}\fontspec{Hoefler Text}Now in green with lining figures: 0123456789

3.2 Changing the currently selected featuresThe \addfontfeatures command allows font features to be changed without\addfontfeatures

knowing what features are currently selected or even what font is being used.A good example of this could be to add a hook to all tabular material to havemonospaced numbers:

‘In 1842, 999 people sailed 97 miles in 13boats. In 1923, 111 people sailed 54 miles in

56 boats.’

Year People Miles Boats

1842 999 75 131923 111 54 56

\fontspec[Numbers=OldStyle]{Skia Regular}`In 1842, 999 people sailed 97 miles in13 boats. In 1923, 111 people sailed 54miles in 56 boats.' \vspace{3em}

\addfontfeatures{Numbers={Monospaced,Lining}}\begin{tabular}{@{} cccc @{}}\toprule Year & People & Miles & Boats \\\midrule 1842 & 999 & 75 & 13 \\

1923 & 111 & 54 & 56 \\\bottomrule

\end{tabular}

This command may also be executed under the alias \addfontfeature.\addfontfeature

3.2.1 Priority

Features defined with \addfontfeatures override features specified by \font-spec, which in turn override features specified by \defaultfontfeatures. If indoubt, whenever a new font is chosen for the first time, an entry is made in thetranscript (.log) file displaying the font name and the features requested.

4 Available font featuresThis section covers each and every font feature catered for by this package. Somehave been used already in examples for the font commands. There are too manyto list in this introduction, but for a first taste of what is available, here is anexample of the Apple Chancery typeface:

!y 1"# e$amp%e o&'pp%e C(ancer)

\fontspec[Colour=CC00CC,Numbers=OldStyle,VerticalPosition=Ordinal,Variant=2]{Apple Chancery}

\LargeMy 1st example of\\ Apple Chancery

5

4.1 Different features for different font shapesIt is entirely possible that separate fonts in a family will require separate options;e.g., Hoefler Text Italic contains various swash options that are unavailable in theupright shapes.

Using the Bold-, Italic-, and BoldItalicFeatures options, separate fontfeatures may be added to those shapes. As an example, let’s colour each shapedifferently:

? – Normal; – Italic; – Bold

; – Bold Italic

\fontspec[Numbers=Lining,BoldFeatures={Colour=AA0000},ItalicFeatures={Colour=008833},BoldItalicFeatures={Colour=AA8833},

]{Hoefler Text}0 -- Normal\par

{\itshape 1 -- Italic}\par{\bfseries 2 -- Bold}\par{\bfseries\itshape 3 -- Bold Italic}

Combined with the options for selecting arbitrary fonts for the different shapes,these separate feature options allow the selection of arbitrary weights in (at least)the Skia typeface:

Skia RegularSkia Regular ‘Bold’

\fontspec[BoldFont={Skia Regular},BoldFeatures={Weight=2},

]{Skia Regular}Skia Regular\par{\bfseries Skia Regular `Bold'}\par

4.2 Font independent optionsThese features may be used with any font. Scale takes a single numeric argu-ment for scaling the font glyphs, and was demonstrated in Section 2.1 on page 3.Mapping enables an X ETEX text-mapping scheme.

“¡A small amount of— text!”\fontspec[Mapping=tex-text]{Cochin}``!`A small amount of--- text!''

Colour (or Color), also shown in Section 3.1 on page 4 and Section 4 on thepreceding page, uses X ETEX font calls to set the colour of the font. The colouris defined as a triplet of two-digit Hex RGB values, with optionally another valuefor the transparency (where 00 is completely transparent and FF is opaque.)

WSPR \fontsize{48}{48}\fontspec{Hoefler Text Black}{\addfontfeature{Color=FF000099}W}\kern-1ex{\addfontfeature{Color=0000FF99}S}\kern-0.8ex{\addfontfeature{Color=DDBB2299}P}\kern-0.8ex{\addfontfeature{Color=00BB3399}R}

X ETEX has more advanced colour management abilities, but they cannot be ac-cessed through this package (yet, if at all).

6

4.3 LigaturesLigatures refer to the replacement of two separate characters with a speciallydrawn glyph for functional or æsthetic reasons. For AAT fonts, you may choosefrom any combination of Required, Common, Rare (or Discretionary), Logos, Re-bus, Diphthong, Squared, AbbrevSquared, and Icelandic.

The first three are also supported in OpenType fonts, which may also useHistorical and Contextual. To turn a ligature option off, prefix its name with No:e.g., NoDiphthong.

striK fireflystrict firefly

Rare: Ð Þ ð þLogos: Rebus: ‰

Diphthong: Æ Œ æ œ

\fontspec[Ligatures=Rare]{Hoefler Text}\Large strict firefly \par\fontspec[Ligatures=NoCommon]{Hoefler Text}

strict firefly\vspace{1em}

\fontspec[Ligatures={Rare,Logos,Rebus,Diphthong}]{Palatino} \large

Rare: Dh Th dh th \parLogos: apple \parRebus: \%0 \parDipht\null hong: AE OE ae oe

Some other Apple AAT fonts have those ‘Rare’ ligatures contained in theIcelandic feature. Notice also that the old TEX trick of splitting up a ligaturewith an empty brace pair does not work in X ETEX; you must use a 0 pt kern or\hbox to split the characters up.

4.4 LettersThe Letters feature (←) specifies how the letters in the current font will look. For(→ This feature changed names

along with its options in v1.6,breaking backwards

compatibility!)

AAT fonts, you may choose from Normal, Uppercase, Lowercase, SmallCaps, andInitialCaps.

THIS SENTENCE NO VERB.this sentence no verb.

This Sentence No Verb.

\fontspec[Letters=Uppercase]{Palatino}THIS Sentence no verb. \par\fontspec[Letters=Lowercase]{Palatino}THIS Sentence no verb. \par\fontspec[Letters=InitialCaps]{Palatino}THIS Sentence no verb.

OpenType fonts have some different options: SmallCaps, PetiteCaps, SMALLCAPS,PETITECAPS, and Unicase. Petite caps are smaller than small caps. Mixed casecommands turn lowercase letters into the smaller caps letters, whereas uppercaseoptions turn the capital letters to the smaller caps (good, e.g., for applying toalready uppercase acronyms like ‘NASA’). Finally, unicase is a weird hybrid ofupper and lower case letters.

THIS SENTENCE ɴ ʀʙ.ʜɪ ɴɴ no verb.

\fontspec[Letters=SmallCaps]{Warnock Pro}THIS SENTENCE no verb. \par\fontspec[Letters=SMALLCAPS]{Warnock Pro}THIS SENTENCE no verb.

7

4.5 Number OptionsThe Numbers feature defines how numbers will look in the selected font. For bothAAT and OpenType fonts, they may be a combination of Lining or OldStyleand Proportional or Monospaced (the latter is good for tabular material). Thesynonyms Uppercase and Lowercase are equivalent to Lining and OldStyle, re-spectively. The differences have been shown previously in Section 3.2 on page 5.

For OpenType fonts, there is also the SlashedZero option which replaces thedefault zero with a slashed version to prevent confusion with an uppercase ‘O’ (Ipresume).

0123456789 123456789\fontspec[Numbers=Lining]{Warnock Pro}0123456789\fontspec[Numbers=SlashedZero]{Warnock Pro}0123456789

4.6 SwashesSwashes are fancy ornaments on letters. The options are WordInitial, WordFinal,LineInitial, LineFinal, and Inner (also known as ‘non-final’). As non-exclusiveselectors, like the ligatures, you can turn them off by prefixing their name withNo.

=her> is a? th> @egemit>

‘Inner’ MwaNes can Aometimescontain the archaic long s.

\fontspec[Swashes={WordInitial,WordFinal}]{Hoefler Text Italic}

where is all the vegemite \bigskip

\fontspec[Swashes=Inner]{Hoefler Text}`Inner' swashes can \emph{sometimes} \\contain the archaic long~s.

For OpenType fonts, all but the LineInitial and Inner features are also suppor-ted in OpenType, and Contextual turns on contextual swashes.

Without Contextual Swashes!it" #ontextua$ %washes; cf. W C S

\fontspec{Warnock Pro}\itshapeWithout Contextual Swashes\par\fontspec[Swashes=Contextual]{Warnock Pro}With Contextual Swashes; cf. W C S

4.7 DiacriticsDiacritics refer to characters that are made up from multiple elements, for ex-ample, accented characters. You may either choose to Show, Hide or Decomposethem in AAT fonts. I would recommend using the proper TEX input conventionsfor obtaining such characters instead.

Some fonts include O/ etc. as diacritics for writing Ø. I believe this to be amistake (they should be ligatures instead if anything), but we’re stuck with itnow. You’ll want to turn them off (imagine typing hello/goodbye and getting‘helløgoodbye’ instead!) by decomposing the two characters in the diacritic intothe ones you actually want (←).(→ Note that Hoefler Text has a

bug which means that diacriticscannot be turned off at all!)

8

Ó Ö ØO´ O¨ O/Better: Ó Ö Ø

\fontspec[Diacritics=Show]{Palatino}O´ \quad O¨ \quad O/ \par\fontspec[Diacritics=Decompose]{Palatino}O´ \quad O¨ \quad O/ \parBetter: \'O \"O \O

The Hide option is for Arabic-like fonts which may be displayed either with orwithout vowel markings.

No options for OpenType fonts.

4.8 Vertical positionSome subscript (Superior) and superscript (Inferior) numbers and letters (anda small amount of punctuation, sometimes) are availabe in various fonts. TheOrdinal feature is (supposed to be) contextually sensitive to only raise charactersthat appear directly after a number.

Normal /0123453 6789:6;:1/< 2ⁿ> 33> 4<? 0<? 8ABC>2

\fontspec{Skia Regular}Normal\fontspec[VerticalPosition=Superior]{Skia Regular}Superior\fontspec[VerticalPosition=Inferior]{Skia Regular}Inferior\\\fontspec[VerticalPosition=Ordinal]{Skia Regular}1st 2nd 3rd 4th 0th 8abcde

OpenType fonts also have the option ScientificInferior which extends furtherbelow the baseline than Inferiors, as well as Numerator and Denominator forcreating arbitrary fractions (see next section). Beware, the Ordinal feature willnot work correctly for all OpenType fonts!

Sup ˡⁿʳˢ ⁽⁻¹²³⁴⁵⁶⁷⁾Numerator Denominator

Scientific Inferior ₁₂₃₄₅‘Ordinals’ 1ˢt 2ⁿd 3ʳd 4h 0h

\fontspec[VerticalPosition=Superior]{Warnock Pro}Sup abdehilmnorst (-\$12,345.67)\fontspec[VerticalPosition=Numerator]{Warnock Pro}Numerator 12345\fontspec[VerticalPosition=Denominator]{Warnock Pro}Denominator 12345\fontspec[VerticalPosition=ScientificInferior]{Warnock Pro}Scientific~Inferior 12345\fontspec[VerticalPosition=Ordinal]{Warnock Pro}`Ordinals' 1st 2nd 3rd 4th 0th

4.9 FractionsThis feature works with both AAT and OpenType fonts, with some differences,to create ‘vulgar’ fractions.

In AAT fonts, the ‘fraction slash’ or solidus character, which may be obtainedby typing OPT SHIFT 1, is (supposed) to be used to create fractions. If the Frac-tions feature is used, then (supposedly) only pre-drawn fractions will be used.

Using DiagonalFractions (AAT only), the font will attempt to create the frac-tion from superscript and subscript characters. This is shown in the followingexample by Hoefler Text, whose font support may not be turned off.

9

OPQRS⁄TUVWX (fraction slash)13579/24680 (regular slash)

½ 5⁄6 (fraction slash)1/2 5/6 (regular slash)

\fontspec{Hoefler Text}13579⁄24680 (fraction slash) \par

\quad 13579/24680 (regular slash) \bigskip

\fontspec[Fractions]{Palatino}½ \quad 5⁄6 (fraction slash) \par1/2 \quad 5/6 (regular slash)

It appears that my ‘verbatim’ font is actually also applying these rules. How irrit-ating. OpenType fonts simply use a regular text slash to create fractions:

1/2 1/4 5/6 13579/24680½ ¼ 5/6 13579/24680

\fontspec{Warnock Pro}1/2 \quad 1/4 \quad 5/6 \quad 13579/24680\par\fontspec[Fractions]{Warnock Pro}1/2 \quad 1/4 \quad 5/6 \quad 13579/24680\par

In both AAT and OpenType fonts, NoFractions turns off such fractions.You may wish to use a command like the following to build arbitrary vulgar

fractions in fonts with numerator and denominator glyphs if the font doesn’t sup-port it explicitly: (it is not necessary considered good form to use such fractions)

Xere’s a reason they’recalled ‘vulgar’! ⁄

\newcommand*\vulgarfraction[2]{%{\addfontfeature{VerticalPosition=Numerator}#1}%\textfractionsolidus{\addfontfeature{VerticalPosition=Denominator}#2}}

\fontspec{Warnock Pro} There's a reason they're called `vulgar'!\vulgarfraction{13579}{24680}

(Requires the xunicode package for \textfractionsolidus; also note that \vul-garfraction is not provided by fontspec.)

4.10 Character AlternatesAlternates are tricky, because there’s no definition for what they can be. Thisis where the swashes are in Hoefler Text, but you can’t guarantee that this iswhere they’ll always be or that they’ll use the same number. So unfortunatelyselection of Character Alternates must be done numerically on a per font basis(although Section 5 on page 12 may help a little in this regard).

Sphinx Of Black Quartz, J30+# M: V(,Bphinx Cf Dlack Quartz, J30+# E: F(,

\fontspec[Alternate=0]{Hoefler Text Italic}Sphinx Of Black Quartz, {\scshape Judge My Vow}\fontspec[Alternate=1]{Hoefler Text Italic}Sphinx Of Black Quartz, {\scshape Judge My Vow}

For an OpenType font, any assignment of the alternates will turn on stylistic al-ternates (OpenType feature +salt).

K Q R k v w yK Q R k v w y

\fontspec{Warnock Pro}\largeK Q R k v w y\par\fontspec[Alternate=1]{Warnock Pro}K Q R k v w y

10

4.11 VariantsThe Variant feature takes a single numberical input for choosing different alpha-betic shapes. Don’t mind my fancy example :) I’m just looping through the nine( ! ) variants of Zapfino.

d!"#$%&'( \Huge\newcounter{var}\newcounter{trans}\raisebox{0pt}[\height][0pt]{%\whiledo{\value{var}<9}{%\stepcounter{trans}%\fontspec[Variant=\thevar,Colour=005599\thetrans\thetrans]{Zapfino}%

\makebox[0.75\width]{d}%\stepcounter{var}}}

For OpenType fonts, Variant selects a Stylistic Set, specified numerically betweenone and twenty. I don’t have a font to demonstrate this feature with, unfortunately.

4.12 Style OptionsStyle options are defined in AAT as one of the following: Display, Engraved,IlluminatedCaps, TitlingCaps (supported by OpenType), or TallCaps. I onlywish I had a font that could demonstrate them all.

[\]^_`abcdefghijklmnopqrstuv

\fontspec[StyleOptions=Engraved]{Hoefler Text}[ABCDEFGHIJKLM \hfill\null\par\hfillNOPQRSTUVWXYZ]

4.13 AAT font axesWeight and Width are continuous font parameter axes like you used to be able tofind in Multiple Master fonts. The only font I know of which supports these isSkia. Luckily it comes with Mac OS X!

Really light and extended SkiaReally fat and condensed Skia

\fontspec[Weight=0.5,Width=3]{Skia Regular}Really light and extended Skia \par\fontspec[Weight=2,Width=0.5]{Skia Regular}Really fat and condensed Skia

4.14 OpenType scripts and languagesWhen dealing with fonts that include glyphs for various languages, they maycontain different font features for the different character sets and languages itsupports. These may be selected with the Script and Language features. Thepossible options are tabulated in Table 1 on the next page and Table 2 on page 13,respectively. Note however that very few fonts even take some of these optionsinto account, so most of them are included only for completeness.

In the following example, the same font is used to typeset the verbatim inputand the X ETEX output. Because the Script is only specified for the output, the textis rendered incorrectly in the verbatim input. Many thanks to Jonathan Kew, YvesCodet and Gildas Hamel for their contributions towards this example.

11

-

\fontspec[Script=Arabic]{Code2000}\par\bigskip

\fontspec[Script=Devanagari]{Code2000}\par\bigskip

\fontspec[Script=Bengali]{Code2000}\par\bigskip

\fontspec[Script=Gujarati]{Code2000}- \par\bigskip

\fontspec[Script=Malayalam]{Code2000}\par\bigskip

\fontspec[Script=Gurmukhi]{Code2000}\par\bigskip

\fontspec[Script=Tamil]{Code2000}\par\bigskip

\fontspec[Script=Hebrew]{Code2000}

ArabicArmenianBalineseBengaliBopomofoBrailleBugineseBuhidByzantine MusicCanadian SyllabicsCherokeeCJK IdeographicCopticCypriot SyllabaryCyrillicDefaultDeseretDevanagariEthiopic

GeorgianGlagoliticGothicGreekGujaratiGurmukhiHangul JamoHangulHanunooHebrewHiraganaKatakanaJapaneseJavaneseKannadaKharosthiKhmerLaoLatin

LimbuLinear BMalayalamMathMathsMongolianMusical SymbolsMyanmarN’koOghamOld ItalicOld Persian CuneiformOriyaOsmanyaPhags-paPhoenicianRunicShavianSinhala

Sumero-Akkadian Cunei-formSyloti NagriSyriacTagalogTagbanwaTai LeTai LuTamilTeluguThaanaThaiTibetanTifinaghUgaritic CuneiformYi

Table 1: Defined Scripts for OpenType fonts.

5 Defining new featuresThis package cannot hope to contain every possible font feature. Two commandsare provided for selecting features that have are not available out of the box. Ifyou are using them a lot, chances are I’ve left something out, so please let meknow.

\newfontfeature{〈tag〉}{〈feature string〉} takes two arguments: 〈tag〉 is the\newfontfeature

name to reference the new feature by when selecting it in your font; and 〈featurestring〉 the string that activates the particular font feature. For example, Zapfinocontains a non-standard feature ‘Avoid d-collisions’. To access it with this pack-age, you could do the following:

12

AbazaAbkhazianAdygheAfrikaansAfarAgawAltaiAmharicArabicAariArakaneseAssameseAthapaskanAvarAwadhiAymaraAzeriBadagaBaghelkhandiBalkarBauleBerberBenchBible CreeBelarussianBembaBengaliBulgarianBhiliBhojpuriBikolBilenBlackfootBalochiBalanteBaltiBambaraBamilekeBretonBrahuiBraj BhashaBurmeseBashkirBetiCatalanCebuanoChechenChaha GurageChattisgarhiChichewaChukchiChipewyanCherokeeChuvashComorianCopticCreeCarrierCrimean TatarChurch SlavonicCzechDanishDargwaWoods Cree

GermanDefaultDogriDivehiDjermaDangmeDinkaDunganDzongkhaEbiraEastern CreeEdoEfikGreekEnglishErzyaSpanishEstonianBasqueEvenkiEvenEweFrench AntilleanFarsiFinnishFijianFlemishForest NenetsFonFaroeseFrenchFrisianFriulianFutaFulaniGaGaelicGagauzGalicianGarshuniGarhwaliGe’ezGilyakGumuzGondiGreenlandicGaroGuaraniGujaratiHaitianHalamHarautiHausaHawaiinHammer-BannaHiligaynonHindiHigh MariHindkoHoHarariCroatianHungarianArmenian

IgboIjoIlokanoIndonesianIngushInuktitutIrishIrish TraditionalIcelandicInari SamiItalianHebrewJavaneseYiddishJapaneseJudezmoJulaKabardianKachchiKalenjinKannadaKarachayGeorgianKazakhKebenaKhutsuri GeorgianKhakassKhanty-KazimKhmerKhanty-ShurishkarKhanty-VakhiKhowarKikuyuKirghizKisiiKokniKalmykKambaKumaoniKomoKomsoKanuriKodaguKorean Old HangulKonkaniKikongoKomi-PermyakKoreanKomi-ZyrianKpelleKrioKarakalpakKarelianKaraimKarenKooreteKashmiriKhasiKildin SamiKuiKulviKumykKurdishKurukh

KuyKoryakLadinLahuliLakLambaniLaoLatinLazL-CreeLadakhiLezgiLingalaLow MariLimbuLomweLower SorbianLule SamiLithuanianLubaLugandaLuhyaLuoLatvianMajangMakuaMalayalam TraditionalMansiMarathiMarwariMbunduManchuMoose CreeMendeMe’enMizoMacedonianMaleMalagasyMalinkeMalayalam ReformedMalayMandinkaMongolianManipuriManinkaManx GaelicMokshaMoldavianMonMoroccanMaoriMaithiliMalteseMundariNaga-AssameseNanaiNaskapiN-CreeNdebeleNdongaNepaliNewariNagari

Norway House CreeNisiNiueanNkoleN’koDutchNogaiNorwegianNorthern SamiNorthern TaiEsperantoNynorskOji-CreeOjibwayOriyaOromoOssetianPalestinian AramaicPaliPunjabiPalpaPashtoPolytonic GreekPilipinoPalaungPolishProvencalPortugueseChinRajasthaniR-CreeRussian BuriatRiangRhaeto-RomanicRomanianRomanyRusynRuandaRussianSadriSanskritSantaliSayisiSekotaSelkupSangoShanSibeSidamoSilte GurageSkolt SamiSlovakSlaveySlovenianSomaliSamoanSenaSindhiSinhaleseSoninkeSodo GurageSothoAlbanianSerbian

SaraikiSererSouth SlaveySouthern SamiSuriSvanSwedishSwadaya AramaicSwahiliSwaziSutuSyriacTabasaranTajikiTamilTatarTH-CreeTeluguTonganTigreTigrinyaThaiTahitianTibetanTurkmenTemneTswanaTundra NenetsTongaTodoTurkishTsongaTuroyo AramaicTuluTuvinTwiUdmurtUkrainianUrduUpper SorbianUyghurUzbekVendaVietnameseWaWagdiWest-CreeWelshWolofTai LueXhosaYakutYorubaY-CreeYi ClassicYi ModernChinese Hong KongChinese PhoneticChinese SimplifiedChinese TraditionalZandeZulu

Table 2: Defined Languages for OpenType fonts. Note that they are sorted in al-phabetical not by name but by OpenType tag (which you don’t need to know,now).

13

)*+,d*-./0 012d*3)*+,!*-./0 012!*3

\newfontfeature{AvoidD}{Special=Avoid d-collisions}\newfontfeature{NoAvoidD}{Special=!Avoid d-collisions}\fontspec[AvoidD,Variant=1]{Zapfino}sockdolager rubdown \par\fontspec[NoAvoidD,Variant=1]{Zapfino}sockdolager rubdown

Of course, you may perform similar operations with OpenType features, e.g.,\newfontfeature{OTSwash}{+swsh} to activate swash forms.

\newfeaturecode{〈tag〉}{〈feature number〉}{〈selector number〉} performs the\newfeaturecode

same function as the last macro, but instead of using a string, it takes two argu-ments to define the 〈feature number〉 and 〈selector number〉 of the feature. It worksonly for AAT fonts. There is no mechanism yet for the package to help informyou what codes are available for a specific font, sorry.

Gis is HeIeH by Jonathan Jew.\newfeaturecode{Swash}{17}{1}\fontspec[Swash]{Hoefler Text Italic}This is XeTeX by Jonathan Kew.

6 fontspec in the futureThis package is still under development, so there are some features I mean toinclude that haven’t yet made it. It also serves as my to-do list :)

1. If/when X ETEX allows it, I’d like to be able to automatically scale fonts tomatch their x-heights. At present this is not possible, however.

2. Support for fonts with a range of optical sizes.

3. I’d like to build in a mechanism in the package that can inform the userwhat font features are available for a requested font.

4. Far off into the future: can fonts with Greek letters be used for ad-hoc mathsfonts? (Probably not, but worth investigation.)

Change Historyv1.0

General: Initial version. 1v1.1

General: Name change to fontspec. 1\setromanfont: Implemented (with friends). 16

v1.2General: Initial OpenType support. 1

v1.3General: More OpenType support. 1\defaultfontfeatures: Implemented. 17\newfeaturecode: Implemented. 18\newfontfeature: Implemented. 18

v1.3aGeneral: Bug fix for OpenType small caps. 34

14

v1.4General: Support for Weight and Width AAT features. 25\AtBeginDocument: Selects the default \mathXX fonts. 37\defaultfontfeatures: Name changed from \setdefaultoptions. 17

v1.5General: New options for arbitrary bold/italic shapes. 24\addfontfeatures: Implemented. 17\ifEqFonts: Added check for empty font. 23\zf@fontspec: Added code for choosing arbitrary bold/italic fonts. 19

Checks if the font family has already been defined. 19NFSS specifiers now take the default values. 19

\zf@make@font@shapes: Absorbed font-checking from \zf@fontspec 20v1.5a

\AtBeginDocument: Added fix for Computer Modern maths. 37v1.6

General: Bold option aliased to BoldFont 24LetterCase is now Letters and options changed appropriately. 34All AAT Fractions features offered. 36Feature selection code uses more keyval. 24New OpenType feature: Language 25New OpenType feature: Script 25OpenType letters features: PetiteCaps and PETITECAPS. 34OpenType ligature features: Contextual and Historical. 34OpenType stylistic sets supports under the Variant option. 36

\addfontfeatures: Removed \relaxing of temporary macros. 17\AtBeginDocument: Removed mathtime support since XeTeX doesn’t

handle virtual fonts. Why did I put it in in the first place? 37\fontspec: Removed \zf@currfont (don’t think it’s necessary) 16\ifEqStr: Removed entirely from code. keyval \setkeys used instead. 23\newfontfeature: newff counter now uses LaTeX methods rather than

primitive TeX. I don’t know if there is any advantage to this. 18\newfontinstance: Implemented. 17\setromanfont: Changed \..default assigning to use \let 16\zf@fontspec: Added code for choosing arbitrary bold/italic font fea-

tures. 19Writes some info to the .log file 19

\zf@get@feature@requests: Removed the space between the commaand \zf@options when it’s concatenated with the defaults. This fixes thatbug in the big Apple Chancery example. 21

7 The codeHerein lies the implementation details of this package. Welcome! It’s my first.

For some reason, I decided to prefix all the package internal command namesand variables with zf. I don’t know why I chose those letters, but I guess I justliked the look/feel of the letters together at the time.

1 〈∗fontspec〉Only proceed if it is X ETEX that is doing the typesetting.

2 \expandafter\ifx\csname XeTeXversion\endcsname\relax3 \@latex@error{^^J4 *************************************************^^J

15

5 *** Sorry! ^^J6 *** The fontspec package only works with XeTeX. ^^J7 *************************************************^^J8 }9 \fi

While the business of encoding names is up in the air, I’ll continue to use the Uencoding.10 \def\zf@enc{U}11 %\RequirePackage[\zf@enc]{fontenc}12 \renewcommand\encodingdefault{\zf@enc}

The keyval package makes processing comma separated inputs very simple with\define@key

\setkeys the \define@key and \setkeys commands:

— \define@key{〈family〉}{〈option〉}{〈commands to process〉}— \setkeys{〈family〉}{〈input list〉}

\define@key is used to define each 〈option〉, grouped by 〈family〉, each of whichexecutes its 〈commands to process〉 when it is included in an 〈input list〉 in a call to\setkeys.13 \RequirePackage{keyval}

7.1 User commandsThis section contains the definitions of the commands detailed in the user docu-mentation. Only the ‘top level’ definitions of the commands are contained herein;they all use or define macros which are defined or used later on in Section 7.2 onpage 18.

7.1.1 Font selection

\fontspec This is the main command of the package that selects fonts with various features.It takes two arguments: the Mac OS X font name and the optional requested fea-tures of that font. It simply runs \zf@fontspec, which takes the same argumentsas the top level macro and puts the new-fangled font family name into the global\zf@family. Then this new font family is selected.14 \newcommand*\fontspec[2][]{%15 \zf@fontspec[#1]{#2}%16 \fontfamily\zf@family\selectfont}

\setromanfont

\setsansfont

\setmonofont

The following three macros perform equivalent operations setting the defaultfont (using \let rather than \renewcommand because \zf@family will change inthe future) for a particular family: roman, sans serif, or typewriter (monospaced).I end them with \normalfont so that if they’re used in the document, the changeregisters immediately.17 \newcommand*\setromanfont[2][]{%18 \zf@fontspec[#1]{#2}%19 \let\rmdefault\zf@family20 \normalfont}21 \newcommand*\setsansfont[2][]{%

16

22 \zf@fontspec[#1]{#2}%23 \let\sfdefault\zf@family24 \normalfont}25 \newcommand*\setmonofont[2][]{%26 \zf@fontspec[#1]{#2}%27 \let\ttdefault\zf@family28 \normalfont}

\newfontinstance This macro takes the arguments of \fontspec with a prepended 〈instancecmd〉 (code for middle optional argument generated by Scott Pakin’s newcom-mand.py). This command is used when a specific font instance needs to be referredto repetitively (e.g., in a section heading) since continuously calling \zf@fontspecis inefficient because it must parse the option arguments every time.

\zf@fontspec defines a font family and saves its name in \zf@family. Sothen this value is expanded in a temporary macro also containing the unexpandedcommands to later select the font family to which it refers. Finally, the requestedname for the font instance is \leted from the temporary macro.29 \newcommand\newfontinstance[1]{%30 \@ifnextchar[{\newfontinstance@i#1}{\newfontinstance@i#1[]}}31 \def\newfontinstance@i#1[#2]#3{%32 \zf@fontspec[#2]{#3}%33 \edef\zf@tempinst{\noexpand\fontfamily{\zf@family}\noexpand\selectfont}%34 \let#1\zf@tempinst}

7.1.2 Font feature selection

\defaultfontfeatures

\zf@default@options

This macro takes one argument that consists of all of feature options that willbe applied by default to all subsequent \fontspec, et al., commands. It stores itsvalue in \zf@default@options (initialised empty), which is concatenated withthe individual macro choices in the \zf@get@feature@requests macro.35 \newcommand*\defaultfontfeatures[1]{\def\zf@default@options{#1}}36 \let\zf@default@options\@empty

\addfontfeatures In order to be able to extend the feature selection of a given font, two things needto be known: the currently selected features, and the currently selected font. Everytime a font family is creating, this information is saved inside a control sequencewith the name of the font family itself.

This macro extracts this information, then appends the requested font featuresto add to the already existing ones, and calls the font again with the top level\fontspec command.

The default options are not applied (which is why they’re saved and restoredwith \zf@default@options@old), so this means that the only added features tothe font are strictly those specified by this command.

\addfontfeature is defined as an alias, as I found that I often typed this in-stead when adding only a single font feature.37 \newcommand*\addfontfeatures[1]{%38 \let\zf@default@options@old\zf@default@options39 \let\zf@default@options\@empty40 \edef\zf@thisinfo{\csname\f@family\endcsname}%41 \fontspec

17

42 [\expandafter\@firstoftwo\zf@thisinfo, #1]%43 {\expandafter\@secondoftwo\zf@thisinfo}%44 \let\zf@default@options\zf@default@options@old}45 \let\addfontfeature\addfontfeatures

7.1.3 Defining new font features

\newfontfeature \newfontfeature takes two arguments: the name of the feature tag by which toreference it, and the string that is used to select the font feature. It uses a counterto keep track of the number of new features introduced; every time a new featureis defined, a control sequence is defined made up of the concatenation of +zf-and the new feature tag. This long-winded control sequence is then called uponto update the font family string when a new instance is requested.46 \newcounter{newff}47 \newcommand*\newfontfeature[2]{%48 \stepcounter{newff}%49 \expandafter\edef\csname +zf-#1\endcsname{+zf-\thenewff}%50 \define@key{zf}{#1}[true]{%51 \zf@update@family{\csname +zf-#1\endcsname}%52 \zf@update@ff{#2}}}

\newfeaturecode This is similar to above, but simply defines a new AAT feature code (second twoarguments) with a new name (first argument). Maybe I should just give usersaccess to the \zf@make@feature command?53 \newcommand*\newfeaturecode[3]{%54 \define@key{zf}{#1}[true]{\zf@make@feature{#2}{#3}{}}}

7.2 Internal macros\zf@fontspec This is the command that defines font families for use. Given a list of font fea-

tures for a requested font (#1, which is later set in \zf@macname globally for the\zf@set@font@type and \zf@make@aat@feature@string macros), it will definean NFSS family for that font and put the family name into \zf@family.

Then we check with \zf@set@font@type whether the font is AAT or Open-Type, and convert the requested features to font definition strings. This is per-formed with \zf@get@feature@requests, in which \setkeys retrieves the re-quested font features and processes them. To build up the complex family name,it concatenates each font feature with the family name of the font. So since\setkeys is run more than once (since different font faces may have differentfeature names), we only want the complex family name to be built up once, hencethe zf@firsttime conditionals.55 \newcommand*\zf@fontspec[2][]{%56 \edef\zf@options{#1}%57 \edef\zf@macname{#2}%58 \edef\zf@family{\zap@space #2 \@empty}%59 \zf@set@font@type{#2}%60 \zf@firsttimetrue61 \zf@get@feature@requests62 \zf@firsttimefalse

18

Now that we have the complex family name, we can check to see if the family hasalready been defined, and if not, do so. Once the family name is created, save init the user string of the requested options and font name for use with \addfont-features (this info is separately braced for easy extraction with the \@first- and\@secondoftwo commands).63 \expandafter\ifx\csname\zf@family\endcsname\relax64 \wlog{fontspec: Defining font family for "#2"65 with options [\zf@current@options]}%66 \edef\zf@info{{\zf@current@options}{#2}}%67 \expandafter\let\csname\zf@family\endcsname\zf@info

Now the font family and its shapes are defined in the NFSS.All NFSS specifications take their default values, so if any of them are re-

defined, the shapes will be selected to fit in with the current state. For example, if\bfdefault is redefined to b, all bold shapes defined by this package will also beassigned to b.

The strings \zf@bf, et al., are used to store the name of the custom bold, et al.,font, if requested as user options. If they are empty, the default bold, et al., fontsare used.68 \DeclareFontFamily{\zf@enc}{\zf@family}{}%69 \zf@make@font@shapes{#2}{\mddefault}{\updefault}%70 % BOLD71 \let\zf@options@old\zf@options72 \def\zf@options{\zf@options@old,\zf@bf@options}%73 \ifx\zf@bf\@empty74 \zf@make@font@shapes[#2]{#2/B}{\bfdefault}{\updefault}%75 \else76 \zf@make@font@shapes{\zf@bf}{\bfdefault}{\updefault}%77 \fi78 \let\zf@options\zf@options@old79 % ITALIC80 \let\zf@options@old\zf@options81 \def\zf@options{\zf@options@old,\zf@it@options}%82 \ifx\zf@it\@empty83 \zf@make@font@shapes[#2]{#2/I}{\mddefault}{\itdefault}%84 \else85 \zf@make@font@shapes{\zf@it}{\mddefault}{\itdefault}%86 \fi87 \let\zf@options\zf@options@old

If requested, the custom fonts take precedence when choosing the bold italic font.When both italic and bold fonts are requested and the bold italic font hasn’t beenexplicitly specified (a rare occurance, presumably), the new bold font is used todefine the new bold italic font.88 \let\zf@options@old\zf@options89 \def\zf@options{\zf@options@old,\zf@bfit@options}%90 \ifx\zf@bfit\@empty91 \ifx\zf@bf\@empty92 \ifx\zf@it\@empty93 \zf@make@font@shapes[#2]{#2/BI}{\bfdefault}{\itdefault}%94 \else

19

95 \zf@make@font@shapes{\zf@it/B}{\bfdefault}{\itdefault}%96 \fi97 \else98 \zf@make@font@shapes{\zf@bf/I}{\bfdefault}{\itdefault}%99 \fi

100 \else101 \zf@make@font@shapes{\zf@bfit}{\bfdefault}{\itdefault}%102 \fi103 \let\zf@options\zf@options@old104 \fi}

7.2.1 Fonts

\zf@set@font@type This macro sets zf@aat or zf@opentype booleans accordingly depending if thefont in \zf@macname is an AAT font or an OpenType font, respectively.105 \newcommand*\zf@set@font@type[1]{%106 \zf@aatfalse107 \zf@opentypefalse108 \font\zf@testfont = "#1" at 10pt109 \count255 = \XeTeXcountfeatures\zf@testfont110 \ifnum\count255 > 0111 \zf@aattrue112 \zf@opentypefalse113 \else114 \count255 = \XeTeXOTcountscripts\zf@testfont115 \ifnum\count255 > 0116 \zf@opentypetrue117 \zf@aatfalse118 \fi119 \fi}120 \newif\ifzf@aat121 \newif\ifzf@opentype

\zf@make@font@shapes This macro uses \DeclareFontShape to define the font shape in question. It isnecessary to wrap the whole thing in \nfss@catcodes so that the scale factorworks. This necessitates \globaldefs=1 so the macro is visible to the rest of thepackage. The mandatory arguments are: the font name, the font series, and thefont shape. The optional argument checks against the font name and doesn’tproceed with the macro if they are equal.122 \begingroup123 \nfss@catcodes124 \globaldefs=1125 \newcommand*\zf@make@font@shapes[4][]{%126 \ifEqFonts{#1}{#2}\then\else127 \edef\zf@macname{#2}%128 \zf@get@feature@requests129 \ifx\zf@scale\@empty130 \let\zf@scale@str\@empty131 \else132 \edef\zf@scale@str{s*[\zf@scale]}%133 \fi

20

134 \DeclareFontShape{\zf@enc}{\zf@family}{#3}{#4}%135 {<-> \zf@scale@str "#2:\zf@ff"}{}%

Next, the small caps are defined. \zf@test@smallcaps is used to define the appro-priate string for activating small caps in the font, if they exist. If we are definingsmall caps for the upright shape, then the small caps shape default is used. Foran italic font, however, the shape parameter is overloaded and we must call italicsmall caps by their own identifier. See Section 7.4 on page 36 for the code thatenables this usage.136 \zf@test@smallcaps137 \ifx\zf@smallcaps\@empty\else138 \ifx #4\updefault139 \edef\zf@scshape{\scdefault}%140 \fi141 \ifx #4\itdefault142 \edef\zf@scshape{\sidefault}%143 \fi144 \DeclareFontShape145 {\zf@enc}{\zf@family}{#3}{\zf@scshape}%146 {<-> \zf@scale@str "#2:\zf@ff\zf@smallcaps"}{}%147 \fi148 \fi}149 \endgroup

\zf@update@family This macro is used to build up a complex family name based on its features. Itbasically concatenates the family name with a string of lower case letters whichuniquely denote its features.

\zf@firsttime is set true in \zf@fontspec only the first time \f@get@feature@requestsis called, so that the family name is only created once.150 \newcommand*{\zf@update@family}[1]{%151 \ifzf@firsttime152 \let\zf@family@old\zf@family153 \xdef\zf@family{\zf@family@old #1}%154 \fi}155 \newif\ifzf@firsttime

7.2.2 Features

\zf@get@feature@requests This macro is a wrapper for \setkeys which expands and adds a default specific-ation to the original passed options. It begins by initialising the commands usedto hold font-feature specific strings.156 \newcommand*\zf@get@feature@requests{%157 \ifzf@firsttime158 \let\zf@scale\@empty159 \let\zf@bf \@empty160 \let\zf@it \@empty161 \let\zf@bfit \@empty162 \let\zf@bf@options \@empty163 \let\zf@it@options \@empty164 \let\zf@bfit@options\@empty165 \fi

21

166 \let\zf@ff\@empty167 \ifx\zf@default@options\@empty168 \edef\zf@current@options{\zf@options}%169 \else170 \edef\zf@current@options{\zf@default@options,\zf@options}%171 \fi172 \edef\zf@process@options173 {\noexpand\setkeys{zf}{\zf@current@options}}%174 \zf@process@options}

\zf@test@smallcaps This macro checks if the font contains small caps, and if so creates the string foraccessing them in \zf@smallcaps. The OpenType portion of this macro has beenadapted/stolen from Jonathan Kew’s osxfonts.sty package.175 \newcommand*\zf@test@smallcaps{%176 \let\zf@smallcaps\@empty177 \ifzf@aat178 \zf@make@aat@feature@string{3}{3}{zf@smallcaps@string}%179 \ifx\zf@smallcaps@string\@empty\else180 \edef\zf@smallcaps{\zf@smallcaps@string;}%181 \fi182 \fi183 \ifzf@opentype184 \font\zf@testfont="\zf@macname" at 10pt185 \count255 = \XeTeXOTcountscripts\zf@testfont186 \ifnum\count255 > 0187 \count255 = 0188 \zf@featurecount = \XeTeXOTcountfeatures\zf@testfont "6C61746E "0189 \loop\ifnum\count255 < \zf@featurecount190 \ifnum\XeTeXOTfeaturetag\zf@testfont "6C61746E "0191 \count255 = "736D6370 % 'smcp'192 \edef\zf@smallcaps{+smcp,}%193 \count255 = \zf@featurecount194 \else195 \advance\count255 by 1196 \fi197 \repeat198 \fi199 \fi}200 \newcount\zf@featurecount

\zf@update@ff \zf@ff is the string used to define the list of specific font features. Each timeanother font feature is requested, this macro is used to add that feature to the list.AAT features are separated by semicolons, OpenType features by commas.201 \newcommand*{\zf@update@ff}[1]{%202 \begingroup203 \let\zf@ff@old\zf@ff204 \ifzf@aat205 \xdef\zf@ff{\zf@ff@old #1;}%206 \fi207 \ifzf@opentype208 \xdef\zf@ff{\zf@ff@old #1,}%209 \fi

22

210 \endgroup}

\zf@make@feature This macro is called by each feature key selected, and runs according to whichtype of font is selected. Note that it does not check to see if an OpenType featureexists.211 \newcommand*\zf@make@feature[3]{%212 \ifzf@aat213 \zf@make@aat@feature@string{#1}{#2}{zf@thisfontfeature}%214 \ifx\zf@thisfontfeature\@empty\else215 \zf@update@family{+#1,#2}%216 \zf@update@ff{\zf@thisfontfeature}%217 \fi218 \fi219 \ifzf@opentype220 \zf@update@family{#3}%221 \zf@update@ff{#3}%222 \fi}

\zf@make@aat@feature@string This macro takes the numerical codes for a font feature and creates a specifiedmacro containing the string required in the font definition to turn that feature onor off. Used primarily in \zf@make@aat@feature, but also used to check if smallcaps exists in the requested font.223 \newcommand*\zf@make@aat@feature@string[3]{%224 \font\zf@fontone="\zf@macname" at 10pt225 \edef\zf@this@featurename{\XeTeXfeaturename\zf@fontone #1}%226 \ifx\zf@this@featurename\@empty227 \expandafter\edef\csname #3\endcsname{\@empty}%228 \else229 \edef\zf@this@selectionname{\XeTeXselectorname\zf@fontone #1 #2}%230 \ifx\zf@this@selectionname\@empty231 \expandafter\edef\csname #3\endcsname{\@empty}%232 \else233 \expandafter\edef\csname #3\endcsname234 {\ifnum\XeTeXisexclusivefeature\zf@fontone #1 > 0235 \zf@this@featurename=\zf@this@selectionname%236 \else237 \ifodd #2238 \zf@this@featurename=!\zf@this@selectionname%239 \else240 \zf@this@featurename=\zf@this@selectionname%241 \fi242 \fi}%243 \fi244 \fi}

\ifEqStr \ifEqStr was a conditional for checking it two strings are the same. It no longerexists.

\ifEqFonts A conditional for checking if two fonts are the same. If one of the arguments isempty, special provision needs to be taken, since there is no font with an emptystring for a name. This case arises when \zf@make@font@shapes doesn’t take itsoptional argument.

23

245 \let\then\iftrue246 \def\ifEqFonts#1#2\then{%247 \edef\@tempa{#1}%248 \ifx\@tempa\@empty249 \let\@tempa\@empty250 \else251 \font\zf@fontone = "#1" at 10pt252 \edef\@tempa{\fontname\zf@fontone}%253 \fi254 \font\zf@fonttwo = "#2" at 10pt255 \edef\@tempb{\fontname\zf@fonttwo}%256 \ifx\@tempa\@tempb}

7.3 keyval definitionsThis is the tedious section where we correlate all possible (eventually) font featurerequests with their X ETEX representations.

7.3.1 Bold/italic choosing options

The Bold, Italic, and BoldItalic features are for defining explicitly the boldand italic fonts used in a font family. v1.6 introduced arbitrary font features forthese shapes (BoldFeatures, etc.), so the names of the shape-selecting optionswere appended with Font for consistency.257 \define@key{zf}{Bold}{\edef\zf@bf{#1}%258 \zf@update@family{bf:\zap@space #1 \@empty}}259 \define@key{zf}{Italic}{\edef\zf@it{#1}%260 \zf@update@family{it:\zap@space #1 \@empty}}261 \define@key{zf}{BoldItalic}{\edef\zf@bfit{#1}%262 \zf@update@family{bfit:\zap@space #1 \@empty}}263264 \define@key{zf}{BoldFont}{\edef\zf@bf{#1}%265 \zf@update@family{bf:\zap@space #1 \@empty}}266 \define@key{zf}{ItalicFont}{\edef\zf@it{#1}%267 \zf@update@family{it:\zap@space #1 \@empty}}268 \define@key{zf}{BoldItalicFont}{\edef\zf@bfit{#1}%269 \zf@update@family{bfit:\zap@space #1 \@empty}}270271 \define@key{zf}{BoldFeatures}{\def\zf@bf@options{#1}}272 \define@key{zf}{ItalicFeatures}{\def\zf@it@options{#1}}273 \define@key{zf}{BoldItalicFeatures}{\def\zf@bfit@options{#1}}

7.3.2 Font-independent options

These options can be applied to any font. Both spellings (American and correct)of ‘colour’ offered.274 \define@key{zf}{Scale}{%275 \zf@update@family{+scale:#1}%276 \edef\zf@scale{#1}}277 \define@key{zf}{Colour}{%278 \zf@update@family{+col:#1}%279 \zf@update@ff{color=#1}}

24

280 \define@key{zf}{Color}{%281 \zf@update@family{+col:#1}%282 \zf@update@ff{color=#1}}283 \define@key{zf}{Mapping}{%284 \zf@update@family{+map:#1}%285 \zf@update@ff{mapping=#1}}

7.3.3 AAT-exclusive features286 \define@key{zf}{Weight}{%287 \ifzf@aat288 \zf@update@family{+weight:#1}%289 \zf@update@ff{weight=#1}%290 \fi}291 \define@key{zf}{Width}{%292 \ifzf@aat293 \zf@update@family{+width:#1}%294 \zf@update@ff{width=#1}%295 \fi}

7.3.4 OpenType-exclusive features296 \define@key{zf}{Script}{\ifzf@opentype\bgroup\setkeys{zf@scpt}{#1}\egroup\fi}297 \newcommand*\zf@make@scpt@feature[2]{%298 \define@key{zf@scpt}{#1}[true]{%299 \zf@update@family{+scpt:#2}%300 \zf@update@ff{script=#2}}}301 \zf@make@scpt@feature{Arabic}{arab}302 \zf@make@scpt@feature{Armenian}{armn}303 \zf@make@scpt@feature{Balinese}{bali}304 \zf@make@scpt@feature{Bengali}{beng}305 \zf@make@scpt@feature{Bopomofo}{bopo}306 \zf@make@scpt@feature{Braille}{brai}307 \zf@make@scpt@feature{Buginese}{bugi}308 \zf@make@scpt@feature{Buhid}{buhd}309 \zf@make@scpt@feature{Byzantine Music}{byzm}310 \zf@make@scpt@feature{Canadian Syllabics}{cans}311 \zf@make@scpt@feature{Cherokee}{cher}312 \zf@make@scpt@feature{CJK Ideographic}{hani}313 \zf@make@scpt@feature{Coptic}{copt}314 \zf@make@scpt@feature{Cypriot Syllabary}{cprt}315 \zf@make@scpt@feature{Cyrillic}{cyrl}316 \zf@make@scpt@feature{Default}{DFLT}317 \zf@make@scpt@feature{Deseret}{dsrt}318 \zf@make@scpt@feature{Devanagari}{deva}319 \zf@make@scpt@feature{Ethiopic}{ethi}320 \zf@make@scpt@feature{Georgian}{geor}321 \zf@make@scpt@feature{Glagolitic}{glag}322 \zf@make@scpt@feature{Gothic}{goth}323 \zf@make@scpt@feature{Greek}{grek}324 \zf@make@scpt@feature{Gujarati}{gujr}325 \zf@make@scpt@feature{Gurmukhi}{guru}326 \zf@make@scpt@feature{Hangul Jamo}{jamo}327 \zf@make@scpt@feature{Hangul}{hang}

25

328 \zf@make@scpt@feature{Hanunoo}{hano}329 \zf@make@scpt@feature{Hebrew}{hebr}330 \zf@make@scpt@feature{Hiragana}{kana}331 \zf@make@scpt@feature{Katakana}{kana}332 \zf@make@scpt@feature{Japanese}{kana}333 \zf@make@scpt@feature{Javanese}{java}334 \zf@make@scpt@feature{Kannada}{knda}335 \zf@make@scpt@feature{Kharosthi}{khar}336 \zf@make@scpt@feature{Khmer}{khmr}337 \zf@make@scpt@feature{Lao}{lao }338 \zf@make@scpt@feature{Latin}{latn}339 \zf@make@scpt@feature{Limbu}{limb}340 \zf@make@scpt@feature{Linear B}{linb}341 \zf@make@scpt@feature{Malayalam}{mlym}342 \zf@make@scpt@feature{Math}{math}343 \zf@make@scpt@feature{Maths}{math}344 \zf@make@scpt@feature{Mongolian}{mong}345 \zf@make@scpt@feature{Musical Symbols}{musc}346 \zf@make@scpt@feature{Myanmar}{mymr}347 \zf@make@scpt@feature{N'ko}{nko }348 \zf@make@scpt@feature{Ogham}{ogam}349 \zf@make@scpt@feature{Old Italic}{ital}350 \zf@make@scpt@feature{Old Persian Cuneiform}{xpeo}351 \zf@make@scpt@feature{Oriya}{orya}352 \zf@make@scpt@feature{Osmanya}{osma}353 \zf@make@scpt@feature{Phags-pa}{phag}354 \zf@make@scpt@feature{Phoenician}{phnx}355 \zf@make@scpt@feature{Runic}{runr}356 \zf@make@scpt@feature{Shavian}{shaw}357 \zf@make@scpt@feature{Sinhala}{sinh}358 \zf@make@scpt@feature{Sumero-Akkadian Cuneiform}{xsux}359 \zf@make@scpt@feature{Syloti Nagri}{sylo}360 \zf@make@scpt@feature{Syriac}{syrc}361 \zf@make@scpt@feature{Tagalog}{tglg}362 \zf@make@scpt@feature{Tagbanwa}{tagb}363 \zf@make@scpt@feature{Tai Le}{tale}364 \zf@make@scpt@feature{Tai Lu}{talu}365 \zf@make@scpt@feature{Tamil}{taml}366 \zf@make@scpt@feature{Telugu}{telu}367 \zf@make@scpt@feature{Thaana}{thaa}368 \zf@make@scpt@feature{Thai}{thai}369 \zf@make@scpt@feature{Tibetan}{tibt}370 \zf@make@scpt@feature{Tifinagh}{tfng}371 \zf@make@scpt@feature{Ugaritic Cuneiform}{ugar}372 \zf@make@scpt@feature{Yi}{yi }373374 \define@key{zf}{Language}{\ifzf@opentype\bgroup\setkeys{zf@lang}{#1}\egroup\fi}375 \newcommand*\zf@make@lang@feature[2]{%376 \define@key{zf@lang}{#1}[true]{%377 \zf@update@family{+lang:#2}%378 \zf@update@ff{language=#2}}}379 \zf@make@lang@feature{Abaza}{ABA}

26

380 \zf@make@lang@feature{Abkhazian}{ABK}381 \zf@make@lang@feature{Adyghe}{ADY}382 \zf@make@lang@feature{Afrikaans}{AFK}383 \zf@make@lang@feature{Afar}{AFR}384 \zf@make@lang@feature{Agaw}{AGW}385 \zf@make@lang@feature{Altai}{ALT}386 \zf@make@lang@feature{Amharic}{AMH}387 \zf@make@lang@feature{Arabic}{ARA}388 \zf@make@lang@feature{Aari}{ARI}389 \zf@make@lang@feature{Arakanese}{ARK}390 \zf@make@lang@feature{Assamese}{ASM}391 \zf@make@lang@feature{Athapaskan}{ATH}392 \zf@make@lang@feature{Avar}{AVR}393 \zf@make@lang@feature{Awadhi}{AWA}394 \zf@make@lang@feature{Aymara}{AYM}395 \zf@make@lang@feature{Azeri}{AZE}396 \zf@make@lang@feature{Badaga}{BAD}397 \zf@make@lang@feature{Baghelkhandi}{BAG}398 \zf@make@lang@feature{Balkar}{BAL}399 \zf@make@lang@feature{Baule}{BAU}400 \zf@make@lang@feature{Berber}{BBR}401 \zf@make@lang@feature{Bench}{BCH}402 \zf@make@lang@feature{Bible Cree}{BCR}403 \zf@make@lang@feature{Belarussian}{BEL}404 \zf@make@lang@feature{Bemba}{BEM}405 \zf@make@lang@feature{Bengali}{BEN}406 \zf@make@lang@feature{Bulgarian}{BGR}407 \zf@make@lang@feature{Bhili}{BHI}408 \zf@make@lang@feature{Bhojpuri}{BHO}409 \zf@make@lang@feature{Bikol}{BIK}410 \zf@make@lang@feature{Bilen}{BIL}411 \zf@make@lang@feature{Blackfoot}{BKF}412 \zf@make@lang@feature{Balochi}{BLI}413 \zf@make@lang@feature{Balante}{BLN}414 \zf@make@lang@feature{Balti}{BLT}415 \zf@make@lang@feature{Bambara}{BMB}416 \zf@make@lang@feature{Bamileke}{BML}417 \zf@make@lang@feature{Breton}{BRE}418 \zf@make@lang@feature{Brahui}{BRH}419 \zf@make@lang@feature{Braj Bhasha}{BRI}420 \zf@make@lang@feature{Burmese}{BRM}421 \zf@make@lang@feature{Bashkir}{BSH}422 \zf@make@lang@feature{Beti}{BTI}423 \zf@make@lang@feature{Catalan}{CAT}424 \zf@make@lang@feature{Cebuano}{CEB}425 \zf@make@lang@feature{Chechen}{CHE}426 \zf@make@lang@feature{Chaha Gurage}{CHG}427 \zf@make@lang@feature{Chattisgarhi}{CHH}428 \zf@make@lang@feature{Chichewa}{CHI}429 \zf@make@lang@feature{Chukchi}{CHK}430 \zf@make@lang@feature{Chipewyan}{CHP}431 \zf@make@lang@feature{Cherokee}{CHR}

27

432 \zf@make@lang@feature{Chuvash}{CHU}433 \zf@make@lang@feature{Comorian}{CMR}434 \zf@make@lang@feature{Coptic}{COP}435 \zf@make@lang@feature{Cree}{CRE}436 \zf@make@lang@feature{Carrier}{CRR}437 \zf@make@lang@feature{Crimean Tatar}{CRT}438 \zf@make@lang@feature{Church Slavonic}{CSL}439 \zf@make@lang@feature{Czech}{CSY}440 \zf@make@lang@feature{Danish}{DAN}441 \zf@make@lang@feature{Dargwa}{DAR}442 \zf@make@lang@feature{Woods Cree}{DCR}443 \zf@make@lang@feature{German}{DEU}444 \zf@make@lang@feature{Default}{DFLT}445 \zf@make@lang@feature{Dogri}{DGR}446 \zf@make@lang@feature{Divehi}{DIV}447 \zf@make@lang@feature{Djerma}{DJR}448 \zf@make@lang@feature{Dangme}{DNG}449 \zf@make@lang@feature{Dinka}{DNK}450 \zf@make@lang@feature{Dungan}{DUN}451 \zf@make@lang@feature{Dzongkha}{DZN}452 \zf@make@lang@feature{Ebira}{EBI}453 \zf@make@lang@feature{Eastern Cree}{ECR}454 \zf@make@lang@feature{Edo}{EDO}455 \zf@make@lang@feature{Efik}{EFI}456 \zf@make@lang@feature{Greek}{ELL}457 \zf@make@lang@feature{English}{ENG}458 \zf@make@lang@feature{Erzya}{ERZ}459 \zf@make@lang@feature{Spanish}{ESP}460 \zf@make@lang@feature{Estonian}{ETI}461 \zf@make@lang@feature{Basque}{EUQ}462 \zf@make@lang@feature{Evenki}{EVK}463 \zf@make@lang@feature{Even}{EVN}464 \zf@make@lang@feature{Ewe}{EWE}465 \zf@make@lang@feature{French Antillean}{FAN}466 \zf@make@lang@feature{Farsi}{FAR}467 \zf@make@lang@feature{Finnish}{FIN}468 \zf@make@lang@feature{Fijian}{FJI}469 \zf@make@lang@feature{Flemish}{FLE}470 \zf@make@lang@feature{Forest Nenets}{FNE}471 \zf@make@lang@feature{Fon}{FON}472 \zf@make@lang@feature{Faroese}{FOS}473 \zf@make@lang@feature{French}{FRA}474 \zf@make@lang@feature{Frisian}{FRI}475 \zf@make@lang@feature{Friulian}{FRL}476 \zf@make@lang@feature{Futa}{FTA}477 \zf@make@lang@feature{Fulani}{FUL}478 \zf@make@lang@feature{Ga}{GAD}479 \zf@make@lang@feature{Gaelic}{GAE}480 \zf@make@lang@feature{Gagauz}{GAG}481 \zf@make@lang@feature{Galician}{GAL}482 \zf@make@lang@feature{Garshuni}{GAR}483 \zf@make@lang@feature{Garhwali}{GAW}

28

484 \zf@make@lang@feature{Ge'ez}{GEZ}485 \zf@make@lang@feature{Gilyak}{GIL}486 \zf@make@lang@feature{Gumuz}{GMZ}487 \zf@make@lang@feature{Gondi}{GON}488 \zf@make@lang@feature{Greenlandic}{GRN}489 \zf@make@lang@feature{Garo}{GRO}490 \zf@make@lang@feature{Guarani}{GUA}491 \zf@make@lang@feature{Gujarati}{GUJ}492 \zf@make@lang@feature{Haitian}{HAI}493 \zf@make@lang@feature{Halam}{HAL}494 \zf@make@lang@feature{Harauti}{HAR}495 \zf@make@lang@feature{Hausa}{HAU}496 \zf@make@lang@feature{Hawaiin}{HAW}497 \zf@make@lang@feature{Hammer-Banna}{HBN}498 \zf@make@lang@feature{Hiligaynon}{HIL}499 \zf@make@lang@feature{Hindi}{HIN}500 \zf@make@lang@feature{High Mari}{HMA}501 \zf@make@lang@feature{Hindko}{HND}502 \zf@make@lang@feature{Ho}{HO}503 \zf@make@lang@feature{Harari}{HRI}504 \zf@make@lang@feature{Croatian}{HRV}505 \zf@make@lang@feature{Hungarian}{HUN}506 \zf@make@lang@feature{Armenian}{HYE}507 \zf@make@lang@feature{Igbo}{IBO}508 \zf@make@lang@feature{Ijo}{IJO}509 \zf@make@lang@feature{Ilokano}{ILO}510 \zf@make@lang@feature{Indonesian}{IND}511 \zf@make@lang@feature{Ingush}{ING}512 \zf@make@lang@feature{Inuktitut}{INU}513 \zf@make@lang@feature{Irish}{IRI}514 \zf@make@lang@feature{Irish Traditional}{IRT}515 \zf@make@lang@feature{Icelandic}{ISL}516 \zf@make@lang@feature{Inari Sami}{ISM}517 \zf@make@lang@feature{Italian}{ITA}518 \zf@make@lang@feature{Hebrew}{IWR}519 \zf@make@lang@feature{Javanese}{JAV}520 \zf@make@lang@feature{Yiddish}{JII}521 \zf@make@lang@feature{Japanese}{JAN}522 \zf@make@lang@feature{Judezmo}{JUD}523 \zf@make@lang@feature{Jula}{JUL}524 \zf@make@lang@feature{Kabardian}{KAB}525 \zf@make@lang@feature{Kachchi}{KAC}526 \zf@make@lang@feature{Kalenjin}{KAL}527 \zf@make@lang@feature{Kannada}{KAN}528 \zf@make@lang@feature{Karachay}{KAR}529 \zf@make@lang@feature{Georgian}{KAT}530 \zf@make@lang@feature{Kazakh}{KAZ}531 \zf@make@lang@feature{Kebena}{KEB}532 \zf@make@lang@feature{Khutsuri Georgian}{KGE}533 \zf@make@lang@feature{Khakass}{KHA}534 \zf@make@lang@feature{Khanty-Kazim}{KHK}535 \zf@make@lang@feature{Khmer}{KHM}

29

536 \zf@make@lang@feature{Khanty-Shurishkar}{KHS}537 \zf@make@lang@feature{Khanty-Vakhi}{KHV}538 \zf@make@lang@feature{Khowar}{KHW}539 \zf@make@lang@feature{Kikuyu}{KIK}540 \zf@make@lang@feature{Kirghiz}{KIR}541 \zf@make@lang@feature{Kisii}{KIS}542 \zf@make@lang@feature{Kokni}{KKN}543 \zf@make@lang@feature{Kalmyk}{KLM}544 \zf@make@lang@feature{Kamba}{KMB}545 \zf@make@lang@feature{Kumaoni}{KMN}546 \zf@make@lang@feature{Komo}{KMO}547 \zf@make@lang@feature{Komso}{KMS}548 \zf@make@lang@feature{Kanuri}{KNR}549 \zf@make@lang@feature{Kodagu}{KOD}550 \zf@make@lang@feature{Korean Old Hangul}{KOH}551 \zf@make@lang@feature{Konkani}{KOK}552 \zf@make@lang@feature{Kikongo}{KON}553 \zf@make@lang@feature{Komi-Permyak}{KOP}554 \zf@make@lang@feature{Korean}{KOR}555 \zf@make@lang@feature{Komi-Zyrian}{KOZ}556 \zf@make@lang@feature{Kpelle}{KPL}557 \zf@make@lang@feature{Krio}{KRI}558 \zf@make@lang@feature{Karakalpak}{KRK}559 \zf@make@lang@feature{Karelian}{KRL}560 \zf@make@lang@feature{Karaim}{KRM}561 \zf@make@lang@feature{Karen}{KRN}562 \zf@make@lang@feature{Koorete}{KRT}563 \zf@make@lang@feature{Kashmiri}{KSH}564 \zf@make@lang@feature{Khasi}{KSI}565 \zf@make@lang@feature{Kildin Sami}{KSM}566 \zf@make@lang@feature{Kui}{KUI}567 \zf@make@lang@feature{Kulvi}{KUL}568 \zf@make@lang@feature{Kumyk}{KUM}569 \zf@make@lang@feature{Kurdish}{KUR}570 \zf@make@lang@feature{Kurukh}{KUU}571 \zf@make@lang@feature{Kuy}{KUY}572 \zf@make@lang@feature{Koryak}{KYK}573 \zf@make@lang@feature{Ladin}{LAD}574 \zf@make@lang@feature{Lahuli}{LAH}575 \zf@make@lang@feature{Lak}{LAK}576 \zf@make@lang@feature{Lambani}{LAM}577 \zf@make@lang@feature{Lao}{LAO}578 \zf@make@lang@feature{Latin}{LAT}579 \zf@make@lang@feature{Laz}{LAZ}580 \zf@make@lang@feature{L-Cree}{LCR}581 \zf@make@lang@feature{Ladakhi}{LDK}582 \zf@make@lang@feature{Lezgi}{LEZ}583 \zf@make@lang@feature{Lingala}{LIN}584 \zf@make@lang@feature{Low Mari}{LMA}585 \zf@make@lang@feature{Limbu}{LMB}586 \zf@make@lang@feature{Lomwe}{LMW}587 \zf@make@lang@feature{Lower Sorbian}{LSB}

30

588 \zf@make@lang@feature{Lule Sami}{LSM}589 \zf@make@lang@feature{Lithuanian}{LTH}590 \zf@make@lang@feature{Luba}{LUB}591 \zf@make@lang@feature{Luganda}{LUG}592 \zf@make@lang@feature{Luhya}{LUH}593 \zf@make@lang@feature{Luo}{LUO}594 \zf@make@lang@feature{Latvian}{LVI}595 \zf@make@lang@feature{Majang}{MAJ}596 \zf@make@lang@feature{Makua}{MAK}597 \zf@make@lang@feature{Malayalam Traditional}{MAL}598 \zf@make@lang@feature{Mansi}{MAN}599 \zf@make@lang@feature{Marathi}{MAR}600 \zf@make@lang@feature{Marwari}{MAW}601 \zf@make@lang@feature{Mbundu}{MBN}602 \zf@make@lang@feature{Manchu}{MCH}603 \zf@make@lang@feature{Moose Cree}{MCR}604 \zf@make@lang@feature{Mende}{MDE}605 \zf@make@lang@feature{Me'en}{MEN}606 \zf@make@lang@feature{Mizo}{MIZ}607 \zf@make@lang@feature{Macedonian}{MKD}608 \zf@make@lang@feature{Male}{MLE}609 \zf@make@lang@feature{Malagasy}{MLG}610 \zf@make@lang@feature{Malinke}{MLN}611 \zf@make@lang@feature{Malayalam Reformed}{MLR}612 \zf@make@lang@feature{Malay}{MLY}613 \zf@make@lang@feature{Mandinka}{MND}614 \zf@make@lang@feature{Mongolian}{MNG}615 \zf@make@lang@feature{Manipuri}{MNI}616 \zf@make@lang@feature{Maninka}{MNK}617 \zf@make@lang@feature{Manx Gaelic}{MNX}618 \zf@make@lang@feature{Moksha}{MOK}619 \zf@make@lang@feature{Moldavian}{MOL}620 \zf@make@lang@feature{Mon}{MON}621 \zf@make@lang@feature{Moroccan}{MOR}622 \zf@make@lang@feature{Maori}{MRI}623 \zf@make@lang@feature{Maithili}{MTH}624 \zf@make@lang@feature{Maltese}{MTS}625 \zf@make@lang@feature{Mundari}{MUN}626 \zf@make@lang@feature{Naga-Assamese}{NAG}627 \zf@make@lang@feature{Nanai}{NAN}628 \zf@make@lang@feature{Naskapi}{NAS}629 \zf@make@lang@feature{N-Cree}{NCR}630 \zf@make@lang@feature{Ndebele}{NDB}631 \zf@make@lang@feature{Ndonga}{NDG}632 \zf@make@lang@feature{Nepali}{NEP}633 \zf@make@lang@feature{Newari}{NEW}634 \zf@make@lang@feature{Nagari}{NGR}635 \zf@make@lang@feature{Norway House Cree}{NHC}636 \zf@make@lang@feature{Nisi}{NIS}637 \zf@make@lang@feature{Niuean}{NIU}638 \zf@make@lang@feature{Nkole}{NKL}639 \zf@make@lang@feature{N'ko}{NKO}

31

640 \zf@make@lang@feature{Dutch}{NLD}641 \zf@make@lang@feature{Nogai}{NOG}642 \zf@make@lang@feature{Norwegian}{NOR}643 \zf@make@lang@feature{Northern Sami}{NSM}644 \zf@make@lang@feature{Northern Tai}{NTA}645 \zf@make@lang@feature{Esperanto}{NTO}646 \zf@make@lang@feature{Nynorsk}{NYN}647 \zf@make@lang@feature{Oji-Cree}{OCR}648 \zf@make@lang@feature{Ojibway}{OJB}649 \zf@make@lang@feature{Oriya}{ORI}650 \zf@make@lang@feature{Oromo}{ORO}651 \zf@make@lang@feature{Ossetian}{OSS}652 \zf@make@lang@feature{Palestinian Aramaic}{PAA}653 \zf@make@lang@feature{Pali}{PAL}654 \zf@make@lang@feature{Punjabi}{PAN}655 \zf@make@lang@feature{Palpa}{PAP}656 \zf@make@lang@feature{Pashto}{PAS}657 \zf@make@lang@feature{Polytonic Greek}{PGR}658 \zf@make@lang@feature{Pilipino}{PIL}659 \zf@make@lang@feature{Palaung}{PLG}660 \zf@make@lang@feature{Polish}{PLK}661 \zf@make@lang@feature{Provencal}{PRO}662 \zf@make@lang@feature{Portuguese}{PTG}663 \zf@make@lang@feature{Chin}{QIN}664 \zf@make@lang@feature{Rajasthani}{RAJ}665 \zf@make@lang@feature{R-Cree}{RCR}666 \zf@make@lang@feature{Russian Buriat}{RBU}667 \zf@make@lang@feature{Riang}{RIA}668 \zf@make@lang@feature{Rhaeto-Romanic}{RMS}669 \zf@make@lang@feature{Romanian}{ROM}670 \zf@make@lang@feature{Romany}{ROY}671 \zf@make@lang@feature{Rusyn}{RSY}672 \zf@make@lang@feature{Ruanda}{RUA}673 \zf@make@lang@feature{Russian}{RUS}674 \zf@make@lang@feature{Sadri}{SAD}675 \zf@make@lang@feature{Sanskrit}{SAN}676 \zf@make@lang@feature{Santali}{SAT}677 \zf@make@lang@feature{Sayisi}{SAY}678 \zf@make@lang@feature{Sekota}{SEK}679 \zf@make@lang@feature{Selkup}{SEL}680 \zf@make@lang@feature{Sango}{SGO}681 \zf@make@lang@feature{Shan}{SHN}682 \zf@make@lang@feature{Sibe}{SIB}683 \zf@make@lang@feature{Sidamo}{SID}684 \zf@make@lang@feature{Silte Gurage}{SIG}685 \zf@make@lang@feature{Skolt Sami}{SKS}686 \zf@make@lang@feature{Slovak}{SKY}687 \zf@make@lang@feature{Slavey}{SLA}688 \zf@make@lang@feature{Slovenian}{SLV}689 \zf@make@lang@feature{Somali}{SML}690 \zf@make@lang@feature{Samoan}{SMO}691 \zf@make@lang@feature{Sena}{SNA}

32

692 \zf@make@lang@feature{Sindhi}{SND}693 \zf@make@lang@feature{Sinhalese}{SNH}694 \zf@make@lang@feature{Soninke}{SNK}695 \zf@make@lang@feature{Sodo Gurage}{SOG}696 \zf@make@lang@feature{Sotho}{SOT}697 \zf@make@lang@feature{Albanian}{SQI}698 \zf@make@lang@feature{Serbian}{SRB}699 \zf@make@lang@feature{Saraiki}{SRK}700 \zf@make@lang@feature{Serer}{SRR}701 \zf@make@lang@feature{South Slavey}{SSL}702 \zf@make@lang@feature{Southern Sami}{SSM}703 \zf@make@lang@feature{Suri}{SUR}704 \zf@make@lang@feature{Svan}{SVA}705 \zf@make@lang@feature{Swedish}{SVE}706 \zf@make@lang@feature{Swadaya Aramaic}{SWA}707 \zf@make@lang@feature{Swahili}{SWK}708 \zf@make@lang@feature{Swazi}{SWZ}709 \zf@make@lang@feature{Sutu}{SXT}710 \zf@make@lang@feature{Syriac}{SYR}711 \zf@make@lang@feature{Tabasaran}{TAB}712 \zf@make@lang@feature{Tajiki}{TAJ}713 \zf@make@lang@feature{Tamil}{TAM}714 \zf@make@lang@feature{Tatar}{TAT}715 \zf@make@lang@feature{TH-Cree}{TCR}716 \zf@make@lang@feature{Telugu}{TEL}717 \zf@make@lang@feature{Tongan}{TGN}718 \zf@make@lang@feature{Tigre}{TGR}719 \zf@make@lang@feature{Tigrinya}{TGY}720 \zf@make@lang@feature{Thai}{THA}721 \zf@make@lang@feature{Tahitian}{THT}722 \zf@make@lang@feature{Tibetan}{TIB}723 \zf@make@lang@feature{Turkmen}{TKM}724 \zf@make@lang@feature{Temne}{TMN}725 \zf@make@lang@feature{Tswana}{TNA}726 \zf@make@lang@feature{Tundra Nenets}{TNE}727 \zf@make@lang@feature{Tonga}{TNG}728 \zf@make@lang@feature{Todo}{TOD}729 \zf@make@lang@feature{Turkish}{TRK}730 \zf@make@lang@feature{Tsonga}{TSG}731 \zf@make@lang@feature{Turoyo Aramaic}{TUA}732 \zf@make@lang@feature{Tulu}{TUL}733 \zf@make@lang@feature{Tuvin}{TUV}734 \zf@make@lang@feature{Twi}{TWI}735 \zf@make@lang@feature{Udmurt}{UDM}736 \zf@make@lang@feature{Ukrainian}{UKR}737 \zf@make@lang@feature{Urdu}{URD}738 \zf@make@lang@feature{Upper Sorbian}{USB}739 \zf@make@lang@feature{Uyghur}{UYG}740 \zf@make@lang@feature{Uzbek}{UZB}741 \zf@make@lang@feature{Venda}{VEN}742 \zf@make@lang@feature{Vietnamese}{VIT}743 \zf@make@lang@feature{Wa}{WA}

33

744 \zf@make@lang@feature{Wagdi}{WAG}745 \zf@make@lang@feature{West-Cree}{WCR}746 \zf@make@lang@feature{Welsh}{WEL}747 \zf@make@lang@feature{Wolof}{WLF}748 \zf@make@lang@feature{Tai Lue}{XBD}749 \zf@make@lang@feature{Xhosa}{XHS}750 \zf@make@lang@feature{Yakut}{YAK}751 \zf@make@lang@feature{Yoruba}{YBA}752 \zf@make@lang@feature{Y-Cree}{YCR}753 \zf@make@lang@feature{Yi Classic}{YIC}754 \zf@make@lang@feature{Yi Modern}{YIM}755 \zf@make@lang@feature{Chinese Hong Kong}{ZHH}756 \zf@make@lang@feature{Chinese Phonetic}{ZHP}757 \zf@make@lang@feature{Chinese Simplified}{ZHS}758 \zf@make@lang@feature{Chinese Traditional}{ZHT}759 \zf@make@lang@feature{Zande}{ZND}760 \zf@make@lang@feature{Zulu}{ZUL}

7.3.5 Ligatures

The call to the nested keyval family must be wrapped in braces to hide the parentlist (this later requires the use of global definitions (\xdef) in \zf@update@...).Both AAT and OpenType names are offered to chose Rare/Discretionary ligat-ures.761 \define@key{zf}{Ligatures}{\bgroup\setkeys{zf@lig}{#1}\egroup}762 \define@key{zf@lig}{Required} [true]{\zf@make@feature{1}{0}{+rlig}}763 \define@key{zf@lig}{NoRequired} [true]{\zf@make@feature{1}{1}{-rlig}}764 \define@key{zf@lig}{Common} [true]{\zf@make@feature{1}{2}{+liga}}765 \define@key{zf@lig}{NoCommon} [true]{\zf@make@feature{1}{3}{-liga}}766 \define@key{zf@lig}{Rare} [true]{\zf@make@feature{1}{4}{+dlig}}767 \define@key{zf@lig}{NoRare} [true]{\zf@make@feature{1}{5}{-dlig}}768 \define@key{zf@lig}{Discretionary} [true]{\zf@make@feature{1}{4}{+dlig}}769 \define@key{zf@lig}{NoDiscretionary}[true]{\zf@make@feature{1}{5}{-dlig}}770 \define@key{zf@lig}{Contextual} [true]{\zf@make@feature{}{}{+clig}}771 \define@key{zf@lig}{NoContextual} [true]{\zf@make@feature{}{}{-clig}}772 \define@key{zf@lig}{Historical} [true]{\zf@make@feature{}{}{+hlig}}773 \define@key{zf@lig}{NoHistorical} [true]{\zf@make@feature{}{}{-hlig}}774 \define@key{zf@lig}{Logos} [true]{\zf@make@feature{1}{6}{}}775 \define@key{zf@lig}{NoLogos} [true]{\zf@make@feature{1}{7}{}}776 \define@key{zf@lig}{Rebus} [true]{\zf@make@feature{1}{8}{}}777 \define@key{zf@lig}{NoRebus} [true]{\zf@make@feature{1}{9}{}}778 \define@key{zf@lig}{Diphthong} [true]{\zf@make@feature{1}{10}{}}779 \define@key{zf@lig}{NoDiphthong} [true]{\zf@make@feature{1}{11}{}}780 \define@key{zf@lig}{Squared} [true]{\zf@make@feature{1}{12}{}}781 \define@key{zf@lig}{NoSquared} [true]{\zf@make@feature{1}{13}{}}782 \define@key{zf@lig}{AbbrevSquared} [true]{\zf@make@feature{1}{14}{}}783 \define@key{zf@lig}{NoAbbrevSquared}[true]{\zf@make@feature{1}{15}{}}784 \define@key{zf@lig}{Icelandic} [true]{\zf@make@feature{1}{32}{}}785 \define@key{zf@lig}{NoIcelandic} [true]{\zf@make@feature{1}{33}{}}

7.3.6 Letters786 \define@key{zf}{Letters}{\bgroup\setkeys{zf@letters}{#1}\egroup}

34

787 \define@key{zf@letters}{Normal} [true]{\zf@make@feature{3}{0}{}}788 \define@key{zf@letters}{Uppercase} [true]{\zf@make@feature{3}{1}{+cpsp}}789 \define@key{zf@letters}{Lowercase} [true]{\zf@make@feature{3}{2}{}}790 \define@key{zf@letters}{SmallCaps} [true]{\zf@make@feature{3}{3}{+smcp}}791 \define@key{zf@letters}{PetiteCaps} [true]{\zf@make@feature{}{}{+pcap}}792 \define@key{zf@letters}{SMALLCAPS} [true]{\zf@make@feature{}{}{+c2sc}}793 \define@key{zf@letters}{PETITECAPS} [true]{\zf@make@feature{}{}{+c2pc}}794 \define@key{zf@letters}{InitialCaps}[true]{\zf@make@feature{3}{4}{}}795 \define@key{zf@letters}{Unicase} [true]{\zf@make@feature{}{}{+unic}}

7.3.7 Numbers

These were originally separated into NumberCase and NumberSpacing followingAAT, but it makes more sense to combine them.

Both naming conventions are offered to select the number case.796 \define@key{zf}{Numbers}{\bgroup\setkeys{zf@num}{#1}\egroup}797 \define@key{zf@num}{Monospaced} [true]{\zf@make@feature{6}{0}{+tnum}}798 \define@key{zf@num}{Proportional} [true]{\zf@make@feature{6}{1}{+pnum}}799 \define@key{zf@num}{Lowercase} [true]{\zf@make@feature{21}{0}{+onum}}800 \define@key{zf@num}{OldStyle} [true]{\zf@make@feature{21}{0}{+onum}}801 \define@key{zf@num}{Uppercase} [true]{\zf@make@feature{21}{1}{+lnum}}802 \define@key{zf@num}{Lining} [true]{\zf@make@feature{21}{1}{+lnum}}803 \define@key{zf@num}{SlashedZero} [true]{\zf@make@feature{}{}{+zero}}804 \define@key{zf@num}{NoSlashedZero}[true]{\zf@make@feature{}{}{-zero}}

7.3.8 Swashes805 \define@key{zf}{Swashes}{\bgroup\setkeys{zf@swash}{#1}\egroup}806 \define@key{zf@swash}{Contextual} [true]{\zf@make@feature{}{}{+cswh}}807 \define@key{zf@swash}{WordInitial} [true]{\zf@make@feature{8}{0}{+init}}808 \define@key{zf@swash}{NoWordInitial}[true]{\zf@make@feature{8}{1}{-init}}809 \define@key{zf@swash}{WordFinal} [true]{\zf@make@feature{8}{2}{+fina}}810 \define@key{zf@swash}{NoWordFinal} [true]{\zf@make@feature{8}{3}{-fina}}811 \define@key{zf@swash}{LineInitial} [true]{\zf@make@feature{8}{4}{}}812 \define@key{zf@swash}{NoLineInitial}[true]{\zf@make@feature{8}{5}{}}813 \define@key{zf@swash}{LineFinal} [true]{\zf@make@feature{8}{6}{+falt}}814 \define@key{zf@swash}{NoLineFinal} [true]{\zf@make@feature{8}{7}{-falt}}815 \define@key{zf@swash}{Inner} [true]{\zf@make@feature{8}{8}{}}816 \define@key{zf@swash}{NoInner} [true]{\zf@make@feature{8}{9}{}}

7.3.9 Diacritics817 \define@key{zf}{Diacritics}{\bgroup\setkeys{zf@diacritics}{#1}\egroup}818 \define@key{zf@diacritics}{Show} [true]{\zf@make@feature{9}{0}{}}819 \define@key{zf@diacritics}{Hide} [true]{\zf@make@feature{9}{1}{}}820 \define@key{zf@diacritics}{Decompose}[true]{\zf@make@feature{9}{2}{}}

7.3.10 Vertical position821 \define@key{zf}{VerticalPosition}{\bgroup\setkeys{zf@vertpos}{#1}\egroup}822 \define@key{zf@vertpos}{Normal}[true]{\zf@make@feature{10}{0}{}}823 \define@key{zf@vertpos}{Superior}[true]{\zf@make@feature{10}{1}{+sups}}824 \define@key{zf@vertpos}{Inferior}[true]{\zf@make@feature{10}{2}{+subs}}825 \define@key{zf@vertpos}{ScientificInferior}[true]{\zf@make@feature{}{}{+sinf}}826 \define@key{zf@vertpos}{Ordinal}[true]{\zf@make@feature{10}{3}{+ordn}}

35

827 \define@key{zf@vertpos}{Numerator}[true]{\zf@make@feature{}{}{+numr}}828 \define@key{zf@vertpos}{Denominator}[true]{\zf@make@feature{}{}{+dnom}}

7.3.11 Fractions829 \define@key{zf}{NoFractions}[true]{\zf@make@feature{11}{0}{-frac}}830 \define@key{zf}{Fractions}[true]{\zf@make@feature{11}{1}{+frac}}831 \define@key{zf}{DiagonalFractions}[true]{\zf@make@feature{11}{2}{+frac}}

7.3.12 Alternates and variants

Selected numerically because they don’t have standard names. Very easy to pro-cess, very annoying for the user!832 \define@key{zf}{Alternate}{\zf@make@feature{17}{#1}{\ifnum #1 > 0 +salt\fi}}833 \define@key{zf}{Variant}{\zf@make@feature{18}{#1}{%834 \ifnum #1 > 0835 \ifnum #1 < 21836 \ifnum #1 > 9837 +ss#1%838 \else839 +ss0#1%840 \fi841 \else842 \PackageWarning{fontspec}{OpenType variant range must be843 between 1 and 20.}%844 \fi845 \else846 \PackageWarning{fontspec}{OpenType variant range must be between 1847 and 20.}%848 \fi}}

7.3.13 Style options849 \define@key{zf}{StyleOptions}{\bgroup\setkeys{zf@style}{#1}\egroup}850 \define@key{zf@style}{Display}[true]{\zf@make@feature{19}{1}{}}851 \define@key{zf@style}{Engraved}[true]{\zf@make@feature{19}{2}{}}852 \define@key{zf@style}{IlluminatedCaps}[true]{\zf@make@feature{19}{3}{}}853 \define@key{zf@style}{TitlingCaps}[true]{\zf@make@feature{19}{4}{+titl}}854 \define@key{zf@style}{TallCaps}[true]{\zf@make@feature{19}{5}{}}

7.4 Italic small capsThe following code for utilising italic small caps sensibly is taken pretty muchverbatim from Philip Lehman’s Font Installation Guide. Note that \upshape needsto be used twice to get from italic small caps to regular upright (it always goes tosmall caps, then regular upright).

\sishape

\textsi

First, the commands for actually selecting italic small caps are defined. I use si

as the NFSS shape for italic small caps, but I have seen itsc and slsc also used.\sidefault may be redefined to one of these if required for compatibility.855 \providecommand*{\sidefault}{si}856 \DeclareRobustCommand{\sishape}{%857 \not@math@alphabet\sishape\relax858 \fontshape\sidefault\selectfont}859 \DeclareTextFontCommand{\textsi}{\sishape}

36

\zf@merge@shape This is the macro which enables the overload on the \..shape commands. It takesthree such arguments. In essence, the macro selects the first argument, unless thesecond argument is already selected, in which case it selects the third.860 \newcommand*{\zf@merge@shape}[3]{%861 \edef\@tempa{#1}%862 \edef\@tempb{#2}%863 \ifx\f@shape\@tempb864 \expandafter\ifx865 \csname\f@encoding/\f@family/\f@series/#3\endcsname866 \relax\else867 \edef\@tempa{#3}%868 \fi869 \fi870 \fontshape{\@tempa}\selectfont}

\itshape

\scshape

\upshape

Here the original \..shape commands are redefined to use the merge shapemacro.871 \DeclareRobustCommand{\itshape}{%872 \not@math@alphabet\itshape\mathit873 \zf@merge@shape\itdefault\scdefault\sidefault}874 \DeclareRobustCommand{\scshape}{%875 \not@math@alphabet\scshape\relax876 \zf@merge@shape\scdefault\itdefault\sidefault}877 \DeclareRobustCommand{\upshape}{%878 \not@math@alphabet\upshape\relax879 \zf@merge@shape\updefault\sidefault\scdefault}

7.5 Selecting maths fontsHere, the fonts used in math mode are redefined to correspond to the defaultroman, sans serif and typewriter fonts. Unfortunately, you can only define mathsfonts in the preamble, otherwise I’d run this code whenever \defaultromanfontand friends was run.

\AtBeginDocument Everything here is performed \AtBeginDocument in order to overwrite euler’sattempt. This means fontspec must be loaded before euler.

The Computer Modern font family contain uppercase Greek math letters inits main text font, cmr. Since this is also the font used for the operators, thedefault roman font, any redefinition of this will make the uppercase Greek lettersdisappear. This is not a problem using any other math font, however, so first wecheck to see if that is the case: (TODO: it would be more robust to simply check ifthe currently selected maths font is indeed cmmi or whatever.)880 \newif\ifzf@math@package881 \AtBeginDocument{%882 \@ifpackageloaded{euler}{\zf@math@packagetrue}{}883 \@ifpackageloaded{lucbmath}{\zf@math@packagetrue}{}884 \@ifpackageloaded{lucidabr}{%885 \zf@math@packagetrue886 \PackageWarningNoLine{fontspec}{887 It would be better to use the lucbmath package,\MessageBreak888 since the lucidabr package also defines the text\MessageBreak

37

889 fonts, which are unavailable in XeTeX.}}{}

If default maths, redefine the uppercase Greek letters to a different math symbolfont (which is cmr, what it originally was) so that font changes don’t make X ETEXtry and look for them in the new Mac OS X font:890 \ifzf@math@package\else891 \DeclareSymbolFont{Greek}{OT1}{cmr}{m}{n}892 \SetSymbolFont{Greek}{bold}{OT1}{cmr}{bx}{n}893 \DeclareMathSymbol{\Gamma}{\mathalpha}{Greek}{0}894 \DeclareMathSymbol{\Delta}{\mathalpha}{Greek}{1}895 \DeclareMathSymbol{\Theta}{\mathalpha}{Greek}{2}896 \DeclareMathSymbol{\Lambda}{\mathalpha}{Greek}{3}897 \DeclareMathSymbol{\Xi}{\mathalpha}{Greek}{4}898 \DeclareMathSymbol{\Pi}{\mathalpha}{Greek}{5}899 \DeclareMathSymbol{\Sigma}{\mathalpha}{Greek}{6}900 \DeclareMathSymbol{\Upsilon}{\mathalpha}{Greek}{7}901 \DeclareMathSymbol{\Phi}{\mathalpha}{Greek}{8}902 \DeclareMathSymbol{\Psi}{\mathalpha}{Greek}{9}903 \DeclareMathSymbol{\Omega}{\mathalpha}{Greek}{10}904 \fi

Finally we change the font definitions. I’m not sure if every single declarationbelow is necessary, but I thought it would be best to include everything. Somemay be redundant, and others may not be desired since there are only a limitednumber of math fonts available for declaration at any one time.905 \DeclareSymbolFont{operators}\zf@enc\rmdefault\mddefault\updefault906 \SetSymbolFont{operators}{normal}\zf@enc\rmdefault\mddefault\updefault907 \SetMathAlphabet\mathrm{normal}\zf@enc\rmdefault\mddefault\updefault908 \SetMathAlphabet\mathit{normal}\zf@enc\rmdefault\mddefault\itdefault909 \SetMathAlphabet\mathbf{normal}\zf@enc\rmdefault\bfdefault\updefault910 \SetMathAlphabet\mathsf{normal}\zf@enc\sfdefault\mddefault\updefault911 \SetMathAlphabet\mathtt{normal}\zf@enc\ttdefault\mddefault\updefault912 \SetSymbolFont{operators}{bold}\zf@enc\rmdefault\bfdefault\updefault913 \SetMathAlphabet\mathrm{bold}\zf@enc\rmdefault\bfdefault\updefault914 \SetMathAlphabet\mathit{bold}\zf@enc\rmdefault\bfdefault\itdefault915 \SetMathAlphabet\mathsf{bold}\zf@enc\sfdefault\bfdefault\updefault}

The end! Thanks for coming.916 〈/fontspec〉

IndexNumbers written in italic refer to the page where the corresponding entry isdescribed; numbers underlined refer to the code line of the definition; numbersin roman refer to the code lines where the entry is used.

Symbols\@firstoftwo . . . . . . . . . . . . . . . . . . 42\@ifnextchar . . . . . . . . . . . . . . . . . . 30\@ifpackageloaded . . . . . . . . . 882–884\@secondoftwo . . . . . . . . . . . . . . . . . 43

\@tempb . . . . . . . . . . . . 255, 256, 862, 863

A\addfontfeature . . . . . . . . . . . . . . 5, 45\addfontfeatures . . . . . . . . . . . . . 5, 37\AtBeginDocument . . . . . . . . . . . . . . 880

38

B\bfdefault . . . . . . . . . . . . . . . . . . .

74, 76, 93, 95, 98, 101, 909, 912–915

D\DeclareFontFamily . . . . . . . . . . . . . 68\DeclareFontShape . . . . . . . . . 134, 144\DeclareMathSymbol . . . . . . . . . 893–903\DeclareSymbolFont . . . . . . . . . 891, 905\DeclareTextFontCommand . . . . . . . . 859\defaultfontfeatures . . . . . . . . . . 4, 35\define@key . . . . . . . . . . . . . . . . . . . 16\Delta . . . . . . . . . . . . . . . . . . . . . . . 894

E\encodingdefault . . . . . . . . . . . . . . 12

F\f@encoding . . . . . . . . . . . . . . . . . . . 865\f@family . . . . . . . . . . . . . . . . . 40, 865\f@series . . . . . . . . . . . . . . . . . . . . 865\f@shape . . . . . . . . . . . . . . . . . . . . . 863\font . . . . . . . . . . 108, 184, 224, 251, 254\fontfamily . . . . . . . . . . . . . . . . . 16, 33\fontname . . . . . . . . . . . . . . . . 252, 255\fontshape . . . . . . . . . . . . . . . 858, 870\fontspec . . . . . . . . . . . . . . . . 2, 14, 41

G\Gamma . . . . . . . . . . . . . . . . . . . . . . . 893\globaldefs . . . . . . . . . . . . . . . . . . . 124

I\ifEqFonts . . . . . . . . . . . . . . . 126, 245\ifEqStr . . . . . . . . . . . . . . . . . . . . . 245\ifzf@aat . . . 120, 177, 204, 212, 287, 292\ifzf@firsttime . . . . . . . . 151, 155, 157\ifzf@math@package . . . . . . . . . 880, 890\ifzf@opentype 121, 183, 207, 219, 296, 374\itdefault . . . . . . . . . . . . . . 83, 85,

93, 95, 98, 101, 141, 873, 876, 908, 914\itshape . . . . . . . . . . . . . . . . . . . . . 871

L\Lambda . . . . . . . . . . . . . . . . . . . . . . 896

M\mathalpha . . . . . . . . . . . . . . . 893–903\mddefault . 69, 83, 85, 905–908, 910, 911\MessageBreak . . . . . . . . . . . . . 887, 888

N\newcounter . . . . . . . . . . . . . . . . . . . 46

\newfeaturecode . . . . . . . . . . . . . 14, 53\newfontfeature . . . . . . . . . . . . . 12, 46\newfontinstance . . . . . . . . . . . . . 4, 29\newfontinstance@i . . . . . . . . . . . 30, 31\newif . . . . . . . . . . . . . 120, 121, 155, 880\nfss@catcodes . . . . . . . . . . . . . . . . 123\normalfont . . . . . . . . . . . . . . 20, 24, 28\not@math@alphabet . . . 857, 872, 875, 878

O\Omega . . . . . . . . . . . . . . . . . . . . . . . 903

P\PackageWarning . . . . . . . . . . . 842, 846\PackageWarningNoLine . . . . . . . . . . 886\Phi . . . . . . . . . . . . . . . . . . . . . . . . . 901\Pi . . . . . . . . . . . . . . . . . . . . . . . . . . 898\providecommand . . . . . . . . . . . . . . . 855\Psi . . . . . . . . . . . . . . . . . . . . . . . . . 902

R\rmdefault . . . . . . 19, 905–909, 912–914

S\scdefault . . . . . . . . . 139, 873, 876, 879\scshape . . . . . . . . . . . . . . . . . . . . . 871\setkeys . . . . . . . . . . . 16, 173, 296,

374, 761, 786, 796, 805, 817, 821, 849\SetMathAlphabet . . . . 907–911, 913–915\setmonofont . . . . . . . . . . . . . . . . . 3, 17\setromanfont . . . . . . . . . . . . . . . . 3, 17\setsansfont . . . . . . . . . . . . . . . . . 3, 17\SetSymbolFont . . . . . . . . . 892, 906, 912\sfdefault . . . . . . . . . . . . . 23, 910, 915\sidefault . . 142, 855, 858, 873, 876, 879\Sigma . . . . . . . . . . . . . . . . . . . . . . . 899\sishape . . . . . . . . . . . . . . . . . . . . . 855\stepcounter . . . . . . . . . . . . . . . . . . 48

T\textsi . . . . . . . . . . . . . . . . . . . . . . 855\thenewff . . . . . . . . . . . . . . . . . . . . 49\Theta . . . . . . . . . . . . . . . . . . . . . . . 895\ttdefault . . . . . . . . . . . . . . . . 27, 911

U\updefault . . . . . . . . . . . . . . 69, 74,

76, 138, 879, 905–907, 909–913, 915\upshape . . . . . . . . . . . . . . . . . . . . . 871\Upsilon . . . . . . . . . . . . . . . . . . . . . 900

W\wlog . . . . . . . . . . . . . . . . . . . . . . . . 64

39

X\XeTeXcountfeatures . . . . . . . . . . . . 109\XeTeXfeaturename . . . . . . . . . . . . . 225\XeTeXisexclusivefeature . . . . . . . 234\XeTeXOTcountfeatures . . . . . . . . . . 188\XeTeXOTcountscripts . . . . . . . 114, 185\XeTeXOTfeaturetag . . . . . . . . . . . . . 190\XeTeXselectorname . . . . . . . . . . . . . 229\Xi . . . . . . . . . . . . . . . . . . . . . . . . . . 897

Z\zf@aatfalse . . . . . . . . . . . . . . 106, 117\zf@aattrue . . . . . . . . . . . . . . . . . . . 111\zf@bf . . . . . . 73, 76, 91, 98, 159, 257, 264\zf@bf@options . . . . . . . . . . 72, 162, 271\zf@bfit . . . . . . . . 90, 101, 161, 261, 268\zf@bfit@options . . . . . . . . 89, 164, 273\zf@current@options 65, 66, 168, 170, 173\zf@default@options . . . . . . . . . . . .

. . . . . . . . . . 35, 38, 39, 44, 167, 170\zf@default@options@old . . . . . . 38, 44\zf@enc . . . . 10–12, 68, 134, 145, 905–915\zf@family . . . . . . . . . 16, 19, 23, 27,

33, 58, 63, 67, 68, 134, 145, 152, 153\zf@family@old . . . . . . . . . . . . 152, 153\zf@featurecount . . . . 188, 189, 193, 200\zf@ff . . . . . . 135, 146, 166, 203, 205, 208\zf@ff@old . . . . . . . . . . . . 203, 205, 208\zf@firsttimefalse . . . . . . . . . . . . . 62\zf@firsttimetrue . . . . . . . . . . . . . 60\zf@fontone . . 224, 225, 229, 234, 251, 252\zf@fontspec . . . . . . 15, 18, 22, 26, 32, 55\zf@fonttwo . . . . . . . . . . . . . . . 254, 255\zf@get@feature@requests . 61, 128, 156\zf@info . . . . . . . . . . . . . . . . . . . 66, 67\zf@it . . . . . . 82, 85, 92, 95, 160, 259, 266\zf@it@options . . . . . . . . . . 81, 163, 272\zf@macname . . . . . . . . . 57, 127, 184, 224

\zf@make@aat@feature@string . . . . .. . . . . . . . . . . . . . . . 178, 213, 223

\zf@make@feature . . . . . . . . 54, 211,762–785, 787–795, 797–804, 806--816, 818–820, 822–833, 850–854

\zf@make@font@shapes . . . . . . . . 69,74, 76, 83, 85, 93, 95, 98, 101, 122

\zf@make@lang@feature . . . 375, 379–760\zf@make@scpt@feature . . . 297, 301–372\zf@math@packagetrue . . . . 882, 883, 885\zf@merge@shape . . . . . 860, 873, 876, 879\zf@opentypefalse . . . . . . . . . 107, 112\zf@opentypetrue . . . . . . . . . . . . . . 116\zf@options . . . . . . . . . . . . . . . . 56,

71, 72, 78, 80, 81, 87–89, 103, 168, 170\zf@options@old . . . . . . . . . . . . . . .

. . . . . 71, 72, 78, 80, 81, 87–89, 103\zf@process@options . . . . . . . . 172, 174\zf@scale . . . . . . . . . . 129, 132, 158, 276\zf@scale@str . . . . . . . 130, 132, 135, 146\zf@scshape . . . . . . . . . . . . 139, 142, 145\zf@set@font@type . . . . . . . . . . 59, 105\zf@smallcaps . . . 137, 146, 176, 180, 192\zf@smallcaps@string . . . . . . . 179, 180\zf@tempinst . . . . . . . . . . . . . . . . 33, 34\zf@test@smallcaps . . . . . . . . . 136, 175\zf@testfont . . . . . . . . . . . . . . . . . .

. . . 108, 109, 114, 184, 185, 188, 190\zf@this@featurename . . . . . . . . . . .

. . . . . . . . . . 225, 226, 235, 238, 240\zf@this@selectionname . . . . . . . . .

. . . . . . . . . . 229, 230, 235, 238, 240\zf@thisfontfeature . . . . . . . . 214, 216\zf@thisinfo . . . . . . . . . . . . . 40, 42, 43\zf@update@family . . . 51, 150, 215,

220, 258, 260, 262, 265, 267, 269,275, 278, 281, 284, 288, 293, 299, 377

\zf@update@ff . . . . . . . 52, 201, 216,221, 279, 282, 285, 289, 294, 300, 378

40