Re: fonts



Pallucchini Roberto wrote:

i need to change the default font of gtk_label_text. what i need to do?

thanks

The stuff below is for gtk+-2.0.

1. You can use  pango_layout_set_font_description() function:
static void label_font_set(GtkLabel *label)
{
   g_return_if_fail(label!=NULL);
   g_return_if_fail(GTK_IS_LABEL(label));

   pango_layout_set_font_description(
gtk_label_get_layout (label), "fixed 14" /* put pango font description here */
   );
}

2. You can name your label with gtk_widget_set_name() and use "font_name" .rc file option.
3. You can use gtk_label_set_attributes() function to change font attribute.
4. You can use pango markup to specify font[s] in string passed to label.

Olexiy




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