GNU Emacs Manual - Fontsets

Go to the first, previous, next, last section, table of contents.

## Fontsets

A font for X Windows typically defines shapes for one alphabet or script. Therefore, displaying the entire range of scripts that Emacs supports requires a collection of many fonts. In Emacs, such a collection is called a fontset. A fontset is defined by a list of fonts, each assigned to handle a range of character codes.

Each fontset has a name, like a font. The available X fonts are defined by the X server; fontsets, however, are defined within Emacs itself. Once you have defined a fontset, you can use it within Emacs by specifying its name, anywhere that you could use a single font. Of course, Emacs fontsets can use only the fonts that the X server supports; if certain characters appear on the screen as hollow boxes, this means that the fontset in use for them has no font for those characters.

Emacs creates two fontsets automatically: the standard fontset and the startup fontset. The standard fontset is most likely to have fonts for a wide variety of non-ASCII characters; however, this is not the default for Emacs to use. (By default, Emacs tries to find a font which has bold and italic variants.) You can specify use of the standard fontset with the ``-fn'` option, or with the ``Font'` X resource (see section Font Specification Options). For example,

    emacs -fn fontset-standard

A fontset does not necessarily specify a font for every character code. If a fontset specifies no font for a certain character, or if it specifies a font that does not exist on your system, then it cannot display that character properly. It will display that character as an empty box instead.

The fontset height and width are determined by the ASCII characters (that is, by the font used for ASCII characters in that fontset). If another font in the fontset has a different height, or a different width, then characters assigned to that font are clipped to the fontset's size. If `highlight-wrong-size-font` is non-`nil`, a box is displayed around these wrong-size characters as well.

Go to the first, previous, next, last section, table of contents.