## Font Preview

Font Preview — Full featured font preview widget

## Functions

const gchar * | font_manager_font_preview_mode_to_string ()
const gchar * | font_manager_font_preview_mode_to_translatable_string ()
GtkWidget * | font_manager_font_preview_new ()
void | font_manager_font_preview_set_preview_mode ()
void | font_manager_font_preview_set_preview_size ()
void | font_manager_font_preview_set_font_description ()
void | font_manager_font_preview_set_preview_text ()
void | font_manager_font_preview_set_justification ()
void | font_manager_font_preview_set_sample_strings ()
void | font_manager_font_preview_set_waterfall_size ()
gdouble | font_manager_font_preview_get_preview_size ()
gchar * | font_manager_font_preview_get_font_description ()
gchar * | font_manager_font_preview_get_preview_text ()
GtkJustification | font_manager_font_preview_get_justification ()
FontManagerFontPreviewMode | font_manager_font_preview_get_preview_mode ()

## Properties

char * | font-description | Read / Write
GtkJustification | justification | Read / Write
double | max-waterfall-size | Read / Write
double | min-waterfall-size | Read / Write
FontManagerFontPreviewMode | preview-mode | Read / Write
double | preview-size | Read / Write
char * | preview-text | Read / Write
GHashTable * | samples | Read / Write
gboolean | show-line-size | Read / Write
double | waterfall-size-ratio | Read / Write

## Types and Values

#define | FONT_MANAGER_TYPE_FONT_PREVIEW
enum | FontManagerFontPreviewMode
#define | FONT_MANAGER_TYPE_FONT_PREVIEW_MODE
| FontManagerFontPreview

## Object Hierarchy

        GEnum
        ╰── FontManagerFontPreviewMode
        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── FontManagerFontPreview

## Implemented Interfaces

FontManagerFontPreview implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

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

## Description

This widget allows previewing of font files in various ways.

## Functions

### font_manager_font_preview_mode_to_string ()

    const gchar *
    font_manager_font_preview_mode_to_string
                                   (FontManagerFontPreviewMode mode);

#### Parameters

mode | FontManagerFontPreviewMode |

#### Returns

`mode` as a string.

[transfer none][nullable]

### font_manager_font_preview_mode_to_translatable_string ()

    const gchar *
    font_manager_font_preview_mode_to_translatable_string
                                   (FontManagerFontPreviewMode mode);

#### Parameters

mode | FontManagerFontPreviewMode |

#### Returns

`mode` as a localized string, if available.

[transfer none][nullable]

### font_manager_font_preview_new ()

    GtkWidget *
    font_manager_font_preview_new (void);

#### Returns

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

### font_manager_font_preview_set_preview_mode ()

    void
    font_manager_font_preview_set_preview_mode
                                   (FontManagerFontPreview *self,
                                    FontManagerFontPreviewMode mode);

#### Parameters

self | FontManagerFontPreview |
mode | Preview mode. |

### font_manager_font_preview_set_preview_size ()

    void
    font_manager_font_preview_set_preview_size
                                   (FontManagerFontPreview *self,
                                    gdouble size_points);

#### Parameters

self | FontManagerFontPreview |
size_points | Preview text size. |

### font_manager_font_preview_set_font_description ()

    void
    font_manager_font_preview_set_font_description
                                   (FontManagerFontPreview *self,
                                    const gchar *font);

See ``pango_font_description_from_string()`` for details on what constitutes a valid font description string.

#### Parameters

self | FontManagerFontPreview |
font | string representation of a font description. | [nullable]

### font_manager_font_preview_set_preview_text ()

    void
    font_manager_font_preview_set_preview_text
                                   (FontManagerFontPreview *self,
                                    const gchar *preview_text);

#### Parameters

self | FontManagerFontPreview |
preview_text | Preview text. |

### font_manager_font_preview_set_justification ()

    void
    font_manager_font_preview_set_justification
                                   (FontManagerFontPreview *self,
                                    GtkJustification justification);

Set preview text justification.

#### Parameters

self | FontManagerFontPreview |
justification | GtkJustification |

### font_manager_font_preview_set_sample_strings ()

    void
    font_manager_font_preview_set_sample_strings
                                   (FontManagerFontPreview *self,
                                    GHashTable *samples);

