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