import -ko -b 1.1.3 XEmacs XEmacs-21_2 r21-2-35
[chise/xemacs-chise.git.1] / lisp / x-faces.el
index 123fcc0..c3e35d7 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996 Ben Wing.
 
-;; Author: Jamie Zawinski <jwz@netscape.com>
+;; Author: Jamie Zawinski <jwz@jwz.org>
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: extensions, internal, dumped
 
@@ -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.
@@ -478,11 +492,13 @@ Otherwise, it returns the next larger version of this font that is defined."
             (or (null locale) (eq locale 'global)))
        (progn
          (or fn (setq fn (x-get-resource
-                          "font" "Font" 'string locale)))
+                          "font" "Font" 'string locale nil 'warn)))
          (or fg (setq fg (x-get-resource
-                          "foreground" "Foreground" 'string locale)))
+                          "foreground" "Foreground" 'string locale nil
+                          'warn)))
          (or bg (setq bg (x-get-resource
-                          "background" "Background" 'string locale)))))
+                          "background" "Background" 'string locale nil
+                          'warn)))))
     ;;
     ;; "*cursorColor: foo" is equivalent to setting the background of the
     ;; text-cursor face.
@@ -490,7 +506,8 @@ Otherwise, it returns the next larger version of this font that is defined."
     (if (and (eq (face-name face) 'text-cursor)
             (or (null locale) (eq locale 'global)))
        (setq bg (or (x-get-resource
-                     "cursorColor" "CursorColor" 'string locale) bg)))
+                     "cursorColor" "CursorColor" 'string locale nil 'warn)
+                    bg)))
     ;; #### should issue warnings?  I think this should be
     ;; done when the instancing actually happens, but I'm not
     ;; sure how it should actually be dealt with.
@@ -721,7 +738,8 @@ Otherwise, it returns the next larger version of this font that is defined."
   ;; If reverseVideo was specified, swap the foreground and background
   ;; of the default and modeline faces.
   ;;
-  (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame))
+  (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame
+                             nil 'warn))
         ;; First make sure the modeline has fg and bg, inherited from the
         ;; current default face - for the case where only one is specified,
         ;; so that invert-face doesn't do something weird.