]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_new_fontset2): Change arguments. Both args FONTSET
authorKenichi Handa <handa@m17n.org>
Fri, 16 Jun 2006 12:11:10 +0000 (12:11 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 16 Jun 2006 12:11:10 +0000 (12:11 +0000)
and FONT_OBJECT must be existing ones.

src/xterm.c

index d5253e27906fa77a430aad33bae70c77790b3f64..4f2bc73c9f986f3778f458e0822184f96287b48b 100644 (file)
@@ -8172,46 +8172,22 @@ x_new_fontset (f, fontsetname)
 
 #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;
+     Lisp_Object font_object;
 {
-  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;
+  struct font *font = XSAVE_VALUE (font_object)->pointer;
 
-  if (FRAME_FONT (f) == xfont)
+  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;