Function: x-decompose-font-name
x-decompose-font-name is a byte-compiled function defined in
fontset.el.gz.
Signature
(x-decompose-font-name PATTERN)
Documentation
Decompose PATTERN into XLFD fields and return a vector of the fields.
The length of the vector is 12. The FOUNDRY and FAMILY fields are concatenated and stored in the first element of the vector. The REGISTRY and ENCODING fields are concatenated and stored in the last element of the vector.
Return nil if PATTERN doesn't conform to XLFD.
Source Code
;; Defined in /usr/src/emacs/lisp/international/fontset.el.gz
(defun x-decompose-font-name (pattern)
"Decompose PATTERN into XLFD fields and return a vector of the fields.
The length of the vector is 12.
The FOUNDRY and FAMILY fields are concatenated and stored in the first
element of the vector.
The REGISTRY and ENCODING fields are concatenated and stored in the last
element of the vector.
Return nil if PATTERN doesn't conform to XLFD."
(if (string-match xlfd-tight-regexp pattern)
(let ((xlfd-fields (make-vector 12 nil)))
(dotimes (i 12)
(aset xlfd-fields i (match-string (1+ i) pattern)))
(dotimes (i 12)
(if (string-match "^[*-]+$" (aref xlfd-fields i))
(aset xlfd-fields i nil)))
xlfd-fields)))