comparison src/objects-x.c @ 14:9ee227acff29 r19-15b90

Import from CVS: tag r19-15b90
author cvs
date Mon, 13 Aug 2007 08:48:42 +0200
parents ac2d302a0011
children 131b0175ea99
comparison
equal deleted inserted replaced
13:13c6d0aaafe5 14:9ee227acff29
152 { 152 {
153 XColor color; 153 XColor color;
154 int result; 154 int result;
155 155
156 result = x_parse_nearest_color (XDEVICE (device), &color, 156 result = x_parse_nearest_color (XDEVICE (device), &color,
157 string_data (XSTRING (name)), 157 XSTRING_DATA (name),
158 string_length (XSTRING (name)), 158 XSTRING_LENGTH (name),
159 errb); 159 errb);
160 160
161 if (!result) 161 if (!result)
162 return 0; 162 return 0;
163 163
285 FONT_INSTANCE_X_FONT (f) = xf; 285 FONT_INSTANCE_X_FONT (f) = xf;
286 f->ascent = xf->ascent; 286 f->ascent = xf->ascent;
287 f->descent = xf->descent; 287 f->descent = xf->descent;
288 f->height = xf->ascent + xf->descent; 288 f->height = xf->ascent + xf->descent;
289 { 289 {
290 unsigned int def_char = xf->default_char; 290 /* following change suggested by Ted Phelps <phelps@dstc.edu.au> */
291 unsigned int def_char = 'n'; /*xf->default_char;*/
291 int byte1, byte2; 292 int byte1, byte2;
292 293
293 once_more: 294 once_more:
294 byte1 = def_char >> 8; 295 byte1 = def_char >> 8;
295 byte2 = def_char & 0xFF; 296 byte2 = def_char & 0xFF;
313 /* Some fonts have a default char whose width is 0. This is no good. 314 /* Some fonts have a default char whose width is 0. This is no good.
314 If that's the case, first try 'n' as the default char, and if n has 315 If that's the case, first try 'n' as the default char, and if n has
315 0 width too (unlikely) then just use the max width. */ 316 0 width too (unlikely) then just use the max width. */
316 if (f->width == 0) 317 if (f->width == 0)
317 { 318 {
318 if (def_char == 'n') 319 if (def_char == xf->default_char)
319 f->width = xf->max_bounds.width; 320 f->width = xf->max_bounds.width;
320 else 321 else
321 { 322 {
322 def_char = 'n'; 323 def_char = xf->default_char;
323 goto once_more; 324 goto once_more;
324 } 325 }
325 } 326 }
326 } 327 }
327 /* If all characters don't exist then there could potentially be 328 /* If all characters don't exist then there could potentially be
665 struct device *d = XDEVICE (f->device); 666 struct device *d = XDEVICE (f->device);
666 667
667 if (NILP (FONT_INSTANCE_X_TRUENAME (f))) 668 if (NILP (FONT_INSTANCE_X_TRUENAME (f)))
668 { 669 {
669 Display *dpy = DEVICE_X_DISPLAY (d); 670 Display *dpy = DEVICE_X_DISPLAY (d);
670 char *name = 671 char *name = (char *) XSTRING_DATA (f->name);
671 (char *) string_data (XSTRING (f->name));
672 { 672 {
673 FONT_INSTANCE_X_TRUENAME (f) = 673 FONT_INSTANCE_X_TRUENAME (f) =
674 x_font_truename (dpy, name, FONT_INSTANCE_X_FONT (f)); 674 x_font_truename (dpy, name, FONT_INSTANCE_X_FONT (f));
675 } 675 }
676 if (NILP (FONT_INSTANCE_X_TRUENAME (f))) 676 if (NILP (FONT_INSTANCE_X_TRUENAME (f)))