hometypography › texopentype

Accessing OpenType font features in LaTeX


OpenType feature example 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>}


List of OpenType features supported in fontspec
FeatureTagsFontspec optionsNotes
1. Numbers
Proportional Oldstylepnum+onumNumbers={Proportional,Oldstyle}
Tabular Liningtnum+lnumNumbers={Monospaced,Lining}
Proportional Liningpnum+lnumNumbers={Proportional,Lining}
Tabular Oldstyletnum+onumNumbers={Monospaced,OldStyle}
2. Ligatures
Standard LigaturesligaLigatures=Commonon by default, can be disabled with: NoCommon
Required LigaturesrligLigatures=Requiredon by default, can be disabled with: NoRequired
Contextual LigaturescligLigatures=Contextualon by default, can be disabled with: NoContextual
Discretionary LigaturesdligLigatures=Rare
Historical LigatureshligLigatures=Historical
3. Letters
All CapscaseLetters=Uppercase
Small CapssmcpLetters=SmallCaps
Petite CapspcapLetters=PetiteCaps
Capitals to Small Capsc2scLetters=UppercaseSmallCaps
Capitals to Petite Capsc2pcLetters=UppercasePetiteCaps
UnicaseunicLetters=Unicase
4. Contextuals
Contextual SwashcswhContextuals=Swash
Contextual AlternatecaltContextuals=Alternate
Initial ForminitContextuals=WordInitial
Final FormfinaContextuals=WordFinal
Medial FormmediContextuals=Inner
Line FinalfaltContextuals=LineFinal
5. Vertical Position
SuperscriptsupsVerticalPosition=Superior
SubscriptsubsVerticalPosition=Inferior
Scientific InferiorssinfVerticalPosition=ScientificInferior
OrdinalsordnVerticalPosition=Ordinal
6. Fractions
NumeratornumrVerticalPosition=Numerator
DenominatordnomVerticalPosition=Denominator
FractionsfracFractions=On
Alternate FractionsafrcFractions=Alternate
7. Style and alternate glyphs
Stylistic Setsss01ůss20StylisticSet=1
Stylistic AlternatessaltStyle=Alternate
ItalicitalStyle=Italic
RubyrubyStyle=Ruby
Historical FormshistStyle=Historic
Titling FormstitlStyle=Titling
Horizontal KanahknaStyle=HorizontalKana
Vertical KanavknaStyle=VerticalKana
8. Diacritics
Mark PositioningmarkDiacritics=MarkToBaseon by default, can be disabled with: NoMarkToBase
Mark-to-mark PositioningmkmkDiacritics=MarkToMarkon by default, can be disabled with: NoMarkToMark
Above-base PositioningabvmDiacritics=AboveBaseon by default, can be disabled with: NoAboveBase
Below-base PositioningblvmDiacritics=BelowBaseon by default, can be disabled with: NoBelowBase
9. Kerning
Uppercase kerningcpspKerning=Uppercase
Regular kerningkernKerning=Onon by default, can be disabled with: Off

Notes


See also


[latex] The Beauty of LaTeX. Why should you use LaTeX instead of an ordinary word processor? Here is a tentative answer comparing their typographic accuracy.

[latex] Typesetting an academic CV in LaTeX. Templates and examples of how to compose an academic curriculum vitae or resume using XƎTeX and expert fonts.

[latex tools] LaTeX on Mac OS X: my open source LaTeX toolbox for Mac OS.
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki