diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-09-10 12:47:13 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-09-10 12:47:13 (GMT) |
commit | 59d18bcefa5280de1152a05d08d250cb582fab62 (patch) | |
tree | 49ed37276011f737c431c8504927a71bf597ff3e /generic | |
parent | 04186cac679b0f544237dd1c8be70e4f3a79a2e7 (diff) | |
download | tk-59d18bcefa5280de1152a05d08d250cb582fab62.zip tk-59d18bcefa5280de1152a05d08d250cb582fab62.tar.gz tk-59d18bcefa5280de1152a05d08d250cb582fab62.tar.bz2 |
Backport of "misconfigured xft font engine" fixes.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkFont.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 3839ef0..4852f14 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.42.2.2 2009/05/13 21:49:12 patthoyts Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.42.2.3 2009/09/10 12:47:15 dkf Exp $ */ #include "tkInt.h" @@ -1194,6 +1194,19 @@ Tk_AllocFontFromObj( } } + /* + * Detect the system font engine going wrong and fail more gracefully. + */ + + if (fontPtr == NULL) { + if (isNew) { + Tcl_DeleteHashEntry(cacheHashPtr); + } + Tcl_AppendResult(interp, "failed to allocate font due to ", + "internal system font engine problem", NULL); + return NULL; + } + fontPtr->resourceRefCount = 1; fontPtr->objRefCount = 1; fontPtr->cacheHashPtr = cacheHashPtr; |