Re: Call for text size and style advice for Gnome 2



Havoc Pennington <hp redhat com> writes:

> > So to summarize: To apply a PangoAttrScale I need to use widget-specific
> > code. But I can easily modify the font in a widget-independent way. But
> > that's not good because it ends up requesting a specific font rather a size
> > relative to the default.
> 
> Yeah. Not the best thing ever - I wanted gtk_widget_scale_font() or
> something, but we didn't figure out how to do that in time I guess.

What I want to do in the future is support pango font descriptions with
relative sizes in pango_font_description_merge() so you can use modify
font() with

 pango_font_description_from_string("+2")

And have that work, as it does for style "bold italic" or family. (We
probably should have a gtk_widget_modify_font_name() for
convenience())

It would take about 10 minutes to implement and involve no changes
outside of Pango at all, but as a semantic addition, I don't want
to do it now.
 
> Nearly all text-displaying widgets do support AttrList somehow though.
> 
> It's probably also fine to use gtk_widget_modify_font() as long as we
> handle style_set etc., which I guess Nautilus always has. Trivial to
> apply a scale factor ourselves in the style_set handler. Maybe this is
> what make_larger should do.

Ugh, ugh, ugh, ugh, ugh, ugh. gtk_widget_modify_font() causes a new style
to be set with a larger font. You might be able to figure out how to
get around this infinite loop, but it would be utterly ugly.

And GTK+ is perfectly free in the future to decide that a RC file change
(the user changing the size) didn't change the font at all (because
the size was previously overriden)

Regards,
                                        Owen



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