Function: x-complement-fontset-spec

x-complement-fontset-spec is a byte-compiled function defined in fontset.el.gz.

Signature

(x-complement-fontset-spec DEFAULT-SPEC FONTLIST)

Documentation

Complement elements of FONTLIST based on DEFAULT-SPEC.

DEFAULT-SPEC is a font-spec object providing default font properties. FONTLIST is an alist of script names vs the corresponding font names.

The font names are parsed and unspecified font properties are given from DEFAULT-SPEC.

Source Code

;; Defined in /usr/src/emacs/lisp/international/fontset.el.gz
(defun x-complement-fontset-spec (default-spec fontlist)
  "Complement elements of FONTLIST based on DEFAULT-SPEC.
DEFAULT-SPEC is a font-spec object providing default font properties.
FONTLIST is an alist of script names vs the corresponding font names.

The font names are parsed and unspecified font properties are
given from DEFAULT-SPEC."
  (let ((prop-list '(:foundry :family :weight :slant :width :adstyle :size)))
    (dolist (elt fontlist)
      (let ((spec (font-spec :name (cadr elt))))
	(dolist (prop prop-list)
	  (let ((val (font-get spec prop)))
	    (or val
		(font-put spec prop (font-get default-spec prop)))))
	(setcar (cdr elt) spec)))
    fontlist))