comparison src/objects.c @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 8bec6624d99b
children 8626e4521993
comparison
equal deleted inserted replaced
370:bd866891f083 371:cc15677e0335
259 error ("printing unreadable object #<font-instance 0x%x>", f->header.uid); 259 error ("printing unreadable object #<font-instance 0x%x>", f->header.uid);
260 write_c_string ("#<font-instance ", printcharfun); 260 write_c_string ("#<font-instance ", printcharfun);
261 print_internal (f->name, printcharfun, 1); 261 print_internal (f->name, printcharfun, 1);
262 write_c_string (" on ", printcharfun); 262 write_c_string (" on ", printcharfun);
263 print_internal (f->device, printcharfun, 0); 263 print_internal (f->device, printcharfun, 0);
264 if (!NILP (f->device)) 264 MAYBE_DEVMETH (XDEVICE (f->device), print_font_instance,
265 MAYBE_DEVMETH (XDEVICE (f->device), print_font_instance, 265 (f, printcharfun, escapeflag));
266 (f, printcharfun, escapeflag));
267 sprintf (buf, " 0x%x>", f->header.uid); 266 sprintf (buf, " 0x%x>", f->header.uid);
268 write_c_string (buf, printcharfun); 267 write_c_string (buf, printcharfun);
269 } 268 }
270 269
271 static void 270 static void
418 static Lisp_Object 417 static Lisp_Object
419 font_instance_truename_internal (Lisp_Object font_instance, 418 font_instance_truename_internal (Lisp_Object font_instance,
420 Error_behavior errb) 419 Error_behavior errb)
421 { 420 {
422 struct Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance); 421 struct Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance);
423 422 struct device *d = XDEVICE (f->device);
424 if (NILP (f->device)) 423 return DEVMETH_OR_GIVEN (d, font_instance_truename, (f, errb), f->name);
425 {
426 maybe_signal_simple_error ("Couldn't determine font truename",
427 font_instance, Qfont, errb);
428 return Qnil;
429 }
430
431 return DEVMETH_OR_GIVEN (XDEVICE (f->device),
432 font_instance_truename, (f, errb), f->name);
433 } 424 }
434 425
435 DEFUN ("font-instance-truename", Ffont_instance_truename, 1, 1, 0, /* 426 DEFUN ("font-instance-truename", Ffont_instance_truename, 1, 1, 0, /*
436 Return the canonical name of FONT-INSTANCE. 427 Return the canonical name of FONT-INSTANCE.
437 Font names are patterns which may match any number of fonts, of which 428 Font names are patterns which may match any number of fonts, of which
451 { 442 {
452 struct Lisp_Font_Instance *f; 443 struct Lisp_Font_Instance *f;
453 444
454 CHECK_FONT_INSTANCE (font_instance); 445 CHECK_FONT_INSTANCE (font_instance);
455 f = XFONT_INSTANCE (font_instance); 446 f = XFONT_INSTANCE (font_instance);
456
457 if (NILP (f->device))
458 return Qnil;
459 447
460 return MAYBE_LISP_DEVMETH (XDEVICE (f->device), 448 return MAYBE_LISP_DEVMETH (XDEVICE (f->device),
461 font_instance_properties, (f)); 449 font_instance_properties, (f));
462 } 450 }
463 451