| Top |
| enum | hb_vector_format_t |
| hb_vector_extents_t | |
| enum | hb_vector_extents_mode_t |
| typedef | hb_vector_draw_t |
| typedef | hb_vector_paint_t |
Functions for converting glyph draw and paint callbacks to vector output.
The initial backend is SVG. Extents must be set before calling render
functions; otherwise render returns NULL.
hb_vector_draw_t *
hb_vector_draw_create_or_fail (hb_vector_format_t format);
Creates a new draw context for vector output.
Since: 13.0.0
hb_vector_draw_t *
hb_vector_draw_reference (hb_vector_draw_t *draw);
Increases the reference count of draw
.
Since: 13.0.0
void
hb_vector_draw_destroy (hb_vector_draw_t *draw);
Decreases the reference count of draw
and destroys it when it reaches zero.
Since: 13.0.0
hb_bool_t hb_vector_draw_set_user_data (hb_vector_draw_t *draw,hb_user_data_key_t *key,void *data,hb_destroy_func_t destroy,hb_bool_t replace);
Attaches user data to draw
.
draw |
a draw context. |
|
key |
user-data key. |
|
data |
user-data value. |
|
destroy |
destroy callback for |
[nullable] |
replace |
whether to replace an existing value for |
Since: 13.0.0
void * hb_vector_draw_get_user_data (hb_vector_draw_t *draw,hb_user_data_key_t *key);
Gets previously attached user data from draw
.
Since: 13.0.0
void hb_vector_draw_set_transform (hb_vector_draw_t *draw,float xx,float yx,float xy,float yy,float dx,float dy);
Sets the affine transform used when drawing glyphs.
draw |
a draw context. |
|
xx |
transform xx component. |
|
yx |
transform yx component. |
|
xy |
transform xy component. |
|
yy |
transform yy component. |
|
dx |
transform x translation. |
|
dy |
transform y translation. |
Since: 13.0.0
void hb_vector_draw_get_transform (hb_vector_draw_t *draw,float *xx,float *yx,float *xy,float *yy,float *dx,float *dy);
Gets the affine transform used when drawing glyphs.
draw |
a draw context. |
|
xx |
transform xx component. |
[out][nullable] |
yx |
transform yx component. |
[out][nullable] |
xy |
transform xy component. |
[out][nullable] |
yy |
transform yy component. |
[out][nullable] |
dx |
transform x translation. |
[out][nullable] |
dy |
transform y translation. |
[out][nullable] |
Since: 13.0.0
void hb_vector_draw_set_scale_factor (hb_vector_draw_t *draw,float x_scale_factor,float y_scale_factor);
Sets additional output scaling factors.
Since: 13.0.0
void hb_vector_draw_get_scale_factor (hb_vector_draw_t *draw,float *x_scale_factor,float *y_scale_factor);
Gets additional output scaling factors.
draw |
a draw context. |
|
x_scale_factor |
x scale factor. |
[out][nullable] |
y_scale_factor |
y scale factor. |
[out][nullable] |
Since: 13.0.0
void hb_vector_draw_set_extents (hb_vector_draw_t *draw,const hb_vector_extents_t *extents);
Sets or expands output extents on draw
. Passing NULL clears extents.
Since: 13.0.0
hb_bool_t hb_vector_draw_get_extents (hb_vector_draw_t *draw,hb_vector_extents_t *extents);
Gets current output extents from draw
.
Since: 13.0.0
hb_bool_t hb_vector_draw_set_glyph_extents (hb_vector_draw_t *draw,const hb_glyph_extents_t *glyph_extents);
Expands draw
extents using glyph_extents
under the current transform.
Since: 13.0.0
hb_draw_funcs_t *
hb_vector_draw_get_funcs (void);
Gets draw callbacks implemented by the vector draw backend.
Since: 13.0.0
hb_bool_t hb_vector_draw_glyph (hb_vector_draw_t *draw,hb_font_t *font,hb_codepoint_t glyph,float pen_x,float pen_y,hb_vector_extents_mode_t extents_mode);
Draws one glyph into draw
.
draw |
a draw context. |
|
font |
font object. |
|
glyph |
glyph ID. |
|
pen_x |
glyph x origin before context transform. |
|
pen_y |
glyph y origin before context transform. |
|
extents_mode |
extents update mode. |
Since: 13.0.0
void hb_vector_svg_set_flat (hb_vector_draw_t *draw,hb_bool_t flat);
Enables or disables SVG draw flattening.
Since: 13.0.0
void hb_vector_svg_set_precision (hb_vector_draw_t *draw,unsigned precision);
Sets numeric output precision for SVG draw output.
Since: 13.0.0
hb_blob_t *
hb_vector_draw_render (hb_vector_draw_t *draw);
Renders accumulated draw content to an SVG blob.
Since: 13.0.0
void
hb_vector_draw_reset (hb_vector_draw_t *draw);
Resets draw
state and clears accumulated content.
Since: 13.0.0
void hb_vector_draw_recycle_blob (hb_vector_draw_t *draw,hb_blob_t *blob);
Provides a blob for internal buffer reuse by later render calls.
Since: 13.0.0
hb_vector_paint_t *
hb_vector_paint_create_or_fail (hb_vector_format_t format);
Creates a new paint context for vector output.
Since: 13.0.0
hb_vector_paint_t *
hb_vector_paint_reference (hb_vector_paint_t *paint);
Increases the reference count of paint
.
Since: 13.0.0
void
hb_vector_paint_destroy (hb_vector_paint_t *paint);
Decreases the reference count of paint
and destroys it when it reaches zero.
Since: 13.0.0
hb_bool_t hb_vector_paint_set_user_data (hb_vector_paint_t *paint,hb_user_data_key_t *key,void *data,hb_destroy_func_t destroy,hb_bool_t replace);
Attaches user data to paint
.
paint |
a paint context. |
|
key |
user-data key. |
|
data |
user-data value. |
|
destroy |
destroy callback for |
[nullable] |
replace |
whether to replace an existing value for |
Since: 13.0.0
void * hb_vector_paint_get_user_data (hb_vector_paint_t *paint,hb_user_data_key_t *key);
Gets previously attached user data from paint
.
Since: 13.0.0
void hb_vector_paint_set_transform (hb_vector_paint_t *paint,float xx,float yx,float xy,float yy,float dx,float dy);
Sets the affine transform used when painting glyphs.
paint |
a paint context. |
|
xx |
transform xx component. |
|
yx |
transform yx component. |
|
xy |
transform xy component. |
|
yy |
transform yy component. |
|
dx |
transform x translation. |
|
dy |
transform y translation. |
Since: 13.0.0
void hb_vector_paint_get_transform (hb_vector_paint_t *paint,float *xx,float *yx,float *xy,float *yy,float *dx,float *dy);
Gets the affine transform used when painting glyphs.
paint |
a paint context. |
|
xx |
transform xx component. |
[out][nullable] |
yx |
transform yx component. |
[out][nullable] |
xy |
transform xy component. |
[out][nullable] |
yy |
transform yy component. |
[out][nullable] |
dx |
transform x translation. |
[out][nullable] |
dy |
transform y translation. |
[out][nullable] |
Since: 13.0.0
void hb_vector_paint_set_scale_factor (hb_vector_paint_t *paint,float x_scale_factor,float y_scale_factor);
Sets additional output scaling factors.
Since: 13.0.0
void hb_vector_paint_get_scale_factor (hb_vector_paint_t *paint,float *x_scale_factor,float *y_scale_factor);
Gets additional output scaling factors.
paint |
a paint context. |
|
x_scale_factor |
x scale factor. |
[out][nullable] |
y_scale_factor |
y scale factor. |
[out][nullable] |
Since: 13.0.0
void hb_vector_paint_set_extents (hb_vector_paint_t *paint,const hb_vector_extents_t *extents);
Sets or expands output extents on paint
. Passing NULL clears extents.
Since: 13.0.0
hb_bool_t hb_vector_paint_get_extents (hb_vector_paint_t *paint,hb_vector_extents_t *extents);
Gets current output extents from paint
.
Since: 13.0.0
hb_bool_t hb_vector_paint_set_glyph_extents (hb_vector_paint_t *paint,const hb_glyph_extents_t *glyph_extents);
Expands paint
extents using glyph_extents
under the current transform.
Since: 13.0.0
void hb_vector_paint_set_foreground (hb_vector_paint_t *paint,hb_color_t foreground);
Sets fallback foreground color used by paint operations.
Since: 13.0.0
void hb_vector_paint_set_palette (hb_vector_paint_t *paint,int palette);
Sets the color palette index used by paint operations.
Since: 13.0.0
void hb_vector_paint_set_custom_palette_color (hb_vector_paint_t *paint,unsigned color_index,hb_color_t color);
Overrides one font palette color entry for subsequent paint operations.
Overrides are keyed by color_index
and persist on paint
until cleared
(or replaced for the same index).
These overrides are consulted by paint operations that resolve CPAL
entries, including SVG glyph content using var(--colorN).
Since: 13.0.0
void
hb_vector_paint_clear_custom_palette_colors
(hb_vector_paint_t *paint);
Clears all custom palette color overrides previously set on paint
.
After this call, palette lookups use the selected font palette without custom override entries.
Since: 13.0.0
hb_paint_funcs_t *
hb_vector_paint_get_funcs (void);
Gets paint callbacks implemented by the vector paint backend.
Since: 13.0.0
hb_bool_t hb_vector_paint_glyph (hb_vector_paint_t *paint,hb_font_t *font,hb_codepoint_t glyph,float pen_x,float pen_y,hb_vector_extents_mode_t extents_mode);
Paints one color glyph into paint
.
paint |
a paint context. |
|
font |
font object. |
|
glyph |
glyph ID. |
|
pen_x |
glyph x origin before context transform. |
|
pen_y |
glyph y origin before context transform. |
|
extents_mode |
extents update mode. |
Since: 13.0.0
void hb_vector_svg_paint_set_flat (hb_vector_paint_t *paint,hb_bool_t flat);
Enables or disables SVG paint flattening.
paint |
a paint context. |
|
flat |
whether to flatten paint output and disable glyph-group reuse. |
Since: 13.0.0
void hb_vector_svg_paint_set_precision (hb_vector_paint_t *paint,unsigned precision);
Sets numeric output precision for SVG paint output.
Since: 13.0.0
hb_blob_t *
hb_vector_paint_render (hb_vector_paint_t *paint);
Renders accumulated paint content to an SVG blob.
Since: 13.0.0
void
hb_vector_paint_reset (hb_vector_paint_t *paint);
Resets paint
state and clears accumulated content.
Since: 13.0.0
void hb_vector_paint_recycle_blob (hb_vector_paint_t *paint,hb_blob_t *blob);
Provides a blob for internal buffer reuse by later render calls.
Since: 13.0.0
typedef struct {
float x, y;
float width, height;
} hb_vector_extents_t;
Vector output extents, mapped to SVG viewBox.
Since: 13.0.0
Controls whether convenience glyph APIs update context extents.
Since: 13.0.0
typedef struct hb_vector_draw_t hb_vector_draw_t;
Opaque draw context for vector outline conversion.
Since: 13.0.0
typedef struct hb_vector_paint_t hb_vector_paint_t;
Opaque paint context for vector color-glyph conversion.
Since: 13.0.0