## Gtk utility functions

Gtk utility functions — Gtk related utility functions

## Functions

void | font_manager_set_application_style ()
void | font_manager_clear_pango_cache ()
void | font_manager_widget_set_align ()
void | font_manager_widget_set_expand ()
void | font_manager_widget_set_margin ()
void | font_manager_widget_set_name ()
void | font_manager_widget_dispose ()
gchar * | font_manager_get_localized_pangram ()
gchar * | font_manager_get_localized_preview_text ()
GtkTextTagTable * | font_manager_text_tag_table_new ()
GtkShortcut * | font_manager_get_shortcut_for_stateful_action ()

## Types and Values

#define | FONT_MANAGER_BUS_ID
#define | FONT_MANAGER_BUS_PATH
#define | FONT_MANAGER_FONT_VIEWER_BUS_ID
#define | FONT_MANAGER_FONT_VIEWER_BUS_PATH
#define | FONT_MANAGER_STYLE_CLASS_COLOR
#define | FONT_MANAGER_STYLE_CLASS_FLAT
#define | FONT_MANAGER_STYLE_CLASS_VIEW
#define | FONT_MANAGER_STYLE_CLASS_DIM_LABEL
#define | FONT_MANAGER_STYLE_CLASS_BACKGROUND
#define | FONT_MANAGER_STYLE_CLASS_SIDEBAR
#define | FONT_MANAGER_STYLE_CLASS_SUGGESTED_ACTION
#define | FONT_MANAGER_STYLE_CLASS_DESTRUCTIVE_ACTION
#define | FONT_MANAGER_MIN_MARGIN
#define | FONT_MANAGER_DEFAULT_MARGIN
#define | FONT_MANAGER_DEFAULT_FONT
#define | FONT_MANAGER_MIN_FONT_SIZE
#define | FONT_MANAGER_MAX_FONT_SIZE
#define | FONT_MANAGER_DEFAULT_PREVIEW_SIZE
#define | FONT_MANAGER_LARGE_PREVIEW_SIZE
#define | FONT_MANAGER_DEFAULT_PREVIEW_TEXT
#define | FONT_MANAGER_LOREM_IPSUM

## Includes

    #include <font-manager-gtk-utils.h>

## Description

## Functions

### font_manager_set_application_style ()

    void
    font_manager_set_application_style (void);

Load application specific CSS and icons.

### font_manager_clear_pango_cache ()

    void
    font_manager_clear_pango_cache (PangoContext *ctx);

Forces Pango to update the cached font configuration.

Required to render sourced fonts on Pango > 1.47

#### Parameters

ctx | PangoContext |

### font_manager_widget_set_align ()

    void
    font_manager_widget_set_align (GtkWidget *widget,
                                   GtkAlign align);

Set both halign and valign to the same value.

#### Parameters

widget | GtkWidget |
align | GtkAlign |

### font_manager_widget_set_expand ()

    void
    font_manager_widget_set_expand (GtkWidget *widget,
                                    gboolean expand);

Set both hexpand and vexpand to the same value.

#### Parameters

widget | GtkWidget |
expand | gboolean |

### font_manager_widget_set_margin ()

    void
    font_manager_widget_set_margin (GtkWidget *widget,
                                    gint margin);

Set all margin properties to the same value.

#### Parameters

widget | GtkWidget |
margin | gint |

### font_manager_widget_set_name ()

    void
    font_manager_widget_set_name (GtkWidget *widget,
                                  const gchar *name);

Set widget name and css properties to the same value.

#### Parameters

widget | GtkWidget |
name | widget name. | [nullable]

### font_manager_widget_dispose ()

    void
    font_manager_widget_dispose (GtkWidget *widget);

Convenience function which iterates through the children of a GtkWidget, calls ``gtk_widget_unparent()`` on each and sets the pointer to NULL.

#### Parameters

widget | GtkWidget |

### font_manager_get_localized_pangram ()

    gchar *
    font_manager_get_localized_pangram (void);

Retrieve a sample string from Pango for the default language. If Pango does not have a sample string for language, the classic "The quick brown fox..." is returned.

#### Returns

A newly allocated string. Free the result using g_free.

[transfer full]

