From f943af64905378bde29eaf7c4404f1a0fb971830 Mon Sep 17 00:00:00 2001 From: Moazin Khatti Date: Sat, 24 Aug 2019 18:39:50 +0500 Subject: Document `svg_hooks` property. --- include/freetype/ftdriver.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/freetype/ftdriver.h b/include/freetype/ftdriver.h index 497bde9f6..5c8b8360f 100644 --- a/include/freetype/ftdriver.h +++ b/include/freetype/ftdriver.h @@ -619,6 +619,46 @@ FT_BEGIN_HEADER */ + /************************************************************************** + * + * @property: + * svg_hooks + * + * @description: + * OT-SVG glyphs are rendererd with the use of some callback hooks to an + * external SVG rendering library. OT-SVG glyphs support can be enabled + * by compiling FreeType with `FT_CONFIG_OPTION_SVG`. The hooks can be + * stored in an @SVG_RendererHooks structure, which is then passed as the + * value of `svg_hooks` property. See the example. We also provide + * default hooks which can be enabled by compiling with + * `FT_CONFIG_OPTION_DEFAULT_SVG`. Then, nothing needs to be set from + * the user side, unless the user wants to use some other library. + * + * @note: + * This property can only be set via @FT_Property_Set. + * + * @example: + * ``` + * FT_Library library; + * SVG_RendererHooks hooks; + * + * + * FT_Init_FreeType( &library ); + * + * hooks.init_svg = (SVG_Lib_Init_Func)foo_port_init; + * hooks.free_svg = (SVG_Lib_Free_Func)foo_port_free; + * hooks.render_svg = (SVG_Lib_Render_Func)foo_port_render; + * hooks.preset_slot = (SVG_Lib_Preset_Slot_Func)foo_port_preset_slot; + * + * FT_Property_Set( library, "ot-svg", "svg_hooks", &hooks ); + * + * ``` + * + * @since: + * 2.11 + */ + + /************************************************************************** * * @enum: -- cgit v1.2.1