Command/definefontfamily

Unofficial ConTeXt Wiki mirror

Last modified: 2024-02-29

Syntax (autogenerated)

\definefontfamily[...][...][...][...=...,...]
[...] name
[...] rm ss tt mm hw cg roman serif regular sansserif sans support teletype type mono handwritten calligraphic math mathematics
[...] font
rscale number
designsize default auto
goodies file
features name
tf text
bf text
it text
sl text
bi text
bs text
sc text
\definefontfamily[...][...][...][...,...]
[...] name
[...] rm ss tt mm hw cg roman serif regular sansserif sans support teletype type mono handwritten calligraphic math mathematics
[...] font
[...,...] name

Syntax

Description

  1. typescript identifier
  2. font class
  3. existing font name

Example

In the first example we create a new typeface with the name mainface which includes fonts from the TeX Gyre family. Even though there is no math used in this example it is better to set one because math symbols are sometimes used in text mode.

In this example we are switching the fonts which are used for the upright, italic etc. alternatives. With the help of the style keyword you access one of the predefined styles, by default \definefontfamily uses the following styles for each alternative:

Alternative Style
tf regular
it italic
sl slanted
bf bold
bi bolditalic
sc smallcaps

If it is not possible to install fonts system-wide, one can explicitly specify the filename of a font. Custom fonts often don't come with math symbols or a fitting monospaced font. One can replace these using Latin Modern which comes with ConTeXt.

See also