annotate lisp/msw-faces.el @ 213:78f53ef88e17 r20-4b5

Import from CVS: tag r20-4b5
author cvs
date Mon, 13 Aug 2007 10:06:47 +0200
parents
children 1f0dabaa0855
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1 ;;; msw-faces.el --- mswindows-specific face stuff.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
2
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
3 ;;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
4 ;;; Copyright (C) 1995, 1996 Ben Wing.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
5
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
6 ;; Author: Jamie Zawinski
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
7 ;; Modified by: Chuck Thompson
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
8 ;; Modified by: Ben Wing
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
9 ;; Modified by: Martin Buchholz
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
10 ;; Rewritten for mswindows by: Jonathan Harris
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
11
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
12 ;; This file is part of XEmacs.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
13
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
14 ;; XEmacs is free software; you can redistribute it and/or modify it
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
15 ;; under the terms of the GNU General Public License as published by
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
17 ;; any later version.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
18
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
19 ;; XEmacs is distributed in the hope that it will be useful, but
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
22 ;; General Public License for more details.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
23
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
25 ;; along with XEmacs; see the file COPYING. If not, write to the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
27 ;; Boston, MA 02111-1307, USA.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
28
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
29 ;; This file does the magic to parse mswindows font names, and make sure that the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
30 ;; default and modeline attributes of new frames are specified enough.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
31
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
32 (defun mswindows-init-global-faces ()
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
33 )
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
34
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
35 ;;; ensure that the default face has some reasonable fallbacks if nothing
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
36 ;;; else is specified.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
37 (defun mswindows-init-device-faces (device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
38 (or (face-font 'default 'global)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
39 (set-face-font 'default "Courier New:Regular:10")
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
40 'global)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
41 (or (face-foreground 'default 'global)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
42 (set-face-foreground 'default "black" 'global 'mswindows))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
43 (or (face-background 'default 'global)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
44 (set-face-background 'default "white" 'global 'mswindows))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
45 (or (face-background 'modeline 'global)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
46 (set-face-background 'modeline "grey75" 'global 'mswindows))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
47 )
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
48
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
49
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
50 (defun mswindows-init-frame-faces (frame)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
51 )
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
52
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
53
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
54 ;;; Fill in missing parts of a font spec. This is primarily intended as a
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
55 ;;; helper function for the functions below.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
56 ;;; mswindows fonts look like:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
57 ;;; fontname[:[weight ][style][:pointsize[:effects[:charset]]]]
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
58 ;;; A minimal mswindows font spec looks like:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
59 ;;; Courier New
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
60 ;;; A maximal mswindows font spec looks like:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
61 ;;; Courier New:Bold Italic:10:underline strikeout:ansi
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
62 ;;; Missing parts of the font spec should be filled in with these values:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
63 ;;; Courier New:Normal:10::ansi
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
64 (defun mswindows-canicolize-font (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
65 "Given a mswindows font specification, this converts it to canonical form."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
66 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
67
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
68 (defun mswindows-make-font-bold (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
69 "Given a mswindows font specification, this attempts to make a bold font.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
70 If it fails, it returns nil."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
71 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
72
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
73 (defun mswindows-make-font-unbold (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
74 "Given a mswindows font specification, this attempts to make a non-bold font.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
75 If it fails, it returns nil."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
76 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
77
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
78 (defun mswindows-make-font-italic (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
79 "Given a mswindows font specification, this attempts to make an `italic' font.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
80 If it fails, it returns nil."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
81 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
82
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
83 (defun mswindows-make-font-unitalic (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
84 "Given a mswindows font specification, this attempts to make a non-italic font.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
85 If it fails, it returns nil."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
86 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
87
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
88 (defun mswindows-make-font-bold-italic (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
89 "Given a mswindows font specification, this attempts to make a `bold-italic'
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
90 font. If it fails, it returns nil."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
91 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
92
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
93 (defun mswindows-find-smaller-font (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
94 "Loads a new, version of the given font (or font name).
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
95 Returns the font if it succeeds, nil otherwise.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
96 If scalable fonts are available, this returns a font which is 1 point smaller.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
97 Otherwise, it returns the next smaller version of this font that is defined."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
98 nil)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
99
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
100 (defun mswindows-find-larger-font (font &optional device)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
101 "Loads a new, slightly larger version of the given font (or font name).
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
102 Returns the font if it succeeds, nil otherwise.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
103 If scalable fonts are available, this returns a font which is 1 point larger.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
104 Otherwise, it returns the next larger version of this font that is defined."
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
105 nil)