annotate src/objects-msw.c @ 578:190b164ddcac

[xemacs-hg @ 2001-05-25 11:26:50 by ben] device-msw.c, eldap.c, emodules.c, hpplay.c, process-unix.c, sound.h, tooltalk.c, win32.c: Revert Martin's attempted compile-warnings fix. It does fix the warnings, but not the right way. We are trying to eliminate the raw use of `char' and `unsigned char' absolutely everywhere. There is never an occasion to reintroduce these. buffer.h: Instead, we fix these macros so they don't care about the type of their lvalues. We already do this for the non-C-string equivalents of these, and it's correct because it should be OK to pass in an SBufbyte *, for example. In any case, we do not need any type-correctness checking here -- errors will be caught for sure as soon as we remove the -Wno-sign-compare switch. mule-charset.c: Use invalid_argument, not generic signal_error (Qerror, ). alloc.c, chartab.c, console-gtk.c, console-msw.c, console-stream.c, console-stream.h, console-tty.c, console-tty.h, console-x.c, console.c, console.h, device-x.c, device.c, elhash.c, eval.c, faces.c, faces.h, fns.c, glyphs.c, glyphs.h, gui.c, gui.h, lisp.h, lread.c, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-tty.c, objects-x.c, objects.c, process-unix.c, rangetab.c, search.c, specifier.c, toolbar.c, window.c, window.h: Rename Error_behavior to Error_Behavior, to be consistent with general naming practices (Lisp_Object, Char_Binary, etc.).
author ben
date Fri, 25 May 2001 11:27:01 +0000
parents 183866b06e0b
children 5fd7ba8b56e7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* mswindows-specific Lisp objects.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 Copyright (C) 1995 Tinker Systems.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 Copyright (C) 1995, 1996 Ben Wing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 Copyright (C) 1995 Sun Microsystems, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 Copyright (C) 1997 Jonathan Harris.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 /* Authorship:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 Jamie Zawinski, Chuck Thompson, Ben Wing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 /* TODO: palette handling */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 #include "hash.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #include "console-msw.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 #include "objects-msw.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 #ifdef MULE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 #include "mule-charset.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 #include "buffer.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 #include "device.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 #include "insdel.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
52 typedef struct colormap_t
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
54 const char *name;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
55 COLORREF colorref;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 } colormap_t;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 /* Colors from X11R6 "XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp" */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
59 /* MSWindows tends to round up the numbers in it's palette, ie where X uses
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
60 * 127, MSWindows uses 128. Colors commented as "Adjusted" are tweaked to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
61 * match the Windows standard palette to increase the likelihood of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
62 * mswindows_color_to_string() finding a named match.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
63 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
64 static const colormap_t mswindows_X_color_map[] =
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
66 {"white" , PALETTERGB (255, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
67 {"black" , PALETTERGB (0, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
68 {"snow" , PALETTERGB (255, 250, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
69 {"GhostWhite" , PALETTERGB (248, 248, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
70 {"WhiteSmoke" , PALETTERGB (245, 245, 245) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
71 {"gainsboro" , PALETTERGB (220, 220, 220) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
72 {"FloralWhite" , PALETTERGB (255, 250, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
73 {"OldLace" , PALETTERGB (253, 245, 230) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
74 {"linen" , PALETTERGB (250, 240, 230) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
75 {"AntiqueWhite" , PALETTERGB (250, 235, 215) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
76 {"PapayaWhip" , PALETTERGB (255, 239, 213) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
77 {"BlanchedAlmond" , PALETTERGB (255, 235, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
78 {"bisque" , PALETTERGB (255, 228, 196) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
79 {"PeachPuff" , PALETTERGB (255, 218, 185) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
80 {"NavajoWhite" , PALETTERGB (255, 222, 173) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
81 {"moccasin" , PALETTERGB (255, 228, 181) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
82 {"cornsilk" , PALETTERGB (255, 248, 220) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
83 {"ivory" , PALETTERGB (255, 255, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
84 {"LemonChiffon" , PALETTERGB (255, 250, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
85 {"seashell" , PALETTERGB (255, 245, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
86 {"honeydew" , PALETTERGB (240, 255, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
87 {"MintCream" , PALETTERGB (245, 255, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
88 {"azure" , PALETTERGB (240, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 {"AliceBlue" , PALETTERGB (240, 248, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
90 {"lavender" , PALETTERGB (230, 230, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
91 {"LavenderBlush" , PALETTERGB (255, 240, 245) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
92 {"MistyRose" , PALETTERGB (255, 228, 225) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
93 {"DarkSlateGray" , PALETTERGB (47, 79, 79) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
94 {"DarkSlateGrey" , PALETTERGB (47, 79, 79) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
95 {"DimGray" , PALETTERGB (105, 105, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
96 {"DimGrey" , PALETTERGB (105, 105, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
97 {"SlateGray" , PALETTERGB (112, 128, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
98 {"SlateGrey" , PALETTERGB (112, 128, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
99 {"LightSlateGray" , PALETTERGB (119, 136, 153) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
100 {"LightSlateGrey" , PALETTERGB (119, 136, 153) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
101 {"gray" , PALETTERGB (190, 190, 190) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
102 {"grey" , PALETTERGB (190, 190, 190) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
103 {"LightGrey" , PALETTERGB (211, 211, 211) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
104 {"LightGray" , PALETTERGB (211, 211, 211) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
105 {"MidnightBlue" , PALETTERGB (25, 25, 112) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
106 {"navy" , PALETTERGB (0, 0, 128) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
107 {"NavyBlue" , PALETTERGB (0, 0, 128) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
108 {"CornflowerBlue" , PALETTERGB (100, 149, 237) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
109 {"DarkSlateBlue" , PALETTERGB (72, 61, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
110 {"SlateBlue" , PALETTERGB (106, 90, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
111 {"MediumSlateBlue" , PALETTERGB (123, 104, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
112 {"LightSlateBlue" , PALETTERGB (132, 112, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
113 {"MediumBlue" , PALETTERGB (0, 0, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
114 {"RoyalBlue" , PALETTERGB (65, 105, 225) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
115 {"blue" , PALETTERGB (0, 0, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
116 {"DodgerBlue" , PALETTERGB (30, 144, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
117 {"DeepSkyBlue" , PALETTERGB (0, 191, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
118 {"SkyBlue" , PALETTERGB (135, 206, 235) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
119 {"LightSkyBlue" , PALETTERGB (135, 206, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
120 {"SteelBlue" , PALETTERGB (70, 130, 180) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
121 {"LightSteelBlue" , PALETTERGB (176, 196, 222) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
122 {"LightBlue" , PALETTERGB (173, 216, 230) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
123 {"PowderBlue" , PALETTERGB (176, 224, 230) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
124 {"PaleTurquoise" , PALETTERGB (175, 238, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
125 {"DarkTurquoise" , PALETTERGB (0, 206, 209) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
126 {"MediumTurquoise" , PALETTERGB (72, 209, 204) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
127 {"turquoise" , PALETTERGB (64, 224, 208) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
128 {"cyan" , PALETTERGB (0, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
129 {"LightCyan" , PALETTERGB (224, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
130 {"CadetBlue" , PALETTERGB (95, 158, 160) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
131 {"MediumAquamarine" , PALETTERGB (102, 205, 170) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
132 {"aquamarine" , PALETTERGB (127, 255, 212) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
133 {"DarkGreen" , PALETTERGB (0, 128, 0) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
134 {"DarkOliveGreen" , PALETTERGB (85, 107, 47) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
135 {"DarkSeaGreen" , PALETTERGB (143, 188, 143) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
136 {"SeaGreen" , PALETTERGB (46, 139, 87) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
137 {"MediumSeaGreen" , PALETTERGB (60, 179, 113) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
138 {"LightSeaGreen" , PALETTERGB (32, 178, 170) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
139 {"PaleGreen" , PALETTERGB (152, 251, 152) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
140 {"SpringGreen" , PALETTERGB (0, 255, 127) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
141 {"LawnGreen" , PALETTERGB (124, 252, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
142 {"green" , PALETTERGB (0, 255, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
143 {"chartreuse" , PALETTERGB (127, 255, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
144 {"MediumSpringGreen" , PALETTERGB (0, 250, 154) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
145 {"GreenYellow" , PALETTERGB (173, 255, 47) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
146 {"LimeGreen" , PALETTERGB (50, 205, 50) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
147 {"YellowGreen" , PALETTERGB (154, 205, 50) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
148 {"ForestGreen" , PALETTERGB (34, 139, 34) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
149 {"OliveDrab" , PALETTERGB (107, 142, 35) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
150 {"DarkKhaki" , PALETTERGB (189, 183, 107) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
151 {"khaki" , PALETTERGB (240, 230, 140) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
152 {"PaleGoldenrod" , PALETTERGB (238, 232, 170) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
153 {"LightGoldenrodYellow", PALETTERGB (250, 250, 210) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
154 {"LightYellow" , PALETTERGB (255, 255, 224) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
155 {"LightYellow" , PALETTERGB (255, 255, 225) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
156 {"yellow" , PALETTERGB (255, 255, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
157 {"gold" , PALETTERGB (255, 215, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
158 {"LightGoldenrod" , PALETTERGB (238, 221, 130) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
159 {"goldenrod" , PALETTERGB (218, 165, 32) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
160 {"DarkGoldenrod" , PALETTERGB (184, 134, 11) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
161 {"RosyBrown" , PALETTERGB (188, 143, 143) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
162 {"IndianRed" , PALETTERGB (205, 92, 92) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
163 {"SaddleBrown" , PALETTERGB (139, 69, 19) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
164 {"sienna" , PALETTERGB (160, 82, 45) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
165 {"peru" , PALETTERGB (205, 133, 63) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
166 {"burlywood" , PALETTERGB (222, 184, 135) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
167 {"beige" , PALETTERGB (245, 245, 220) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
168 {"wheat" , PALETTERGB (245, 222, 179) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
169 {"SandyBrown" , PALETTERGB (244, 164, 96) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
170 {"tan" , PALETTERGB (210, 180, 140) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
171 {"chocolate" , PALETTERGB (210, 105, 30) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
172 {"firebrick" , PALETTERGB (178, 34, 34) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
173 {"brown" , PALETTERGB (165, 42, 42) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
174 {"DarkSalmon" , PALETTERGB (233, 150, 122) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
175 {"salmon" , PALETTERGB (250, 128, 114) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
176 {"LightSalmon" , PALETTERGB (255, 160, 122) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
177 {"orange" , PALETTERGB (255, 165, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
178 {"DarkOrange" , PALETTERGB (255, 140, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
179 {"coral" , PALETTERGB (255, 127, 80) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
180 {"LightCoral" , PALETTERGB (240, 128, 128) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
181 {"tomato" , PALETTERGB (255, 99, 71) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
182 {"OrangeRed" , PALETTERGB (255, 69, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
183 {"red" , PALETTERGB (255, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
184 {"HotPink" , PALETTERGB (255, 105, 180) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
185 {"DeepPink" , PALETTERGB (255, 20, 147) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
186 {"pink" , PALETTERGB (255, 192, 203) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
187 {"LightPink" , PALETTERGB (255, 182, 193) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
188 {"PaleVioletRed" , PALETTERGB (219, 112, 147) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
189 {"maroon" , PALETTERGB (176, 48, 96) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
190 {"MediumVioletRed" , PALETTERGB (199, 21, 133) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
191 {"VioletRed" , PALETTERGB (208, 32, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
192 {"magenta" , PALETTERGB (255, 0, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
193 {"violet" , PALETTERGB (238, 130, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
194 {"plum" , PALETTERGB (221, 160, 221) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
195 {"orchid" , PALETTERGB (218, 112, 214) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
196 {"MediumOrchid" , PALETTERGB (186, 85, 211) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
197 {"DarkOrchid" , PALETTERGB (153, 50, 204) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
198 {"DarkViolet" , PALETTERGB (148, 0, 211) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
199 {"BlueViolet" , PALETTERGB (138, 43, 226) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
200 {"purple" , PALETTERGB (160, 32, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
201 {"MediumPurple" , PALETTERGB (147, 112, 219) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
202 {"thistle" , PALETTERGB (216, 191, 216) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
203 {"snow1" , PALETTERGB (255, 250, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
204 {"snow2" , PALETTERGB (238, 233, 233) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
205 {"snow3" , PALETTERGB (205, 201, 201) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
206 {"snow4" , PALETTERGB (139, 137, 137) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
207 {"seashell1" , PALETTERGB (255, 245, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
208 {"seashell2" , PALETTERGB (238, 229, 222) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
209 {"seashell3" , PALETTERGB (205, 197, 191) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
210 {"seashell4" , PALETTERGB (139, 134, 130) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
211 {"AntiqueWhite1" , PALETTERGB (255, 239, 219) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
212 {"AntiqueWhite2" , PALETTERGB (238, 223, 204) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
213 {"AntiqueWhite3" , PALETTERGB (205, 192, 176) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
214 {"AntiqueWhite4" , PALETTERGB (139, 131, 120) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
215 {"bisque1" , PALETTERGB (255, 228, 196) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
216 {"bisque2" , PALETTERGB (238, 213, 183) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
217 {"bisque3" , PALETTERGB (205, 183, 158) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
218 {"bisque4" , PALETTERGB (139, 125, 107) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
219 {"PeachPuff1" , PALETTERGB (255, 218, 185) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
220 {"PeachPuff2" , PALETTERGB (238, 203, 173) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
221 {"PeachPuff3" , PALETTERGB (205, 175, 149) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
222 {"PeachPuff4" , PALETTERGB (139, 119, 101) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
223 {"NavajoWhite1" , PALETTERGB (255, 222, 173) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
224 {"NavajoWhite2" , PALETTERGB (238, 207, 161) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
225 {"NavajoWhite3" , PALETTERGB (205, 179, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
226 {"NavajoWhite4" , PALETTERGB (139, 121, 94) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
227 {"LemonChiffon1" , PALETTERGB (255, 250, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
228 {"LemonChiffon2" , PALETTERGB (238, 233, 191) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
229 {"LemonChiffon3" , PALETTERGB (205, 201, 165) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
230 {"LemonChiffon4" , PALETTERGB (139, 137, 112) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
231 {"cornsilk1" , PALETTERGB (255, 248, 220) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
232 {"cornsilk2" , PALETTERGB (238, 232, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
233 {"cornsilk3" , PALETTERGB (205, 200, 177) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
234 {"cornsilk4" , PALETTERGB (139, 136, 120) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
235 {"ivory1" , PALETTERGB (255, 255, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
236 {"ivory2" , PALETTERGB (240, 240, 208) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
237 {"ivory3" , PALETTERGB (205, 205, 193) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
238 {"ivory4" , PALETTERGB (139, 139, 131) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
239 {"honeydew1" , PALETTERGB (240, 255, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
240 {"honeydew2" , PALETTERGB (224, 238, 224) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
241 {"honeydew3" , PALETTERGB (193, 205, 193) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
242 {"honeydew4" , PALETTERGB (131, 139, 131) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
243 {"LavenderBlush1" , PALETTERGB (255, 240, 245) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
244 {"LavenderBlush2" , PALETTERGB (238, 224, 229) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
245 {"LavenderBlush3" , PALETTERGB (205, 193, 197) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
246 {"LavenderBlush4" , PALETTERGB (139, 131, 134) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
247 {"MistyRose1" , PALETTERGB (255, 228, 225) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
248 {"MistyRose2" , PALETTERGB (238, 213, 210) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
249 {"MistyRose3" , PALETTERGB (205, 183, 181) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
250 {"MistyRose4" , PALETTERGB (139, 125, 123) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
251 {"azure1" , PALETTERGB (240, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
252 {"azure2" , PALETTERGB (224, 238, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
253 {"azure3" , PALETTERGB (193, 205, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
254 {"azure4" , PALETTERGB (131, 139, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
255 {"SlateBlue1" , PALETTERGB (131, 111, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
256 {"SlateBlue2" , PALETTERGB (122, 103, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
257 {"SlateBlue3" , PALETTERGB (105, 89, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
258 {"SlateBlue4" , PALETTERGB (71, 60, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
259 {"RoyalBlue1" , PALETTERGB (72, 118, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
260 {"RoyalBlue2" , PALETTERGB (67, 110, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
261 {"RoyalBlue3" , PALETTERGB (58, 95, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
262 {"RoyalBlue4" , PALETTERGB (39, 64, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
263 {"blue1" , PALETTERGB (0, 0, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
264 {"blue2" , PALETTERGB (0, 0, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
265 {"blue3" , PALETTERGB (0, 0, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
266 {"blue4" , PALETTERGB (0, 0, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
267 {"DodgerBlue1" , PALETTERGB (30, 144, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
268 {"DodgerBlue2" , PALETTERGB (28, 134, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
269 {"DodgerBlue3" , PALETTERGB (24, 116, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
270 {"DodgerBlue4" , PALETTERGB (16, 78, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
271 {"SteelBlue1" , PALETTERGB (99, 184, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
272 {"SteelBlue2" , PALETTERGB (92, 172, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
273 {"SteelBlue3" , PALETTERGB (79, 148, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
274 {"SteelBlue4" , PALETTERGB (54, 100, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
275 {"DeepSkyBlue1" , PALETTERGB (0, 191, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
276 {"DeepSkyBlue2" , PALETTERGB (0, 178, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
277 {"DeepSkyBlue3" , PALETTERGB (0, 154, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
278 {"DeepSkyBlue4" , PALETTERGB (0, 104, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
279 {"SkyBlue1" , PALETTERGB (135, 206, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
280 {"SkyBlue2" , PALETTERGB (126, 192, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
281 {"SkyBlue3" , PALETTERGB (108, 166, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
282 {"SkyBlue4" , PALETTERGB (74, 112, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
283 {"LightSkyBlue1" , PALETTERGB (176, 226, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
284 {"LightSkyBlue2" , PALETTERGB (164, 211, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
285 {"LightSkyBlue3" , PALETTERGB (141, 182, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
286 {"LightSkyBlue4" , PALETTERGB (96, 123, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
287 {"SlateGray1" , PALETTERGB (198, 226, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
288 {"SlateGray2" , PALETTERGB (185, 211, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
289 {"SlateGray3" , PALETTERGB (159, 182, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
290 {"SlateGray4" , PALETTERGB (108, 123, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
291 {"LightSteelBlue1" , PALETTERGB (202, 225, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
292 {"LightSteelBlue2" , PALETTERGB (188, 210, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
293 {"LightSteelBlue3" , PALETTERGB (162, 181, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
294 {"LightSteelBlue4" , PALETTERGB (110, 123, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
295 {"LightBlue1" , PALETTERGB (191, 239, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
296 {"LightBlue2" , PALETTERGB (178, 223, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
297 {"LightBlue3" , PALETTERGB (154, 192, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
298 {"LightBlue4" , PALETTERGB (104, 131, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
299 {"LightCyan1" , PALETTERGB (224, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
300 {"LightCyan2" , PALETTERGB (209, 238, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
301 {"LightCyan3" , PALETTERGB (180, 205, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
302 {"LightCyan4" , PALETTERGB (122, 139, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
303 {"PaleTurquoise1" , PALETTERGB (187, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
304 {"PaleTurquoise2" , PALETTERGB (174, 238, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
305 {"PaleTurquoise3" , PALETTERGB (150, 205, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
306 {"PaleTurquoise4" , PALETTERGB (102, 139, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
307 {"CadetBlue1" , PALETTERGB (152, 245, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
308 {"CadetBlue2" , PALETTERGB (144, 220, 240) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
309 {"CadetBlue3" , PALETTERGB (122, 197, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
310 {"CadetBlue4" , PALETTERGB (83, 134, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
311 {"turquoise1" , PALETTERGB (0, 245, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
312 {"turquoise2" , PALETTERGB (0, 229, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
313 {"turquoise3" , PALETTERGB (0, 197, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
314 {"turquoise4" , PALETTERGB (0, 134, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
315 {"cyan1" , PALETTERGB (0, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
316 {"cyan2" , PALETTERGB (0, 238, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
317 {"cyan3" , PALETTERGB (0, 205, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
318 {"cyan4" , PALETTERGB (0, 139, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
319 {"DarkSlateGray1" , PALETTERGB (151, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
320 {"DarkSlateGray2" , PALETTERGB (141, 238, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
321 {"DarkSlateGray3" , PALETTERGB (121, 205, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
322 {"DarkSlateGray4" , PALETTERGB (82, 139, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
323 {"aquamarine1" , PALETTERGB (127, 255, 212) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
324 {"aquamarine2" , PALETTERGB (118, 238, 198) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
325 {"aquamarine3" , PALETTERGB (102, 205, 170) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
326 {"aquamarine4" , PALETTERGB (69, 139, 116) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
327 {"DarkSeaGreen1" , PALETTERGB (193, 255, 193) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
328 {"DarkSeaGreen2" , PALETTERGB (180, 238, 180) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
329 {"DarkSeaGreen3" , PALETTERGB (155, 205, 155) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
330 {"DarkSeaGreen4" , PALETTERGB (105, 139, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
331 {"SeaGreen1" , PALETTERGB (84, 255, 159) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
332 {"SeaGreen2" , PALETTERGB (78, 238, 148) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
333 {"SeaGreen3" , PALETTERGB (67, 205, 128) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
334 {"SeaGreen4" , PALETTERGB (46, 139, 87) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
335 {"PaleGreen1" , PALETTERGB (154, 255, 154) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
336 {"PaleGreen2" , PALETTERGB (144, 238, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
337 {"PaleGreen3" , PALETTERGB (124, 205, 124) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
338 {"PaleGreen4" , PALETTERGB (84, 139, 84) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
339 {"SpringGreen1" , PALETTERGB (0, 255, 127) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
340 {"SpringGreen2" , PALETTERGB (0, 238, 118) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
341 {"SpringGreen3" , PALETTERGB (0, 205, 102) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
342 {"SpringGreen4" , PALETTERGB (0, 139, 69) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
343 {"green1" , PALETTERGB (0, 255, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
344 {"green2" , PALETTERGB (0, 238, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
345 {"green3" , PALETTERGB (0, 205, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
346 {"green4" , PALETTERGB (0, 139, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
347 {"chartreuse1" , PALETTERGB (127, 255, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
348 {"chartreuse2" , PALETTERGB (118, 238, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
349 {"chartreuse3" , PALETTERGB (102, 205, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
350 {"chartreuse4" , PALETTERGB (69, 139, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
351 {"OliveDrab1" , PALETTERGB (192, 255, 62) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
352 {"OliveDrab2" , PALETTERGB (179, 238, 58) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
353 {"OliveDrab3" , PALETTERGB (154, 205, 50) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
354 {"OliveDrab4" , PALETTERGB (105, 139, 34) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
355 {"DarkOliveGreen1" , PALETTERGB (202, 255, 112) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
356 {"DarkOliveGreen2" , PALETTERGB (188, 238, 104) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
357 {"DarkOliveGreen3" , PALETTERGB (162, 205, 90) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
358 {"DarkOliveGreen4" , PALETTERGB (110, 139, 61) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
359 {"khaki1" , PALETTERGB (255, 246, 143) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
360 {"khaki2" , PALETTERGB (238, 230, 133) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
361 {"khaki3" , PALETTERGB (205, 198, 115) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
362 {"khaki4" , PALETTERGB (139, 134, 78) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
363 {"LightGoldenrod1" , PALETTERGB (255, 236, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
364 {"LightGoldenrod2" , PALETTERGB (238, 220, 130) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
365 {"LightGoldenrod3" , PALETTERGB (205, 190, 112) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
366 {"LightGoldenrod4" , PALETTERGB (139, 129, 76) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
367 {"LightYellow1" , PALETTERGB (255, 255, 224) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
368 {"LightYellow2" , PALETTERGB (238, 238, 209) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
369 {"LightYellow3" , PALETTERGB (205, 205, 180) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
370 {"LightYellow4" , PALETTERGB (139, 139, 122) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
371 {"yellow1" , PALETTERGB (255, 255, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
372 {"yellow2" , PALETTERGB (238, 238, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
373 {"yellow3" , PALETTERGB (205, 205, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
374 {"yellow4" , PALETTERGB (139, 139, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
375 {"gold1" , PALETTERGB (255, 215, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
376 {"gold2" , PALETTERGB (238, 201, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
377 {"gold3" , PALETTERGB (205, 173, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
378 {"gold4" , PALETTERGB (139, 117, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
379 {"goldenrod1" , PALETTERGB (255, 193, 37) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
380 {"goldenrod2" , PALETTERGB (238, 180, 34) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
381 {"goldenrod3" , PALETTERGB (205, 155, 29) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
382 {"goldenrod4" , PALETTERGB (139, 105, 20) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
383 {"DarkGoldenrod1" , PALETTERGB (255, 185, 15) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
384 {"DarkGoldenrod2" , PALETTERGB (238, 173, 14) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
385 {"DarkGoldenrod3" , PALETTERGB (205, 149, 12) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
386 {"DarkGoldenrod4" , PALETTERGB (139, 101, 8) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
387 {"RosyBrown1" , PALETTERGB (255, 193, 193) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
388 {"RosyBrown2" , PALETTERGB (238, 180, 180) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
389 {"RosyBrown3" , PALETTERGB (205, 155, 155) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
390 {"RosyBrown4" , PALETTERGB (139, 105, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
391 {"IndianRed1" , PALETTERGB (255, 106, 106) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
392 {"IndianRed2" , PALETTERGB (238, 99, 99) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
393 {"IndianRed3" , PALETTERGB (205, 85, 85) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
394 {"IndianRed4" , PALETTERGB (139, 58, 58) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
395 {"sienna1" , PALETTERGB (255, 130, 71) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
396 {"sienna2" , PALETTERGB (238, 121, 66) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
397 {"sienna3" , PALETTERGB (205, 104, 57) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
398 {"sienna4" , PALETTERGB (139, 71, 38) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
399 {"burlywood1" , PALETTERGB (255, 211, 155) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
400 {"burlywood2" , PALETTERGB (238, 197, 145) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
401 {"burlywood3" , PALETTERGB (205, 170, 125) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
402 {"burlywood4" , PALETTERGB (139, 115, 85) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
403 {"wheat1" , PALETTERGB (255, 231, 186) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
404 {"wheat2" , PALETTERGB (238, 216, 174) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
405 {"wheat3" , PALETTERGB (205, 186, 150) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
406 {"wheat4" , PALETTERGB (139, 126, 102) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
407 {"tan1" , PALETTERGB (255, 165, 79) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
408 {"tan2" , PALETTERGB (238, 154, 73) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
409 {"tan3" , PALETTERGB (205, 133, 63) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
410 {"tan4" , PALETTERGB (139, 90, 43) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
411 {"chocolate1" , PALETTERGB (255, 127, 36) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
412 {"chocolate2" , PALETTERGB (238, 118, 33) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
413 {"chocolate3" , PALETTERGB (205, 102, 29) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
414 {"chocolate4" , PALETTERGB (139, 69, 19) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
415 {"firebrick1" , PALETTERGB (255, 48, 48) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
416 {"firebrick2" , PALETTERGB (238, 44, 44) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
417 {"firebrick3" , PALETTERGB (205, 38, 38) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
418 {"firebrick4" , PALETTERGB (139, 26, 26) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
419 {"brown1" , PALETTERGB (255, 64, 64) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
420 {"brown2" , PALETTERGB (238, 59, 59) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
421 {"brown3" , PALETTERGB (205, 51, 51) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
422 {"brown4" , PALETTERGB (139, 35, 35) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
423 {"salmon1" , PALETTERGB (255, 140, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
424 {"salmon2" , PALETTERGB (238, 130, 98) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
425 {"salmon3" , PALETTERGB (205, 112, 84) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
426 {"salmon4" , PALETTERGB (139, 76, 57) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
427 {"LightSalmon1" , PALETTERGB (255, 160, 122) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
428 {"LightSalmon2" , PALETTERGB (238, 149, 114) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
429 {"LightSalmon3" , PALETTERGB (205, 129, 98) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
430 {"LightSalmon4" , PALETTERGB (139, 87, 66) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
431 {"orange1" , PALETTERGB (255, 165, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
432 {"orange2" , PALETTERGB (238, 154, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
433 {"orange3" , PALETTERGB (205, 133, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
434 {"orange4" , PALETTERGB (139, 90, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
435 {"DarkOrange1" , PALETTERGB (255, 127, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
436 {"DarkOrange2" , PALETTERGB (238, 118, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
437 {"DarkOrange3" , PALETTERGB (205, 102, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
438 {"DarkOrange4" , PALETTERGB (139, 69, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
439 {"coral1" , PALETTERGB (255, 114, 86) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
440 {"coral2" , PALETTERGB (238, 106, 80) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
441 {"coral3" , PALETTERGB (205, 91, 69) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
442 {"coral4" , PALETTERGB (139, 62, 47) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
443 {"tomato1" , PALETTERGB (255, 99, 71) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
444 {"tomato2" , PALETTERGB (238, 92, 66) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
445 {"tomato3" , PALETTERGB (205, 79, 57) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
446 {"tomato4" , PALETTERGB (139, 54, 38) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
447 {"OrangeRed1" , PALETTERGB (255, 69, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
448 {"OrangeRed2" , PALETTERGB (238, 64, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
449 {"OrangeRed3" , PALETTERGB (205, 55, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
450 {"OrangeRed4" , PALETTERGB (139, 37, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
451 {"red1" , PALETTERGB (255, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
452 {"red2" , PALETTERGB (238, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
453 {"red3" , PALETTERGB (205, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
454 {"red4" , PALETTERGB (139, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
455 {"DeepPink1" , PALETTERGB (255, 20, 147) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
456 {"DeepPink2" , PALETTERGB (238, 18, 137) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
457 {"DeepPink3" , PALETTERGB (205, 16, 118) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
458 {"DeepPink4" , PALETTERGB (139, 10, 80) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
459 {"HotPink1" , PALETTERGB (255, 110, 180) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
460 {"HotPink2" , PALETTERGB (238, 106, 167) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
461 {"HotPink3" , PALETTERGB (205, 96, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
462 {"HotPink4" , PALETTERGB (139, 58, 98) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
463 {"pink1" , PALETTERGB (255, 181, 197) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
464 {"pink2" , PALETTERGB (238, 169, 184) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
465 {"pink3" , PALETTERGB (205, 145, 158) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
466 {"pink4" , PALETTERGB (139, 99, 108) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
467 {"LightPink1" , PALETTERGB (255, 174, 185) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
468 {"LightPink2" , PALETTERGB (238, 162, 173) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
469 {"LightPink3" , PALETTERGB (205, 140, 149) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
470 {"LightPink4" , PALETTERGB (139, 95, 101) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
471 {"PaleVioletRed1" , PALETTERGB (255, 130, 171) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
472 {"PaleVioletRed2" , PALETTERGB (238, 121, 159) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
473 {"PaleVioletRed3" , PALETTERGB (205, 104, 137) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
474 {"PaleVioletRed4" , PALETTERGB (139, 71, 93) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
475 {"maroon1" , PALETTERGB (255, 52, 179) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
476 {"maroon2" , PALETTERGB (238, 48, 167) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
477 {"maroon3" , PALETTERGB (205, 41, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
478 {"maroon4" , PALETTERGB (139, 28, 98) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
479 {"VioletRed1" , PALETTERGB (255, 62, 150) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
480 {"VioletRed2" , PALETTERGB (238, 58, 140) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
481 {"VioletRed3" , PALETTERGB (205, 50, 120) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
482 {"VioletRed4" , PALETTERGB (139, 34, 82) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
483 {"magenta1" , PALETTERGB (255, 0, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
484 {"magenta2" , PALETTERGB (238, 0, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
485 {"magenta3" , PALETTERGB (205, 0, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
486 {"magenta4" , PALETTERGB (139, 0, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
487 {"orchid1" , PALETTERGB (255, 131, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
488 {"orchid2" , PALETTERGB (238, 122, 233) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
489 {"orchid3" , PALETTERGB (205, 105, 201) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
490 {"orchid4" , PALETTERGB (139, 71, 137) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
491 {"plum1" , PALETTERGB (255, 187, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
492 {"plum2" , PALETTERGB (238, 174, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
493 {"plum3" , PALETTERGB (205, 150, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
494 {"plum4" , PALETTERGB (139, 102, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
495 {"MediumOrchid1" , PALETTERGB (224, 102, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
496 {"MediumOrchid2" , PALETTERGB (209, 95, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
497 {"MediumOrchid3" , PALETTERGB (180, 82, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
498 {"MediumOrchid4" , PALETTERGB (122, 55, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
499 {"DarkOrchid1" , PALETTERGB (191, 62, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
500 {"DarkOrchid2" , PALETTERGB (178, 58, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
501 {"DarkOrchid3" , PALETTERGB (154, 50, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
502 {"DarkOrchid4" , PALETTERGB (104, 34, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
503 {"purple1" , PALETTERGB (155, 48, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
504 {"purple2" , PALETTERGB (145, 44, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
505 {"purple3" , PALETTERGB (125, 38, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
506 {"purple4" , PALETTERGB (85, 26, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
507 {"MediumPurple1" , PALETTERGB (171, 130, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
508 {"MediumPurple2" , PALETTERGB (159, 121, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
509 {"MediumPurple3" , PALETTERGB (137, 104, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
510 {"MediumPurple4" , PALETTERGB (93, 71, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
511 {"thistle1" , PALETTERGB (255, 225, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
512 {"thistle2" , PALETTERGB (238, 210, 238) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
513 {"thistle3" , PALETTERGB (205, 181, 205) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
514 {"thistle4" , PALETTERGB (139, 123, 139) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
515 {"gray0" , PALETTERGB (0, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
516 {"grey0" , PALETTERGB (0, 0, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
517 {"gray1" , PALETTERGB (3, 3, 3) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
518 {"grey1" , PALETTERGB (3, 3, 3) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
519 {"gray2" , PALETTERGB (5, 5, 5) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
520 {"grey2" , PALETTERGB (5, 5, 5) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
521 {"gray3" , PALETTERGB (8, 8, 8) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
522 {"grey3" , PALETTERGB (8, 8, 8) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
523 {"gray4" , PALETTERGB (10, 10, 10) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
524 {"grey4" , PALETTERGB (10, 10, 10) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
525 {"gray5" , PALETTERGB (13, 13, 13) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
526 {"grey5" , PALETTERGB (13, 13, 13) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
527 {"gray6" , PALETTERGB (15, 15, 15) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
528 {"grey6" , PALETTERGB (15, 15, 15) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
529 {"gray7" , PALETTERGB (18, 18, 18) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
530 {"grey7" , PALETTERGB (18, 18, 18) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
531 {"gray8" , PALETTERGB (20, 20, 20) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
532 {"grey8" , PALETTERGB (20, 20, 20) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
533 {"gray9" , PALETTERGB (23, 23, 23) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
534 {"grey9" , PALETTERGB (23, 23, 23) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
535 {"gray10" , PALETTERGB (26, 26, 26) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
536 {"grey10" , PALETTERGB (26, 26, 26) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
537 {"gray11" , PALETTERGB (28, 28, 28) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
538 {"grey11" , PALETTERGB (28, 28, 28) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
539 {"gray12" , PALETTERGB (31, 31, 31) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
540 {"grey12" , PALETTERGB (31, 31, 31) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
541 {"gray13" , PALETTERGB (33, 33, 33) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
542 {"grey13" , PALETTERGB (33, 33, 33) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
543 {"gray14" , PALETTERGB (36, 36, 36) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
544 {"grey14" , PALETTERGB (36, 36, 36) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
545 {"gray15" , PALETTERGB (38, 38, 38) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
546 {"grey15" , PALETTERGB (38, 38, 38) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
547 {"gray16" , PALETTERGB (41, 41, 41) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
548 {"grey16" , PALETTERGB (41, 41, 41) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
549 {"gray17" , PALETTERGB (43, 43, 43) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
550 {"grey17" , PALETTERGB (43, 43, 43) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
551 {"gray18" , PALETTERGB (46, 46, 46) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
552 {"grey18" , PALETTERGB (46, 46, 46) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
553 {"gray19" , PALETTERGB (48, 48, 48) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
554 {"grey19" , PALETTERGB (48, 48, 48) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
555 {"gray20" , PALETTERGB (51, 51, 51) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
556 {"grey20" , PALETTERGB (51, 51, 51) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
557 {"gray21" , PALETTERGB (54, 54, 54) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
558 {"grey21" , PALETTERGB (54, 54, 54) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
559 {"gray22" , PALETTERGB (56, 56, 56) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
560 {"grey22" , PALETTERGB (56, 56, 56) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
561 {"gray23" , PALETTERGB (59, 59, 59) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
562 {"grey23" , PALETTERGB (59, 59, 59) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
563 {"gray24" , PALETTERGB (61, 61, 61) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
564 {"grey24" , PALETTERGB (61, 61, 61) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
565 {"gray25" , PALETTERGB (64, 64, 64) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
566 {"grey25" , PALETTERGB (64, 64, 64) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
567 {"gray26" , PALETTERGB (66, 66, 66) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
568 {"grey26" , PALETTERGB (66, 66, 66) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
569 {"gray27" , PALETTERGB (69, 69, 69) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
570 {"grey27" , PALETTERGB (69, 69, 69) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
571 {"gray28" , PALETTERGB (71, 71, 71) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
572 {"grey28" , PALETTERGB (71, 71, 71) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
573 {"gray29" , PALETTERGB (74, 74, 74) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
574 {"grey29" , PALETTERGB (74, 74, 74) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
575 {"gray30" , PALETTERGB (77, 77, 77) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
576 {"grey30" , PALETTERGB (77, 77, 77) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
577 {"gray31" , PALETTERGB (79, 79, 79) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
578 {"grey31" , PALETTERGB (79, 79, 79) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
579 {"gray32" , PALETTERGB (82, 82, 82) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
580 {"grey32" , PALETTERGB (82, 82, 82) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
581 {"gray33" , PALETTERGB (84, 84, 84) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
582 {"grey33" , PALETTERGB (84, 84, 84) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
583 {"gray34" , PALETTERGB (87, 87, 87) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
584 {"grey34" , PALETTERGB (87, 87, 87) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
585 {"gray35" , PALETTERGB (89, 89, 89) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
586 {"grey35" , PALETTERGB (89, 89, 89) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
587 {"gray36" , PALETTERGB (92, 92, 92) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
588 {"grey36" , PALETTERGB (92, 92, 92) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
589 {"gray37" , PALETTERGB (94, 94, 94) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
590 {"grey37" , PALETTERGB (94, 94, 94) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
591 {"gray38" , PALETTERGB (97, 97, 97) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
592 {"grey38" , PALETTERGB (97, 97, 97) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
593 {"gray39" , PALETTERGB (99, 99, 99) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
594 {"grey39" , PALETTERGB (99, 99, 99) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
595 {"gray40" , PALETTERGB (102, 102, 102) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
596 {"grey40" , PALETTERGB (102, 102, 102) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
597 {"gray41" , PALETTERGB (105, 105, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
598 {"grey41" , PALETTERGB (105, 105, 105) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
599 {"gray42" , PALETTERGB (107, 107, 107) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
600 {"grey42" , PALETTERGB (107, 107, 107) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
601 {"gray43" , PALETTERGB (110, 110, 110) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
602 {"grey43" , PALETTERGB (110, 110, 110) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
603 {"gray44" , PALETTERGB (112, 112, 112) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
604 {"grey44" , PALETTERGB (112, 112, 112) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
605 {"gray45" , PALETTERGB (115, 115, 115) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
606 {"grey45" , PALETTERGB (115, 115, 115) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
607 {"gray46" , PALETTERGB (117, 117, 117) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
608 {"grey46" , PALETTERGB (117, 117, 117) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
609 {"gray47" , PALETTERGB (120, 120, 120) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
610 {"grey47" , PALETTERGB (120, 120, 120) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
611 {"gray48" , PALETTERGB (122, 122, 122) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
612 {"grey48" , PALETTERGB (122, 122, 122) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
613 {"gray49" , PALETTERGB (125, 125, 125) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
614 {"grey49" , PALETTERGB (125, 125, 125) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
615 {"gray50" , PALETTERGB (128, 128, 128) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
616 {"grey50" , PALETTERGB (128, 128, 128) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
617 {"gray51" , PALETTERGB (130, 130, 130) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
618 {"grey51" , PALETTERGB (130, 130, 130) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
619 {"gray52" , PALETTERGB (133, 133, 133) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
620 {"grey52" , PALETTERGB (133, 133, 133) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
621 {"gray53" , PALETTERGB (135, 135, 135) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
622 {"grey53" , PALETTERGB (135, 135, 135) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
623 {"gray54" , PALETTERGB (138, 138, 138) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
624 {"grey54" , PALETTERGB (138, 138, 138) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
625 {"gray55" , PALETTERGB (140, 140, 140) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
626 {"grey55" , PALETTERGB (140, 140, 140) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
627 {"gray56" , PALETTERGB (143, 143, 143) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
628 {"grey56" , PALETTERGB (143, 143, 143) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
629 {"gray57" , PALETTERGB (145, 145, 145) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
630 {"grey57" , PALETTERGB (145, 145, 145) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
631 {"gray58" , PALETTERGB (148, 148, 148) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
632 {"grey58" , PALETTERGB (148, 148, 148) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
633 {"gray59" , PALETTERGB (150, 150, 150) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
634 {"grey59" , PALETTERGB (150, 150, 150) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
635 {"gray60" , PALETTERGB (153, 153, 153) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
636 {"grey60" , PALETTERGB (153, 153, 153) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
637 {"gray61" , PALETTERGB (156, 156, 156) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
638 {"grey61" , PALETTERGB (156, 156, 156) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
639 {"gray62" , PALETTERGB (158, 158, 158) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
640 {"grey62" , PALETTERGB (158, 158, 158) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
641 {"gray63" , PALETTERGB (161, 161, 161) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
642 {"grey63" , PALETTERGB (161, 161, 161) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
643 {"gray64" , PALETTERGB (163, 163, 163) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
644 {"grey64" , PALETTERGB (163, 163, 163) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
645 {"gray65" , PALETTERGB (166, 166, 166) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
646 {"grey65" , PALETTERGB (166, 166, 166) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
647 {"gray66" , PALETTERGB (168, 168, 168) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
648 {"grey66" , PALETTERGB (168, 168, 168) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
649 {"gray67" , PALETTERGB (171, 171, 171) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
650 {"grey67" , PALETTERGB (171, 171, 171) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
651 {"gray68" , PALETTERGB (173, 173, 173) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
652 {"grey68" , PALETTERGB (173, 173, 173) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
653 {"gray69" , PALETTERGB (176, 176, 176) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
654 {"grey69" , PALETTERGB (176, 176, 176) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
655 {"gray70" , PALETTERGB (179, 179, 179) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
656 {"grey70" , PALETTERGB (179, 179, 179) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
657 {"gray71" , PALETTERGB (181, 181, 181) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
658 {"grey71" , PALETTERGB (181, 181, 181) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
659 {"gray72" , PALETTERGB (184, 184, 184) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
660 {"grey72" , PALETTERGB (184, 184, 184) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
661 {"gray73" , PALETTERGB (186, 186, 186) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
662 {"grey73" , PALETTERGB (186, 186, 186) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
663 {"gray74" , PALETTERGB (189, 189, 189) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
664 {"grey74" , PALETTERGB (189, 189, 189) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
665 {"gray75" , PALETTERGB (192, 192, 192) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
666 {"grey75" , PALETTERGB (192, 192, 192) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
667 {"gray76" , PALETTERGB (194, 194, 194) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
668 {"grey76" , PALETTERGB (194, 194, 194) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
669 {"gray77" , PALETTERGB (196, 196, 196) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
670 {"grey77" , PALETTERGB (196, 196, 196) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
671 {"gray78" , PALETTERGB (199, 199, 199) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
672 {"grey78" , PALETTERGB (199, 199, 199) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
673 {"gray79" , PALETTERGB (201, 201, 201) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
674 {"grey79" , PALETTERGB (201, 201, 201) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
675 {"gray80" , PALETTERGB (204, 204, 204) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
676 {"grey80" , PALETTERGB (204, 204, 204) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
677 {"gray81" , PALETTERGB (207, 207, 207) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
678 {"grey81" , PALETTERGB (207, 207, 207) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
679 {"gray82" , PALETTERGB (209, 209, 209) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
680 {"grey82" , PALETTERGB (209, 209, 209) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
681 {"gray83" , PALETTERGB (212, 212, 212) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
682 {"grey83" , PALETTERGB (212, 212, 212) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
683 {"gray84" , PALETTERGB (214, 214, 214) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
684 {"grey84" , PALETTERGB (214, 214, 214) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
685 {"gray85" , PALETTERGB (217, 217, 217) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
686 {"grey85" , PALETTERGB (217, 217, 217) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
687 {"gray86" , PALETTERGB (219, 219, 219) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
688 {"grey86" , PALETTERGB (219, 219, 219) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
689 {"gray87" , PALETTERGB (222, 222, 222) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
690 {"grey87" , PALETTERGB (222, 222, 222) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
691 {"gray88" , PALETTERGB (224, 224, 224) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
692 {"grey88" , PALETTERGB (224, 224, 224) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
693 {"gray89" , PALETTERGB (227, 227, 227) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
694 {"grey89" , PALETTERGB (227, 227, 227) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
695 {"gray90" , PALETTERGB (229, 229, 229) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
696 {"grey90" , PALETTERGB (229, 229, 229) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
697 {"gray91" , PALETTERGB (232, 232, 232) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
698 {"grey91" , PALETTERGB (232, 232, 232) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
699 {"gray92" , PALETTERGB (235, 235, 235) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
700 {"grey92" , PALETTERGB (235, 235, 235) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
701 {"gray93" , PALETTERGB (237, 237, 237) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
702 {"grey93" , PALETTERGB (237, 237, 237) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
703 {"gray94" , PALETTERGB (240, 240, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
704 {"grey94" , PALETTERGB (240, 240, 240) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
705 {"gray95" , PALETTERGB (242, 242, 242) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
706 {"grey95" , PALETTERGB (242, 242, 242) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
707 {"gray96" , PALETTERGB (245, 245, 245) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
708 {"grey96" , PALETTERGB (245, 245, 245) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
709 {"gray97" , PALETTERGB (247, 247, 247) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
710 {"grey97" , PALETTERGB (247, 247, 247) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
711 {"gray98" , PALETTERGB (250, 250, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
712 {"grey98" , PALETTERGB (250, 250, 250) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
713 {"gray99" , PALETTERGB (252, 252, 252) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
714 {"grey99" , PALETTERGB (252, 252, 252) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
715 {"gray100" , PALETTERGB (255, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
716 {"grey100" , PALETTERGB (255, 255, 255) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
717 {"DarkGrey" , PALETTERGB (169, 169, 169) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
718 {"DarkGray" , PALETTERGB (169, 169, 169) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
719 {"DarkBlue" , PALETTERGB (0, 0, 128) }, /* Adjusted == Navy */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
720 {"DarkCyan" , PALETTERGB (0, 128, 128) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
721 {"DarkMagenta" , PALETTERGB (128, 0, 128) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
722 {"DarkRed" , PALETTERGB (128, 0, 0) }, /* Adjusted */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
723 {"LightGreen" , PALETTERGB (144, 238, 144) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
724 /* Added to match values in the default Windows palette: */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
725 {"DarkYellow" , PALETTERGB (128, 128, 0) },
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
726 {"PaleYellow" , PALETTERGB (255, 255, 128) }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
730 typedef struct fontmap_t
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
732 const char *name;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
733 int value;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 } fontmap_t;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 /* Default weight first, preferred names listed before synonyms */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
737 static const fontmap_t fontweight_map[] =
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 {"Regular" , FW_REGULAR}, /* The standard font weight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 {"Thin" , FW_THIN},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 {"Extra Light" , FW_EXTRALIGHT},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742 {"Ultra Light" , FW_ULTRALIGHT},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 {"Light" , FW_LIGHT},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 {"Normal" , FW_NORMAL},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 {"Medium" , FW_MEDIUM},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 {"Semi Bold" , FW_SEMIBOLD},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 {"Demi Bold" , FW_DEMIBOLD},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 {"Bold" , FW_BOLD}, /* The standard bold font weight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 {"Extra Bold" , FW_EXTRABOLD},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 {"Ultra Bold" , FW_ULTRABOLD},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 {"Heavy" , FW_HEAVY},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 {"Black" , FW_BLACK}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
755 /* Default charset first, no synonyms allowed because these names are
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 * matched against the names reported by win32 by match_font() */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
757 static const fontmap_t charset_map[] =
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 {"Western" , ANSI_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 {"Symbol" , SYMBOL_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 {"Shift JIS" , SHIFTJIS_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 {"GB2312" , GB2312_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 {"Hanguel" , HANGEUL_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 {"Chinese Big 5" , CHINESEBIG5_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 #if (WINVER >= 0x0400)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 {"Johab" , JOHAB_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 {"Hebrew" , HEBREW_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 {"Arabic" , ARABIC_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 {"Greek" , GREEK_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 {"Turkish" , TURKISH_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 {"Vietnamese" , VIETNAMESE_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 {"Thai" , THAI_CHARSET}, /* #### Name to be verified */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 {"Central European" , EASTEUROPE_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 {"Cyrillic" , RUSSIAN_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 {"Mac" , MAC_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 {"Baltic" , BALTIC_CHARSET},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 {"OEM/DOS" , OEM_CHARSET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 /* helpers */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 static int
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
787 hexval (char c)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 /* assumes ASCII and isxdigit(c) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 if (c >= 'a')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 return c-'a' + 10;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 else if (c >= 'A')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 return c-'A' + 10;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 return c-'0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 COLORREF
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
799 mswindows_string_to_color(const char *name)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 int i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 if (*name == '#')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806 or "rgb:rrrr/gggg/bbbb" */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 unsigned int r, g, b;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
808
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 for (i=1; i<strlen(name); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 if (!isxdigit ((int)name[i]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 return (COLORREF) -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 if (strlen(name)==7)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 r = hexval (name[1]) * 16 + hexval (name[2]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 g = hexval (name[3]) * 16 + hexval (name[4]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 b = hexval (name[5]) * 16 + hexval (name[6]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 return (PALETTERGB (r, g, b));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 else if (strlen(name)==10)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 r = hexval (name[1]) * 16 + hexval (name[2]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824 g = hexval (name[4]) * 16 + hexval (name[5]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 b = hexval (name[7]) * 16 + hexval (name[8]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 return (PALETTERGB (r, g, b));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 else if (strlen(name)==13)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 r = hexval (name[1]) * 16 + hexval (name[2]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831 g = hexval (name[5]) * 16 + hexval (name[6]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832 b = hexval (name[9]) * 16 + hexval (name[10]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 return (PALETTERGB (r, g, b));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 else if (!strncmp(name, "rgb:", 4))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838 unsigned int r,g,b;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840 if (sscanf(name, "rgb:%04x/%04x/%04x", &r, &g, &b) == 3)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 int len = strlen (name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 if (len == 18)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 r /= 257;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846 g /= 257;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 b /= 257;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 else if (len == 15)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 r /= 17;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 g /= 17;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 b /= 17;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
854 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855 return (PALETTERGB (r, g, b));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
857 else
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858 return (COLORREF) -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 else if (*name) /* Can't be an empty string */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
862 char *nospaces = (char*) alloca (strlen (name)+1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
863 char *c = nospaces;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 while (*name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 if (*name != ' ')
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
866 *c++ = *name++;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 name++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 *c = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
871 for (i = 0; i < countof (mswindows_X_color_map); i++)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 if (!stricmp (nospaces, mswindows_X_color_map[i].name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 return (mswindows_X_color_map[i].colorref);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 return (COLORREF) -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
878 Lisp_Object
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
879 mswindows_color_to_string (COLORREF color)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
880 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
881 int i;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
882 char buf[8];
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
883 COLORREF pcolor = PALETTERGB (GetRValue (color), GetGValue (color),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
884 GetBValue (color));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
885
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
886 for (i=0; i < countof (mswindows_X_color_map); i++)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
887 if (pcolor == (mswindows_X_color_map[i].colorref))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
888 return build_string (mswindows_X_color_map[i].name);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
889
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
890 sprintf (buf, "#%02X%02X%02X",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
891 GetRValue (color), GetGValue (color), GetBValue (color));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
892 return build_string (buf);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
893 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
894
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 * Returns non-zero if the two supplied font patterns match.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 * If they match and fontname is not NULL, copies the logical OR of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898 * patterns to fontname (which is assumed to be at least MSW_FONTSIZE in size).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 * The patterns 'match' iff for each field that is not blank in either pattern,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 * the corresponding field in the other pattern is either identical or blank.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904 match_font (char *pattern1, char *pattern2, char *fontname)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 char *c1=pattern1, *c2=pattern2, *e1=0, *e2=0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 int i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 if (fontname)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 fontname[0] = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912 for (i=0; i<5; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 if (c1 && (e1 = strchr (c1, ':')))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 *(e1) = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 if (c2 && (e2 = strchr (c2, ':')))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 *(e2) = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 if (c1 && c1[0]!='\0')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 if (c2 && c2[0]!='\0' && stricmp(c1, c2))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 if (e1) *e1 = ':';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 if (e2) *e2 = ':';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 else if (fontname)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928 strcat (strcat (fontname, c1), ":");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 else if (fontname)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 if (c2 && c2[0]!='\0')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 strcat (strcat (fontname, c2), ":");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 strcat (fontname, ":");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 if (e1) *(e1++) = ':';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 if (e2) *(e2++) = ':';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 c1=e1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 c2=e2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 if (fontname)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 fontname[strlen (fontname) - 1] = '\0'; /* Trim trailing ':' */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 /* exports */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 struct font_enum_t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 HDC hdc;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
960 Lisp_Object list;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 static int CALLBACK
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
964 old_font_enum_callback_2 (ENUMLOGFONT FAR *lpelfe, NEWTEXTMETRIC FAR *lpntme,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
965 int FontType, struct font_enum_t *font_enum)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
966 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
967 char fontname[MSW_FONTSIZE];
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
968 Lisp_Object fontname_lispstr;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
969 int i;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
970
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
971 /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
972 * The enumerated font weights are not to be trusted because:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
973 * a) lpelfe->elfStyle is only filled in for TrueType fonts.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
974 * b) Not all Bold and Italic styles of all fonts (including some Vector,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
975 * Truetype and Raster fonts) are enumerated.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
976 * I guess that fonts for which Bold and Italic styles are generated
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
977 * 'on-the-fly' are not enumerated. It would be overly restrictive to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
978 * disallow Bold And Italic weights for these fonts, so we just leave
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
979 * weights unspecified. This means that we have to weed out duplicates of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
980 * those fonts that do get enumerated with different weights.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
981 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
982 if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
983 /* Scalable, so leave pointsize blank */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
984 sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
985 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
986 /* Formula for pointsize->height from LOGFONT docs in Platform SDK */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
987 sprintf (fontname, "%s::%d::", lpelfe->elfLogFont.lfFaceName,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
988 MulDiv (lpntme->tmHeight - lpntme->tmInternalLeading,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
989 72, GetDeviceCaps (font_enum->hdc, LOGPIXELSY)));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
990
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
991 /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
992 * The enumerated font character set strings are not to be trusted because
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
993 * lpelfe->elfScript is returned in the host language and not in English.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
994 * We can't know a priori the translations of "Western", "Central European"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
995 * etc into the host language, so we must use English. The same argument
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
996 * applies to the font weight string when matching fonts.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
997 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
998 for (i=0; i<countof (charset_map); i++)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
999 if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1000 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1001 strcat (fontname, charset_map[i].name);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1002 break;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1003 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1004 if (i==countof (charset_map))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1005 strcpy (fontname, charset_map[0].name);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1006
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1007 /* Add the font name to the list if not already there */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1008 fontname_lispstr = build_string (fontname);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1009 if (NILP (memq_no_quit (fontname_lispstr, font_enum->list)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1010 font_enum->list = Fcons (fontname_lispstr, font_enum->list);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1011
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1012 return 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1013 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1014
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1015 static int CALLBACK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1016 old_font_enum_callback_1 (ENUMLOGFONT FAR *lpelfe, NEWTEXTMETRIC FAR *lpntme,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1017 int FontType, struct font_enum_t *font_enum)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1018 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1019 /* This function gets called once per facename per character set.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1020 * We call a second callback to enumerate the fonts in each facename */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1021 return EnumFontFamilies (font_enum->hdc, lpelfe->elfLogFont.lfFaceName,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1022 (FONTENUMPROC) old_font_enum_callback_2,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1023 (LPARAM) font_enum);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1024 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1025
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1026 static int CALLBACK
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1027 font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 int FontType, struct font_enum_t *font_enum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 char fontname[MSW_FONTSIZE];
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1031 Lisp_Object fontname_lispstr;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 int i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 * The enumerated font weights are not to be trusted because:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 * a) lpelfe->elfStyle is only filled in for TrueType fonts.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1037 * b) Not all Bold and Italic styles of all fonts (including some Vector,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 * Truetype and Raster fonts) are enumerated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 * I guess that fonts for which Bold and Italic styles are generated
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 * 'on-the-fly' are not enumerated. It would be overly restrictive to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041 * disallow Bold And Italic weights for these fonts, so we just leave
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 * weights unspecified. This means that we have to weed out duplicates of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 * those fonts that do get enumerated with different weights.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 /* Scalable, so leave pointsize blank */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 /* Formula for pointsize->height from LOGFONT docs in Platform SDK */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 sprintf (fontname, "%s::%d::", lpelfe->elfLogFont.lfFaceName,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 MulDiv (lpntme->ntmTm.tmHeight - lpntme->ntmTm.tmInternalLeading,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1052 72, GetDeviceCaps (font_enum->hdc, LOGPIXELSY)));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 * The enumerated font character set strings are not to be trusted because
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 * lpelfe->elfScript is returned in the host language and not in English.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 * We can't know a priori the translations of "Western", "Central European"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 * etc into the host language, so we must use English. The same argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059 * applies to the font weight string when matching fonts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 for (i=0; i<countof (charset_map); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064 strcat (fontname, charset_map[i].name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 if (i==countof (charset_map))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 strcpy (fontname, charset_map[0].name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1070 /* Add the font name to the list if not already there */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1071 fontname_lispstr = build_string (fontname);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1072 if (NILP (memq_no_quit (fontname_lispstr, font_enum->list)))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1073 font_enum->list = Fcons (fontname_lispstr, font_enum->list);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 static int CALLBACK
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1079 font_enum_callback_1 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 int FontType, struct font_enum_t *font_enum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 /* This function gets called once per facename per character set.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 * We call a second callback to enumerate the fonts in each facename */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1084 return xEnumFontFamiliesExA (font_enum->hdc, &lpelfe->elfLogFont,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1085 (FONTENUMPROC) font_enum_callback_2,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1086 (LPARAM) font_enum, 0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 /*
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1090 * Enumerate the available on the HDC fonts and return a list of string
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1091 * font names.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1093 Lisp_Object
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1094 mswindows_enumerate_fonts (HDC hdc)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1096 /* This cannot CG */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 LOGFONT logfont;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 struct font_enum_t font_enum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 assert (hdc!=NULL);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 logfont.lfCharSet = DEFAULT_CHARSET;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 logfont.lfFaceName[0] = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 logfont.lfPitchAndFamily = DEFAULT_PITCH;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 font_enum.hdc = hdc;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1105 font_enum.list = Qnil;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1106 if (xEnumFontFamiliesExA)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1107 xEnumFontFamiliesExA (hdc, &logfont, (FONTENUMPROC) font_enum_callback_1,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1108 (LPARAM) (&font_enum), 0);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1109 else /* NT 3.5x */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1110 EnumFontFamilies (hdc, 0, (FONTENUMPROC) old_font_enum_callback_1,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1111 (LPARAM) (&font_enum));
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1112
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1113 return font_enum.list;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1116 static HFONT
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1117 mswindows_create_font_variant (Lisp_Font_Instance* f,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1118 int under, int strike)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1119 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1120 /* Cannot GC */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1121
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1122 LOGFONT lf;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1123 HFONT hfont;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1124
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1125 assert (FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike) == NULL);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1126
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1127 if (GetObject (FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0),
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1128 sizeof (lf), (void*) &lf) == 0)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1129 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1130 hfont = MSWINDOWS_BAD_HFONT;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1131 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1132 else
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1133 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1134 lf.lfUnderline = under;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1135 lf.lfStrikeOut = strike;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1136
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1137 hfont = CreateFontIndirect (&lf);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1138 if (hfont == NULL)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1139 hfont = MSWINDOWS_BAD_HFONT;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1140 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1141
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1142 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike) = hfont;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1143 return hfont;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1144 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1145
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1146 HFONT
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1147 mswindows_get_hfont (Lisp_Font_Instance* f,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1148 int under, int strike)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1149 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1150 /* Cannot GC */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1151 HFONT hfont = FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, under, strike);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1152
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1153 if (hfont == NULL)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1154 hfont = mswindows_create_font_variant (f, under, strike);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1155
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1156 /* If strikeout/underline variant of the font could not be
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1157 created, then use the base version of the font */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1158 if (hfont == MSWINDOWS_BAD_HFONT)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1159 hfont = FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1160
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1161 assert (hfont != NULL && hfont != MSWINDOWS_BAD_HFONT);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1162
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1163 return hfont;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1164 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 /* methods */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170 static int
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1171 mswindows_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
1172 Lisp_Object device, Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1174 const char *extname;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 COLORREF color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1177 TO_EXTERNAL_FORMAT (LISP_STRING, name,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1178 C_STRING_ALLOCA, extname,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1179 Qctext);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 color = mswindows_string_to_color(extname);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 if (color != -1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 c->data = xnew (struct mswindows_color_instance_data);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 COLOR_INSTANCE_MSWINDOWS_COLOR (c) = color;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 }
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1187 maybe_signal_error (Qinvalid_constant,
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1188 "Unrecognized color", name, Qcolor, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 return(0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 static void
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1194 mswindows_mark_color_instance (Lisp_Color_Instance *c)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 static void
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1200 mswindows_print_color_instance (Lisp_Color_Instance *c,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1201 Lisp_Object printcharfun,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1202 int escapeflag)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 char buf[32];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 sprintf (buf, " %06ld=(%04X,%04X,%04X)", color & 0xffffff,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 GetRValue(color)*257, GetGValue(color)*257, GetBValue(color)*257);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 write_c_string (buf, printcharfun);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 static void
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1212 mswindows_finalize_color_instance (Lisp_Color_Instance *c)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 if (c->data)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 xfree (c->data);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 c->data = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 static int
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1222 mswindows_color_instance_equal (Lisp_Color_Instance *c1,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1223 Lisp_Color_Instance *c2,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1224 int depth)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 return (COLOR_INSTANCE_MSWINDOWS_COLOR(c1) == COLOR_INSTANCE_MSWINDOWS_COLOR(c2));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 static unsigned long
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1230 mswindows_color_instance_hash (Lisp_Color_Instance *c, int depth)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 return (unsigned long) COLOR_INSTANCE_MSWINDOWS_COLOR(c);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 static Lisp_Object
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1236 mswindows_color_instance_rgb_components (Lisp_Color_Instance *c)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 COLORREF color = COLOR_INSTANCE_MSWINDOWS_COLOR (c);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 return list3 (make_int (GetRValue (color) * 257),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 make_int (GetGValue (color) * 257),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 make_int (GetBValue (color) * 257));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 mswindows_valid_color_name_p (struct device *d, Lisp_Object color)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1247 const char *extname;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1249 TO_EXTERNAL_FORMAT (LISP_STRING, color,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1250 C_STRING_ALLOCA, extname,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1251 Qctext);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 return (mswindows_string_to_color(extname)!=-1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 static void
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1258 mswindows_finalize_font_instance (Lisp_Font_Instance *f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1260 /*
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1261 * This is a work horse for both mswindows_initialize_font_instance and
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1262 * msprinter_initialize_font_instance.
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1263 */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 static int
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1265 initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1266 Lisp_Object device_font_list, HDC hdc,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
1267 Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1269 const char *extname;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 LOGFONT logfont;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 int fields, i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 int pt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 char fontname[LF_FACESIZE], weight[LF_FACESIZE], *style, points[8];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 char effects[LF_FACESIZE], charset[LF_FACESIZE];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 char *c;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1276 HFONT hfont, hfont2;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277 TEXTMETRIC metrics;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1278
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1279 extname = XSTRING_DATA (name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1280
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 * mswindows fonts look like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283 * fontname[:[weight ][style][:pointsize[:effects]]][:charset]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 * The font name field shouldn't be empty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 * ie:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287 * Lucida Console:Regular:10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288 * minimal:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 * Courier New
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290 * maximal:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 * Courier New:Bold Italic:10:underline strikeout:western
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 fields = sscanf (extname, "%31[^:]:%31[^:]:%7[^:]:%31[^:]:%31s",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295 fontname, weight, points, effects, charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1297 /* This function is implemented in a fairly ad-hoc manner.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298 * The general idea is to validate and canonicalize each of the above fields
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 * at the same time as we build up the win32 LOGFONT structure. This enables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 * us to use match_font() on a canonicalized font string to check the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 * availability of the requested font */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 if (fields < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1305 maybe_signal_error (Qinvalid_argument, "Invalid font", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 if (fields>0 && strlen(fontname))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 strncpy (logfont.lfFaceName, fontname, LF_FACESIZE);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312 logfont.lfFaceName[LF_FACESIZE-1] = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1316 maybe_signal_error (Qinvalid_argument, "Must specify a font name", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1319
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 /* weight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 if (fields < 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 strcpy (weight, fontweight_map[0].name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 /* Maybe split weight into weight and style */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 if ((c=strchr(weight, ' ')))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 *c = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 style = c+1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 style = NULL;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 for (i=0; i<countof (fontweight_map); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 if (!stricmp (weight, fontweight_map[i].name))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1335 {
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 logfont.lfWeight = fontweight_map[i].value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339 if (i == countof (fontweight_map)) /* No matching weight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 if (!style)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343 logfont.lfWeight = FW_REGULAR;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344 style = weight; /* May have specified style without weight */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1345 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1347 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1348 maybe_signal_error (Qinvalid_constant, "Invalid font weight", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1349 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 if (style)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355 /* #### what about oblique? */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1356 if (stricmp (style,"italic") == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1357 logfont.lfItalic = TRUE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1360 maybe_signal_error (Qinvalid_constant, "Invalid font weight or style", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1361 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364 /* Glue weight and style together again */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365 if (weight != style)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 *c = ' ';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369 logfont.lfItalic = FALSE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371 if (fields < 3)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1372 pt = 10; /* #### Should we reject strings that don't specify a size? */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1373 else if ((pt=atoi(points)) == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1375 maybe_signal_error (Qinvalid_argument, "Invalid font pointsize", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1379 /* Formula for pointsize->height from LOGFONT docs in MSVC5 Platform SDK */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1380 logfont.lfHeight = -MulDiv(pt, GetDeviceCaps (hdc, LOGPIXELSY), 72);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 logfont.lfWidth = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 /* Effects */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1384 logfont.lfUnderline = FALSE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1385 logfont.lfStrikeOut = FALSE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1386 if (fields >= 4 && effects[0] != '\0')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1387 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1388 char *effects2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1389
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1390 /* Maybe split effects into effects and effects2 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1391 if ((c=strchr (effects, ' ')))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1393 *c = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1394 effects2 = c+1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1395 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1396 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1397 effects2 = NULL;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1398
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1399 if (stricmp (effects, "underline") == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1400 logfont.lfUnderline = TRUE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1401 else if (stricmp (effects, "strikeout") == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1402 logfont.lfStrikeOut = TRUE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1403 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1404 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1405 maybe_signal_error (Qinvalid_constant, "Invalid font effect", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1409 if (effects2 && effects2[0] != '\0')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1410 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1411 if (stricmp (effects2, "underline") == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1412 logfont.lfUnderline = TRUE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1413 else if (stricmp (effects2, "strikeout") == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1414 logfont.lfStrikeOut = TRUE;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1415 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1416 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1417 maybe_signal_error (Qinvalid_constant, "Invalid font effect", name,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1418 Qfont, errb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1419 return (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1420 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1421 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1422
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1423 /* Regenerate sanitised effects string */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1424 if (logfont.lfUnderline)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1425 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 if (logfont.lfStrikeOut)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1427 strcpy (effects, "underline strikeout");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1428 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 strcpy (effects, "underline");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431 else if (logfont.lfStrikeOut)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432 strcpy (effects, "strikeout");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1433 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1435 effects[0] = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437 /* Charset */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1438 /* charset can be specified even if earlier fields haven't been */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439 if (fields < 5)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1441 if ((c=strchr (extname, ':')) && (c=strchr (c+1, ':')) &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 (c=strchr (c+1, ':')) && (c=strchr (c+1, ':')))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444 strncpy (charset, c+1, LF_FACESIZE);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 charset[LF_FACESIZE-1] = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448 strcpy (charset, charset_map[0].name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1449 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1450
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1451 for (i=0; i<countof (charset_map); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1452 if (!stricmp (charset, charset_map[i].name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1453 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1454 logfont.lfCharSet = charset_map[i].value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1455 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1456 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1457
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1458 if (i == countof (charset_map)) /* No matching charset */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1459 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1460 maybe_signal_error (Qinvalid_argument, "Invalid charset", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1461 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1462 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1463
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1464 /* Misc crud */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1465 logfont.lfEscapement = logfont.lfOrientation = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1466 #if 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1467 logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1468 logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1469 logfont.lfQuality = DEFAULT_QUALITY;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1470 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1471 logfont.lfOutPrecision = OUT_STROKE_PRECIS;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1472 logfont.lfClipPrecision = CLIP_STROKE_PRECIS;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1473 logfont.lfQuality = PROOF_QUALITY;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1474 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1475 /* Default to monospaced if the specified fontname doesn't exist. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1476 logfont.lfPitchAndFamily = FF_MODERN;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1477
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1478 /* Windows will silently substitute a default font if the fontname specifies
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1479 a non-existent font. This is bad for screen fonts because it doesn't
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1480 allow higher-level code to see the error and to act appropriately.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1481 For instance complex_vars_of_faces() sets up a fallback list of fonts
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1482 for the default face. */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1483
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1484 if (!NILP (device_font_list))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1485 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1486 Lisp_Object fonttail;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1487 char truename[MSW_FONTSIZE];
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1488
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1489 sprintf (truename, "%s:%s:%d:%s:%s", fontname, weight, pt, effects, charset);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1490 LIST_LOOP (fonttail, device_font_list)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1491 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1492 if (match_font (XSTRING_DATA (XCAR (fonttail)), truename, NULL))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1493 break;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1494 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1495 if (NILP (fonttail))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1496 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1497 maybe_signal_error (Qinvalid_argument, "No matching font", name, Qfont, errb);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1498 return 0;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1499 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1500 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1501
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1502 if ((hfont = CreateFontIndirect(&logfont)) == NULL)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1503 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1504 maybe_signal_error (Qgui_error, "Couldn't create font", name, Qfont, errb);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1505 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1506 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1507
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1508 f->data = xnew_and_zero (struct mswindows_font_instance_data);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1509 FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0) = hfont;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1510
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1511 /* Some underlined fonts have the descent of one pixel more than their
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1512 non-underlined counterparts. Font variants though are assumed to have
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1513 identical metrics. So get the font metrics from the underlined variant
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1514 of the font */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1515 hfont2 = mswindows_create_font_variant (f, 1, 0);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1516 if (hfont2 != MSWINDOWS_BAD_HFONT)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1517 hfont = hfont2;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1518
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1519 hfont2 = (HFONT) SelectObject (hdc, hfont);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1520 if (!hfont2)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1521 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1522 mswindows_finalize_font_instance (f);
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 442
diff changeset
1523 maybe_signal_error (Qgui_error, "Couldn't map font", name, Qfont, errb);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1524 return 0;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1525 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1526 GetTextMetrics (hdc, &metrics);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1527 SelectObject(hdc, hfont2);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1528
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1529 f->width = (unsigned short) metrics.tmAveCharWidth;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1530 f->height = (unsigned short) metrics.tmHeight;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1531 f->ascent = (unsigned short) metrics.tmAscent;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1532 f->descent = (unsigned short) metrics.tmDescent;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1533 f->proportional_p = (metrics.tmPitchAndFamily & TMPF_FIXED_PITCH);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1534
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1535 return 1;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1536 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1537
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1538 static int
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1539 mswindows_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
1540 Lisp_Object device, Error_Behavior errb)
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1541 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1542 HDC hdc = CreateCompatibleDC (NULL);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1543 Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device));
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1544 int res = initialize_font_instance (f, name, font_list, hdc, errb);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1545 DeleteDC (hdc);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1546 return res;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1547 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1548
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1549 static int
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1550 msprinter_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
1551 Lisp_Object device, Error_Behavior errb)
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1552 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1553 HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (device));
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1554 Lisp_Object font_list = DEVICE_MSPRINTER_FONTLIST (XDEVICE (device));
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1555 return initialize_font_instance (f, name, font_list, hdc, errb);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1556 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1557
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1558 static void
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1559 mswindows_finalize_font_instance (Lisp_Font_Instance *f)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1560 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1561 int i;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1562
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1563 if (f->data)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1564 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1565 for (i = 0; i < MSWINDOWS_NUM_FONT_VARIANTS; i++)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1566 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1567 if (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i) != NULL
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1568 && FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i) != MSWINDOWS_BAD_HFONT)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1569 DeleteObject (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1570 }
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1571
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1572 xfree (f->data);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1573 f->data = 0;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1574 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1575 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1576
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1577 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1578 static void
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1579 mswindows_mark_font_instance (Lisp_Font_Instance *f)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1580 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1581 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1582 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1583
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1584 static void
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1585 mswindows_print_font_instance (Lisp_Font_Instance *f,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1586 Lisp_Object printcharfun,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1587 int escapeflag)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1588 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1589 char buf[10];
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1590 sprintf (buf, " 0x%lx",
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1591 (unsigned long)FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0));
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1592 write_c_string (buf, printcharfun);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1593 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1594
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1595 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1596 mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1597 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1598 Lisp_Object fonttail, result = Qnil;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1599 char *extpattern;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1600
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1601 TO_EXTERNAL_FORMAT (LISP_STRING, pattern,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1602 C_STRING_ALLOCA, extpattern,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1603 Qctext);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1604
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1605 LIST_LOOP (fonttail, DEVICE_MSWINDOWS_FONTLIST (XDEVICE (device)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1606 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1607 if (match_font (XSTRING_DATA (XCAR (fonttail)), extpattern, NULL))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1608 result = Fcons (XCAR (fonttail), result);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1609 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1610
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1611 return Fnreverse (result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1612 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1613
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1614 /* Fill in missing parts of a font spec. This is primarily intended as a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1615 * helper function for the functions below.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1616 * mswindows fonts look like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1617 * fontname[:[weight][ style][:pointsize[:effects]]][:charset]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1618 * A minimal mswindows font spec looks like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1619 * Courier New
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1620 * A maximal mswindows font spec looks like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1621 * Courier New:Bold Italic:10:underline strikeout:Western
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1622 * Missing parts of the font spec should be filled in with these values:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1623 * Courier New:Regular:10::Western */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1624 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 563
diff changeset
1625 mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_Behavior errb)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1626 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1627 int nsep=0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1628 char *name = (char *) XSTRING_DATA (f->name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1629 char* ptr = name;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1630 char* extname = (char*) alloca (strlen (name) + 19);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1631 strcpy (extname, name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1632
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1633 while ((ptr = strchr (ptr, ':')) != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1634 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1635 ptr++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1636 nsep++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1637 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1638
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1639 switch (nsep)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1640 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1641 case 0:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1642 strcat (extname, ":Regular:10::Western");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1643 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1644 case 1:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1645 strcat (extname, ":10::Western");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1646 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1647 case 2:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1648 strcat (extname, "::Western");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1649 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1650 case 3:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1651 strcat (extname, ":Western");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1652 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1653 default:;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1654 }
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1655
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1656 return build_ext_string (extname, Qnative);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1657 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1658
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1659 #ifdef MULE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1660
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1661 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1662 mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1663 const Bufbyte *nonreloc, Lisp_Object reloc,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1664 Bytecount offset, Bytecount length)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1665 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1666 /* #### Implement me */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1667 if (UNBOUNDP (charset))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1668 return 1;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1669
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1670 return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1671 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1672
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1673 /* find a font spec that matches font spec FONT and also matches
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1674 (the registry of) CHARSET. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1675 static Lisp_Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676 mswindows_find_charset_font (Lisp_Object device, Lisp_Object font,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1677 Lisp_Object charset)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1678 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 /* #### Implement me */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680 return build_string ("Courier New:Regular:10");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1683 #endif /* MULE */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1685
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1687 /* non-methods */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1689
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690 DEFUN ("mswindows-color-list", Fmswindows_color_list, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1691 Return a list of the colors available on mswindows devices.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1694 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695 Lisp_Object result = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696 int i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1698 for (i=0; i<countof (mswindows_X_color_map); i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1699 result = Fcons (build_string (mswindows_X_color_map[i].name), result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1700
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1701 return Fnreverse (result);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1702 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1703
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1705
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1706 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1707 /* initialization */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1708 /************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1709
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1710 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1711 syms_of_objects_mswindows (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1712 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1713 DEFSUBR (Fmswindows_color_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1714 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1715
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1716 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1717 console_type_create_objects_mswindows (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1718 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1719 /* object methods */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1720 CONSOLE_HAS_METHOD (mswindows, initialize_color_instance);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1721 /* CONSOLE_HAS_METHOD (mswindows, mark_color_instance); */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1722 CONSOLE_HAS_METHOD (mswindows, print_color_instance);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1723 CONSOLE_HAS_METHOD (mswindows, finalize_color_instance);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1724 CONSOLE_HAS_METHOD (mswindows, color_instance_equal);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1725 CONSOLE_HAS_METHOD (mswindows, color_instance_hash);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1726 CONSOLE_HAS_METHOD (mswindows, color_instance_rgb_components);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1727 CONSOLE_HAS_METHOD (mswindows, valid_color_name_p);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1728
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1729 CONSOLE_HAS_METHOD (mswindows, initialize_font_instance);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1730 /* CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1731 CONSOLE_HAS_METHOD (mswindows, print_font_instance);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1732 CONSOLE_HAS_METHOD (mswindows, finalize_font_instance);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1733 CONSOLE_HAS_METHOD (mswindows, font_instance_truename);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1734 CONSOLE_HAS_METHOD (mswindows, list_fonts);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1735 #ifdef MULE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1736 CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1737 CONSOLE_HAS_METHOD (mswindows, find_charset_font);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1738 #endif
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1739
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1740 /* Printer methods - delegate most to windows methods,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1741 since graphical objects behave the same way. */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1742
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1743 CONSOLE_INHERITS_METHOD (msprinter, mswindows, initialize_color_instance);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1744 /* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_color_instance); */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1745 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_color_instance);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1746 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_color_instance);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1747 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_equal);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1748 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_hash);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1749 CONSOLE_INHERITS_METHOD (msprinter, mswindows, color_instance_rgb_components);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1750 CONSOLE_INHERITS_METHOD (msprinter, mswindows, valid_color_name_p);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1751
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1752 CONSOLE_HAS_METHOD (msprinter, initialize_font_instance);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1753 /* CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_font_instance); */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1754 CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_font_instance);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1755 CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_font_instance);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1756 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1757 CONSOLE_INHERITS_METHOD (msprinter, mswindows, list_fonts);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1758 #ifdef MULE
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1759 CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_spec_matches_charset);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1760 CONSOLE_INHERITS_METHOD (msprinter, mswindows, find_charset_font);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
1761 #endif
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1762 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1763
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1764 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1765 vars_of_objects_mswindows (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1766 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1767 }