User: stephent
Date: 05/03/09 10:31:05
Modified: xemacs/src Tag: sjt-xft ChangeLog objects-x.c
Log:
Try to fix truename_via_XListFonts crash again
<87fyz5yxpj.fsf(a)tleepslib.sk.tsukuba.ac.jp>
Revision Changes Path
No revision
No revision
1.64.2.8 +4 -0 XEmacs/xemacs/lwlib/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/ChangeLog,v
retrieving revision 1.64.2.7
retrieving revision 1.64.2.8
diff -u -r1.64.2.7 -r1.64.2.8
--- ChangeLog 2005/03/09 06:31:09 1.64.2.7
+++ ChangeLog 2005/03/09 09:30:26 1.64.2.8
@@ -1,3 +1,7 @@
+2005-03-09 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * xlwtabs.c (TabsGeometryManager): Fix "fat fingers" mistake.
+
2005-03-07 Stephen J. Turnbull <stephen(a)xemacs.org>
* lwlib-Xlw.c (build_tabs_in_widget): Correctly disable geometry
1.4.2.10 +1 -1 XEmacs/xemacs/lwlib/xlwtabs.c
Index: xlwtabs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lwlib/xlwtabs.c,v
retrieving revision 1.4.2.9
retrieving revision 1.4.2.10
diff -u -r1.4.2.9 -r1.4.2.10
--- xlwtabs.c 2005/03/09 06:31:10 1.4.2.9
+++ xlwtabs.c 2005/03/09 09:30:26 1.4.2.10
@@ -1143,7 +1143,7 @@
~((reply->border_width == tab->core.border_width
? CWBorderWidth : 0)
|(reply->width == tab->core.width ? CWWidth : 0)
- |(reply->height == tab->core.height ? CWHeight : 0))
+ |(reply->height == tab->core.height ? CWHeight : 0));
return XtGeometryAlmost ;
}
No revision
No revision
1.758.2.18 +5 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.758.2.17
retrieving revision 1.758.2.18
diff -u -r1.758.2.17 -r1.758.2.18
--- ChangeLog 2005/03/09 06:31:22 1.758.2.17
+++ ChangeLog 2005/03/09 09:30:36 1.758.2.18
@@ -1,3 +1,8 @@
+2005-03-09 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-x.c (x_font_instance_truename): Try to fix XListFonts
+ crash by not hand random Xft results to core Xlib functions.
+
2005-03-07 Stephen J. Turnbull <stephen(a)xemacs.org>
* objects-x-impl.h: Include lwlib-fonts.h
1.26.2.12 +25 -8 XEmacs/xemacs/src/objects-x.c
Index: objects-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/objects-x.c,v
retrieving revision 1.26.2.11
retrieving revision 1.26.2.12
diff -u -r1.26.2.11 -r1.26.2.12
--- objects-x.c 2005/03/09 06:31:42 1.26.2.11
+++ objects-x.c 2005/03/09 09:30:49 1.26.2.12
@@ -711,7 +711,6 @@
return Qnil;
}
-/* #### The logic in this function seems fxxked. */
static Lisp_Object
x_font_instance_truename (Lisp_Font_Instance *f, Error_Behavior errb)
{
@@ -725,14 +724,17 @@
#ifdef USE_XFT
/* First, try an Xft font. */
- if (NILP (FONT_INSTANCE_TRUENAME (f)))
+ if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f))
{
int core;
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);
- if (res_xlfd == FcResultTypeMismatch || res_core == FcResultTypeMismatch)
+ /* #### 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);
@@ -749,20 +751,35 @@
return FONT_INSTANCE_TRUENAME (f);
}
else
- { /* Now we're f.... */
+ {
maybe_signal_error (Qgui_error,
- "Couldn't determine font truename",
+ "Couldn't unparse Xft font to truename",
Qnil, Qfont, errb);
- return Qnil;
+ /* used to return Qnil here */
}
}
- else
+ else if (res_xlfd == FcResultMatch && res_core == FcResultMatch)
{
- /* #### Why isn't this appropriate for core fonts, too? */
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