## Preview Page

Preview Page — Full featured font preview widget

## Functions

const gchar * | font_manager_preview_page_mode_to_string ()
const gchar * | font_manager_preview_page_mode_to_translatable_string ()
GtkWidget * | font_manager_preview_page_new ()
GtkWidget * | font_manager_preview_page_get_action_widget ()
FontManagerFont * | font_manager_preview_page_get_font ()
GtkJustification | font_manager_preview_page_get_justification ()
FontManagerPreviewPageMode | font_manager_preview_page_get_preview_mode ()
gdouble | font_manager_preview_page_get_preview_size ()
gchar * | font_manager_preview_page_get_preview_text ()
void | font_manager_preview_page_set_font ()
void | font_manager_preview_page_set_justification ()
void | font_manager_preview_page_set_preview_mode ()
void | font_manager_preview_page_set_preview_size ()
void | font_manager_preview_page_set_preview_text ()
void | font_manager_preview_page_set_waterfall_size ()
void | font_manager_preview_page_restore_state ()
void | font_manager_set_preview_page_mode_menu_and_actions ()

## Properties

FontManagerFont * | font | Read / Write
GtkJustification | justification | Read / Write
int | line-spacing | Read / Write
double | max-waterfall-size | Read / Write
double | min-waterfall-size | Read / Write
FontManagerPreviewPageMode | preview-mode | Read / Write
double | preview-size | Read / Write
char * | preview-text | Read / Write
gboolean | show-line-size | Read / Write
double | waterfall-size-ratio | Read / Write

## Types and Values

#define | FONT_MANAGER_TYPE_PREVIEW_PAGE
enum | FontManagerPreviewPageMode
#define | FONT_MANAGER_TYPE_PREVIEW_PAGE_MODE
| FontManagerPreviewPage

## Object Hierarchy

        GEnum
        ╰── FontManagerPreviewPageMode
        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkBox
                    ╰── FontManagerPreviewPage

## Implemented Interfaces

FontManagerPreviewPage implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkOrientable.

## Includes

    #include <font-manager-preview-page.h>

## Description

This widget has three modes to allow previewing font files in various ways.

The first mode provides an "active" preview where the user can edit the displayed text, set the size and justification. The second mode displays a standard "waterfall" preview of the selected font and the third mode displays several paragraphs of "Lorem Ipsum" text.

## Functions

### font_manager_preview_page_mode_to_string ()

    const gchar *
    font_manager_preview_page_mode_to_string
                                   (FontManagerPreviewPageMode mode);

#### Parameters

mode | FontManagerPreviewPageMode |

#### Returns

`mode` as a string.

[transfer none][nullable]

### font_manager_preview_page_mode_to_translatable_string ()

    const gchar *
    font_manager_preview_page_mode_to_translatable_string
                                   (FontManagerPreviewPageMode mode);

#### Parameters

mode | FontManagerPreviewPageMode |

#### Returns

`mode` as a localized string, if available.

[transfer none][nullable]

### font_manager_preview_page_new ()

    GtkWidget *
    font_manager_preview_page_new (void);

#### Returns

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

### font_manager_preview_page_get_action_widget ()

    GtkWidget *
    font_manager_preview_page_get_action_widget
                                   (FontManagerPreviewPage *self);

#### Parameters

self | FontManagerPreviewPage |

#### Returns

A GtkMenuButton which provides controls for preview mode. Free the returned object using ``g_object_unref()``.

[transfer full][nullable]

### font_manager_preview_page_get_font ()

    FontManagerFont *
    font_manager_preview_page_get_font (FontManagerPreviewPage *self);

#### Parameters

self | FontManagerPreviewPage |

#### Returns

FontManagerFont which is owned by the instance and must not be modified or freed.

[transfer none][nullable]

### font_manager_preview_page_get_justification ()

    GtkJustification
    font_manager_preview_page_get_justification
                                   (FontManagerPreviewPage *self);

#### Parameters

self | FontManagerPreviewPage |

#### Returns

Current preview text justification.

### font_manager_preview_page_get_preview_mode ()

    FontManagerPreviewPageMode
    font_manager_preview_page_get_preview_mode
                                   (FontManagerPreviewPage *self);

#### Parameters

self | FontManagerPreviewPage |

#### Returns

Current preview mode.

### font_manager_preview_page_get_preview_size ()

    gdouble
    font_manager_preview_page_get_preview_size
                                   (FontManagerPreviewPage *self);

#### Parameters

self | FontManagerPreviewPage |

#### Returns

Current preview size.

### font_manager_preview_page_get_preview_text ()

    gchar *
    font_manager_preview_page_get_preview_text
                                   (FontManagerPreviewPage *self);

#### Parameters

self | FontManagerPreviewPage |

#### Returns

A newly allocated string that must be freed with g_free or `NULL`.

[transfer full][nullable]

### font_manager_preview_page_set_font ()

    void
    font_manager_preview_page_set_font (FontManagerPreviewPage *self,
                                        FontManagerFont *font);

#### Parameters

self | FontManagerPreviewPage |
font | FontManagerFont |

### font_manager_preview_page_set_justification ()

    void
    font_manager_preview_page_set_justification
                                   (FontManagerPreviewPage *self,
                                    GtkJustification justification);

Set preview text justification.

#### Parameters

