Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- HarfBuzz.buffer_message_func_t(buffer, font, message, *user_data)¶
- Parameters:
buffer (
HarfBuzz.buffer_t) – AnHarfBuzz.buffer_tto work uponfont (
HarfBuzz.font_t) – TheHarfBuzz.font_tthe buffer is shaped withmessage (
str) –NULL-terminated message passed to the functionuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueto perform the shaping step,falseto skip it.- Return type:
A callback method for
HarfBuzz.buffer_t. The method gets called with theHarfBuzz.buffer_tit was set on, theHarfBuzz.font_tthe buffer is shaped with and a message describing what step of the shaping process will be performed. Returningfalsefrom this method will skip this shaping step and move to the next one.New in version 1.1.3.
- HarfBuzz.color_line_get_color_stops_func_t(color_line, color_line_data, start, *user_data)¶
- Parameters:
color_line (
HarfBuzz.color_line_t) – aHarfBuzz.color_line_tobjectcolor_line_data (
objectorNone) – the data accompanying color_linestart (
int) – the index of the first color stop to returnuser_data (
objectorNone) – the data accompanying this method
- Returns:
the total number of color stops in color_line
- color_stops:
Array of
HarfBuzz.color_stop_tto populate
- Return type:
(
int, color_stops: [HarfBuzz.color_stop_t])
A virtual method for the
HarfBuzz.color_line_tto fetch color stops.New in version 7.0.0.
- HarfBuzz.color_line_get_extend_func_t(color_line, color_line_data, *user_data)¶
- Parameters:
color_line (
HarfBuzz.color_line_t) – aHarfBuzz.color_line_tobjectcolor_line_data (
objectorNone) – the data accompanying color_lineuser_data (
objectorNone) – the data accompanying this method
- Returns:
the extend mode of color_line
- Return type:
A virtual method for the hb_color_line_t to fetches the extend mode.
New in version 7.0.0.
- HarfBuzz.destroy_func_t(*user_data)¶
-
A virtual method for destroy user-data callbacks.
- HarfBuzz.draw_close_path_func_t(dfuncs, draw_data, st, *user_data)¶
- Parameters:
dfuncs (
HarfBuzz.draw_funcs_t) – draw functions objectdraw_data (
objectorNone) – The data accompanying the draw functions inHarfBuzz.font_draw_glyph()st (
HarfBuzz.draw_state_t) – current draw stateuser_data (
objectorNone) – User data pointer passed toHarfBuzz.draw_funcs_set_close_path_func()
A virtual method for the
HarfBuzz.draw_funcs_tto perform a “close-path” draw operation.New in version 4.0.0.
- HarfBuzz.draw_cubic_to_func_t(dfuncs, draw_data, st, control1_x, control1_y, control2_x, control2_y, to_x, to_y, *user_data)¶
- Parameters:
dfuncs (
HarfBuzz.draw_funcs_t) – draw functions objectdraw_data (
objectorNone) – The data accompanying the draw functions inHarfBuzz.font_draw_glyph()st (
HarfBuzz.draw_state_t) – current draw statecontrol1_x (
float) – X component of first control pointcontrol1_y (
float) – Y component of first control pointcontrol2_x (
float) – X component of second control pointcontrol2_y (
float) – Y component of second control pointto_x (
float) – X component of target pointto_y (
float) – Y component of target pointuser_data (
objectorNone) – User data pointer passed toHarfBuzz.draw_funcs_set_cubic_to_func()
A virtual method for the
HarfBuzz.draw_funcs_tto perform a “cubic-to” draw operation.New in version 4.0.0.
- HarfBuzz.draw_line_to_func_t(dfuncs, draw_data, st, to_x, to_y, *user_data)¶
- Parameters:
dfuncs (
HarfBuzz.draw_funcs_t) – draw functions objectdraw_data (
objectorNone) – The data accompanying the draw functions inHarfBuzz.font_draw_glyph()st (
HarfBuzz.draw_state_t) – current draw stateto_x (
float) – X component of target pointto_y (
float) – Y component of target pointuser_data (
objectorNone) – User data pointer passed toHarfBuzz.draw_funcs_set_line_to_func()
A virtual method for the
HarfBuzz.draw_funcs_tto perform a “line-to” draw operation.New in version 4.0.0.
- HarfBuzz.draw_move_to_func_t(dfuncs, draw_data, st, to_x, to_y, *user_data)¶
- Parameters:
dfuncs (
HarfBuzz.draw_funcs_t) – draw functions objectdraw_data (
objectorNone) – The data accompanying the draw functions inHarfBuzz.font_draw_glyph()st (
HarfBuzz.draw_state_t) – current draw stateto_x (
float) – X component of target pointto_y (
float) – Y component of target pointuser_data (
objectorNone) – User data pointer passed toHarfBuzz.draw_funcs_set_move_to_func()
A virtual method for the
HarfBuzz.draw_funcs_tto perform a “move-to” draw operation.New in version 4.0.0.
- HarfBuzz.draw_quadratic_to_func_t(dfuncs, draw_data, st, control_x, control_y, to_x, to_y, *user_data)¶
- Parameters:
dfuncs (
HarfBuzz.draw_funcs_t) – draw functions objectdraw_data (
objectorNone) – The data accompanying the draw functions inHarfBuzz.font_draw_glyph()st (
HarfBuzz.draw_state_t) – current draw statecontrol_x (
float) – X component of control pointcontrol_y (
float) – Y component of control pointto_x (
float) – X component of target pointto_y (
float) – Y component of target pointuser_data (
objectorNone) – User data pointer passed toHarfBuzz.draw_funcs_set_quadratic_to_func()
A virtual method for the
HarfBuzz.draw_funcs_tto perform a “quadratic-to” draw operation.New in version 4.0.0.
- HarfBuzz.font_draw_glyph_func_t(font, font_data, glyph, draw_funcs, draw_data, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to querydraw_funcs (
HarfBuzz.draw_funcs_t) – The draw functions to send the shape data todraw_data (
objectorNone) – The data accompanying the draw functionsuser_data (
objectorNone) – User data pointer passed by the caller
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.New in version 7.0.0.
- HarfBuzz.font_get_font_extents_func_t(font, font_data, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
- extents:
The font extents retrieved
- Return type:
(
int, extents:HarfBuzz.font_extents_t)
This method should retrieve the extents for a font.
- HarfBuzz.font_get_glyph_advance_func_t(font, font_data, glyph, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
The advance of glyph within font
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the advance for a specified glyph. The method must return an #hb_position_t.
- HarfBuzz.font_get_glyph_advances_func_t(font, font_data, count, first_glyph, glyph_stride, advance_stride, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponcount (
int) – The number of glyph IDs in the sequence queriedfirst_glyph (
int) – The first glyph ID to queryglyph_stride (
int) – The stride between successive glyph IDsadvance_stride (
int) – The stride between successive advancesuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
The first advance retrieved
- Return type:
first_advance:
int
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the advances for a sequence of glyphs.
- HarfBuzz.font_get_glyph_contour_point_func_t(font, font_data, glyph, point_index, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to querypoint_index (
int) – The contour-point index to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- x:
The X value retrieved for the contour point
- y:
The Y value retrieved for the contour point
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the (X,Y) coordinates (in font units) for a specified contour point in a glyph. Each coordinate must be returned as an #hb_position_t output parameter.
- HarfBuzz.font_get_glyph_extents_func_t(font, font_data, glyph, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- extents:
The
HarfBuzz.glyph_extents_tretrieved
- Return type:
(
int, extents:HarfBuzz.glyph_extents_t)
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the extents for a specified glyph. Extents must be returned in an #hb_glyph_extents output parameter.
- HarfBuzz.font_get_glyph_from_name_func_t(font, font_data, name, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponname ([
str]) – The name string to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- glyph:
The glyph ID retrieved
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the glyph ID that corresponds to a glyph-name string.
- HarfBuzz.font_get_glyph_func_t(font, font_data, unicode, variation_selector, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponunicode (
int) – The Unicode code point to queryvariation_selector (
int) – The variation-selector code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- glyph:
The glyph ID retrieved
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the glyph ID for a specified Unicode code point font, with an optional variation selector.
Deprecated since version 1.2.3.
- HarfBuzz.font_get_glyph_kerning_func_t(font, font_data, first_glyph, second_glyph, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponfirst_glyph (
int) – The glyph ID of the first glyph in the glyph pairsecond_glyph (
int) – The glyph ID of the second glyph in the glyph pairuser_data (
objectorNone) – User data pointer passed by the caller
- Return type:
This method should retrieve the kerning-adjustment value for a glyph-pair in the specified font, for horizontal text segments.
- HarfBuzz.font_get_glyph_name_func_t(font, font_data, glyph, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- name:
Name string retrieved for the glyph ID
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the glyph name that corresponds to a glyph ID. The name should be returned in a string output parameter.
- HarfBuzz.font_get_glyph_origin_func_t(font, font_data, glyph, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- x:
The X coordinate of the origin
- y:
The Y coordinate of the origin
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the (X,Y) coordinates (in font units) of the origin for a glyph. Each coordinate must be returned in an #hb_position_t output parameter.
- HarfBuzz.font_get_glyph_shape_func_t(font, font_data, glyph, draw_funcs, draw_data, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to querydraw_funcs (
HarfBuzz.draw_funcs_t) – The draw functions to send the shape data todraw_data (
objectorNone) – The data accompanying the draw functionsuser_data (
objectorNone) – User data pointer passed by the caller
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.New in version 4.0.0.
Deprecated since version 7.0.0: Use
HarfBuzz.font_draw_glyph_func_tinstead
- HarfBuzz.font_get_nominal_glyph_func_t(font, font_data, unicode, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponunicode (
int) – The Unicode code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- glyph:
The glyph ID retrieved
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the nominal glyph ID for a specified Unicode code point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.
- HarfBuzz.font_get_nominal_glyphs_func_t(font, font_data, count, first_unicode, unicode_stride, glyph_stride, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponcount (
int) – number of code points to queryfirst_unicode (
int) – The first Unicode code point to queryunicode_stride (
int) – The stride between successive code pointsglyph_stride (
int) – The stride between successive glyph IDsuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
the number of code points processed
- first_glyph:
The first glyph ID retrieved
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the nominal glyph IDs for a sequence of Unicode code points. Glyph IDs must be returned in a #hb_codepoint_t output parameter.
- HarfBuzz.font_get_variation_glyph_func_t(font, font_data, unicode, variation_selector, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponunicode (
int) – The Unicode code point to queryvariation_selector (
int) – The variation-selector code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
trueif data found,falseotherwise- glyph:
The glyph ID retrieved
- Return type:
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.This method should retrieve the glyph ID for a specified Unicode code point followed by a specified Variation Selector code point. Glyph IDs must be returned in a #hb_codepoint_t output parameter.
- HarfBuzz.font_paint_glyph_func_t(font, font_data, glyph, paint_funcs, paint_data, palette_index, foreground, *user_data)¶
- Parameters:
font (
HarfBuzz.font_t) –HarfBuzz.font_tto work uponglyph (
int) – The glyph ID to querypaint_funcs (
HarfBuzz.paint_funcs_t) – The paint functions to usepaint_data (
objectorNone) – The data accompanying the paint functionspalette_index (
int) – The color palette to useforeground (
int) – The foreground coloruser_data (
objectorNone) – User data pointer passed by the caller
A virtual method for the
HarfBuzz.font_funcs_tof anHarfBuzz.font_tobject.New in version 7.0.0.
- HarfBuzz.get_table_tags_func_t(face, start_offset, *user_data)¶
- Parameters:
face (
HarfBuzz.face_t) – A face objectstart_offset (
int) – The index of first table tag to retrieveuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
Total number of tables, or zero if it is not possible to list
- table_tags:
The array of table tags found
- Return type:
Callback function for
HarfBuzz.face_get_table_tags().New in version 10.0.0.
- HarfBuzz.paint_color_func_t(funcs, paint_data, is_foreground, color, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()is_foreground (
int) – whether the color is the foregroundcolor (
int) – The color to use, unpremultiplieduser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_color_func()
A virtual method for the
HarfBuzz.paint_funcs_tto paint a color everywhere within the current clip.New in version 7.0.0.
- HarfBuzz.paint_color_glyph_func_t(funcs, paint_data, glyph, font, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()glyph (
int) – the glyph IDfont (
HarfBuzz.font_t) – the fontuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_color_glyph_func()
- Returns:
trueif the glyph was painted,falseotherwise.- Return type:
A virtual method for the
HarfBuzz.paint_funcs_tto render a color glyph by glyph index.New in version 8.2.0.
- HarfBuzz.paint_custom_palette_color_func_t(funcs, paint_data, color_index, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()color_index (
int) – the color indexuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_pop_group_func()
- Returns:
trueif found,falseotherwise- color:
fetched color
- Return type:
A virtual method for the
HarfBuzz.paint_funcs_tto fetch a color from the custom color palette.Custom palette colors override the colors from the fonts selected color palette. It is not necessary to override all palette entries; for entries that should be taken from the font palette, return
false.This function might get called multiple times, but the custom palette is expected to remain unchanged for duration of a
HarfBuzz.font_paint_glyph() call.New in version 7.0.0.
- HarfBuzz.paint_image_func_t(funcs, paint_data, image, width, height, format, slant, extents, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()image (
HarfBuzz.blob_t) – the image datawidth (
int) – width of the raster image in pixels, or 0height (
int) – height of the raster image in pixels, or 0format (
int) – the image format as a tagslant (
float) – the synthetic slant ratio to be applied to the image during renderingextents (
HarfBuzz.glyph_extents_torNone) – glyph extents for desired renderinguser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_image_func()
- Returns:
Whether the operation was successful.
- Return type:
A virtual method for the
HarfBuzz.paint_funcs_tto paint a glyph image.This method is called for glyphs with image blobs in the CBDT, sbix or SVG tables. The format identifies the kind of data that is contained in image. Possible values include #HB_PAINT_IMAGE_FORMAT_PNG, #HB_PAINT_IMAGE_FORMAT_SVG and #HB_PAINT_IMAGE_FORMAT_BGRA.
The image dimensions and glyph extents are provided if available, and should be used to size and position the image.
New in version 7.0.0.
- HarfBuzz.paint_linear_gradient_func_t(funcs, paint_data, color_line, x0, y0, x1, y1, x2, y2, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()color_line (
HarfBuzz.color_line_t) – Color information for the gradientx0 (
float) – X coordinate of the first pointy0 (
float) – Y coordinate of the first pointx1 (
float) – X coordinate of the second pointy1 (
float) – Y coordinate of the second pointx2 (
float) – X coordinate of the third pointy2 (
float) – Y coordinate of the third pointuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_linear_gradient_func()
A virtual method for the
HarfBuzz.paint_funcs_tto paint a linear gradient everywhere within the current clip.The color_line object contains information about the colors of the gradients. It is only valid for the duration of the callback, you cannot keep it around.
The coordinates of the points are interpreted according to the current transform.
See the OpenType spec COLR section for details on how the points define the direction of the gradient, and how to interpret the color_line.
New in version 7.0.0.
- HarfBuzz.paint_pop_clip_func_t(funcs, paint_data, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()user_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_pop_clip_func()
A virtual method for the
HarfBuzz.paint_funcs_tto undo the effect of a prior call to the #hb_paint_funcs_push_clip_glyph_func_t or #hb_paint_funcs_push_clip_rectangle_func_t vfuncs.New in version 7.0.0.
- HarfBuzz.paint_pop_group_func_t(funcs, paint_data, mode, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()mode (
HarfBuzz.paint_composite_mode_t) – the compositing mode to useuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_pop_group_func()
A virtual method for the
HarfBuzz.paint_funcs_tto undo the effect of a prior call to the #hb_paint_funcs_push_group_func_t vfunc.This call stops the redirection to the intermediate surface, and then composites it on the previous surface, using the compositing mode passed to this call.
New in version 7.0.0.
- HarfBuzz.paint_pop_transform_func_t(funcs, paint_data, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()user_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_pop_transform_func()
A virtual method for the
HarfBuzz.paint_funcs_tto undo the effect of a prior call to the #hb_paint_funcs_push_transform_func_t vfunc.New in version 7.0.0.
- HarfBuzz.paint_push_clip_glyph_func_t(funcs, paint_data, glyph, font, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()glyph (
int) – the glyph IDfont (
HarfBuzz.font_t) – the fontuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_push_clip_glyph_func()
A virtual method for the
HarfBuzz.paint_funcs_tto clip subsequent paint calls to the outline of a glyph.The coordinates of the glyph outline are interpreted according to the current transform.
This clip is applied in addition to the current clip, and remains in effect until a matching call to the #hb_paint_funcs_pop_clip_func_t vfunc.
New in version 7.0.0.
- HarfBuzz.paint_push_clip_rectangle_func_t(funcs, paint_data, xmin, ymin, xmax, ymax, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()xmin (
float) – min X for the rectangleymin (
float) – min Y for the rectanglexmax (
float) – max X for the rectangleymax (
float) – max Y for the rectangleuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_push_clip_rectangle_func()
A virtual method for the
HarfBuzz.paint_funcs_tto clip subsequent paint calls to a rectangle.The coordinates of the rectangle are interpreted according to the current transform.
This clip is applied in addition to the current clip, and remains in effect until a matching call to the #hb_paint_funcs_pop_clip_func_t vfunc.
New in version 7.0.0.
- HarfBuzz.paint_push_group_func_t(funcs, paint_data, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()user_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_push_group_func()
A virtual method for the
HarfBuzz.paint_funcs_tto use an intermediate surface for subsequent paint calls.The drawing will be redirected to an intermediate surface until a matching call to the #hb_paint_funcs_pop_group_func_t vfunc.
New in version 7.0.0.
- HarfBuzz.paint_push_transform_func_t(funcs, paint_data, xx, yx, xy, yy, dx, dy, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()xx (
float) – xx component of the transform matrixyx (
float) – yx component of the transform matrixxy (
float) – xy component of the transform matrixyy (
float) – yy component of the transform matrixdx (
float) – dx component of the transform matrixdy (
float) – dy component of the transform matrixuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_push_transform_func()
A virtual method for the
HarfBuzz.paint_funcs_tto apply a transform to subsequent paint calls.This transform is applied after the current transform, and remains in effect until a matching call to the #hb_paint_funcs_pop_transform_func_t vfunc.
New in version 7.0.0.
- HarfBuzz.paint_radial_gradient_func_t(funcs, paint_data, color_line, x0, y0, r0, x1, y1, r1, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()color_line (
HarfBuzz.color_line_t) – Color information for the gradientx0 (
float) – X coordinate of the first circle’s centery0 (
float) – Y coordinate of the first circle’s centerr0 (
float) – radius of the first circlex1 (
float) – X coordinate of the second circle’s centery1 (
float) – Y coordinate of the second circle’s centerr1 (
float) – radius of the second circleuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_radial_gradient_func()
A virtual method for the
HarfBuzz.paint_funcs_tto paint a radial gradient everywhere within the current clip.The color_line object contains information about the colors of the gradients. It is only valid for the duration of the callback, you cannot keep it around.
The coordinates of the points are interpreted according to the current transform.
See the OpenType spec COLR section for details on how the points define the direction of the gradient, and how to interpret the color_line.
New in version 7.0.0.
- HarfBuzz.paint_sweep_gradient_func_t(funcs, paint_data, color_line, x0, y0, start_angle, end_angle, *user_data)¶
- Parameters:
funcs (
HarfBuzz.paint_funcs_t) – paint functions objectpaint_data (
objectorNone) – The data accompanying the paint functions inHarfBuzz.font_paint_glyph()color_line (
HarfBuzz.color_line_t) – Color information for the gradientx0 (
float) – X coordinate of the circle’s centery0 (
float) – Y coordinate of the circle’s centerstart_angle (
float) – the start angle, in radiansend_angle (
float) – the end angle, in radiansuser_data (
objectorNone) – User data pointer passed toHarfBuzz.paint_funcs_set_sweep_gradient_func()
A virtual method for the
HarfBuzz.paint_funcs_tto paint a sweep gradient everywhere within the current clip.The color_line object contains information about the colors of the gradients. It is only valid for the duration of the callback, you cannot keep it around.
The coordinates of the points are interpreted according to the current transform.
See the OpenType spec COLR section for details on how the points define the direction of the gradient, and how to interpret the color_line.
New in version 7.0.0.
- HarfBuzz.reference_table_func_t(face, tag, *user_data)¶
- Parameters:
face (
HarfBuzz.face_t) – anHarfBuzz.face_tto reference table fortag (
int) – the tag of the table to referenceuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
A pointer to the tag table within face
- Return type:
Callback function for
HarfBuzz.face_create_for_tables().New in version 0.9.2.
- HarfBuzz.unicode_combining_class_func_t(ufuncs, unicode, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structureunicode (
int) – The code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
The
HarfBuzz.unicode_combining_class_tof unicode- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.This method should retrieve the Canonical Combining Class (ccc) property for a specified Unicode code point.
- HarfBuzz.unicode_compose_func_t(ufuncs, a, b, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structurea (
int) – The first code point to composeb (
int) – The second code point to composeuser_data (
objectorNone) – user data pointer passed by the caller
- Returns:
trueis a,`b` composed,falseotherwise- ab:
The composed code point
- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.This method should compose a sequence of two input Unicode code points by canonical equivalence, returning the composed code point in a #hb_codepoint_t output parameter (if successful). The method must return an #hb_bool_t indicating the success of the composition.
- HarfBuzz.unicode_decompose_compatibility_func_t(ufuncs, u, decomposed, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – a Unicode function structureu (
int) – codepoint to decomposedecomposed (
int) – address of codepoint array (of lengthHarfBuzz.UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition intouser_data (
objectorNone) – user data pointer as passed toHarfBuzz.unicode_funcs_set_decompose_compatibility_func()
- Returns:
number of codepoints in the full compatibility decomposition of u, or 0 if no decomposition available.
- Return type:
Fully decompose u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to decomposed. The complete length of the decomposition will be returned.
If u has no compatibility decomposition, zero should be returned.
The Unicode standard guarantees that a buffer of length
HarfBuzz.UNICODE_MAX_DECOMPOSITION_LENcodepoints will always be sufficient for any compatibility decomposition plus an terminating value of 0. Consequently, decompose must be allocated by the caller to be at least this length. Implementations of this function type must ensure that they do not write past the provided array.Deprecated since version 2.0.0.
- HarfBuzz.unicode_decompose_func_t(ufuncs, ab, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structureab (
int) – The code point to decomposeuser_data (
objectorNone) – user data pointer passed by the caller
- Returns:
trueif ab decomposed,falseotherwise- a:
The first decomposed code point
- b:
The second decomposed code point
- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.This method should decompose an input Unicode code point, returning the two decomposed code points in #hb_codepoint_t output parameters (if successful). The method must return an #hb_bool_t indicating the success of the composition.
- HarfBuzz.unicode_eastasian_width_func_t(ufuncs, unicode, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structureunicode (
int) – The code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.Deprecated since version 2.0.0.
- HarfBuzz.unicode_general_category_func_t(ufuncs, unicode, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structureunicode (
int) – The code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
The
HarfBuzz.unicode_general_category_tof unicode- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.This method should retrieve the General Category property for a specified Unicode code point.
- HarfBuzz.unicode_mirroring_func_t(ufuncs, unicode, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structureunicode (
int) – The code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
The #hb_codepoint_t of the Mirroring Glyph for unicode
- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.This method should retrieve the Bi-Directional Mirroring Glyph code point for a specified Unicode code point.
Note: If a code point does not have a specified Bi-Directional Mirroring Glyph defined, the method should return the original code point.
- HarfBuzz.unicode_script_func_t(ufuncs, unicode, *user_data)¶
- Parameters:
ufuncs (
HarfBuzz.unicode_funcs_t) – A Unicode-functions structureunicode (
int) – The code point to queryuser_data (
objectorNone) – User data pointer passed by the caller
- Returns:
The
HarfBuzz.script_tof unicode- Return type:
A virtual method for the
HarfBuzz.unicode_funcs_tstructure.This method should retrieve the Script property for a specified Unicode code point.