Accessing OpenType font features in LATEX
Mainstream typography websites discussing OpenType support in design and typesetting applications (1–2) seem to be largely unaware of the amazing work done by the creators of the XƎTEX typesetting system and of its high-level interface to OpenType features (the fontspec package). To bridge this gap I put together a table with a list of font features currently supported in XƎTEX, based on version 2.0 of fontspec. TEX distributions such as XƎTEX allow you to make the most of the advanced typographic features available with expert fonts via a simple user interface.
Activating font features with fontspec
Specific OpenType features can be activated globally, by declaring them in the document defaults:
\setmainfont[<font features>]{<font name>}
or locally in the text, only when needed:
\addfontfeature{<font features>}
Feature | Tags | Fontspec options | Notes |
---|---|---|---|
1. Numbers | |||
Proportional Oldstyle | pnum+onum | Numbers={Proportional,Oldstyle} | |
Tabular Lining | tnum+lnum | Numbers={Monospaced,Lining} | |
Proportional Lining | pnum+lnum | Numbers={Proportional,Lining} | |
Tabular Oldstyle | tnum+onum | Numbers={Monospaced,OldStyle} | |
2. Ligatures | |||
Standard Ligatures | liga | Ligatures=Common | on by default, can be disabled with: NoCommon |
Required Ligatures | rlig | Ligatures=Required | on by default, can be disabled with: NoRequired |
Contextual Ligatures | clig | Ligatures=Contextual | on by default, can be disabled with: NoContextual |
Discretionary Ligatures | dlig | Ligatures=Rare | |
Historical Ligatures | hlig | Ligatures=Historical | |
3. Letters | |||
All Caps | case | Letters=Uppercase | |
Small Caps | smcp | Letters=SmallCaps | |
Petite Caps | pcap | Letters=PetiteCaps | |
Capitals to Small Caps | c2sc | Letters=UppercaseSmallCaps | |
Capitals to Petite Caps | c2pc | Letters=UppercasePetiteCaps | |
Unicase | unic | Letters=Unicase | |
4. Contextuals | |||
Contextual Swash | cswh | Contextuals=Swash | |
Contextual Alternate | calt | Contextuals=Alternate | |
Initial Form | init | Contextuals=WordInitial | |
Final Form | fina | Contextuals=WordFinal | |
Medial Form | medi | Contextuals=Inner | |
Line Final | falt | Contextuals=LineFinal | |
5. Vertical Position | |||
Superscript | sups | VerticalPosition=Superior | |
Subscript | subs | VerticalPosition=Inferior | |
Scientific Inferiors | sinf | VerticalPosition=ScientificInferior | |
Ordinals | ordn | VerticalPosition=Ordinal | |
6. Fractions | |||
Numerator | numr | VerticalPosition=Numerator | |
Denominator | dnom | VerticalPosition=Denominator | |
Fractions | frac | Fractions=On | |
Alternate Fractions | afrc | Fractions=Alternate | |
7. Style and alternate glyphs | |||
Stylistic Sets | ss01…ss20 | StylisticSet=1 | |
Stylistic Alternates | salt | Style=Alternate | |
Italic | ital | Style=Italic | |
Ruby | ruby | Style=Ruby | |
Historical Forms | hist | Style=Historic | |
Titling Forms | titl | Style=Titling | |
Horizontal Kana | hkna | Style=HorizontalKana | |
Vertical Kana | vkna | Style=VerticalKana | |
8. Diacritics | |||
Mark Positioning | mark | Diacritics=MarkToBase | on by default, can be disabled with: NoMarkToBase |
Mark-to-mark Positioning | mkmk | Diacritics=MarkToMark | on by default, can be disabled with: NoMarkToMark |
Above-base Positioning | abvm | Diacritics=AboveBase | on by default, can be disabled with: NoAboveBase |
Below-base Positioning | blvm | Diacritics=BelowBase | on by default, can be disabled with: NoBelowBase |
9. Kerning | |||
Uppercase kerning | cpsp | Kerning=Uppercase | |
Regular kerning | kern | Kerning=On | on by default, can be disabled with: Off |
Notes
- Further information about script-specific OpenType features controlling CJK shape, Character width and Vertical typesetting can be found in section 10 of the fontspec documentation.
- Additional OpenType features for which fontspec does not provide an interface can be manually accessed, as described in section Part 4, section 14 of the fontspec documentation.
See also
The Beauty of LATEX
A comparison of typographic accuracy in LATEX vs ordinary word processors.
Typesetting an academic CV in LATEX
Templates to compile an academic curriculum vitae or resume using XƎTEX and expert fonts.
LATEX on Mac OS
A review of open source software, tools and fonts to use LATEX and XƎTEX on Mac OS.
Pure CSS TEX logos
A simple hack to generate TEX, LATEX and XƎTEX logos in plain CSS.