diff lisp/international/fontset.el @ 22510:3c054c9dea07

(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.
author Karl Heuer <kwzh@gnu.org>
date Fri, 19 Jun 1998 16:54:41 +0000
parents c87830c691a5
children 3b18bf846d3c
line wrap: on
line diff
--- a/lisp/international/fontset.el	Fri Jun 19 16:53:40 1998 +0000
+++ b/lisp/international/fontset.el	Fri Jun 19 16:54:41 1998 +0000
@@ -417,6 +417,36 @@
   "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 @@
 
 	;; 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