freetype2/include/freetype/internal
Shao Yu Zhang f04d81751a [sfnt] Preliminary support of coloured layer outlines.
This commit enables OpenType's COLR/CPAL table handling; a typical
application are color emojis that can be scaled to any size.

If the color palette does not exist or is invalid, the rendering
step rasterizes the outline instead.  The current implementation
assumes that the foreground is black.

Enable this by defining option TT_CONFIG_OPTION_COLOR_LAYERS.

There are still some issues with metrics; additionally, an API to
fetch color layers is missing.

* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_OPTION_COLOR_LAYERS): New macro.

* include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec,
FT_Colr_InternalRec): New structures.
(FT_Slot_InternalRec): Add `color_layers' field.

* include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func,
TT_Blend_Colr_Func): New function types.
(SFNT_Interface): Add `load_colr', `free_colr', `load_colr_layer',
and `colr_blend' fields.

* include/freetype/internal/tttypes.h (TT_FaceRec): Add
`colr_and_cpal' field.

* include/freetype/internal/tttags. (TTAG_COLR, TTAG_CPAL): New
macros.

* src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: New files.

* src/base/ftobjs.c (ft_glyphslot_done, FT_Render_Glyph_Internal):
Handle glyph color layers.

* src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC): Add
`ttcolr.c'.

* src/sfnt/sfdriver.c: Include `ttcolr.h'.
(PUT_COLOR_LAYERS): New macro.
Update call to `FT_DEFINE_SFNT_INTERFACE'.

* src/sfnt/sfnt.c: Include `ttcolr.c'.

* src/sfnt/sfobjs.c (sfnt_load_face): Load `COLR' and `CPAL' tables.
(sfnt_done_face): Updated.

* src/truetype/ttgload.c (TT_Load_Glyph): Handle color layers.
2018-05-13 03:25:09 +02:00
..
services Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
autohint.h Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
cffotypes.h Update copyright year. 2018-01-02 09:33:57 +01:00
cfftypes.h Next release will be 2.9. 2018-01-08 11:16:11 +01:00
ftcalc.h Use MS VC++'s _BitScanReverse to calculate MSB (patch #9636). 2018-05-12 06:18:07 +02:00
ftdebug.h Update copyright year. 2018-01-02 09:33:57 +01:00
ftdrv.h Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
ftgloadr.h Update copyright year. 2018-01-02 09:33:57 +01:00
fthash.h Don't use macro names that contain `__' [1/2]. 2016-01-12 21:37:13 +01:00
ftmemory.h Update copyright year. 2018-01-02 09:33:57 +01:00
ftobjs.h [sfnt] Preliminary support of coloured layer outlines. 2018-05-13 03:25:09 +02:00
ftpsprop.h Update copyright year. 2018-01-02 09:33:57 +01:00
ftrfork.h Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
ftserv.h Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
ftstream.h Update copyright year. 2018-01-02 09:33:57 +01:00
fttrace.h Update copyright year. 2018-01-02 09:33:57 +01:00
ftvalid.h Update copyright year. 2018-01-02 09:33:57 +01:00
internal.h Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
psaux.h Update copyright year. 2018-01-02 09:33:57 +01:00
pshints.h Remove FT_CONFIG_OPTION_PIC and related code. 2018-05-02 20:27:48 +02:00
sfnt.h [sfnt] Preliminary support of coloured layer outlines. 2018-05-13 03:25:09 +02:00
t1types.h Update copyright year. 2018-01-02 09:33:57 +01:00
tttypes.h [sfnt] Preliminary support of coloured layer outlines. 2018-05-13 03:25:09 +02:00