shithub: freetype+ttf2subf

Download patch

ref: f87ced9dc98c8f9178e2668b998e7a41d11406f8
parent: 7c7004d60cd5fee4675fd33bf2f5c422c802e0b8
author: Werner Lemberg <[email protected]>
date: Wed Jun 6 13:49:17 EDT 2018

ftcolor.h: Redesign API.

While going to implement it I noticed that I need access to most of
the `CPAL' elements; I thus plan to add a `cpal' field to
`TT_FaceRec', which makes most of the previously suggested API
functions obsolete because the fields will be directly accessable.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-06-06  Werner Lemberg  <[email protected]>
+
+	ftcolor.h: Redesign API.
+
+	While going to implement it I noticed that I need access to most of
+	the `CPAL' elements; I thus plan to add a `cpal' field to
+	`TT_FaceRec', which makes most of the previously suggested API
+	functions obsolete because the fields will be directly accessable.
+
 2018-06-06  Parth Wazurkar  <[email protected]>
 
 	[bdf, pcf] Remove deprecated FT_FACE_FLAG_FAST_GLYPHS flag.
--- a/include/freetype/ftcolor.h
+++ b/include/freetype/ftcolor.h
@@ -167,7 +167,7 @@
    * @since:
    *   2.10
    */
-  typedef FT_Palette_ {
+  typedef struct  FT_Palette_ {
     FT_UShort         num_palettes;
     const FT_UShort*  palette_name_ids;
     const FT_UShort*  palette_types;
@@ -176,6 +176,39 @@
     const FT_UShort*  palette_entry_name_ids;
 
   } FT_Palette;
+
+
+  /**************************************************************************
+   *
+   * @func:
+   *   FT_Palette_Get
+   *
+   * @description:
+   *   Retrieve the face's color palette data.
+   *
+   * @input:
+   *   face ::
+   *     The source face handle.
+   *
+   * @output:
+   *   apalette ::
+   *     A pointer to an @FT_Palette structure.
+   *
+   * @return:
+   *   FreeType error code.  0~means success.
+   *
+   * @note:
+   *   All arrays in the returned @FT_Palette structure are read-only.
+   *
+   *   This function always returns an error if the config macro
+   *   `TT_CONFIG_OPTION_COLOR_LAYERS' is not defined in `ftoption.h'.
+   *
+   * @since:
+   *   2.10
+   */
+  FT_EXPORT( FT_Error )
+  FT_Palette_Get( FT_Face      face,
+                  FT_Palette  *apalette );
 
 
   /**************************************************************************