Function: htmlize-face-size

htmlize-face-size is a byte-compiled function defined in htmlize.el.

Signature

(htmlize-face-size FACE)

Source Code

;; Defined in ~/.emacs.d/elpa/htmlize-20250724.1703/htmlize.el
(defun htmlize-face-size (face)
  ;; The size (height) of FACE, taking inheritance into account.
  ;; Only works in Emacs 21 and later.
  (let* ((face-list (list face))
         (head face-list)
         (tail face-list))
    (while head
      (let ((inherit (face-attribute (car head) :inherit)))
        (cond ((listp inherit)
               (setq tail (last inherit)))
              ((eq inherit 'unspecified))
              (t
               (setcdr tail (list inherit))
               (setq tail (cdr tail)))))
      (pop head))
    (let ((size-list
           (cl-loop
            for f in face-list
            for h = (and (facep f) (face-attribute f :height))
            collect (if (eq h 'unspecified) nil h))))
      (cl-reduce 'htmlize-merge-size (cons nil size-list)))))