emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fontset.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/fontset.c,v
Date: Sun, 17 Feb 2008 02:03:45 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/02/17 02:03:44

Index: fontset.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fontset.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- fontset.c   16 Feb 2008 22:32:49 -0000      1.113
+++ fontset.c   17 Feb 2008 02:03:44 -0000      1.114
@@ -303,6 +303,7 @@
 /* Macros to access special values of (realized) FONTSET.  */
 #define FONTSET_BASE(fontset)          XCHAR_TABLE (fontset)->extras[2]
 #define FONTSET_FRAME(fontset)         XCHAR_TABLE (fontset)->extras[3]
+#define FONTSET_OBJLIST(fontset)       XCHAR_TABLE (fontset)->extras[4]
 #define FONTSET_NOFONT_FACE(fontset)   XCHAR_TABLE (fontset)->extras[5]
 #define FONTSET_REPERTORY(fontset)     XCHAR_TABLE (fontset)->extras[6]
 #define FONTSET_DEFAULT(fontset)       XCHAR_TABLE (fontset)->extras[7]
@@ -694,6 +695,8 @@
                  FONT_ENTITY_SET_NOT_LOADABLE (font_entity);
                  continue;
                }
+             FONTSET_OBJLIST (fontset)
+               = Fcons (font_object, FONTSET_OBJLIST (fontset));
              ASET (elt, 3, font_object);
              if (has_char < 0)
                {
@@ -912,6 +915,21 @@
   return elt;
 }
 
+void
+free_realized_fontset (f, fontset)
+     FRAME_PTR f;
+     Lisp_Object fontset;
+{
+  int i;
+  Lisp_Object tail;
+
+  return;
+  for (tail = FONTSET_OBJLIST (fontset); CONSP (tail); tail = XCDR (tail))
+    {
+      xassert (FONT_OBJECT_P (XCAR (tail)));
+      font_close_object (f, XCAR (tail));
+    }
+}
 
 /* Free fontset of FACE defined on frame F.  Called from
    free_realized_face.  */
@@ -926,6 +944,7 @@
   fontset = FONTSET_FROM_ID (face->fontset);
   xassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
   xassert (f == XFRAME (FONTSET_FRAME (fontset)));
+  free_realized_fontset (f, fontset);
   ASET (Vfontset_table, face->fontset, Qnil);
   if (face->fontset < next_fontset_id)
     next_fontset_id = face->fontset;
@@ -936,6 +955,7 @@
       fontset = AREF (Vfontset_table, id);
       xassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset));
       xassert (f == XFRAME (FONTSET_FRAME (fontset)));
+      free_realized_fontset (f, fontset);
       ASET (Vfontset_table, id, Qnil);
       if (id < next_fontset_id)
        next_fontset_id = face->fontset;
@@ -1966,7 +1986,7 @@
   XVECTOR (info)->contents[6] = make_number (fontp->default_ascent);
 
 #ifdef USE_FONT_BACKEND
-  if (! NILP (font_object))
+  if (enable_font_backend && ! NILP (font_object))
     font_close_object (f, font_object);
 #endif /* USE_FONT_BACKEND */
   return info;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]