## GnomeFontPicker

GnomeFontPicker —

## Synopsis

    #include <libgnomeui/libgnomeui.h>

    enum        GnomeFontPickerMode;
    struct      GnomeFontPickerPrivate;
    struct      GnomeFontPicker;
    GtkWidget*  gnome_font_picker_new           (void);
    void        gnome_font_picker_set_title     (GnomeFontPicker *gfp,
                                                 const gchar *title);
    const gchar* gnome_font_picker_get_title    (GnomeFontPicker *gfp);
    GnomeFontPickerMode gnome_font_picker_get_mode
                                                (GnomeFontPicker *gfp);
    void        gnome_font_picker_set_mode      (GnomeFontPicker *gfp,
                                                 GnomeFontPickerMode mode);
    void        gnome_font_picker_fi_set_use_font_in_label
                                                (GnomeFontPicker *gfp,
                                                 gboolean use_font_in_label,
                                                 gint size);
    void        gnome_font_picker_fi_set_show_size
                                                (GnomeFontPicker *gfp,
                                                 gboolean show_size);
    void        gnome_font_picker_uw_set_widget (GnomeFontPicker *gfp,
                                                 GtkWidget *widget);
    GtkWidget*  gnome_font_picker_uw_get_widget (GnomeFontPicker *gfp);
    const gchar* gnome_font_picker_get_font_name
                                                (GnomeFontPicker *gfp);
    GdkFont*    gnome_font_picker_get_font      (GnomeFontPicker *gfp);
    gboolean    gnome_font_picker_set_font_name (GnomeFontPicker *gfp,
                                                 const gchar *fontname);
    const gchar* gnome_font_picker_get_preview_text
                                                (GnomeFontPicker *gfp);
    void        gnome_font_picker_set_preview_text
                                                (GnomeFontPicker *gfp,
                                                 const gchar *text);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GtkWidget
                   +----GtkContainer
                         +----GtkBin
                               +----GtkButton
                                     +----GnomeFontPicker

## Implemented Interfaces

GnomeFontPicker implements AtkImplementorIface.

## Properties

      "font"                 gpointer             : Read
      "font-name"            gchararray           : Read / Write
      "label-font-size"      gint                 : Read / Write
      "mode"                 GnomeFontPickerMode  : Read / Write
      "preview-text"         gchararray           : Read / Write
      "show-size"            gboolean             : Read / Write
      "title"                gchararray           : Read / Write
      "use-font-in-label"    gboolean             : Read / Write

## Signal Prototypes

    "font-set"  void        user_function      (GnomeFontPicker *fontpicker,
                                                gchar *arg1,
                                                gpointer user_data);

## Description

## Details

### enum GnomeFontPickerMode

    typedef enum {
        GNOME_FONT_PICKER_MODE_PIXMAP,
        GNOME_FONT_PICKER_MODE_FONT_INFO,
        GNOME_FONT_PICKER_MODE_USER_WIDGET,
        GNOME_FONT_PICKER_MODE_UNKNOWN
    } GnomeFontPickerMode;

### struct GnomeFontPickerPrivate

    struct GnomeFontPickerPrivate;

### struct GnomeFontPicker

    struct GnomeFontPicker;

### gnome_font_picker_new ()

    GtkWidget*  gnome_font_picker_new           (void);

Create new font picker widget.

Returns : | Pointer to new font picker widget.

### gnome_font_picker_set_title ()

    void        gnome_font_picker_set_title     (GnomeFontPicker *gfp,
                                                 const gchar *title);

Sets the title for the font selection dialog. If `title` is `NULL`, then the default is used.

`gfp` : | Pointer to GNOME font picker widget.
`title` : | String containing font selection dialog title.

### gnome_font_picker_get_title ()

    const gchar* gnome_font_picker_get_title    (GnomeFontPicker *gfp);

Retrieve name of the font selection dialog title

`gfp` : | Pointer to GNOME font picker widget.
Returns : | Pointer to an internal copy of the title string

### gnome_font_picker_get_mode ()

    GnomeFontPickerMode gnome_font_picker_get_mode
                                                (GnomeFontPicker *gfp);

Returns current font picker button mode (or what to show). Possible values include `GNOME_FONT_PICKER_MODE_PIXMAP`, `GNOME_FONT_PICKER_MODE_FONT_INFO`, and `GNOME_FONT_PICKER_MODE_USER_WIDGET`.

`gfp` : | Pointer to GNOME font picker widget.
Returns : | Button mode currently set in font picker widget, or `GNOME_FONT_PICKER_MODE_UNKNOWN` on error.

### gnome_font_picker_set_mode ()

    void        gnome_font_picker_set_mode      (GnomeFontPicker *gfp,
                                                 GnomeFontPickerMode mode);

Set value of subsequent font picker button mode (or what to show).

