# How to obtain font info

**URL:** <https://www.ruby-forum.com/t/how-to-obtain-font-info/157919>\
**Category:** Ruby-Gnome 2\
**Created:** [January 16, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/how-to-obtain-font-info/157919 "2009-01-16T16:02:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@rubinx](https://www.ruby-forum.com/u/rubinx)\
**Post date:** [January 16, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/how-to-obtain-font-info/157919/1 "2009-01-16T16:02:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rubinx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@rubinx](https://www.ruby-forum.com/u/rubinx)\
**Post date:** [January 28, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/how-to-obtain-font-info/157919/2 "2009-01-28T16:18:43Z")

</div>

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.
