manpagez: man pages & more
html files: harfbuzz
Home | html | info | man

hb-subset

hb-subset — Subsets font files.

Types and Values

Includes

#include <hb-subset.h>

Description

Subsetting reduces the codepoint coverage of font files and removes all data that is no longer needed. A subset input describes the desired subset. The input is provided along with a font to the subsetting operation. Output is a new font file containing only the data specified in the input.

Currently most outline and bitmap tables are supported: glyf, CFF, CFF2, sbix, COLR, and CBDT/CBLC. This also includes fonts with variable outlines via OpenType variations. Notably EBDT/EBLC and SVG are not supported. Layout subsetting is supported only for OpenType Layout tables (GSUB, GPOS, GDEF). Notably subsetting of graphite or AAT tables is not yet supported.

Fonts with graphite or AAT tables may still be subsetted but will likely need to use the retain glyph ids option and configure the subset to pass through the layout tables untouched.

Functions

hb_subset_input_create_or_fail ()

hb_subset_input_t *
hb_subset_input_create_or_fail (void);

Creates a new subset input object.

Returns

New subset input, or NULL if failed. Destroy with hb_subset_input_destroy().

[transfer full]

Since: 1.8.0


hb_subset_input_reference ()

hb_subset_input_t *
hb_subset_input_reference (hb_subset_input_t *input);

Increases the reference count on input .

[skip]

Parameters

input

a hb_subset_input_t object.

 

Returns

input .

Since: 1.8.0


hb_subset_input_destroy ()

void
hb_subset_input_destroy (hb_subset_input_t *input);

Decreases the reference count on input , and if it reaches zero, destroys input , freeing all memory.

Parameters

input

a hb_subset_input_t object.

 

Since: 1.8.0


hb_subset_input_set_user_data ()

hb_bool_t
hb_subset_input_set_user_data (hb_subset_input_t *input,
                               hb_user_data_key_t *key,
                               void *data,
                               hb_destroy_func_t destroy,
                               hb_bool_t replace);

Attaches a user-data key/data pair to the given subset input object.

[skip]

Parameters

input

a hb_subset_input_t object.

 

key

The user-data key to set

 

data

A pointer to the user data

 

destroy

A callback to call when data is not needed anymore.

[nullable]

replace

Whether to replace an existing data with the same key

 

Returns

true if success, false otherwise

Since: 2.9.0


hb_subset_input_get_user_data ()

void *
hb_subset_input_get_user_data (const hb_subset_input_t *input,
                               hb_user_data_key_t *key);

Fetches the user data associated with the specified key, attached to the specified subset input object.

[skip]

Parameters

input

a hb_subset_input_t object.

 

key

The user-data key to query

 

Returns

A pointer to the user data.

[transfer none]

Since: 2.9.0


hb_subset_input_unicode_set ()

hb_set_t *
hb_subset_input_unicode_set (hb_subset_input_t *input);

Gets the set of Unicode code points to retain, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of Unicode code points.

[transfer none]

Since: 1.8.0


hb_subset_input_glyph_set ()

hb_set_t *
hb_subset_input_glyph_set (hb_subset_input_t *input);

Gets the set of glyph IDs to retain, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of glyph IDs.

[transfer none]

Since: 1.8.0


hb_subset_input_nameid_set ()

hb_set_t *
hb_subset_input_nameid_set (hb_subset_input_t *input);

Gets the set of name table name IDs to retain, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of name IDs.

[transfer none]

Since: 2.9.0


hb_subset_input_namelangid_set ()

hb_set_t *
hb_subset_input_namelangid_set (hb_subset_input_t *input);

Gets the set of name table language IDs to retain, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of language IDs.

[transfer none]

Since: 2.9.0


hb_subset_input_layout_features_set ()

hb_set_t *
hb_subset_input_layout_features_set (hb_subset_input_t *input);

Gets the set of layout feature tags to retain, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of feature tags.

[transfer none]

Since: 2.9.0


hb_subset_input_no_subset_tables_set ()

hb_set_t *
hb_subset_input_no_subset_tables_set (hb_subset_input_t *input);

Gets the set of table tags which specifies tables that should not be subsetted, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of table tags.

[transfer none]

Since: 2.9.0


hb_subset_input_drop_tables_set ()

hb_set_t *
hb_subset_input_drop_tables_set (hb_subset_input_t *input);

Gets the set of table tags to drop, the caller should modify the set as needed.

Parameters

input

a hb_subset_input_t object.

 

Returns

pointer to the hb_set_t of table tags.

[transfer none]

Since: 2.9.0


hb_subset_or_fail ()

hb_face_t *
hb_subset_or_fail (hb_face_t *source,
                   const hb_subset_input_t *input);

Subsets a font according to provided input. Returns nullptr if the subset operation fails.

Parameters

source

font face data to be subset.

 

input

input to use for the subsetting.

 

Since: 2.9.0

Types and Values

hb_subset_input_t

typedef struct hb_subset_input_t hb_subset_input_t;

Things that change based on the input. Characters to keep, etc.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.