`gfp` : | Pointer to GNOME font picker widget.
`mode` : | Value of subsequent font picker button mode (or what to show)

### gnome_font_picker_fi_set_use_font_in_label ()

    void        gnome_font_picker_fi_set_use_font_in_label
                                                (GnomeFontPicker *gfp,
                                                 gboolean use_font_in_label,
                                                 gint size);

If `use_font_in_label` is `TRUE`, font name will be written using font chosen by user and using `size` passed to this function. This only applies if current button mode is `GNOME_FONT_PICKER_MODE_FONT_INFO`.

`gfp` : | Pointer to GNOME font picker widget.
`use_font_in_label` : | If `TRUE`, font name will be written using font chosen.
`size` : | Display font using this point size.

### gnome_font_picker_fi_set_show_size ()

    void        gnome_font_picker_fi_set_show_size
                                                (GnomeFontPicker *gfp,
                                                 gboolean show_size);

If `show_size` is `TRUE`, font size will be displayed along with font chosen by user. This only applies if current button mode is `GNOME_FONT_PICKER_MODE_FONT_INFO`.

`gfp` : | Pointer to GNOME font picker widget.
`show_size` : | `TRUE` if font size should be displayed in dialog.

### gnome_font_picker_uw_set_widget ()

    void        gnome_font_picker_uw_set_widget (GnomeFontPicker *gfp,
                                                 GtkWidget *widget);

Set the user-supplied `widget` as the inside of the font picker. This only applies with GNOME_FONT_PICKER_MODE_USER_WIDGET.

`gfp` : | Pointer to GNOME font picker widget.
`widget` : | User widget to display for inside of font picker.

### gnome_font_picker_uw_get_widget ()

    GtkWidget*  gnome_font_picker_uw_get_widget (GnomeFontPicker *gfp);

Get the user-supplied widget inside of the font picker. This only applies with GNOME_FONT_PICKER_MODE_USER_WIDGET.

`gfp` : | Pointer to GNOME font picker widget.
Returns : | a GtkWidget, or `NULL` if not in GNOME_FONT_PICKER_MODE_USER_WIDGET mode

### gnome_font_picker_get_font_name ()

    const gchar* gnome_font_picker_get_font_name
                                                (GnomeFontPicker *gfp);

Retrieve name of font from font selection dialog.

`gfp` : | Pointer to GNOME font picker widget.
Returns : | Pointer to an internal copy of the font name.

### gnome_font_picker_get_font ()

    GdkFont*    gnome_font_picker_get_font      (GnomeFontPicker *gfp);

Retrieve font info from font selection dialog.

`gfp` : | Pointer to GNOME font picker widget.
Returns : | Return value of gtk_font_selection_dialog_get_font, or `NULL` if font dialog is not being displayed. The value is not a copy but an internal value and should not be modified.

### gnome_font_picker_set_font_name ()

    gboolean    gnome_font_picker_set_font_name (GnomeFontPicker *gfp,
                                                 const gchar *fontname);

Set or update currently-displayed font in font picker dialog.

`gfp` : | Pointer to GNOME font picker widget.
`fontname` : | Name of font to display in font selection dialog
Returns : | Return value of gtk_font_selection_dialog_set_font_name if the font selection dialog exists, otherwise `FALSE`.

### gnome_font_picker_get_preview_text ()

    const gchar* gnome_font_picker_get_preview_text
                                                (GnomeFontPicker *gfp);

Retrieve preview text from font selection dialog if available.

`gfp` : | Pointer to GNOME font picker widget.
Returns : | Reference to internal copy of preview text string, or `NULL` if no font dialog is being displayed.

### gnome_font_picker_set_preview_text ()

    void        gnome_font_picker_set_preview_text
                                                (GnomeFontPicker *gfp,
                                                 const gchar *text);

Set preview text in font picker, and in font selection dialog if one is being displayed.

`gfp` : | Pointer to GNOME font picker widget.
`text` : | New preview text

## Properties

"`font`" (gpointer : Read) | The selected GtkFont.
"`font-name`" (gchararray : Read / Write) | Name of the selected font.
"`label-font-size`" (gint : Read / Write) | Font size for label in font info mode.
"`mode`" (GnomeFontPickerMode : Read / Write) | The mode of operation of the font picker.
"`preview-text`" (gchararray : Read / Write) | Preview text shown in the dialog.
"`show-size`" (gboolean : Read / Write) | Show size in font info mode.
"`title`" (gchararray : Read / Write) | The title of the selection dialog box.
"`use-font-in-label`" (gboolean : Read / Write) | Use font in the label in font info mode.

## Signals

### The "font-set" signal

    void        user_function                  (GnomeFontPicker *fontpicker,
                                                gchar *arg1,
                                                gpointer user_data);

`fontpicker` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.