Re: [gtk-list] Verifying fonts



I had exactly this proplem.  Noticed that it happened only with fonts with
long names.  I had been strcpy()'ing into a char buffer that was too
short.  Hope this helps.

-emile

On Sun, 29 Aug 1999, David Allen wrote:

> 
> I've been developing a package that uses the font selection dialog, which 
> does the standard thing to get a font name, and then loads it and starts
> to use it.
> 
> The problem is that one of the users of my package has complained that 
> sometimes he will pick a font, and click ok, and the program will segfault.
> The font handling code that I have written seems to be ok, and maybe I was
> being naive, but I assumed that the font selection box would only make 
> available options that were useable, but I guess not.
> 
> Is there a way to verify that the font is loadable/useable using GTK+?
> In the interim, I've been using XQueryFont and a few other xlib calls, but
> I'd rather do it in GTK+ to keep things consistant.
> 
> Any suggestions?
> 
> -- 
> David Allen
> http://opop.nols.com/
> ----------------------------------------
> "I don't have to take this abuse from you - I've got hundreds of 
> people waiting to abuse me." 
> - Bill Murray, "Ghostbusters" 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 

-------------------------------------------------------------------
ESR: I want to live in a world where software doesn't suck.
RMS: Any software that isn't free sucks.
Linus: I'm interested in free beer.
          - As reported by Elizabeth O. Coolbaugh of LWN 
	    from LinuxWorld Conference and Expo
-------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]