Thread View: gnu.epoch.misc
1 messages
1 total messages
Started by Ken Wood
Mon, 02 Sep 1991 16:16
Bug in font loading with get-font
Author: Ken Wood
Date: Mon, 02 Sep 1991 16:16
Date: Mon, 02 Sep 1991 16:16
53 lines
2214 bytes
2214 bytes
[Apologies if you've seen this before - I tried to post it but it
didn't appear to get out.]
There seems to be a bug in get-font. From the way it's written I
assume it's supposed to return nil if you give it an invalid font
name. In reality it always returns an allocated font structure. A
patch is attached below. Could someone official please bless this
patch or else tell be where I've gone wrong? Thanks. We're using epoch
3.2 patch 2 .
Ken
*** ../../epoch-3.2.2/src/xutil.c Fri Jul 19 09:36:33 1991
--- xutil.c Fri Aug 23 16:31:07 1991
***************
*** 566,571 ****
--- 566,573 ----
{
Font font;
BLOCK_INPUT_DECLARE();
+ char **tempfontlist;
+ int tempfontcount;
if (XRESOURCEP(name) && XXRESOURCE(name)->type == XA_FONT) return name;
***************
*** 572,578 ****
CHECK_STRING(name,0);
BLOCK_INPUT();
! font = XLoadFont(XD_display,XSTRING(name)->data);
UNBLOCK_INPUT();
return font ? make_Xresource(XD_display,XD_plane,font,XA_FONT) : Qnil;
--- 574,585 ----
CHECK_STRING(name,0);
BLOCK_INPUT();
! tempfontlist = XListFonts(XD_display,XSTRING(name)->data,1,&tempfontcount);
! if (tempfontcount)
! font = XLoadFont(XD_display,XSTRING(name)->data);
! else
! font = 0;
! XFreeFontNames(tempfontlist);
UNBLOCK_INPUT();
return font ? make_Xresource(XD_display,XD_plane,font,XA_FONT) : Qnil;
Ken Wood, Austek Microsystems, Technology Park, Adelaide, SA 5095, Australia
INTERNET: kwood@austek.oz.au UUCP: uunet.uu.net!munnari!austek.oz.au!kwood
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads