comparison lisp/x-faces.el @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 8bec6624d99b
children 7d59cb494b73
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
200 200
201 (defun x-make-font-bold-italic (font &optional device) 201 (defun x-make-font-bold-italic (font &optional device)
202 "Given an X font specification, this attempts to make a `bold-italic' font. 202 "Given an X font specification, this attempts to make a `bold-italic' font.
203 If it fails, it returns nil." 203 If it fails, it returns nil."
204 ;; This is haired up to avoid loading the "intermediate" fonts. 204 ;; This is haired up to avoid loading the "intermediate" fonts.
205 (if *try-oblique-before-italic-fonts* 205 (or (try-font-name
206 (or (try-font-name 206 (x-frob-font-slant (x-frob-font-weight font "bold") "i") device)
207 (x-frob-font-slant (x-frob-font-weight font "bold") "o") device) 207 (try-font-name
208 (try-font-name 208 (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
209 (x-frob-font-slant (x-frob-font-weight font "bold") "i") device) 209 (try-font-name
210 (try-font-name 210 (x-frob-font-slant (x-frob-font-weight font "black") "i") device)
211 (x-frob-font-slant (x-frob-font-weight font "black") "o") device) 211 (try-font-name
212 (try-font-name 212 (x-frob-font-slant (x-frob-font-weight font "black") "o") device)
213 (x-frob-font-slant (x-frob-font-weight font "black") "i") device) 213 (try-font-name
214 (try-font-name 214 (x-frob-font-slant (x-frob-font-weight font "demibold") "i") device)
215 (x-frob-font-slant (x-frob-font-weight font "demibold") "o") device) 215 (try-font-name
216 (try-font-name 216 (x-frob-font-slant (x-frob-font-weight font "demibold") "o") device)))
217 (x-frob-font-slant (x-frob-font-weight font "demibold") "i") device))
218 (or (try-font-name
219 (x-frob-font-slant (x-frob-font-weight font "bold") "i") device)
220 (try-font-name
221 (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
222 (try-font-name
223 (x-frob-font-slant (x-frob-font-weight font "black") "i") device)
224 (try-font-name
225 (x-frob-font-slant (x-frob-font-weight font "black") "o") device)
226 (try-font-name
227 (x-frob-font-slant (x-frob-font-weight font "demibold") "i") device)
228 (try-font-name
229 (x-frob-font-slant (x-frob-font-weight font "demibold") "o") device))))
230 217
231 (defun x-font-size (font) 218 (defun x-font-size (font)
232 "Return the nominal size of the given font. 219 "Return the nominal size of the given font.
233 This is done by parsing its name, so it's likely to lose. 220 This is done by parsing its name, so it's likely to lose.
234 X fonts can be specified (by the user) in either pixels or 10ths of points, 221 X fonts can be specified (by the user) in either pixels or 10ths of points,
517 x-tag-set) 504 x-tag-set)
518 ;; If there's no device class then we're initializing 505 ;; If there's no device class then we're initializing
519 ;; globally. This means we should override global 506 ;; globally. This means we should override global
520 ;; defaults for all X device classes. 507 ;; defaults for all X device classes.
521 (remove-specifier (face-font face) locale x-tag-set nil)) 508 (remove-specifier (face-font face) locale x-tag-set nil))
522 (set-face-font face fn locale 'x append)) 509 (set-face-font face fn locale nil append))
523 ;; Kludge-o-rooni. Set the foreground and background resources for 510 ;; Kludge-o-rooni. Set the foreground and background resources for
524 ;; X devices only -- otherwise things tend to get all messed up 511 ;; X devices only -- otherwise things tend to get all messed up
525 ;; if you start up an X frame and then later create a TTY frame. 512 ;; if you start up an X frame and then later create a TTY frame.
526 (when fg 513 (when fg
527 (if device-class 514 (if device-class
613 ;;; specified. 600 ;;; specified.
614 ;;; 601 ;;;
615 (defun x-init-global-faces () 602 (defun x-init-global-faces ()
616 (or (face-font 'default 'global) 603 (or (face-font 'default 'global)
617 (set-face-font 'default 604 (set-face-font 'default
618 "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" 605 "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*")
619 'global '(x default))) 606 'global)
620 (or (face-foreground 'default 'global) 607 (or (face-foreground 'default 'global)
621 (set-face-foreground 'default "black" 'global '(x default))) 608 (set-face-foreground 'default "black" 'global 'x))
622 (or (face-background 'default 'global) 609 (or (face-background 'default 'global)
623 (set-face-background 'default "gray80" 'global '(x default)))) 610 (set-face-background 'default "gray80" 'global 'x)))
624 611
625 ;;; x-init-device-faces is responsible for initializing default 612 ;;; x-init-device-faces is responsible for initializing default
626 ;;; values for faces on a newly created device. 613 ;;; values for faces on a newly created device.
627 ;;; 614 ;;;
628 (defun x-init-device-faces (device) 615 (defun x-init-device-faces (device)