Discussion:
gtklabel font size change?
Markus Wolters
2003-01-25 10:33:28 UTC
Permalink
Could anyone tell my how to change the font size of my labels?
Bastien Nocera
2003-01-25 12:21:55 UTC
Permalink
Hi,
Post by Markus Wolters
Could anyone tell my how to change the font size of my labels?
This mailing-list isn't for developer help on Gtk+, it's for Debian
developers packaging Gtk+/Gnome applications.

You'll be able to change the size of a font with Gtk+ 2.x like so:

GtkWidget *label;

label = gtk_label_new ("<span size=\"100\">Fooo</span>");
gtk_label_set_use_markup (GTK_LABEL (label));

See the pango documentation for more info. And ask your question on
gtk-app-devel-list (see http://lists.gnome.org)

Cheers
--
Bastien Nocera <***@hadess.net>
Havoc Pennington
2003-01-25 17:59:20 UTC
Permalink
Post by Bastien Nocera
GtkWidget *label;
label = gtk_label_new ("<span size=\"100\">Fooo</span>");
gtk_label_set_use_markup (GTK_LABEL (label));
It's better to use markup "<large>Foo</large>" as that will be
relative to the user's normal font size, rather than hardcoded to
a particular point size. There's also <span size="x-large"> type stuff
I think.

It's also possible to skip markup and just use
gtk_label_set_attributes(), generally translators prefer that. see
eel_gtk_label_set_scale() in the "eel" library for example code.

Havoc

Loading...