self | FontManagerPreviewPage |
justification | GtkJustification |

### font_manager_preview_page_set_preview_mode ()

    void
    font_manager_preview_page_set_preview_mode
                                   (FontManagerPreviewPage *self,
                                    FontManagerPreviewPageMode mode);

#### Parameters

self | FontManagerPreviewPage |
mode | Preview mode. |

### font_manager_preview_page_set_preview_size ()

    void
    font_manager_preview_page_set_preview_size
                                   (FontManagerPreviewPage *self,
                                    gdouble size_points);

#### Parameters

self | FontManagerPreviewPage |
size_points | Preview text size. |

### font_manager_preview_page_set_preview_text ()

    void
    font_manager_preview_page_set_preview_text
                                   (FontManagerPreviewPage *self,
                                    const gchar *preview_text);

#### Parameters

self | FontManagerPreviewPage |
preview_text | Preview text. |

### font_manager_preview_page_set_waterfall_size ()

    void
    font_manager_preview_page_set_waterfall_size
                                   (FontManagerPreviewPage *self,
                                    gdouble min_size,
                                    gdouble max_size,
                                    gdouble ratio);

#### Parameters

self | FontManagerPreviewPage |
min_size | Minimum point size to use for waterfall previews. (-1.0 to keep current) |
max_size | Maximum size to use for waterfall previews. (-1.0 to keep current) |
ratio | Waterfall point size common ratio. (-1.0 to keep current) |

### font_manager_preview_page_restore_state ()

    void
    font_manager_preview_page_restore_state
                                   (FontManagerPreviewPage *self,
                                    GSettings *settings);

Applies the values in `settings` to `self` and also binds those settings to their respective properties so that they are updated when any changes take place.

The following keys MUST be present in `settings` :

- preview-font-size

- preview-mode

- preview-text

- show-line-size

- min-waterfall-size

- max-waterfall-size

- waterfall-size-ratio

- waterfall-line-spacing

#### Parameters

self | FontManagerPreviewPage |
settings | GSettings |

### font_manager_set_preview_page_mode_menu_and_actions ()

    void
    font_manager_set_preview_page_mode_menu_and_actions
                                   (GtkWidget *parent,
                                    GtkWidget *menu_button,
                                    GCallback callback);

#### Parameters

parent | GtkWidget |
menu_button | GtkMenuButton |
callback | (scope forever) : GCallback for action "activate" signal |

## Types and Values

### FONT_MANAGER_TYPE_PREVIEW_PAGE

    #define FONT_MANAGER_TYPE_PREVIEW_PAGE (font_manager_preview_page_get_type())

### enum FontManagerPreviewPageMode

#### Members

FONT_MANAGER_PREVIEW_PAGE_MODE_PREVIEW | Interactive preview |
FONT_MANAGER_PREVIEW_PAGE_MODE_WATERFALL | Waterfall preview |
FONT_MANAGER_PREVIEW_PAGE_MODE_LOREM_IPSUM | Body text preview |

### FONT_MANAGER_TYPE_PREVIEW_PAGE_MODE

    #define FONT_MANAGER_TYPE_PREVIEW_PAGE_MODE (font_manager_preview_page_mode_get_type())

### FontManagerPreviewPage

    typedef struct _FontManagerPreviewPage FontManagerPreviewPage;

## Property Details

### The `“font”` property

      “font”                     FontManagerFont *

FontManagerFont

Owner: FontManagerPreviewPage

Flags: Read / Write

### The `“justification”` property

      “justification”            GtkJustification

Preview text justification.

Owner: FontManagerPreviewPage

Flags: Read / Write

Default value: GTK_JUSTIFY_CENTER

### The `“line-spacing”` property

      “line-spacing”             int

Pixels between lines in Waterfall preview.

Owner: FontManagerPreviewPage

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“max-waterfall-size”` property

      “max-waterfall-size”       double

The current maximum waterfall preview size.

Owner: FontManagerPreviewPage

Flags: Read / Write

Allowed values: [6,192]

Default value: 48

### The `“min-waterfall-size”` property

      “min-waterfall-size”       double

The current minimum waterfall preview size.

Owner: FontManagerPreviewPage

Flags: Read / Write

Allowed values: [6,48]

Default value: 6

### The `“preview-mode”` property

      “preview-mode”             FontManagerPreviewPageMode

The current font preview mode.

Owner: FontManagerPreviewPage

Flags: Read / Write

Default value: FONT_MANAGER_PREVIEW_PAGE_MODE_WATERFALL

### The `“preview-size”` property

      “preview-size”             double

The current font preview size.

Owner: FontManagerPreviewPage

Flags: Read / Write

Allowed values: [6,96]

Default value: 10

### The `“preview-text”` property

      “preview-text”             char *

Current preview text.

Owner: FontManagerPreviewPage

Flags: Read / Write

Default value: NULL

### The `“show-line-size”` property

      “show-line-size”           gboolean

Whether to display line size in Waterfall preview or not.

Owner: FontManagerPreviewPage

Flags: Read / Write

Default value: TRUE

### The `“waterfall-size-ratio”` property

      “waterfall-size-ratio”     double

Waterfall point size common ratio.

Owner: FontManagerPreviewPage

Flags: Read / Write

Allowed values: [1,24]

Default value: 1.1