changeset 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 f8775578c21a
children 5c68d57a8dab
files src/xfaces.c
diffstat 1 files changed, 11 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Fri Jan 18 07:09:42 2008 +0000
+++ b/src/xfaces.c	Tue Jan 22 12:03:15 2008 +0000
@@ -4540,41 +4540,32 @@
 
 #ifdef USE_FONT_BACKEND
 	  if (enable_font_backend
-	      && FRAME_WINDOW_P (XFRAME (frame))
 	      && !UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
 	    {
-	      int fontset;
-
+	      tmp = Fquery_fontset (value, Qnil);
 	      if (EQ (attr, QCfontset))
 		{
-		  Lisp_Object fontset_name = Fquery_fontset (value, Qnil);
-
-		  if (NILP (fontset_name))
+		  if (NILP (tmp))
 		    signal_error ("Invalid fontset name", value);
-		  LFACE_FONTSET (lface) = value;
+		  LFACE_FONTSET (lface) = tmp;
 		}
 	      else
 		{
+		  int fontset;
 		  Lisp_Object font_object;
 
-		  if (FONT_OBJECT_P (value))
+		  if (! NILP (tmp))
 		    {
-		      font_object = value;
-		      fontset = FRAME_FONTSET (f);
+		      fontset = fs_query_fontset (tmp, 0);
+		      value = fontset_ascii (fontset);
 		    }
 		  else
 		    {
-		      CHECK_STRING (value);
-
-		      fontset = fs_query_fontset (value, 0);
-		      if (fontset >= 0)
-			value = fontset_ascii (fontset);
-		      else
-			fontset = FRAME_FONTSET (f);
-		      font_object = font_open_by_name (f, SDATA (value));
-		      if (NILP (font_object))
-			signal_error ("Invalid font", value);
+		      fontset = FRAME_FONTSET (f);
 		    }
+		  font_object = font_open_by_name (f, SDATA (value));
+		  if (NILP (font_object))
+		    signal_error ("Invalid font", value);
 		  set_lface_from_font_and_fontset (f, lface, font_object,
 						   fontset, 1);
 		}