comparison lisp/msw-faces.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents a86b2b5e0111
children da8ed4261e83
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
27 ;; Boston, MA 02111-1307, USA. 27 ;; Boston, MA 02111-1307, USA.
28 28
29 ;; This file does the magic to parse mswindows font names, and make sure that 29 ;; This file does the magic to parse mswindows font names, and make sure that
30 ;; the default and modeline attributes of new frames are specified enough. 30 ;; the default and modeline attributes of new frames are specified enough.
31 31
32 ;;; Force creation of the default face font so that if it fails we get an
33 ;;; error now instead of a crash at frame creation.
32 (defun mswindows-init-device-faces (device) 34 (defun mswindows-init-device-faces (device)
33 (let ((color-default (device-system-metric device 'color-default)) 35 (unless (face-font-instance 'default device)
34 (color-3d-face (device-system-metric device 'color-3d-face))) 36 (error "Can't find a suitable default font")))
35 ; Force creation of the default face font so that if it fails we get 37
36 ; an error now instead of a crash at frame creation.
37 (unless (face-font-instance 'default device)
38 (error "Can't find a suitable default font"))
39
40 (if (car color-default)
41 (set-face-foreground 'default (car color-default)) device)
42 (if (cdr color-default)
43 (set-face-background 'default (cdr color-default)) device)
44 (if (car color-3d-face)
45 (set-face-foreground 'gui-element (car color-3d-face)) device)
46 (if (cdr color-3d-face)
47 (set-face-background 'gui-element (cdr color-3d-face)) device)
48 (set-face-font 'gui-element "MS Sans Serif:Regular:8" device)))
49 38
50 (defun mswindows-init-frame-faces (frame) 39 (defun mswindows-init-frame-faces (frame)
51 ) 40 )
52 41
53 ;; Other functions expect these regexps
54 (defconst mswindows-font-regexp
55 (let
56 ((- ":")
57 (fontname "\\([a-zA-Z ]+\\)")
58 (weight "\\([a-zA-Z]*\\)?")
59 (style "\\( [a-zA-Z]*\\)?")
60 (pointsize "\\([0-9]+\\)?")
61 (effects "\\([a-zA-Z ]*\\)?")
62 (charset "\\([a-zA-Z 0-9]*\\)")
63 )
64 (concat "^"
65 fontname - weight style - pointsize - effects - charset "$")))
66 42
67 ;;; Fill in missing parts of a font spec. This is primarily intended as a 43 ;;; Fill in missing parts of a font spec. This is primarily intended as a
68 ;;; helper function for the functions below. 44 ;;; helper function for the functions below.
69 ;;; mswindows fonts look like: 45 ;;; mswindows fonts look like:
70 ;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset] 46 ;;; fontname[:[weight][ style][:pointsize[:effects]]][:charset]