APPROVE COMMIT sjt-xft
No real changelog, sorry.
steve@tleepslib:/mnt/old.vicepa/tmp/staging/sjt-xft$ cvs diff
? +build
? install
Index: lwlib/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.64
diff -u -r1.64 ChangeLog
--- lwlib/ChangeLog 22 Oct 2004 05:18:10 -0000 1.64
+++ lwlib/ChangeLog 3 Dec 2004 07:34:03 -0000
@@ -1,3 +1,7 @@
+2004-12-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * xlwtabs.c: Move debug_xft to ../src/xft-fonts.c.
+
2004-10-22 Stephen J. Turnbull <stephen(a)xemacs.org>
* XEmacs 21.5.18 "chestnut" is released.
Index: lwlib/xlwtabs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwtabs.c,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 xlwtabs.c
--- lwlib/xlwtabs.c 25 Nov 2004 12:44:07 -0000 1.4.2.1
+++ lwlib/xlwtabs.c 3 Dec 2004 07:34:03 -0000
@@ -65,10 +65,6 @@
* TODO: min child height = tab height
*/
-int debug_xft = 0; /* This enable a lot of obnoxious messages;
- unfortunately, there are several that
- aren't protected by if (debug_xft).... */
-
#include <config.h>
#include <stdio.h>
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.26.2.2
diff -u -r1.26.2.2 objects-x.c
--- src/objects-x.c 27 Nov 2004 05:56:02 -0000 1.26.2.2
+++ src/objects-x.c 3 Dec 2004 07:34:18 -0000
@@ -216,6 +216,10 @@
stderr_out ("attempting to initialize font spec %s\n", extname);
/* #### serialize (optimize) these later... */
#ifdef USE_XFT
+ /* #### This function really needs to go away.
+ The problem is that the fontconfig/Xft functions work much too hard
+ to ensure that something is returned; but that something need not be
+ at all close to what we asked for. */
rf = xft_open_font_by_name (dpy, extname);
#endif
fs = XLoadQueryFont (dpy, extname);
@@ -249,12 +253,10 @@
/* handle Xft fonts */
if (rf)
{
- FONT_INSTANCE_X_XFTFONT (f) = rf;
if (fs)
- {
- XFreeFont (dpy, fs);
- FONT_INSTANCE_X_FONT (f) = NULL;
- }
+ XFreeFont (dpy, fs);
+ FONT_INSTANCE_X_XFTFONT (f) = rf;
+ FONT_INSTANCE_X_FONT (f) = NULL;
if (f->ascent < rf->ascent)
f->ascent = rf->ascent;
if (f->descent < rf->descent)
@@ -265,6 +267,7 @@
f->height = rf->height;
/* #### is this right? See comment on proportional_p below. */
f->proportional_p = 1; /* we can't recognize monospaced fonts! */
+
if (debug_xft > 0)
stderr_out ("initialized Xft font %s\n", extname);
}
@@ -351,12 +354,12 @@
int UNUSED (escapeflag))
{
if (FONT_INSTANCE_X_FONT (f))
- write_fmt_string (printcharfun, " core: 0x%lx",
+ write_fmt_string (printcharfun, " font id: 0x%lx",
(unsigned long) FONT_INSTANCE_X_FONT (f)->fid);
#ifdef USE_XFT
/* #### What should we do here? For now, print the address. */
if (FONT_INSTANCE_X_XFTFONT (f))
- write_fmt_string (printcharfun, " xft: 0x%lx",
+ write_fmt_string (printcharfun, " xft font: 0x%lx",
(unsigned long) FONT_INSTANCE_X_FONT (f));
#endif
}
@@ -365,6 +368,10 @@
x_finalize_font_instance (Lisp_Font_Instance *f)
{
+ if (debug_xft > 0)
+ stderr_out ("finalizing %s", (STRINGP (f->name)
+ ? (char *) XSTRING_DATA (f->name)
+ : "no font name"));
if (f->data)
{
if (DEVICE_LIVE_P (XDEVICE (f->device)))
@@ -1001,10 +1008,8 @@
#ifdef USE_XFT
/* #### totally lazy, let's just get something out the door */
waste = FcInit ();
- if (debug_xft > 1) /* I don't think this can fail */
- stderr_out ("%s fontconfig initialization\n",
- waste ? "Successful" : "Failed");
- if (waste) /* #### should we init in xft_fonts_init()
+ if (waste) /* I don't think this can fail */
+ /* #### should we init in xft_fonts_init()
and FcInitBringUpToDate() here? */
{
FcChar8 *lang = "en";
@@ -1083,6 +1088,8 @@
FcResultToString (r));
}
}
+ else if (debug_xft > 0)
+ stderr_out ("Failed fontconfig initialization\n");
#endif
names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
Index: src/xft-fonts.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/Attic/xft-fonts.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 xft-fonts.c
--- src/xft-fonts.c 25 Nov 2004 12:44:18 -0000 1.1.2.1
+++ src/xft-fonts.c 3 Dec 2004 07:34:18 -0000
@@ -46,6 +46,9 @@
#include "objects-x-impl.h"
#include "xft-fonts.h"
+int debug_xft = 1; /* This enables lots of obnoxious messages.
+ Setting it to 2 enables even more. */
+
/* #### TO DO ####
. The "x-xft-*" and "x_xft_*" nomenclature is mostly redundant,
especially
if we separate X fonts from Xft fonts, and use fontconfig more generally.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.