comparison src/xfaces.c @ 91346:04866c5fd4b5

(Finternal_set_lisp_face_attribute) [USE_FONT_BACKEND]: Fix previous change. If the frame is not on a window system, signal an error.
author Kenichi Handa <handa@m17n.org>
date Tue, 22 Jan 2008 12:03:15 +0000
parents 06266d5f46a1
children 40fcad327dd1
comparison
equal deleted inserted replaced
91345:f8775578c21a 91346:04866c5fd4b5
4538 else 4538 else
4539 f = check_x_frame (frame); 4539 f = check_x_frame (frame);
4540 4540
4541 #ifdef USE_FONT_BACKEND 4541 #ifdef USE_FONT_BACKEND
4542 if (enable_font_backend 4542 if (enable_font_backend
4543 && FRAME_WINDOW_P (XFRAME (frame))
4544 && !UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) 4543 && !UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
4545 { 4544 {
4546 int fontset; 4545 tmp = Fquery_fontset (value, Qnil);
4547
4548 if (EQ (attr, QCfontset)) 4546 if (EQ (attr, QCfontset))
4549 { 4547 {
4550 Lisp_Object fontset_name = Fquery_fontset (value, Qnil); 4548 if (NILP (tmp))
4551
4552 if (NILP (fontset_name))
4553 signal_error ("Invalid fontset name", value); 4549 signal_error ("Invalid fontset name", value);
4554 LFACE_FONTSET (lface) = value; 4550 LFACE_FONTSET (lface) = tmp;
4555 } 4551 }
4556 else 4552 else
4557 { 4553 {
4554 int fontset;
4558 Lisp_Object font_object; 4555 Lisp_Object font_object;
4559 4556
4560 if (FONT_OBJECT_P (value)) 4557 if (! NILP (tmp))
4561 { 4558 {
4562 font_object = value; 4559 fontset = fs_query_fontset (tmp, 0);
4563 fontset = FRAME_FONTSET (f); 4560 value = fontset_ascii (fontset);
4564 } 4561 }
4565 else 4562 else
4566 { 4563 {
4567 CHECK_STRING (value); 4564 fontset = FRAME_FONTSET (f);
4568
4569 fontset = fs_query_fontset (value, 0);
4570 if (fontset >= 0)
4571 value = fontset_ascii (fontset);
4572 else
4573 fontset = FRAME_FONTSET (f);
4574 font_object = font_open_by_name (f, SDATA (value));
4575 if (NILP (font_object))
4576 signal_error ("Invalid font", value);
4577 } 4565 }
4566 font_object = font_open_by_name (f, SDATA (value));
4567 if (NILP (font_object))
4568 signal_error ("Invalid font", value);
4578 set_lface_from_font_and_fontset (f, lface, font_object, 4569 set_lface_from_font_and_fontset (f, lface, font_object,
4579 fontset, 1); 4570 fontset, 1);
4580 } 4571 }
4581 } 4572 }
4582 else 4573 else