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/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
diff --git a/ChangeLog b/ChangeLog
index 06bac8b..94a0a1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-05-30 Werner Lemberg <wl@gnu.org>
+
+ 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 <prince.cherusker@gmail.com>
Beautify a3cfed5e87232c933bdc64f43e8ebebcfd18b41b.
diff --git a/include/freetype/ftcolor.h b/include/freetype/ftcolor.h
index 4a2e11d..3065fde 100644
--- a/include/freetype/ftcolor.h
+++ b/include/freetype/ftcolor.h
@@ -125,20 +125,22 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @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 ::
* 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 @@ FT_BEGIN_HEADER
* @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 @@ FT_BEGIN_HEADER
* 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 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @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,9 +248,11 @@ FT_BEGIN_HEADER
*
* @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 @@ FT_BEGIN_HEADER
* 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 @@ FT_BEGIN_HEADER
* 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 @@ FT_BEGIN_HEADER
* 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 );
/* */