Add new API hb_font_set_face()

For completeness.
This commit is contained in:
Behdad Esfahbod 2017-02-03 10:39:40 -08:00
parent 4ec19319ab
commit 95808bad2c
2 changed files with 33 additions and 0 deletions

View File

@ -1371,6 +1371,35 @@ hb_font_get_parent (hb_font_t *font)
return font->parent;
}
/**
* hb_font_set_face:
* @font: a font.
* @face: new face.
*
* Sets font-face of @font.
*
* Since: 1.4.3
**/
void
hb_font_set_face (hb_font_t *font,
hb_face_t *face)
{
if (font->immutable)
return;
if (unlikely (!face))
face = hb_face_get_empty ();
if (font->face == face)
return;
hb_face_t *old = font->face;
font->face = hb_face_reference (face);
hb_face_destroy (old);
}
/**
* hb_font_get_face:
* @font: a font.

View File

@ -563,6 +563,10 @@ hb_font_set_parent (hb_font_t *font,
HB_EXTERN hb_font_t *
hb_font_get_parent (hb_font_t *font);
HB_EXTERN void
hb_font_set_face (hb_font_t *font,
hb_face_t *face);
HB_EXTERN hb_face_t *
hb_font_get_face (hb_font_t *font);