428
|
1 /* X-specific Lisp objects.
|
|
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
|
|
4 Copyright (C) 1995 Tinker Systems.
|
442
|
5 Copyright (C) 1995, 1996, 2000 Ben Wing.
|
428
|
6 Copyright (C) 1995 Sun Microsystems, Inc.
|
|
7
|
|
8 This file is part of XEmacs.
|
|
9
|
|
10 XEmacs is free software; you can redistribute it and/or modify it
|
|
11 under the terms of the GNU General Public License as published by the
|
|
12 Free Software Foundation; either version 2, or (at your option) any
|
|
13 later version.
|
|
14
|
|
15 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
18 for more details.
|
|
19
|
|
20 You should have received a copy of the GNU General Public License
|
|
21 along with XEmacs; see the file COPYING. If not, write to
|
|
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
23 Boston, MA 02111-1307, USA. */
|
|
24
|
|
25 /* Synched up with: Not in FSF. */
|
|
26
|
|
27 /* Authors: Jamie Zawinski, Chuck Thompson, Ben Wing */
|
|
28
|
442
|
29 /* This file Mule-ized by Ben Wing, 7-10-00. */
|
|
30
|
428
|
31 #include <config.h>
|
|
32 #include "lisp.h"
|
|
33
|
|
34 #include "console-x.h"
|
|
35 #include "objects-x.h"
|
|
36
|
|
37 #include "buffer.h"
|
|
38 #include "device.h"
|
|
39 #include "insdel.h"
|
|
40
|
|
41 int x_handle_non_fully_specified_fonts;
|
|
42
|
|
43
|
|
44 /************************************************************************/
|
|
45 /* color instances */
|
|
46 /************************************************************************/
|
|
47
|
|
48 /* Replacement for XAllocColor() that tries to return the nearest
|
|
49 available color if the colormap is full. Original was from FSFmacs,
|
|
50 but rewritten by Jareth Hein <jareth@camelot-soft.com> 97/11/25
|
|
51 Modified by Lee Kindness <lkindness@csl.co.uk> 31/08/99 to handle previous
|
|
52 total failure which was due to a read/write colorcell being the nearest
|
|
53 match - tries the next nearest...
|
|
54
|
|
55 Return value is 1 for normal success, 2 for nearest color success,
|
442
|
56 3 for Non-deallocable success. */
|
428
|
57 int
|
|
58 allocate_nearest_color (Display *display, Colormap colormap, Visual *visual,
|
|
59 XColor *color_def)
|
|
60 {
|
|
61 int status;
|
|
62
|
|
63 if (visual->class == DirectColor || visual->class == TrueColor)
|
|
64 {
|
|
65 if (XAllocColor (display, colormap, color_def) != 0)
|
|
66 {
|
|
67 status = 1;
|
|
68 }
|
|
69 else
|
|
70 {
|
|
71 /* We're dealing with a TrueColor/DirectColor visual, so play games
|
|
72 with the RGB values in the XColor struct. */
|
440
|
73 /* #### JH: I'm not sure how a call to XAllocColor can fail in a
|
428
|
74 TrueColor or DirectColor visual, so I will just reformat the
|
|
75 request to match the requirements of the visual, and re-issue
|
|
76 the request. If this fails for anybody, I wanna know about it
|
|
77 so I can come up with a better plan */
|
|
78
|
|
79 unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
|
|
80 junk = visual->red_mask;
|
|
81 rshift = 0;
|
|
82 while ((junk & 0x1) == 0) {
|
|
83 junk = junk >> 1;
|
|
84 rshift ++;
|
|
85 }
|
|
86 rbits = 0;
|
|
87 while (junk != 0) {
|
|
88 junk = junk >> 1;
|
|
89 rbits++;
|
|
90 }
|
|
91 junk = visual->green_mask;
|
|
92 gshift = 0;
|
|
93 while ((junk & 0x1) == 0) {
|
|
94 junk = junk >> 1;
|
|
95 gshift ++;
|
|
96 }
|
|
97 gbits = 0;
|
|
98 while (junk != 0) {
|
|
99 junk = junk >> 1;
|
|
100 gbits++;
|
|
101 }
|
|
102 junk = visual->blue_mask;
|
|
103 bshift = 0;
|
|
104 while ((junk & 0x1) == 0) {
|
|
105 junk = junk >> 1;
|
|
106 bshift ++;
|
|
107 }
|
|
108 bbits = 0;
|
|
109 while (junk != 0) {
|
|
110 junk = junk >> 1;
|
|
111 bbits++;
|
|
112 }
|
|
113
|
|
114 color_def->red = color_def->red >> (16 - rbits);
|
|
115 color_def->green = color_def->green >> (16 - gbits);
|
|
116 color_def->blue = color_def->blue >> (16 - bbits);
|
|
117 if (XAllocColor (display, colormap, color_def) != 0)
|
|
118 status = 1;
|
|
119 else
|
|
120 {
|
|
121 int rd, gr, bl;
|
440
|
122 /* #### JH: I'm punting here, knowing that doing this will at
|
428
|
123 least draw the color correctly. However, unless we convert
|
|
124 all of the functions that allocate colors (graphics
|
|
125 libraries, etc) to use this function doing this is very
|
|
126 likely to cause problems later... */
|
|
127
|
|
128 if (rbits > 8)
|
|
129 rd = color_def->red << (rbits - 8);
|
|
130 else
|
|
131 rd = color_def->red >> (8 - rbits);
|
|
132 if (gbits > 8)
|
|
133 gr = color_def->green << (gbits - 8);
|
|
134 else
|
|
135 gr = color_def->green >> (8 - gbits);
|
|
136 if (bbits > 8)
|
|
137 bl = color_def->blue << (bbits - 8);
|
|
138 else
|
|
139 bl = color_def->blue >> (8 - bbits);
|
442
|
140 color_def->pixel = (rd << rshift) | (gr << gshift) | (bl <<
|
|
141 bshift);
|
428
|
142 status = 3;
|
|
143 }
|
|
144 }
|
|
145 }
|
|
146 else
|
|
147 {
|
|
148 XColor *cells = NULL;
|
|
149 /* JH: I can't believe there's no way to go backwards from a
|
|
150 colormap ID and get its visual and number of entries, but X
|
|
151 apparently isn't built that way... */
|
|
152 int no_cells = visual->map_entries;
|
|
153 status = 0;
|
|
154
|
|
155 if (XAllocColor (display, colormap, color_def) != 0)
|
|
156 status = 1;
|
|
157 else while( status != 2 )
|
|
158 {
|
|
159 /* If we got to this point, the colormap is full, so we're
|
|
160 going to try and get the next closest color. The algorithm used
|
|
161 is a least-squares matching, which is what X uses for closest
|
|
162 color matching with StaticColor visuals. */
|
|
163 int nearest;
|
|
164 long nearest_delta, trial_delta;
|
|
165 int x;
|
|
166
|
|
167 if( cells == NULL )
|
442
|
168 {
|
|
169 cells = alloca_array (XColor, no_cells);
|
|
170 for (x = 0; x < no_cells; x++)
|
|
171 cells[x].pixel = x;
|
428
|
172
|
442
|
173 /* read the current colormap */
|
|
174 XQueryColors (display, colormap, cells, no_cells);
|
|
175 }
|
428
|
176
|
|
177 nearest = 0;
|
|
178 /* I'm assuming CSE so I'm not going to condense this. */
|
|
179 nearest_delta = ((((color_def->red >> 8) - (cells[0].red >> 8))
|
|
180 * ((color_def->red >> 8) - (cells[0].red >> 8)))
|
|
181 +
|
|
182 (((color_def->green >> 8) - (cells[0].green >> 8))
|
442
|
183 * ((color_def->green >> 8) - (cells[0].green >>
|
|
184 8)))
|
428
|
185 +
|
|
186 (((color_def->blue >> 8) - (cells[0].blue >> 8))
|
442
|
187 * ((color_def->blue >> 8) - (cells[0].blue >>
|
|
188 8))));
|
428
|
189 for (x = 1; x < no_cells; x++)
|
|
190 {
|
|
191 trial_delta = ((((color_def->red >> 8) - (cells[x].red >> 8))
|
|
192 * ((color_def->red >> 8) - (cells[x].red >> 8)))
|
|
193 +
|
|
194 (((color_def->green >> 8) - (cells[x].green >> 8))
|
442
|
195 * ((color_def->green >> 8) - (cells[x].green >>
|
|
196 8)))
|
428
|
197 +
|
|
198 (((color_def->blue >> 8) - (cells[x].blue >> 8))
|
442
|
199 * ((color_def->blue >> 8) - (cells[x].blue >>
|
|
200 8))));
|
428
|
201
|
|
202 /* less? Ignore cells marked as previously failing */
|
|
203 if( (trial_delta < nearest_delta) &&
|
|
204 (cells[x].pixel != ULONG_MAX) )
|
|
205 {
|
|
206 nearest = x;
|
|
207 nearest_delta = trial_delta;
|
|
208 }
|
|
209 }
|
|
210 color_def->red = cells[nearest].red;
|
|
211 color_def->green = cells[nearest].green;
|
|
212 color_def->blue = cells[nearest].blue;
|
|
213 if (XAllocColor (display, colormap, color_def) != 0)
|
442
|
214 status = 2;
|
428
|
215 else
|
442
|
216 /* LSK: Either the colour map has changed since
|
|
217 * we read it, or the colour is allocated
|
|
218 * read/write... Mark this cmap entry so it's
|
|
219 * ignored in the next iteration.
|
|
220 */
|
|
221 cells[nearest].pixel = ULONG_MAX;
|
428
|
222 }
|
|
223 }
|
|
224 return status;
|
|
225 }
|
|
226
|
442
|
227 static int
|
|
228 x_parse_nearest_color (struct device *d, XColor *color, Lisp_Object name,
|
578
|
229 Error_Behavior errb)
|
428
|
230 {
|
|
231 Display *dpy = DEVICE_X_DISPLAY (d);
|
|
232 Colormap cmap = DEVICE_X_COLORMAP (d);
|
|
233 Visual *visual = DEVICE_X_VISUAL (d);
|
|
234 int result;
|
|
235
|
|
236 xzero (*color);
|
|
237 {
|
442
|
238 const Extbyte *extname;
|
428
|
239
|
442
|
240 LISP_STRING_TO_EXTERNAL (name, extname, Qx_color_name_encoding);
|
|
241 result = XParseColor (dpy, cmap, extname, color);
|
428
|
242 }
|
|
243 if (!result)
|
|
244 {
|
563
|
245 maybe_signal_error (Qgui_error, "Unrecognized color",
|
|
246 name, Qcolor, errb);
|
428
|
247 return 0;
|
|
248 }
|
|
249 result = allocate_nearest_color (dpy, cmap, visual, color);
|
|
250 if (!result)
|
|
251 {
|
563
|
252 maybe_signal_error (Qgui_error, "Couldn't allocate color",
|
|
253 name, Qcolor, errb);
|
428
|
254 return 0;
|
|
255 }
|
|
256
|
|
257 return result;
|
|
258 }
|
|
259
|
|
260 static int
|
440
|
261 x_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name,
|
578
|
262 Lisp_Object device, Error_Behavior errb)
|
428
|
263 {
|
|
264 XColor color;
|
|
265 int result;
|
|
266
|
442
|
267 result = x_parse_nearest_color (XDEVICE (device), &color, name, errb);
|
428
|
268
|
|
269 if (!result)
|
|
270 return 0;
|
|
271
|
|
272 /* Don't allocate the data until we're sure that we will succeed,
|
|
273 or the finalize method may get fucked. */
|
|
274 c->data = xnew (struct x_color_instance_data);
|
|
275 if (result == 3)
|
|
276 COLOR_INSTANCE_X_DEALLOC (c) = 0;
|
|
277 else
|
|
278 COLOR_INSTANCE_X_DEALLOC (c) = 1;
|
|
279 COLOR_INSTANCE_X_COLOR (c) = color;
|
|
280 return 1;
|
|
281 }
|
|
282
|
|
283 static void
|
440
|
284 x_print_color_instance (Lisp_Color_Instance *c,
|
428
|
285 Lisp_Object printcharfun,
|
|
286 int escapeflag)
|
|
287 {
|
444
|
288 char buf[100];
|
428
|
289 XColor color = COLOR_INSTANCE_X_COLOR (c);
|
|
290 sprintf (buf, " %ld=(%X,%X,%X)",
|
|
291 color.pixel, color.red, color.green, color.blue);
|
|
292 write_c_string (buf, printcharfun);
|
|
293 }
|
|
294
|
|
295 static void
|
440
|
296 x_finalize_color_instance (Lisp_Color_Instance *c)
|
428
|
297 {
|
|
298 if (c->data)
|
|
299 {
|
|
300 if (DEVICE_LIVE_P (XDEVICE (c->device)))
|
|
301 {
|
|
302 if (COLOR_INSTANCE_X_DEALLOC (c))
|
|
303 {
|
442
|
304 XFreeColors (DEVICE_X_DISPLAY (XDEVICE (c->device)),
|
|
305 DEVICE_X_COLORMAP (XDEVICE (c->device)),
|
428
|
306 &COLOR_INSTANCE_X_COLOR (c).pixel, 1, 0);
|
|
307 }
|
|
308 }
|
|
309 xfree (c->data);
|
|
310 c->data = 0;
|
|
311 }
|
|
312 }
|
|
313
|
|
314 /* Color instances are equal if they resolve to the same color on the
|
|
315 screen (have the same RGB values). I imagine that
|
|
316 "same RGB values" == "same cell in the colormap." Arguably we should
|
|
317 be comparing their names or pixel values instead. */
|
|
318
|
|
319 static int
|
440
|
320 x_color_instance_equal (Lisp_Color_Instance *c1,
|
|
321 Lisp_Color_Instance *c2,
|
428
|
322 int depth)
|
|
323 {
|
|
324 XColor color1 = COLOR_INSTANCE_X_COLOR (c1);
|
|
325 XColor color2 = COLOR_INSTANCE_X_COLOR (c2);
|
|
326 return ((color1.red == color2.red) &&
|
|
327 (color1.green == color2.green) &&
|
|
328 (color1.blue == color2.blue));
|
|
329 }
|
|
330
|
|
331 static unsigned long
|
440
|
332 x_color_instance_hash (Lisp_Color_Instance *c, int depth)
|
428
|
333 {
|
|
334 XColor color = COLOR_INSTANCE_X_COLOR (c);
|
|
335 return HASH3 (color.red, color.green, color.blue);
|
|
336 }
|
|
337
|
|
338 static Lisp_Object
|
440
|
339 x_color_instance_rgb_components (Lisp_Color_Instance *c)
|
428
|
340 {
|
|
341 XColor color = COLOR_INSTANCE_X_COLOR (c);
|
|
342 return (list3 (make_int (color.red),
|
|
343 make_int (color.green),
|
|
344 make_int (color.blue)));
|
|
345 }
|
|
346
|
|
347 static int
|
|
348 x_valid_color_name_p (struct device *d, Lisp_Object color)
|
|
349 {
|
|
350 XColor c;
|
|
351 Display *dpy = DEVICE_X_DISPLAY (d);
|
|
352 Colormap cmap = DEVICE_X_COLORMAP (d);
|
442
|
353 const Extbyte *extname;
|
428
|
354
|
442
|
355 LISP_STRING_TO_EXTERNAL (color, extname, Qx_color_name_encoding);
|
428
|
356
|
440
|
357 return XParseColor (dpy, cmap, extname, &c);
|
428
|
358 }
|
|
359
|
|
360
|
|
361 /************************************************************************/
|
|
362 /* font instances */
|
|
363 /************************************************************************/
|
|
364
|
|
365 static int
|
440
|
366 x_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
|
578
|
367 Lisp_Object device, Error_Behavior errb)
|
428
|
368 {
|
440
|
369 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device));
|
428
|
370 XFontStruct *xf;
|
442
|
371 const Extbyte *extname;
|
428
|
372
|
442
|
373 LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
|
428
|
374 xf = XLoadQueryFont (dpy, extname);
|
|
375
|
|
376 if (!xf)
|
|
377 {
|
563
|
378 maybe_signal_error (Qgui_error, "Couldn't load font", f->name, Qfont,
|
|
379 errb);
|
428
|
380 return 0;
|
|
381 }
|
|
382
|
|
383 if (!xf->max_bounds.width)
|
|
384 {
|
|
385 /* yes, this has been known to happen. */
|
|
386 XFreeFont (dpy, xf);
|
563
|
387 maybe_signal_error (Qgui_error, "X font is too small", f->name, Qfont,
|
|
388 errb);
|
428
|
389 return 0;
|
|
390 }
|
|
391
|
|
392 /* Don't allocate the data until we're sure that we will succeed,
|
|
393 or the finalize method may get fucked. */
|
|
394 f->data = xnew (struct x_font_instance_data);
|
|
395 FONT_INSTANCE_X_TRUENAME (f) = Qnil;
|
|
396 FONT_INSTANCE_X_FONT (f) = xf;
|
|
397 f->ascent = xf->ascent;
|
|
398 f->descent = xf->descent;
|
|
399 f->height = xf->ascent + xf->descent;
|
|
400 {
|
|
401 /* following change suggested by Ted Phelps <phelps@dstc.edu.au> */
|
647
|
402 int def_char = 'n'; /*xf->default_char;*/
|
|
403 int byte1, byte2;
|
428
|
404
|
|
405 once_more:
|
|
406 byte1 = def_char >> 8;
|
|
407 byte2 = def_char & 0xFF;
|
|
408
|
|
409 if (xf->per_char)
|
|
410 {
|
|
411 /* Old versions of the R5 font server have garbage (>63k) as
|
|
412 def_char. 'n' might not be a valid character. */
|
647
|
413 if (byte1 < (int) xf->min_byte1 ||
|
|
414 byte1 > (int) xf->max_byte1 ||
|
|
415 byte2 < (int) xf->min_char_or_byte2 ||
|
|
416 byte2 > (int) xf->max_char_or_byte2)
|
428
|
417 f->width = 0;
|
|
418 else
|
|
419 f->width = xf->per_char[(byte1 - xf->min_byte1) *
|
|
420 (xf->max_char_or_byte2 -
|
|
421 xf->min_char_or_byte2 + 1) +
|
|
422 (byte2 - xf->min_char_or_byte2)].width;
|
|
423 }
|
|
424 else
|
|
425 f->width = xf->max_bounds.width;
|
|
426
|
|
427 /* Some fonts have a default char whose width is 0. This is no good.
|
|
428 If that's the case, first try 'n' as the default char, and if n has
|
|
429 0 width too (unlikely) then just use the max width. */
|
|
430 if (f->width == 0)
|
|
431 {
|
647
|
432 if (def_char == (int) xf->default_char)
|
428
|
433 f->width = xf->max_bounds.width;
|
|
434 else
|
|
435 {
|
|
436 def_char = xf->default_char;
|
|
437 goto once_more;
|
|
438 }
|
|
439 }
|
|
440 }
|
|
441 /* If all characters don't exist then there could potentially be
|
|
442 0-width characters lurking out there. Not setting this flag
|
|
443 trips an optimization that would make them appear to have width
|
|
444 to redisplay. This is bad. So we set it if not all characters
|
|
445 have the same width or if not all characters are defined.
|
|
446 */
|
|
447 /* #### This sucks. There is a measurable performance increase
|
|
448 when using proportional width fonts if this flag is not set.
|
|
449 Unfortunately so many of the fucking X fonts are not fully
|
|
450 defined that we could almost just get rid of this damn flag and
|
|
451 make it an assertion. */
|
|
452 f->proportional_p = (xf->min_bounds.width != xf->max_bounds.width ||
|
|
453 (x_handle_non_fully_specified_fonts &&
|
|
454 !xf->all_chars_exist));
|
|
455
|
|
456 return 1;
|
|
457 }
|
|
458
|
|
459 static void
|
440
|
460 x_mark_font_instance (Lisp_Font_Instance *f)
|
428
|
461 {
|
|
462 mark_object (FONT_INSTANCE_X_TRUENAME (f));
|
|
463 }
|
|
464
|
|
465 static void
|
440
|
466 x_print_font_instance (Lisp_Font_Instance *f,
|
428
|
467 Lisp_Object printcharfun,
|
|
468 int escapeflag)
|
|
469 {
|
444
|
470 char buf[200];
|
428
|
471 sprintf (buf, " 0x%lx", (unsigned long) FONT_INSTANCE_X_FONT (f)->fid);
|
|
472 write_c_string (buf, printcharfun);
|
|
473 }
|
|
474
|
|
475 static void
|
440
|
476 x_finalize_font_instance (Lisp_Font_Instance *f)
|
428
|
477 {
|
|
478
|
|
479 if (f->data)
|
|
480 {
|
|
481 if (DEVICE_LIVE_P (XDEVICE (f->device)))
|
|
482 {
|
|
483 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (f->device));
|
|
484
|
|
485 XFreeFont (dpy, FONT_INSTANCE_X_FONT (f));
|
|
486 }
|
|
487 xfree (f->data);
|
|
488 f->data = 0;
|
|
489 }
|
|
490 }
|
|
491
|
|
492 /* Determining the truename of a font is hard. (Big surprise.)
|
|
493
|
|
494 By "truename" we mean an XLFD-form name which contains no wildcards, yet
|
|
495 which resolves to *exactly* the same font as the one which we already have
|
|
496 the (probably wildcarded) name and `XFontStruct' of.
|
|
497
|
|
498 One might think that the first font returned by XListFonts would be the one
|
|
499 that XOpenFont would pick. Apparently this is the case on some servers,
|
|
500 but not on others. It would seem not to be specified.
|
|
501
|
|
502 The MIT R5 server sometimes appears to be picking the lexicographically
|
|
503 smallest font which matches the name (thus picking "adobe" fonts before
|
|
504 "bitstream" fonts even if the bitstream fonts are earlier in the path, and
|
|
505 also picking 100dpi adobe fonts over 75dpi adobe fonts even though the
|
|
506 75dpi are in the path earlier) but sometimes appears to be doing something
|
442
|
507 else entirely (for example, removing the bitstream fonts from the path will
|
428
|
508 cause the 75dpi adobe fonts to be used instead of the 100dpi, even though
|
|
509 their relative positions in the path (and their names!) have not changed).
|
|
510
|
|
511 The documentation for XSetFontPath() seems to indicate that the order of
|
442
|
512 entries in the font path means something, but it's pretty noncommittal about
|
428
|
513 it, and the spirit of the law is apparently not being obeyed...
|
|
514
|
|
515 All the fonts I've seen have a property named `FONT' which contains the
|
|
516 truename of the font. However, there are two problems with using this: the
|
|
517 first is that the X Protocol Document is quite explicit that all properties
|
|
518 are optional, so we can't depend on it being there. The second is that
|
|
519 it's conceivable that this alleged truename isn't actually accessible as a
|
|
520 font, due to some difference of opinion between the font designers and
|
|
521 whoever installed the font on the system.
|
|
522
|
|
523 So, our first attempt is to look for a FONT property, and then verify that
|
|
524 the name there is a valid name by running XListFonts on it. There's still
|
|
525 the potential that this could be true but we could still be being lied to,
|
|
526 but that seems pretty remote.
|
|
527
|
|
528 Late breaking news: I've gotten reports that SunOS 4.1.3U1
|
|
529 with OpenWound 3.0 has a font whose truename is really
|
|
530 "-Adobe-Courier-Medium-R-Normal--12-120-75-75-M-70-ISO8859-1"
|
|
531 but whose FONT property contains "Courier".
|
|
532
|
|
533 So we disbelieve the FONT property unless it begins with a dash and
|
|
534 is more than 30 characters long. X Windows: The defacto substandard.
|
|
535 X Windows: Complex nonsolutions to simple nonproblems. X Windows:
|
|
536 Live the nightmare.
|
|
537
|
|
538 If the FONT property doesn't exist, then we try and construct an XLFD name
|
|
539 out of the other font properties (FOUNDRY, FAMILY_NAME, WEIGHT_NAME, etc).
|
|
540 This is necessary at least for some versions of OpenWound. But who knows
|
|
541 what the future will bring.
|
|
542
|
|
543 If that doesn't work, then we use XListFonts and either take the first font
|
|
544 (which I think is the most sensible thing) or we find the lexicographically
|
|
545 least, depending on whether the preprocessor constant `XOPENFONT_SORTS' is
|
|
546 defined. This sucks because the two behaviors are a property of the server
|
|
547 being used, not the architecture on which emacs has been compiled. Also,
|
|
548 as I described above, sorting isn't ALWAYS what the server does. Really it
|
|
549 does something seemingly random. There is no reliable way to win if the
|
|
550 FONT property isn't present.
|
|
551
|
|
552 Another possibility which I haven't bothered to implement would be to map
|
|
553 over all of the matching fonts and find the first one that has the same
|
|
554 character metrics as the font we already have loaded. Even if this didn't
|
|
555 return exactly the same font, it would at least return one whose characters
|
|
556 were the same sizes, which would probably be good enough.
|
|
557
|
|
558 More late-breaking news: on RS/6000 AIX 3.2.4, the expression
|
|
559 XLoadQueryFont (dpy, "-*-Fixed-Medium-R-*-*-*-130-75-75-*-*-ISO8859-1")
|
|
560 actually returns the font
|
|
561 -Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO8859-1
|
|
562 which is crazy, because that font doesn't even match that pattern! It is
|
|
563 also not included in the output produced by `xlsfonts' with that pattern.
|
|
564
|
|
565 So this is yet another example of XListFonts() and XOpenFont() using
|
|
566 completely different algorithms. This, however, is a goofier example of
|
|
567 this bug, because in this case, it's not just the search order that is
|
|
568 different -- the sets don't even intersect.
|
|
569
|
|
570 If anyone has any better ideas how to do this, or any insights on what it is
|
|
571 that the various servers are actually doing, please let me know! -- jwz. */
|
|
572
|
|
573 static int
|
442
|
574 valid_x_font_name_p (Display *dpy, Extbyte *name)
|
428
|
575 {
|
|
576 /* Maybe this should be implemented by calling XLoadFont and trapping
|
|
577 the error. That would be a lot of work, and wasteful as hell, but
|
|
578 might be more correct.
|
|
579 */
|
|
580 int nnames = 0;
|
444
|
581 Extbyte **names = 0;
|
428
|
582 if (! name)
|
|
583 return 0;
|
|
584 names = XListFonts (dpy, name, 1, &nnames);
|
|
585 if (names)
|
|
586 XFreeFontNames (names);
|
|
587 return (nnames != 0);
|
|
588 }
|
|
589
|
442
|
590 static Extbyte *
|
428
|
591 truename_via_FONT_prop (Display *dpy, XFontStruct *font)
|
|
592 {
|
|
593 unsigned long value = 0;
|
442
|
594 Extbyte *result = 0;
|
428
|
595 if (XGetFontProperty (font, XA_FONT, &value))
|
|
596 result = XGetAtomName (dpy, value);
|
|
597 /* result is now 0, or the string value of the FONT property. */
|
|
598 if (result)
|
|
599 {
|
|
600 /* Verify that result is an XLFD name (roughly...) */
|
647
|
601 if (result [0] != '-' || strlen (result) < 30)
|
428
|
602 {
|
|
603 XFree (result);
|
|
604 result = 0;
|
|
605 }
|
|
606 }
|
|
607 return result; /* this must be freed by caller if non-0 */
|
|
608 }
|
|
609
|
442
|
610 static Extbyte *
|
428
|
611 truename_via_random_props (Display *dpy, XFontStruct *font)
|
|
612 {
|
|
613 struct device *d = get_device_from_display (dpy);
|
|
614 unsigned long value = 0;
|
442
|
615 Extbyte *foundry, *family, *weight, *slant, *setwidth, *add_style;
|
428
|
616 unsigned long pixel, point, res_x, res_y;
|
442
|
617 Extbyte *spacing;
|
428
|
618 unsigned long avg_width;
|
442
|
619 Extbyte *registry, *encoding;
|
|
620 Extbyte composed_name [2048];
|
428
|
621 int ok = 0;
|
442
|
622 Extbyte *result;
|
428
|
623
|
|
624 #define get_string(atom,var) \
|
|
625 if (XGetFontProperty (font, (atom), &value)) \
|
|
626 var = XGetAtomName (dpy, value); \
|
|
627 else { \
|
|
628 var = 0; \
|
|
629 goto FAIL; }
|
|
630 #define get_number(atom,var) \
|
|
631 if (!XGetFontProperty (font, (atom), &var) || \
|
|
632 var > 999) \
|
|
633 goto FAIL;
|
|
634
|
|
635 foundry = family = weight = slant = setwidth = 0;
|
|
636 add_style = spacing = registry = encoding = 0;
|
|
637
|
|
638 get_string (DEVICE_XATOM_FOUNDRY (d), foundry);
|
|
639 get_string (DEVICE_XATOM_FAMILY_NAME (d), family);
|
|
640 get_string (DEVICE_XATOM_WEIGHT_NAME (d), weight);
|
|
641 get_string (DEVICE_XATOM_SLANT (d), slant);
|
|
642 get_string (DEVICE_XATOM_SETWIDTH_NAME (d), setwidth);
|
|
643 get_string (DEVICE_XATOM_ADD_STYLE_NAME (d), add_style);
|
|
644 get_number (DEVICE_XATOM_PIXEL_SIZE (d), pixel);
|
|
645 get_number (DEVICE_XATOM_POINT_SIZE (d), point);
|
|
646 get_number (DEVICE_XATOM_RESOLUTION_X (d), res_x);
|
|
647 get_number (DEVICE_XATOM_RESOLUTION_Y (d), res_y);
|
|
648 get_string (DEVICE_XATOM_SPACING (d), spacing);
|
|
649 get_number (DEVICE_XATOM_AVERAGE_WIDTH (d), avg_width);
|
|
650 get_string (DEVICE_XATOM_CHARSET_REGISTRY (d), registry);
|
|
651 get_string (DEVICE_XATOM_CHARSET_ENCODING (d), encoding);
|
|
652 #undef get_number
|
|
653 #undef get_string
|
|
654
|
|
655 sprintf (composed_name,
|
|
656 "-%s-%s-%s-%s-%s-%s-%ld-%ld-%ld-%ld-%s-%ld-%s-%s",
|
|
657 foundry, family, weight, slant, setwidth, add_style, pixel,
|
|
658 point, res_x, res_y, spacing, avg_width, registry, encoding);
|
|
659 ok = 1;
|
|
660
|
|
661 FAIL:
|
|
662 if (ok)
|
|
663 {
|
|
664 int L = strlen (composed_name) + 1;
|
442
|
665 result = (Extbyte *) xmalloc (L);
|
428
|
666 strncpy (result, composed_name, L);
|
|
667 }
|
|
668 else
|
|
669 result = 0;
|
|
670
|
|
671 if (foundry) XFree (foundry);
|
|
672 if (family) XFree (family);
|
|
673 if (weight) XFree (weight);
|
|
674 if (slant) XFree (slant);
|
|
675 if (setwidth) XFree (setwidth);
|
|
676 if (add_style) XFree (add_style);
|
|
677 if (spacing) XFree (spacing);
|
|
678 if (registry) XFree (registry);
|
|
679 if (encoding) XFree (encoding);
|
|
680
|
|
681 return result;
|
|
682 }
|
|
683
|
|
684 /* Unbounded, for sufficiently small values of infinity... */
|
|
685 #define MAX_FONT_COUNT 5000
|
|
686
|
442
|
687 static Extbyte *
|
|
688 truename_via_XListFonts (Display *dpy, Extbyte *font_name)
|
428
|
689 {
|
442
|
690 Extbyte *result = 0;
|
444
|
691 Extbyte **names;
|
428
|
692 int count = 0;
|
|
693
|
|
694 #ifndef XOPENFONT_SORTS
|
|
695 /* In a sensible world, the first font returned by XListFonts()
|
|
696 would be the font that XOpenFont() would use. */
|
|
697 names = XListFonts (dpy, font_name, 1, &count);
|
|
698 if (count) result = names [0];
|
|
699 #else
|
|
700 /* But the world I live in is much more perverse. */
|
|
701 names = XListFonts (dpy, font_name, MAX_FONT_COUNT, &count);
|
|
702 while (count--)
|
442
|
703 /* !!#### Not Mule-friendly */
|
428
|
704 /* If names[count] is lexicographically less than result, use it.
|
|
705 (#### Should we be comparing case-insensitively?) */
|
|
706 if (result == 0 || (strcmp (result, names [count]) < 0))
|
|
707 result = names [count];
|
|
708 #endif
|
|
709
|
|
710 if (result)
|
|
711 result = xstrdup (result);
|
|
712 if (names)
|
|
713 XFreeFontNames (names);
|
|
714
|
|
715 return result; /* this must be freed by caller if non-0 */
|
|
716 }
|
|
717
|
|
718 static Lisp_Object
|
442
|
719 x_font_truename (Display *dpy, Extbyte *name, XFontStruct *font)
|
428
|
720 {
|
442
|
721 Extbyte *truename_FONT = 0;
|
|
722 Extbyte *truename_random = 0;
|
|
723 Extbyte *truename = 0;
|
428
|
724
|
|
725 /* The search order is:
|
|
726 - if FONT property exists, and is a valid name, return it.
|
|
727 - if the other props exist, and add up to a valid name, return it.
|
|
728 - if we find a matching name with XListFonts, return it.
|
|
729 - if FONT property exists, return it regardless.
|
|
730 - if other props exist, return the resultant name regardless.
|
|
731 - else return 0.
|
|
732 */
|
|
733
|
|
734 truename = truename_FONT = truename_via_FONT_prop (dpy, font);
|
|
735 if (truename && !valid_x_font_name_p (dpy, truename))
|
|
736 truename = 0;
|
|
737 if (!truename)
|
|
738 truename = truename_random = truename_via_random_props (dpy, font);
|
|
739 if (truename && !valid_x_font_name_p (dpy, truename))
|
|
740 truename = 0;
|
|
741 if (!truename && name)
|
|
742 truename = truename_via_XListFonts (dpy, name);
|
|
743
|
|
744 if (!truename)
|
|
745 {
|
|
746 /* Gag - we weren't able to find a seemingly-valid truename.
|
|
747 Well, maybe we're on one of those braindead systems where
|
|
748 XListFonts() and XLoadFont() are in violent disagreement.
|
|
749 If we were able to compute a truename, try using that even
|
|
750 if evidence suggests that it's not a valid name - because
|
|
751 maybe it is, really, and that's better than nothing.
|
|
752 X Windows: You'll envy the dead.
|
|
753 */
|
|
754 if (truename_FONT)
|
|
755 truename = truename_FONT;
|
|
756 else if (truename_random)
|
|
757 truename = truename_random;
|
|
758 }
|
|
759
|
|
760 /* One or both of these are not being used - free them. */
|
|
761 if (truename_FONT && truename_FONT != truename)
|
|
762 XFree (truename_FONT);
|
|
763 if (truename_random && truename_random != truename)
|
|
764 XFree (truename_random);
|
|
765
|
|
766 if (truename)
|
|
767 {
|
442
|
768 Lisp_Object result = build_ext_string (truename, Qx_font_name_encoding);
|
428
|
769 XFree (truename);
|
|
770 return result;
|
|
771 }
|
|
772 else
|
|
773 return Qnil;
|
|
774 }
|
|
775
|
|
776 static Lisp_Object
|
578
|
777 x_font_instance_truename (Lisp_Font_Instance *f, Error_Behavior errb)
|
428
|
778 {
|
|
779 struct device *d = XDEVICE (f->device);
|
|
780
|
|
781 if (NILP (FONT_INSTANCE_X_TRUENAME (f)))
|
|
782 {
|
|
783 Display *dpy = DEVICE_X_DISPLAY (d);
|
|
784 {
|
442
|
785 Extbyte *nameext;
|
|
786
|
|
787 LISP_STRING_TO_EXTERNAL (f->name, nameext, Qx_font_name_encoding);
|
428
|
788 FONT_INSTANCE_X_TRUENAME (f) =
|
442
|
789 x_font_truename (dpy, nameext, FONT_INSTANCE_X_FONT (f));
|
428
|
790 }
|
|
791 if (NILP (FONT_INSTANCE_X_TRUENAME (f)))
|
|
792 {
|
|
793 Lisp_Object font_instance;
|
|
794 XSETFONT_INSTANCE (font_instance, f);
|
|
795
|
563
|
796 maybe_signal_error (Qgui_error, "Couldn't determine font truename",
|
|
797 font_instance, Qfont, errb);
|
428
|
798 /* Ok, just this once, return the font name as the truename.
|
|
799 (This is only used by Fequal() right now.) */
|
|
800 return f->name;
|
|
801 }
|
|
802 }
|
444
|
803 return FONT_INSTANCE_X_TRUENAME (f);
|
428
|
804 }
|
|
805
|
|
806 static Lisp_Object
|
440
|
807 x_font_instance_properties (Lisp_Font_Instance *f)
|
428
|
808 {
|
|
809 struct device *d = XDEVICE (f->device);
|
|
810 int i;
|
|
811 Lisp_Object result = Qnil;
|
444
|
812 Display *dpy = DEVICE_X_DISPLAY (d);
|
|
813 XFontProp *props = FONT_INSTANCE_X_FONT (f)->properties;
|
428
|
814
|
|
815 for (i = FONT_INSTANCE_X_FONT (f)->n_properties - 1; i >= 0; i--)
|
|
816 {
|
|
817 Lisp_Object name, value;
|
|
818 Atom atom = props [i].name;
|
665
|
819 Intbyte *name_str = 0;
|
647
|
820 Bytecount name_len;
|
442
|
821 Extbyte *namestrext = XGetAtomName (dpy, atom);
|
|
822
|
|
823 if (namestrext)
|
444
|
824 TO_INTERNAL_FORMAT (C_STRING, namestrext,
|
|
825 ALLOCA, (name_str, name_len),
|
|
826 Qx_atom_name_encoding);
|
442
|
827
|
444
|
828 name = (name_str ? intern ((char *) name_str) : Qnil);
|
428
|
829 if (name_str &&
|
|
830 (atom == XA_FONT ||
|
|
831 atom == DEVICE_XATOM_FOUNDRY (d) ||
|
|
832 atom == DEVICE_XATOM_FAMILY_NAME (d) ||
|
|
833 atom == DEVICE_XATOM_WEIGHT_NAME (d) ||
|
|
834 atom == DEVICE_XATOM_SLANT (d) ||
|
|
835 atom == DEVICE_XATOM_SETWIDTH_NAME (d) ||
|
|
836 atom == DEVICE_XATOM_ADD_STYLE_NAME (d) ||
|
|
837 atom == DEVICE_XATOM_SPACING (d) ||
|
|
838 atom == DEVICE_XATOM_CHARSET_REGISTRY (d) ||
|
|
839 atom == DEVICE_XATOM_CHARSET_ENCODING (d) ||
|
665
|
840 !intbyte_strcmp (name_str, "CHARSET_COLLECTIONS") ||
|
|
841 !intbyte_strcmp (name_str, "FONTNAME_REGISTRY") ||
|
|
842 !intbyte_strcmp (name_str, "CLASSIFICATION") ||
|
|
843 !intbyte_strcmp (name_str, "COPYRIGHT") ||
|
|
844 !intbyte_strcmp (name_str, "DEVICE_FONT_NAME") ||
|
|
845 !intbyte_strcmp (name_str, "FULL_NAME") ||
|
|
846 !intbyte_strcmp (name_str, "MONOSPACED") ||
|
|
847 !intbyte_strcmp (name_str, "QUALITY") ||
|
|
848 !intbyte_strcmp (name_str, "RELATIVE_SET") ||
|
|
849 !intbyte_strcmp (name_str, "RELATIVE_WEIGHT") ||
|
|
850 !intbyte_strcmp (name_str, "STYLE")))
|
428
|
851 {
|
442
|
852 Extbyte *val_str = XGetAtomName (dpy, props [i].card32);
|
|
853
|
|
854 value = (val_str ? build_ext_string (val_str, Qx_atom_name_encoding)
|
|
855 : Qnil);
|
428
|
856 }
|
|
857 else
|
|
858 value = make_int (props [i].card32);
|
442
|
859 if (namestrext) XFree (namestrext);
|
428
|
860 result = Fcons (Fcons (name, value), result);
|
|
861 }
|
|
862 return result;
|
|
863 }
|
|
864
|
|
865 static Lisp_Object
|
|
866 x_list_fonts (Lisp_Object pattern, Lisp_Object device)
|
|
867 {
|
444
|
868 Extbyte **names;
|
428
|
869 int count = 0;
|
|
870 Lisp_Object result = Qnil;
|
442
|
871 const Extbyte *patternext;
|
428
|
872
|
442
|
873 LISP_STRING_TO_EXTERNAL (pattern, patternext, Qx_font_name_encoding);
|
428
|
874
|
|
875 names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
|
|
876 patternext, MAX_FONT_COUNT, &count);
|
|
877 while (count--)
|
442
|
878 result = Fcons (build_ext_string (names[count], Qx_font_name_encoding),
|
|
879 result);
|
428
|
880 if (names)
|
|
881 XFreeFontNames (names);
|
|
882 return result;
|
|
883 }
|
|
884
|
|
885 #ifdef MULE
|
|
886
|
|
887 static int
|
|
888 x_font_spec_matches_charset (struct device *d, Lisp_Object charset,
|
665
|
889 const Intbyte *nonreloc, Lisp_Object reloc,
|
428
|
890 Bytecount offset, Bytecount length)
|
|
891 {
|
|
892 if (UNBOUNDP (charset))
|
|
893 return 1;
|
|
894 /* Hack! Short font names don't have the registry in them,
|
|
895 so we just assume the user knows what they're doing in the
|
|
896 case of ASCII. For other charsets, you gotta give the
|
|
897 long form; sorry buster.
|
|
898 */
|
|
899 if (EQ (charset, Vcharset_ascii))
|
|
900 {
|
665
|
901 const Intbyte *the_nonreloc = nonreloc;
|
428
|
902 int i;
|
|
903 Bytecount the_length = length;
|
|
904
|
|
905 if (!the_nonreloc)
|
|
906 the_nonreloc = XSTRING_DATA (reloc);
|
|
907 fixup_internal_substring (nonreloc, reloc, offset, &the_length);
|
|
908 the_nonreloc += offset;
|
|
909 if (!memchr (the_nonreloc, '*', the_length))
|
|
910 {
|
|
911 for (i = 0;; i++)
|
|
912 {
|
665
|
913 const Intbyte *new_nonreloc = (const Intbyte *)
|
428
|
914 memchr (the_nonreloc, '-', the_length);
|
|
915 if (!new_nonreloc)
|
|
916 break;
|
|
917 new_nonreloc++;
|
|
918 the_length -= new_nonreloc - the_nonreloc;
|
|
919 the_nonreloc = new_nonreloc;
|
|
920 }
|
|
921
|
|
922 /* If it has less than 5 dashes, it's a short font.
|
|
923 Of course, long fonts always have 14 dashes or so, but short
|
|
924 fonts never have more than 1 or 2 dashes, so this is some
|
|
925 sort of reasonable heuristic. */
|
|
926 if (i < 5)
|
|
927 return 1;
|
|
928 }
|
|
929 }
|
|
930
|
|
931 return (fast_string_match (XCHARSET_REGISTRY (charset),
|
|
932 nonreloc, reloc, offset, length, 1,
|
|
933 ERROR_ME, 0) >= 0);
|
|
934 }
|
|
935
|
|
936 /* find a font spec that matches font spec FONT and also matches
|
|
937 (the registry of) CHARSET. */
|
|
938 static Lisp_Object
|
|
939 x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset)
|
|
940 {
|
444
|
941 Extbyte **names;
|
428
|
942 int count = 0;
|
|
943 Lisp_Object result = Qnil;
|
442
|
944 const Extbyte *patternext;
|
428
|
945 int i;
|
|
946
|
442
|
947 LISP_STRING_TO_EXTERNAL (font, patternext, Qx_font_name_encoding);
|
428
|
948
|
|
949 names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
|
|
950 patternext, MAX_FONT_COUNT, &count);
|
440
|
951 /* #### This code seems awfully bogus -- mrb */
|
428
|
952 for (i = 0; i < count; i ++)
|
|
953 {
|
665
|
954 const Intbyte *intname;
|
444
|
955 Bytecount intlen;
|
428
|
956
|
444
|
957 TO_INTERNAL_FORMAT (C_STRING, names[i],
|
|
958 ALLOCA, (intname, intlen),
|
|
959 Qx_font_name_encoding);
|
428
|
960 if (x_font_spec_matches_charset (XDEVICE (device), charset,
|
442
|
961 intname, Qnil, 0, -1))
|
428
|
962 {
|
444
|
963 result = make_string (intname, intlen);
|
428
|
964 break;
|
|
965 }
|
|
966 }
|
|
967
|
|
968 if (names)
|
|
969 XFreeFontNames (names);
|
|
970
|
|
971 /* Check for a short font name. */
|
|
972 if (NILP (result)
|
|
973 && x_font_spec_matches_charset (XDEVICE (device), charset, 0,
|
|
974 font, 0, -1))
|
|
975 return font;
|
|
976
|
|
977 return result;
|
|
978 }
|
|
979
|
|
980 #endif /* MULE */
|
|
981
|
|
982
|
|
983 /************************************************************************/
|
|
984 /* initialization */
|
|
985 /************************************************************************/
|
|
986
|
|
987 void
|
|
988 syms_of_objects_x (void)
|
|
989 {
|
|
990 }
|
|
991
|
|
992 void
|
|
993 console_type_create_objects_x (void)
|
|
994 {
|
|
995 /* object methods */
|
|
996
|
|
997 CONSOLE_HAS_METHOD (x, initialize_color_instance);
|
|
998 CONSOLE_HAS_METHOD (x, print_color_instance);
|
|
999 CONSOLE_HAS_METHOD (x, finalize_color_instance);
|
|
1000 CONSOLE_HAS_METHOD (x, color_instance_equal);
|
|
1001 CONSOLE_HAS_METHOD (x, color_instance_hash);
|
|
1002 CONSOLE_HAS_METHOD (x, color_instance_rgb_components);
|
|
1003 CONSOLE_HAS_METHOD (x, valid_color_name_p);
|
|
1004
|
|
1005 CONSOLE_HAS_METHOD (x, initialize_font_instance);
|
|
1006 CONSOLE_HAS_METHOD (x, mark_font_instance);
|
|
1007 CONSOLE_HAS_METHOD (x, print_font_instance);
|
|
1008 CONSOLE_HAS_METHOD (x, finalize_font_instance);
|
|
1009 CONSOLE_HAS_METHOD (x, font_instance_truename);
|
|
1010 CONSOLE_HAS_METHOD (x, font_instance_properties);
|
|
1011 CONSOLE_HAS_METHOD (x, list_fonts);
|
|
1012 #ifdef MULE
|
|
1013 CONSOLE_HAS_METHOD (x, find_charset_font);
|
|
1014 CONSOLE_HAS_METHOD (x, font_spec_matches_charset);
|
|
1015 #endif
|
|
1016 }
|
|
1017
|
|
1018 void
|
|
1019 vars_of_objects_x (void)
|
|
1020 {
|
|
1021 DEFVAR_BOOL ("x-handle-non-fully-specified-fonts",
|
|
1022 &x_handle_non_fully_specified_fonts /*
|
|
1023 If this is true then fonts which do not have all characters specified
|
|
1024 will be considered to be proportional width even if they are actually
|
|
1025 fixed-width. If this is not done then characters which are supposed to
|
|
1026 have 0 width may appear to actually have some width.
|
|
1027
|
|
1028 Note: While setting this to t guarantees correct output in all
|
|
1029 circumstances, it also causes a noticeable performance hit when using
|
|
1030 fixed-width fonts. Since most people don't use characters which could
|
|
1031 cause problems this is set to nil by default.
|
|
1032 */ );
|
|
1033 x_handle_non_fully_specified_fonts = 0;
|
|
1034 }
|
|
1035
|
|
1036 void
|
|
1037 Xatoms_of_objects_x (struct device *d)
|
|
1038 {
|
|
1039 Display *D = DEVICE_X_DISPLAY (d);
|
|
1040
|
|
1041 DEVICE_XATOM_FOUNDRY (d) = XInternAtom (D, "FOUNDRY", False);
|
|
1042 DEVICE_XATOM_FAMILY_NAME (d) = XInternAtom (D, "FAMILY_NAME", False);
|
|
1043 DEVICE_XATOM_WEIGHT_NAME (d) = XInternAtom (D, "WEIGHT_NAME", False);
|
|
1044 DEVICE_XATOM_SLANT (d) = XInternAtom (D, "SLANT", False);
|
|
1045 DEVICE_XATOM_SETWIDTH_NAME (d) = XInternAtom (D, "SETWIDTH_NAME", False);
|
|
1046 DEVICE_XATOM_ADD_STYLE_NAME (d) = XInternAtom (D, "ADD_STYLE_NAME", False);
|
|
1047 DEVICE_XATOM_PIXEL_SIZE (d) = XInternAtom (D, "PIXEL_SIZE", False);
|
|
1048 DEVICE_XATOM_POINT_SIZE (d) = XInternAtom (D, "POINT_SIZE", False);
|
|
1049 DEVICE_XATOM_RESOLUTION_X (d) = XInternAtom (D, "RESOLUTION_X", False);
|
|
1050 DEVICE_XATOM_RESOLUTION_Y (d) = XInternAtom (D, "RESOLUTION_Y", False);
|
|
1051 DEVICE_XATOM_SPACING (d) = XInternAtom (D, "SPACING", False);
|
|
1052 DEVICE_XATOM_AVERAGE_WIDTH (d) = XInternAtom (D, "AVERAGE_WIDTH", False);
|
|
1053 DEVICE_XATOM_CHARSET_REGISTRY(d) = XInternAtom (D, "CHARSET_REGISTRY",False);
|
|
1054 DEVICE_XATOM_CHARSET_ENCODING(d) = XInternAtom (D, "CHARSET_ENCODING",False);
|
|
1055 }
|