Hi!
I think it depends on how you want to try to solve it.
For instance, if you use Gnome::CanvasText you can do:
@canvas_text = Gnome::CanvasText.new(@canvas_group,
:x => 98.0,
:y => 32.0,
:font => “Sans 22”,
:anchor => Gtk::ANCHOR_CENTER,
:text => “foobar”,
:fill_color => “black”
)
And pass in the font value there.
If you want to modify the font of your window, you can do this:
@window.modify_font(
Pango::FontDescription.new("#widget.settings.gtk_font_nameend 20" ) )
Where @window is of Gtk::Window type.
I think you can also use .modify_font on other widgets, for instance:
DEFAULT_FONT = Pango::FontDescription.new(“Sans 30”)
@label.modify_font(DEFAULT_FONT)
I am also using some constants for easier access like this:
module PangoFonts
FONT_SANS_BOLD_08 = Pango::FontDescription.new('Sans Bold 08')
FONT_SANS_BOLD_10 = Pango::FontDescription.new('Sans Bold 10')
FONT_SANS_BOLD_11 = Pango::FontDescription.new('Sans Bold 11')
FONT_SANS_BOLD_12 = Pango::FontDescription.new('Sans Bold 12')
FONT_SANS_BOLD_14 = Pango::FontDescription.new('Sans Bold 14')
FONT_SANS_BOLD_16 = Pango::FontDescription.new('Sans Bold 16')
FONT_SANS_BOLD_18 = Pango::FontDescription.new('Sans Bold 18')
FONT_UTOPIA_14 = Pango::FontDescription.new('Utopia 14')
FONT_UTOPIA_16 = Pango::FontDescription.new('Utopia 16')
FONT_UTOPIA_18 = Pango::FontDescription.new('Utopia 18')
FONT_UTOPIA_20 = Pango::FontDescription.new('Utopia 20')
end
In a VTE Terminal you could do this:
@vte_terminal.set_font(‘Monospace 28’,
Vte::TerminalAntiAlias::FORCE_ENABLE)
Not sure if this is helping you, sorry, but perhaps it can be a start.
There is probably also an easier way to handle font size in general, I
am just not sure about it (The GTK way …)