diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-12 18:05:18 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-12 18:05:18 (GMT) |
commit | b9a4361754a553ade5449d8410f5ac5b021f7e00 (patch) | |
tree | 018237a9d1d336f291a224d31683cd43a4b6ac47 /unix | |
parent | 81575a89268f055404ce2b8655a24ec1ccbd188d (diff) | |
download | tk-b9a4361754a553ade5449d8410f5ac5b021f7e00.zip tk-b9a4361754a553ade5449d8410f5ac5b021f7e00.tar.gz tk-b9a4361754a553ade5449d8410f5ac5b021f7e00.tar.bz2 |
Additional suggestion by chw. Unfortunately doesn't help any on Ubuntu :-(
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixRFont.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index a9c75ed..cf8c68f 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -334,11 +334,17 @@ InitFont( * Fill in platform-specific fields of TkFont. */ - ftFont = GetFont(fontPtr, 0, 0.0); - fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed"); + errorFlag = 0; handler = Tk_CreateErrorHandler(Tk_Display(tkwin), -1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag); - errorFlag = 0; + ftFont = GetFont(fontPtr, 0, 0.0); + if ((ftFont == NULL) || errorFlag) { + Tk_DeleteErrorHandler(handler); + FinishedWithFont(fontPtr); + ckfree(fontPtr); + return NULL; + } + fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed"); GetTkFontAttributes(ftFont, &fontPtr->font.fa); GetTkFontMetrics(ftFont, &fontPtr->font.fm); Tk_DeleteErrorHandler(handler); |