Client programs should be ready to handle any value in the 0..254 range being returned from [harfbuzz.global.unicodeCombiningClass].</note>
harfbuzz.c.types
C types for harfbuzz0 library
Types 126
Data type for booleans.
Data type for holding Unicode codepoints. Also used to hold glyph IDs.
Data type for holding color values. Colors are eight bits per channel RGB plus alpha transparency.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the extents for a font, for horizontal-direction text segments. Extents must be returned in an #hb_glyph_extents output parameter.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the extents for a font, for vertical-direction text segments. Extents must be returned in an #hb_glyph_extents output parameter.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the advance for a specified glyph, in horizontal-direction text segments. Advances must be returned in an #hb_position_t output parameter.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the advances for a sequence of glyphs, in horizontal-direction text segments.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the kerning-adjustment value for a glyph-pair in the specified font, for horizontal text segments.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the (X,Y) coordinates (in font units) of the origin for a glyph, for horizontal-direction text segments. Each coordinate must be returned in an #hb_position_t output parameter.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the advance for a specified glyph, in vertical-direction text segments. Advances must be returned in an #hb_position_t output parameter.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the advances for a sequence of glyphs, in vertical-direction text segments.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the kerning-adjustment value for a glyph-pair in the specified font, for vertical text segments.
A virtual method for the #hb_font_funcs_t of an #hb_font_t object.
This method should retrieve the (X,Y) coordinates (in font units) of the origin for a glyph, for vertical-direction text segments. Each coordinate must be returned in an #hb_position_t output parameter.
Data type for bitmasks.
An integral type representing an OpenType 'name' table name identifier. There are predefined name IDs, as well as name IDs return from other API. These can be used to fetch name strings from a font face.
Data type for holding a single coordinate value. Contour points and other multi-dimensional data are stored as tuples of #hb_position_t's.
Data type for tag identifiers. Tags are four byte integers, each byte representing a character.
Tags are used to identify tables, design-variation axes, scripts, languages, font features, and baselines with human-readable names.
The selectors defined for specifying AAT feature settings.
The possible feature types defined for AAT shaping, from Apple Font Feature Registry.
Data type for holding HarfBuzz's clustering behavior options. The cluster level dictates one aspect of how HarfBuzz will treat non-base characters during shaping.
In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES, non-base characters are merged into the cluster of the base character that precedes them.
In @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS, non-base characters are initially assigned their own cluster values, which are not merged into preceding base clusters. This allows HarfBuzz to perform additional operations like reorder sequences of adjacent marks.
@HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES is the default, because it maintains backward compatibility with older versions of HarfBuzz. New client programs that do not need to maintain such backward compatibility are recommended to use @HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS instead of the default.
The type of #hb_buffer_t contents.
Flags from comparing two #hb_buffer_t's.
Buffer with different #hb_buffer_content_type_t cannot be meaningfully compared in any further detail.
For buffers with differing length, the per-glyph comparison is not attempted, though we do still scan reference buffer for dotted circle and .notdef glyphs.
If the buffers have the same length, we compare them glyph-by-glyph and report which aspect(s) of the glyph info/position are different.
Flags for #hb_buffer_t.
Flags that control what glyph information are serialized in [harfbuzz.global.bufferSerializeGlyphs].
The buffer serialization and de-serialization format used in [harfbuzz.global.bufferSerializeGlyphs] and [harfbuzz.global.bufferDeserializeGlyphs].
The direction of a text segment or buffer.
A segment can also be tested for horizontal or vertical orientation (irrespective of specific direction) with HB_DIRECTION_IS_HORIZONTAL() or HB_DIRECTION_IS_VERTICAL().
Flags for #hb_glyph_info_t.
Data type holding the memory modes available to client programs.
Regarding these various memory-modes:
- In no case shall the HarfBuzz client modify memory
that is passed to HarfBuzz in a blob. If there is any such possibility, @HB_MEMORY_MODE_DUPLICATE should be used such that HarfBuzz makes a copy immediately,
- Use @HB_MEMORY_MODE_READONLY otherwise, unless you really really
really know what you are doing,
- @HB_MEMORY_MODE_WRITABLE is appropriate if you really made a
copy of data solely for the purpose of passing to HarfBuzz and doing that just once (no reuse!),
- If the font is mmap()ed, it's okay to use
@HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE, however, using that mode correctly is very tricky. Use @HB_MEMORY_MODE_READONLY instead.
Flags that describe the properties of color palette.
Baseline tags from Baseline Tags registry.
The GDEF classes defined for glyphs.
Flags for math glyph parts.
The math kerning-table types defined for the four corners of a glyph.
Known metadata tags from https://docs.microsoft.com/en-us/typography/opentype/spec/meta
Metric tags corresponding to MVAR Value Tags
An enum type representing the pre-defined name IDs.
For more information on these fields, see the
OpenType spec.Flags for #hb_ot_var_axis_info_t.
The values of this enumeration describe the compositing modes that can be used when combining temporary redirected drawing with the backdrop.
See the OpenType spec COLR section for details.
The values of this enumeration determine how color values outside the minimum and maximum defined offset on a #hb_color_line_t are determined.
See the OpenType spec COLR section for details.
Data type for scripts. Each #hb_script_t's value is an #hb_tag_t corresponding to the four-letter values defined by ISO 15924.
See also the Script (sc) property of the Unicode Character Database.
Defined by OpenType Design-Variation Axis Tag Registry.
Data type for the Canonical_Combining_Class (ccc) property from the Unicode Character Database.
<note>Note
Data type for the "General_Category" (gc) property from the Unicode Character Database.
Structure representing a setting for an #hb_aat_layout_feature_type_t.
hb_ot_name_id_t nameIdThe selector's name identifierhb_aat_layout_feature_selector_t enableThe value to turn the selector onhb_aat_layout_feature_selector_t disableThe value to turn the selector offuint reservedData type for blobs. A blob wraps a chunk of binary data and facilitates its lifecycle management between a client program and HarfBuzz.
The main structure holding the input text and its properties before shaping, and output glyphs and their information after shaping.
A struct containing color information for a gradient.
void * datahb_color_line_get_color_stops_func_t getColorStopsvoid * getColorStopsUserDatahb_color_line_get_extend_func_t getExtendvoid * getExtendUserDatavoid * reserved0void * reserved1void * reserved2void * reserved3void * reserved5void * reserved6void * reserved7void * reserved8Information about a color stop on a color line.
Color lines typically have offsets ranging between 0 and 1, but that is not required.
Note
gradients shall happen in premultiplied space. See the OpenType spec
COLRsection for details.
float offsetthe offset of the color stophb_bool_t isForegroundwhether the color is the foregroundhb_color_t colorthe color, unpremultipliedGlyph draw callbacks.
#hb_draw_move_to_func_t, #hb_draw_line_to_func_t and #hb_draw_cubic_to_func_t calls are necessary to be defined but we translate #hb_draw_quadratic_to_func_t calls to #hb_draw_cubic_to_func_t if the callback isn't defined.
Data type for holding font faces.
The #hb_feature_t is the structure that holds information about requested feature application. The feature will be applied with the given value to all glyphs which are in clusters between @start (inclusive) and @end (exclusive). Setting start to #HB_FEATURE_GLOBAL_START and end to #HB_FEATURE_GLOBAL_END specifies that the feature always applies to the entire buffer.
hb_tag_t tagThe #hbtagt tag of the featureuint valueThe value of the feature. 0 disables the feature, non-zero (usually 1) enables the feature. For features implemented as lookup type 3 (like 'salt') the @value is a one based index into the alterna...uint startthe cluster to start applying this feature setting (inclusive).uint endthe cluster to end applying this feature setting (exclusive).Data type for holding fonts.
Font-wide extent values, measured in font units.
Note that typically @ascender is positive and @descender negative, in coordinate systems that grow up.
hb_position_t ascenderThe height of typographic ascenders.hb_position_t descenderThe depth of typographic descenders.hb_position_t lineGapThe suggested line-spacing gap.hb_position_t reserved9hb_position_t reserved8hb_position_t reserved7hb_position_t reserved6hb_position_t reserved5hb_position_t reserved4hb_position_t reserved3hb_position_t reserved2hb_position_t reserved1Data type containing a set of virtual methods used for working on #hb_font_t font objects.
HarfBuzz provides a lightweight default function for each of the methods in #hb_font_funcs_t. Client programs can implement their own replacements for the individual font functions, as needed, and replace the default by calling the setter for a method.
Glyph extent values, measured in font units.
Note that @height is negative, in coordinate systems that grow up.
hb_position_t xBearingDistance from the x-origin to the left extremum of the glyph.hb_position_t yBearingDistance from the top extremum of the glyph to the y-origin.hb_position_t widthDistance from the left extremum of the glyph to the right extremum.hb_position_t heightDistance from the top extremum of the glyph to the bottom extremum.Data type for languages. Each #hb_language_t corresponds to a BCP 47 language tag.
Data type for holding integer-to-integer hash maps.
Pairs of glyph and color index.
A color index of 0xFFFF does not refer to a palette color, but indicates that the foreground color should be used.
hb_codepoint_t glyphthe glyph ID of the layeruint colorIndexthe palette color index of the layerData type to hold information for a "part" component of a math-variant glyph. Large variants for stretchable math glyphs (such as parentheses) can be constructed on the fly from parts.
hb_codepoint_t glyphThe glyph index of the variant parthb_position_t startConnectorLengthThe length of the connector on the starting side of the variant parthb_position_t endConnectorLengthThe length of the connector on the ending side of the variant parthb_position_t fullAdvanceThe total advance of the parthb_ot_math_glyph_part_flags_t flags#hbotmathglyphpartflagst flags for the partData type to hold math-variant information for a glyph.
hb_codepoint_t glyphThe glyph index of the varianthb_position_t advanceThe advance width of the variantData type to hold math kerning (cut-in) information for a glyph.
hb_position_t maxCorrectionHeightThe maximum height at which this entry should be usedhb_position_t kernValueThe kern value of the entryStructure representing a name ID in a particular language.
hb_ot_name_id_t nameIdname IDhb_var_int_t varhb_language_t languagelanguageUse #hb_ot_var_axis_info_t instead.
hb_tag_t tagaxis taghb_ot_name_id_t nameIdaxis name identifierfloat minValueminimum value of the axisfloat defaultValuedefault value of the axisfloat maxValuemaximum value of the axisData type for holding variation-axis values.
The minimum, default, and maximum values are in un-normalized, user scales.
<note>Note
#HB_OT_VAR_AXIS_FLAG_HIDDEN.</note>
uint axisIndexIndex of the axis in the variation-axis arrayhb_tag_t tagThe #hbtagt tag identifying the design variation of the axishb_ot_name_id_t nameIdThe `name` table Name ID that provides display names for the axishb_ot_var_axis_flags_t flagsThe #hbotvaraxisflags_t flags for the axisfloat minValueThe minimum value on the variation axis that the font coversfloat defaultValueThe position on the variation axis corresponding to the font's defaultsfloat maxValueThe maximum value on the variation axis that the font coversuint reservedGlyph paint callbacks.
The callbacks assume that the caller maintains a stack of current transforms, clips and intermediate surfaces, as evidenced by the pairs of push/pop callbacks. The push/pop calls will be properly nested, so it is fine to store the different kinds of object on a single stack.
Not all callbacks are required for all kinds of glyphs. For rendering COLRv0 or non-color outline glyphs, the gradient callbacks are not needed, and the composite callback only needs to handle simple alpha compositing (#HB_PAINT_COMPOSITE_MODE_SRC_OVER).
The paint-image callback is only needed for glyphs with image blobs in the CBDT, sbix or SVG tables.
The custom-palette-color callback is only necessary if you want to override colors from the font palette with custom colors.
The structure that holds various text properties of an #hb_buffer_t. Can be set and retrieved using [harfbuzz.global.bufferSetSegmentProperties] and [harfbuzz.global.bufferGetSegmentProperties], respectively.
hb_direction_t directionthe #hbdirectiont of the buffer, see [harfbuzz.global.bufferSetDirection].hb_script_t scriptthe #hbscriptt of the buffer, see [harfbuzz.global.bufferSetScript].hb_language_t languagethe #hblanguaget of the buffer, see [harfbuzz.global.bufferSetLanguage].void * reserved1void * reserved2Data type for holding a set of integers. #hb_set_t's are used to gather and contain glyph IDs, Unicode code points, and various other collections of discrete values.
Data type for holding a shaping plan.
Shape plans contain information about how HarfBuzz will shape a particular text segment, based on the segment's properties and the capabilities in the font face in use.
Shape plans can be queried about how shaping will perform, given a set of specific input parameters (script, language, direction, features, etc.).
Data type containing a set of virtual methods used for accessing various Unicode character properties.
HarfBuzz provides a default function for each of the methods in #hb_unicode_funcs_t. Client programs can implement their own replacements for the individual Unicode functions, as needed, and replace the default by calling the setter for a method.
Data structure for holding user-data keys.
char unuseduint u32int i32ushort[2] u16short[2] i16ubyte[4] u8byte[4] i8float fuint u32int i32ushort[2] u16short[2] i16ubyte[4] u8byte[4] i8Data type for holding variation data. Registered OpenType variation-axis tags are listed in
OpenType Axis Tag Registry.hb_tag_t tagThe #hbtagt tag of the variation-axis namefloat valueThe value of the variation axisCurrent drawing state.
hb_bool_t pathOpenWhether there is an open pathfloat pathStartXX component of the start of current pathfloat pathStartYY component of the start of current pathfloat currentXX component of current pointfloat currentYY component of current pointhb_var_num_t reserved1hb_var_num_t reserved2hb_var_num_t reserved3hb_var_num_t reserved4hb_var_num_t reserved5hb_var_num_t reserved6hb_var_num_t reserved7The #hb_glyph_info_t is the structure that holds information about the glyphs and their relation to input text.
hb_codepoint_t codepointeither a Unicode code point (before shaping) or a glyph index (after shaping).hb_mask_t maskuint clusterthe index of the character in the original text that corresponds to this #hbglyphinfot, or whatever the client passes to [harfbuzz.global.bufferAdd]. More than one #hbglyphinfot can have the same @...hb_var_int_t var1hb_var_int_t var2The #hb_glyph_position_t is the structure that holds the positions of the glyph in both horizontal and vertical directions. All positions in #hb_glyph_position_t are relative to the current point.
hb_position_t xAdvancehow much the line advances after drawing this glyph when setting text in horizontal direction.hb_position_t yAdvancehow much the line advances after drawing this glyph when setting text in vertical direction.hb_position_t xOffsethow much the glyph moves on the X-axis before drawing it, this should not affect how much the line advances.hb_position_t yOffsethow much the glyph moves on the Y-axis before drawing it, this should not affect how much the line advances.hb_var_int_t var