From d96917194a122a7fee4f72f023c7d5df9ae359aa Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Fri, 19 Jun 1998 16:54:41 +0000 Subject: [PATCH] (x-style-funcs-alist): Fix the elements that call two x-... functions so they don't call the second if the first gives nil. (fontset-default-styles): New variable. (create-fontset-from-fontset-spec): Use fontset-default-styles. --- lisp/international/fontset.el | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 3944e481d94..365bc3f3921 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -417,6 +417,36 @@ FONTLIST is an alist of charsets vs font names to be used in FONSET.") "Alist of font style vs function to generate a X font name of the style. The function is called with one argument, a font name.") +(defconst x-style-funcs-alist + `((bold . x-make-font-bold) + (demibold . x-make-font-demibold) + (italic . x-make-font-italic) + (oblique . x-make-font-oblique) + (bold-italic . x-make-font-bold-italic) + (demibold-italic + . ,(function (lambda (x) + (let ((y (x-make-font-demibold x))) + (and y (x-make-font-italic y)))))) + (demibold-oblique + . ,(function (lambda (x) + (let ((y (x-make-font-demibold x))) + (and y (x-make-font-oblique y)))))) + (bold-oblique + . ,(function (lambda (x) + (let ((y (x-make-font-bold x))) + (and y (x-make-font-oblique y))))))) + "Alist of font style vs function to generate a X font name of the style. +The function is called with one argument, a font name.") + +(defcustom fontset-default-styles '(bold italic bold-italic) + "List of alternative styles to create for a fontset. +Valid elements include `bold', `demibold'; `italic', `oblique'; +and combinations of one from each group, +such as `bold-italic' and `demibold-oblique'." + :group 'faces + :type '(set bold demibold italic oblique bold-italic bold-oblique + demibold-italic demibold-oblique)) + (defun x-modify-font-name (fontname style) "Substitute style specification part of FONTNAME for STYLE. STYLE should be listed in the variable `x-style-funcs-alist'." @@ -488,7 +518,7 @@ signaled unless the optional 3rd argument NOERROR is non-nil." ;; At last, handle style variants. (if (eq style-variant t) - (setq style-variant (mapcar 'car x-style-funcs-alist))) + (setq style-variant fontset-default-styles)) (if style-variant ;; Generate fontset names of style variants and set them -- 2.39.2