### font_manager_get_localized_preview_text ()

    gchar *
    font_manager_get_localized_preview_text
                                   (void);

#### Returns

A newly allocated string. Free the result using g_free.

[transfer full]

### font_manager_text_tag_table_new ()

    GtkTextTagTable *
    font_manager_text_tag_table_new (void);

#### Returns

A newly created GtkTextTagTable. Free the returned object using ``g_object_unref()``.

[transfer full]

### font_manager_get_shortcut_for_stateful_action ()

    GtkShortcut *
    font_manager_get_shortcut_for_stateful_action
                                   (const gchar *prefix,
                                    const gchar *name,
                                    const gchar *target,
                                    const gchar *accel);

#### Parameters

prefix | Action prefix i.e. "app", "window", etc. | [nullable]
name | Action name |
target | Action target |
accel | A valid accelerator string as understood by gtk_accelerator_parse. | [nullable]

#### Returns

A newly created GtkShortcut. Free the returned object using g_object_unref.

[transfer full][nullable]

## Types and Values

### FONT_MANAGER_BUS_ID

    #define FONT_MANAGER_BUS_ID "com.github.FontManager.FontManager"

### FONT_MANAGER_BUS_PATH

    #define FONT_MANAGER_BUS_PATH "/com/github/FontManager/FontManager"

### FONT_MANAGER_FONT_VIEWER_BUS_ID

    #define FONT_MANAGER_FONT_VIEWER_BUS_ID "com.github.FontManager.FontViewer"

### FONT_MANAGER_FONT_VIEWER_BUS_PATH

    #define FONT_MANAGER_FONT_VIEWER_BUS_PATH "/com/github/FontManager/FontViewer"

### FONT_MANAGER_STYLE_CLASS_COLOR

    #define FONT_MANAGER_STYLE_CLASS_COLOR "color"

### FONT_MANAGER_STYLE_CLASS_FLAT

    #define FONT_MANAGER_STYLE_CLASS_FLAT "flat"

### FONT_MANAGER_STYLE_CLASS_VIEW

    #define FONT_MANAGER_STYLE_CLASS_VIEW "view"

### FONT_MANAGER_STYLE_CLASS_DIM_LABEL

    #define FONT_MANAGER_STYLE_CLASS_DIM_LABEL "dim-label"

### FONT_MANAGER_STYLE_CLASS_BACKGROUND

    #define FONT_MANAGER_STYLE_CLASS_BACKGROUND "background"

### FONT_MANAGER_STYLE_CLASS_SIDEBAR

    #define FONT_MANAGER_STYLE_CLASS_SIDEBAR "sidebar"

### FONT_MANAGER_STYLE_CLASS_SUGGESTED_ACTION

    #define FONT_MANAGER_STYLE_CLASS_SUGGESTED_ACTION "suggested-action"

### FONT_MANAGER_STYLE_CLASS_DESTRUCTIVE_ACTION

    #define FONT_MANAGER_STYLE_CLASS_DESTRUCTIVE_ACTION "destructive-action"

### FONT_MANAGER_MIN_MARGIN

    #define FONT_MANAGER_MIN_MARGIN 2

### FONT_MANAGER_DEFAULT_MARGIN

    #define FONT_MANAGER_DEFAULT_MARGIN 6

### FONT_MANAGER_DEFAULT_FONT

    #define FONT_MANAGER_DEFAULT_FONT "Sans"

### FONT_MANAGER_MIN_FONT_SIZE

    #define FONT_MANAGER_MIN_FONT_SIZE 6.0

### FONT_MANAGER_MAX_FONT_SIZE

    #define FONT_MANAGER_MAX_FONT_SIZE 96.0

### FONT_MANAGER_DEFAULT_PREVIEW_SIZE

    #define FONT_MANAGER_DEFAULT_PREVIEW_SIZE 10.0

### FONT_MANAGER_LARGE_PREVIEW_SIZE

    #define FONT_MANAGER_LARGE_PREVIEW_SIZE 16.0

### FONT_MANAGER_DEFAULT_PREVIEW_TEXT

    #define             FONT_MANAGER_DEFAULT_PREVIEW_TEXT

### FONT_MANAGER_LOREM_IPSUM

    #define             FONT_MANAGER_LOREM_IPSUM