Functions

  blob_copy_writable_or_fail (blob)
  blob_create_from_file (file_name)
  blob_create_sub_blob (parent, offset, length)
  blob_get_data (blob)
  blob_get_data_writable (blob)
  blob_get_empty ()
  blob_get_length (blob)
  blob_is_immutable (blob)
  blob_make_immutable (blob)
  buffer_add (buffer, codepoint, cluster)
  buffer_add_codepoints (buffer, text, item_offset, item_length)
  buffer_add_latin1 (buffer, text, item_offset, item_length)
  buffer_add_utf16 (buffer, text, item_offset, item_length)
  buffer_add_utf32 (buffer, text, item_offset, item_length)
  buffer_add_utf8 (buffer, text, item_offset, item_length)
  buffer_allocation_successful (buffer)
  buffer_append (buffer, source, start, end)
  buffer_clear_contents (buffer)
  buffer_create ()
  buffer_deserialize_glyphs (buffer, buf, font, format)
  buffer_diff (buffer, reference, dottedcircle_glyph, position_fuzz)
  buffer_get_cluster_level (buffer)
  buffer_get_content_type (buffer)
  buffer_get_direction (buffer)
  buffer_get_empty ()
  buffer_get_flags (buffer)
  buffer_get_glyph_infos (buffer)
  buffer_get_glyph_positions (buffer)
  buffer_get_invisible_glyph (buffer)
  buffer_get_language (buffer)
  buffer_get_length (buffer)
  buffer_get_replacement_codepoint (buffer)
  buffer_get_script (buffer)
  buffer_get_segment_properties (buffer)
  buffer_get_unicode_funcs (buffer)
  buffer_guess_segment_properties (buffer)
  buffer_normalize_glyphs (buffer)
  buffer_pre_allocate (buffer, size)
  buffer_reset (buffer)
  buffer_reverse (buffer)
  buffer_reverse_clusters (buffer)
  buffer_reverse_range (buffer, start, end)
  buffer_serialize_format_from_string (str)
  buffer_serialize_format_to_string (format)
  buffer_serialize_glyphs (buffer, start, end, font, format, flags)
  buffer_serialize_list_formats ()
  buffer_set_cluster_level (buffer, cluster_level)
  buffer_set_content_type (buffer, content_type)
  buffer_set_direction (buffer, direction)
  buffer_set_flags (buffer, flags)
  buffer_set_invisible_glyph (buffer, invisible)
  buffer_set_language (buffer, language)
  buffer_set_length (buffer, length)
  buffer_set_message_func (buffer, func, *user_data)
  buffer_set_replacement_codepoint (buffer, replacement)
  buffer_set_script (buffer, script)
  buffer_set_segment_properties (buffer, props)
  buffer_set_unicode_funcs (buffer, unicode_funcs)
  color_get_alpha (color)
  color_get_blue (color)
  color_get_green (color)
  color_get_red (color)
  direction_from_string (str)
  direction_to_string (direction)
  face_builder_add_table (face, tag, blob)
  face_builder_create ()
  face_collect_unicodes (face, out)
  face_collect_variation_selectors (face, out)
  face_collect_variation_unicodes (face, variation_selector, out)
  face_count (blob)
  face_create (blob, index)
  face_create_for_tables (reference_table_func, *user_data)
  face_get_empty ()
  face_get_glyph_count (face)
  face_get_index (face)
  face_get_table_tags (face, start_offset, table_count, table_tags)
  face_get_upem (face)
  face_is_immutable (face)
  face_make_immutable (face)
  face_reference_blob (face)
  face_reference_table (face, tag)
  face_set_glyph_count (face, glyph_count)
  face_set_index (face, index)
  face_set_upem (face, upem)
  feature_from_string (str)
  feature_to_string (feature)
  font_add_glyph_origin_for_direction (font, glyph, direction)
  font_create (face)
  font_create_sub_font (parent)
  font_funcs_create ()
  font_funcs_get_empty ()
  font_funcs_is_immutable (ffuncs)
  font_funcs_make_immutable (ffuncs)
  font_funcs_set_font_h_extents_func (ffuncs, func, *user_data)
  font_funcs_set_font_v_extents_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_contour_point_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_extents_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_from_name_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_h_advance_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_h_advances_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_h_kerning_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_h_origin_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_name_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_v_advance_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_v_advances_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_v_kerning_func (ffuncs, func, *user_data)
  font_funcs_set_glyph_v_origin_func (ffuncs, func, *user_data)
  font_funcs_set_nominal_glyph_func (ffuncs, func, *user_data)
  font_funcs_set_nominal_glyphs_func (ffuncs, func, *user_data)
  font_funcs_set_variation_glyph_func (ffuncs, func, *user_data)
  font_get_empty ()
  font_get_extents_for_direction (font, direction)
  font_get_face (font)
  font_get_glyph (font, unicode, variation_selector)
  font_get_glyph_advance_for_direction (font, glyph, direction)
  font_get_glyph_advances_for_direction (font, direction, count, first_glyph, glyph_stride, first_advance, advance_stride)
  font_get_glyph_contour_point (font, glyph, point_index)
  font_get_glyph_contour_point_for_origin (font, glyph, point_index, direction)
  font_get_glyph_extents (font, glyph)
  font_get_glyph_extents_for_origin (font, glyph, direction)
  font_get_glyph_from_name (font, name)
  font_get_glyph_h_advance (font, glyph)
  font_get_glyph_h_advances (font, count, first_glyph, glyph_stride, first_advance, advance_stride)
  font_get_glyph_h_kerning (font, left_glyph, right_glyph)
  font_get_glyph_h_origin (font, glyph)
  font_get_glyph_kerning_for_direction (font, first_glyph, second_glyph, direction)
  font_get_glyph_name (font, glyph, name)
  font_get_glyph_origin_for_direction (font, glyph, direction)
  font_get_glyph_v_advance (font, glyph)
  font_get_glyph_v_advances (font, count, first_glyph, glyph_stride, first_advance, advance_stride)
  font_get_glyph_v_kerning (font, top_glyph, bottom_glyph)
  font_get_glyph_v_origin (font, glyph)
  font_get_h_extents (font)
  font_get_nominal_glyph (font, unicode)
  font_get_nominal_glyphs (font, count, first_unicode, unicode_stride, first_glyph, glyph_stride)
  font_get_parent (font)
  font_get_ppem (font)
  font_get_ptem (font)
  font_get_scale (font)
  font_get_v_extents (font)
  font_get_var_coords_normalized (font, length)
  font_get_variation_glyph (font, unicode, variation_selector)
  font_glyph_from_string (font, s)
  font_glyph_to_string (font, glyph, s)
  font_is_immutable (font)
  font_make_immutable (font)
  font_set_face (font, face)
  font_set_funcs (font, klass, font_data, destroy)
  font_set_funcs_data (font, font_data, destroy)
  font_set_parent (font, parent)
  font_set_ppem (font, x_ppem, y_ppem)
  font_set_ptem (font, ptem)
  font_set_scale (font, x_scale, y_scale)
  font_set_var_coords_design (font, coords, coords_length)
  font_set_var_coords_normalized (font, coords, coords_length)
  font_set_var_named_instance (font, instance_index)
  font_set_variations (font, variations, variations_length)
  font_subtract_glyph_origin_for_direction (font, glyph, direction)
  ft_font_changed (font)
  ft_font_get_load_flags (font)
  ft_font_set_funcs (font)
  ft_font_set_load_flags (font, load_flags)
  glib_blob_create (gbytes)
  glib_get_unicode_funcs ()
  glib_script_from_script (script)
  glib_script_to_script (script)
  glyph_info_get_glyph_flags (info)
  language_from_string (str)
  language_get_default ()
  language_to_string (language)
  map_allocation_successful (map)
  map_clear (map)
  map_create ()
  map_del (map, key)
  map_get (map, key)
  map_get_empty ()
  map_get_population (map)
  map_has (map, key)
  map_is_empty (map)
  map_set (map, key, value)
  ot_color_glyph_get_layers (face, glyph, start_offset)
  ot_color_glyph_reference_png (font, glyph)
  ot_color_glyph_reference_svg (face, glyph)
  ot_color_has_layers (face)
  ot_color_has_palettes (face)
  ot_color_has_png (face)
  ot_color_has_svg (face)
  ot_color_palette_color_get_name_id (face, color_index)
  ot_color_palette_get_colors (face, palette_index, start_offset)
  ot_color_palette_get_count (face)
  ot_color_palette_get_flags (face, palette_index)
  ot_color_palette_get_name_id (face, palette_index)
  ot_font_set_funcs (font)
  ot_layout_collect_features (face, table_tag, scripts, languages, features)
  ot_layout_collect_lookups (face, table_tag, scripts, languages, features)
  ot_layout_feature_get_characters (face, table_tag, feature_index, start_offset)
  ot_layout_feature_get_lookups (face, table_tag, feature_index, start_offset)
  ot_layout_feature_get_name_ids (face, table_tag, feature_index)
  ot_layout_feature_with_variations_get_lookups (face, table_tag, feature_index, variations_index, start_offset)
  ot_layout_get_attach_points (face, glyph, start_offset)
  ot_layout_get_baseline (font, baseline_tag, direction, script_tag, language_tag)
  ot_layout_get_glyph_class (face, glyph)
  ot_layout_get_glyphs_in_class (face, klass)
  ot_layout_get_ligature_carets (font, direction, glyph, start_offset)
  ot_layout_get_size_params (face)
  ot_layout_has_glyph_classes (face)
  ot_layout_has_positioning (face)
  ot_layout_has_substitution (face)
  ot_layout_language_find_feature (face, table_tag, script_index, language_index, feature_tag)
  ot_layout_language_get_feature_indexes (face, table_tag, script_index, language_index, start_offset)
  ot_layout_language_get_feature_tags (face, table_tag, script_index, language_index, start_offset)
  ot_layout_language_get_required_feature (face, table_tag, script_index, language_index, feature_index)
  ot_layout_language_get_required_feature_index (face, table_tag, script_index, language_index)
  ot_layout_lookup_collect_glyphs (face, table_tag, lookup_index)
  ot_layout_lookup_substitute_closure (face, lookup_index)
  ot_layout_lookup_would_substitute (face, lookup_index, glyphs, glyphs_length, zero_context)
  ot_layout_lookups_substitute_closure (face, lookups)
  ot_layout_script_find_language (face, table_tag, script_index, language_tag, language_index)
  ot_layout_script_get_language_tags (face, table_tag, script_index, start_offset)
  ot_layout_script_select_language (face, table_tag, script_index, language_count, language_tags)
  ot_layout_table_choose_script (face, table_tag, script_tags)
  ot_layout_table_find_feature_variations (face, table_tag, coords, num_coords)
  ot_layout_table_find_script (face, table_tag, script_tag)
  ot_layout_table_get_feature_tags (face, table_tag, start_offset)
  ot_layout_table_get_lookup_count (face, table_tag)
  ot_layout_table_get_script_tags (face, table_tag, start_offset)
  ot_layout_table_select_script (face, table_tag, script_count, script_tags)
  ot_math_get_constant (font, constant)
  ot_math_get_glyph_assembly (font, glyph, direction, start_offset)
  ot_math_get_glyph_italics_correction (font, glyph)
  ot_math_get_glyph_kerning (font, glyph, kern, correction_height)
  ot_math_get_glyph_top_accent_attachment (font, glyph)
  ot_math_get_glyph_variants (font, glyph, direction, start_offset)
  ot_math_get_min_connector_overlap (font, direction)
  ot_math_has_data (face)
  ot_math_is_glyph_extended_shape (face, glyph)
  ot_meta_get_entry_tags (face, start_offset, entries_count, entries)
  ot_meta_reference_entry (face, meta_tag)
  ot_metrics_get_position (font, metrics_tag)
  ot_metrics_get_variation (font, metrics_tag)
  ot_metrics_get_x_variation (font, metrics_tag)
  ot_metrics_get_y_variation (font, metrics_tag)
  ot_name_get_utf16 (face, name_id, language)
  ot_name_get_utf32 (face, name_id, language)
  ot_name_get_utf8 (face, name_id, language)
  ot_name_list_names (face)
  ot_shape_glyphs_closure (font, buffer, features, num_features, glyphs)
  ot_tag_from_language (language)
  ot_tag_to_language (tag)
  ot_tag_to_script (tag)
  ot_tags_from_script (script, script_tag_1, script_tag_2)
  ot_tags_from_script_and_language (script, language, script_count, language_count)
  ot_tags_to_script_and_language (script_tag, language_tag, script, language)
  ot_var_find_axis (face, axis_tag, axis_index, axis_info)
  ot_var_find_axis_info (face, axis_tag, axis_info)
  ot_var_get_axes (face, start_offset, axes_count, axes_array)
  ot_var_get_axis_count (face)
  ot_var_get_axis_infos (face, start_offset, axes_count, axes_array)
  ot_var_get_named_instance_count (face)
  ot_var_has_data (face)
  ot_var_named_instance_get_design_coords (face, instance_index, coords_length, coords)
  ot_var_named_instance_get_postscript_name_id (face, instance_index)
  ot_var_named_instance_get_subfamily_name_id (face, instance_index)
  ot_var_normalize_coords (face, coords_length, design_coords, normalized_coords)
  ot_var_normalize_variations (face, variations, variations_length, coords, coords_length)
  script_from_iso15924_tag (tag)
  script_from_string (str)
  script_get_horizontal_direction (script)
  script_to_iso15924_tag (script)
  segment_properties_equal (a, b)
  segment_properties_hash (p)
  set_add (set, codepoint)
  set_add_range (set, first, last)
  set_allocation_successful (set)
  set_clear (set)
  set_create ()
  set_del (set, codepoint)
  set_del_range (set, first, last)
  set_get_empty ()
  set_get_max (set)
  set_get_min (set)
  set_get_population (set)
  set_has (set, codepoint)
  set_intersect (set, other)
  set_invert (set)
  set_is_empty (set)
  set_is_equal (set, other)
  set_is_subset (set, larger_set)
  set_next (set, codepoint)
  set_next_range (set, last)
  set_previous (set, codepoint)
  set_previous_range (set, first)
  set_set (set, other)
  set_subtract (set, other)
  set_symmetric_difference (set, other)
  set_union (set, other)
  shape (font, buffer, features)
  shape_full (font, buffer, features, shaper_list)
  shape_list_shapers ()
  shape_plan_create (face, props, user_features, shaper_list)
  shape_plan_create2 (face, props, user_features, num_user_features, coords, num_coords, shaper_list)
  shape_plan_create_cached (face, props, user_features, shaper_list)
  shape_plan_create_cached2 (face, props, user_features, num_user_features, coords, num_coords, shaper_list)
  shape_plan_execute (shape_plan, font, buffer, features)
  shape_plan_get_empty ()
  shape_plan_get_shaper (shape_plan)
  tag_from_string (str)
  tag_to_string (tag)
  unicode_combining_class (ufuncs, unicode)
  unicode_compose (ufuncs, a, b)
  unicode_decompose (ufuncs, ab)
  unicode_decompose_compatibility (ufuncs, u)
  unicode_eastasian_width (ufuncs, unicode)
  unicode_funcs_create (parent)
  unicode_funcs_get_default ()
  unicode_funcs_get_empty ()
  unicode_funcs_get_parent (ufuncs)
  unicode_funcs_is_immutable (ufuncs)
  unicode_funcs_make_immutable (ufuncs)
  unicode_funcs_set_combining_class_func (ufuncs, func, *user_data)
  unicode_funcs_set_compose_func (ufuncs, func, *user_data)
  unicode_funcs_set_decompose_compatibility_func (ufuncs, func, *user_data)
  unicode_funcs_set_decompose_func (ufuncs, func, *user_data)
  unicode_funcs_set_eastasian_width_func (ufuncs, func, *user_data)
  unicode_funcs_set_general_category_func (ufuncs, func, *user_data)
  unicode_funcs_set_mirroring_func (ufuncs, func, *user_data)
  unicode_funcs_set_script_func (ufuncs, func, *user_data)
  unicode_general_category (ufuncs, unicode)
  unicode_mirroring (ufuncs, unicode)
  unicode_script (ufuncs, unicode)
  variation_from_string (str, len, variation)
  variation_to_string (variation, buf, size)
  version ()
  version_atleast (major, minor, micro)
  version_string ()

