Re: what font is actually used?



On Sun, 2011-10-02 at 13:00 -0600, D. R. Evans wrote:
> D. R. Evans said the following at 09/14/2011 07:20 PM :
> > I believe that this is the correct way to set the font to be used in a label:
> > 
> > ----
> > 
> > const string font_description_string("Courier New, medium, 14");
> > 
> > label.override_font(Pango::FontDescription(font_description_string));
> > 
> > ----
> > 
> > How can I determine what font is actually used for the label once the
> > font-matching algorithm has done its work??

Another way to change the font of a widget would be to get its
Pango::Context (using Gtk::Widget::get_pango_context()) and setting the
context's default font description.

Once the font has been changed, it should also be possible to get the
widget's current font description using the context.  The
get_pango_context() docs [1] implies that the context changes according
to the attributes set on the widget.

[1]
http://developer.gnome.org/gtkmm/3.2/classGtk_1_1Widget.html#a0be06b45418ec17f992eb3acf89cd0b8

> 
> I never saw a response to this question. Is there a more appropriate
> reflector somewhere where it would be better for me to ask it?
> 
>   Doc
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

-- 
José







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