Functions
hb_font_add_glyph_origin_for_direction ()
void
hb_font_add_glyph_origin_for_direction
(hb_font_t *font
,
hb_codepoint_t glyph
,
hb_direction_t direction
,
hb_position_t *x
,
hb_position_t *y
);
Adds the origin coordinates to an (X,Y) point coordinate, in
the specified glyph ID in the specified font.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 0.9.2
hb_font_create ()
hb_font_t *
hb_font_create (hb_face_t *face
);
Constructs a new font object from the specified face.
[Xconstructor]
Returns
The new font object.
[transfer full]
Since: 0.9.2
hb_font_create_sub_font ()
hb_font_t *
hb_font_create_sub_font (hb_font_t *parent
);
Constructs a sub-font font object from the specified parent
font,
replicating the parent's properties.
Returns
The new sub-font font object.
[transfer full]
Since: 0.9.2
hb_font_destroy ()
void
hb_font_destroy (hb_font_t *font
);
Decreases the reference count on the given font object. When the
reference count reaches zero, the font is destroyed,
freeing all memory.
[skip]
Since: 0.9.2
hb_font_funcs_create ()
hb_font_funcs_t *
hb_font_funcs_create (void
);
Creates a new hb_font_funcs_t structure of font functions.
[Xconstructor]
Returns
The font-functions structure.
[transfer full]
Since: 0.9.2
hb_font_funcs_destroy ()
void
hb_font_funcs_destroy (hb_font_funcs_t *ffuncs
);
Decreases the reference count on a font-functions structure. When
the reference count reaches zero, the font-functions structure is
destroyed, freeing all memory.
[skip]
Since: 0.9.2
hb_font_funcs_get_empty ()
hb_font_funcs_t *
hb_font_funcs_get_empty (void
);
Fetches an empty font-functions structure.
Returns
The font-functions structure.
[transfer full]
Since: 0.9.2
hb_font_funcs_get_user_data ()
void *
hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs
,
hb_user_data_key_t *key
);
Fetches the user data associated with the specified key,
attached to the specified font-functions structure.
[skip]
Returns
A pointer to the user data.
[transfer none]
Since: 0.9.2
hb_font_funcs_is_immutable ()
hb_bool_t
hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs
);
Tests whether a font-functions structure is immutable.
Returns
true
if ffuncs
is immutable, false otherwise
Since: 0.9.2
hb_font_funcs_make_immutable ()
void
hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs
);
Makes a font-functions structure immutable.
Since: 0.9.2
hb_font_funcs_reference ()
hb_font_funcs_t *
hb_font_funcs_reference (hb_font_funcs_t *ffuncs
);
Increases the reference count on a font-functions structure.
[skip]
Returns
The font-functions structure
Since: 0.9.2
hb_font_get_empty ()
hb_font_t *
hb_font_get_empty (void
);
Fetches the empty font object.
Returns
The empty font object.
[transfer full]
Since: 0.9.2
hb_font_get_face ()
hb_face_t *
hb_font_get_face (hb_font_t *font
);
Fetches the face associated with the specified font object.
Since: 0.9.2
hb_font_get_glyph_advance_for_direction ()
void
hb_font_get_glyph_advance_for_direction
(hb_font_t *font
,
hb_codepoint_t glyph
,
hb_direction_t direction
,
hb_position_t *x
,
hb_position_t *y
);
Fetches the advance for a glyph ID from the specified font,
in a text segment of the specified direction.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 0.9.2
hb_font_get_glyph_advances_for_direction ()
void
hb_font_get_glyph_advances_for_direction
(hb_font_t *font
,
hb_direction_t direction
,
unsigned int count
,
const hb_codepoint_t *first_glyph
,
unsigned glyph_stride
,
hb_position_t *first_advance
,
unsigned advance_stride
);
Fetches the advances for a sequence of glyph IDs in the specified
font, in a text segment of the specified direction.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 1.8.6
hb_font_get_glyph_advances_func_t ()
void
(*hb_font_get_glyph_advances_func_t) (hb_font_t *font
,
void *font_data
,
unsigned int count
,
const hb_codepoint_t *first_glyph
,
unsigned glyph_stride
,
hb_position_t *first_advance
,
unsigned advance_stride
,
void *user_data
);
A virtual method for the hb_font_funcs_t of an hb_font_t object.
This method should retrieve the advances for a sequence of glyphs.
hb_font_get_glyph_contour_point ()
hb_bool_t
hb_font_get_glyph_contour_point (hb_font_t *font
,
hb_codepoint_t glyph
,
unsigned int point_index
,
hb_position_t *x
,
hb_position_t *y
);
Fetches the (x,y) coordinates of a specified contour-point index
in the specified glyph, within the specified font.
Returns
true
if data found, false otherwise
Since: 0.9.2
hb_font_get_glyph_contour_point_for_origin ()
hb_bool_t
hb_font_get_glyph_contour_point_for_origin
(hb_font_t *font
,
hb_codepoint_t glyph
,
unsigned int point_index
,
hb_direction_t direction
,
hb_position_t *x
,
hb_position_t *y
);
Fetches the (X,Y) coordinates of a specified contour-point index
in the specified glyph ID in the specified font, with respect
to the origin in a text segment in the specified direction.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Returns
true
if data found, false otherwise
Since: 0.9.2
hb_font_get_glyph_extents_for_origin ()
hb_bool_t
hb_font_get_glyph_extents_for_origin (hb_font_t *font
,
hb_codepoint_t glyph
,
hb_direction_t direction
,
hb_glyph_extents_t *extents
);
Fetches the hb_glyph_extents_t data for a glyph ID
in the specified font, with respect to the origin in
a text segment in the specified direction.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Returns
true
if data found, false otherwise
Since: 0.9.2
hb_font_get_glyph_extents_func_t ()
hb_bool_t
(*hb_font_get_glyph_extents_func_t) (hb_font_t *font
,
void *font_data
,
hb_codepoint_t glyph
,
hb_glyph_extents_t *extents
,
void *user_data
);
A virtual method for the hb_font_funcs_t of an hb_font_t object.
This method should retrieve the extents for a specified glyph. Extents must be
returned in an hb_glyph_extents output parameter.
hb_font_get_glyph_from_name ()
hb_bool_t
hb_font_get_glyph_from_name (hb_font_t *font
,
const char *name
,
int len
,
hb_codepoint_t *glyph
);
Fetches the glyph ID that corresponds to a name string in the specified font
.
Note: len
== -1 means the name string is null-terminated.
Returns
true
if data found, false otherwise
Since: 0.9.2
hb_font_get_glyph_from_name_func_t ()
hb_bool_t
(*hb_font_get_glyph_from_name_func_t) (hb_font_t *font
,
void *font_data
,
const char *name
,
int len
,
hb_codepoint_t *glyph
,
void *user_data
);
A virtual method for the hb_font_funcs_t of an hb_font_t object.
This method should retrieve the glyph ID that corresponds to a glyph-name
string.
hb_font_get_glyph_h_advance ()
hb_position_t
hb_font_get_glyph_h_advance (hb_font_t *font
,
hb_codepoint_t glyph
);
Fetches the advance for a glyph ID in the specified font,
for horizontal text segments.
Returns
The advance of glyph
within font
Since: 0.9.2
hb_font_get_glyph_h_advances ()
void
hb_font_get_glyph_h_advances (hb_font_t *font
,
unsigned int count
,
const hb_codepoint_t *first_glyph
,
unsigned glyph_stride
,
hb_position_t *first_advance
,
unsigned advance_stride
);
Fetches the advances for a sequence of glyph IDs in the specified
font, for horizontal text segments.
Since: 1.8.6
hb_font_get_glyph_h_kerning ()
hb_position_t
hb_font_get_glyph_h_kerning (hb_font_t *font
,
hb_codepoint_t left_glyph
,
hb_codepoint_t right_glyph
);
Fetches the kerning-adjustment value for a glyph-pair in
the specified font, in horizontal text segments.
It handles legacy kerning only (as returned by the corresponding
hb_font_funcs_t function).
Returns
The kerning adjustment value
Since: 0.9.2
hb_font_get_glyph_kerning_for_direction ()
void
hb_font_get_glyph_kerning_for_direction
(hb_font_t *font
,
hb_codepoint_t first_glyph
,
hb_codepoint_t second_glyph
,
hb_direction_t direction
,
hb_position_t *x
,
hb_position_t *y
);
Fetches the kerning-adjustment value for a glyph-pair in the specified font.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 0.9.2
hb_font_get_glyph_name ()
hb_bool_t
hb_font_get_glyph_name (hb_font_t *font
,
hb_codepoint_t glyph
,
char *name
,
unsigned int size
);
Fetches the glyph-name string for a glyph ID in the specified font
.
Returns
true
if data found, zero otherwise
Since: 0.9.2
hb_font_get_glyph_name_func_t ()
hb_bool_t
(*hb_font_get_glyph_name_func_t) (hb_font_t *font
,
void *font_data
,
hb_codepoint_t glyph
,
char *name
,
unsigned int size
,
void *user_data
);
A virtual method for the hb_font_funcs_t of an hb_font_t object.
This method should retrieve the glyph name that corresponds to a
glyph ID. The name should be returned in a string output parameter.
hb_font_get_glyph_origin_for_direction ()
void
hb_font_get_glyph_origin_for_direction
(hb_font_t *font
,
hb_codepoint_t glyph
,
hb_direction_t direction
,
hb_position_t *x
,
hb_position_t *y
);
Fetches the (X,Y) coordinates of the origin for a glyph in
the specified font.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 0.9.2
hb_font_get_glyph_v_advance ()
hb_position_t
hb_font_get_glyph_v_advance (hb_font_t *font
,
hb_codepoint_t glyph
);
Fetches the advance for a glyph ID in the specified font,
for vertical text segments.
Returns
The advance of glyph
within font
Since: 0.9.2
hb_font_get_glyph_v_advances ()
void
hb_font_get_glyph_v_advances (hb_font_t *font
,
unsigned int count
,
const hb_codepoint_t *first_glyph
,
unsigned glyph_stride
,
hb_position_t *first_advance
,
unsigned advance_stride
);
Fetches the advances for a sequence of glyph IDs in the specified
font, for vertical text segments.
Since: 1.8.6
hb_font_get_nominal_glyphs ()
unsigned int
hb_font_get_nominal_glyphs (hb_font_t *font
,
unsigned int count
,
const hb_codepoint_t *first_unicode
,
unsigned int unicode_stride
,
hb_codepoint_t *first_glyph
,
unsigned int glyph_stride
);
Since: 2.6.3
hb_font_get_nominal_glyphs_func_t ()
unsigned int
(*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font
,
void *font_data
,
unsigned int count
,
const hb_codepoint_t *first_unicode
,
unsigned int unicode_stride
,
hb_codepoint_t *first_glyph
,
unsigned int glyph_stride
,
void *user_data
);
A virtual method for the hb_font_funcs_t of an hb_font_t object.
This method should retrieve the nominal glyph IDs for a sequence of
Unicode code points. Glyph IDs must be returned in a hb_codepoint_t
output parameter.
hb_font_get_parent ()
hb_font_t *
hb_font_get_parent (hb_font_t *font
);
Fetches the parent font of font
.
Returns
The parent font object.
[transfer none]
Since: 0.9.2
hb_font_get_ppem ()
void
hb_font_get_ppem (hb_font_t *font
,
unsigned int *x_ppem
,
unsigned int *y_ppem
);
Fetches the horizontal and vertical points-per-em (ppem) of a font.
Since: 0.9.2
hb_font_get_ptem ()
float
hb_font_get_ptem (hb_font_t *font
);
Fetches the "point size" of a font. Used in CoreText to
implement optical sizing.
Returns
Point size. A value of zero means "not set."
Since: 0.9.2
hb_font_get_scale ()
void
hb_font_get_scale (hb_font_t *font
,
int *x_scale
,
int *y_scale
);
Fetches the horizontal and vertical scale of a font.
Since: 0.9.2
hb_font_get_user_data ()
void *
hb_font_get_user_data (hb_font_t *font
,
hb_user_data_key_t *key
);
Fetches the user-data object associated with the specified key,
attached to the specified font object.
[skip]
Returns
Pointer to the user data.
[transfer none]
Since: 0.9.2
hb_font_get_variation_glyph ()
hb_bool_t
hb_font_get_variation_glyph (hb_font_t *font
,
hb_codepoint_t unicode
,
hb_codepoint_t variation_selector
,
hb_codepoint_t *glyph
);
Fetches the glyph ID for a Unicode code point when followed by
by the specified variation-selector code point, in the specified
font.
Returns
true
if data found, false otherwise
Since: 1.2.3
hb_font_get_var_coords_design ()
const float *
hb_font_get_var_coords_design (hb_font_t *font
,
unsigned int *length
);
Return value is valid as long as variation coordinates of the font
are not modified.
Since: EXPERIMENTAL
hb_font_get_var_coords_normalized ()
const int *
hb_font_get_var_coords_normalized (hb_font_t *font
,
unsigned int *length
);
Fetches the list of normalized variation coordinates currently
set on a font.
Return value is valid as long as variation coordinates of the font
are not modified.
Since: 1.4.2
hb_font_glyph_from_string ()
hb_bool_t
hb_font_glyph_from_string (hb_font_t *font
,
const char *s
,
int len
,
hb_codepoint_t *glyph
);
Fetches the glyph ID from font
that matches the specified string.
Strings of the format gidDDD
or uniUUUU
are parsed automatically.
Note: len
== -1 means the string is null-terminated.
Returns
true
if data found, false otherwise
Since: 0.9.2
hb_font_glyph_to_string ()
void
hb_font_glyph_to_string (hb_font_t *font
,
hb_codepoint_t glyph
,
char *s
,
unsigned int size
);
Fetches the name of the specified glyph ID in font
and returns
it in string s
.
If the glyph ID has no name in font
, a string of the form gidDDD
is
generated, with DDD
being the glyph ID.
Since: 0.9.2
hb_font_is_immutable ()
hb_bool_t
hb_font_is_immutable (hb_font_t *font
);
Tests whether a font object is immutable.
Returns
true
if font
is immutable, false otherwise
Since: 0.9.2
hb_font_make_immutable ()
void
hb_font_make_immutable (hb_font_t *font
);
Makes font
immutable.
Since: 0.9.2
hb_font_reference ()
hb_font_t *
hb_font_reference (hb_font_t *font
);
Increases the reference count on the given font object.
[skip]
Returns
The font
object.
[transfer full]
Since: 0.9.2
hb_font_set_face ()
void
hb_font_set_face (hb_font_t *font
,
hb_face_t *face
);
Sets face
as the font-face value of font
.
Since: 1.4.3
hb_font_set_funcs ()
void
hb_font_set_funcs (hb_font_t *font
,
hb_font_funcs_t *klass
,
void *font_data
,
hb_destroy_func_t destroy
);
Replaces the font-functions structure attached to a font, updating
the font's user-data with font
-data and the destroy
callback.
Since: 0.9.2
hb_font_set_funcs_data ()
void
hb_font_set_funcs_data (hb_font_t *font
,
void *font_data
,
hb_destroy_func_t destroy
);
Replaces the user data attached to a font, updating the font's
destroy
callback.
Since: 0.9.2
hb_font_set_parent ()
void
hb_font_set_parent (hb_font_t *font
,
hb_font_t *parent
);
Sets the parent font of font
.
Since: 1.0.5
hb_font_set_ppem ()
void
hb_font_set_ppem (hb_font_t *font
,
unsigned int x_ppem
,
unsigned int y_ppem
);
Sets the horizontal and vertical pixels-per-em (ppem) of a font.
Since: 0.9.2
hb_font_set_ptem ()
void
hb_font_set_ptem (hb_font_t *font
,
float ptem
);
Sets the "point size" of a font. Set to zero to unset.
Used in CoreText to implement optical sizing.
Note: There are 72 points in an inch.
Since: 1.6.0
hb_font_set_scale ()
void
hb_font_set_scale (hb_font_t *font
,
int x_scale
,
int y_scale
);
Sets the horizontal and vertical scale of a font.
Since: 0.9.2
hb_font_set_variations ()
void
hb_font_set_variations (hb_font_t *font
,
const hb_variation_t *variations
,
unsigned int variations_length
);
Applies a list of font-variation settings to a font.
Since: 1.4.2
hb_font_set_var_coords_design ()
void
hb_font_set_var_coords_design (hb_font_t *font
,
const float *coords
,
unsigned int coords_length
);
Applies a list of variation coordinates (in design-space units)
to a font.
Since: 1.4.2
hb_font_set_var_coords_normalized ()
void
hb_font_set_var_coords_normalized (hb_font_t *font
,
const int *coords
,
unsigned int coords_length
);
Applies a list of variation coordinates (in normalized units)
to a font.
Note: Coordinates should be normalized to 2.14.
Since: 1.4.2
hb_font_set_var_named_instance ()
void
hb_font_set_var_named_instance (hb_font_t *font
,
unsigned instance_index
);
Sets design coords of a font from a named instance index.
Since: 2.6.0
hb_font_subtract_glyph_origin_for_direction ()
void
hb_font_subtract_glyph_origin_for_direction
(hb_font_t *font
,
hb_codepoint_t glyph
,
hb_direction_t direction
,
hb_position_t *x
,
hb_position_t *y
);
Subtracts the origin coordinates from an (X,Y) point coordinate,
in the specified glyph ID in the specified font.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 0.9.2
hb_font_get_extents_for_direction ()
void
hb_font_get_extents_for_direction (hb_font_t *font
,
hb_direction_t direction
,
hb_font_extents_t *extents
);
Fetches the extents for a font in a text segment of the
specified direction.
Calls the appropriate direction-specific variant (horizontal
or vertical) depending on the value of direction
.
Since: 1.1.3
hb_font_get_h_extents ()
hb_bool_t
hb_font_get_h_extents (hb_font_t *font
,
hb_font_extents_t *extents
);
Fetches the extents for a specified font, in horizontal
text segments.
Returns
true
if data found, false otherwise
Since: 1.1.3
hb_font_get_v_extents ()
hb_bool_t
hb_font_get_v_extents (hb_font_t *font
,
hb_font_extents_t *extents
);
Fetches the extents for a specified font, in vertical
text segments.
Returns
true
if data found, false otherwise
Since: 1.1.3