0

I'm trying to change the size of the font on the button but not able to do it. I tried using pango on the widget. For some reason it does not work. Is there an alternate way to do this?

#define font "Sans 30"
 button = gtk_button_new_with_label("Button text");
  gtk_widget_set_size_request(button, 150, 100);
  gtk_widget_modify_bg (button, GTK_STATE_NORMAL, &blue_button);
PangoFontDescription *font_desc;
font_desc = pango_font_description_from_string (font);
gtk_widget_modify_font(GTK_WIDGET(button), font_desc);
drahnr
  • 6,782
  • 5
  • 48
  • 75
user3309525
  • 71
  • 1
  • 10

1 Answers1

0

Devhelp excerpt:

void                pango_font_description_set_size     (PangoFontDescription *desc,
                                                         gint size);

Sets the size field of a font description in fractional points. This is mutually exclusive with pango_font_description_set_absolute_size().

desc :

a PangoFontDescription size :

the size of the font in points, scaled by PANGO_SCALE. (That is, a size value of 10 * PANGO_SCALE is a 10 point font. The conversion factor between points and device units depends on system configuration and the output device. For screen display, a logical DPI of 96 is common, in which case a 10 point font corresponds to a 10 * (96 / 72) = 13.3 pixel font. Use pango_font_description_set_absolute_size() if you need a particular size in device units.

drahnr
  • 6,782
  • 5
  • 48
  • 75