APPROVE COMMIT sjt-xft
Minor cleanups on private branch.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.758.2.28
diff -u -U0 -r1.758.2.28 ChangeLog
--- src/ChangeLog 23 Sep 2005 18:20:37 -0000 1.758.2.28
+++ src/ChangeLog 24 Sep 2005 12:28:52 -0000
@@ -0,0 +1,5 @@
+2005-09-24 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c: Improve various header comments.
+ (x_font_instance_truename): Remove obsolete #ifdef 0 code.
+
Index: src/objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.26.2.18
diff -u -r1.26.2.18 objects-x.c
--- src/objects-x.c 18 Apr 2005 03:51:18 -0000 1.26.2.18
+++ src/objects-x.c 24 Sep 2005 12:29:01 -0000
@@ -243,7 +243,7 @@
going to #ifdef the return values defaulting to short. -- sjt
*/
-/* #### Do we need to properly implement Qxft_font_name_encoding? */
+/* Standard for fontconfig. Use a macro to show we're not guessing. */
#define Qxft_font_name_encoding Qutf_8
/* DEBUGGING STUFF */
@@ -518,7 +518,8 @@
/* Determining the truename of a font is hard. (Big surprise.)
- This is almost not true for fontconfig. At least in theory, it is
+ This is not true for fontconfig. Each font has a (nearly) canonical
+ representation up to permutation of the order of properties. It is
possible to construct a name which exactly identifies the properties of
the current font. However, it is theoretically possible that there exists
another font with a super set of those properties that would happen to get
@@ -824,7 +825,6 @@
/* First, try an Xft font. */
if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f))
{
-#ifndef DO_FORMER_BIZARRE_GYMNASTICS
/* The font is already open, we just unparse. */
FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern);
if (res)
@@ -840,65 +840,6 @@
Qnil, Qfont, errb);
/* used to return Qnil here */
}
-#else
- /* FORMER BIZARRE GYMNASTICS */
- int core;
- FcChar8* fcfont;
- FcPattern *pat = FONT_INSTANCE_X_XFTFONT (f)->pattern;
- FcResult res_xlfd = FcPatternGetString (pat, XFT_XLFD, 0, &fcfont);
- FcResult res_core = FcPatternGetBool (pat, XFT_CORE, 0, &core);
-
- /* #### boy this is broken!! FIXME!!
- Probably only makes sense in Xft v1. */
- if (res_xlfd == FcResultNoMatch || res_core == FcResultNoMatch || !core)
- /* #### should we test fcfont for something here? if so, what? */
- {
- /* we've got an Xft font! */
- FcChar8 *res = FcNameUnparse (pat);
- Lisp_Object name = (res ? make_string (res, strlen (res)) : Qnil);
- /* #### huh? device? Fc don' need no steekin' device! */
- Lisp_Object real_pat = Ffc_font_real_pattern (name, f->device);
- free (res);
-
- res = FcNameUnparse (XFCPATTERN_PTR(real_pat));
- if (res)
- {
- FONT_INSTANCE_TRUENAME (f) = make_string (res, strlen (res));
- free (res);
- return FONT_INSTANCE_TRUENAME (f);
- }
- else
- {
- maybe_signal_error (Qgui_error,
- "Couldn't unparse Xft font to truename",
- Qnil, Qfont, errb);
- /* used to return Qnil here */
- }
- }
- else if (res_xlfd == FcResultMatch && res_core == FcResultMatch)
- {
- FONT_INSTANCE_TRUENAME (f) =
- build_ext_string (truename_via_XListFonts (dpy,
- (Extbyte *) &fcfont[0]),
- Qx_font_name_encoding);
- return FONT_INSTANCE_TRUENAME (f);
- }
- else if (res_xlfd == FcResultTypeMismatch || res_core == FcResultTypeMismatch)
- { /* Now we're f.... */
- maybe_signal_error (Qgui_error,
- "Xft TypeMismatch while determining font truename",
- Qnil, Qfont, errb);
- /* used to return Qnil here */
- }
- /* we shouldn't have to worry about FcResultNoId */
- else
- { /* Now we're f.... */
- maybe_signal_error (Qgui_error,
- "Xft bogus status while determining font truename",
- Qnil, Qfont, errb);
- /* used to return Qnil here */
- }
-#endif /* DO_FORMER_BIZARRE_GYMNASTICS */
}
#endif /* USE_XFT */
@@ -1194,9 +1135,10 @@
struct charset_reporter {
Lisp_Object *charset;
- /* #### Mule-ize these strings? */
- Extbyte *language;
- FcChar8 *rfc3066;
+ /* #### Mule-ize these strings?
+ No hurry, this is a debug facility. */
+ Extbyte *language; /* ASCII, please */
+ FcChar8 *rfc3066; /* ASCII, please */
};
static struct charset_reporter charset_table[] =
--
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