Function: set-face-font

set-face-font is an interactive and byte-compiled function defined in faces.el.gz.

Signature

(set-face-font FACE FONT &optional FRAME)

Documentation

Change font-related attributes of FACE to those of FONT.

FONT can be a string, a font spec, a font entity, a font object, or a fontset. However, interactively, only strings are accepted. The format of the font string specification varies based on the font system in use, but it can commonly be an X Logical Font Description (XLFD) string, or a simpler string like "Courier-10" or "courier:size=10".

FRAME nil or not specified means change face on all frames. This sets the attributes :family, :foundry, :width,
:height, :weight, and :slant. When called interactively,
prompt for the face and font.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/faces.el.gz
(defun set-face-font (face font &optional frame)
  "Change font-related attributes of FACE to those of FONT.
FONT can be a string, a font spec, a font entity, a font object,
or a fontset.  However, interactively, only strings are accepted.
The format of the font string specification varies based on the font
system in use, but it can commonly be an X Logical Font
Description (XLFD) string, or a simpler string like \"Courier-10\"
or \"courier:size=10\".

FRAME nil or not specified means change face on all frames.
This sets the attributes `:family', `:foundry', `:width',
`:height', `:weight', and `:slant'.  When called interactively,
prompt for the face and font."
  (interactive (read-face-and-attribute :font))
  (set-face-attribute face frame :font font))