font "styles" [was Re:.. fontset ...canvas.c]



Changwoo Ryu wrote:
> 
> I can define thoese fonts.  There is a `dirty hack' for gnomecard-like
> programs..  (Please open gnome-libs/libgnomeui/gnome-about.c and
> search the string, `dirty hack'.  :)
> 
>         cardname_font = gdk_fontset_load (CARDNAME_FONTSET);
> 	title_font = gdk_fontset_load (TITLE_FONTSET);
> 	...
> 
> The above can be replaced like this:
> 
>         style_backup = gtk_style_ref (some_widget->style);
> 
> 	gtk_widget_set_name (some_widget, "CardName");
>         cardname_font = gdk_font_ref (some_widget->style->font);
> 
> 	gtk_widget_set_name (some_widget, "CardName");
>         cardname_font = gdk_font_ref (some_widget->style->font);
> 	...
> 
> 	gtk_widget_set_style (some_widget, style_backup);
> 	gtk_style_unref (style_backup);
> 
> Yes, it's ugly and `dirty'.  But surely gtkrc can be used for
> gnomecard.

But it is exactly the way I thought we can define GNOME-wide
collection of standart fonts for use in canvas. That "some_widget"
whould be some sort of the storage for fonts. Then in gtkrc file you 
will put:

style "Gnome_Header1_style"
{
  font = "-adobe-helvetica-bold-r-normal-*-20-*-*-*-*-*-*-*"
}

style "Gnome_Header2_style"
{
  font = "-adobe-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*"
}

style "Gnome_Header3_style"
{
  font = "-adobe-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*"
}

....

widget "*GnomeFonts*.Header1" style "Gnome_Header1_style"
widget "*GnomeFonts*.Header2" style "Gnome_Header2_style"
widget "*GnomeFonts*.Header3" style "Gnome_Header3_style"
...


When we discussed that in this list, Miguel said he wants to wait with
it till after 1.0
I also hope, someone might come up with a more elegant solution

     Sergey



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