Callbacks

  buffer_message_func_t (buffer, font, message, *user_data)
  destroy_func_t (*user_data)
  font_get_font_extents_func_t (font, font_data, extents, *user_data)
  font_get_glyph_advance_func_t (font, font_data, glyph, *user_data)
  font_get_glyph_advances_func_t (font, font_data, count, first_glyph, glyph_stride, first_advance, advance_stride, *user_data)
  font_get_glyph_contour_point_func_t (font, font_data, glyph, point_index, x, y, *user_data)
  font_get_glyph_extents_func_t (font, font_data, glyph, extents, *user_data)
  font_get_glyph_from_name_func_t (font, font_data, name, len, glyph, *user_data)
  font_get_glyph_func_t (font, font_data, unicode, variation_selector, glyph, *user_data)
  font_get_glyph_kerning_func_t (font, font_data, first_glyph, second_glyph, *user_data)
  font_get_glyph_name_func_t (font, font_data, glyph, name, size, *user_data)
  font_get_glyph_origin_func_t (font, font_data, glyph, x, y, *user_data)
  font_get_nominal_glyph_func_t (font, font_data, unicode, glyph, *user_data)
  font_get_nominal_glyphs_func_t (font, font_data, count, first_unicode, unicode_stride, first_glyph, glyph_stride, *user_data)
  font_get_variation_glyph_func_t (font, font_data, unicode, variation_selector, glyph, *user_data)
  reference_table_func_t (face, tag, *user_data)
  unicode_combining_class_func_t (ufuncs, unicode, *user_data)
  unicode_compose_func_t (ufuncs, a, b, *user_data)
  unicode_decompose_compatibility_func_t (ufuncs, u, decomposed, *user_data)
  unicode_decompose_func_t (ufuncs, ab, *user_data)
  unicode_eastasian_width_func_t (ufuncs, unicode, *user_data)
  unicode_general_category_func_t (ufuncs, unicode, *user_data)
  unicode_mirroring_func_t (ufuncs, unicode, *user_data)
  unicode_script_func_t (ufuncs, unicode, *user_data)

Details

HarfBuzz.buffer_message_func_t(buffer, font, message, *user_data)
Parameters:
Return type:

int

HarfBuzz.destroy_func_t(*user_data)
Parameters:user_data (object or None) –
HarfBuzz.font_get_font_extents_func_t(font, font_data, extents, *user_data)
Parameters:
Return type:

int

