Fonts in GTK+ 2.0



I was musing on the issue of fonts, and concluded that a more flexible
set of fonts in gtkrc files would be really nice and help the interface
of GTK+ apps.

font = "helvetica normal 12"
font_bold = "helvetica bold 12"
font_large = "helvetica bold 24"
font_small = "helvetica 10"
font_mono = "fixed 13"

These extra fonts would mean that applications would not have to
hardcode in their special fonts (I'm thinking of GnomeDruid and
GnomeAbout specifically). Obviously, some kind of API to make a widget
use these fonts would be required.

typedef enum {
    GTK_FONT_TYPE_NORMAL = 0,
    GTK_FONT_TYPE_BOLD = 1,
    GTK_FONT_TYPE_LARGE = 2,
    GTK_FONT_TYPE_SMALL = 3,
    GTK_FONT_TYPE_MONO = 4
}; GtkFontType;

void gtk_widget_set_font_type (GtkWidget *widget, GtkFontType
font_type);

In addition to the obvious advantage of having these previously
unresponsive gnome widgets respond to user font prefs and still look
similar to their current appearance, it would also allow one of the
nicer UI features of Macs (namely, different fonts for different levels
of importance in message boxes) to be easily duplicated. Nautilus had to
implement some of this internally to accomplish this relatively simple
feature for 1.0.

I'm nowhere near proficient enough code-wise to code such a beast in,
but I'm sure the value of this kind of an interface feature is not lost
on anyone :-).

    Jim Cape
    http://www.ignore-your.tv

    If the United States Government spent as much on education
    as it did on the military, every student could fail in a
    solid gold desk.





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