Details

HarfBuzz.blob_copy_writable_or_fail(blob)
Parameters:blob (HarfBuzz.blob_t) – A blob.
Returns:New blob, or nullptr if allocation failed.
Return type:HarfBuzz.blob_t

Makes a writable copy of blob.

New in version 1.8.0.

HarfBuzz.blob_create_from_file(file_name)
Parameters:file_name (str) – font filename.
Returns:A HarfBuzz.blob_t pointer with the content of the file
Return type:HarfBuzz.blob_t

New in version 1.7.7.

HarfBuzz.blob_create_sub_blob(parent, offset, length)
Parameters:
  • parent (HarfBuzz.blob_t) – Parent blob.
  • offset (int) – Start offset of sub-blob within parent, in bytes.
  • length (int) – Length of sub-blob.
Returns:

New blob, or the empty blob if something failed or if length is zero or offset is beyond the end of parent’s data. Destroy with hb_blob_destroy().

Return type:

HarfBuzz.blob_t

Returns a blob that represents a range of bytes in parent. The new blob is always created with HarfBuzz.memory_mode_t.READONLY, meaning that it will never modify data in the parent blob. The parent data is not expected to be modified, and will result in undefined behavior if it is.

Makes parent immutable.

New in version 0.9.2.

HarfBuzz.blob_get_data(blob)
Parameters:blob (HarfBuzz.blob_t) – a blob.
Return type:[str]

New in version 0.9.2.

HarfBuzz.blob_get_data_writable(blob)
Parameters:blob (HarfBuzz.blob_t) – a blob.
Returns:Writable blob data, or None if failed.
Return type:[str]

Tries to make blob data writable (possibly copying it) and return pointer to data.

Fails if blob has been made immutable, or if memory allocation fails.

New in version 0.9.2.

HarfBuzz.blob_get_empty()
Returns:the empty blob.
Return type:HarfBuzz.blob_t

Returns the singleton empty blob.

See TODO:link object types for more information.

New in version 0.9.2.

HarfBuzz.blob_get_length(blob)
Parameters:blob (HarfBuzz.blob_t) – a blob.
Returns:the length of blob data in bytes.
Return type:int

New in version 0.9.2.

HarfBuzz.blob_is_immutable(blob)
Parameters:blob (HarfBuzz.blob_t) – a blob.
Returns:TODO
Return type:int

New in version 0.9.2.

HarfBuzz.blob_make_immutable(blob)
Parameters:blob (HarfBuzz.blob_t) – a blob.

New in version 0.9.2.

HarfBuzz.buffer_add(buffer, codepoint, cluster)
Parameters:

Appends a character with the Unicode value of codepoint to buffer, and gives it the initial cluster value of cluster. Clusters can be any thing the client wants, they are usually used to refer to the index of the character in the input text stream and are output in HarfBuzz.glyph_info_t.cluster field.

This function does not check the validity of codepoint, it is up to the caller to ensure it is a valid Unicode code point.

New in version 0.9.7.

HarfBuzz.buffer_add_codepoints(buffer, text, item_offset, item_length)
Parameters:
  • buffer (HarfBuzz.buffer_t) – a HarfBuzz.buffer_t to append characters to.
  • text ([int]) – an array of Unicode code points to append.
  • item_offset (int) – the offset of the first code point to add to the buffer.
  • item_length (int) – the number of code points to add to the buffer, or -1 for the end of text (assuming it is None terminated).

Appends characters from text array to buffer. The item_offset is the position of the first character from text that will be appended, and item_length is the number of character. When shaping part of a larger text (e.g. a run of text from a paragraph), instead of passing just the substring corresponding to the run, it is preferable to pass the whole paragraph and specify the run start and length as item_offset and item_length, respectively, to give HarfBuzz the full context to be able, for example, to do cross-run Arabic shaping or properly handle combining marks at stat of run.

This function does not check the validity of text, it is up to the caller to ensure it contains a valid Unicode code points.

New in version 0.9.31.

HarfBuzz.buffer_add_latin1(buffer, text, item_offset, item_length)
Parameters:
  • buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
  • text (bytes) – an array of UTF-8 characters to append.
  • item_offset (int) – the offset of the first character to add to the buffer.
  • item_length (int) – the number of characters to add to the buffer, or -1 for the end of text (assuming it is None terminated).

Similar to HarfBuzz.buffer_add_codepoints(), but allows only access to first 256 Unicode code points that can fit in 8-bit strings.

Has nothing to do with non-Unicode Latin-1 encoding.

New in version 0.9.39.

HarfBuzz.buffer_add_utf16(buffer, text, item_offset, item_length)
Parameters:
  • buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
  • text ([int]) – an array of UTF-16 characters to append.
  • item_offset (int) – the offset of the first character to add to the buffer.
  • item_length (int) – the number of characters to add to the buffer, or -1 for the end of text (assuming it is None terminated).

See HarfBuzz.buffer_add_codepoints().

Replaces invalid UTF-16 characters with the buffer replacement code point, see HarfBuzz.buffer_set_replacement_codepoint().

New in version 0.9.2.

HarfBuzz.buffer_add_utf32(buffer, text, item_offset, item_length)
Parameters:
  • buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
  • text ([int]) – an array of UTF-32 characters to append.
  • item_offset (int) – the offset of the first character to add to the buffer.
  • item_length (int) – the number of characters to add to the buffer, or -1 for the end of text (assuming it is None terminated).

See HarfBuzz.buffer_add_codepoints().

Replaces invalid UTF-32 characters with the buffer replacement code point, see HarfBuzz.buffer_set_replacement_codepoint().

New in version 0.9.2.

HarfBuzz.buffer_add_utf8(buffer, text, item_offset, item_length)
Parameters:
  • buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
  • text (bytes) – an array of UTF-8 characters to append.
  • item_offset (int) – the offset of the first character to add to the buffer.
  • item_length (int) – the number of characters to add to the buffer, or -1 for the end of text (assuming it is None terminated).

See HarfBuzz.buffer_add_codepoints().

Replaces invalid UTF-8 characters with the buffer replacement code point, see HarfBuzz.buffer_set_replacement_codepoint().

New in version 0.9.2.

