diff --git a/docs/usermanual-integration.xml b/docs/usermanual-integration.xml index 66060f466..5f922ab10 100644 --- a/docs/usermanual-integration.xml +++ b/docs/usermanual-integration.xml @@ -207,18 +207,27 @@ FT_Set_Char_Size(face, 0, 1000, 0, 0); hb_font_t *font = hb_ft_font_create(face); + + hb_ft_font_create_referenced() is + the recommended function for creating an hb_face_t face + object. This function calls FT_Reference_Face() + before using the FT_Face and calls + FT_Done_Face() when it is finished using the + FT_Face. Consequently, your client program does not need + to worry about destroying the FT_Face while HarfBuzz + is still using it. + Although hb_ft_font_create_referenced() is - the recommended function, there is another variant. The simpler - version of the function is - hb_ft_font_create(), which takes an - FT_Face and an optional destroy callback as its - arguments. The critical difference between the two is that - hb_ft_font_create() does not offer the - lifecycle-management feature. Your client code will be - responsible for tracking references to the FT_Face objects and - destroying them when they are no longer needed. If you do not - have a valid reason for doing this, user + the recommended function, there is another variant for client code + where special circumstances make it necessary. The simpler + version of the function is hb_ft_font_create(), + which takes an FT_Face and an optional destroy callback + as its arguments. Because hb_ft_font_create() + does not offer lifecycle management, however, your client code will + be responsible for tracking references to the FT_Face + objects and destroying them when they are no longer needed. If you + do not have a valid reason for doing this, use hb_ft_font_create_referenced().