User: stephent
Date: 05/03/09 11:53:47
Modified: xemacs/src Tag: sjt-xft ChangeLog objects-x.c
Log:
one more quick fix
Revision Changes Path
No revision
No revision
1.758.2.19 +2 -1 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.758.2.18
retrieving revision 1.758.2.19
diff -u -r1.758.2.18 -r1.758.2.19
--- ChangeLog 2005/03/09 09:30:36 1.758.2.18
+++ ChangeLog 2005/03/09 10:53:20 1.758.2.19
@@ -1,7 +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.
+ crash by not handing random Xft results to core Xlib functions.
+ Replace bizarre gymnastics with simple FcNameUnparse.
2005-03-07 Stephen J. Turnbull <stephen(a)xemacs.org>
1.26.2.13 +21 -2 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.12
retrieving revision 1.26.2.13
diff -u -r1.26.2.12 -r1.26.2.13
--- objects-x.c 2005/03/09 09:30:49 1.26.2.12
+++ objects-x.c 2005/03/09 10:53:31 1.26.2.13
@@ -718,7 +718,7 @@
Display *dpy = DEVICE_X_DISPLAY (d);
Extbyte *nameext;
char* xlfd;
-#ifdef USE_XFT
+#if defined(USE_XFT) && defined(DO_FORMER_BIZARRE_GYMNASTICS)
FcChar8* fcfont;
#endif
@@ -726,6 +726,24 @@
/* 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 should just unparse. */
+ FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern);
+ 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
+ /* FORMER BIZARRE GYMNASTICS */
int core;
FcPattern *pat = FONT_INSTANCE_X_XFTFONT (f)->pattern;
FcResult res_xlfd = FcPatternGetString (pat, XFT_XLFD, 0, &fcfont);
@@ -781,8 +799,9 @@
Qnil, Qfont, errb);
/* used to return Qnil here */
}
+#endif /* DO_FORMER_BIZARRE_GYMNASTICS */
}
-#endif
+#endif /* USE_XFT */
/* OK, fall back to core font. */
if (NILP (FONT_INSTANCE_TRUENAME (f))
Show replies by date