[GX] Add new API hb_font_set_var_coords_normalized()
Will probably change.
This commit is contained in:
parent
151d93de8a
commit
ad69e8f07c
|
@ -1548,6 +1548,29 @@ hb_font_get_ppem (hb_font_t *font,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
hb_font_set_var_coords_normalized (hb_font_t *font,
|
||||
int *coords, /* XXX 2.14 normalized */
|
||||
unsigned int coords_length)
|
||||
{
|
||||
if (font->immutable)
|
||||
return;
|
||||
|
||||
int *copy = (int *) calloc (coords_length, sizeof (coords[0]));
|
||||
if (unlikely (!copy))
|
||||
return;
|
||||
|
||||
if (font->x_coords)
|
||||
free (font->x_coords);
|
||||
if (font->y_coords && font->y_coords != font->x_coords)
|
||||
free (font->y_coords);
|
||||
|
||||
memcpy (copy, coords, coords_length * sizeof (coords[0]));
|
||||
font->x_coords = font->y_coords = copy;
|
||||
font->num_coords = coords_length;
|
||||
}
|
||||
|
||||
|
||||
#ifndef HB_DISABLE_DEPRECATED
|
||||
|
||||
/*
|
||||
|
|
|
@ -604,6 +604,11 @@ hb_font_get_ppem (hb_font_t *font,
|
|||
unsigned int *y_ppem);
|
||||
|
||||
|
||||
HB_EXTERN void
|
||||
hb_font_set_var_coords_normalized (hb_font_t *font,
|
||||
int *coords, /* XXX 2.14 normalized */
|
||||
unsigned int coords_length);
|
||||
|
||||
HB_END_DECLS
|
||||
|
||||
#endif /* HB_FONT_H */
|
||||
|
|
Loading…
Reference in New Issue