Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

2016.

 08. 28. Dario Taraborelli: Accessing OpenType font features in LaTeX

home › typography › texopentype

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>}

List of OpenType features supported in fontspec

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
on by default, can be disabled with:
Standard Ligatures liga Ligatures=Common
NoCommon
on by default, can be disabled with:
Required Ligatures rlig Ligatures=Required
NoRequired
on by default, can be disabled with:
Contextual Ligatures clig Ligatures=Contextual
NoContextual
Discretionary
dlig Ligatures=Rare
Ligatures
Historical Ligatures hlig Ligatures=Historical

3. Letters
All Caps case Letters=Uppercase

Small Caps smcp Letters=SmallCaps

Petite Caps pcap Letters=PetiteCaps

http://nitens.org/taraborelli/TeXOpenType 1/3
2016. 08. 28. Dario Taraborelli: Accessing OpenType font features in LaTeX

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
on by default, can be disabled with:
Mark Positioning mark Diacritics=MarkToBase
NoMarkToBase
Mark-to-mark on by default, can be disabled with:
mkmk Diacritics=MarkToMark
Positioning NoMarkToMark

Above-base on by default, can be disabled with:


abvm Diacritics=AboveBase
Positioning NoAboveBase

Below-base on by default, can be disabled with:


blvm Diacritics=BelowBase
Positioning NoBelowBase

9. Kerning
Uppercase kerning cpsp Kerning=Uppercase
on by default, can be disabled with:
Regular kerning kern Kerning=On
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.

http://nitens.org/taraborelli/TeXOpenType 2/3
2016. 08. 28. Dario Taraborelli: Accessing OpenType font features in LaTeX

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. Why should you use LATEX instead of an ordinary word processor? Here is a
tentative answer comparing their typographic accuracy.

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 on Mac OS X: my open source LATEX toolbox for Mac OS.

nitens.org

http://nitens.org/taraborelli/TeXOpenType 3/3

You might also like