From f87ced9dc98c8f9178e2668b998e7a41d11406f8 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 6 Jun 2018 17:49:17 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ include/freetype/ftcolor.h | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 674da28fa..db224a283 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2018-06-06 Werner Lemberg + + 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 [bdf, pcf] Remove deprecated FT_FACE_FLAG_FAST_GLYPHS flag. diff --git a/include/freetype/ftcolor.h b/include/freetype/ftcolor.h index c11998111..3abe40290 100644 --- a/include/freetype/ftcolor.h +++ b/include/freetype/ftcolor.h @@ -167,7 +167,7 @@ FT_BEGIN_HEADER * @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; @@ -178,6 +178,39 @@ FT_BEGIN_HEADER } 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 ); + + /************************************************************************** * * @func: