[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] GSoC-2019-moazin ead9ca4 2/2: Document `svg_hooks` property.
From: |
Moazin Khatti |
Subject: |
[freetype2] GSoC-2019-moazin ead9ca4 2/2: Document `svg_hooks` property. |
Date: |
Sat, 24 Aug 2019 09:44:31 -0400 (EDT) |
branch: GSoC-2019-moazin
commit ead9ca42df08c8f2b4b2ed7ba9718b82b749f55e
Author: Moazin Khatti <address@hidden>
Commit: Moazin Khatti <address@hidden>
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 497bde9..46dff9e 100644
--- a/include/freetype/ftdriver.h
+++ b/include/freetype/ftdriver.h
@@ -621,6 +621,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_RenderHooks 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_RenderHooks 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:
* TT_INTERPRETER_VERSION_XXX
*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] GSoC-2019-moazin ead9ca4 2/2: Document `svg_hooks` property.,
Moazin Khatti <=