## FreeType Utility Functions

FreeType Utility Functions — FreeType utilty functions

## Functions

GQuark | font_manager_freetype_error_quark ()
const gchar * | font_manager_fsType_to_string ()
glong | font_manager_get_face_count ()
JsonObject * | font_manager_get_metadata ()
gchar * | font_manager_get_suggested_filename ()
GFile * | font_manager_get_installation_target ()

## Types and Values

#define | FONT_MANAGER_FREETYPE_ERROR
enum | FontManagerFreetypeError
#define | FONT_MANAGER_TYPE_FSTYPE

## Object Hierarchy

        GEnum
        ╰── FontManagerfsType

## Includes

    #include <font-manager-freetype.h>

## Description

Functions used to gather information from font files using the FreeType library.

## Functions

### font_manager_freetype_error_quark ()

    GQuark
    font_manager_freetype_error_quark ();

### font_manager_fsType_to_string ()

    const gchar *
    font_manager_fsType_to_string (FontManagerfsType fstype);

Returns a description of the fsType field suitable for display.

[skip]

#### Parameters

fstype | FontManagerfsType |

#### Returns

`fstype` as a string.

[transfer none][nullable]

### font_manager_get_face_count ()

    glong
    font_manager_get_face_count (const gchar *filepath);

This function never fails. In case of an error this function returns 1. Any valid font file should contain at least one variation.

#### Parameters

filepath | full path to font file to examine |

#### Returns

the number of variations contained in filepath

### font_manager_get_metadata ()

    JsonObject *
    font_manager_get_metadata (const gchar *filepath,
                               gint index,
                               GError **error);

See FontManagerFontInfo for a description of the JsonObject returned by this function.

#### Parameters

filepath | full path to font file to examine |
index | face index to examine |
error | GError or `NULL` to ignore errors |

#### Returns

A newly created JsonObject or `NULL` if there was an error. Free the returned object using json_object_unref when no longer needed.

[transfer full][nullable]

### font_manager_get_suggested_filename ()

    gchar *
    font_manager_get_suggested_filename (JsonObject *metadata);

#### Parameters

metadata | JsonObject returned by `font_manager_get_metadata()` |

#### Returns

A newly allocated string. Free the result using g_free.

[transfer full]

### font_manager_get_installation_target ()

    GFile *
    font_manager_get_installation_target (GFile *font_file,
                                          GFile *target_dir,
                                          gboolean create_directories,
                                          GError **error);

The GFile returned by this function is the suggested output file based on the metadata present in `font_file` .

If `create_directories` is `FALSE` the parent directory for the returned GFile may not exist and should be created prior to use.

#### Parameters

font_file | GFile |
target_dir | GFile |
create_directories | whether to create suggested directories or not |
error | GError or `NULL` to ignore errors |

#### Returns

A newly-created GFile or `NULL` if there was an error. Free the returned object using ``g_object_unref()``.

[transfer full][nullable]

## Types and Values

### FONT_MANAGER_FREETYPE_ERROR

    #define FONT_MANAGER_FREETYPE_ERROR font_manager_freetype_error_quark()

### enum FontManagerFreetypeError

#### Members

FONT_MANAGER_FREETYPE_ERROR_FAILED | Call to Freetype library failed |

### FONT_MANAGER_TYPE_FSTYPE

    #define FONT_MANAGER_TYPE_FSTYPE (font_manager_fsType_get_type ())

## See Also

FontManagerFontInfo