Skip to main content

39.12 Faces

A face is a collection of graphical attributes for displaying text: font, foreground color, background color, optional underlining, etc. Faces control how Emacs displays text in buffers, as well as other parts of the frame such as the mode line.

One way to represent a face is as a property list of attributes, like (:foreground "red" :weight bold). Such a list is called an anonymous face. For example, you can assign an anonymous face as the value of the face text property, and Emacs will display the underlying text with the specified attributes. See Special Properties.

More commonly, a face is referred to via a face name: a Lisp symbol associated with a set of face attributes1. Named faces are defined using the defface macro (see Defining Faces). Emacs comes with several standard named faces (see Basic Faces).

Some parts of Emacs require named faces (e.g., the functions documented in Attribute Functions). Unless otherwise stated, we will use the term face to refer only to named faces.

function facep object

This function returns a non-nil value if object is a named face: a Lisp symbol or string which serves as a face name. Otherwise, it returns nil.

Face Attributes  What is in a face?
Defining Faces  How to define a face.
Attribute Functions  Functions to examine and set face attributes.
Displaying Faces  How Emacs combines the faces specified for a character.
Face Remapping  Remapping faces to alternative definitions.
Face Functions  How to define and examine faces.
Auto Faces  Hook for automatic face assignment.
Basic Faces  Faces that are defined by default.
Font Selection  Finding the best available font for a face.
Font Lookup  Looking up the names of available fonts and information about them.
Fontsets  A fontset is a collection of fonts that handle a range of character sets.
Low-Level Font  Lisp representation for character display fonts.

  1. For backward compatibility, you can also use a string to specify a face name; that is equivalent to a Lisp symbol with the same name.