Next: , Up: Fonts   [Contents][Index]

### 4.1 fontenc package

Synopsis:

```\usepackage[font_encoding]{fontenc}
```

or

```\usepackage[font_encoding1, font_encoding2, ...]{fontenc}
```

Specify the encoding used for the font. This is the mapping of the character codes to the font glyphs that are used to typeset your output. This package only applies if you use the `pdflatex` engine (see TeX engines).

TeX’s original font family, Computer Modern, has a limited character set. For instance, to make common accented characters you must use `\accent` (see \accent) but this disables hyphenation. TeX users have agreed on a number of standards to access the larger sets of characters provided by modern fonts. If you are using `pdflatex` then this in the preamble

```\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}  % Optional: encoding of input file
```

gives you support for the most widespread European languages, including French, German, Italian, Polish, and others. In particular, if you have words with accented letters then LaTeX will hyphenate them and your output can be copied and pasted. (The optional second line allows you to directly enter accented characters into your source file.)

For each font_encoding given as an option but not already declared, this package loads the encoding definition files, named font_encodingenc.def. It also sets `\encodingdefault` to be the last encoding in the option list.

These are the common values for font_encoding.

`OT1`

The original encoding for TeX. Limited to mostly English characters.

`OMS, OML`

Math symbols and math letters encoding.

`T1`

TeX text extended. Sometimes called the Cork encoding for the Users Group meeting where it was developed. Gives access to most European accented characters. The most common option for this package.

`TS1`

Text Companion encoding.

LaTeX’s default is to load `OML`, `T1`, `OT1`, and then `OMS`, and set the default to `OT1`.

Even if you do not use accented letters, you may need to specify a font encoding if your font requires it.

If you use `T1` encoded fonts other than the default Computer Modern family then you may need to load the package that selects your fonts before loading fontenc, to prevent the system from loading any `T1` encoded fonts from the default.

If you are using an encoding such as `T1` and the characters appear blurry or do not magnify well then your fonts may be bitmapped, sometimes called raster or Type 3. You want vector fonts. Use a package such as lmodern or cm-super to get a font that extends LaTeX’s default using vector fonts.

Do not use `fontenc` if you use the `xelatex` or `lualatex` engine (see TeX engines). Instead, use the fontspec package.