X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Fusermanual-fonts-and-faces.xml;h=abf5dc2b426dddd408f59496e03f606da61578f4;hb=8b9bac85deb2ace750acafa5e0da676f633aadeb;hp=1258bec8c2a3f052a55c2aa8563121c395c34ffc;hpb=fe65a6a32ba3654c532639ba656bd66b041d7dc6;p=platform%2Fupstream%2Fharfbuzz.git diff --git a/docs/usermanual-fonts-and-faces.xml b/docs/usermanual-fonts-and-faces.xml index 1258bec..abf5dc2 100644 --- a/docs/usermanual-fonts-and-faces.xml +++ b/docs/usermanual-fonts-and-faces.xml @@ -260,18 +260,18 @@ - You can fetch the font-functions configuration for a font object - by calling hb_font_get_font_funcs(): + You can create new font-functions by calling + hb_font_funcs_create(): - hb_font_funcs_t *ffunctions; - ffunctions = hb_font_get_font_funcs (font); + hb_font_funcs_t *ffunctions = hb_font_funcs_create (); + hb_font_set_funcs (font, ffunctions, font_data, destroy); - The individual methods can each be replaced with their own setter + The individual methods can each be set with their own setter function, such as - hb_font_funcs_set_nominal_glyph_func(*ffunctions, - func, *user_data, destroy). + hb_font_funcs_set_nominal_glyph_func(ffunctions, + func, user_data, destroy). Font-functions structures can be reused for multiple font @@ -291,6 +291,20 @@ programs from changing the configuration and introducing inconsistencies and errors downstream. + + To override only some functions while using the default implementation + for the others, you will need to create a sub-font. By default, the + sub-font uses the font functions of its parent except for the functions + that were explicitly set. The following code will override only the + hb_font_get_nominal_glyph_func_t for the sub-font: + + + hb_font_t *subfont = hb_font_create_sub_font (font) + hb_font_funcs_t *ffunctions = hb_font_funcs_create (); + hb_font_funcs_set_nominal_glyph_func (ffunctions, func, user_data, destroy); + hb_font_set_funcs (subfont, ffunctions, font_data, destroy); + hb_font_funcs_destroy (ffunctions); +