ftFaceCreateReferenced
fn
harfbuzz.face.Face ftFaceCreateReferenced(freetype2.types.Face ftFace)Creates an #hb_face_t face object from the specified FT_Face.
Note that this is using the FT_Face object just to get at the underlying font data, and fonts created from the returned #hb_face_t will use the native HarfBuzz font implementation, unless you call [harfbuzz.global.ftFontSetFuncs] on them.
This is the preferred variant of the hb_ft_face_create* function family, because it calls FT_Reference_Face() on ft_face, ensuring that ft_face remains alive as long as the resulting #hb_face_t face object remains alive. Also calls FT_Done_Face() when the #hb_face_t face object is destroyed.
Use this version unless you know you have good reasons not to.
Parameters
ftFace | FT_Face to work upon |
Returns
the new #hb_face_t face object