aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2008-02-17 02:03:44 +0000
committerKenichi Handa <[email protected]>2008-02-17 02:03:44 +0000
commit9459b1e901014e9cdfff44553a3fda1775ea2296 (patch)
tree7951af0651f913ce08589d1df898131d4d13f9a1 /src
parent3370d9f5b36378e235dce457db9bed23a3f4aeec (diff)
(FONTSET_OBJLIST): New macro.
(fontset_find_font): Update font-object list of the fontset. (free_realized_fontset): New function. (free_face_fontset): Call free_realized_fontset. (Ffont_info): Call font_close_object only when enable_font_backend is set.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 765fac0b9d..bd4553bc48 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -303,6 +303,7 @@ fontset_id_valid_p (id)
/* 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 @@ fontset_find_font (fontset, c, face, id, fallback)
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 @@ fontset_ascii (id)
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 @@ free_face_fontset (f, face)
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 @@ free_face_fontset (f, face)
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 @@ If the named font is not yet loaded, return nil. */)
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;