comparison lisp/x-faces.el @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
201 201
202 (defun x-make-font-bold-italic (font &optional device) 202 (defun x-make-font-bold-italic (font &optional device)
203 "Given an X font specification, this attempts to make a `bold-italic' font. 203 "Given an X font specification, this attempts to make a `bold-italic' font.
204 If it fails, it returns nil." 204 If it fails, it returns nil."
205 ;; This is haired up to avoid loading the "intermediate" fonts. 205 ;; This is haired up to avoid loading the "intermediate" fonts.
206 (if *try-oblique-before-italic-fonts* 206 (if try-oblique-before-italic-fonts
207 (or (try-font-name 207 (or (try-font-name
208 (x-frob-font-slant (x-frob-font-weight font "bold") "o") device) 208 (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
209 (try-font-name 209 (try-font-name
210 (x-frob-font-slant (x-frob-font-weight font "bold") "i") device) 210 (x-frob-font-slant (x-frob-font-weight font "bold") "i") device)
211 (try-font-name 211 (try-font-name
490 (if (and (or (eq (face-name face) 'default) 490 (if (and (or (eq (face-name face) 'default)
491 (eq (face-name face) 'gui-element)) 491 (eq (face-name face) 'gui-element))
492 (or (null locale) (eq locale 'global))) 492 (or (null locale) (eq locale 'global)))
493 (progn 493 (progn
494 (or fn (setq fn (x-get-resource 494 (or fn (setq fn (x-get-resource
495 "font" "Font" 'string locale))) 495 "font" "Font" 'string locale nil 'warn)))
496 (or fg (setq fg (x-get-resource 496 (or fg (setq fg (x-get-resource
497 "foreground" "Foreground" 'string locale))) 497 "foreground" "Foreground" 'string locale nil
498 'warn)))
498 (or bg (setq bg (x-get-resource 499 (or bg (setq bg (x-get-resource
499 "background" "Background" 'string locale))))) 500 "background" "Background" 'string locale nil
501 'warn)))))
500 ;; 502 ;;
501 ;; "*cursorColor: foo" is equivalent to setting the background of the 503 ;; "*cursorColor: foo" is equivalent to setting the background of the
502 ;; text-cursor face. 504 ;; text-cursor face.
503 ;; 505 ;;
504 (if (and (eq (face-name face) 'text-cursor) 506 (if (and (eq (face-name face) 'text-cursor)
505 (or (null locale) (eq locale 'global))) 507 (or (null locale) (eq locale 'global)))
506 (setq bg (or (x-get-resource 508 (setq bg (or (x-get-resource
507 "cursorColor" "CursorColor" 'string locale) bg))) 509 "cursorColor" "CursorColor" 'string locale nil 'warn)
510 bg)))
508 ;; #### should issue warnings? I think this should be 511 ;; #### should issue warnings? I think this should be
509 ;; done when the instancing actually happens, but I'm not 512 ;; done when the instancing actually happens, but I'm not
510 ;; sure how it should actually be dealt with. 513 ;; sure how it should actually be dealt with.
511 (when fn 514 (when fn
512 (if device-class 515 (if device-class
733 736
734 ;; 737 ;;
735 ;; If reverseVideo was specified, swap the foreground and background 738 ;; If reverseVideo was specified, swap the foreground and background
736 ;; of the default and modeline faces. 739 ;; of the default and modeline faces.
737 ;; 740 ;;
738 (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame)) 741 (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame
742 nil 'warn))
739 ;; First make sure the modeline has fg and bg, inherited from the 743 ;; First make sure the modeline has fg and bg, inherited from the
740 ;; current default face - for the case where only one is specified, 744 ;; current default face - for the case where only one is specified,
741 ;; so that invert-face doesn't do something weird. 745 ;; so that invert-face doesn't do something weird.
742 (or (face-foreground 'modeline frame) 746 (or (face-foreground 'modeline frame)
743 (set-face-foreground 'modeline 747 (set-face-foreground 'modeline