changeset 90458:60db44f4be6a

(x_new_fontset2): Change arguments. Both args FONTSET and FONT_OBJECT must be existing ones.
author Kenichi Handa <handa@m17n.org>
date Fri, 16 Jun 2006 12:11:10 +0000
parents 48b05b7bf674
children 81011b9fc603
files src/xterm.c
diffstat 1 files changed, 9 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Jun 16 08:01:07 2006 +0000
+++ b/src/xterm.c	Fri Jun 16 12:11:10 2006 +0000
@@ -8172,46 +8172,22 @@
 
 #ifdef USE_FONT_BACKEND
 Lisp_Object
-x_new_fontset2 (f, fontsetname)
+x_new_fontset2 (f, fontset, font_object)
      struct frame *f;
-     Lisp_Object fontsetname;
-{
-  int fontset;
-  struct font *font;
-  XFontStruct *xfont;
-
-  if (STRINGP (fontsetname))
-    {
-      fontset = fs_query_fontset (fontsetname, 0);
-      if (fontset > 0 && f->output_data.x->fontset == fontset)
-	/* This fontset is already set in frame F.  There's nothing more
-	   to do.  */
-	return fontset_name (fontset);
-      if (fontset == 0)
-	/* The default fontset can't be the default font.   */
-	return Qt;
-      if (fontset < 0)
-	fontset = new_fontset_from_font_name (fontsetname);
-    }
-  else
-    fontset = new_fontset_from_font (f, fontsetname);
-
-  if (fontset < 0)
-    return Qnil;
-
-  font = fontset_ascii_font (f, fontset);
-  if (! font)
-    return Qnil;
-  xfont = font->font.font;
-
-  if (FRAME_FONT (f) == xfont)
+     int fontset;
+     Lisp_Object font_object;
+{
+  struct font *font = XSAVE_VALUE (font_object)->pointer;
+
+  if (FRAME_FONT_OBJECT (f) == font)
     /* This font is already set in frame F.  There's nothing more to
        do.  */
     return fontset_name (fontset);
 
   BLOCK_INPUT;
 
-  FRAME_FONT (f) = xfont;
+  FRAME_FONT_OBJECT (f) = font;
+  FRAME_FONT (f) = font->font.font;
   FRAME_BASELINE_OFFSET (f) = font->font.baseline_offset;
   FRAME_FONTSET (f) = fontset;