HarfBuzz.buffer_allocation_successful(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:%true if buffer memory allocation succeeded, %false otherwise.
Return type:int

Check if allocating memory for the buffer succeeded.

New in version 0.9.2.

HarfBuzz.buffer_append(buffer, source, start, end)
Parameters:

Append (part of) contents of another buffer to this buffer.

New in version 1.5.0.

HarfBuzz.buffer_clear_contents(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.

Similar to HarfBuzz.buffer_reset(), but does not clear the Unicode functions and the replacement code point.

New in version 0.9.11.

HarfBuzz.buffer_create()
Returns:A newly allocated HarfBuzz.buffer_t with a reference count of 1. The initial reference count should be released with hb_buffer_destroy() when you are done using the HarfBuzz.buffer_t. This function never returns None. If memory cannot be allocated, a special HarfBuzz.buffer_t object will be returned on which HarfBuzz.buffer_allocation_successful() returns %false.
Return type:HarfBuzz.buffer_t

Creates a new HarfBuzz.buffer_t with all properties to defaults.

New in version 0.9.2.

HarfBuzz.buffer_deserialize_glyphs(buffer, buf, font, format)
Parameters:
Return type:

(int, end_ptr: str)

New in version 0.9.7.

HarfBuzz.buffer_diff(buffer, reference, dottedcircle_glyph, position_fuzz)
Parameters:
  • buffer (HarfBuzz.buffer_t) – a buffer.
  • reference (HarfBuzz.buffer_t) – other buffer to compare to.
  • dottedcircle_glyph (int) – glyph id of U+25CC DOTTED CIRCLE, or (hb_codepont_t) -1.
  • position_fuzz (int) – allowed absolute difference in position values.
Return type:

HarfBuzz.buffer_diff_flags_t

If dottedcircle_glyph is (hb_codepoint_t) -1 then HarfBuzz.buffer_diff_flags_t.DOTTED_CIRCLE_PRESENT and HarfBuzz.buffer_diff_flags_t.NOTDEF_PRESENT are never returned. This should be used by most callers if just comparing two buffers is needed.

New in version 1.5.0.

HarfBuzz.buffer_get_cluster_level(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Return type:HarfBuzz.buffer_cluster_level_t

New in version 0.9.42.

HarfBuzz.buffer_get_content_type(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The type of buffer contents.
Return type:HarfBuzz.buffer_content_type_t

see HarfBuzz.buffer_set_content_type().

New in version 0.9.5.

HarfBuzz.buffer_get_direction(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The direction of the buffer.
Return type:HarfBuzz.direction_t

See HarfBuzz.buffer_set_direction()

New in version 0.9.2.

HarfBuzz.buffer_get_empty()
Return type:HarfBuzz.buffer_t

New in version 0.9.2.

HarfBuzz.buffer_get_flags(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The buffer flags.
Return type:HarfBuzz.buffer_flags_t

See HarfBuzz.buffer_set_flags().

New in version 0.9.7.

HarfBuzz.buffer_get_glyph_infos(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The buffer glyph information array. The value valid as long as buffer has not been modified.
Return type:[HarfBuzz.glyph_info_t]

Returns buffer glyph information array. Returned pointer is valid as long as buffer contents are not modified.

New in version 0.9.2.

HarfBuzz.buffer_get_glyph_positions(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The buffer glyph position array. The value valid as long as buffer has not been modified.
Return type:[HarfBuzz.glyph_position_t]

Returns buffer glyph position array. Returned pointer is valid as long as buffer contents are not modified.

New in version 0.9.2.

HarfBuzz.buffer_get_invisible_glyph(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The buffer invisible #hb_codepoint_t.
Return type:int

See HarfBuzz.buffer_set_invisible_glyph().

New in version 2.0.0.

HarfBuzz.buffer_get_language(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The HarfBuzz.language_t of the buffer. Must not be freed by the caller.
Return type:HarfBuzz.language_t

See HarfBuzz.buffer_set_language().

New in version 0.9.2.

HarfBuzz.buffer_get_length(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The buffer length. The value valid as long as buffer has not been modified.
Return type:int

Returns the number of items in the buffer.

New in version 0.9.2.

HarfBuzz.buffer_get_replacement_codepoint(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The buffer replacement #hb_codepoint_t.
Return type:int

See HarfBuzz.buffer_set_replacement_codepoint().

New in version 0.9.31.

HarfBuzz.buffer_get_script(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:The HarfBuzz.script_t of the buffer.
Return type:HarfBuzz.script_t

See HarfBuzz.buffer_set_script().

New in version 0.9.2.

HarfBuzz.buffer_get_segment_properties(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Returns:the output HarfBuzz.segment_properties_t.
Return type:props: HarfBuzz.segment_properties_t

Sets props to the HarfBuzz.segment_properties_t of buffer.

New in version 0.9.7.

HarfBuzz.buffer_get_unicode_funcs(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.
Return type:HarfBuzz.unicode_funcs_t

New in version 0.9.2.

HarfBuzz.buffer_guess_segment_properties(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.

Sets unset buffer segment properties based on buffer Unicode contents. If buffer is not empty, it must have content type HarfBuzz.buffer_content_type_t.UNICODE.

If buffer script is not set (ie. is HarfBuzz.script_t.INVALID), it will be set to the Unicode script of the first character in the buffer that has a script other than HarfBuzz.script_t.COMMON, HarfBuzz.script_t.INHERITED, and HarfBuzz.script_t.UNKNOWN.

Next, if buffer direction is not set (ie. is HarfBuzz.direction_t.INVALID), it will be set to the natural horizontal direction of the buffer script as returned by HarfBuzz.script_get_horizontal_direction(). If HarfBuzz.script_get_horizontal_direction() returns HarfBuzz.direction_t.INVALID, then HarfBuzz.direction_t.LTR is used.

Finally, if buffer language is not set (ie. is HarfBuzz.LANGUAGE_INVALID), it will be set to the process’s default language as returned by HarfBuzz.language_get_default(). This may change in the future by taking buffer script into consideration when choosing a language. Note that HarfBuzz.language_get_default() is NOT threadsafe the first time it is called. See documentation for that function for details.

New in version 0.9.7.

HarfBuzz.buffer_normalize_glyphs(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.

Reorders a glyph buffer to have canonical in-cluster glyph order / position. The resulting clusters should behave identical to pre-reordering clusters.

This has nothing to do with Unicode normalization.

New in version 0.9.2.

HarfBuzz.buffer_pre_allocate(buffer, size)
Parameters:
Returns:

%true if buffer memory allocation succeeded, %false otherwise.

Return type:

int

Pre allocates memory for buffer to fit at least size number of items.

New in version 0.9.2.

HarfBuzz.buffer_reset(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.

Resets the buffer to its initial status, as if it was just newly created with HarfBuzz.buffer_create().

New in version 0.9.2.

HarfBuzz.buffer_reverse(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.

Reverses buffer contents.

New in version 0.9.2.

HarfBuzz.buffer_reverse_clusters(buffer)
Parameters:buffer (HarfBuzz.buffer_t) – an HarfBuzz.buffer_t.

Reverses buffer clusters. That is, the buffer contents are reversed, then each cluster (consecutive items having the same cluster number) are reversed again.

New in version 0.9.2.

HarfBuzz.buffer_reverse_range(buffer, start, end)
Parameters:

Reverses buffer contents between start to end.

New in version 0.9.41.

HarfBuzz.buffer_serialize_format_from_string(str)
Parameters:str (bytes) – a string to parse
Returns:The parsed HarfBuzz.buffer_serialize_format_t.
Return type:HarfBuzz.buffer_serialize_format_t

Parses a string into an HarfBuzz.buffer_serialize_format_t. Does not check if str is a valid buffer serialization format, use HarfBuzz.buffer_serialize_list_formats() to get the list of supported formats.

New in version 0.9.7.

HarfBuzz.buffer_serialize_format_to_string(format)
Parameters:format (HarfBuzz.buffer_serialize_format_t) – an HarfBuzz.buffer_serialize_format_t to convert.
Returns:A None terminated string corresponding to format. Should not be freed.
Return type:str

Converts format to the string corresponding it, or None if it is not a valid HarfBuzz.buffer_serialize_format_t.

New in version 0.9.7.

HarfBuzz.buffer_serialize_glyphs(buffer, start, end, font, format, flags)
Parameters:
Returns:

The number of serialized items.

buf:output string to write serialized buffer into.
buf_consumed:if not None, will be set to the number of byes written into buf.

Return type:

(int, buf: bytes, buf_consumed: int)

Serializes buffer into a textual representation of its glyph content, useful for showing the contents of the buffer, for example during debugging. There are currently two supported serialization formats:

text

A human-readable, plain text format. The serialized glyphs will look something like:

`` [uni0651=0@518,0+0|uni0628=0+1897] ``

json

TODO.

New in version 0.9.7.

HarfBuzz.buffer_serialize_list_formats()
Returns:A string array of buffer serialization formats. Should not be freed.
Return type:[str]

Returns a list of supported buffer serialization formats.

New in version 0.9.7.

HarfBuzz.buffer_set_cluster_level(buffer, cluster_level)
Parameters:

New in version 0.9.42.

HarfBuzz.buffer_set_content_type(buffer, content_type)
Parameters:

Sets the type of buffer contents, buffers are either empty, contain characters (before shaping) or glyphs (the result of shaping).

New in version 0.9.5.

HarfBuzz.buffer_set_direction(buffer, direction)
Parameters:

Set the text flow direction of the buffer. No shaping can happen without setting buffer direction, and it controls the visual direction for the output glyphs; for RTL direction the glyphs will be reversed. Many layout features depend on the proper setting of the direction, for example, reversing RTL text before shaping, then shaping with LTR direction is not the same as keeping the text in logical order and shaping with RTL direction.

New in version 0.9.2.

HarfBuzz.buffer_set_flags(buffer, flags)
Parameters:

Sets buffer flags to flags. See HarfBuzz.buffer_flags_t.

New in version 0.9.7.

HarfBuzz.buffer_set_invisible_glyph(buffer, invisible)
Parameters:

Sets the #hb_codepoint_t that replaces invisible characters in the shaping result. If set to zero (default), the glyph for the U+0020 SPACE character is used. Otherwise, this value is used verbatim.

New in version 2.0.0.

HarfBuzz.buffer_set_language(buffer, language)
Parameters:

Sets the language of buffer to language.

Languages are crucial for selecting which OpenType feature to apply to the buffer which can result in applying language-specific behaviour. Languages are orthogonal to the scripts, and though they are related, they are different concepts and should not be confused with each other.

Use HarfBuzz.language_from_string() to convert from BCP 47 language tags to HarfBuzz.language_t.

New in version 0.9.2.

HarfBuzz.buffer_set_length(buffer, length)
Parameters:
Returns:

%true if buffer memory allocation succeeded, %false otherwise.

Return type:

int

Similar to HarfBuzz.buffer_pre_allocate(), but clears any new items added at the end.

New in version 0.9.2.

HarfBuzz.buffer_set_message_func(buffer, func, *user_data)
Parameters:

New in version 1.1.3.

HarfBuzz.buffer_set_replacement_codepoint(buffer, replacement)
Parameters:

Sets the #hb_codepoint_t that replaces invalid entries for a given encoding when adding text to buffer.

Default is HarfBuzz.BUFFER_REPLACEMENT_CODEPOINT_DEFAULT.

New in version 0.9.31.

HarfBuzz.buffer_set_script(buffer, script)
Parameters:

Sets the script of buffer to script.

Script is crucial for choosing the proper shaping behaviour for scripts that require it (e.g. Arabic) and the which OpenType features defined in the font to be applied.

You can pass one of the predefined HarfBuzz.script_t values, or use HarfBuzz.script_from_string() or HarfBuzz.script_from_iso15924_tag() to get the corresponding script from an ISO 15924 script tag.

New in version 0.9.2.

HarfBuzz.buffer_set_segment_properties(buffer, props)
Parameters:

Sets the segment properties of the buffer, a shortcut for calling HarfBuzz.buffer_set_direction(), HarfBuzz.buffer_set_script() and HarfBuzz.buffer_set_language() individually.

New in version 0.9.7.

HarfBuzz.buffer_set_unicode_funcs(buffer, unicode_funcs)
Parameters:

New in version 0.9.2.

HarfBuzz.color_get_alpha(color)
Parameters:color (int) –
Returns:Alpha channel value of the given color
Return type:int

color: a #hb_color_t we are interested in its channels.

New in version 2.1.0.

HarfBuzz.color_get_blue(color)
Parameters:color (int) –
Returns:Blue channel value of the given color
Return type:int

color: a #hb_color_t we are interested in its channels.

New in version 2.1.0.

HarfBuzz.color_get_green(color)
Parameters:color (int) –
Returns:Green channel value of the given color
Return type:int

color: a #hb_color_t we are interested in its channels.

New in version 2.1.0.

HarfBuzz.color_get_red(color)
Parameters:color (int) –
Returns:Red channel value of the given color
Return type:int

color: a #hb_color_t we are interested in its channels.

New in version 2.1.0.

HarfBuzz.direction_from_string(str)
Parameters:str (bytes) –
Return type:HarfBuzz.direction_t

New in version 0.9.2.

HarfBuzz.direction_to_string(direction)
Parameters:direction (HarfBuzz.direction_t) –
Return type:str

New in version 0.9.2.

HarfBuzz.face_builder_add_table(face, tag, blob)
Parameters:
Return type:

int

Add table for tag with data provided by blob to the face. face must be created using HarfBuzz.face_builder_create().

New in version 1.9.0.

HarfBuzz.face_builder_create()
Returns:New face.
Return type:HarfBuzz.face_t

Creates a HarfBuzz.face_t that can be used with HarfBuzz.face_builder_add_table(). After tables are added to the face, it can be compiled to a binary font file by calling HarfBuzz.face_reference_blob().

New in version 1.9.0.

HarfBuzz.face_collect_unicodes(face, out)
Parameters:

New in version 1.9.0.

HarfBuzz.face_collect_variation_selectors(face, out)
Parameters:

New in version 1.9.0.

HarfBuzz.face_collect_variation_unicodes(face, variation_selector, out)
Parameters:
  • face (HarfBuzz.face_t) – font face.
  • variation_selector (int) –
  • out (HarfBuzz.set_t) – set to add Unicode characters for variation_selector covered by face to.

New in version 1.9.0.

HarfBuzz.face_count(blob)
Parameters:blob (HarfBuzz.blob_t) – a blob.
Returns:Number of faces in blob
Return type:int

Get number of faces in a blob.

New in version 1.7.7.

HarfBuzz.face_create(blob, index)
Parameters:
Return type:

HarfBuzz.face_t

New in version 0.9.2.

HarfBuzz.face_create_for_tables(reference_table_func, *user_data)
Parameters:
Return type:

HarfBuzz.face_t

New in version 0.9.2.

HarfBuzz.face_get_empty()
Return type:HarfBuzz.face_t

New in version 0.9.2.

HarfBuzz.face_get_glyph_count(face)
Parameters:face (HarfBuzz.face_t) – a face.
Return type:int

New in version 0.9.7.

HarfBuzz.face_get_index(face)
Parameters:face (HarfBuzz.face_t) – a face.
Return type:int

New in version 0.9.2.

HarfBuzz.face_get_table_tags(face, start_offset, table_count, table_tags)
Parameters:
  • face (HarfBuzz.face_t) – a face.
  • start_offset (int) – index of first tag to return.
  • table_count (int) – input length of table_tags array, output number of items written.
  • table_tags (int) – array to write tags into.
Returns:

total number of tables, or 0 if not possible to list.

Return type:

int

Retrieves table tags for a face, if possible.

New in version 1.6.0.

HarfBuzz.face_get_upem(face)
Parameters:face (HarfBuzz.face_t) – a face.
Return type:int

New in version 0.9.2.

HarfBuzz.face_is_immutable(face)
Parameters:face (HarfBuzz.face_t) – a face.
Return type:int

New in version 0.9.2.

HarfBuzz.face_make_immutable(face)
Parameters:face (HarfBuzz.face_t) – a face.

New in version 0.9.2.

HarfBuzz.face_reference_blob(face)
Parameters:face (HarfBuzz.face_t) – a face.
Return type:HarfBuzz.blob_t

New in version 0.9.2.

HarfBuzz.face_reference_table(face, tag)
Parameters:
Return type:

HarfBuzz.blob_t

New in version 0.9.2.

HarfBuzz.face_set_glyph_count(face, glyph_count)
Parameters:

New in version 0.9.7.

HarfBuzz.face_set_index(face, index)
Parameters:

New in version 0.9.2.

HarfBuzz.face_set_upem(face, upem)
Parameters:

New in version 0.9.2.

HarfBuzz.feature_from_string(str)
Parameters:str (bytes) – a string to parse
Returns:%true if str is successfully parsed, %false otherwise.
feature:the HarfBuzz.feature_t to initialize with the parsed values
Return type:(int, feature: HarfBuzz.feature_t)

Parses a string into a HarfBuzz.feature_t.

The format for specifying feature strings follows. All valid CSS font-feature-settings values other than ‘normal’ and the global values are also accepted, though not documented below. CSS string escapes are not supported.

The range indices refer to the positions between Unicode characters. The position before the first character is always 0.

The format is Python-esque. Here is how it all works:

Syntax Value Start End

Setting value: kern 1 0 ∞ Turn feature on +kern 1 0 ∞ Turn feature on -kern 0 0 ∞ Turn feature off kern=0 0 0 ∞ Turn feature off kern=1 1 0 ∞ Turn feature on aalt=2 2 0 ∞ Choose 2nd alternate Setting index: kern[] 1 0 ∞ Turn feature on kern[:] 1 0 ∞ Turn feature on kern[5:] 1 5 ∞ Turn feature on, partial kern[:5] 1 0 5 Turn feature on, partial kern[3:5] 1 3 5 Turn feature on, range kern[3] 1 3 3+1 Turn feature on, single str Mixing it all: aalt[3:5]=2 2 3 5 Turn 2nd alternate on for range

New in version 0.9.5.

HarfBuzz.feature_to_string(feature)
Parameters:feature (HarfBuzz.feature_t) – an HarfBuzz.feature_t to convert
Returns:output string
Return type:buf: [str]

Converts a HarfBuzz.feature_t into a None-terminated string in the format understood by HarfBuzz.feature_from_string(). The client in responsible for allocating big enough size for buf, 128 bytes is more than enough.

New in version 0.9.5.

HarfBuzz.font_add_glyph_origin_for_direction(font, glyph, direction)
Parameters:
Return type:

(x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_create(face)
Parameters:face (HarfBuzz.face_t) – a face.
Return type:HarfBuzz.font_t

New in version 0.9.2.

HarfBuzz.font_create_sub_font(parent)
Parameters:parent (HarfBuzz.font_t) – parent font.
Return type:HarfBuzz.font_t

New in version 0.9.2.

HarfBuzz.font_funcs_create()
Return type:HarfBuzz.font_funcs_t

New in version 0.9.2.

HarfBuzz.font_funcs_get_empty()
Return type:HarfBuzz.font_funcs_t

New in version 0.9.2.

HarfBuzz.font_funcs_is_immutable(ffuncs)
Parameters:ffuncs (HarfBuzz.font_funcs_t) – font functions.
Return type:int

New in version 0.9.2.

HarfBuzz.font_funcs_make_immutable(ffuncs)
Parameters:ffuncs (HarfBuzz.font_funcs_t) – font functions.

New in version 0.9.2.

HarfBuzz.font_funcs_set_font_h_extents_func(ffuncs, func, *user_data)
Parameters:

New in version 1.1.2.

HarfBuzz.font_funcs_set_font_v_extents_func(ffuncs, func, *user_data)
Parameters:

New in version 1.1.2.

HarfBuzz.font_funcs_set_glyph_contour_point_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_extents_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_from_name_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_func(ffuncs, func, *user_data)
Parameters:

Deprecated. Use HarfBuzz.font_funcs_set_nominal_glyph_func() and HarfBuzz.font_funcs_set_variation_glyph_func() instead.

New in version 0.9.2.

Deprecated since version 1.2.3.

HarfBuzz.font_funcs_set_glyph_h_advance_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_h_advances_func(ffuncs, func, *user_data)
Parameters:

New in version 1.8.6.

HarfBuzz.font_funcs_set_glyph_h_kerning_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_h_origin_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_name_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_v_advance_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_glyph_v_advances_func(ffuncs, func, *user_data)
Parameters:

New in version 1.8.6.

HarfBuzz.font_funcs_set_glyph_v_kerning_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

Deprecated since version 2.0.0.

HarfBuzz.font_funcs_set_glyph_v_origin_func(ffuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.font_funcs_set_nominal_glyph_func(ffuncs, func, *user_data)
Parameters:

New in version 1.2.3.

HarfBuzz.font_funcs_set_nominal_glyphs_func(ffuncs, func, *user_data)
Parameters:

New in version 2.0.0.

HarfBuzz.font_funcs_set_variation_glyph_func(ffuncs, func, *user_data)
Parameters:

New in version 1.2.3.

HarfBuzz.font_get_empty()
Return type:HarfBuzz.font_t

New in version 0.9.2.

HarfBuzz.font_get_extents_for_direction(font, direction)
Parameters:
Return type:

extents: HarfBuzz.font_extents_t

New in version 1.1.3.

HarfBuzz.font_get_face(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:HarfBuzz.face_t

New in version 0.9.2.

HarfBuzz.font_get_glyph(font, unicode, variation_selector)
Parameters:
Return type:

(int, glyph: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_advance_for_direction(font, glyph, direction)
Parameters:
Return type:

(x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_advances_for_direction(font, direction, count, first_glyph, glyph_stride, first_advance, advance_stride)
Parameters:

New in version 1.8.6.

HarfBuzz.font_get_glyph_contour_point(font, glyph, point_index)
Parameters:
Return type:

(int, x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_contour_point_for_origin(font, glyph, point_index, direction)
Parameters:
Return type:

(int, x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_extents(font, glyph)
Parameters:
Return type:

(int, extents: HarfBuzz.glyph_extents_t)

New in version 0.9.2.

HarfBuzz.font_get_glyph_extents_for_origin(font, glyph, direction)
Parameters:
Return type:

(int, extents: HarfBuzz.glyph_extents_t)

New in version 0.9.2.

HarfBuzz.font_get_glyph_from_name(font, name)
Parameters:
Return type:

(int, glyph: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_h_advance(font, glyph)
Parameters:
Return type:

int

New in version 0.9.2.

HarfBuzz.font_get_glyph_h_advances(font, count, first_glyph, glyph_stride, first_advance, advance_stride)
Parameters:

New in version 1.8.6.

HarfBuzz.font_get_glyph_h_kerning(font, left_glyph, right_glyph)
Parameters:
Return type:

int

New in version 0.9.2.

HarfBuzz.font_get_glyph_h_origin(font, glyph)
Parameters:
Return type:

(int, x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_kerning_for_direction(font, first_glyph, second_glyph, direction)
Parameters:
Return type:

(x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_name(font, glyph, name)
Parameters:
Return type:

int

New in version 0.9.2.

HarfBuzz.font_get_glyph_origin_for_direction(font, glyph, direction)
Parameters:
Return type:

(x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_glyph_v_advance(font, glyph)
Parameters:
Return type:

int

New in version 0.9.2.

HarfBuzz.font_get_glyph_v_advances(font, count, first_glyph, glyph_stride, first_advance, advance_stride)
Parameters:

New in version 1.8.6.

HarfBuzz.font_get_glyph_v_kerning(font, top_glyph, bottom_glyph)
Parameters:
Return type:

int

New in version 0.9.2.

Deprecated since version 2.0.0.

HarfBuzz.font_get_glyph_v_origin(font, glyph)
Parameters:
Return type:

(int, x: int, y: int)

New in version 0.9.2.

HarfBuzz.font_get_h_extents(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:(int, extents: HarfBuzz.font_extents_t)

New in version 1.1.3.

HarfBuzz.font_get_nominal_glyph(font, unicode)
Parameters:
Return type:

(int, glyph: int)

New in version 1.2.3.

HarfBuzz.font_get_nominal_glyphs(font, count, first_unicode, unicode_stride, first_glyph, glyph_stride)
Parameters:
Return type:

int

New in version 2.6.3.

HarfBuzz.font_get_parent(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:HarfBuzz.font_t

New in version 0.9.2.

HarfBuzz.font_get_ppem(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:(x_ppem: int, y_ppem: int)

New in version 0.9.2.

HarfBuzz.font_get_ptem(font)
Parameters:font (HarfBuzz.font_t) – a font.
Returns:Point size.
Return type:float

Gets the “point size” of the font. A value of 0 means unset.

New in version 0.9.2.

HarfBuzz.font_get_scale(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:(x_scale: int, y_scale: int)

New in version 0.9.2.

HarfBuzz.font_get_v_extents(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:(int, extents: HarfBuzz.font_extents_t)

New in version 1.1.3.

HarfBuzz.font_get_var_coords_normalized(font, length)
Parameters:
Return type:

int

Return value is valid as long as variation coordinates of the font are not modified.

New in version 1.4.2.

HarfBuzz.font_get_variation_glyph(font, unicode, variation_selector)
Parameters:
Return type:

(int, glyph: int)

New in version 1.2.3.

HarfBuzz.font_glyph_from_string(font, s)
Parameters:
Return type:

(int, glyph: int)

New in version 0.9.2.

HarfBuzz.font_glyph_to_string(font, glyph, s)
Parameters:

New in version 0.9.2.

HarfBuzz.font_is_immutable(font)
Parameters:font (HarfBuzz.font_t) – a font.
Return type:int

New in version 0.9.2.

HarfBuzz.font_make_immutable(font)
Parameters:font (HarfBuzz.font_t) – a font.

New in version 0.9.2.

HarfBuzz.font_set_face(font, face)
Parameters:

Sets font-face of font.

New in version 1.4.3.

HarfBuzz.font_set_funcs(font, klass, font_data, destroy)
Parameters:

New in version 0.9.2.

HarfBuzz.font_set_funcs_data(font, font_data, destroy)
Parameters:

New in version 0.9.2.

HarfBuzz.font_set_parent(font, parent)
Parameters:

Sets parent font of font.

New in version 1.0.5.

HarfBuzz.font_set_ppem(font, x_ppem, y_ppem)
Parameters:

New in version 0.9.2.

HarfBuzz.font_set_ptem(font, ptem)
Parameters:

Sets “point size” of the font. Set to 0 to unset.

There are 72 points in an inch.

New in version 1.6.0.

HarfBuzz.font_set_scale(font, x_scale, y_scale)
Parameters:

New in version 0.9.2.

HarfBuzz.font_set_var_coords_design(font, coords, coords_length)
Parameters:

New in version 1.4.2.

HarfBuzz.font_set_var_coords_normalized(font, coords, coords_length)
Parameters:

New in version 1.4.2.

HarfBuzz.font_set_var_named_instance(font, instance_index)
Parameters:

Sets design coords of a font from a named instance index.

New in version 2.6.0.

HarfBuzz.font_set_variations(font, variations, variations_length)
Parameters:

New in version 1.4.2.

HarfBuzz.font_subtract_glyph_origin_for_direction(font, glyph, direction)
Parameters:
Return type:

(x: int, y: int)

New in version 0.9.2.

HarfBuzz.ft_font_changed(font)
Parameters:font (HarfBuzz.font_t) –
HarfBuzz.ft_font_get_load_flags(font)
Parameters:font (HarfBuzz.font_t) –
Return type:int

New in version 1.0.5.

HarfBuzz.ft_font_set_funcs(font)
Parameters:font (HarfBuzz.font_t) –
HarfBuzz.ft_font_set_load_flags(font, load_flags)
Parameters:

New in version 1.0.5.

HarfBuzz.glib_blob_create(gbytes)
Parameters:gbytes (GLib.Bytes) –
Return type:HarfBuzz.blob_t

New in version 0.9.38.

HarfBuzz.glib_get_unicode_funcs()
Return type:HarfBuzz.unicode_funcs_t
HarfBuzz.glib_script_from_script(script)
Parameters:script (HarfBuzz.script_t) –
Return type:GLib.UnicodeScript
HarfBuzz.glib_script_to_script(script)
Parameters:script (GLib.UnicodeScript) –
Return type:HarfBuzz.script_t
HarfBuzz.glyph_info_get_glyph_flags(info)
Parameters:info (HarfBuzz.glyph_info_t) – a HarfBuzz.glyph_info_t.
Returns:The HarfBuzz.glyph_flags_t encoded within info.
Return type:HarfBuzz.glyph_flags_t

Returns glyph flags encoded within a HarfBuzz.glyph_info_t.

New in version 1.5.0.

HarfBuzz.language_from_string(str)
Parameters:str (bytes) – a string representing a BCP 47 language tag
Returns:The HarfBuzz.language_t corresponding to the BCP 47 language tag.
Return type:HarfBuzz.language_t

Converts str representing a BCP 47 language tag to the corresponding HarfBuzz.language_t.

New in version 0.9.2.

HarfBuzz.language_get_default()
Return type:HarfBuzz.language_t

Get default language from current locale.

Note that the first time this function is called, it calls “setlocale (LC_CTYPE, nullptr)” to fetch current locale. The underlying setlocale function is, in many implementations, NOT threadsafe. To avoid problems, call this function once before multiple threads can call it. This function is only used from HarfBuzz.buffer_guess_segment_properties() by HarfBuzz itself.

New in version 0.9.2.

HarfBuzz.language_to_string(language)
Parameters:language (HarfBuzz.language_t) – an HarfBuzz.language_t to convert.
Returns:A None-terminated string representing the language. Must not be freed by the caller.
Return type:str

See HarfBuzz.language_from_string().

New in version 0.9.2.

HarfBuzz.map_allocation_successful(map)
Parameters:map (HarfBuzz.map_t) – a map.
Return type:int

New in version 1.7.7.

HarfBuzz.map_clear(map)
Parameters:map (HarfBuzz.map_t) – a map.

New in version 1.7.7.

HarfBuzz.map_create()
Return type:HarfBuzz.map_t

New in version 1.7.7.

HarfBuzz.map_del(map, key)
Parameters:

New in version 1.7.7.

HarfBuzz.map_get(map, key)
Parameters:
Return type:

int

New in version 1.7.7.

HarfBuzz.map_get_empty()
Return type:HarfBuzz.map_t

New in version 1.7.7.

HarfBuzz.map_get_population(map)
Parameters:map (HarfBuzz.map_t) – a map.
Return type:int

New in version 1.7.7.

HarfBuzz.map_has(map, key)
Parameters:
Return type:

int

New in version 1.7.7.

HarfBuzz.map_is_empty(map)
Parameters:map (HarfBuzz.map_t) – a map.
Return type:int

New in version 1.7.7.

HarfBuzz.map_set(map, key, value)
Parameters:

New in version 1.7.7.

HarfBuzz.ot_color_glyph_get_layers(face, glyph, start_offset)
Parameters:
Returns:

Total number of layers available for the glyph index queried

layers:The array of layers found

Return type:

(int, layers: [HarfBuzz.ot_color_layer_t])

Fetches a list of all color layers for the specified glyph index in the specified face. The list returned will begin at the offset provided.

New in version 2.1.0.

HarfBuzz.ot_color_glyph_reference_png(font, glyph)
Parameters:
Returns:

An HarfBuzz.blob_t containing the PNG image for the glyph, if available

Return type:

HarfBuzz.blob_t

Fetches the PNG image for a glyph. This function takes a font object, not a face object, as input. To get an optimally sized PNG blob, the UPEM value must be set on the font object. If UPEM is unset, the blob returned will be the largest PNG available.

New in version 2.1.0.

HarfBuzz.ot_color_glyph_reference_svg(face, glyph)
Parameters:
Returns:

An HarfBuzz.blob_t containing the SVG document of the glyph, if available

Return type:

HarfBuzz.blob_t

Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded.

New in version 2.1.0.

HarfBuzz.ot_color_has_layers(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if data found, false otherwise
Return type:int

Tests whether a face includes any COLR color layers.

New in version 2.1.0.

HarfBuzz.ot_color_has_palettes(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if data found, false otherwise
Return type:int

Tests whether a face includes a CPAL color-palette table.

New in version 2.1.0.

HarfBuzz.ot_color_has_png(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if data found, false otherwise
Return type:int

Tests whether a face has PNG glyph images (either in CBDT or sbix tables).

New in version 2.1.0.

HarfBuzz.ot_color_has_svg(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon.
Returns:true if data found, false otherwise.
Return type:int

Tests whether a face includes any SVG glyph images.

New in version 2.1.0.

HarfBuzz.ot_color_palette_color_get_name_id(face, color_index)
Parameters:
Returns:

the Name ID found for the color.

Return type:

int

Fetches the name table Name ID that provides display names for the specificed color in a face’s CPAL color palette.

Display names can be generic (e.g., “Background”) or specific (e.g., “Eye color”).

New in version 2.1.0.

HarfBuzz.ot_color_palette_get_colors(face, palette_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • palette_index (int) – the index of the color palette to query
  • start_offset (int) – offset of the first color to retrieve
Returns:

the total number of colors in the palette

colors:The array of #hb_color_t records found

Return type:

(int, colors: [int])

Fetches a list of the colors in a color palette.

After calling this function, colors will be filled with the palette colors. If colors is None, the function will just return the number of total colors without storing any actual colors; this can be used for allocating a buffer of suitable size before calling HarfBuzz.ot_color_palette_get_colors() a second time.

New in version 2.1.0.

HarfBuzz.ot_color_palette_get_count(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:the number of palettes found
Return type:int

Fetches the number of color palettes in a face.

New in version 2.1.0.

HarfBuzz.ot_color_palette_get_flags(face, palette_index)
Parameters:
Returns:

the HarfBuzz.ot_color_palette_flags_t of the requested color palette

Return type:

HarfBuzz.ot_color_palette_flags_t

Fetches the flags defined for a color palette.

New in version 2.1.0.

HarfBuzz.ot_color_palette_get_name_id(face, palette_index)
Parameters:
Returns:

the Named ID found for the palette. If the requested palette has no name the result is #HB_OT_NAME_ID_INVALID.

Return type:

int

Fetches the name table Name ID that provides display names for a CPAL color palette.

Palette display names can be generic (e.g., “Default”) or provide specific, themed names (e.g., “Spring”, “Summer”, “Fall”, and “Winter”).

New in version 2.1.0.

HarfBuzz.ot_font_set_funcs(font)
Parameters:font (HarfBuzz.font_t) –

New in version 0.9.28.

HarfBuzz.ot_layout_collect_features(face, table_tag, scripts, languages, features)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • scripts (int) – The array of scripts to collect features for
  • languages (int) – The array of languages to collect features for
  • features (int) – The array of features to collect
Returns:

The array of feature indexes found for the query

Return type:

feature_indexes: HarfBuzz.set_t

Fetches a list of all feature indexes in the specified face’s GSUB table or GPOS table, underneath the specified scripts, languages, and features. If no list of scripts is provided, all scripts will be queried. If no list of languages is provided, all languages will be queried. If no list of features is provided, all features will be queried.

New in version 1.8.5.

HarfBuzz.ot_layout_collect_lookups(face, table_tag, scripts, languages, features)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • scripts (int) – The array of scripts to collect lookups for
  • languages (int) – The array of languages to collect lookups for
  • features (int) – The array of features to collect lookups for
Returns:

The array of lookup indexes found for the query

Return type:

lookup_indexes: HarfBuzz.set_t

Fetches a list of all feature-lookup indexes in the specified face’s GSUB table or GPOS table, underneath the specified scripts, languages, and features. If no list of scripts is provided, all scripts will be queried. If no list of languages is provided, all languages will be queried. If no list of features is provided, all features will be queried.

New in version 0.9.8.

HarfBuzz.ot_layout_feature_get_characters(face, table_tag, feature_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – table tag to query, “GSUB” or “GPOS”.
  • feature_index (int) – index of feature to query.
  • start_offset (int) – offset of the first character to retrieve
Returns:

Number of total sample characters in the cvXX feature.

characters:A buffer pointer. The Unicode codepoints of the characters for which this feature provides glyph variants.

Return type:

(int, characters: [int])

Fetches a list of the characters defined as having a variant under the specified “Character Variant” (“cvXX”) feature tag.

Note: If the char_count output value is equal to its input value, then there is a chance there were more characters defined under the feature tag than were returned. This function can be called with incrementally larger start_offset until the char_count output value is lower than its input value, or the size of the characters array can be increased.

New in version 2.0.0.

HarfBuzz.ot_layout_feature_get_lookups(face, table_tag, feature_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • feature_index (int) – The index of the requested feature
  • start_offset (int) – offset of the first lookup to retrieve
Returns:

lookup_indexes:The array of lookup indexes found for the query

Return type:

(int, lookup_indexes: [int])

Fetches a list of all lookups enumerated for the specified feature, in the specified face’s GSUB table or GPOS table. The list returned will begin at the offset provided.

New in version 0.9.7.

HarfBuzz.ot_layout_feature_get_name_ids(face, table_tag, feature_index)
Parameters:
Returns:

true if data found, false otherwise

label_id:The ‘name’ table name ID that specifies a string for a user-interface label for this feature. (May be None.)
tooltip_id:The ‘name’ table name ID that specifies a string that an application can use for tooltip text for this feature. (May be None.)
sample_id:The ‘name’ table name ID that specifies sample text that illustrates the effect of this feature. (May be None.)
num_named_parameters:
 Number of named parameters. (May be zero.)
first_param_id:The first ‘name’ table name ID used to specify strings for user-interface labels for the feature parameters. (Must be zero if numParameters is zero.)

Return type:

(int, label_id: int, tooltip_id: int, sample_id: int, num_named_parameters: int, first_param_id: int)

Fetches name indices from feature parameters for “Stylistic Set” (‘ssXX’) or “Character Variant” (‘cvXX’) features.

New in version 2.0.0.

HarfBuzz.ot_layout_feature_with_variations_get_lookups(face, table_tag, feature_index, variations_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • feature_index (int) – The index of the feature to query
  • variations_index (int) – The index of the feature variation to query
  • start_offset (int) – offset of the first lookup to retrieve
Returns:

lookup_indexes:The array of lookups found for the query

Return type:

(int, lookup_indexes: [int])

Fetches a list of all lookups enumerated for the specified feature, in the specified face’s GSUB table or GPOS table, enabled at the specified variations index. The list returned will begin at the offset provided.

HarfBuzz.ot_layout_get_attach_points(face, glyph, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – The HarfBuzz.face_t to work on
  • glyph (int) – The #hb_codepoint_t code point to query
  • start_offset (int) – offset of the first attachment point to retrieve
Returns:

point_array:The array of attachment points found for the query

Return type:

(int, point_array: [int])

Fetches a list of all attachment points for the specified glyph in the GDEF table of the face. The list returned will begin at the offset provided.

Useful if the client program wishes to cache the list.

HarfBuzz.ot_layout_get_baseline(font, baseline_tag, direction, script_tag, language_tag)
Parameters:
Returns:

if found baseline value in the the font.

coord:baseline value if found.

Return type:

(int, coord: int)

Fetches a baseline value from the face.

New in version 2.6.0.

HarfBuzz.ot_layout_get_glyph_class(face, glyph)
Parameters:
Returns:

The HarfBuzz.ot_layout_glyph_class_t glyph class of the given code point in the GDEF table of the face.

Return type:

HarfBuzz.ot_layout_glyph_class_t

Fetches the GDEF class of the requested glyph in the specified face.

New in version 0.9.7.

HarfBuzz.ot_layout_get_glyphs_in_class(face, klass)
Parameters:
Returns:

The HarfBuzz.set_t set of all glyphs belonging to the requested class.

Return type:

glyphs: HarfBuzz.set_t

Retrieves the set of all glyphs from the face that belong to the requested glyph class in the face’s GDEF table.

New in version 0.9.7.

HarfBuzz.ot_layout_get_ligature_carets(font, direction, glyph, start_offset)
Parameters:
Returns:

caret_array:The array of caret positions found for the query

Return type:

(int, caret_array: [int])

Fetches a list of the caret positions defined for a ligature glyph in the GDEF table of the font. The list returned will begin at the offset provided.

HarfBuzz.ot_layout_get_size_params(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if data found, false otherwise
design_size:The design size of the face
subfamily_id:The identifier of the face within the font subfamily
subfamily_name_id:
 The ‘name’ table name ID of the face within the font subfamily
range_start:The minimum size of the recommended size range for the face
range_end:The maximum size of the recommended size range for the face
Return type:(int, design_size: int, subfamily_id: int, subfamily_name_id: int, range_start: int, range_end: int)

Fetches optical-size feature data (i.e., the size feature from GPOS). Note that the subfamily_id and the subfamily name string (accessible via the subfamily_name_id) as used here are defined as pertaining only to fonts within a font family that differ specifically in their respective size ranges; other ways to differentiate fonts within a subfamily are not covered by the size feature.

For more information on this distinction, see the size documentation at https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-39size39

New in version 0.9.10.

HarfBuzz.ot_layout_has_glyph_classes(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if data found, false otherwise
Return type:int

Tests whether a face has any glyph classes defined in its GDEF table.

HarfBuzz.ot_layout_has_positioning(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if the face has GPOS data, false otherwise
Return type:int
HarfBuzz.ot_layout_has_substitution(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
Returns:true if data found, false otherwise
Return type:int

Tests whether the specified face includes any GSUB substitutions.

HarfBuzz.ot_layout_language_find_feature(face, table_tag, script_index, language_index, feature_tag)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_index (int) – The index of the requested language tag
  • feature_tag (int) – #hb_tag_t of the feature tag requested
Returns:

true if the feature is found, false otherwise

feature_index:The index of the requested feature

Return type:

(int, feature_index: int)

Fetches the index of a given feature tag in the specified face’s GSUB table or GPOS table, underneath the specified script and language.

HarfBuzz.ot_layout_language_get_feature_indexes(face, table_tag, script_index, language_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_index (int) – The index of the requested language tag
  • start_offset (int) – offset of the first feature tag to retrieve
Returns:

feature_indexes:
 The array of feature indexes found for the query

Return type:

(int, feature_indexes: [int])

Fetches a list of all features in the specified face’s GSUB table or GPOS table, underneath the specified script and language. The list returned will begin at the offset provided.

HarfBuzz.ot_layout_language_get_feature_tags(face, table_tag, script_index, language_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_index (int) – The index of the requested language tag
  • start_offset (int) – offset of the first feature tag to retrieve
Returns:

feature_tags:The array of #hb_tag_t feature tags found for the query

Return type:

(int, feature_tags: [int])

Fetches a list of all features in the specified face’s GSUB table or GPOS table, underneath the specified script and language. The list returned will begin at the offset provided.

HarfBuzz.ot_layout_language_get_required_feature(face, table_tag, script_index, language_index, feature_index)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_index (int) – The index of the requested language tag
  • feature_index (int) – The index of the requested feature
Returns:

true if the feature is found, false otherwise

feature_tag:The #hb_tag_t of the requested feature

Return type:

(int, feature_tag: int)

Fetches the tag of a requested feature index in the given face’s GSUB or GPOS table, underneath the specified script and language.

New in version 0.9.30.

HarfBuzz.ot_layout_language_get_required_feature_index(face, table_tag, script_index, language_index)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_index (int) – The index of the requested language tag
Returns:

true if the feature is found, false otherwise

feature_index:The index of the requested feature

Return type:

(int, feature_index: int)

Fetches the index of a requested feature in the given face’s GSUB or GPOS table, underneath the specified script and language.

HarfBuzz.ot_layout_lookup_collect_glyphs(face, table_tag, lookup_index)
Parameters:
Returns:

glyphs_before:Array of glyphs preceding the substitution range
glyphs_input:Array of input glyphs that would be substituted by the lookup
glyphs_after:Array of glyphs following the substition range
glyphs_output:Array of glyphs that would be the substitued output of the lookup

Return type:

(glyphs_before: HarfBuzz.set_t, glyphs_input: HarfBuzz.set_t, glyphs_after: HarfBuzz.set_t, glyphs_output: HarfBuzz.set_t)

Fetches a list of all glyphs affected by the specified lookup in the specified face’s GSUB table or GPOS table.

New in version 0.9.7.

HarfBuzz.ot_layout_lookup_substitute_closure(face, lookup_index)
Parameters:
Returns:

Array of glyphs comprising the transitive closure of the lookup

Return type:

glyphs: HarfBuzz.set_t

Compute the transitive closure of glyphs needed for a specified lookup.

New in version 0.9.7.

HarfBuzz.ot_layout_lookup_would_substitute(face, lookup_index, glyphs, glyphs_length, zero_context)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • lookup_index (int) – The index of the lookup to query
  • glyphs (int) – The sequence of glyphs to query for substitution
  • glyphs_length (int) – The length of the glyph sequence
  • zero_context (int) – #hb_bool_t indicating whether substitutions should be context-free
Returns:

true if a substitution would be triggered, false otherwise

Return type:

int

Tests whether a specified lookup in the specified face would trigger a substitution on the given glyph sequence.

New in version 0.9.7.

HarfBuzz.ot_layout_lookups_substitute_closure(face, lookups)
Parameters:
Returns:

Array of glyphs comprising the transitive closure of the lookups

Return type:

glyphs: HarfBuzz.set_t

Compute the transitive closure of glyphs needed for all of the provided lookups.

New in version 1.8.1.

HarfBuzz.ot_layout_script_find_language(face, table_tag, script_index, language_tag, language_index)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_tag (int) – The #hb_tag_t of the requested language
  • language_index (int) – The index of the requested language
Returns:

true if the language tag is found, false otherwise

Return type:

int

Fetches the index of a given language tag in the specified face’s GSUB table or GPOS table, underneath the specified script tag.

Deprecated since version ???: ??

HarfBuzz.ot_layout_script_get_language_tags(face, table_tag, script_index, start_offset)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • start_offset (int) – offset of the first language tag to retrieve
Returns:

language_tags:Array of language tags found in the table

Return type:

(int, language_tags: [int])

Fetches a list of language tags in the given face’s GSUB or GPOS table, underneath the specified script index. The list returned will begin at the offset provided.

HarfBuzz.ot_layout_script_select_language(face, table_tag, script_index, language_count, language_tags)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_index (int) – The index of the requested script tag
  • language_count (int) – The number of languages in the specified script
  • language_tags (int) – The array of language tags
Returns:

true if the language tag is found, false otherwise

language_index:The index of the requested language

Return type:

(int, language_index: int)

Fetches the index of a given language tag in the specified face’s GSUB table or GPOS table, underneath the specified script index.

New in version 2.0.0.

HarfBuzz.ot_layout_table_choose_script(face, table_tag, script_tags)
Parameters:
Returns:

script_index:The index of the requested script tag
chosen_script:#hb_tag_t of the script tag requested

Return type:

(int, script_index: int, chosen_script: int)

Deprecated since 2.0.0

HarfBuzz.ot_layout_table_find_feature_variations(face, table_tag, coords, num_coords)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • coords (int) – The variation coordinates to query
  • num_coords (int) – The number of variation coorinates
Returns:

variations_index:
 The array of feature variations found for the query

Return type:

(int, variations_index: int)

Fetches a list of feature variations in the specified face’s GSUB table or GPOS table, at the specified variation coordinates.

HarfBuzz.ot_layout_table_find_script(face, table_tag, script_tag)
Parameters:
Returns:

true if the script is found, false otherwise

script_index:The index of the requested script tag

Return type:

(int, script_index: int)

Fetches the index if a given script tag in the specified face’s GSUB table or GPOS table.

HarfBuzz.ot_layout_table_get_feature_tags(face, table_tag, start_offset)
Parameters:
Returns:

feature_tags:Array of feature tags found in the table

Return type:

(int, feature_tags: [int])

Fetches a list of all feature tags in the given face’s GSUB or GPOS table.

HarfBuzz.ot_layout_table_get_lookup_count(face, table_tag)
Parameters:
Return type:

int

Fetches the total number of lookups enumerated in the specified face’s GSUB table or GPOS table.

New in version 0.9.22.

HarfBuzz.ot_layout_table_get_script_tags(face, table_tag, start_offset)
Parameters:
Returns:

script_tags:The array of #hb_tag_t script tags found for the query

Return type:

(int, script_tags: [int])

Fetches a list of all scripts enumerated in the specified face’s GSUB table or GPOS table. The list returned will begin at the offset provided.

HarfBuzz.ot_layout_table_select_script(face, table_tag, script_count, script_tags)
Parameters:
  • face (HarfBuzz.face_t) – HarfBuzz.face_t to work upon
  • table_tag (int) – HB_OT_TAG_GSUB or HB_OT_TAG_GPOS
  • script_count (int) – Number of script tags in the array
  • script_tags (int) – Array of #hb_tag_t script tags
Returns:

script_index:The index of the requested script
chosen_script:#hb_tag_t of the requested script

Return type:

(int, script_index: int, chosen_script: int)

New in version 2.0.0.

HarfBuzz.ot_math_get_constant(font, constant)
Parameters:
Returns:

the requested constant or zero

Return type:

int

Fetches the specified math constant. For most constants, the value returned is an #hb_position_t.

However, if the requested constant is HarfBuzz.ot_math_constant_t.SCRIPT_PERCENT_SCALE_DOWN, HarfBuzz.ot_math_constant_t.SCRIPT_SCRIPT_PERCENT_SCALE_DOWN or HarfBuzz.ot_math_constant_t.SCRIPT_PERCENT_SCALE_DOWN, then the return value is an integer between 0 and 100 representing that percentage.

New in version 1.3.3.

HarfBuzz.ot_math_get_glyph_assembly(font, glyph, direction, start_offset)
Parameters:
Returns:

the total number of parts in the glyph assembly

parts:the glyph parts returned
italics_correction:
 italics correction of the glyph assembly

Return type:

(int, parts: [HarfBuzz.ot_math_glyph_part_t], italics_correction: int)

Fetches the GlyphAssembly for the specified font, glyph index, and direction. Returned are a list of HarfBuzz.ot_math_glyph_part_t glyph parts that can be used to draw the glyph and an italics-correction value (if one is defined in the font).

The direction parameter is only used to select between horizontal or vertical directions for the construction. Even though all HarfBuzz.direction_t values are accepted, only the result of #HB_DIRECTION_IS_HORIZONTAL is considered.

New in version 1.3.3.

HarfBuzz.ot_math_get_glyph_italics_correction(font, glyph)
Parameters:
Returns:

the italics correction of the glyph or zero

Return type:

int

Fetches an italics-correction value (if one exists) for the specified glyph index.

New in version 1.3.3.

HarfBuzz.ot_math_get_glyph_kerning(font, glyph, kern, correction_height)
Parameters:
Returns:

requested kerning value or zero

Return type:

int

Fetches the math kerning (cut-ins) value for the specified font, glyph index, and kern.

If the MathKern table is found, the function examines it to find a height value that is greater or equal to correction_height. If such a height value is found, corresponding kerning value from the table is returned. If no such height value is found, the last kerning value is returned.

New in version 1.3.3.

HarfBuzz.ot_math_get_glyph_top_accent_attachment(font, glyph)
Parameters:
Returns:

the top accent attachment of the glyph or 0.5 * the advance width of glyph

Return type:

int

Fetches a top-accent-attachment value (if one exists) for the specified glyph index.

For any glyph that does not have a top-accent-attachment value - that is, a glyph not covered by the MathTopAccentAttachment table (or, when font has no MathTopAccentAttachment table or no MATH table, any glyph) - the function synthesizes a value, returning the position at one-half the glyph’s advance width.

New in version 1.3.3.

HarfBuzz.ot_math_get_glyph_variants(font, glyph, direction, start_offset)
Parameters:
Returns:

the total number of size variants available or zero

variants:array of variants returned

Return type:

(int, variants: [HarfBuzz.ot_math_glyph_variant_t])

Fetches the MathGlyphConstruction for the specified font, glyph index, and direction. The corresponding list of size variants is returned as a list of HarfBuzz.ot_math_glyph_variant_t structs.

The direction parameter is only used to select between horizontal or vertical directions for the construction. Even though all HarfBuzz.direction_t values are accepted, only the result of #HB_DIRECTION_IS_HORIZONTAL is considered.

New in version 1.3.3.

HarfBuzz.ot_math_get_min_connector_overlap(font, direction)
Parameters:
Returns:

requested minimum connector overlap or zero

Return type:

int

Fetches the MathVariants table for the specified font and returns the minimum overlap of connecting glyphs that are required to draw a glyph assembly in the specified direction.

The direction parameter is only used to select between horizontal or vertical directions for the construction. Even though all HarfBuzz.direction_t values are accepted, only the result of #HB_DIRECTION_IS_HORIZONTAL is considered.

New in version 1.3.3.

HarfBuzz.ot_math_has_data(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to test
Returns:true if the table is found, false otherwise
Return type:int

Tests whether a face has a MATH table.

New in version 1.3.3.

HarfBuzz.ot_math_is_glyph_extended_shape(face, glyph)
Parameters:
Returns:

true if the glyph is an extended shape, false otherwise

Return type:

int

Tests whether the given glyph index is an extended shape in the face.

New in version 1.3.3.

HarfBuzz.ot_meta_get_entry_tags(face, start_offset, entries_count, entries)
Parameters:
Return type:

int

HarfBuzz.ot_meta_reference_entry(face, meta_tag)
Parameters:
Returns:

A blob containing the blob.

Return type:

HarfBuzz.blob_t

It fetches metadata entry of a given tag from a font.

New in version 2.6.0.

HarfBuzz.ot_metrics_get_position(font, metrics_tag)
Parameters:
Returns:

Whether found the requested metrics in the font.

position:result of metrics value from the font.

Return type:

(int, position: int)

It fetches metrics value corresponding to a given tag from a font.

New in version 2.6.0.

HarfBuzz.ot_metrics_get_variation(font, metrics_tag)
Parameters:
Return type:

float

New in version 2.6.0.

HarfBuzz.ot_metrics_get_x_variation(font, metrics_tag)
Parameters:
Return type:

int

New in version 2.6.0.

HarfBuzz.ot_metrics_get_y_variation(font, metrics_tag)
Parameters:
Return type:

int

New in version 2.6.0.

HarfBuzz.ot_name_get_utf16(face, name_id, language)
Parameters:
Returns:

full length of the requested string, or 0 if not found.

text:buffer to write fetched name into.

Return type:

(int, text: [int])

Fetches a font name from the OpenType ‘name’ table. If language is HarfBuzz.LANGUAGE_INVALID, English (“en”) is assumed. Returns string in UTF-16 encoding.

New in version 2.1.0.

HarfBuzz.ot_name_get_utf32(face, name_id, language)
Parameters:
Returns:

full length of the requested string, or 0 if not found.

text:buffer to write fetched name into.

Return type:

(int, text: [int])

Fetches a font name from the OpenType ‘name’ table. If language is HarfBuzz.LANGUAGE_INVALID, English (“en”) is assumed. Returns string in UTF-32 encoding.

New in version 2.1.0.

HarfBuzz.ot_name_get_utf8(face, name_id, language)
Parameters:
Returns:

full length of the requested string, or 0 if not found.

text:buffer to write fetched name into.

Return type:

(int, text: [str])

Fetches a font name from the OpenType ‘name’ table. If language is HarfBuzz.LANGUAGE_INVALID, English (“en”) is assumed. Returns string in UTF-8 encoding.

New in version 2.1.0.

HarfBuzz.ot_name_list_names(face)
Parameters:face (HarfBuzz.face_t) – font face.
Returns:Array of available name entries.
Return type:[HarfBuzz.ot_name_entry_t]

Enumerates all available name IDs and language combinations. Returned array is owned by the face and should not be modified. It can be used as long as face is alive.

New in version 2.1.0.

HarfBuzz.ot_shape_glyphs_closure(font, buffer, features, num_features, glyphs)
Parameters:

New in version 0.9.2.

HarfBuzz.ot_tag_from_language(language)
Parameters:language (HarfBuzz.language_t) –
Return type:int
HarfBuzz.ot_tag_to_language(tag)
Parameters:tag (int) –
Return type:HarfBuzz.language_t

New in version 0.9.2.

HarfBuzz.ot_tag_to_script(tag)
Parameters:tag (int) –
Return type:HarfBuzz.script_t
HarfBuzz.ot_tags_from_script(script, script_tag_1, script_tag_2)
Parameters:
HarfBuzz.ot_tags_from_script_and_language(script, language, script_count, language_count)
Parameters:
Returns:

script_tags:array of size at least script_count to store the script tag results
language_tags:array of size at least language_count to store the language tag results

Return type:

(script_tags: int, language_tags: int)

Converts an HarfBuzz.script_t and an HarfBuzz.language_t to script and language tags.

New in version 2.0.0.

HarfBuzz.ot_tags_to_script_and_language(script_tag, language_tag, script, language)
Parameters:

Converts a script tag and a language tag to an HarfBuzz.script_t and an HarfBuzz.language_t.

New in version 2.0.0.

HarfBuzz.ot_var_find_axis(face, axis_tag, axis_index, axis_info)
Parameters:
Return type:

int

New in version 1.4.2.

Deprecated since version 2.2.0.

HarfBuzz.ot_var_find_axis_info(face, axis_tag, axis_info)
Parameters:
Return type:

int

New in version 2.2.0.

HarfBuzz.ot_var_get_axes(face, start_offset, axes_count, axes_array)
Parameters:
Return type:

int

New in version 1.4.2.

Deprecated since version 2.2.0.

HarfBuzz.ot_var_get_axis_count(face)
Parameters:face (HarfBuzz.face_t) –
Return type:int

New in version 1.4.2.

HarfBuzz.ot_var_get_axis_infos(face, start_offset, axes_count, axes_array)
Parameters:
Return type:

int

New in version 2.2.0.

HarfBuzz.ot_var_get_named_instance_count(face)
Parameters:face (HarfBuzz.face_t) –
Return type:int
HarfBuzz.ot_var_has_data(face)
Parameters:face (HarfBuzz.face_t) – HarfBuzz.face_t to test
Returns:true if face has a `fvar’ table and false otherwise
Return type:int

This function allows to verify the presence of OpenType variation data on the face.

New in version 1.4.2.

HarfBuzz.ot_var_named_instance_get_design_coords(face, instance_index, coords_length, coords)
Parameters:
Return type:

int

HarfBuzz.ot_var_named_instance_get_postscript_name_id(face, instance_index)
Parameters:
Return type:

int

HarfBuzz.ot_var_named_instance_get_subfamily_name_id(face, instance_index)
Parameters:
Return type:

int

HarfBuzz.ot_var_normalize_coords(face, coords_length, design_coords, normalized_coords)
Parameters:

New in version 1.4.2.

HarfBuzz.ot_var_normalize_variations(face, variations, variations_length, coords, coords_length)
Parameters:

New in version 1.4.2.

HarfBuzz.script_from_iso15924_tag(tag)
Parameters:tag (int) – an #hb_tag_t representing an ISO 15924 tag.
Returns:An HarfBuzz.script_t corresponding to the ISO 15924 tag.
Return type:HarfBuzz.script_t

Converts an ISO 15924 script tag to a corresponding HarfBuzz.script_t.

New in version 0.9.2.

HarfBuzz.script_from_string(str)
Parameters:str (bytes) – a string representing an ISO 15924 tag.
Returns:An HarfBuzz.script_t corresponding to the ISO 15924 tag.
Return type:HarfBuzz.script_t

Converts a string str representing an ISO 15924 script tag to a corresponding HarfBuzz.script_t. Shorthand for HarfBuzz.tag_from_string() then HarfBuzz.script_from_iso15924_tag().

New in version 0.9.2.

HarfBuzz.script_get_horizontal_direction(script)
Parameters:script (HarfBuzz.script_t) –
Return type:HarfBuzz.direction_t

New in version 0.9.2.

HarfBuzz.script_to_iso15924_tag(script)
Parameters:script (HarfBuzz.script_t) – an HarfBuzz.script_t to convert.
Returns:An #hb_tag_t representing an ISO 15924 script tag.
Return type:int

See HarfBuzz.script_from_iso15924_tag().

New in version 0.9.2.

HarfBuzz.segment_properties_equal(a, b)
Parameters:
Returns:

%true if all properties of a equal those of b, false otherwise.

Return type:

int

Checks the equality of two HarfBuzz.segment_properties_t’s.

New in version 0.9.7.

HarfBuzz.segment_properties_hash(p)
Parameters:p (HarfBuzz.segment_properties_t) – HarfBuzz.segment_properties_t to hash.
Returns:A hash of p.
Return type:int

Creates a hash representing p.

New in version 0.9.7.

HarfBuzz.set_add(set, codepoint)
Parameters:

New in version 0.9.2.

HarfBuzz.set_add_range(set, first, last)
Parameters:

New in version 0.9.7.

HarfBuzz.set_allocation_successful(set)
Parameters:set (HarfBuzz.set_t) – a set.
Return type:int

New in version 0.9.2.

HarfBuzz.set_clear(set)
Parameters:set (HarfBuzz.set_t) – a set.

New in version 0.9.2.

HarfBuzz.set_create()
Return type:HarfBuzz.set_t

New in version 0.9.2.

HarfBuzz.set_del(set, codepoint)
Parameters:

New in version 0.9.2.

HarfBuzz.set_del_range(set, first, last)
Parameters:

New in version 0.9.7.

HarfBuzz.set_get_empty()
Return type:HarfBuzz.set_t

New in version 0.9.2.

HarfBuzz.set_get_max(set)
Parameters:set (HarfBuzz.set_t) – a set.
Returns:minimum of the set, or HarfBuzz.SET_VALUE_INVALID if set is empty.
Return type:int

Finds the maximum number in the set.

New in version 0.9.7.

HarfBuzz.set_get_min(set)
Parameters:set (HarfBuzz.set_t) – a set.
Returns:minimum of the set, or HarfBuzz.SET_VALUE_INVALID if set is empty.
Return type:int

Finds the minimum number in the set.

New in version 0.9.7.

HarfBuzz.set_get_population(set)
Parameters:set (HarfBuzz.set_t) – a set.
Returns:set population.
Return type:int

Returns the number of numbers in the set.

New in version 0.9.7.

HarfBuzz.set_has(set, codepoint)
Parameters:
Return type:

int

New in version 0.9.2.

HarfBuzz.set_intersect(set, other)
Parameters:

New in version 0.9.2.

HarfBuzz.set_invert(set)
Parameters:set (HarfBuzz.set_t) – a set.

New in version 0.9.10.

Deprecated since version 1.6.1.

HarfBuzz.set_is_empty(set)
Parameters:set (HarfBuzz.set_t) – a set.
Return type:int

New in version 0.9.7.

HarfBuzz.set_is_equal(set, other)
Parameters:
Returns:

True if the two sets are equal, False otherwise.

Return type:

int

New in version 0.9.7.

HarfBuzz.set_is_subset(set, larger_set)
Parameters:
Returns:

True if the set is a subset of (or equal to) larger_set, False otherwise.

Return type:

int

New in version 1.8.1.

HarfBuzz.set_next(set, codepoint)
Parameters:
Returns:

whether there was a next value.

Return type:

(int, codepoint: int)

Gets the next number in set that is greater than current value of codepoint.

Set codepoint to HarfBuzz.SET_VALUE_INVALID to get started.

New in version 0.9.2.

HarfBuzz.set_next_range(set, last)
Parameters:
  • set (HarfBuzz.set_t) – a set.
  • last (int) – input current last and output last codepoint in the range.
Returns:

whether there was a next range.

first:output first codepoint in the range.
last:input current last and output last codepoint in the range.

Return type:

(int, first: int, last: int)

Gets the next consecutive range of numbers in set that are greater than current value of last.

Set last to HarfBuzz.SET_VALUE_INVALID to get started.

New in version 0.9.7.

HarfBuzz.set_previous(set, codepoint)
Parameters:
Returns:

whether there was a previous value.

Return type:

(int, codepoint: int)

Gets the previous number in set that is lower than current value of codepoint.

Set codepoint to HarfBuzz.SET_VALUE_INVALID to get started.

New in version 1.8.0.

HarfBuzz.set_previous_range(set, first)
Parameters:
  • set (HarfBuzz.set_t) – a set.
  • first (int) – input current first and output first codepoint in the range.
Returns:

whether there was a previous range.

first:input current first and output first codepoint in the range.
last:output last codepoint in the range.

Return type:

(int, first: int, last: int)

Gets the previous consecutive range of numbers in set that are less than current value of first.

Set first to HarfBuzz.SET_VALUE_INVALID to get started.

New in version 1.8.0.

HarfBuzz.set_set(set, other)
Parameters:

New in version 0.9.2.

HarfBuzz.set_subtract(set, other)
Parameters:

New in version 0.9.2.

HarfBuzz.set_symmetric_difference(set, other)
Parameters:

New in version 0.9.2.

HarfBuzz.set_union(set, other)
Parameters:

New in version 0.9.2.

HarfBuzz.shape(font, buffer, features)
Parameters:

Shapes buffer using font turning its Unicode characters content to positioned glyphs. If features is not None, it will be used to control the features applied during shaping. If two features have the same tag but overlapping ranges the value of the feature with the higher index takes precedence.

New in version 0.9.2.

HarfBuzz.shape_full(font, buffer, features, shaper_list)
Parameters:
Returns:

false if all shapers failed, true otherwise

Return type:

int

See HarfBuzz.shape() for details. If shaper_list is not None, the specified shapers will be used in the given order, otherwise the default shapers list will be used.

New in version 0.9.2.

HarfBuzz.shape_list_shapers()
Returns:an array of constant strings
Return type:[str]

Retrieves the list of shapers supported by HarfBuzz.

New in version 0.9.2.

HarfBuzz.shape_plan_create(face, props, user_features, shaper_list)
Parameters:
Return type:

HarfBuzz.shape_plan_t

New in version 0.9.7.

HarfBuzz.shape_plan_create2(face, props, user_features, num_user_features, coords, num_coords, shaper_list)
Parameters:
Return type:

HarfBuzz.shape_plan_t

HarfBuzz.shape_plan_create_cached(face, props, user_features, shaper_list)
Parameters:
Return type:

HarfBuzz.shape_plan_t

New in version 0.9.7.

HarfBuzz.shape_plan_create_cached2(face, props, user_features, num_user_features, coords, num_coords, shaper_list)
Parameters:
Return type:

HarfBuzz.shape_plan_t

HarfBuzz.shape_plan_execute(shape_plan, font, buffer, features)
Parameters:
Return type:

int

New in version 0.9.7.

HarfBuzz.shape_plan_get_empty()
Return type:HarfBuzz.shape_plan_t

New in version 0.9.7.

HarfBuzz.shape_plan_get_shaper(shape_plan)
Parameters:shape_plan (HarfBuzz.shape_plan_t) – a shape plan.
Return type:str

New in version 0.9.7.

HarfBuzz.tag_from_string(str)
Parameters:str (bytes) –
Return type:int

New in version 0.9.2.

HarfBuzz.tag_to_string(tag)
Parameters:tag (int) –
Return type:buf: bytes

New in version 0.9.5.

HarfBuzz.unicode_combining_class(ufuncs, unicode)
Parameters:
Return type:

HarfBuzz.unicode_combining_class_t

New in version 0.9.2.

HarfBuzz.unicode_compose(ufuncs, a, b)
Parameters:
Return type:

(int, ab: int)

New in version 0.9.2.

HarfBuzz.unicode_decompose(ufuncs, ab)
Parameters:
Return type:

(int, a: int, b: int)

New in version 0.9.2.

HarfBuzz.unicode_decompose_compatibility(ufuncs, u)
Parameters:
Return type:

(int, decomposed: int)

New in version 0.9.2.

Deprecated since version 2.0.0.

HarfBuzz.unicode_eastasian_width(ufuncs, unicode)
Parameters:
Return type:

int

New in version 0.9.2.

Deprecated since version 2.0.0.

HarfBuzz.unicode_funcs_create(parent)
Parameters:parent (HarfBuzz.unicode_funcs_t or None) –
Return type:HarfBuzz.unicode_funcs_t

New in version 0.9.2.

HarfBuzz.unicode_funcs_get_default()
Return type:HarfBuzz.unicode_funcs_t
HarfBuzz.unicode_funcs_get_empty()
Return type:HarfBuzz.unicode_funcs_t

New in version 0.9.2.

HarfBuzz.unicode_funcs_get_parent(ufuncs)
Parameters:ufuncs (HarfBuzz.unicode_funcs_t) – Unicode functions.
Return type:HarfBuzz.unicode_funcs_t

New in version 0.9.2.

HarfBuzz.unicode_funcs_is_immutable(ufuncs)
Parameters:ufuncs (HarfBuzz.unicode_funcs_t) – Unicode functions.
Return type:int

New in version 0.9.2.

HarfBuzz.unicode_funcs_make_immutable(ufuncs)
Parameters:ufuncs (HarfBuzz.unicode_funcs_t) – Unicode functions.

New in version 0.9.2.

HarfBuzz.unicode_funcs_set_combining_class_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.unicode_funcs_set_compose_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.unicode_funcs_set_decompose_compatibility_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

Deprecated since version 2.0.0.

HarfBuzz.unicode_funcs_set_decompose_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.unicode_funcs_set_eastasian_width_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

Deprecated since version 2.0.0.

HarfBuzz.unicode_funcs_set_general_category_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.unicode_funcs_set_mirroring_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.unicode_funcs_set_script_func(ufuncs, func, *user_data)
Parameters:

New in version 0.9.2.

HarfBuzz.unicode_general_category(ufuncs, unicode)
Parameters:
Return type:

HarfBuzz.unicode_general_category_t

New in version 0.9.2.

HarfBuzz.unicode_mirroring(ufuncs, unicode)
Parameters:
Return type:

int

New in version 0.9.2.

HarfBuzz.unicode_script(ufuncs, unicode)
Parameters:
Return type:

HarfBuzz.script_t

New in version 0.9.2.

HarfBuzz.variation_from_string(str, len, variation)
Parameters:
Return type:

int

New in version 1.4.2.

HarfBuzz.variation_to_string(variation, buf, size)
Parameters:

New in version 1.4.2.

HarfBuzz.version()
Returns:
major:Library major version component.
minor:Library minor version component.
micro:Library micro version component.
Return type:(major: int, minor: int, micro: int)

Returns library version as three integer components.

New in version 0.9.2.

HarfBuzz.version_atleast(major, minor, micro)
Parameters:
  • major (int) –
  • minor (int) –
  • micro (int) –
Return type:

int

New in version 0.9.30.

HarfBuzz.version_string()
Returns:library version string.
Return type:str

Returns library version as a string with three components.

New in version 0.9.2.