Contents in 1999-06-04-13 of release-21-2.
[chise/xemacs-chise.git.1] / lisp / x-faces.el
index 21895c3..46677cf 100644 (file)
@@ -176,18 +176,19 @@ If it fails, it returns nil."
 If it fails, it returns nil."
   (try-font-name (x-frob-font-weight font "medium") device))
 
-(defcustom *try-oblique-before-italic-fonts* nil
+(defcustom try-oblique-before-italic-fonts nil
   "*If nil, italic fonts are searched before oblique fonts.
 If non-nil, oblique fonts are tried before italic fonts.  This is mostly
 applicable to adobe-courier fonts"
   :type 'boolean
-  :tag "Try Oblique Before Italic Fonts"
   :group 'x)
+(define-obsolete-variable-alias '*try-oblique-before-italic-fonts*
+  'try-oblique-before-italic-fonts)
 
 (defun x-make-font-italic (font &optional device)
   "Given an X font specification, this attempts to make an `italic' font.
 If it fails, it returns nil."
-  (if *try-oblique-before-italic-fonts*
+  (if try-oblique-before-italic-fonts
       (or (try-font-name (x-frob-font-slant font "o") device)
          (try-font-name (x-frob-font-slant font "i") device))
     (or (try-font-name (x-frob-font-slant font "i") device)
@@ -202,18 +203,31 @@ If it fails, it returns nil."
   "Given an X font specification, this attempts to make a `bold-italic' font.
 If it fails, it returns nil."
   ;; This is haired up to avoid loading the "intermediate" fonts.
-  (or (try-font-name
-       (x-frob-font-slant (x-frob-font-weight font "bold") "i") device)
-      (try-font-name
-       (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
-      (try-font-name
-       (x-frob-font-slant (x-frob-font-weight font "black") "i") device)
-      (try-font-name
-       (x-frob-font-slant (x-frob-font-weight font "black") "o") device)
-      (try-font-name
-       (x-frob-font-slant (x-frob-font-weight font "demibold") "i") device)
-      (try-font-name
-       (x-frob-font-slant (x-frob-font-weight font "demibold") "o") device)))
+  (if *try-oblique-before-italic-fonts*
+      (or (try-font-name
+          (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
+         (try-font-name
+          (x-frob-font-slant (x-frob-font-weight font "bold") "i") device)
+         (try-font-name
+          (x-frob-font-slant (x-frob-font-weight font "black") "o") device)
+         (try-font-name
+          (x-frob-font-slant (x-frob-font-weight font "black") "i") device)
+         (try-font-name
+          (x-frob-font-slant (x-frob-font-weight font "demibold") "o") device)
+         (try-font-name
+          (x-frob-font-slant (x-frob-font-weight font "demibold") "i") device))
+    (or (try-font-name
+        (x-frob-font-slant (x-frob-font-weight font "bold") "i") device)
+       (try-font-name
+        (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
+       (try-font-name
+        (x-frob-font-slant (x-frob-font-weight font "black") "i") device)
+       (try-font-name
+        (x-frob-font-slant (x-frob-font-weight font "black") "o") device)
+       (try-font-name
+        (x-frob-font-slant (x-frob-font-weight font "demibold") "i") device)
+       (try-font-name
+        (x-frob-font-slant (x-frob-font-weight font "demibold") "o") device))))
 
 (defun x-font-size (font)
   "Return the nominal size of the given font.
@@ -506,7 +520,7 @@ Otherwise, it returns the next larger version of this font that is defined."
        ;; globally.  This means we should override global
        ;; defaults for all X device classes.
        (remove-specifier (face-font face) locale x-tag-set nil))
-      (set-face-font face fn locale nil append))
+      (set-face-font face fn locale 'x append))
     ;; Kludge-o-rooni.  Set the foreground and background resources for
     ;; X devices only -- otherwise things tend to get all messed up
     ;; if you start up an X frame and then later create a TTY frame.
@@ -602,12 +616,12 @@ Otherwise, it returns the next larger version of this font that is defined."
 (defun x-init-global-faces ()
   (or (face-font 'default 'global)
       (set-face-font 'default
-                    "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*")
-      'global)
+                    "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*"
+                    'global '(x default)))
   (or (face-foreground 'default 'global)
-      (set-face-foreground 'default "black" 'global 'x))
+      (set-face-foreground 'default "black" 'global '(x default)))
   (or (face-background 'default 'global)
-      (set-face-background 'default "gray80" 'global 'x)))
+      (set-face-background 'default "gray80" 'global '(x default))))
 
 ;;; x-init-device-faces is responsible for initializing default
 ;;; values for faces on a newly created device.