diff src/fontcolor-x.c @ 5923:61d7d7bcbe76 cygwin

merged heads after pull -u
author Henry Thompson <ht@markup.co.uk>
date Thu, 05 Feb 2015 17:19:05 +0000
parents 6928877dbc26
children
line wrap: on
line diff
--- a/src/fontcolor-x.c	Wed Apr 23 22:22:37 2014 +0100
+++ b/src/fontcolor-x.c	Thu Feb 05 17:19:05 2015 +0000
@@ -755,13 +755,20 @@
   if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f))
     {
       /* The font is already open, we just unparse. */
-      FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern);
-      if (! FONT_INSTANCE_X_XFTFONT (f)->pattern)
+      FcPattern* pattern = FONT_INSTANCE_X_XFTFONT (f)->pattern;
+      FcChar8 *res;
+      if (!pattern)
 	{
 	  maybe_signal_error (Qgui_error,
 			      "Xft font present but lacks pattern",
 			      wrap_font_instance(f), Qfont, errb);
 	}
+      {
+	FcPattern* temp = FcPatternDuplicate (pattern);
+	FcPatternDel (temp, FC_CHARSET);  /* FcNameUnparse may choke */
+	res = FcNameUnparse (temp);
+	FcPatternDestroy (temp);
+      }
       if (res)
 	{
 	  FONT_INSTANCE_TRUENAME (f) =