ref: db7c4060840c1e6b657e8a0fd8b449ba0968d0a3
parent: d45d4b97e6a03cfe21a2952138cf6e970fc358e5
author: Werner Lemberg <[email protected]>
date: Wed May 30 17:21:19 EDT 2018
ftcolor.h: Improve API design, fix typos (#54011, #54014). * include/freetype/ftcolor.h (FT_Palette_Get_Names): Replace with... (FT_Palette_Get_Name_IDs): ... this function. (FT_Palette_Get_Entry_Names): Replace with... (FT_Palette_Get_Entry_Name_IDs): ... this function s/FT_Palette_Set_Foreground_COlor/FT_Palette_Set_Foreground_Color/.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-05-30 Werner Lemberg <[email protected]>
+
+ ftcolor.h: Improve API design, fix typos (#54011, #54014).
+
+ * include/freetype/ftcolor.h (FT_Palette_Get_Names): Replace with...
+ (FT_Palette_Get_Name_IDs): ... this function.
+ (FT_Palette_Get_Entry_Names): Replace with...
+ (FT_Palette_Get_Entry_Name_IDs): ... this function
+ s/FT_Palette_Set_Foreground_COlor/FT_Palette_Set_Foreground_Color/.
+
2018-05-30 Armin Hasitzka <[email protected]>
Beautify a3cfed5e87232c933bdc64f43e8ebebcfd18b41b.
--- a/include/freetype/ftcolor.h
+++ b/include/freetype/ftcolor.h
@@ -125,10 +125,11 @@
/**************************************************************************
*
* @func:
- * FT_Palette_Get_Names
+ * FT_Palette_Get_Name_IDs
*
* @description:
- * Get the palette names, for example `dark' or `light'.
+ * Get the palette name IDs, which correspond to entries like `dark' or
+ * `light' in the font's `name' table.
*
* @input:
* face ::
@@ -135,11 +136,12 @@
* The source face handle.
*
* @output:
- * apalette_names ::
- * A read-only array of palette names, taken from the font's `name'
- * table. NULL if the font's `CPAL' table doesn't contain appropriate
- * data.
+ * palette_name_ids ::
+ * A read-only array of palette name IDs. NULL if the font's `CPAL'
+ * table doesn't contain appropriate data.
*
+ * Use function @FT_Get_Sfnt_Name to map name IDs to a name strings.
+ *
* @return:
* FreeType error code. 0~means success.
*
@@ -146,8 +148,8 @@
* @note:
* The number of palettes can be retrieved with @FT_Palette_Get_Size.
*
- * An empty name entry in the `CPAL' table gets represented as an empty
- * string.
+ * An empty name ID in the `CPAL' table gets represented as value
+ * 0xFFFF.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS' is not defined in `ftoption.h'.
@@ -156,8 +158,8 @@
* 2.10
*/
FT_EXPORT( FT_Error )
- FT_Palette_Get_Names( FT_Face face,
- const FT_String* const* apalette_names );
+ FT_Palette_Get_Name_IDs( FT_Face face,
+ const FT_UShort* palette_name_ids );
/**************************************************************************
@@ -230,14 +232,15 @@
/**************************************************************************
*
* @func:
- * FT_Palette_Get_Entry_Names
+ * FT_Palette_Get_Entry_Name_IDs
*
* @description:
- * Get the palette entry names. In each palette, entries with the same
- * index have the same function. For example, index~0 might be the
- * string `outline' to indicate that this palette entry is used for
- * outlines, index~1 might be `fill' to indicate the filling color
- * palette entry, etc.
+ * Get the palette entry name IDs. In each palette, entries with the
+ * same index have the same function. For example, index~0 might
+ * correspond to string `outline' in the font's `name' table to indicate
+ * that this palette entry is used for outlines, index~1 might
+ * correspond to `fill' to indicate the filling color palette entry,
+ * etc.
*
* @input:
* face ::
@@ -245,10 +248,12 @@
*
* @output:
* aentry_names ::
- * A read-only array of palette entry names, taken from the font's
- * `name' table. NULL if the font's `CPAL' table doesn't contain
- * appropriate data.
+ * A read-only array of palette entry name IDs. NULL if the font's
+ * `CPAL' table doesn't contain appropriate data.
*
+ * Use function @FT_Get_Sfnt_Name to map entry name IDs to a name
+ * strings.
+ *
* @return:
* FreeType error code. 0~means success.
*
@@ -256,8 +261,8 @@
* The number of palette entries can be retrieved with
* @FT_Palette_Get_Size.
*
- * An empty name entry in the `CPAL' table gets represented as an empty
- * string.
+ * An empty entry name ID in the `CPAL' table gets represented as value
+ * 0xFFFF.
*
* This function always returns an error if the config macro
* `TT_CONFIG_OPTION_COLOR_LAYERS' is not defined in `ftoption.h'.
@@ -266,8 +271,8 @@
* 2.10
*/
FT_EXPORT( FT_Error )
- FT_Palette_Get_Entry_Names( FT_Face face,
- const FT_String* const* aentry_names );
+ FT_Palette_Get_Entry_Name_IDs( FT_Face face,
+ const FT_UShort* palette_entry_name_ids );
/**************************************************************************
@@ -351,7 +356,7 @@
* 2.10
*/
FT_EXPORT( FT_Error )
- FT_Palette_Set_Foreground_COlor( FT_Face face,
+ FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color );
/* */