HarfBuzz.font_get_glyph_advance_func_t(font, font_data, glyph, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the advance for a specified glyph. The method must return an #hb_position_t.

HarfBuzz.font_get_glyph_advances_func_t(font, font_data, count, first_glyph, glyph_stride, first_advance, advance_stride, *user_data)
Parameters:

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the advances for a sequence of glyphs.

HarfBuzz.font_get_glyph_contour_point_func_t(font, font_data, glyph, point_index, x, y, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the (X,Y) coordinates (in font units) for a specified contour point in a glyph. Each coordinate must be returned as an #hb_position_t output parameter.

HarfBuzz.font_get_glyph_extents_func_t(font, font_data, glyph, extents, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the extents for a specified glyph. Extents must be returned in an #hb_glyph_extents output parameter.

HarfBuzz.font_get_glyph_from_name_func_t(font, font_data, name, len, glyph, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the glyph ID that corresponds to a glyph-name string.

HarfBuzz.font_get_glyph_func_t(font, font_data, unicode, variation_selector, glyph, *user_data)
Parameters:
Return type:

int

HarfBuzz.font_get_glyph_kerning_func_t(font, font_data, first_glyph, second_glyph, *user_data)
Parameters:
Return type:

int

HarfBuzz.font_get_glyph_name_func_t(font, font_data, glyph, name, size, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.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.

HarfBuzz.font_get_glyph_origin_func_t(font, font_data, glyph, x, y, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the (X,Y) coordinates (in font units) of the origin for a glyph. Each coordinate must be returned in an #hb_position_t output parameter.

HarfBuzz.font_get_nominal_glyph_func_t(font, font_data, unicode, glyph, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the nominal glyph ID for a specified Unicode code point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.

HarfBuzz.font_get_nominal_glyphs_func_t(font, font_data, count, first_unicode, unicode_stride, first_glyph, glyph_stride, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.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.

HarfBuzz.font_get_variation_glyph_func_t(font, font_data, unicode, variation_selector, glyph, *user_data)
Parameters:
Return type:

int

A virtual method for the HarfBuzz.font_funcs_t of an HarfBuzz.font_t object.

This method should retrieve the glyph ID for a specified Unicode code point followed by a specified Variation Selector code point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.

HarfBuzz.reference_table_func_t(face, tag, *user_data)
Parameters:
Return type:

HarfBuzz.blob_t

HarfBuzz.unicode_combining_class_func_t(ufuncs, unicode, *user_data)
Parameters:
Returns:

The HarfBuzz.unicode_combining_class_t of unicode

Return type:

HarfBuzz.unicode_combining_class_t

A virtual method for the HarfBuzz.unicode_funcs_t structure.

This method should retrieve the Canonical Combining Class (ccc) property for a specified Unicode code point.

HarfBuzz.unicode_compose_func_t(ufuncs, a, b, *user_data)
Parameters:
  • ufuncs (HarfBuzz.unicode_funcs_t) – A Unicode-functions structure
  • a (int) – The first code point to compose
  • b (int) – The second code point to compose
  • user_data (object or None) – user data pointer passed by the caller
Returns:

True is a,`b` composed, false otherwise

ab:The composed code point

Return type:

(int, ab: int)

A virtual method for the HarfBuzz.unicode_funcs_t structure.

This method should compose a sequence of two input Unicode code points by canonical equivalence, returning the composed code point in a #hb_codepoint_t output parameter (if successful). The method must return an #hb_bool_t indicating the success of the composition.

HarfBuzz.unicode_decompose_compatibility_func_t(ufuncs, u, decomposed, *user_data)
Parameters:
Returns:

number of codepoints in the full compatibility decomposition of u, or 0 if no decomposition available.

Return type:

int

Fully decompose u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to decomposed. The complete length of the decomposition will be returned.

If u has no compatibility decomposition, zero should be returned.

The Unicode standard guarantees that a buffer of length HarfBuzz.UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any compatibility decomposition plus an terminating value of 0. Consequently, decompose must be allocated by the caller to be at least this length. Implementations of this function type must ensure that they do not write past the provided array.

Deprecated since version 2.0.0.

HarfBuzz.unicode_decompose_func_t(ufuncs, ab, *user_data)
Parameters:
Returns:

True if ab decomposed, false otherwise

a:The first decomposed code point
b:The second decomposed code point

Return type:

(int, a: int, b: int)

A virtual method for the HarfBuzz.unicode_funcs_t structure.

This method should decompose an input Unicode code point, returning the two decomposed code points in #hb_codepoint_t output parameters (if successful). The method must return an #hb_bool_t indicating the success of the composition.

HarfBuzz.unicode_eastasian_width_func_t(ufuncs, unicode, *user_data)
Parameters:
Return type:

int

Deprecated since version 2.0.0.

HarfBuzz.unicode_general_category_func_t(ufuncs, unicode, *user_data)
Parameters:
Returns:

The HarfBuzz.unicode_general_category_t of unicode

Return type:

HarfBuzz.unicode_general_category_t

A virtual method for the HarfBuzz.unicode_funcs_t structure.

This method should retrieve the General Category property for a specified Unicode code point.

HarfBuzz.unicode_mirroring_func_t(ufuncs, unicode, *user_data)
Parameters:
Returns:

The #hb_codepoint_t of the Mirroring Glyph for unicode

Return type:

int

A virtual method for the HarfBuzz.unicode_funcs_t structure.

This method should retrieve the Bi-Directional Mirroring Glyph code point for a specified Unicode code point.

Note: If a code point does not have a specified Bi-Directional Mirroring Glyph defined, the method should return the original code point.

HarfBuzz.unicode_script_func_t(ufuncs, unicode, *user_data)
Parameters:
Returns:

The HarfBuzz.script_t of unicode

Return type:

HarfBuzz.script_t

A virtual method for the HarfBuzz.unicode_funcs_t structure.

This method should retrieve the Script property for a specified Unicode code point.