[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Suggested font_cacher patch
From: |
Anthony W. Juckel |
Subject: |
Suggested font_cacher patch |
Date: |
06 Dec 2001 18:17:05 -0600 |
I've recently been having problems with GNUstep. Namely, whenever I
would open an app, font_cacher would bring down my X display. It had
been suggested to me that the problem might lie in my X server, or the
number of fonts that I had installed. So, I spun out the following
patch quick, to possibly help others out who are having the same
problem, and may not want to prune their X fonts.
Admittedly, this isn't the best of fixes, but it is working for me now,
so I thought I would post it here and see what everyone else thought.
The patch adds a check for an XGPSFontMask (NSUserDefaults-style)
default. If it finds it, it uses that as the font mask to XListFonts.
If not, it uses the standard "*".
Again, any comments/criticism on this are welcome.
Anthony W. Juckel
Index: font_cacher.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/xgps/Tools/font_cacher.m,v
retrieving revision 1.11
diff -r1.11 font_cacher.m
30a31
> #include <Foundation/NSUserDefaults.h>
160a162,163
> NSString *font_mask;
> NSUserDefaults *defs;
249a253,267
> /* ...Unless the user has supplied the default XGPSFontMask in
NSGlobalDomain, in which case
> * only fonts matching the supplied mask will be cached */
> defs = [NSUserDefaults standardUserDefaults];
> if (defs == nil)
> {
> NSLog(@"font_cacher: unable to access defaults database!");
> }
> else
> {
> font_mask = [defs stringForKey: @"XGPSFontMask"];
> }
> if (font_mask == nil)
> {
> font_mask = [NSString stringWithCString: "*"];
> }
252c270
< fonts = XListFonts(dpy, "*", nnames, &available);
---
> fonts = XListFonts(dpy, [font_mask cString], nnames,
&available);
- Suggested font_cacher patch,
Anthony W. Juckel <=