APPROVE COMMIT 21.5
Not relevant to 21.4.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.957
diff -u -U0 -r1.957 ChangeLog
--- src/ChangeLog 8 May 2006 07:35:23 -0000 1.957
+++ src/ChangeLog 9 May 2006 10:37:36 -0000
@@ -0,0 +1,7 @@
+2006-03-30 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c (x_initialize_font_instance):
+ Ensure that duplicative X font gets freed if we have an Xft font.
+ Remove some redundant debug output.
+ Comment on frequency of calls to this function.
+
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.39
diff -u -r1.39 objects-x.c
--- src/objects-x.c 25 Apr 2006 14:02:09 -0000 1.39
+++ src/objects-x.c 9 May 2006 10:37:42 -0000
@@ -309,6 +309,12 @@
return 0;
}
+ if (rf && fs)
+ {
+ XFreeFont (dpy, fs);
+ fs = NULL; /* we don' need no steenkin' X font */
+ }
+
if (fs && !fs->max_bounds.width)
{
/* yes, this has been known to happen. */
@@ -316,8 +322,7 @@
fs = NULL;
maybe_signal_error (Qgui_error, "X font is too small", f->name,
Qfont,
errb);
- if (!rf)
- return 0;
+ return 0;
}
/* Now that we're sure that we will succeed, we can allocate data without
@@ -353,11 +358,12 @@
f->height = rf->height;
f->proportional_p = 1; /* we can't recognize monospaced fonts! */
- DEBUG_XFT4 (0, "initialized metrics ascent %d descent %d width %d height
%d\n",
- f->ascent, f->descent, f->width, f->height);
- /* we also output on initialization of any font below */
- DEBUG_XFT1 (2, "initialized Xft font %s\n", XSTRING_DATA(f->name));
- fs = NULL; /* we don' need no steenkin' X font */
+ /* #### This message appears wa-a-ay too often!
+ We probably need to cache truenames or something?
+ Even if Xft does it for us, we cons too many font instances. */
+ DEBUG_XFT4 (0,
+ "initialized metrics ascent %d descent %d width %d height %d\n",
+ f->ascent, f->descent, f->width, f->height);
}
else
{
--
Graduate School of Systems and Information Engineering University of Tsukuba
http://turnbull.sk.tsukuba.ac.jp/ Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Economics of Information Communication and Computation Systems
Experimental Economics, Microeconomic Theory, Game Theory