annotate src/objects-msw.c @ 788:026c5bf9c134

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