Forum: Ruby-Gnome 2 How to obtain font info

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Torli B. (Guest)
on 2009-01-16 17:02
Hi,

I would like to change my font on a label, but I do not want to use
FontButton. How can I get the font information (I guess the
Pango::FontDescription) of the font on my label, or for that matter font
used with any widget where font is used?

Thank you in advance.
Igor P. (Guest)
on 2009-01-28 17:18
You should be able to to modify font used in most any widget with the
Gtk::Widget#modify_font(font), providing font is an instance of
Pango::FontDescription. However currently (Ruby 1.8.6 and Ruby-GNOME2
rel 2-0.17.0-rc1) this does not seem to be the case. I was only able to
manipulate fonts on Gtk::Label objects and editable objects like
Gtk::Entry. I could not change font on button text or button labels. I
believe this will change in the future.
This topic is locked and can not be replied to.