Re: Gtk font/style question



On Thu, Mar 09, 2000 at 09:22:07PM -0500, Matthew Guenther wrote:
> Hi,
> 
> I'm trying to have a program I'm working on (Balsa) take the user's current
> Gtk style font, make it bold, and then use that font in a CTree to
> show which mailboxes have new mail.  However I can't figure out a way
> to do this.  Although I can get the GdkFont, there doesn't seem to be
> a way to get either the XLFD, or perform manipulations on the current
> font.  Is there a way to do this from within the Gtk/Gdk framework?

The following is an ugly way to get the font xlfd.

#include <gdk/gdkprivate.h>

GdkFont* font = style->font;
GSList *list = ((GdkFontPrivate*)font)->names;
gchar *xlfd = (gchar*)list->data;

Since its a list, I suppose you might get more than one xlfd for a
given GdkFont, but in my test it was only a one element list.

If anyone else has a cleaner way, please post here. I need to do
this as well at some point.

Good Luck,
Sam Hunter <shunter@bigsky.net>



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