CTAN Comprehensive TeX Archive Network

Direc­tory macros/xetex/latex/fontspec


The FONTSPEC pack­age

The fontspec pack­age pro­vides an au­to­matic and uni­fied in­ter­face for load­ing fonts in . and Lua (the lat­ter through the luaotfload pack­age) al­lows a di­rect in­ter­face to fonts which may be loaded by their name or file­name, so no man­ual font in­stal­la­tion is re­quired.

This pack­age also pro­vides ac­cess to the large num­ber of font fea­tures avail­able with OpenType (and other) fonts, in­clud­ing up­per and lower case num­bers, pro­por­tional and monospaced num­bers, swash let­ters, lig­a­ture con­trol, and many many oth­ers.

See the doc­u­men­ta­tion fontspec.pdf for full in­for­ma­tion.

Sum­mary of user com­mands

To de­fine com­mands for se­lect­ing fonts ef­fi­ciently through a doc­u­ment:

\newfontfamily\<font switch>{<font name>}[<font options>]
\newfontface  \<font switch>{<font name>}[<font options>]

To se­lect the de­fault doc­u­ment fonts:

\setmainfont{<font name>}[<font options>]
\setsansfont{<font name>}[<font options>]
\setmonofont{<font name>}[<font options>]

To de­fine an ad hoc font fam­ily in­di­vid­u­ally:

\fontspec{<font name>}[<font options>]

To spec­ify fea­tures to be used for ev­ery sub­se­quently de­fined font:

\defaultfontfeatures{<default font options>}
\defaultfontfeatures+{<add to default font options>}

To spec­ify fea­tures to be used for spe­cific fonts:

\defaultfontfeatures[<font name or switch>]{<default font options>}
\defaultfontfeatures+[<font name or switch>]{<add to defaults>}

To add fea­tures to the font fam­ily cur­rently in use:

\addfontfeatures{<font options to add>}

Pack­age de­tails

Re­lease ver­sions of fontspec are avail­able from CTAN: http://www.ctan.org/pkg/fontspec

Devel­op­ment and his­tor­i­cal ver­sions are avail­able from Github: http://github.com/wspr/fontspec

Please of­fer sug­ges­tions and file bug re­ports in the is­sue tracker: http://github.com/wspr/fontspec/is­sues

If you are run­ning Live, you can up­date to the lat­est ver­sion of this pack­age by run­ning

tlmgr install fontspec

If you wish to man­u­ally down­load the lat­est re­lease ver­sion from CTAN, get the pre-built TDS pack­age and ex­tract it into your lo­cal texmf tree:


If you wish to use the lat­est de­vel­op­ment ver­sion from Github, ei­ther use git to ob­tain the bleed­ing edge ver­sion with

git clone git://github.com/wspr/fontspec.git

(For bleed­ing edge ver­sions, see the working branch.) Hav­ing ob­tained the pack­age from Github, in­stall the pack­age code by run­ning

texlua build.lua install

This will com­pile the doc­u­men­ta­tion and in­stall all nec­es­sary files in your lo­cal texmf tree. Depend­ing how your dis­tri­bu­tion is con­fig­ured you may then need to up­date the file­name database with texhash.

Down­load the con­tents of this pack­age in one zip archive (1.3M).

Guest Book Sitemap Contact Contact Author