GNOME Bugzilla – Bug 97146
Add set_font_weight and set_font_style
Last modified: 2004-12-22 21:47:04 UTC
Unnecessary markup should be removed from messages, to avoid problems for translators. Details on that are in bug 96836. hp@redhat.com suggested: "if we really want people to avoid the markup, I think we need to add: gtk_label_set_font_weight (); gtk_label_set_font_style (); etc. Maybe worth a GTK bug."
The right api is gtk_widget_modify_font() .. I think adding gtk_widget_modify_weight() gtk_widget_modify_family(), etc would just be too much bloat. PangoFontDescription *font_desc = pango_font_description_from_string ("bold"); gtk_widget_modify_font (label, font_desc); pango_font_description_free (font_desc);
I disagree with you on this Owen - the markup API is simple, which is a strength, but it's creating problems for translators. Having to use several API calls in place of a simple string markup results in either programmers removing the markup altogether due to the hassle, or leaving it in and getting mailbombed by the translation team. Possibly even better would be gtk_label_new_with_text (char *text, ...) thus gtk_label_new_with_text ("<small><i>", _("foo"), "</i></small>", NULL); Bill