summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2018-06-18 09:23:18 +0200
committerWerner Lemberg <wl@gnu.org>2018-06-18 09:23:18 +0200
commitfc40469a6f049343f2694d0b724db22558f0d374 (patch)
tree25cdaa1705ad390aeb3b90da47fa66d0aa769a17
parentb1a3c59f8df2b6f1a0c1ddf10fbfc67138c32cc5 (diff)
downloadfreetype2-fc40469a6f049343f2694d0b724db22558f0d374.tar.gz
Add example for `FT_Get_Color_Glyph_Layer'.
-rw-r--r--include/freetype/freetype.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 1dbcf1724..2daf52957 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -4256,6 +4256,43 @@ FT_BEGIN_HEADER
*
* @FT_Render_Glyph, however, handles colored glyph layers
* automatically if the @FT_LOAD_COLOR flag is passed to it.
+ *
+ * @example:
+ * {
+ * FT_Color* palette;
+ * FT_LayerIterator iterator;
+ *
+ * FT_UInt layer_glyph_index;
+ * FT_UInt layer_color_index;
+ *
+ *
+ * error = FT_Palette_Select( face, palette_index, &palette );
+ * if ( error )
+ * palette = NULL;
+ *
+ * iterator.p = NULL;
+ * layer_glyph_index = FT_Get_Color_Glyph_Layer( face,
+ * glyph_index,
+ * &layer_color_index,
+ * &iterator );
+ *
+ * if ( palette && layer_glyph_index )
+ * {
+ * do
+ * {
+ * FT_Color layer_color = palette[layer_color_index];
+ *
+ *
+ * // Load and render glyph `layer_glyph_index', then
+ * // blend resulting pixmap with previously created pixmaps.
+ *
+ * } while ( ( layer_glyph_index =
+ * FT_Get_Color_Glyph_Layer( face,
+ * glyph_index,
+ * &layer_color_index,
+ * &iterator ) ) != 0 );
+ * }
+ * }
*/
FT_EXPORT( FT_UInt )
FT_Get_Color_Glyph_Layer( FT_Face face,