Function: create-fontset-from-ascii-font
create-fontset-from-ascii-font is a byte-compiled function defined in
fontset.el.gz.
Signature
(create-fontset-from-ascii-font FONT &optional RESOLVED-FONT FONTSET-NAME)
Documentation
Create a fontset from an ASCII font FONT.
Optional 2nd arg RESOLVED-FONT is a resolved name of FONT.
If omitted, x-resolve-font-name is called to get the resolved name.
At this time, if FONT is not available, an error is signaled.
Optional 3rd arg FONTSET-NAME is a string to be used in
<CHARSET_ENCODING> fields of a new fontset name. If it is omitted,
an appropriate name is generated automatically.
It returns a name of the created fontset.
Source Code
;; Defined in /usr/src/emacs/lisp/international/fontset.el.gz
(defun create-fontset-from-ascii-font (font &optional resolved-font
fontset-name)
"Create a fontset from an ASCII font FONT.
Optional 2nd arg RESOLVED-FONT is a resolved name of FONT.
If omitted, `x-resolve-font-name' is called to get the resolved name.
At this time, if FONT is not available, an error is signaled.
Optional 3rd arg FONTSET-NAME is a string to be used in
`<CHARSET_ENCODING>' fields of a new fontset name. If it is omitted,
an appropriate name is generated automatically.
It returns a name of the created fontset."
(setq font (downcase font))
(setq resolved-font
(downcase (or resolved-font (x-resolve-font-name font))))
(let ((xlfd (x-decompose-font-name resolved-font))
fontset)
(if fontset-name
(setq fontset-name (downcase fontset-name))
(if (query-fontset "fontset-startup")
(setq fontset-name
(subst-char-in-string
?- ?_ (aref xlfd xlfd-regexp-registry-subnum) t))
(setq fontset-name "startup")))
(aset xlfd xlfd-regexp-registry-subnum
(format "fontset-%s" fontset-name))
(setq fontset (x-compose-font-name xlfd))
(or (query-fontset fontset)
(create-fontset-from-fontset-spec (concat fontset ", ascii:" font)))))