Function: window-font-width
window-font-width is a byte-compiled function defined in window.el.gz.
Signature
(window-font-width &optional WINDOW FACE)
Documentation
Return average character width for the font of FACE used in WINDOW.
WINDOW must be a live window and defaults to the selected one.
If FACE is nil or omitted, the default face is used. If FACE is
remapped (see face-remapping-alist), the function returns the
information for the remapped face.
Probably introduced at or before Emacs version 25.1.
Source Code
;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-font-width (&optional window face)
"Return average character width for the font of FACE used in WINDOW.
WINDOW must be a live window and defaults to the selected one.
If FACE is nil or omitted, the default face is used. If FACE is
remapped (see `face-remapping-alist'), the function returns the
information for the remapped face."
(with-selected-window (window-normalize-window window t)
(if (display-multi-font-p)
(let* ((face (if face face 'default))
(info (font-info (face-font face)))
(width (aref info 11)))
(if (> width 0)
width
(aref info 10)))
(frame-char-width))))