annotate lisp/x11/x-font-menu.el @ 207:e45d5e7c476e r20-4b2

Import from CVS: tag r20-4b2
author cvs
date Mon, 13 Aug 2007 10:03:52 +0200
parents a2f645c6b9f8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;; x-font-menu.el --- Managing menus of X fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
5 ;; Copyright (C) 1997 Sun Microsystems
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents: 88
diff changeset
7 ;; Author: Jamie Zawinski <jwz@netscape.com>
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Restructured by: Jonathan Stigelman <Stig@hackvan.com>
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
9 ;; Mule-ized by: Martin Buchholz
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
25 ;; Free Software Foundation, 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
26 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Creates three menus, "Font", "Size", and "Weight", and puts them on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; "Options" menu. The contents of these menus are the superset of those
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; properties available on any fonts, but only the intersection of the three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; sets is selectable at one time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; Known Problems:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;; ===============
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;; Items on the Font menu are selectable if and only if that font exists in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;; the same size and weight as the current font. This means that some fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; are simply not reachable from some other fonts - if only one font comes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; in only one point size (like "Nil", which comes only in 2), you will never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;;; be able to select it. It would be better if the items on the Fonts menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;;; were always selectable, and selecting them would set the size to be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; closest size to the current font's size.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; This attempts to change all other faces in an analagous way to the change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;;; that was made to the default face; if it can't, it will skip over the face.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;;; However, this could leave incongruous font sizes around, which may cause
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;;; some nonreversibility problems if further changes are made. Perhaps it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;;; should remember the initial fonts of all faces, and derive all subsequent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;; fonts from that initial state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;;; xfontsel(1) is a lot more flexible (but probably harder to understand).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;; The code to construct menus from all of the x11 fonts available from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;; server is autoloaded and executed the very first time that one of the Font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;; menus is selected on each device. That is, if XEmacs has frames on two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;;; different devices, then separate font menu information will be maintained
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;;; for each X display. If the font path changes after emacs has already
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;; asked the X server on a particular display for its list of fonts, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;;; won't notice. Also, the first time that a font menu is posted on each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;;; display will entail a lengthy delay, but that's better than slowing down
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;;; XEmacs startup. At any time (i.e.: after a font-path change or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;;; immediately after device creation), you can call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;; `reset-device-font-menus' to rebuild the menus from all currently
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;;; available fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;;
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
67 ;;; There is knowledge here about the regexp match numbers in
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
68 ;;; `x-font-regexp' and `x-font-regexp-foundry-and-family' defined in
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
69 ;;; x-faces.el.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;;; There are at least three kinds of fonts under X11r5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;;; - bitmap fonts, which can be assumed to look as good as possible;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;;; - bitmap fonts which have been (or can be) automatically scaled to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;; a new size, and which almost always look awful;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
76 ;;; - and true outline fonts, which should look ok at any size, but in
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;;; practice (on at least some systems) look awful at any size, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;;; even in theory are unlikely ever to look as good as non-scaled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;;; bitmap fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;;; It would be nice to get this code to look for non-scaled bitmap fonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;;; first, then outline fonts, then scaled bitmap fonts as a last resort.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ;;; But it's not clear to me how to tell them apart based on their truenames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;;; and/or the result of XListFonts(). I welcome any and all explanations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ;;; of the subtleties involved...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;;; If You Think You'Re Seeing A Bug:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;;; =================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;;; When reporting problems, send the following information:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;;; - Exactly what behavior you're seeing;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;;; - The output of the `xlsfonts' program;
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
94 ;;; - The value of the variable `device-fonts-cache';
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ;;; - The values of the following expressions, both before and after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;;; making a selection from any of the fonts-related menus:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;;; (face-font 'default)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
98 ;;; (font-truename (face-font 'default))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
99 ;;; (font-properties (face-font 'default))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;;; - The values of the following variables after making a selection:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;;; font-menu-preferred-resolution
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
102 ;;; font-menu-registry-encoding
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;;; There is a common misconception that "*-courier-medium-r-*-11-*", also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;;; known as "-adobe-courier-medium-r-normal--11-80-100-100-m-60-iso8859-1",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;;; is an 11-point font. It is not -- it is an 11-pixel font at 100dpi,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ;;; which is an 8-point font (the number after -11- is the size in tenths
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;;; of points). So if you expect to be seeing an "11" entry in the "Size"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;;; menu and are not, this may be why.
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
110 ;;;
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
111 ;;; In the real world (aka Solaris), one has to deal with fonts that
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
112 ;;; appear to be medium-i but are really light-r, and fonts that
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
113 ;;; resolve to different resolutions depending on the charset:
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
114 ;;;
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
115 ;;; (font-instance-truename
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
116 ;;; (make-font-instance "-*-mincho-medium-i-normal-*-*-*-*-*-*-*-jisx0201*-*"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
117 ;;; ==>
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
118 ;;; "-morisawa-ryumin light kl-light-r-normal--10-100-72-72-m-50-jisx0201.1976-0"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
119 ;;;
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
120 ;;; (list-fonts "-dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
121 ;;; ==>
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
122 ;;; ("-dt-interface user-medium-r-normal-s sans-12-120-72-72-m-70-iso8859-1"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
123 ;;; "-dt-interface user-medium-r-normal-s-14-120-75-75-m-120-jisx0208.1983-0"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
124 ;;; "-dt-interface user-medium-r-normal-s-14-120-75-75-m-60-jisx0201.1976-0")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; #### - implement these...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;;; (defvar font-menu-ignore-proportional-fonts nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;;; "*If non-nil, then the font menu will only show fixed-width fonts.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;;;###autoload
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
134 (defcustom font-menu-ignore-scaled-fonts t
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
135 "*If non-nil, then the font menu will try to show only bitmap fonts."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
136 :type 'boolean
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
137 :group 'x)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;;###autoload
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
140 (defcustom font-menu-this-frame-only-p nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 "*If non-nil, then changing the default font from the font menu will only
195
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
142 affect one frame instead of all frames."
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
143 :type 'boolean
a2f645c6b9f8 Import from CVS: tag r20-3b24
cvs
parents: 149
diff changeset
144 :group 'x)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; only call XListFonts (and parse) once per device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ;; ( (device . [parsed-list-fonts family-menu size-menu weight-menu]) ...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (defvar device-fonts-cache nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
150 (defvar font-menu-registry-encoding nil
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
151 "Registry and encoding to use with font menu fonts.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
153 (defvar font-menu-preferred-resolution "*-*"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
154 "Preferred horizontal and vertical font menu resolution (e.g. \"75-75\").")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
155
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
156 (defvar fonts-menu-junk-families
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (mapconcat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 '("cursor" "glyph" "symbol" ; Obvious losers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "\\`Ax...\\'" ; FrameMaker fonts - there are just way too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ; many of these, and there is a different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ; font family for each font face! Losers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 ; "Axcor" -> "Applix Courier Roman",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ; "Axcob" -> "Applix Courier Bold", etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 "\\|"))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
168 "A regexp matching font families which are uninteresting (e.g. cursor fonts).")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
170 (eval-when-compile
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
171 (defsubst device-fonts-cache ()
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
172 (or (cdr (assq (selected-device) device-fonts-cache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
173 (reset-device-font-menus (selected-device)))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
174
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (defun hack-font-truename (fn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 "Filter the output of `font-instance-truename' to deal with Japanese fontsets."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (if (string-match "," (font-instance-truename fn))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (let ((fpnt (nth 8 (split-string (font-instance-name fn) "-")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (flist (split-string (font-instance-truename fn) ","))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ret)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (while flist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (if (string-equal fpnt (nth 8 (split-string (car flist) "-")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (progn (setq ret (car flist)) (setq flist nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (setq flist (cdr flist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ret)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (font-instance-truename fn)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (fset 'install-font-menus 'reset-device-font-menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (make-obsolete 'install-font-menus 'reset-device-font-menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
193 (defvar x-font-regexp-ascii nil
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
194 "This is used to filter out font families that can't display ASCII text.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 It must be set at run-time.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defun vassoc (key valist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 "Search VALIST for a vector whose first element is equal to KEY.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 See also `assoc'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ;; by Stig@hackvan.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (let (el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (catch 'done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (while (setq el (pop valist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (and (equal key (aref el 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (throw 'done el))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defun reset-device-font-menus (&optional device debug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 "Generates the `Font', `Size', and `Weight' submenus for the Options menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 This is run the first time that a font-menu is needed for each device.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 If you don't like the lazy invocation of this function, you can add it to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 `create-device-hook' and that will make the font menus respond more quickly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 when they are selected for the first time. If you add fonts to your system,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 or if you change your font path, you can call this to re-initialize the menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ;; by Stig@hackvan.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;; #### - this should implement a `menus-only' option, which would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ;; recalculate the menus from the cache w/o having to do list-fonts again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (message "Getting list of fonts from server... ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (if (or noninteractive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (not (or device (setq device (selected-device))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (not (eq (device-type device) 'x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 nil
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
223 (unless x-font-regexp-ascii
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 86
diff changeset
224 (setq x-font-regexp-ascii (if (featurep 'mule)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
225 (charset-registry 'ascii)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
226 "iso8859-1")))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
227 (setq font-menu-registry-encoding
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
228 (if (featurep 'mule) "*-*" "iso8859-1"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
229 (let ((case-fold-search t)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
230 family size weight entry monospaced-p
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
231 dev-cache cache families sizes weights)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
232 (dolist (name (cond ((null debug) ; debugging kludge
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
233 (list-fonts "*-*-*-*-*-*-*-*-*-*-*-*-*-*" device))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
234 ((stringp debug) (split-string debug "\n"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
235 (t debug)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
236 (when (and (string-match x-font-regexp-ascii name)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
237 (string-match x-font-regexp name))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
238 (setq weight (capitalize (match-string 1 name))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
239 size (string-to-int (match-string 6 name)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
240 (or (string-match x-font-regexp-foundry-and-family name)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
241 (error "internal error"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
242 (setq family (capitalize (match-string 1 name)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
243 (or (string-match x-font-regexp-spacing name)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
244 (error "internal error"))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
245 (setq monospaced-p (string= "m" (match-string 1 name)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
246 (unless (string-match fonts-menu-junk-families family)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
247 (setq entry (or (vassoc family cache)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
248 (car (setq cache
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
249 (cons (vector family nil nil t)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
250 cache)))))
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
251 (or (member family families) (push family families))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
252 (or (member weight weights) (push weight weights))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
253 (or (member size sizes) (push size sizes))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
254 (or (member weight (aref entry 1)) (push weight (aref entry 1)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
255 (or (member size (aref entry 2)) (push size (aref entry 2)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
256 (aset entry 3 (and (aref entry 3) monospaced-p)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ;; Hack scalable fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ;; Some fonts come only in scalable versions (the only size is 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;; and some fonts come in both scalable and non-scalable versions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;; (one size is 0). If there are any scalable fonts at all, make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; sure that the union of all point sizes contains at least some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; common sizes - it's possible that some sensible sizes might end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; up not getting mentioned explicitly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (if (member 0 sizes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (let ((common '(60 80 100 120 140 160 180 240)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (while common
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (or;;(member (car common) sizes) ; not enough slack
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (let ((rest sizes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (done nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (while (and (not done) rest)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (if (and (> (car common) (- (car rest) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (< (car common) (+ (car rest) 5)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (setq done t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (setq rest (cdr rest)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 done)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (setq sizes (cons (car common) sizes)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (setq common (cdr common)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (setq sizes (delq 0 sizes))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (setq families (sort families 'string-lessp)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
283 weights (sort weights 'string-lessp)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
284 sizes (sort sizes '<))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
286 (dolist (entry cache)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
287 (aset entry 1 (sort (aref entry 1) 'string-lessp))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
288 (aset entry 2 (sort (aref entry 2) '<)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (message "Getting list of fonts from server... done.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (setq dev-cache (assq device device-fonts-cache))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (or dev-cache
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (setq dev-cache (car (push (list device) device-fonts-cache))))
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
295 (setcdr
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
296 dev-cache
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
297 (vector
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
298 cache
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
299 (mapcar (lambda (x)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
300 (vector x
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
301 (list 'font-menu-set-font x nil nil)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
302 ':style 'radio ':active nil ':selected nil))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
303 families)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
304 (mapcar (lambda (x)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
305 (vector (if (/= 0 (% x 10))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
306 ;; works with no LISP_FLOAT_TYPE
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
307 (concat (int-to-string (/ x 10)) "."
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
308 (int-to-string (% x 10)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
309 (int-to-string (/ x 10)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
310 (list 'font-menu-set-font nil nil x)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
311 ':style 'radio ':active nil ':selected nil))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
312 sizes)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
313 (mapcar (lambda (x)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
314 (vector x
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
315 (list 'font-menu-set-font nil x nil)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
316 ':style 'radio ':active nil ':selected nil))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
317 weights)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (cdr dev-cache))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
320 ;; Extract font information from a face. We examine both the
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
321 ;; user-specified font name and the canonical (`true') font name.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
322 ;; These can appear to have totally different properties.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
323 ;; For examples, see the prolog above.
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
324
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
325 ;; We use the user-specified one if possible, else use the truename.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
326 ;; If the user didn't specify one (with "-dt-*-*", for example)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
327 ;; get the truename and use the possibly suboptimal data from that.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
328 (defun* font-menu-font-data (face dcache)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
329 (let* ((case-fold-search t)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
330 (domain (if font-menu-this-frame-only-p
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
331 (selected-frame)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
332 (selected-device)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
333 (name (font-instance-name (face-font-instance face domain)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
334 (truename (font-instance-truename
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
335 (face-font-instance face domain
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
336 (if (featurep 'mule) 'ascii))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
337 family size weight entry slant)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
338 (when (string-match x-font-regexp-foundry-and-family name)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
339 (setq family (capitalize (match-string 1 name)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
340 (setq entry (vassoc family (aref dcache 0))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
341 (when (and (null entry)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
342 (string-match x-font-regexp-foundry-and-family truename))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
343 (setq family (capitalize (match-string 1 truename)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
344 (setq entry (vassoc family (aref dcache 0))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
345 (when (null entry)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
346 (return-from font-menu-font-data (make-vector 5 nil)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
347
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
348 (when (string-match x-font-regexp name)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
349 (setq weight (capitalize (match-string 1 name)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
350 (setq size (string-to-int (match-string 6 name))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
351
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
352 (when (string-match x-font-regexp truename)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
353 (when (not (member weight (aref entry 1)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
354 (setq weight (capitalize (match-string 1 truename))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
355 (when (not (member size (aref entry 2)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
356 (setq size (string-to-int (match-string 6 truename))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
357 (setq slant (capitalize (match-string 2 truename))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
358
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
359 (vector entry family size weight slant)))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
360
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (defun font-menu-family-constructor (ignored)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
363 (catch 'menu
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
364 (unless (eq 'x (device-type (selected-device)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
365 (throw 'menu '(["Cannot parse current font" ding nil])))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
366 (let* ((dcache (device-fonts-cache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
367 (font-data (font-menu-font-data 'default dcache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
368 (entry (aref font-data 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
369 (family (aref font-data 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
370 (size (aref font-data 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
371 (weight (aref font-data 3))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 76
diff changeset
372 f)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
373 (unless family
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
374 (throw 'menu '(["Cannot parse current font" ding nil])))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
375 ;; Items on the Font menu are enabled iff that font exists in
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
376 ;; the same size and weight as the current font (scalable fonts
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
377 ;; exist in every size). Only the current font is marked as
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
378 ;; selected.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
379 (mapcar
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
380 (lambda (item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
381 (setq f (aref item 0)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
382 entry (vassoc f (aref dcache 0)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
383 (if (and (member weight (aref entry 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
384 (or (member size (aref entry 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
385 (and (not font-menu-ignore-scaled-fonts)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
386 (member 0 (aref entry 2)))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
387 (enable-menu-item item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
388 (disable-menu-item item))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
389 (if (string-equal family f)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
390 (select-toggle-menu-item item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
391 (deselect-toggle-menu-item item))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
392 item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
393 (aref dcache 1)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (defun font-menu-size-constructor (ignored)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
397 (catch 'menu
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
398 (unless (eq 'x (device-type (selected-device)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
399 (throw 'menu '(["Cannot parse current font" ding nil])))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
400 (let* ((dcache (device-fonts-cache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
401 (font-data (font-menu-font-data 'default dcache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
402 (entry (aref font-data 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
403 (family (aref font-data 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
404 (size (aref font-data 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
405 ;;(weight (aref font-data 3))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
406 s)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
407 (unless family
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
408 (throw 'menu '(["Cannot parse current font" ding nil])))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
409 ;; Items on the Size menu are enabled iff current font has
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
410 ;; that size. Only the size of the current font is selected.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
411 ;; (If the current font comes in size 0, it is scalable, and
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
412 ;; thus has every size.)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
413 (mapcar
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
414 (lambda (item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
415 (setq s (nth 3 (aref item 1)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
416 (if (or (member s (aref entry 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
417 (and (not font-menu-ignore-scaled-fonts)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
418 (member 0 (aref entry 2))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
419 (enable-menu-item item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
420 (disable-menu-item item))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
421 (if (eq size s)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
422 (select-toggle-menu-item item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
423 (deselect-toggle-menu-item item))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
424 item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
425 (aref dcache 2)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (defun font-menu-weight-constructor (ignored)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
429 (catch 'menu
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
430 (unless (eq 'x (device-type (selected-device)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
431 (throw 'menu '(["Cannot parse current font" ding nil])))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
432 (let* ((dcache (device-fonts-cache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
433 (font-data (font-menu-font-data 'default dcache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
434 (entry (aref font-data 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
435 (family (aref font-data 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
436 ;;(size (aref font-data 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
437 (weight (aref font-data 3))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
438 w)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
439 (unless family
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
440 (throw 'menu '(["Cannot parse current font" ding nil])))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
441 ;; Items on the Weight menu are enabled iff current font
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
442 ;; has that weight. Only the weight of the current font
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
443 ;; is selected.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
444 (mapcar
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
445 (lambda (item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
446 (setq w (aref item 0))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
447 (if (member w (aref entry 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
448 (enable-menu-item item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
449 (disable-menu-item item))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
450 (if (string-equal weight w)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
451 (select-toggle-menu-item item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
452 (deselect-toggle-menu-item item))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
453 item)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
454 (aref dcache 3)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 ;;; Changing font sizes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (defun font-menu-set-font (family weight size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 ;; This is what gets run when an item is selected from any of the three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 ;; fonts menus. It needs to be rather clever.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 ;; (size is measured in 10ths of points.)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
463 (let* ((dcache (device-fonts-cache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
464 (font-data (font-menu-font-data 'default dcache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
465 (from-family (aref font-data 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
466 (from-size (aref font-data 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
467 (from-weight (aref font-data 3))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
468 (from-slant (aref font-data 4))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
469 new-default-face-font)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
470 (unless from-family
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
471 (signal 'error '("couldn't parse font name for default face")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (setq new-default-face-font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (font-menu-load-font (or family from-family)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (or weight from-weight)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (or size from-size)
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
476 from-slant
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
477 font-menu-preferred-resolution))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
478 (dolist (face (delq 'default (face-list)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
479 (when (face-font-instance face)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
480 (message "Changing font of `%s'..." face)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
481 (condition-case c
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
482 (font-menu-change-face face
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
483 from-family from-weight from-size
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
484 family weight size)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
485 (error
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
486 (display-error c nil)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
487 (sit-for 1)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ;; Set the default face's font after hacking the other faces, so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 ;; the frame size doesn't change until we are all done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 ;;; WMP - we need to honor font-menu-this-frame-only-p here!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (set-face-font 'default new-default-face-font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (and font-menu-this-frame-only-p (selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (message "Font %s" (face-font-name 'default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (defun font-menu-change-face (face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 from-family from-weight from-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 to-family to-weight to-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (or (symbolp face) (signal 'wrong-type-argument (list 'symbolp face)))
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
501 (let* ((dcache (device-fonts-cache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
502 (font-data (font-menu-font-data face dcache))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
503 (face-family (aref font-data 1))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
504 (face-size (aref font-data 2))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
505 (face-weight (aref font-data 3))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
506 (face-slant (aref font-data 4)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
507
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
508 (or face-family
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
509 (signal 'error (list "couldn't parse font name for face" face)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 ;; If this face matches the old default face in the attribute we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 ;; are changing, then change it to the new attribute along that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 ;; dimension. Also, the face must have its own global attribute.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 ;; If its value is inherited, we don't touch it. If any of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 ;; is not true, we leave it alone.
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
516 (when (and (face-font face 'global)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
517 (cond
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
518 (to-family (string-equal face-family from-family))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
519 (to-weight (string-equal face-weight from-weight))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
520 (to-size (= face-size from-size))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
521 (set-face-font face
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
522 (font-menu-load-font (or to-family face-family)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
523 (or to-weight face-weight)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
524 (or to-size face-size)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
525 face-slant
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
526 font-menu-preferred-resolution)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
527 (and font-menu-this-frame-only-p
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
528 (selected-frame))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
530 (defun font-menu-load-font (family weight size slant resolution)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
531 "Try to load a font with the requested properties.
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
532 The weight, slant and resolution are only hints."
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
533 (when (integerp size) (setq size (int-to-string size)))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
534 (let (font)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
535 (catch 'got-font
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
536 (dolist (weight (list weight "*"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
537 (dolist (slant
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
538 (cond ((string-equal slant "O") '("O" "I" "*"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
539 ((string-equal slant "I") '("I" "O" "*"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
540 ((string-equal slant "*") '("*"))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
541 (t (list slant "*"))))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
542 (dolist (resolution
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
543 (if (string-equal resolution "*-*")
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
544 (list resolution)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
545 (list resolution "*-*")))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
546 (when (setq font
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
547 (make-font-instance
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
548 (concat "-*-" family "-" weight "-" slant "-*-*-*-"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
549 size "-" resolution "-*-*-"
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
550 font-menu-registry-encoding)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
551 nil t))
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
552 (throw 'got-font font))))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (defun flush-device-fonts-cache (device)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 ;; by Stig@hackvan.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (let ((elt (assq device device-fonts-cache)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (and elt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (setq device-fonts-cache (delq elt device-fonts-cache)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (add-hook 'delete-device-hook 'flush-device-fonts-cache)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (provide 'x-font-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 ;;; x-font-menu.el ends here