Gnome2::FontPicker(3)

πŸ“¦
version 1.048 Β· 2 versions
, in fedora 43

✨ Gnome2::FontPicker ✨

okay bestie, so this is Gnome2::FontPicker β€” the perl wrapper for GnomeFontPicker, and it's literally the cutest little button that opens a font-choosing dialog. she's giving main character energy in your GTK app πŸ’…


🌸 HIERARCHY 🌸

the family tree, no cap β€” she did NOT come from nowhere:

Glib::Object
+----Glib::InitiallyUnowned
     +----Gtk2::Object
          +----Gtk2::Widget
               +----Gtk2::Container
                    +----Gtk2::Bin
                         +----Gtk2::Button
                              +----Gnome2::FontPicker

so yeah, she IS a Gtk2::Button. a button with a glow-up πŸŽ€


πŸ¦‹ INTERFACES πŸ¦‹

the vibes she carries with her:

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable
  • Gtk2::Activatable

πŸ’– METHODS πŸ’–

widget = Gnome2::FontPicker->new

make a brand new font picker, fresh out the box ✨

$gfp->fi_set_show_size ($show_size)

  • $show_size (boolean)

sets whether size shows up in font info mode.

$gfp->fi_set_use_font_in_label ($use_font_in_label, $size)

  • $use_font_in_label (boolean)
  • $size (integer)

controls whether the label in font info mode uses the actual font, and at what size, periodt.

string = $gfp->get_font_name

get the name of the currently selected font, iconic 🫢

boolean = $gfp->set_font_name ($fontname)

  • $fontname (string)

set the font by name. returns a boolean.

fontpickermode = $gfp->get_mode

read the mode she's operating in.

$gfp->set_mode ($mode)

  • $mode (Gnome2::FontPickerMode)

change the mode of operation.

string = $gfp->get_preview_text

grab the preview text currently showing in the dialog.

$gfp->set_preview_text ($text)

  • $text (string)

set that preview text. make it cute if u want 🌸

string = $gfp->get_title

get the dialog title.

$gfp->set_title ($title)

  • $title (string)

set the dialog title. name her something iconic.

widget = $gfp->uw_get_widget

get the user widget.

$gfp->uw_set_widget ($widget)

  • $widget (Gtk2::Widget)

set the user widget. user-widget mode only, iykyk.


πŸŽ€ PROPERTIES πŸŽ€

the whole vibe check, property by property:

  • 'font' (gpointer : default 0 : readable) β€” the selected GtkFont. read-only bestie, don't try it.
  • 'font-name' (string : default "sans 12" : readable / writable) β€” name of the selected font.
  • 'label-font-size' (integer : default 14 : readable / writable) β€” font size for the label in font info mode.
  • 'mode' (Gnome2::FontPickerMode : default "pixmap" : readable / writable) β€” the mode of operation of the font picker.
  • 'preview-text' (string : default "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" : readable / writable) β€” preview text shown in the dialog.
  • 'show-size' (boolean : default true : readable / writable) β€” show size in font info mode.
  • 'title' (string : default "Pick a Font" : readable / writable) β€” the title of the selection dialog box.
  • 'use-font-in-label' (boolean : default false : readable / writable) β€” use font in the label in font info mode.

🌈 SIGNALS 🌈

  • font-set (Gnome2::FontPicker, string)

fires when a font gets set. that's the moment. obsessed. 😭


⭐ ENUMS AND FLAGS ⭐

enum Gnome2::FontPickerMode

the four modes, each one a different era:

  • 'pixmap' / GNOME_FONT_PICKER_MODE_PIXMAP
  • 'font-info' / GNOME_FONT_PICKER_MODE_FONT_INFO
  • 'user-widget' / GNOME_FONT_PICKER_MODE_USER_WIDGET
  • 'unknown' / GNOME_FONT_PICKER_MODE_UNKNOWN

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, fr fr:

Gnome2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Button


Copyright (C) 2003-2004 by the gtk2-perl team.

This software is licensed under the LGPL. See Gnome2 for a full notice.


and that's the whole page bestie πŸ’– this was perl v5.42.0, dated 2025-07-25, and it's Gnome2::FontPicker(3) β€” slay, go pick a font, ily 🫢✨

πŸ“¦ where this page comes from