Implement hb_ft_font_get_face
This commit is contained in:
parent
36a4fe037d
commit
01ec13a1d9
15
src/hb-ft.cc
15
src/hb-ft.cc
|
@ -325,6 +325,11 @@ hb_ft_face_create_cached (FT_Face ft_face)
|
|||
return hb_face_reference ((hb_face_t *) ft_face->generic.data);
|
||||
}
|
||||
|
||||
void
|
||||
_do_nothing (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
hb_font_t *
|
||||
hb_ft_font_create (FT_Face ft_face,
|
||||
|
@ -338,7 +343,7 @@ hb_ft_font_create (FT_Face ft_face,
|
|||
hb_face_destroy (face);
|
||||
hb_font_set_funcs (font,
|
||||
_hb_ft_get_font_funcs (),
|
||||
ft_face, NULL);
|
||||
ft_face, (hb_destroy_func_t) _do_nothing);
|
||||
hb_font_set_scale (font,
|
||||
((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM) >> 16,
|
||||
((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM) >> 16);
|
||||
|
@ -413,3 +418,11 @@ hb_ft_font_set_funcs (hb_font_t *font)
|
|||
ft_face,
|
||||
(hb_destroy_func_t) FT_Done_Face);
|
||||
}
|
||||
|
||||
FT_Face
|
||||
hb_ft_font_get_face (hb_font_t *font)
|
||||
{
|
||||
if (font->destroy == (hb_destroy_func_t) FT_Done_Face ||
|
||||
font->destroy == (hb_destroy_func_t) _do_nothing)
|
||||
return (FT_Face) font->user_data;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ hb_ft_font_create (FT_Face ft_face,
|
|||
void
|
||||
hb_ft_font_set_funcs (hb_font_t *font);
|
||||
|
||||
FT_Face
|
||||
hb_ft_font_get_face (hb_font_t *font);
|
||||
|
||||
|
||||
HB_END_DECLS
|
||||
|
|
Loading…
Reference in New Issue