428
|
1 /* mswindows-specific Lisp objects.
|
|
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
|
|
4 Copyright (C) 1995 Tinker Systems.
|
788
|
5 Copyright (C) 1995, 1996, 2000, 2001, 2002 Ben Wing.
|
428
|
6 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
7 Copyright (C) 1997 Jonathan Harris.
|
|
8
|
|
9 This file is part of XEmacs.
|
|
10
|
|
11 XEmacs is free software; you can redistribute it and/or modify it
|
|
12 under the terms of the GNU General Public License as published by the
|
|
13 Free Software Foundation; either version 2, or (at your option) any
|
|
14 later version.
|
|
15
|
|
16 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
19 for more details.
|
|
20
|
|
21 You should have received a copy of the GNU General Public License
|
|
22 along with XEmacs; see the file COPYING. If not, write to
|
|
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
24 Boston, MA 02111-1307, USA. */
|
|
25
|
|
26 /* Synched up with: Not in FSF. */
|
|
27
|
|
28 /* Authorship:
|
|
29
|
|
30 Jamie Zawinski, Chuck Thompson, Ben Wing
|
|
31 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
|
|
32 */
|
|
33
|
793
|
34 /* This function Mule-ized by Ben Wing, 3-24-02. */
|
428
|
35
|
|
36 /* TODO: palette handling */
|
|
37
|
|
38 #include <config.h>
|
|
39 #include "lisp.h"
|
|
40
|
|
41 #include "console-msw.h"
|
|
42 #include "objects-msw.h"
|
|
43 #include "buffer.h"
|
771
|
44 #include "charset.h"
|
428
|
45 #include "device.h"
|
788
|
46 #include "elhash.h"
|
428
|
47 #include "insdel.h"
|
788
|
48 #include "opaque.h"
|
428
|
49
|
442
|
50 typedef struct colormap_t
|
428
|
51 {
|
771
|
52 const Char_ASCII *name;
|
442
|
53 COLORREF colorref;
|
428
|
54 } colormap_t;
|
|
55
|
|
56 /* Colors from X11R6 "XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp" */
|
771
|
57 /* MSWindows tends to round up the numbers in its palette, ie where X uses
|
442
|
58 * 127, MSWindows uses 128. Colors commented as "Adjusted" are tweaked to
|
|
59 * match the Windows standard palette to increase the likelihood of
|
|
60 * mswindows_color_to_string() finding a named match.
|
|
61 */
|
|
62 static const colormap_t mswindows_X_color_map[] =
|
428
|
63 {
|
442
|
64 {"white" , PALETTERGB (255, 255, 255) },
|
|
65 {"black" , PALETTERGB (0, 0, 0) },
|
|
66 {"snow" , PALETTERGB (255, 250, 250) },
|
|
67 {"GhostWhite" , PALETTERGB (248, 248, 255) },
|
|
68 {"WhiteSmoke" , PALETTERGB (245, 245, 245) },
|
|
69 {"gainsboro" , PALETTERGB (220, 220, 220) },
|
|
70 {"FloralWhite" , PALETTERGB (255, 250, 240) },
|
|
71 {"OldLace" , PALETTERGB (253, 245, 230) },
|
|
72 {"linen" , PALETTERGB (250, 240, 230) },
|
|
73 {"AntiqueWhite" , PALETTERGB (250, 235, 215) },
|
|
74 {"PapayaWhip" , PALETTERGB (255, 239, 213) },
|
|
75 {"BlanchedAlmond" , PALETTERGB (255, 235, 205) },
|
|
76 {"bisque" , PALETTERGB (255, 228, 196) },
|
|
77 {"PeachPuff" , PALETTERGB (255, 218, 185) },
|
|
78 {"NavajoWhite" , PALETTERGB (255, 222, 173) },
|
|
79 {"moccasin" , PALETTERGB (255, 228, 181) },
|
|
80 {"cornsilk" , PALETTERGB (255, 248, 220) },
|
|
81 {"ivory" , PALETTERGB (255, 255, 240) },
|
|
82 {"LemonChiffon" , PALETTERGB (255, 250, 205) },
|
|
83 {"seashell" , PALETTERGB (255, 245, 238) },
|
|
84 {"honeydew" , PALETTERGB (240, 255, 240) },
|
|
85 {"MintCream" , PALETTERGB (245, 255, 250) },
|
|
86 {"azure" , PALETTERGB (240, 255, 255) },
|
|
87 {"AliceBlue" , PALETTERGB (240, 248, 255) },
|
|
88 {"lavender" , PALETTERGB (230, 230, 250) },
|
|
89 {"LavenderBlush" , PALETTERGB (255, 240, 245) },
|
|
90 {"MistyRose" , PALETTERGB (255, 228, 225) },
|
|
91 {"DarkSlateGray" , PALETTERGB (47, 79, 79) },
|
|
92 {"DarkSlateGrey" , PALETTERGB (47, 79, 79) },
|
|
93 {"DimGray" , PALETTERGB (105, 105, 105) },
|
|
94 {"DimGrey" , PALETTERGB (105, 105, 105) },
|
|
95 {"SlateGray" , PALETTERGB (112, 128, 144) },
|
|
96 {"SlateGrey" , PALETTERGB (112, 128, 144) },
|
|
97 {"LightSlateGray" , PALETTERGB (119, 136, 153) },
|
|
98 {"LightSlateGrey" , PALETTERGB (119, 136, 153) },
|
|
99 {"gray" , PALETTERGB (190, 190, 190) },
|
|
100 {"grey" , PALETTERGB (190, 190, 190) },
|
|
101 {"LightGrey" , PALETTERGB (211, 211, 211) },
|
|
102 {"LightGray" , PALETTERGB (211, 211, 211) },
|
|
103 {"MidnightBlue" , PALETTERGB (25, 25, 112) },
|
|
104 {"navy" , PALETTERGB (0, 0, 128) },
|
|
105 {"NavyBlue" , PALETTERGB (0, 0, 128) },
|
|
106 {"CornflowerBlue" , PALETTERGB (100, 149, 237) },
|
|
107 {"DarkSlateBlue" , PALETTERGB (72, 61, 139) },
|
|
108 {"SlateBlue" , PALETTERGB (106, 90, 205) },
|
|
109 {"MediumSlateBlue" , PALETTERGB (123, 104, 238) },
|
|
110 {"LightSlateBlue" , PALETTERGB (132, 112, 255) },
|
|
111 {"MediumBlue" , PALETTERGB (0, 0, 205) },
|
|
112 {"RoyalBlue" , PALETTERGB (65, 105, 225) },
|
|
113 {"blue" , PALETTERGB (0, 0, 255) },
|
|
114 {"DodgerBlue" , PALETTERGB (30, 144, 255) },
|
|
115 {"DeepSkyBlue" , PALETTERGB (0, 191, 255) },
|
|
116 {"SkyBlue" , PALETTERGB (135, 206, 235) },
|
|
117 {"LightSkyBlue" , PALETTERGB (135, 206, 250) },
|
|
118 {"SteelBlue" , PALETTERGB (70, 130, 180) },
|
|
119 {"LightSteelBlue" , PALETTERGB (176, 196, 222) },
|
|
120 {"LightBlue" , PALETTERGB (173, 216, 230) },
|
|
121 {"PowderBlue" , PALETTERGB (176, 224, 230) },
|
|
122 {"PaleTurquoise" , PALETTERGB (175, 238, 238) },
|
|
123 {"DarkTurquoise" , PALETTERGB (0, 206, 209) },
|
|
124 {"MediumTurquoise" , PALETTERGB (72, 209, 204) },
|
|
125 {"turquoise" , PALETTERGB (64, 224, 208) },
|
|
126 {"cyan" , PALETTERGB (0, 255, 255) },
|
|
127 {"LightCyan" , PALETTERGB (224, 255, 255) },
|
|
128 {"CadetBlue" , PALETTERGB (95, 158, 160) },
|
|
129 {"MediumAquamarine" , PALETTERGB (102, 205, 170) },
|
|
130 {"aquamarine" , PALETTERGB (127, 255, 212) },
|
|
131 {"DarkGreen" , PALETTERGB (0, 128, 0) }, /* Adjusted */
|
|
132 {"DarkOliveGreen" , PALETTERGB (85, 107, 47) },
|
|
133 {"DarkSeaGreen" , PALETTERGB (143, 188, 143) },
|
|
134 {"SeaGreen" , PALETTERGB (46, 139, 87) },
|
|
135 {"MediumSeaGreen" , PALETTERGB (60, 179, 113) },
|
|
136 {"LightSeaGreen" , PALETTERGB (32, 178, 170) },
|
|
137 {"PaleGreen" , PALETTERGB (152, 251, 152) },
|
|
138 {"SpringGreen" , PALETTERGB (0, 255, 127) },
|
|
139 {"LawnGreen" , PALETTERGB (124, 252, 0) },
|
|
140 {"green" , PALETTERGB (0, 255, 0) },
|
|
141 {"chartreuse" , PALETTERGB (127, 255, 0) },
|
|
142 {"MediumSpringGreen" , PALETTERGB (0, 250, 154) },
|
|
143 {"GreenYellow" , PALETTERGB (173, 255, 47) },
|
|
144 {"LimeGreen" , PALETTERGB (50, 205, 50) },
|
|
145 {"YellowGreen" , PALETTERGB (154, 205, 50) },
|
|
146 {"ForestGreen" , PALETTERGB (34, 139, 34) },
|
|
147 {"OliveDrab" , PALETTERGB (107, 142, 35) },
|
|
148 {"DarkKhaki" , PALETTERGB (189, 183, 107) },
|
|
149 {"khaki" , PALETTERGB (240, 230, 140) },
|
|
150 {"PaleGoldenrod" , PALETTERGB (238, 232, 170) },
|
|
151 {"LightGoldenrodYellow", PALETTERGB (250, 250, 210) },
|
|
152 {"LightYellow" , PALETTERGB (255, 255, 224) },
|
|
153 {"LightYellow" , PALETTERGB (255, 255, 225) }, /* Adjusted */
|
|
154 {"yellow" , PALETTERGB (255, 255, 0) },
|
|
155 {"gold" , PALETTERGB (255, 215, 0) },
|
|
156 {"LightGoldenrod" , PALETTERGB (238, 221, 130) },
|
|
157 {"goldenrod" , PALETTERGB (218, 165, 32) },
|
|
158 {"DarkGoldenrod" , PALETTERGB (184, 134, 11) },
|
|
159 {"RosyBrown" , PALETTERGB (188, 143, 143) },
|
|
160 {"IndianRed" , PALETTERGB (205, 92, 92) },
|
|
161 {"SaddleBrown" , PALETTERGB (139, 69, 19) },
|
|
162 {"sienna" , PALETTERGB (160, 82, 45) },
|
|
163 {"peru" , PALETTERGB (205, 133, 63) },
|
|
164 {"burlywood" , PALETTERGB (222, 184, 135) },
|
|
165 {"beige" , PALETTERGB (245, 245, 220) },
|
|
166 {"wheat" , PALETTERGB (245, 222, 179) },
|
|
167 {"SandyBrown" , PALETTERGB (244, 164, 96) },
|
|
168 {"tan" , PALETTERGB (210, 180, 140) },
|
|
169 {"chocolate" , PALETTERGB (210, 105, 30) },
|
|
170 {"firebrick" , PALETTERGB (178, 34, 34) },
|
|
171 {"brown" , PALETTERGB (165, 42, 42) },
|
|
172 {"DarkSalmon" , PALETTERGB (233, 150, 122) },
|
|
173 {"salmon" , PALETTERGB (250, 128, 114) },
|
|
174 {"LightSalmon" , PALETTERGB (255, 160, 122) },
|
|
175 {"orange" , PALETTERGB (255, 165, 0) },
|
|
176 {"DarkOrange" , PALETTERGB (255, 140, 0) },
|
|
177 {"coral" , PALETTERGB (255, 127, 80) },
|
|
178 {"LightCoral" , PALETTERGB (240, 128, 128) },
|
|
179 {"tomato" , PALETTERGB (255, 99, 71) },
|
|
180 {"OrangeRed" , PALETTERGB (255, 69, 0) },
|
|
181 {"red" , PALETTERGB (255, 0, 0) },
|
|
182 {"HotPink" , PALETTERGB (255, 105, 180) },
|
|
183 {"DeepPink" , PALETTERGB (255, 20, 147) },
|
|
184 {"pink" , PALETTERGB (255, 192, 203) },
|
|
185 {"LightPink" , PALETTERGB (255, 182, 193) },
|
|
186 {"PaleVioletRed" , PALETTERGB (219, 112, 147) },
|
|
187 {"maroon" , PALETTERGB (176, 48, 96) },
|
|
188 {"MediumVioletRed" , PALETTERGB (199, 21, 133) },
|
|
189 {"VioletRed" , PALETTERGB (208, 32, 144) },
|
|
190 {"magenta" , PALETTERGB (255, 0, 255) },
|
|
191 {"violet" , PALETTERGB (238, 130, 238) },
|
|
192 {"plum" , PALETTERGB (221, 160, 221) },
|
|
193 {"orchid" , PALETTERGB (218, 112, 214) },
|
|
194 {"MediumOrchid" , PALETTERGB (186, 85, 211) },
|
|
195 {"DarkOrchid" , PALETTERGB (153, 50, 204) },
|
|
196 {"DarkViolet" , PALETTERGB (148, 0, 211) },
|
|
197 {"BlueViolet" , PALETTERGB (138, 43, 226) },
|
|
198 {"purple" , PALETTERGB (160, 32, 240) },
|
|
199 {"MediumPurple" , PALETTERGB (147, 112, 219) },
|
|
200 {"thistle" , PALETTERGB (216, 191, 216) },
|
|
201 {"snow1" , PALETTERGB (255, 250, 250) },
|
|
202 {"snow2" , PALETTERGB (238, 233, 233) },
|
|
203 {"snow3" , PALETTERGB (205, 201, 201) },
|
|
204 {"snow4" , PALETTERGB (139, 137, 137) },
|
|
205 {"seashell1" , PALETTERGB (255, 245, 238) },
|
|
206 {"seashell2" , PALETTERGB (238, 229, 222) },
|
|
207 {"seashell3" , PALETTERGB (205, 197, 191) },
|
|
208 {"seashell4" , PALETTERGB (139, 134, 130) },
|
|
209 {"AntiqueWhite1" , PALETTERGB (255, 239, 219) },
|
|
210 {"AntiqueWhite2" , PALETTERGB (238, 223, 204) },
|
|
211 {"AntiqueWhite3" , PALETTERGB (205, 192, 176) },
|
|
212 {"AntiqueWhite4" , PALETTERGB (139, 131, 120) },
|
|
213 {"bisque1" , PALETTERGB (255, 228, 196) },
|
|
214 {"bisque2" , PALETTERGB (238, 213, 183) },
|
|
215 {"bisque3" , PALETTERGB (205, 183, 158) },
|
|
216 {"bisque4" , PALETTERGB (139, 125, 107) },
|
|
217 {"PeachPuff1" , PALETTERGB (255, 218, 185) },
|
|
218 {"PeachPuff2" , PALETTERGB (238, 203, 173) },
|
|
219 {"PeachPuff3" , PALETTERGB (205, 175, 149) },
|
|
220 {"PeachPuff4" , PALETTERGB (139, 119, 101) },
|
|
221 {"NavajoWhite1" , PALETTERGB (255, 222, 173) },
|
|
222 {"NavajoWhite2" , PALETTERGB (238, 207, 161) },
|
|
223 {"NavajoWhite3" , PALETTERGB (205, 179, 139) },
|
|
224 {"NavajoWhite4" , PALETTERGB (139, 121, 94) },
|
|
225 {"LemonChiffon1" , PALETTERGB (255, 250, 205) },
|
|
226 {"LemonChiffon2" , PALETTERGB (238, 233, 191) },
|
|
227 {"LemonChiffon3" , PALETTERGB (205, 201, 165) },
|
|
228 {"LemonChiffon4" , PALETTERGB (139, 137, 112) },
|
|
229 {"cornsilk1" , PALETTERGB (255, 248, 220) },
|
|
230 {"cornsilk2" , PALETTERGB (238, 232, 205) },
|
|
231 {"cornsilk3" , PALETTERGB (205, 200, 177) },
|
|
232 {"cornsilk4" , PALETTERGB (139, 136, 120) },
|
|
233 {"ivory1" , PALETTERGB (255, 255, 240) },
|
|
234 {"ivory2" , PALETTERGB (240, 240, 208) }, /* Adjusted */
|
|
235 {"ivory3" , PALETTERGB (205, 205, 193) },
|
|
236 {"ivory4" , PALETTERGB (139, 139, 131) },
|
|
237 {"honeydew1" , PALETTERGB (240, 255, 240) },
|
|
238 {"honeydew2" , PALETTERGB (224, 238, 224) },
|
|
239 {"honeydew3" , PALETTERGB (193, 205, 193) },
|
|
240 {"honeydew4" , PALETTERGB (131, 139, 131) },
|
|
241 {"LavenderBlush1" , PALETTERGB (255, 240, 245) },
|
|
242 {"LavenderBlush2" , PALETTERGB (238, 224, 229) },
|
|
243 {"LavenderBlush3" , PALETTERGB (205, 193, 197) },
|
|
244 {"LavenderBlush4" , PALETTERGB (139, 131, 134) },
|
|
245 {"MistyRose1" , PALETTERGB (255, 228, 225) },
|
|
246 {"MistyRose2" , PALETTERGB (238, 213, 210) },
|
|
247 {"MistyRose3" , PALETTERGB (205, 183, 181) },
|
|
248 {"MistyRose4" , PALETTERGB (139, 125, 123) },
|
|
249 {"azure1" , PALETTERGB (240, 255, 255) },
|
|
250 {"azure2" , PALETTERGB (224, 238, 238) },
|
|
251 {"azure3" , PALETTERGB (193, 205, 205) },
|
|
252 {"azure4" , PALETTERGB (131, 139, 139) },
|
|
253 {"SlateBlue1" , PALETTERGB (131, 111, 255) },
|
|
254 {"SlateBlue2" , PALETTERGB (122, 103, 238) },
|
|
255 {"SlateBlue3" , PALETTERGB (105, 89, 205) },
|
|
256 {"SlateBlue4" , PALETTERGB (71, 60, 139) },
|
|
257 {"RoyalBlue1" , PALETTERGB (72, 118, 255) },
|
|
258 {"RoyalBlue2" , PALETTERGB (67, 110, 238) },
|
|
259 {"RoyalBlue3" , PALETTERGB (58, 95, 205) },
|
|
260 {"RoyalBlue4" , PALETTERGB (39, 64, 139) },
|
|
261 {"blue1" , PALETTERGB (0, 0, 255) },
|
|
262 {"blue2" , PALETTERGB (0, 0, 238) },
|
|
263 {"blue3" , PALETTERGB (0, 0, 205) },
|
|
264 {"blue4" , PALETTERGB (0, 0, 139) },
|
|
265 {"DodgerBlue1" , PALETTERGB (30, 144, 255) },
|
|
266 {"DodgerBlue2" , PALETTERGB (28, 134, 238) },
|
|
267 {"DodgerBlue3" , PALETTERGB (24, 116, 205) },
|
|
268 {"DodgerBlue4" , PALETTERGB (16, 78, 139) },
|
|
269 {"SteelBlue1" , PALETTERGB (99, 184, 255) },
|
|
270 {"SteelBlue2" , PALETTERGB (92, 172, 238) },
|
|
271 {"SteelBlue3" , PALETTERGB (79, 148, 205) },
|
|
272 {"SteelBlue4" , PALETTERGB (54, 100, 139) },
|
|
273 {"DeepSkyBlue1" , PALETTERGB (0, 191, 255) },
|
|
274 {"DeepSkyBlue2" , PALETTERGB (0, 178, 238) },
|
|
275 {"DeepSkyBlue3" , PALETTERGB (0, 154, 205) },
|
|
276 {"DeepSkyBlue4" , PALETTERGB (0, 104, 139) },
|
|
277 {"SkyBlue1" , PALETTERGB (135, 206, 255) },
|
|
278 {"SkyBlue2" , PALETTERGB (126, 192, 238) },
|
|
279 {"SkyBlue3" , PALETTERGB (108, 166, 205) },
|
|
280 {"SkyBlue4" , PALETTERGB (74, 112, 139) },
|
|
281 {"LightSkyBlue1" , PALETTERGB (176, 226, 255) },
|
|
282 {"LightSkyBlue2" , PALETTERGB (164, 211, 238) },
|
|
283 {"LightSkyBlue3" , PALETTERGB (141, 182, 205) },
|
|
284 {"LightSkyBlue4" , PALETTERGB (96, 123, 139) },
|
|
285 {"SlateGray1" , PALETTERGB (198, 226, 255) },
|
|
286 {"SlateGray2" , PALETTERGB (185, 211, 238) },
|
|
287 {"SlateGray3" , PALETTERGB (159, 182, 205) },
|
|
288 {"SlateGray4" , PALETTERGB (108, 123, 139) },
|
|
289 {"LightSteelBlue1" , PALETTERGB (202, 225, 255) },
|
|
290 {"LightSteelBlue2" , PALETTERGB (188, 210, 238) },
|
|
291 {"LightSteelBlue3" , PALETTERGB (162, 181, 205) },
|
|
292 {"LightSteelBlue4" , PALETTERGB (110, 123, 139) },
|
|
293 {"LightBlue1" , PALETTERGB (191, 239, 255) },
|
|
294 {"LightBlue2" , PALETTERGB (178, 223, 238) },
|
|
295 {"LightBlue3" , PALETTERGB (154, 192, 205) },
|
|
296 {"LightBlue4" , PALETTERGB (104, 131, 139) },
|
|
297 {"LightCyan1" , PALETTERGB (224, 255, 255) },
|
|
298 {"LightCyan2" , PALETTERGB (209, 238, 238) },
|
|
299 {"LightCyan3" , PALETTERGB (180, 205, 205) },
|
|
300 {"LightCyan4" , PALETTERGB (122, 139, 139) },
|
|
301 {"PaleTurquoise1" , PALETTERGB (187, 255, 255) },
|
|
302 {"PaleTurquoise2" , PALETTERGB (174, 238, 238) },
|
|
303 {"PaleTurquoise3" , PALETTERGB (150, 205, 205) },
|
|
304 {"PaleTurquoise4" , PALETTERGB (102, 139, 139) },
|
|
305 {"CadetBlue1" , PALETTERGB (152, 245, 255) },
|
|
306 {"CadetBlue2" , PALETTERGB (144, 220, 240) }, /* Adjusted */
|
|
307 {"CadetBlue3" , PALETTERGB (122, 197, 205) },
|
|
308 {"CadetBlue4" , PALETTERGB (83, 134, 139) },
|
|
309 {"turquoise1" , PALETTERGB (0, 245, 255) },
|
|
310 {"turquoise2" , PALETTERGB (0, 229, 238) },
|
|
311 {"turquoise3" , PALETTERGB (0, 197, 205) },
|
|
312 {"turquoise4" , PALETTERGB (0, 134, 139) },
|
|
313 {"cyan1" , PALETTERGB (0, 255, 255) },
|
|
314 {"cyan2" , PALETTERGB (0, 238, 238) },
|
|
315 {"cyan3" , PALETTERGB (0, 205, 205) },
|
|
316 {"cyan4" , PALETTERGB (0, 139, 139) },
|
|
317 {"DarkSlateGray1" , PALETTERGB (151, 255, 255) },
|
|
318 {"DarkSlateGray2" , PALETTERGB (141, 238, 238) },
|
|
319 {"DarkSlateGray3" , PALETTERGB (121, 205, 205) },
|
|
320 {"DarkSlateGray4" , PALETTERGB (82, 139, 139) },
|
|
321 {"aquamarine1" , PALETTERGB (127, 255, 212) },
|
|
322 {"aquamarine2" , PALETTERGB (118, 238, 198) },
|
|
323 {"aquamarine3" , PALETTERGB (102, 205, 170) },
|
|
324 {"aquamarine4" , PALETTERGB (69, 139, 116) },
|
|
325 {"DarkSeaGreen1" , PALETTERGB (193, 255, 193) },
|
|
326 {"DarkSeaGreen2" , PALETTERGB (180, 238, 180) },
|
|
327 {"DarkSeaGreen3" , PALETTERGB (155, 205, 155) },
|
|
328 {"DarkSeaGreen4" , PALETTERGB (105, 139, 105) },
|
|
329 {"SeaGreen1" , PALETTERGB (84, 255, 159) },
|
|
330 {"SeaGreen2" , PALETTERGB (78, 238, 148) },
|
|
331 {"SeaGreen3" , PALETTERGB (67, 205, 128) },
|
|
332 {"SeaGreen4" , PALETTERGB (46, 139, 87) },
|
|
333 {"PaleGreen1" , PALETTERGB (154, 255, 154) },
|
|
334 {"PaleGreen2" , PALETTERGB (144, 238, 144) },
|
|
335 {"PaleGreen3" , PALETTERGB (124, 205, 124) },
|
|
336 {"PaleGreen4" , PALETTERGB (84, 139, 84) },
|
|
337 {"SpringGreen1" , PALETTERGB (0, 255, 127) },
|
|
338 {"SpringGreen2" , PALETTERGB (0, 238, 118) },
|
|
339 {"SpringGreen3" , PALETTERGB (0, 205, 102) },
|
|
340 {"SpringGreen4" , PALETTERGB (0, 139, 69) },
|
|
341 {"green1" , PALETTERGB (0, 255, 0) },
|
|
342 {"green2" , PALETTERGB (0, 238, 0) },
|
|
343 {"green3" , PALETTERGB (0, 205, 0) },
|
|
344 {"green4" , PALETTERGB (0, 139, 0) },
|
|
345 {"chartreuse1" , PALETTERGB (127, 255, 0) },
|
|
346 {"chartreuse2" , PALETTERGB (118, 238, 0) },
|
|
347 {"chartreuse3" , PALETTERGB (102, 205, 0) },
|
|
348 {"chartreuse4" , PALETTERGB (69, 139, 0) },
|
|
349 {"OliveDrab1" , PALETTERGB (192, 255, 62) },
|
|
350 {"OliveDrab2" , PALETTERGB (179, 238, 58) },
|
|
351 {"OliveDrab3" , PALETTERGB (154, 205, 50) },
|
|
352 {"OliveDrab4" , PALETTERGB (105, 139, 34) },
|
|
353 {"DarkOliveGreen1" , PALETTERGB (202, 255, 112) },
|
|
354 {"DarkOliveGreen2" , PALETTERGB (188, 238, 104) },
|
|
355 {"DarkOliveGreen3" , PALETTERGB (162, 205, 90) },
|
|
356 {"DarkOliveGreen4" , PALETTERGB (110, 139, 61) },
|
|
357 {"khaki1" , PALETTERGB (255, 246, 143) },
|
|
358 {"khaki2" , PALETTERGB (238, 230, 133) },
|
|
359 {"khaki3" , PALETTERGB (205, 198, 115) },
|
|
360 {"khaki4" , PALETTERGB (139, 134, 78) },
|
|
361 {"LightGoldenrod1" , PALETTERGB (255, 236, 139) },
|
|
362 {"LightGoldenrod2" , PALETTERGB (238, 220, 130) },
|
|
363 {"LightGoldenrod3" , PALETTERGB (205, 190, 112) },
|
|
364 {"LightGoldenrod4" , PALETTERGB (139, 129, 76) },
|
|
365 {"LightYellow1" , PALETTERGB (255, 255, 224) },
|
|
366 {"LightYellow2" , PALETTERGB (238, 238, 209) },
|
|
367 {"LightYellow3" , PALETTERGB (205, 205, 180) },
|
|
368 {"LightYellow4" , PALETTERGB (139, 139, 122) },
|
|
369 {"yellow1" , PALETTERGB (255, 255, 0) },
|
|
370 {"yellow2" , PALETTERGB (238, 238, 0) },
|
|
371 {"yellow3" , PALETTERGB (205, 205, 0) },
|
|
372 {"yellow4" , PALETTERGB (139, 139, 0) },
|
|
373 {"gold1" , PALETTERGB (255, 215, 0) },
|
|
374 {"gold2" , PALETTERGB (238, 201, 0) },
|
|
375 {"gold3" , PALETTERGB (205, 173, 0) },
|
|
376 {"gold4" , PALETTERGB (139, 117, 0) },
|
|
377 {"goldenrod1" , PALETTERGB (255, 193, 37) },
|
|
378 {"goldenrod2" , PALETTERGB (238, 180, 34) },
|
|
379 {"goldenrod3" , PALETTERGB (205, 155, 29) },
|
|
380 {"goldenrod4" , PALETTERGB (139, 105, 20) },
|
|
381 {"DarkGoldenrod1" , PALETTERGB (255, 185, 15) },
|
|
382 {"DarkGoldenrod2" , PALETTERGB (238, 173, 14) },
|
|
383 {"DarkGoldenrod3" , PALETTERGB (205, 149, 12) },
|
|
384 {"DarkGoldenrod4" , PALETTERGB (139, 101, 8) },
|
|
385 {"RosyBrown1" , PALETTERGB (255, 193, 193) },
|
|
386 {"RosyBrown2" , PALETTERGB (238, 180, 180) },
|
|
387 {"RosyBrown3" , PALETTERGB (205, 155, 155) },
|
|
388 {"RosyBrown4" , PALETTERGB (139, 105, 105) },
|
|
389 {"IndianRed1" , PALETTERGB (255, 106, 106) },
|
|
390 {"IndianRed2" , PALETTERGB (238, 99, 99) },
|
|
391 {"IndianRed3" , PALETTERGB (205, 85, 85) },
|
|
392 {"IndianRed4" , PALETTERGB (139, 58, 58) },
|
|
393 {"sienna1" , PALETTERGB (255, 130, 71) },
|
|
394 {"sienna2" , PALETTERGB (238, 121, 66) },
|
|
395 {"sienna3" , PALETTERGB (205, 104, 57) },
|
|
396 {"sienna4" , PALETTERGB (139, 71, 38) },
|
|
397 {"burlywood1" , PALETTERGB (255, 211, 155) },
|
|
398 {"burlywood2" , PALETTERGB (238, 197, 145) },
|
|
399 {"burlywood3" , PALETTERGB (205, 170, 125) },
|
|
400 {"burlywood4" , PALETTERGB (139, 115, 85) },
|
|
401 {"wheat1" , PALETTERGB (255, 231, 186) },
|
|
402 {"wheat2" , PALETTERGB (238, 216, 174) },
|
|
403 {"wheat3" , PALETTERGB (205, 186, 150) },
|
|
404 {"wheat4" , PALETTERGB (139, 126, 102) },
|
|
405 {"tan1" , PALETTERGB (255, 165, 79) },
|
|
406 {"tan2" , PALETTERGB (238, 154, 73) },
|
|
407 {"tan3" , PALETTERGB (205, 133, 63) },
|
|
408 {"tan4" , PALETTERGB (139, 90, 43) },
|
|
409 {"chocolate1" , PALETTERGB (255, 127, 36) },
|
|
410 {"chocolate2" , PALETTERGB (238, 118, 33) },
|
|
411 {"chocolate3" , PALETTERGB (205, 102, 29) },
|
|
412 {"chocolate4" , PALETTERGB (139, 69, 19) },
|
|
413 {"firebrick1" , PALETTERGB (255, 48, 48) },
|
|
414 {"firebrick2" , PALETTERGB (238, 44, 44) },
|
|
415 {"firebrick3" , PALETTERGB (205, 38, 38) },
|
|
416 {"firebrick4" , PALETTERGB (139, 26, 26) },
|
|
417 {"brown1" , PALETTERGB (255, 64, 64) },
|
|
418 {"brown2" , PALETTERGB (238, 59, 59) },
|
|
419 {"brown3" , PALETTERGB (205, 51, 51) },
|
|
420 {"brown4" , PALETTERGB (139, 35, 35) },
|
|
421 {"salmon1" , PALETTERGB (255, 140, 105) },
|
|
422 {"salmon2" , PALETTERGB (238, 130, 98) },
|
|
423 {"salmon3" , PALETTERGB (205, 112, 84) },
|
|
424 {"salmon4" , PALETTERGB (139, 76, 57) },
|
|
425 {"LightSalmon1" , PALETTERGB (255, 160, 122) },
|
|
426 {"LightSalmon2" , PALETTERGB (238, 149, 114) },
|
|
427 {"LightSalmon3" , PALETTERGB (205, 129, 98) },
|
|
428 {"LightSalmon4" , PALETTERGB (139, 87, 66) },
|
|
429 {"orange1" , PALETTERGB (255, 165, 0) },
|
|
430 {"orange2" , PALETTERGB (238, 154, 0) },
|
|
431 {"orange3" , PALETTERGB (205, 133, 0) },
|
|
432 {"orange4" , PALETTERGB (139, 90, 0) },
|
|
433 {"DarkOrange1" , PALETTERGB (255, 127, 0) },
|
|
434 {"DarkOrange2" , PALETTERGB (238, 118, 0) },
|
|
435 {"DarkOrange3" , PALETTERGB (205, 102, 0) },
|
|
436 {"DarkOrange4" , PALETTERGB (139, 69, 0) },
|
|
437 {"coral1" , PALETTERGB (255, 114, 86) },
|
|
438 {"coral2" , PALETTERGB (238, 106, 80) },
|
|
439 {"coral3" , PALETTERGB (205, 91, 69) },
|
|
440 {"coral4" , PALETTERGB (139, 62, 47) },
|
|
441 {"tomato1" , PALETTERGB (255, 99, 71) },
|
|
442 {"tomato2" , PALETTERGB (238, 92, 66) },
|
|
443 {"tomato3" , PALETTERGB (205, 79, 57) },
|
|
444 {"tomato4" , PALETTERGB (139, 54, 38) },
|
|
445 {"OrangeRed1" , PALETTERGB (255, 69, 0) },
|
|
446 {"OrangeRed2" , PALETTERGB (238, 64, 0) },
|
|
447 {"OrangeRed3" , PALETTERGB (205, 55, 0) },
|
|
448 {"OrangeRed4" , PALETTERGB (139, 37, 0) },
|
|
449 {"red1" , PALETTERGB (255, 0, 0) },
|
|
450 {"red2" , PALETTERGB (238, 0, 0) },
|
|
451 {"red3" , PALETTERGB (205, 0, 0) },
|
|
452 {"red4" , PALETTERGB (139, 0, 0) },
|
|
453 {"DeepPink1" , PALETTERGB (255, 20, 147) },
|
|
454 {"DeepPink2" , PALETTERGB (238, 18, 137) },
|
|
455 {"DeepPink3" , PALETTERGB (205, 16, 118) },
|
|
456 {"DeepPink4" , PALETTERGB (139, 10, 80) },
|
|
457 {"HotPink1" , PALETTERGB (255, 110, 180) },
|
|
458 {"HotPink2" , PALETTERGB (238, 106, 167) },
|
|
459 {"HotPink3" , PALETTERGB (205, 96, 144) },
|
|
460 {"HotPink4" , PALETTERGB (139, 58, 98) },
|
|
461 {"pink1" , PALETTERGB (255, 181, 197) },
|
|
462 {"pink2" , PALETTERGB (238, 169, 184) },
|
|
463 {"pink3" , PALETTERGB (205, 145, 158) },
|
|
464 {"pink4" , PALETTERGB (139, 99, 108) },
|
|
465 {"LightPink1" , PALETTERGB (255, 174, 185) },
|
|
466 {"LightPink2" , PALETTERGB (238, 162, 173) },
|
|
467 {"LightPink3" , PALETTERGB (205, 140, 149) },
|
|
468 {"LightPink4" , PALETTERGB (139, 95, 101) },
|
|
469 {"PaleVioletRed1" , PALETTERGB (255, 130, 171) },
|
|
470 {"PaleVioletRed2" , PALETTERGB (238, 121, 159) },
|
|
471 {"PaleVioletRed3" , PALETTERGB (205, 104, 137) },
|
|
472 {"PaleVioletRed4" , PALETTERGB (139, 71, 93) },
|
|
473 {"maroon1" , PALETTERGB (255, 52, 179) },
|
|
474 {"maroon2" , PALETTERGB (238, 48, 167) },
|
|
475 {"maroon3" , PALETTERGB (205, 41, 144) },
|
|
476 {"maroon4" , PALETTERGB (139, 28, 98) },
|
|
477 {"VioletRed1" , PALETTERGB (255, 62, 150) },
|
|
478 {"VioletRed2" , PALETTERGB (238, 58, 140) },
|
|
479 {"VioletRed3" , PALETTERGB (205, 50, 120) },
|
|
480 {"VioletRed4" , PALETTERGB (139, 34, 82) },
|
|
481 {"magenta1" , PALETTERGB (255, 0, 255) },
|
|
482 {"magenta2" , PALETTERGB (238, 0, 238) },
|
|
483 {"magenta3" , PALETTERGB (205, 0, 205) },
|
|
484 {"magenta4" , PALETTERGB (139, 0, 139) },
|
|
485 {"orchid1" , PALETTERGB (255, 131, 250) },
|
|
486 {"orchid2" , PALETTERGB (238, 122, 233) },
|
|
487 {"orchid3" , PALETTERGB (205, 105, 201) },
|
|
488 {"orchid4" , PALETTERGB (139, 71, 137) },
|
|
489 {"plum1" , PALETTERGB (255, 187, 255) },
|
|
490 {"plum2" , PALETTERGB (238, 174, 238) },
|
|
491 {"plum3" , PALETTERGB (205, 150, 205) },
|
|
492 {"plum4" , PALETTERGB (139, 102, 139) },
|
|
493 {"MediumOrchid1" , PALETTERGB (224, 102, 255) },
|
|
494 {"MediumOrchid2" , PALETTERGB (209, 95, 238) },
|
|
495 {"MediumOrchid3" , PALETTERGB (180, 82, 205) },
|
|
496 {"MediumOrchid4" , PALETTERGB (122, 55, 139) },
|
|
497 {"DarkOrchid1" , PALETTERGB (191, 62, 255) },
|
|
498 {"DarkOrchid2" , PALETTERGB (178, 58, 238) },
|
|
499 {"DarkOrchid3" , PALETTERGB (154, 50, 205) },
|
|
500 {"DarkOrchid4" , PALETTERGB (104, 34, 139) },
|
|
501 {"purple1" , PALETTERGB (155, 48, 255) },
|
|
502 {"purple2" , PALETTERGB (145, 44, 238) },
|
|
503 {"purple3" , PALETTERGB (125, 38, 205) },
|
|
504 {"purple4" , PALETTERGB (85, 26, 139) },
|
|
505 {"MediumPurple1" , PALETTERGB (171, 130, 255) },
|
|
506 {"MediumPurple2" , PALETTERGB (159, 121, 238) },
|
|
507 {"MediumPurple3" , PALETTERGB (137, 104, 205) },
|
|
508 {"MediumPurple4" , PALETTERGB (93, 71, 139) },
|
|
509 {"thistle1" , PALETTERGB (255, 225, 255) },
|
|
510 {"thistle2" , PALETTERGB (238, 210, 238) },
|
|
511 {"thistle3" , PALETTERGB (205, 181, 205) },
|
|
512 {"thistle4" , PALETTERGB (139, 123, 139) },
|
|
513 {"gray0" , PALETTERGB (0, 0, 0) },
|
|
514 {"grey0" , PALETTERGB (0, 0, 0) },
|
|
515 {"gray1" , PALETTERGB (3, 3, 3) },
|
|
516 {"grey1" , PALETTERGB (3, 3, 3) },
|
|
517 {"gray2" , PALETTERGB (5, 5, 5) },
|
|
518 {"grey2" , PALETTERGB (5, 5, 5) },
|
|
519 {"gray3" , PALETTERGB (8, 8, 8) },
|
|
520 {"grey3" , PALETTERGB (8, 8, 8) },
|
|
521 {"gray4" , PALETTERGB (10, 10, 10) },
|
|
522 {"grey4" , PALETTERGB (10, 10, 10) },
|
|
523 {"gray5" , PALETTERGB (13, 13, 13) },
|
|
524 {"grey5" , PALETTERGB (13, 13, 13) },
|
|
525 {"gray6" , PALETTERGB (15, 15, 15) },
|
|
526 {"grey6" , PALETTERGB (15, 15, 15) },
|
|
527 {"gray7" , PALETTERGB (18, 18, 18) },
|
|
528 {"grey7" , PALETTERGB (18, 18, 18) },
|
|
529 {"gray8" , PALETTERGB (20, 20, 20) },
|
|
530 {"grey8" , PALETTERGB (20, 20, 20) },
|
|
531 {"gray9" , PALETTERGB (23, 23, 23) },
|
|
532 {"grey9" , PALETTERGB (23, 23, 23) },
|
|
533 {"gray10" , PALETTERGB (26, 26, 26) },
|
|
534 {"grey10" , PALETTERGB (26, 26, 26) },
|
|
535 {"gray11" , PALETTERGB (28, 28, 28) },
|
|
536 {"grey11" , PALETTERGB (28, 28, 28) },
|
|
537 {"gray12" , PALETTERGB (31, 31, 31) },
|
|
538 {"grey12" , PALETTERGB (31, 31, 31) },
|
|
539 {"gray13" , PALETTERGB (33, 33, 33) },
|
|
540 {"grey13" , PALETTERGB (33, 33, 33) },
|
|
541 {"gray14" , PALETTERGB (36, 36, 36) },
|
|
542 {"grey14" , PALETTERGB (36, 36, 36) },
|
|
543 {"gray15" , PALETTERGB (38, 38, 38) },
|
|
544 {"grey15" , PALETTERGB (38, 38, 38) },
|
|
545 {"gray16" , PALETTERGB (41, 41, 41) },
|
|
546 {"grey16" , PALETTERGB (41, 41, 41) },
|
|
547 {"gray17" , PALETTERGB (43, 43, 43) },
|
|
548 {"grey17" , PALETTERGB (43, 43, 43) },
|
|
549 {"gray18" , PALETTERGB (46, 46, 46) },
|
|
550 {"grey18" , PALETTERGB (46, 46, 46) },
|
|
551 {"gray19" , PALETTERGB (48, 48, 48) },
|
|
552 {"grey19" , PALETTERGB (48, 48, 48) },
|
|
553 {"gray20" , PALETTERGB (51, 51, 51) },
|
|
554 {"grey20" , PALETTERGB (51, 51, 51) },
|
|
555 {"gray21" , PALETTERGB (54, 54, 54) },
|
|
556 {"grey21" , PALETTERGB (54, 54, 54) },
|
|
557 {"gray22" , PALETTERGB (56, 56, 56) },
|
|
558 {"grey22" , PALETTERGB (56, 56, 56) },
|
|
559 {"gray23" , PALETTERGB (59, 59, 59) },
|
|
560 {"grey23" , PALETTERGB (59, 59, 59) },
|
|
561 {"gray24" , PALETTERGB (61, 61, 61) },
|
|
562 {"grey24" , PALETTERGB (61, 61, 61) },
|
|
563 {"gray25" , PALETTERGB (64, 64, 64) },
|
|
564 {"grey25" , PALETTERGB (64, 64, 64) },
|
|
565 {"gray26" , PALETTERGB (66, 66, 66) },
|
|
566 {"grey26" , PALETTERGB (66, 66, 66) },
|
|
567 {"gray27" , PALETTERGB (69, 69, 69) },
|
|
568 {"grey27" , PALETTERGB (69, 69, 69) },
|
|
569 {"gray28" , PALETTERGB (71, 71, 71) },
|
|
570 {"grey28" , PALETTERGB (71, 71, 71) },
|
|
571 {"gray29" , PALETTERGB (74, 74, 74) },
|
|
572 {"grey29" , PALETTERGB (74, 74, 74) },
|
|
573 {"gray30" , PALETTERGB (77, 77, 77) },
|
|
574 {"grey30" , PALETTERGB (77, 77, 77) },
|
|
575 {"gray31" , PALETTERGB (79, 79, 79) },
|
|
576 {"grey31" , PALETTERGB (79, 79, 79) },
|
|
577 {"gray32" , PALETTERGB (82, 82, 82) },
|
|
578 {"grey32" , PALETTERGB (82, 82, 82) },
|
|
579 {"gray33" , PALETTERGB (84, 84, 84) },
|
|
580 {"grey33" , PALETTERGB (84, 84, 84) },
|
|
581 {"gray34" , PALETTERGB (87, 87, 87) },
|
|
582 {"grey34" , PALETTERGB (87, 87, 87) },
|
|
583 {"gray35" , PALETTERGB (89, 89, 89) },
|
|
584 {"grey35" , PALETTERGB (89, 89, 89) },
|
|
585 {"gray36" , PALETTERGB (92, 92, 92) },
|
|
586 {"grey36" , PALETTERGB (92, 92, 92) },
|
|
587 {"gray37" , PALETTERGB (94, 94, 94) },
|
|
588 {"grey37" , PALETTERGB (94, 94, 94) },
|
|
589 {"gray38" , PALETTERGB (97, 97, 97) },
|
|
590 {"grey38" , PALETTERGB (97, 97, 97) },
|
|
591 {"gray39" , PALETTERGB (99, 99, 99) },
|
|
592 {"grey39" , PALETTERGB (99, 99, 99) },
|
|
593 {"gray40" , PALETTERGB (102, 102, 102) },
|
|
594 {"grey40" , PALETTERGB (102, 102, 102) },
|
|
595 {"gray41" , PALETTERGB (105, 105, 105) },
|
|
596 {"grey41" , PALETTERGB (105, 105, 105) },
|
|
597 {"gray42" , PALETTERGB (107, 107, 107) },
|
|
598 {"grey42" , PALETTERGB (107, 107, 107) },
|
|
599 {"gray43" , PALETTERGB (110, 110, 110) },
|
|
600 {"grey43" , PALETTERGB (110, 110, 110) },
|
|
601 {"gray44" , PALETTERGB (112, 112, 112) },
|
|
602 {"grey44" , PALETTERGB (112, 112, 112) },
|
|
603 {"gray45" , PALETTERGB (115, 115, 115) },
|
|
604 {"grey45" , PALETTERGB (115, 115, 115) },
|
|
605 {"gray46" , PALETTERGB (117, 117, 117) },
|
|
606 {"grey46" , PALETTERGB (117, 117, 117) },
|
|
607 {"gray47" , PALETTERGB (120, 120, 120) },
|
|
608 {"grey47" , PALETTERGB (120, 120, 120) },
|
|
609 {"gray48" , PALETTERGB (122, 122, 122) },
|
|
610 {"grey48" , PALETTERGB (122, 122, 122) },
|
|
611 {"gray49" , PALETTERGB (125, 125, 125) },
|
|
612 {"grey49" , PALETTERGB (125, 125, 125) },
|
|
613 {"gray50" , PALETTERGB (128, 128, 128) }, /* Adjusted */
|
|
614 {"grey50" , PALETTERGB (128, 128, 128) }, /* Adjusted */
|
|
615 {"gray51" , PALETTERGB (130, 130, 130) },
|
|
616 {"grey51" , PALETTERGB (130, 130, 130) },
|
|
617 {"gray52" , PALETTERGB (133, 133, 133) },
|
|
618 {"grey52" , PALETTERGB (133, 133, 133) },
|
|
619 {"gray53" , PALETTERGB (135, 135, 135) },
|
|
620 {"grey53" , PALETTERGB (135, 135, 135) },
|
|
621 {"gray54" , PALETTERGB (138, 138, 138) },
|
|
622 {"grey54" , PALETTERGB (138, 138, 138) },
|
|
623 {"gray55" , PALETTERGB (140, 140, 140) },
|
|
624 {"grey55" , PALETTERGB (140, 140, 140) },
|
|
625 {"gray56" , PALETTERGB (143, 143, 143) },
|
|
626 {"grey56" , PALETTERGB (143, 143, 143) },
|
|
627 {"gray57" , PALETTERGB (145, 145, 145) },
|
|
628 {"grey57" , PALETTERGB (145, 145, 145) },
|
|
629 {"gray58" , PALETTERGB (148, 148, 148) },
|
|
630 {"grey58" , PALETTERGB (148, 148, 148) },
|
|
631 {"gray59" , PALETTERGB (150, 150, 150) },
|
|
632 {"grey59" , PALETTERGB (150, 150, 150) },
|
|
633 {"gray60" , PALETTERGB (153, 153, 153) },
|
|
634 {"grey60" , PALETTERGB (153, 153, 153) },
|
|
635 {"gray61" , PALETTERGB (156, 156, 156) },
|
|
636 {"grey61" , PALETTERGB (156, 156, 156) },
|
|
637 {"gray62" , PALETTERGB (158, 158, 158) },
|
|
638 {"grey62" , PALETTERGB (158, 158, 158) },
|
|
639 {"gray63" , PALETTERGB (161, 161, 161) },
|
|
640 {"grey63" , PALETTERGB (161, 161, 161) },
|
|
641 {"gray64" , PALETTERGB (163, 163, 163) },
|
|
642 {"grey64" , PALETTERGB (163, 163, 163) },
|
|
643 {"gray65" , PALETTERGB (166, 166, 166) },
|
|
644 {"grey65" , PALETTERGB (166, 166, 166) },
|
|
645 {"gray66" , PALETTERGB (168, 168, 168) },
|
|
646 {"grey66" , PALETTERGB (168, 168, 168) },
|
|
647 {"gray67" , PALETTERGB (171, 171, 171) },
|
|
648 {"grey67" , PALETTERGB (171, 171, 171) },
|
|
649 {"gray68" , PALETTERGB (173, 173, 173) },
|
|
650 {"grey68" , PALETTERGB (173, 173, 173) },
|
|
651 {"gray69" , PALETTERGB (176, 176, 176) },
|
|
652 {"grey69" , PALETTERGB (176, 176, 176) },
|
|
653 {"gray70" , PALETTERGB (179, 179, 179) },
|
|
654 {"grey70" , PALETTERGB (179, 179, 179) },
|
|
655 {"gray71" , PALETTERGB (181, 181, 181) },
|
|
656 {"grey71" , PALETTERGB (181, 181, 181) },
|
|
657 {"gray72" , PALETTERGB (184, 184, 184) },
|
|
658 {"grey72" , PALETTERGB (184, 184, 184) },
|
|
659 {"gray73" , PALETTERGB (186, 186, 186) },
|
|
660 {"grey73" , PALETTERGB (186, 186, 186) },
|
|
661 {"gray74" , PALETTERGB (189, 189, 189) },
|
|
662 {"grey74" , PALETTERGB (189, 189, 189) },
|
|
663 {"gray75" , PALETTERGB (192, 192, 192) }, /* Adjusted */
|
|
664 {"grey75" , PALETTERGB (192, 192, 192) }, /* Adjusted */
|
|
665 {"gray76" , PALETTERGB (194, 194, 194) },
|
|
666 {"grey76" , PALETTERGB (194, 194, 194) },
|
|
667 {"gray77" , PALETTERGB (196, 196, 196) },
|
|
668 {"grey77" , PALETTERGB (196, 196, 196) },
|
|
669 {"gray78" , PALETTERGB (199, 199, 199) },
|
|
670 {"grey78" , PALETTERGB (199, 199, 199) },
|
|
671 {"gray79" , PALETTERGB (201, 201, 201) },
|
|
672 {"grey79" , PALETTERGB (201, 201, 201) },
|
|
673 {"gray80" , PALETTERGB (204, 204, 204) },
|
|
674 {"grey80" , PALETTERGB (204, 204, 204) },
|
|
675 {"gray81" , PALETTERGB (207, 207, 207) },
|
|
676 {"grey81" , PALETTERGB (207, 207, 207) },
|
|
677 {"gray82" , PALETTERGB (209, 209, 209) },
|
|
678 {"grey82" , PALETTERGB (209, 209, 209) },
|
|
679 {"gray83" , PALETTERGB (212, 212, 212) },
|
|
680 {"grey83" , PALETTERGB (212, 212, 212) },
|
|
681 {"gray84" , PALETTERGB (214, 214, 214) },
|
|
682 {"grey84" , PALETTERGB (214, 214, 214) },
|
|
683 {"gray85" , PALETTERGB (217, 217, 217) },
|
|
684 {"grey85" , PALETTERGB (217, 217, 217) },
|
|
685 {"gray86" , PALETTERGB (219, 219, 219) },
|
|
686 {"grey86" , PALETTERGB (219, 219, 219) },
|
|
687 {"gray87" , PALETTERGB (222, 222, 222) },
|
|
688 {"grey87" , PALETTERGB (222, 222, 222) },
|
|
689 {"gray88" , PALETTERGB (224, 224, 224) },
|
|
690 {"grey88" , PALETTERGB (224, 224, 224) },
|
|
691 {"gray89" , PALETTERGB (227, 227, 227) },
|
|
692 {"grey89" , PALETTERGB (227, 227, 227) },
|
|
693 {"gray90" , PALETTERGB (229, 229, 229) },
|
|
694 {"grey90" , PALETTERGB (229, 229, 229) },
|
|
695 {"gray91" , PALETTERGB (232, 232, 232) },
|
|
696 {"grey91" , PALETTERGB (232, 232, 232) },
|
|
697 {"gray92" , PALETTERGB (235, 235, 235) },
|
|
698 {"grey92" , PALETTERGB (235, 235, 235) },
|
|
699 {"gray93" , PALETTERGB (237, 237, 237) },
|
|
700 {"grey93" , PALETTERGB (237, 237, 237) },
|
|
701 {"gray94" , PALETTERGB (240, 240, 240) },
|
|
702 {"grey94" , PALETTERGB (240, 240, 240) },
|
|
703 {"gray95" , PALETTERGB (242, 242, 242) },
|
|
704 {"grey95" , PALETTERGB (242, 242, 242) },
|
|
705 {"gray96" , PALETTERGB (245, 245, 245) },
|
|
706 {"grey96" , PALETTERGB (245, 245, 245) },
|
|
707 {"gray97" , PALETTERGB (247, 247, 247) },
|
|
708 {"grey97" , PALETTERGB (247, 247, 247) },
|
|
709 {"gray98" , PALETTERGB (250, 250, 250) },
|
|
710 {"grey98" , PALETTERGB (250, 250, 250) },
|
|
711 {"gray99" , PALETTERGB (252, 252, 252) },
|
|
712 {"grey99" , PALETTERGB (252, 252, 252) },
|
|
713 {"gray100" , PALETTERGB (255, 255, 255) },
|
|
714 {"grey100" , PALETTERGB (255, 255, 255) },
|
|
715 {"DarkGrey" , PALETTERGB (169, 169, 169) },
|
|
716 {"DarkGray" , PALETTERGB (169, 169, 169) },
|
|
717 {"DarkBlue" , PALETTERGB (0, 0, 128) }, /* Adjusted == Navy */
|
|
718 {"DarkCyan" , PALETTERGB (0, 128, 128) }, /* Adjusted */
|
|
719 {"DarkMagenta" , PALETTERGB (128, 0, 128) }, /* Adjusted */
|
|
720 {"DarkRed" , PALETTERGB (128, 0, 0) }, /* Adjusted */
|
|
721 {"LightGreen" , PALETTERGB (144, 238, 144) },
|
|
722 /* Added to match values in the default Windows palette: */
|
|
723 {"DarkYellow" , PALETTERGB (128, 128, 0) },
|
|
724 {"PaleYellow" , PALETTERGB (255, 255, 128) }
|
428
|
725 };
|
|
726
|
|
727
|
442
|
728 typedef struct fontmap_t
|
428
|
729 {
|
771
|
730 const Char_ASCII *name;
|
442
|
731 int value;
|
428
|
732 } fontmap_t;
|
|
733
|
|
734 /* Default weight first, preferred names listed before synonyms */
|
442
|
735 static const fontmap_t fontweight_map[] =
|
428
|
736 {
|
|
737 {"Regular" , FW_REGULAR}, /* The standard font weight */
|
|
738 {"Thin" , FW_THIN},
|
|
739 {"Extra Light" , FW_EXTRALIGHT},
|
|
740 {"Ultra Light" , FW_ULTRALIGHT},
|
|
741 {"Light" , FW_LIGHT},
|
|
742 {"Normal" , FW_NORMAL},
|
|
743 {"Medium" , FW_MEDIUM},
|
|
744 {"Semi Bold" , FW_SEMIBOLD},
|
|
745 {"Demi Bold" , FW_DEMIBOLD},
|
|
746 {"Bold" , FW_BOLD}, /* The standard bold font weight */
|
|
747 {"Extra Bold" , FW_EXTRABOLD},
|
|
748 {"Ultra Bold" , FW_ULTRABOLD},
|
|
749 {"Heavy" , FW_HEAVY},
|
|
750 {"Black" , FW_BLACK}
|
|
751 };
|
|
752
|
442
|
753 /* Default charset first, no synonyms allowed because these names are
|
428
|
754 * matched against the names reported by win32 by match_font() */
|
442
|
755 static const fontmap_t charset_map[] =
|
428
|
756 {
|
771
|
757 {"Western" , ANSI_CHARSET}, /* Latin 1 */
|
|
758 {"Central European" , EASTEUROPE_CHARSET},
|
|
759 {"Cyrillic" , RUSSIAN_CHARSET},
|
428
|
760 {"Greek" , GREEK_CHARSET},
|
|
761 {"Turkish" , TURKISH_CHARSET},
|
771
|
762 {"Hebrew" , HEBREW_CHARSET},
|
|
763 {"Arabic" , ARABIC_CHARSET},
|
|
764 {"Baltic" , BALTIC_CHARSET},
|
|
765 {"Viet Nam" , VIETNAMESE_CHARSET},
|
|
766 {"Thai" , THAI_CHARSET},
|
|
767 {"Japanese" , SHIFTJIS_CHARSET},
|
|
768 {"Korean" , HANGEUL_CHARSET},
|
|
769 {"Simplified Chinese" , GB2312_CHARSET},
|
|
770 {"Traditional Chinese", CHINESEBIG5_CHARSET},
|
|
771
|
|
772 {"Symbol" , SYMBOL_CHARSET},
|
428
|
773 {"Mac" , MAC_CHARSET},
|
771
|
774 {"Korean Johab" , JOHAB_CHARSET},
|
428
|
775 {"OEM/DOS" , OEM_CHARSET}
|
|
776 };
|
|
777
|
788
|
778 #ifdef MULE
|
|
779
|
|
780 typedef struct unicode_subrange_raw_t
|
|
781 {
|
|
782 int subrange_bit;
|
|
783 int start; /* first Unicode codepoint */
|
|
784 int end; /* last Unicode codepoint */
|
|
785 } unicode_subrange_raw_t;
|
|
786
|
|
787 /* This table comes from MSDN, Unicode Subset Bitfields [Platform SDK
|
|
788 Documentation, Base Services, International Features, Unicode and
|
|
789 Character Sets, Unicode and Character Set Reference, Unicode and
|
|
790 Character Set Constants]. We preprocess it at startup time into an
|
|
791 array of unicode_subrange_t.
|
|
792 */
|
|
793
|
|
794 static const unicode_subrange_raw_t unicode_subrange_raw_map[] =
|
|
795 {
|
|
796 {0, 0x0020, 0x007e}, /* Basic Latin */
|
|
797 {1, 0x00a0, 0x00ff}, /* Latin-1 Supplement */
|
|
798 {2, 0x0100, 0x017f}, /* Latin Extended-A */
|
|
799 {3, 0x0180, 0x024f}, /* Latin Extended-B */
|
|
800 {4, 0x0250, 0x02af}, /* IPA Extensions */
|
|
801 {5, 0x02b0, 0x02ff}, /* Spacing Modifier Letters */
|
|
802 {6, 0x0300, 0x036f}, /* Combining Diacritical Marks */
|
|
803 {7, 0x0370, 0x03ff}, /* Basic Greek */
|
|
804 /* 8 Reserved */
|
|
805 {9, 0x0400, 0x04ff}, /* Cyrillic */
|
|
806 {10, 0x0530, 0x058f}, /* Armenian */
|
|
807 {11, 0x0590, 0x05ff}, /* Basic Hebrew */
|
|
808 /* 12 Reserved */
|
|
809 {13, 0x0600, 0x06ff}, /* Basic Arabic */
|
|
810 /* 14 Reserved */
|
|
811 {15, 0x0900, 0x097f}, /* Devanagari */
|
|
812 {16, 0x0980, 0x09ff}, /* Bengali */
|
|
813 {17, 0x0a00, 0x0a7f}, /* Gurmukhi */
|
|
814 {18, 0x0a80, 0x0aff}, /* Gujarati */
|
|
815 {19, 0x0b00, 0x0b7f}, /* Oriya */
|
|
816 {20, 0x0b80, 0x0bff}, /* Tamil */
|
|
817 {21, 0x0c00, 0x0c7f}, /* Telugu */
|
|
818 {22, 0x0c80, 0x0cff}, /* Kannada */
|
|
819 {23, 0x0d00, 0x0d7f}, /* Malayalam */
|
|
820 {24, 0x0e00, 0x0e7f}, /* Thai */
|
|
821 {25, 0x0e80, 0x0eff}, /* Lao */
|
|
822 {26, 0x10a0, 0x10ff}, /* Basic Georgian */
|
|
823 /* 27 Reserved */
|
|
824 {28, 0x1100, 0x11ff}, /* Hangul Jamo */
|
|
825 {29, 0x1e00, 0x1eff}, /* Latin Extended Additional */
|
|
826 {30, 0x1f00, 0x1fff}, /* Greek Extended */
|
|
827 {31, 0x2000, 0x206f}, /* General Punctuation */
|
|
828 {32, 0x2070, 0x209f}, /* Subscripts and Superscripts */
|
|
829 {33, 0x20a0, 0x20cf}, /* Currency Symbols */
|
|
830 {34, 0x20d0, 0x20ff}, /* Combining Diacritical Marks for Symbols */
|
|
831 {35, 0x2100, 0x214f}, /* Letter-like Symbols */
|
|
832 {36, 0x2150, 0x218f}, /* Number Forms */
|
|
833 {37, 0x2190, 0x21ff}, /* Arrows */
|
|
834 {38, 0x2200, 0x22ff}, /* Mathematical Operators */
|
|
835 {39, 0x2300, 0x23ff}, /* Miscellaneous Technical */
|
|
836 {40, 0x2400, 0x243f}, /* Control Pictures */
|
|
837 {41, 0x2440, 0x245f}, /* Optical Character Recognition */
|
|
838 {42, 0x2460, 0x24ff}, /* Enclosed Alphanumerics */
|
|
839 {43, 0x2500, 0x257f}, /* Box Drawing */
|
|
840 {44, 0x2580, 0x259f}, /* Block Elements */
|
|
841 {45, 0x25a0, 0x25ff}, /* Geometric Shapes */
|
|
842 {46, 0x2600, 0x26ff}, /* Miscellaneous Symbols */
|
|
843 {47, 0x2700, 0x27bf}, /* Dingbats */
|
|
844 {48, 0x3000, 0x303f}, /* Chinese, Japanese, and Korean (CJK) Symbols and Punctuation */
|
|
845 {49, 0x3040, 0x309f}, /* Hiragana */
|
|
846 {50, 0x30a0, 0x30ff}, /* Katakana */
|
|
847 {51, 0x3100, 0x312f}, /* Bopomofo */
|
|
848 {51, 0x31a0, 0x31bf}, /* Extended Bopomofo */
|
|
849 {52, 0x3130, 0x318f}, /* Hangul Compatibility Jamo */
|
|
850 {53, 0x3190, 0x319f}, /* CJK Miscellaneous */
|
|
851 {54, 0x3200, 0x32ff}, /* Enclosed CJK Letters and Months */
|
|
852 {55, 0x3300, 0x33ff}, /* CJK Compatibility */
|
|
853 {56, 0xac00, 0xd7a3}, /* Hangul */
|
|
854 {57, 0xd800, 0xdfff}, /* Surrogates. Note that setting this bit implies that there is at least one codepoint beyond the Basic Multilingual Plane that is supported by this font. */
|
|
855 /* 58 Reserved */
|
|
856 {59, 0x4e00, 0x9fff}, /* CJK Unified Ideographs */
|
|
857 {59, 0x2e80, 0x2eff}, /* CJK Radicals Supplement */
|
|
858 {59, 0x2f00, 0x2fdf}, /* Kangxi Radicals */
|
|
859 {59, 0x2ff0, 0x2fff}, /* Ideographic Description */
|
|
860 {59, 0x3400, 0x4dbf}, /* CJK Unified Ideograph Extension A */
|
|
861 {60, 0xe000, 0xf8ff}, /* Private Use Area */
|
|
862 {61, 0xf900, 0xfaff}, /* CJK Compatibility Ideographs */
|
|
863 {62, 0xfb00, 0xfb4f}, /* Alphabetic Presentation Forms */
|
|
864 {63, 0xfb50, 0xfdff}, /* Arabic Presentation Forms-A */
|
|
865 {64, 0xfe20, 0xfe2f}, /* Combining Half Marks */
|
|
866 {65, 0xfe30, 0xfe4f}, /* CJK Compatibility Forms */
|
|
867 {66, 0xfe50, 0xfe6f}, /* Small Form Variants */
|
|
868 {67, 0xfe70, 0xfefe}, /* Arabic Presentation Forms-B */
|
|
869 {68, 0xff00, 0xffef}, /* Halfwidth and Fullwidth Forms */
|
|
870 {69, 0xfff0, 0xfffd}, /* Specials */
|
|
871 {70, 0x0f00, 0x0fcf}, /* Tibetan */
|
|
872 {71, 0x0700, 0x074f}, /* Syriac */
|
|
873 {72, 0x0780, 0x07bf}, /* Thaana */
|
|
874 {73, 0x0d80, 0x0dff}, /* Sinhala */
|
|
875 {74, 0x1000, 0x109f}, /* Myanmar */
|
|
876 {75, 0x1200, 0x12bf}, /* Ethiopic */
|
|
877 {76, 0x13a0, 0x13ff}, /* Cherokee */
|
|
878 {77, 0x1400, 0x14df}, /* Canadian Aboriginal Syllabics */
|
|
879 {78, 0x1680, 0x169f}, /* Ogham */
|
|
880 {79, 0x16a0, 0x16ff}, /* Runic */
|
|
881 {80, 0x1780, 0x17ff}, /* Khmer */
|
|
882 {81, 0x1800, 0x18af}, /* Mongolian */
|
|
883 {82, 0x2800, 0x28ff}, /* Braille */
|
|
884 {83, 0xa000, 0xa48c}, /* Yi, Yi Radicals */
|
|
885 /* 84-122 Reserved */
|
|
886 /* 123 Windows 2000/XP: Layout progress: horizontal from right to left */
|
|
887 /* 124 Windows 2000/XP: Layout progress: vertical before horizontal */
|
|
888 /* 125 Windows 2000/XP: Layout progress: vertical bottom to top */
|
|
889 /* 126 Reserved; must be 0 */
|
|
890 /* 127 Reserved; must be 1 */
|
|
891 };
|
|
892
|
|
893 typedef struct unicode_subrange_t
|
|
894 {
|
|
895 int no_subranges;
|
|
896 const unicode_subrange_raw_t *subranges;
|
|
897 } unicode_subrange_t;
|
|
898
|
|
899 unicode_subrange_t *unicode_subrange_table;
|
|
900
|
|
901 /* Hash table mapping font specs (strings) to font signature data
|
|
902 (FONTSIGNATURE structures stored in opaques), as determined by
|
|
903 GetTextCharsetInfo(). I presume this is somewhat expensive because it
|
|
904 involves creating a font object. At the very least, with no hashing, it
|
|
905 definitely took awhile (a few seconds) when encountering characters from
|
|
906 charsets needing stage 2 processing. */
|
|
907 Lisp_Object Vfont_signature_data;
|
|
908
|
|
909 #endif /* MULE */
|
|
910
|
428
|
911
|
|
912 /************************************************************************/
|
|
913 /* helpers */
|
|
914 /************************************************************************/
|
|
915
|
|
916 static int
|
771
|
917 hexval (Intbyte c)
|
428
|
918 {
|
771
|
919 /* assumes ASCII and isxdigit (c) */
|
428
|
920 if (c >= 'a')
|
771
|
921 return c - 'a' + 10;
|
428
|
922 else if (c >= 'A')
|
771
|
923 return c - 'A' + 10;
|
428
|
924 else
|
771
|
925 return c - '0';
|
428
|
926 }
|
|
927
|
|
928 COLORREF
|
771
|
929 mswindows_string_to_color (const Intbyte *name)
|
428
|
930 {
|
|
931 int i;
|
|
932
|
|
933 if (*name == '#')
|
|
934 {
|
|
935 /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB"
|
|
936 or "rgb:rrrr/gggg/bbbb" */
|
|
937 unsigned int r, g, b;
|
442
|
938
|
771
|
939 for (i = 1; i < qxestrlen (name); i++)
|
428
|
940 {
|
771
|
941 if (!BYTE_ASCII_P (name[i]) || !isxdigit ((int) name[i]))
|
428
|
942 return (COLORREF) -1;
|
|
943 }
|
771
|
944 if (qxestrlen (name) == 7)
|
428
|
945 {
|
|
946 r = hexval (name[1]) * 16 + hexval (name[2]);
|
|
947 g = hexval (name[3]) * 16 + hexval (name[4]);
|
|
948 b = hexval (name[5]) * 16 + hexval (name[6]);
|
|
949 return (PALETTERGB (r, g, b));
|
|
950 }
|
771
|
951 else if (qxestrlen (name) == 10)
|
428
|
952 {
|
|
953 r = hexval (name[1]) * 16 + hexval (name[2]);
|
|
954 g = hexval (name[4]) * 16 + hexval (name[5]);
|
|
955 b = hexval (name[7]) * 16 + hexval (name[8]);
|
|
956 return (PALETTERGB (r, g, b));
|
|
957 }
|
771
|
958 else if (qxestrlen (name) == 13)
|
428
|
959 {
|
|
960 r = hexval (name[1]) * 16 + hexval (name[2]);
|
|
961 g = hexval (name[5]) * 16 + hexval (name[6]);
|
|
962 b = hexval (name[9]) * 16 + hexval (name[10]);
|
|
963 return (PALETTERGB (r, g, b));
|
|
964 }
|
|
965 }
|
771
|
966 else if (!qxestrncmp_c (name, "rgb:", 4))
|
428
|
967 {
|
771
|
968 unsigned int r, g, b;
|
428
|
969
|
771
|
970 if (sscanf ((CIntbyte *) name, "rgb:%04x/%04x/%04x", &r, &g, &b) == 3)
|
428
|
971 {
|
771
|
972 int len = qxestrlen (name);
|
428
|
973 if (len == 18)
|
|
974 {
|
|
975 r /= 257;
|
|
976 g /= 257;
|
|
977 b /= 257;
|
|
978 }
|
|
979 else if (len == 15)
|
|
980 {
|
|
981 r /= 17;
|
|
982 g /= 17;
|
|
983 b /= 17;
|
|
984 }
|
|
985 return (PALETTERGB (r, g, b));
|
|
986 }
|
442
|
987 else
|
428
|
988 return (COLORREF) -1;
|
|
989 }
|
|
990 else if (*name) /* Can't be an empty string */
|
|
991 {
|
771
|
992 Intbyte *nospaces = (Intbyte *) alloca (qxestrlen (name) + 1);
|
|
993 Intbyte *c = nospaces;
|
428
|
994 while (*name)
|
|
995 if (*name != ' ')
|
442
|
996 *c++ = *name++;
|
428
|
997 else
|
|
998 name++;
|
|
999 *c = '\0';
|
|
1000
|
442
|
1001 for (i = 0; i < countof (mswindows_X_color_map); i++)
|
771
|
1002 if (!qxestrcasecmp_c (nospaces, mswindows_X_color_map[i].name))
|
428
|
1003 return (mswindows_X_color_map[i].colorref);
|
|
1004 }
|
|
1005 return (COLORREF) -1;
|
|
1006 }
|
|
1007
|
442
|
1008 Lisp_Object
|
|
1009 mswindows_color_to_string (COLORREF color)
|
|
1010 {
|
|
1011 int i;
|
771
|
1012 Char_ASCII buf[8];
|
442
|
1013 COLORREF pcolor = PALETTERGB (GetRValue (color), GetGValue (color),
|
|
1014 GetBValue (color));
|
|
1015
|
771
|
1016 for (i = 0; i < countof (mswindows_X_color_map); i++)
|
442
|
1017 if (pcolor == (mswindows_X_color_map[i].colorref))
|
|
1018 return build_string (mswindows_X_color_map[i].name);
|
|
1019
|
|
1020 sprintf (buf, "#%02X%02X%02X",
|
|
1021 GetRValue (color), GetGValue (color), GetBValue (color));
|
|
1022 return build_string (buf);
|
|
1023 }
|
|
1024
|
428
|
1025 /*
|
|
1026 * Returns non-zero if the two supplied font patterns match.
|
|
1027 * If they match and fontname is not NULL, copies the logical OR of the
|
|
1028 * patterns to fontname (which is assumed to be at least MSW_FONTSIZE in size).
|
|
1029 *
|
|
1030 * The patterns 'match' iff for each field that is not blank in either pattern,
|
|
1031 * the corresponding field in the other pattern is either identical or blank.
|
|
1032 */
|
|
1033 static int
|
771
|
1034 match_font (Intbyte *pattern1, Intbyte *pattern2,
|
|
1035 Intbyte *fontname)
|
428
|
1036 {
|
771
|
1037 Intbyte *c1 = pattern1, *c2 = pattern2, *e1 = 0, *e2 = 0;
|
428
|
1038 int i;
|
|
1039
|
|
1040 if (fontname)
|
|
1041 fontname[0] = '\0';
|
|
1042
|
771
|
1043 for (i = 0; i < 5; i++)
|
428
|
1044 {
|
771
|
1045 if (c1 && (e1 = qxestrchr (c1, ':')))
|
428
|
1046 *(e1) = '\0';
|
771
|
1047 if (c2 && (e2 = qxestrchr (c2, ':')))
|
428
|
1048 *(e2) = '\0';
|
|
1049
|
771
|
1050 if (c1 && c1[0] != '\0')
|
428
|
1051 {
|
771
|
1052 if (c2 && c2[0] != '\0' && qxestrcasecmp (c1, c2))
|
428
|
1053 {
|
|
1054 if (e1) *e1 = ':';
|
|
1055 if (e2) *e2 = ':';
|
|
1056 return 0;
|
|
1057 }
|
|
1058 else if (fontname)
|
771
|
1059 qxestrcat_c (qxestrcat (fontname, c1), ":");
|
428
|
1060 }
|
|
1061 else if (fontname)
|
|
1062 {
|
771
|
1063 if (c2 && c2[0] != '\0')
|
|
1064 qxestrcat_c (qxestrcat (fontname, c2), ":");
|
428
|
1065 else
|
771
|
1066 qxestrcat_c (fontname, ":");
|
428
|
1067 }
|
|
1068
|
|
1069 if (e1) *(e1++) = ':';
|
|
1070 if (e2) *(e2++) = ':';
|
771
|
1071 c1 = e1;
|
|
1072 c2 = e2;
|
428
|
1073 }
|
|
1074
|
|
1075 if (fontname)
|
771
|
1076 fontname[qxestrlen (fontname) - 1] = '\0'; /* Trim trailing ':' */
|
428
|
1077 return 1;
|
|
1078 }
|
|
1079
|
|
1080
|
|
1081 /************************************************************************/
|
|
1082 /* exports */
|
|
1083 /************************************************************************/
|
|
1084
|
|
1085 struct font_enum_t
|
|
1086 {
|
|
1087 HDC hdc;
|
440
|
1088 Lisp_Object list;
|
428
|
1089 };
|
|
1090
|
|
1091 static int CALLBACK
|
771
|
1092 font_enum_callback_2 (ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEXW *lpntme,
|
|
1093 int FontType, struct font_enum_t *font_enum)
|
442
|
1094 {
|
771
|
1095 Intbyte fontname[MSW_FONTSIZE * 2 * MAX_EMCHAR_LEN]; /* should be enough :)*/
|
442
|
1096 Lisp_Object fontname_lispstr;
|
|
1097 int i;
|
771
|
1098 Intbyte *facename;
|
428
|
1099
|
|
1100 /*
|
|
1101 * The enumerated font weights are not to be trusted because:
|
|
1102 * a) lpelfe->elfStyle is only filled in for TrueType fonts.
|
442
|
1103 * b) Not all Bold and Italic styles of all fonts (including some Vector,
|
428
|
1104 * Truetype and Raster fonts) are enumerated.
|
|
1105 * I guess that fonts for which Bold and Italic styles are generated
|
|
1106 * 'on-the-fly' are not enumerated. It would be overly restrictive to
|
|
1107 * disallow Bold And Italic weights for these fonts, so we just leave
|
|
1108 * weights unspecified. This means that we have to weed out duplicates of
|
|
1109 * those fonts that do get enumerated with different weights.
|
|
1110 */
|
771
|
1111 TSTR_TO_C_STRING (lpelfe->elfLogFont.lfFaceName, facename);
|
|
1112 if (charptr_emchar (facename) == '@')
|
|
1113 /* This is a font for writing vertically. We ignore it. */
|
|
1114 return 1;
|
|
1115
|
|
1116 if (FontType == 0 /*vector*/ || FontType & TRUETYPE_FONTTYPE)
|
428
|
1117 /* Scalable, so leave pointsize blank */
|
771
|
1118 qxesprintf (fontname, "%s::::", facename);
|
428
|
1119 else
|
|
1120 /* Formula for pointsize->height from LOGFONT docs in Platform SDK */
|
771
|
1121 qxesprintf (fontname, "%s::%d::", facename,
|
|
1122 MulDiv (lpntme->ntmTm.tmHeight -
|
|
1123 lpntme->ntmTm.tmInternalLeading,
|
|
1124 72, GetDeviceCaps (font_enum->hdc, LOGPIXELSY)));
|
428
|
1125
|
|
1126 /*
|
|
1127 * The enumerated font character set strings are not to be trusted because
|
|
1128 * lpelfe->elfScript is returned in the host language and not in English.
|
|
1129 * We can't know a priori the translations of "Western", "Central European"
|
|
1130 * etc into the host language, so we must use English. The same argument
|
|
1131 * applies to the font weight string when matching fonts.
|
|
1132 */
|
771
|
1133 for (i = 0; i < countof (charset_map); i++)
|
428
|
1134 if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
|
|
1135 {
|
771
|
1136 qxestrcat_c (fontname, charset_map[i].name);
|
428
|
1137 break;
|
|
1138 }
|
771
|
1139 if (i == countof (charset_map))
|
|
1140 return 1;
|
428
|
1141
|
440
|
1142 /* Add the font name to the list if not already there */
|
771
|
1143 fontname_lispstr = build_intstring (fontname);
|
|
1144 if (NILP (Fmember (fontname_lispstr, font_enum->list)))
|
440
|
1145 font_enum->list = Fcons (fontname_lispstr, font_enum->list);
|
428
|
1146
|
|
1147 return 1;
|
|
1148 }
|
|
1149
|
|
1150 static int CALLBACK
|
771
|
1151 font_enum_callback_1 (ENUMLOGFONTEXW *lpelfe, NEWTEXTMETRICEXW *lpntme,
|
428
|
1152 int FontType, struct font_enum_t *font_enum)
|
|
1153 {
|
|
1154 /* This function gets called once per facename per character set.
|
|
1155 * We call a second callback to enumerate the fonts in each facename */
|
771
|
1156 return qxeEnumFontFamiliesEx (font_enum->hdc, &lpelfe->elfLogFont,
|
|
1157 (FONTENUMPROCW) font_enum_callback_2,
|
|
1158 (LPARAM) font_enum, 0);
|
428
|
1159 }
|
|
1160
|
|
1161 /*
|
440
|
1162 * Enumerate the available on the HDC fonts and return a list of string
|
|
1163 * font names.
|
428
|
1164 */
|
440
|
1165 Lisp_Object
|
|
1166 mswindows_enumerate_fonts (HDC hdc)
|
428
|
1167 {
|
771
|
1168 /* This cannot GC */
|
|
1169 LOGFONTW logfont;
|
428
|
1170 struct font_enum_t font_enum;
|
|
1171
|
771
|
1172 assert (hdc != NULL);
|
428
|
1173 logfont.lfCharSet = DEFAULT_CHARSET;
|
|
1174 logfont.lfFaceName[0] = '\0';
|
|
1175 logfont.lfPitchAndFamily = DEFAULT_PITCH;
|
|
1176 font_enum.hdc = hdc;
|
440
|
1177 font_enum.list = Qnil;
|
771
|
1178 /* EnumFontFamilies seems to enumerate only one charset per font, which
|
|
1179 is not what we want. We aren't supporting NT 3.5x, so no need to
|
|
1180 worry about this not existing. */
|
|
1181 qxeEnumFontFamiliesEx (hdc, &logfont, (FONTENUMPROCW) font_enum_callback_1,
|
|
1182 (LPARAM) (&font_enum), 0);
|
442
|
1183
|
440
|
1184 return font_enum.list;
|
428
|
1185 }
|
|
1186
|
442
|
1187 static HFONT
|
771
|
1188 mswindows_create_font_variant (Lisp_Font_Instance *f,
|
440
|
1189 int under, int strike)
|
|
1190 {
|
|
1191 /* Cannot GC */
|
771
|
1192 LOGFONTW lf;
|
440
|
1193 HFONT hfont;
|
|
1194
|
|
1195 assert (FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike) == NULL);
|
|
1196
|
771
|
1197 if (qxeGetObject (FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0),
|
|
1198 sizeof (lf), (void *) &lf) == 0)
|
440
|
1199 {
|
|
1200 hfont = MSWINDOWS_BAD_HFONT;
|
|
1201 }
|
|
1202 else
|
|
1203 {
|
|
1204 lf.lfUnderline = under;
|
|
1205 lf.lfStrikeOut = strike;
|
|
1206
|
771
|
1207 hfont = qxeCreateFontIndirect (&lf);
|
440
|
1208 if (hfont == NULL)
|
|
1209 hfont = MSWINDOWS_BAD_HFONT;
|
|
1210 }
|
|
1211
|
|
1212 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike) = hfont;
|
442
|
1213 return hfont;
|
440
|
1214 }
|
|
1215
|
|
1216 HFONT
|
771
|
1217 mswindows_get_hfont (Lisp_Font_Instance *f,
|
440
|
1218 int under, int strike)
|
|
1219 {
|
|
1220 /* Cannot GC */
|
442
|
1221 HFONT hfont = FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike);
|
440
|
1222
|
442
|
1223 if (hfont == NULL)
|
|
1224 hfont = mswindows_create_font_variant (f, under, strike);
|
440
|
1225
|
|
1226 /* If strikeout/underline variant of the font could not be
|
|
1227 created, then use the base version of the font */
|
|
1228 if (hfont == MSWINDOWS_BAD_HFONT)
|
|
1229 hfont = FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0);
|
|
1230
|
|
1231 assert (hfont != NULL && hfont != MSWINDOWS_BAD_HFONT);
|
|
1232
|
|
1233 return hfont;
|
|
1234 }
|
428
|
1235
|
|
1236 /************************************************************************/
|
|
1237 /* methods */
|
|
1238 /************************************************************************/
|
|
1239
|
|
1240 static int
|
440
|
1241 mswindows_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name,
|
647
|
1242 Lisp_Object device, Error_Behavior errb)
|
428
|
1243 {
|
|
1244 COLORREF color;
|
|
1245
|
771
|
1246 color = mswindows_string_to_color (XSTRING_DATA (name));
|
647
|
1247 if (color != (COLORREF) -1)
|
428
|
1248 {
|
|
1249 c->data = xnew (struct mswindows_color_instance_data);
|
|
1250 COLOR_INSTANCE_MSWINDOWS_COLOR (c) = color;
|
|
1251 return 1;
|
|
1252 }
|
563
|
1253 maybe_signal_error (Qinvalid_constant,
|
771
|
1254 "Unrecognized color", name, Qcolor, errb);
|
428
|
1255 return(0);
|
|
1256 }
|
|
1257
|
|
1258 #if 0
|
|
1259 static void
|
440
|
1260 mswindows_mark_color_instance (Lisp_Color_Instance *c)
|
428
|
1261 {
|
|
1262 }
|
|
1263 #endif
|
|
1264
|
|
1265 static void
|
440
|
1266 mswindows_print_color_instance (Lisp_Color_Instance *c,
|
|
1267 Lisp_Object printcharfun,
|
|
1268 int escapeflag)
|
428
|
1269 {
|
|
1270 COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
|
793
|
1271 write_fmt_string (printcharfun,
|
|
1272 " %06ld=(%04X,%04X,%04X)", color & 0xffffff,
|
|
1273 GetRValue (color) * 257, GetGValue (color) * 257,
|
|
1274 GetBValue (color) * 257);
|
428
|
1275 }
|
|
1276
|
|
1277 static void
|
440
|
1278 mswindows_finalize_color_instance (Lisp_Color_Instance *c)
|
428
|
1279 {
|
|
1280 if (c->data)
|
|
1281 {
|
|
1282 xfree (c->data);
|
|
1283 c->data = 0;
|
|
1284 }
|
|
1285 }
|
|
1286
|
|
1287 static int
|
440
|
1288 mswindows_color_instance_equal (Lisp_Color_Instance *c1,
|
|
1289 Lisp_Color_Instance *c2,
|
|
1290 int depth)
|
428
|
1291 {
|
793
|
1292 return (COLOR_INSTANCE_MSWINDOWS_COLOR (c1) ==
|
|
1293 COLOR_INSTANCE_MSWINDOWS_COLOR (c2));
|
428
|
1294 }
|
|
1295
|
|
1296 static unsigned long
|
440
|
1297 mswindows_color_instance_hash (Lisp_Color_Instance *c, int depth)
|
428
|
1298 {
|
793
|
1299 return (unsigned long) COLOR_INSTANCE_MSWINDOWS_COLOR (c);
|
428
|
1300 }
|
|
1301
|
|
1302 static Lisp_Object
|
440
|
1303 mswindows_color_instance_rgb_components (Lisp_Color_Instance *c)
|
428
|
1304 {
|
|
1305 COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
|
|
1306 return list3 (make_int (GetRValue (color) * 257),
|
|
1307 make_int (GetGValue (color) * 257),
|
|
1308 make_int (GetBValue (color) * 257));
|
|
1309 }
|
|
1310
|
|
1311 static int
|
|
1312 mswindows_valid_color_name_p (struct device *d, Lisp_Object color)
|
|
1313 {
|
771
|
1314 return (mswindows_string_to_color (XSTRING_DATA (color)) != (COLORREF) -1);
|
428
|
1315 }
|
|
1316
|
|
1317
|
|
1318
|
|
1319 static void
|
440
|
1320 mswindows_finalize_font_instance (Lisp_Font_Instance *f);
|
428
|
1321
|
788
|
1322 static HFONT
|
|
1323 create_hfont_from_font_spec (const Intbyte *namestr,
|
|
1324 HDC hdc,
|
|
1325 Lisp_Object name_for_errors,
|
|
1326 Lisp_Object device_font_list,
|
|
1327 Error_Behavior errb)
|
428
|
1328 {
|
771
|
1329 LOGFONTW logfont;
|
428
|
1330 int fields, i;
|
|
1331 int pt;
|
771
|
1332 Intbyte fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8];
|
|
1333 Intbyte effects[LF_FACESIZE], charset[LF_FACESIZE];
|
|
1334 Intbyte *c;
|
788
|
1335 HFONT hfont;
|
428
|
1336
|
|
1337 /*
|
|
1338 * mswindows fonts look like:
|
|
1339 * fontname[:[weight ][style][:pointsize[:effects]]][:charset]
|
|
1340 * The font name field shouldn't be empty.
|
|
1341 *
|
|
1342 * ie:
|
|
1343 * Lucida Console:Regular:10
|
|
1344 * minimal:
|
|
1345 * Courier New
|
|
1346 * maximal:
|
|
1347 * Courier New:Bold Italic:10:underline strikeout:western
|
|
1348 */
|
|
1349
|
771
|
1350 fields = sscanf ((CIntbyte *) namestr, "%31[^:]:%31[^:]:%7[^:]:%31[^:]:%31s",
|
428
|
1351 fontname, weight, points, effects, charset);
|
|
1352
|
|
1353 /* This function is implemented in a fairly ad-hoc manner.
|
|
1354 * The general idea is to validate and canonicalize each of the above fields
|
|
1355 * at the same time as we build up the win32 LOGFONT structure. This enables
|
|
1356 * us to use match_font() on a canonicalized font string to check the
|
|
1357 * availability of the requested font */
|
|
1358
|
|
1359 if (fields < 0)
|
771
|
1360 {
|
788
|
1361 maybe_signal_error (Qinvalid_argument, "Invalid font", name_for_errors,
|
771
|
1362 Qfont, errb);
|
788
|
1363 return NULL;
|
771
|
1364 }
|
|
1365
|
|
1366 if (fields > 0 && qxestrlen (fontname))
|
|
1367 {
|
|
1368 Extbyte *extfontname;
|
428
|
1369
|
771
|
1370 C_STRING_TO_TSTR (fontname, extfontname);
|
|
1371 xetcsncpy ((Extbyte *) logfont.lfFaceName, extfontname, LF_FACESIZE - 1);
|
|
1372 logfont.lfFaceName[LF_FACESIZE - 1] = 0;
|
|
1373 }
|
428
|
1374 else
|
771
|
1375 {
|
|
1376 maybe_signal_error (Qinvalid_argument, "Must specify a font name",
|
788
|
1377 name_for_errors, Qfont, errb);
|
|
1378 return NULL;
|
771
|
1379 }
|
428
|
1380
|
|
1381 /* weight */
|
|
1382 if (fields < 2)
|
771
|
1383 qxestrcpy_c (weight, fontweight_map[0].name);
|
428
|
1384
|
|
1385 /* Maybe split weight into weight and style */
|
771
|
1386 if ((c = qxestrchr (weight, ' ')))
|
428
|
1387 {
|
|
1388 *c = '\0';
|
771
|
1389 style = c + 1;
|
428
|
1390 }
|
|
1391 else
|
|
1392 style = NULL;
|
|
1393
|
771
|
1394 for (i = 0; i < countof (fontweight_map); i++)
|
|
1395 if (!qxestrcasecmp_c (weight, fontweight_map[i].name))
|
442
|
1396 {
|
428
|
1397 logfont.lfWeight = fontweight_map[i].value;
|
|
1398 break;
|
|
1399 }
|
|
1400 if (i == countof (fontweight_map)) /* No matching weight */
|
|
1401 {
|
|
1402 if (!style)
|
|
1403 {
|
|
1404 logfont.lfWeight = FW_REGULAR;
|
|
1405 style = weight; /* May have specified style without weight */
|
|
1406 }
|
|
1407 else
|
|
1408 {
|
788
|
1409 maybe_signal_error (Qinvalid_constant, "Invalid font weight",
|
|
1410 name_for_errors, Qfont, errb);
|
|
1411 return NULL;
|
428
|
1412 }
|
|
1413 }
|
|
1414
|
|
1415 if (style)
|
|
1416 {
|
|
1417 /* #### what about oblique? */
|
771
|
1418 if (qxestrcasecmp_c (style, "italic") == 0)
|
428
|
1419 logfont.lfItalic = TRUE;
|
|
1420 else
|
788
|
1421 {
|
|
1422 maybe_signal_error (Qinvalid_constant,
|
|
1423 "Invalid font weight or style",
|
|
1424 name_for_errors, Qfont, errb);
|
|
1425 return NULL;
|
428
|
1426 }
|
|
1427
|
|
1428 /* Glue weight and style together again */
|
|
1429 if (weight != style)
|
|
1430 *c = ' ';
|
|
1431 }
|
|
1432 else
|
|
1433 logfont.lfItalic = FALSE;
|
|
1434
|
|
1435 if (fields < 3)
|
|
1436 pt = 10; /* #### Should we reject strings that don't specify a size? */
|
771
|
1437 else if ((pt = qxeatoi (points)) == 0)
|
428
|
1438 {
|
788
|
1439 maybe_signal_error (Qinvalid_argument, "Invalid font pointsize",
|
|
1440 name_for_errors, Qfont, errb);
|
|
1441 return NULL;
|
428
|
1442 }
|
|
1443
|
|
1444 /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform SDK */
|
771
|
1445 logfont.lfHeight = -MulDiv (pt, GetDeviceCaps (hdc, LOGPIXELSY), 72);
|
428
|
1446 logfont.lfWidth = 0;
|
|
1447
|
|
1448 /* Effects */
|
|
1449 logfont.lfUnderline = FALSE;
|
|
1450 logfont.lfStrikeOut = FALSE;
|
|
1451 if (fields >= 4 && effects[0] != '\0')
|
|
1452 {
|
771
|
1453 Intbyte *effects2;
|
428
|
1454
|
|
1455 /* Maybe split effects into effects and effects2 */
|
771
|
1456 if ((c = qxestrchr (effects, ' ')))
|
428
|
1457 {
|
|
1458 *c = '\0';
|
771
|
1459 effects2 = c + 1;
|
428
|
1460 }
|
|
1461 else
|
|
1462 effects2 = NULL;
|
|
1463
|
771
|
1464 if (qxestrcasecmp_c (effects, "underline") == 0)
|
428
|
1465 logfont.lfUnderline = TRUE;
|
771
|
1466 else if (qxestrcasecmp_c (effects, "strikeout") == 0)
|
428
|
1467 logfont.lfStrikeOut = TRUE;
|
|
1468 else
|
|
1469 {
|
788
|
1470 maybe_signal_error (Qinvalid_constant, "Invalid font effect",
|
|
1471 name_for_errors, Qfont, errb);
|
|
1472 return NULL;
|
428
|
1473 }
|
|
1474
|
|
1475 if (effects2 && effects2[0] != '\0')
|
|
1476 {
|
771
|
1477 if (qxestrcasecmp_c (effects2, "underline") == 0)
|
428
|
1478 logfont.lfUnderline = TRUE;
|
771
|
1479 else if (qxestrcasecmp_c (effects2, "strikeout") == 0)
|
428
|
1480 logfont.lfStrikeOut = TRUE;
|
|
1481 else
|
|
1482 {
|
771
|
1483 maybe_signal_error (Qinvalid_constant, "Invalid font effect",
|
788
|
1484 name_for_errors, Qfont, errb);
|
|
1485 return NULL;
|
428
|
1486 }
|
|
1487 }
|
|
1488
|
|
1489 /* Regenerate sanitised effects string */
|
|
1490 if (logfont.lfUnderline)
|
|
1491 {
|
|
1492 if (logfont.lfStrikeOut)
|
771
|
1493 qxestrcpy_c (effects, "underline strikeout");
|
428
|
1494 else
|
771
|
1495 qxestrcpy_c (effects, "underline");
|
428
|
1496 }
|
|
1497 else if (logfont.lfStrikeOut)
|
771
|
1498 qxestrcpy_c (effects, "strikeout");
|
428
|
1499 }
|
|
1500 else
|
|
1501 effects[0] = '\0';
|
|
1502
|
|
1503 /* Charset */
|
442
|
1504 /* charset can be specified even if earlier fields haven't been */
|
428
|
1505 if (fields < 5)
|
|
1506 {
|
771
|
1507 if ((c = qxestrchr (namestr, ':')) && (c = qxestrchr (c + 1, ':')) &&
|
|
1508 (c = qxestrchr (c + 1, ':')) && (c = qxestrchr (c + 1, ':')))
|
428
|
1509 {
|
771
|
1510 qxestrncpy (charset, c + 1, LF_FACESIZE);
|
|
1511 charset[LF_FACESIZE - 1] = '\0';
|
428
|
1512 }
|
|
1513 else
|
771
|
1514 qxestrcpy_c (charset, charset_map[0].name);
|
428
|
1515 }
|
|
1516
|
771
|
1517 for (i = 0; i < countof (charset_map); i++)
|
|
1518 if (!qxestrcasecmp_c (charset, charset_map[i].name))
|
428
|
1519 {
|
|
1520 logfont.lfCharSet = charset_map[i].value;
|
|
1521 break;
|
|
1522 }
|
|
1523
|
|
1524 if (i == countof (charset_map)) /* No matching charset */
|
|
1525 {
|
788
|
1526 maybe_signal_error (Qinvalid_argument, "Invalid charset",
|
|
1527 name_for_errors, Qfont, errb);
|
|
1528 return NULL;
|
428
|
1529 }
|
|
1530
|
|
1531 /* Misc crud */
|
|
1532 logfont.lfEscapement = logfont.lfOrientation = 0;
|
|
1533 #if 1
|
|
1534 logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
|
|
1535 logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
|
1536 logfont.lfQuality = DEFAULT_QUALITY;
|
|
1537 #else
|
|
1538 logfont.lfOutPrecision = OUT_STROKE_PRECIS;
|
|
1539 logfont.lfClipPrecision = CLIP_STROKE_PRECIS;
|
|
1540 logfont.lfQuality = PROOF_QUALITY;
|
|
1541 #endif
|
|
1542 /* Default to monospaced if the specified fontname doesn't exist. */
|
|
1543 logfont.lfPitchAndFamily = FF_MODERN;
|
|
1544
|
442
|
1545 /* Windows will silently substitute a default font if the fontname specifies
|
|
1546 a non-existent font. This is bad for screen fonts because it doesn't
|
|
1547 allow higher-level code to see the error and to act appropriately.
|
|
1548 For instance complex_vars_of_faces() sets up a fallback list of fonts
|
|
1549 for the default face. */
|
440
|
1550
|
|
1551 if (!NILP (device_font_list))
|
|
1552 {
|
|
1553 Lisp_Object fonttail;
|
771
|
1554 Intbyte truename[MSW_FONTSIZE];
|
428
|
1555
|
771
|
1556 qxesprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects,
|
|
1557 charset);
|
440
|
1558 LIST_LOOP (fonttail, device_font_list)
|
|
1559 {
|
771
|
1560 if (match_font (XSTRING_DATA (XCAR (fonttail)), truename,
|
|
1561 NULL))
|
440
|
1562 break;
|
|
1563 }
|
|
1564 if (NILP (fonttail))
|
|
1565 {
|
788
|
1566 maybe_signal_error (Qinvalid_argument, "No matching font",
|
|
1567 name_for_errors, Qfont, errb);
|
|
1568 return NULL;
|
440
|
1569 }
|
|
1570 }
|
|
1571
|
771
|
1572 if ((hfont = qxeCreateFontIndirect (&logfont)) == NULL)
|
788
|
1573 {
|
|
1574 maybe_signal_error (Qgui_error, "Couldn't create font",
|
|
1575 name_for_errors, Qfont, errb);
|
|
1576 return NULL;
|
|
1577 }
|
|
1578
|
|
1579 return hfont;
|
|
1580 }
|
|
1581
|
428
|
1582
|
788
|
1583 /*
|
|
1584 * This is a work horse for both mswindows_initialize_font_instance and
|
|
1585 * msprinter_initialize_font_instance.
|
|
1586 */
|
|
1587 static int
|
|
1588 initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
|
|
1589 Lisp_Object device_font_list, HDC hdc,
|
|
1590 Error_Behavior errb)
|
|
1591 {
|
|
1592 HFONT hfont, hfont2;
|
|
1593 TEXTMETRICW metrics;
|
|
1594 Intbyte *namestr = XSTRING_DATA (name);
|
|
1595
|
|
1596 hfont = create_hfont_from_font_spec (namestr, hdc, name, device_font_list,
|
|
1597 errb);
|
440
|
1598 f->data = xnew_and_zero (struct mswindows_font_instance_data);
|
|
1599 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0) = hfont;
|
442
|
1600
|
|
1601 /* Some underlined fonts have the descent of one pixel more than their
|
|
1602 non-underlined counterparts. Font variants though are assumed to have
|
|
1603 identical metrics. So get the font metrics from the underlined variant
|
|
1604 of the font */
|
|
1605 hfont2 = mswindows_create_font_variant (f, 1, 0);
|
|
1606 if (hfont2 != MSWINDOWS_BAD_HFONT)
|
|
1607 hfont = hfont2;
|
|
1608
|
|
1609 hfont2 = (HFONT) SelectObject (hdc, hfont);
|
|
1610 if (!hfont2)
|
428
|
1611 {
|
440
|
1612 mswindows_finalize_font_instance (f);
|
563
|
1613 maybe_signal_error (Qgui_error, "Couldn't map font", name, Qfont, errb);
|
440
|
1614 return 0;
|
|
1615 }
|
771
|
1616 qxeGetTextMetrics (hdc, &metrics);
|
|
1617 SelectObject (hdc, hfont2);
|
440
|
1618
|
|
1619 f->width = (unsigned short) metrics.tmAveCharWidth;
|
|
1620 f->height = (unsigned short) metrics.tmHeight;
|
442
|
1621 f->ascent = (unsigned short) metrics.tmAscent;
|
|
1622 f->descent = (unsigned short) metrics.tmDescent;
|
440
|
1623 f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH);
|
|
1624
|
|
1625 return 1;
|
|
1626 }
|
|
1627
|
|
1628 static int
|
|
1629 mswindows_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
|
578
|
1630 Lisp_Object device, Error_Behavior errb)
|
440
|
1631 {
|
|
1632 HDC hdc = CreateCompatibleDC (NULL);
|
|
1633 Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device));
|
|
1634 int res = initialize_font_instance (f, name, font_list, hdc, errb);
|
|
1635 DeleteDC (hdc);
|
|
1636 return res;
|
|
1637 }
|
|
1638
|
|
1639 static int
|
|
1640 msprinter_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
|
578
|
1641 Lisp_Object device, Error_Behavior errb)
|
440
|
1642 {
|
|
1643 HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (device));
|
|
1644 Lisp_Object font_list = DEVICE_MSPRINTER_FONTLIST (XDEVICE (device));
|
|
1645 return initialize_font_instance (f, name, font_list, hdc, errb);
|
|
1646 }
|
|
1647
|
|
1648 static void
|
|
1649 mswindows_finalize_font_instance (Lisp_Font_Instance *f)
|
|
1650 {
|
|
1651 int i;
|
|
1652
|
|
1653 if (f->data)
|
|
1654 {
|
|
1655 for (i = 0; i < MSWINDOWS_NUM_FONT_VARIANTS; i++)
|
428
|
1656 {
|
440
|
1657 if (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i) != NULL
|
|
1658 && FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i) != MSWINDOWS_BAD_HFONT)
|
|
1659 DeleteObject (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i));
|
428
|
1660 }
|
440
|
1661
|
|
1662 xfree (f->data);
|
|
1663 f->data = 0;
|
|
1664 }
|
428
|
1665 }
|
|
1666
|
|
1667 #if 0
|
|
1668 static void
|
440
|
1669 mswindows_mark_font_instance (Lisp_Font_Instance *f)
|
428
|
1670 {
|
|
1671 }
|
|
1672 #endif
|
|
1673
|
|
1674 static void
|
440
|
1675 mswindows_print_font_instance (Lisp_Font_Instance *f,
|
|
1676 Lisp_Object printcharfun,
|
|
1677 int escapeflag)
|
428
|
1678 {
|
793
|
1679 write_fmt_string (printcharfun, " 0x%lx",
|
|
1680 (unsigned long)
|
|
1681 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0));
|
|
1682
|
428
|
1683 }
|
|
1684
|
|
1685 static Lisp_Object
|
|
1686 mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device)
|
|
1687 {
|
771
|
1688 struct device *d = XDEVICE (device);
|
|
1689 Lisp_Object font_list = Qnil, fonttail, result = Qnil;
|
428
|
1690
|
771
|
1691 if (DEVICE_MSWINDOWS_P (d))
|
|
1692 font_list = DEVICE_MSWINDOWS_FONTLIST (d);
|
|
1693 else if (DEVICE_MSPRINTER_P (d))
|
|
1694 font_list = DEVICE_MSPRINTER_FONTLIST (d);
|
|
1695 else
|
|
1696 abort ();
|
440
|
1697
|
771
|
1698 LIST_LOOP (fonttail, font_list)
|
428
|
1699 {
|
771
|
1700 Intbyte fontname[MSW_FONTSIZE];
|
|
1701
|
|
1702 if (match_font (XSTRING_DATA (XCAR (fonttail)), XSTRING_DATA (pattern),
|
|
1703 fontname))
|
|
1704 result = Fcons (build_intstring (fontname), result);
|
428
|
1705 }
|
|
1706
|
|
1707 return Fnreverse (result);
|
|
1708 }
|
|
1709
|
|
1710 /* Fill in missing parts of a font spec. This is primarily intended as a
|
|
1711 * helper function for the functions below.
|
|
1712 * mswindows fonts look like:
|
|
1713 * fontname[:[weight][ style][:pointsize[:effects]]][:charset]
|
|
1714 * A minimal mswindows font spec looks like:
|
|
1715 * Courier New
|
|
1716 * A maximal mswindows font spec looks like:
|
|
1717 * Courier New:Bold Italic:10:underline strikeout:Western
|
|
1718 * Missing parts of the font spec should be filled in with these values:
|
|
1719 * Courier New:Regular:10::Western */
|
|
1720 static Lisp_Object
|
578
|
1721 mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_Behavior errb)
|
428
|
1722 {
|
771
|
1723 /* #### does not handle charset at end!!! charset can be given even
|
|
1724 when previous fields are not.
|
|
1725
|
|
1726 #### does not canonicalize given fields! needs to be merged
|
|
1727 with initialize_font_instance(). */
|
|
1728
|
|
1729 int nsep = 0;
|
793
|
1730 Intbyte *ptr = (Intbyte *) XSTRING_DATA (f->name);
|
|
1731 Intbyte *name = (Intbyte *) alloca (XSTRING_LENGTH (f->name) + 19);
|
771
|
1732
|
793
|
1733 qxestrcpy (name, ptr);
|
428
|
1734
|
793
|
1735 while ((ptr = qxestrchr (ptr, ':')) != 0)
|
428
|
1736 {
|
|
1737 ptr++;
|
|
1738 nsep++;
|
|
1739 }
|
|
1740
|
|
1741 switch (nsep)
|
|
1742 {
|
|
1743 case 0:
|
793
|
1744 qxestrcat (name, ":Regular:10::Western");
|
428
|
1745 break;
|
|
1746 case 1:
|
793
|
1747 qxestrcat (name, ":10::Western");
|
428
|
1748 break;
|
|
1749 case 2:
|
793
|
1750 qxestrcat (name, "::Western");
|
428
|
1751 break;
|
|
1752 case 3:
|
793
|
1753 qxestrcat (name, ":Western");
|
428
|
1754 break;
|
|
1755 default:;
|
|
1756 }
|
442
|
1757
|
771
|
1758 return build_string (name);
|
428
|
1759 }
|
|
1760
|
|
1761 #ifdef MULE
|
|
1762
|
|
1763 static int
|
788
|
1764 mswindows_font_spec_matches_charset_stage_1 (const Intbyte *font_charset,
|
|
1765 Lisp_Object charset)
|
428
|
1766 {
|
771
|
1767 int i, ms_charset = 0;
|
|
1768 CHARSETINFO info;
|
|
1769 int font_code_page;
|
|
1770 Lisp_Object charset_code_page;
|
|
1771
|
|
1772 /* Get code page from the font spec */
|
|
1773
|
|
1774 for (i = 0; i < countof (charset_map); i++)
|
788
|
1775 if (qxestrcasecmp_c (font_charset, charset_map[i].name) == 0)
|
771
|
1776 {
|
|
1777 ms_charset = charset_map[i].value;
|
|
1778 break;
|
|
1779 }
|
|
1780 if (i == countof (charset_map))
|
|
1781 return 0;
|
|
1782
|
|
1783 /* For border-glyph use */
|
|
1784 if (ms_charset == SYMBOL_CHARSET)
|
|
1785 ms_charset = ANSI_CHARSET;
|
|
1786
|
|
1787 if (!TranslateCharsetInfo ((DWORD *) ms_charset, &info, TCI_SRCCHARSET))
|
|
1788 return 0;
|
|
1789
|
|
1790 font_code_page = info.ciACP;
|
|
1791
|
|
1792 /* Get code page for the charset */
|
|
1793 charset_code_page = Fmswindows_charset_code_page (charset);
|
|
1794 if (!INTP (charset_code_page))
|
|
1795 return 0;
|
|
1796
|
|
1797 return font_code_page == XINT (charset_code_page);
|
428
|
1798 }
|
|
1799
|
788
|
1800 static int
|
|
1801 mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset,
|
|
1802 const Intbyte *nonreloc,
|
|
1803 Lisp_Object reloc,
|
|
1804 Bytecount offset, Bytecount length)
|
|
1805 {
|
|
1806 const Intbyte *the_nonreloc = nonreloc;
|
|
1807 int i;
|
|
1808 const Intbyte *c;
|
|
1809 Bytecount the_length = length;
|
|
1810
|
|
1811 /* The idea is that, when trying to find a suitable font for a character,
|
|
1812 we first see if the character comes from one of the known charsets
|
|
1813 listed above; if so, we try to find a font which is declared as being of
|
|
1814 that charset (that's the last element of the font spec). If so, this
|
|
1815 means that the font is specifically designed for the charset, and we
|
|
1816 prefer it. However, there are only a limited number of defined
|
|
1817 charsets, and new ones aren't being defined; so if we fail the first
|
|
1818 stage, we search through each font looking at the Unicode subranges it
|
|
1819 supports, to see if the character comes from that subrange.
|
|
1820 */
|
|
1821
|
|
1822 if (UNBOUNDP (charset))
|
|
1823 return 1;
|
|
1824
|
|
1825 if (!the_nonreloc)
|
|
1826 the_nonreloc = XSTRING_DATA (reloc);
|
|
1827 fixup_internal_substring (nonreloc, reloc, offset, &the_length);
|
|
1828 the_nonreloc += offset;
|
|
1829
|
|
1830 c = the_nonreloc;
|
|
1831 for (i = 0; i < 4; i++)
|
|
1832 {
|
|
1833 Intbyte *newc = (Intbyte *) memchr (c, ':', the_length);
|
|
1834 if (!newc)
|
|
1835 break;
|
|
1836 newc++;
|
|
1837 the_length -= (newc - c);
|
|
1838 c = newc;
|
|
1839 }
|
|
1840
|
|
1841 if (i >= 4 && mswindows_font_spec_matches_charset_stage_1 (c, charset))
|
|
1842 return 1;
|
|
1843
|
|
1844 /* Stage 2. */
|
|
1845 {
|
|
1846 FONTSIGNATURE fs;
|
|
1847 FONTSIGNATURE *fsp = &fs;
|
|
1848 struct gcpro gcpro1;
|
|
1849 Lisp_Object fontsig;
|
|
1850
|
|
1851 /* Get the list of Unicode subranges corresponding to the font. This
|
|
1852 is contained inside of FONTSIGNATURE data, obtained by calling
|
|
1853 GetTextCharsetInfo on a font object, which we need to create from the
|
|
1854 spec. See if the FONTSIGNATURE data is already cached. If not, get
|
|
1855 it and cache it. */
|
|
1856 if (!STRINGP (reloc) || the_nonreloc != XSTRING_DATA (reloc))
|
|
1857 reloc = build_intstring (the_nonreloc);
|
|
1858 GCPRO1 (reloc);
|
|
1859 fontsig = Fgethash (reloc, Vfont_signature_data, Qunbound);
|
|
1860
|
|
1861 if (!UNBOUNDP (fontsig))
|
|
1862 {
|
|
1863 fsp = (FONTSIGNATURE *) XOPAQUE_DATA (fontsig);
|
|
1864 UNGCPRO;
|
|
1865 }
|
|
1866 else
|
|
1867 {
|
|
1868 HDC hdc = CreateCompatibleDC (NULL);
|
|
1869 Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (d);
|
|
1870 HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
|
793
|
1871 font_list,
|
|
1872 ERROR_ME_DEBUG_WARN);
|
788
|
1873
|
|
1874 if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont)))
|
|
1875 {
|
|
1876 nope:
|
|
1877 DeleteDC (hdc);
|
|
1878 UNGCPRO;
|
|
1879 return 0;
|
|
1880 }
|
|
1881
|
|
1882 if (GetTextCharsetInfo (hdc, &fs, 0) == DEFAULT_CHARSET)
|
|
1883 {
|
|
1884 SelectObject (hdc, hfont);
|
|
1885 goto nope;
|
|
1886 }
|
|
1887 SelectObject (hdc, hfont);
|
|
1888 DeleteDC (hdc);
|
|
1889 Fputhash (reloc, make_opaque (&fs, sizeof (fs)), Vfont_signature_data);
|
|
1890 UNGCPRO;
|
|
1891 }
|
|
1892
|
|
1893 {
|
|
1894 int lowlim, highlim;
|
|
1895 int dim, j, cp = -1;
|
|
1896
|
|
1897 /* Try to find a Unicode char in the charset. #### This is somewhat
|
|
1898 bogus. We should really be doing these checks on the char level,
|
|
1899 not the charset level. There's no guarantee that a charset covers
|
|
1900 a single Unicode range. Furthermore, this is extremely wasteful.
|
|
1901 We should be doing this when we're about to redisplay and already
|
|
1902 have the Unicode codepoints in hand.
|
|
1903
|
|
1904 #### Cache me baby!!!!!!!!!!!!!
|
|
1905 */
|
|
1906 get_charset_limits (charset, &lowlim, &highlim);
|
|
1907 dim = XCHARSET_DIMENSION (charset);
|
|
1908
|
|
1909 if (dim == 1)
|
|
1910 {
|
|
1911 for (i = lowlim; i <= highlim; i++)
|
|
1912 if ((cp = char_to_unicode (MAKE_CHAR (charset, i, 0))) >= 0)
|
|
1913 break;
|
|
1914 }
|
|
1915 else
|
|
1916 {
|
|
1917 for (i = lowlim; i <= highlim; i++)
|
|
1918 for (j = lowlim; j <= highlim; j++)
|
|
1919 if ((cp = char_to_unicode (MAKE_CHAR (charset, i, j))) >= 0)
|
|
1920 break;
|
|
1921 }
|
|
1922
|
|
1923 if (cp < 0)
|
|
1924 return 0;
|
|
1925
|
|
1926 /* Check to see, for each subrange supported by the font,
|
|
1927 whether the Unicode char is within that subrange. If any match,
|
|
1928 the font supports the char (whereby, the charset, bogusly). */
|
|
1929
|
|
1930 for (i = 0; i < 128; i++)
|
|
1931 {
|
|
1932 if (fsp->fsUsb[i >> 5] & (1 << (i & 32)))
|
|
1933 {
|
|
1934 for (j = 0; j < unicode_subrange_table[i].no_subranges; j++)
|
|
1935 if (cp >= unicode_subrange_table[i].subranges[j].start &&
|
|
1936 cp <= unicode_subrange_table[i].subranges[j].end)
|
|
1937 return 1;
|
|
1938 }
|
|
1939 }
|
|
1940
|
|
1941 return 0;
|
|
1942 }
|
|
1943 }
|
|
1944 }
|
|
1945
|
428
|
1946 /* find a font spec that matches font spec FONT and also matches
|
|
1947 (the registry of) CHARSET. */
|
|
1948 static Lisp_Object
|
|
1949 mswindows_find_charset_font (Lisp_Object device, Lisp_Object font,
|
771
|
1950 Lisp_Object charset)
|
428
|
1951 {
|
771
|
1952 Lisp_Object fontlist, fonttail;
|
|
1953
|
|
1954 fontlist = mswindows_list_fonts (font, device);
|
|
1955 LIST_LOOP (fonttail, fontlist)
|
|
1956 {
|
|
1957 if (mswindows_font_spec_matches_charset
|
|
1958 (XDEVICE (device), charset, 0, XCAR (fonttail), 0, -1))
|
|
1959 return XCAR (fonttail);
|
|
1960 }
|
|
1961 return Qnil;
|
428
|
1962 }
|
|
1963
|
|
1964 #endif /* MULE */
|
|
1965
|
|
1966
|
|
1967 /************************************************************************/
|
|
1968 /* non-methods */
|
|
1969 /************************************************************************/
|
|
1970
|
|
1971 DEFUN ("mswindows-color-list", Fmswindows_color_list, 0, 0, 0, /*
|
|
1972 Return a list of the colors available on mswindows devices.
|
|
1973 */
|
|
1974 ())
|
|
1975 {
|
|
1976 Lisp_Object result = Qnil;
|
|
1977 int i;
|
|
1978
|
771
|
1979 for (i = 0; i < countof (mswindows_X_color_map); i++)
|
428
|
1980 result = Fcons (build_string (mswindows_X_color_map[i].name), result);
|
|
1981
|
|
1982 return Fnreverse (result);
|
|
1983 }
|
|
1984
|
|
1985
|
|
1986
|
|
1987 /************************************************************************/
|
|
1988 /* initialization */
|
|
1989 /************************************************************************/
|
|
1990
|
|
1991 void
|
|
1992 syms_of_objects_mswindows (void)
|
|
1993 {
|
|
1994 DEFSUBR (Fmswindows_color_list);
|
|
1995 }
|
|
1996
|
|
1997 void
|
|
1998 console_type_create_objects_mswindows (void)
|
|
1999 {
|
|
2000 /* object methods */
|
|
2001 CONSOLE_HAS_METHOD (mswindows, initialize_color_instance);
|
|
2002 /* CONSOLE_HAS_METHOD (mswindows, mark_color_instance); */
|
|
2003 CONSOLE_HAS_METHOD (mswindows, print_color_instance);
|
|
2004 CONSOLE_HAS_METHOD (mswindows, finalize_color_instance);
|
|
2005 CONSOLE_HAS_METHOD (mswindows, color_instance_equal);
|
|
2006 CONSOLE_HAS_METHOD (mswindows, color_instance_hash);
|
|
2007 CONSOLE_HAS_METHOD (mswindows, color_instance_rgb_components);
|
|
2008 CONSOLE_HAS_METHOD (mswindows, valid_color_name_p);
|
|
2009
|
|
2010 CONSOLE_HAS_METHOD (mswindows, initialize_font_instance);
|
|
2011 /* CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */
|
|
2012 CONSOLE_HAS_METHOD (mswindows, print_font_instance);
|
|
2013 CONSOLE_HAS_METHOD (mswindows, finalize_font_instance);
|
442
|
2014 CONSOLE_HAS_METHOD (mswindows, font_instance_truename);
|
428
|
2015 CONSOLE_HAS_METHOD (mswindows, list_fonts);
|
|
2016 #ifdef MULE
|
|
2017 CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset);
|
|
2018 CONSOLE_HAS_METHOD (mswindows, find_charset_font);
|
|
2019 #endif
|
440
|
2020
|
|
2021 /* Printer methods - delegate most to windows methods,
|
|
2022 since graphical objects behave the same way. */
|
|
2023
|
|
2024 CONSOLE_INHERITS_METHOD (msprinter, mswindows, initialize_color_instance);
|
|
2025 /* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_color_instance); */
|
|
2026 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_color_instance);
|
|
2027 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_color_instance);
|
|
2028 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_equal);
|
|
2029 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_hash);
|
|
2030 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_rgb_components);
|
|
2031 CONSOLE_INHERITS_METHOD (msprinter, mswindows, valid_color_name_p);
|
|
2032
|
|
2033 CONSOLE_HAS_METHOD (msprinter, initialize_font_instance);
|
|
2034 /* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_font_instance); */
|
|
2035 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_font_instance);
|
|
2036 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_font_instance);
|
442
|
2037 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename);
|
440
|
2038 CONSOLE_INHERITS_METHOD (msprinter, mswindows, list_fonts);
|
|
2039 #ifdef MULE
|
|
2040 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_spec_matches_charset);
|
|
2041 CONSOLE_INHERITS_METHOD (msprinter, mswindows, find_charset_font);
|
|
2042 #endif
|
428
|
2043 }
|
|
2044
|
|
2045 void
|
788
|
2046 reinit_vars_of_object_mswindows (void)
|
|
2047 {
|
|
2048 #ifdef MULE
|
|
2049 int i;
|
|
2050
|
|
2051 unicode_subrange_table = xnew_array_and_zero (unicode_subrange_t, 128);
|
|
2052 for (i = 0; i < countof (unicode_subrange_raw_map); i++)
|
|
2053 {
|
|
2054 const unicode_subrange_raw_t *el = &unicode_subrange_raw_map[i];
|
|
2055 if (unicode_subrange_table[el->subrange_bit].subranges == 0)
|
|
2056 unicode_subrange_table[el->subrange_bit].subranges = el;
|
|
2057 unicode_subrange_table[el->subrange_bit].no_subranges++;
|
|
2058 }
|
|
2059
|
|
2060 Fclrhash (Vfont_signature_data);
|
|
2061 #endif /* MULE */
|
|
2062 }
|
|
2063
|
|
2064 void
|
428
|
2065 vars_of_objects_mswindows (void)
|
|
2066 {
|
788
|
2067 #ifdef MULE
|
|
2068 Vfont_signature_data =
|
|
2069 make_lisp_hash_table (100, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
|
|
2070 staticpro (&Vfont_signature_data);
|
|
2071 #endif /* MULE */
|
|
2072
|
|
2073 reinit_vars_of_object_mswindows ();
|
428
|
2074 }
|