summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixRFont.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-09-10 12:47:13 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-09-10 12:47:13 (GMT)
commitdb92c980025b4202cf1e520ce03d6aa1e0737ade (patch)
tree49ed37276011f737c431c8504927a71bf597ff3e /unix/tkUnixRFont.c
parent9aff282a21ad67ddf66baf942f07ba490c597b09 (diff)
downloadtk-db92c980025b4202cf1e520ce03d6aa1e0737ade.zip
tk-db92c980025b4202cf1e520ce03d6aa1e0737ade.tar.gz
tk-db92c980025b4202cf1e520ce03d6aa1e0737ade.tar.bz2
Backport of "misconfigured xft font engine" fixes.
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r--unix/tkUnixRFont.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 73e091c..b3d5ce4 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixRFont.c,v 1.24 2008/03/12 16:35:27 jenglish Exp $
+ * RCS: @(#) $Id: tkUnixRFont.c,v 1.24.2.1 2009/09/10 12:47:15 dkf Exp $
*/
#include "tkUnixInt.h"
@@ -220,7 +220,6 @@ InitFont(
set = FcFontSort(0, pattern, FcTrue, NULL, &result);
if (!set) {
- FcPatternDestroy(pattern);
ckfree((char *)fontPtr);
return NULL;
}
@@ -323,6 +322,7 @@ TkpGetNativeFont(
fontPtr = InitFont(tkwin, pattern, NULL);
if (!fontPtr) {
+ FcPatternDestroy(pattern);
return NULL;
}
return &fontPtr->font;
@@ -388,7 +388,20 @@ TkpGetFontFromAttributes(
FinishedWithFont(fontPtr);
}
fontPtr = InitFont(tkwin, pattern, fontPtr);
+
+ /*
+ * Hack to work around issues with weird issues with Xft/Xrender
+ * connection. For details, see comp.lang.tcl thread starting from
+ * <adcc99ed-c73e-4efc-bb5d-e57a57a051e8@l35g2000pra.googlegroups.com>
+ */
+
if (!fontPtr) {
+ XftPatternAddBool(pattern, XFT_RENDER, FcFalse);
+ fontPtr = InitFont(tkwin, pattern, fontPtr);
+ }
+
+ if (!fontPtr) {
+ FcPatternDestroy(pattern);
return NULL;
}
return &fontPtr->font;