`samples` is expected to have a dictionary like structure, with the font description as key and sample string as value.

#### Parameters

self | FontManagerFontPreview |
samples | JsonObject containing sample strings |

### font_manager_font_preview_set_waterfall_size ()

    void
    font_manager_font_preview_set_waterfall_size
                                   (FontManagerFontPreview *self,
                                    gdouble min_size,
                                    gdouble max_size,
                                    gdouble ratio);

#### Parameters

self | FontManagerFontPreview |
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_font_preview_get_preview_size ()

    gdouble
    font_manager_font_preview_get_preview_size
                                   (FontManagerFontPreview *self);

#### Parameters

self | FontManagerFontPreview |

#### Returns

Current preview size.

### font_manager_font_preview_get_font_description ()

    gchar *
    font_manager_font_preview_get_font_description
                                   (FontManagerFontPreview *self);

#### Parameters

self | FontManagerFontPreview |

#### Returns

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

[transfer full][nullable]

### font_manager_font_preview_get_preview_text ()

    gchar *
    font_manager_font_preview_get_preview_text
                                   (FontManagerFontPreview *self);

#### Parameters

self | FontManagerFontPreview |

#### Returns

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

[transfer full][nullable]

### font_manager_font_preview_get_justification ()

    GtkJustification
    font_manager_font_preview_get_justification
                                   (FontManagerFontPreview *self);

#### Parameters

self | FontManagerFontPreview |

#### Returns

Current preview text justification.

### font_manager_font_preview_get_preview_mode ()

    FontManagerFontPreviewMode
    font_manager_font_preview_get_preview_mode
                                   (FontManagerFontPreview *self);

#### Parameters

self | FontManagerFontPreview |

#### Returns

Current preview mode.

## Types and Values

### FONT_MANAGER_TYPE_FONT_PREVIEW

    #define FONT_MANAGER_TYPE_FONT_PREVIEW (font_manager_font_preview_get_type())

### enum FontManagerFontPreviewMode

#### Members

FONT_MANAGER_FONT_PREVIEW_MODE_PREVIEW | Interactive preview |
FONT_MANAGER_FONT_PREVIEW_MODE_WATERFALL | Waterfall preview |
FONT_MANAGER_FONT_PREVIEW_MODE_LOREM_IPSUM | Body text preview |

### FONT_MANAGER_TYPE_FONT_PREVIEW_MODE

    #define FONT_MANAGER_TYPE_FONT_PREVIEW_MODE (font_manager_font_preview_mode_get_type())

### FontManagerFontPreview

    typedef struct _FontManagerFontPreview FontManagerFontPreview;

## Property Details

### The `“font-description”` property

      “font-description”         char *

Current font dsescription as a string.

Owner: FontManagerFontPreview

Flags: Read / Write

Default value: "Sans"

### The `“justification”` property

      “justification”            GtkJustification

Preview text justification.

Owner: FontManagerFontPreview

Flags: Read / Write

Default value: GTK_JUSTIFY_CENTER

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

      “max-waterfall-size”       double

The current maximum waterfall preview size.

Owner: FontManagerFontPreview

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: FontManagerFontPreview

Flags: Read / Write

Allowed values: [6,48]

Default value: 6

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

      “preview-mode”             FontManagerFontPreviewMode

The current font preview mode.

Owner: FontManagerFontPreview

Flags: Read / Write

Default value: FONT_MANAGER_FONT_PREVIEW_MODE_WATERFALL

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

      “preview-size”             double

The current font preview size.

Owner: FontManagerFontPreview

Flags: Read / Write

Allowed values: [6,96]

Default value: 10

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

      “preview-text”             char *

Current preview text.

Owner: FontManagerFontPreview

Flags: Read / Write

Default value: NULL

### The `“samples”` property

      “samples”                  GHashTable *

Dictionary of sample strings.

Owner: FontManagerFontPreview

Flags: Read / Write

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

      “show-line-size”           gboolean

Whether to display line size in Waterfall preview or not.

Owner: FontManagerFontPreview

Flags: Read / Write

Default value: TRUE

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

      “waterfall-size-ratio”     double

Waterfall point size common ratio.

Owner: FontManagerFontPreview

Flags: Read / Write

Allowed values: [1,24]

Default value: 1.1