changeset 90465:9430e7e49983

(x_set_font) [USE_FONT_BACKEND]: Adusted for the change of x_new_fontset2.
author Kenichi Handa <handa@m17n.org>
date Fri, 16 Jun 2006 12:25:51 +0000
parents 4702b592db4c
children 4c9461c6aef4
files src/frame.c
diffstat 1 files changed, 32 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Fri Jun 16 12:24:58 2006 +0000
+++ b/src/frame.c	Fri Jun 16 12:25:51 2006 +0000
@@ -3077,7 +3077,38 @@
 
 #ifdef USE_FONT_BACKEND
   if (enable_font_backend)
-    fontset_name = result = x_new_fontset2 (f, arg);
+    {
+      int fontset = -1;
+      Lisp_Object font_object;
+
+      /* ARG is a fontset name, a font name, or a font object.
+	 In the last case, this function never fail.  */
+      if (STRINGP (arg))
+	{
+	  fontset = fs_query_fontset (arg, Qnil);
+	  if (fontset < 0)
+	    font_object = font_open_by_name (f, SDATA (arg));
+	  else if (fontset > 0)
+	    {
+	      Lisp_Object ascii_font = fontset_ascii (fontset);
+
+	      font_object = font_open_by_name (f, SDATA (arg));
+	    }
+	}
+      else
+	font_object = arg;
+
+      if (fontset < 0 && ! NILP (font_object))
+	fontset = new_fontset_from_font (font_object);
+
+      if (fontset == 0)
+	/* Refuse the default fontset.  */
+	result = Qt;
+      else if (NILP (font_object))
+	result = Qnil;
+      else
+	result = x_new_fontset2 (f, fontset, font_object);
+    }
   else
     {
 #endif	/* USE_FONT_BACKEND */