freetype2/include/freetype
Behdad Esfahbod 760d342d37 Add support for color embedded bitmaps (eg. color emoji).
A new load flag, FT_LOAD_COLOR, makes FreeType load color
embedded-bitmaps, following this draft specification

  https://color-emoji.googlecode.com/git/specification/v1.html

which defines two new SFNT tables, `CBDT' and `CBLC' (named and
modeled after `EBDT' and `EBLC', respectively).  The color bitmaps
are stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA
pre-multiplied sRGB images.  If PNG support is available, PNG color
images as defined in the same proposed specification are supported
also.

Note that color bitmaps are converted to grayscale if client didn't
ask for color.

* builds/unix/configure.raw: Search for libpng.
Add `--without-png' option.

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

* include/freetype/freetype.h (FT_LOAD_COLOR): New load flag.

* include/freetype/ftimage.h (FT_Pixel_Mode): Add
`FT_PIXEL_MODE_BGRA'.

* include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags.

* src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated.
(ft_gray_for_premultiplied_srgb_bgra): New function.
(FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA.

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

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

* src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h'
(tt_face_load_eblc): Load `CBLC'.
(tt_sbit_decoder_init): Load `CBDT'.
(tt_sbit_decoder_alloc_bitmap): Pass load flags to select between
color and grayscale bitmaps.
Set `num_grays'.  This is used by `ftview' to choose the blending
algorithm.
(tt_sbit_decoder_load_byte_aligned,
tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound,
tt_sbit_decoder_load_image): Pass load flag.
s/write/pwrite/.
Don't call `tt_sbit_decoder_alloc_bitmap'.
Updated.
(tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function.
(tt_sbit_decoder_load_bitmap): Pass load flag.
Handle new glyph formats 17, 18, and 19.
Call `tt_sbit_decoder_alloc_bitmap'.
Flatten color bitmaps if necessary.
(tt_face_load_sbit_image): Updated.

* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'.

* docs/CHANGES: Updated.
2013-05-29 11:36:18 +02:00
..
config Add support for color embedded bitmaps (eg. color emoji). 2013-05-29 11:36:18 +02:00
internal */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code. 2013-05-10 07:58:47 +02:00
freetype.h Add support for color embedded bitmaps (eg. color emoji). 2013-05-29 11:36:18 +02:00
ftadvanc.h load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_Int32 to match the flags of FT_Load_Glyph() 2009-01-09 11:11:53 +00:00
ftautoh.h Remove trailing whitespace. 2013-01-24 13:33:06 +01:00
ftbbox.h Document BBox and CBox computation problems for tricky fonts. 2011-04-13 00:29:41 +02:00
ftbdf.h * include/freetype/ftbdf.h (FT_Get_BDF_Property): Improve documentation. 2009-01-11 11:45:54 +00:00
ftbitmap.h Add support for color embedded bitmaps (eg. color emoji). 2013-05-29 11:36:18 +02:00
ftbzip2.h Improve bzip2 support. 2010-12-31 17:47:09 +01:00
ftcache.h Minor doc improvements. 2013-05-28 22:37:10 +02:00
ftcffdrv.h [cff] Add a new Type 2 interpreter and hinter. 2013-04-13 18:53:28 +02:00
ftchapters.h [truetype] Add `interpreter-version' property. 2013-05-17 13:51:07 +02:00
ftcid.h Typo. 2009-03-11 21:39:10 +00:00
fterrdef.h [cff] Add a new Type 2 interpreter and hinter. 2013-04-13 18:53:28 +02:00
fterrors.h New error management macros. 2013-03-14 15:49:49 +01:00
ftgasp.h Remove trailing spaces. 2012-01-17 02:00:24 +09:00
ftglyph.h Call it fixed-point. 2013-01-12 19:17:05 -05:00
ftgxval.h Improve navigation in API reference. 2008-06-26 19:56:51 +00:00
ftgzip.h Improve navigation in API reference. 2008-06-26 19:56:51 +00:00
ftimage.h Add support for color embedded bitmaps (eg. color emoji). 2013-05-29 11:36:18 +02:00
ftincrem.h Doc fix. 2010-02-13 07:53:37 +01:00
ftlcdfil.h * include/freetype/ftlcdfil.h: Add description of color filtering. 2013-03-29 19:35:39 +01:00
ftlist.h Fix various memory problems found by linuxtesting.org. 2010-05-22 20:03:41 +02:00
ftlzw.h Improve navigation in API reference. 2008-06-26 19:56:51 +00:00
ftmac.h Improve navigation in API reference. 2008-06-26 19:56:51 +00:00
ftmm.h Documentation fixes. 2009-01-19 08:35:45 +00:00
ftmodapi.h Fix Savannah bug #38968. 2013-05-12 06:00:27 +02:00
ftmoderr.h * include/freetype/ftmoderr.h: Fix commit from 2013-03-11. 2013-03-15 08:16:25 +01:00
ftotval.h Improve navigation in API reference. 2008-06-26 19:56:51 +00:00
ftoutln.h Check parameters of `FT_Outline_New'. 2012-12-21 16:45:27 +01:00
ftpfr.h Documentation fixes. 2009-01-19 08:47:43 +00:00
ftrender.h Fix parameter handling of `FT_Set_Renderer'. 2010-12-13 20:17:26 +01:00
ftsizes.h Documentation fixes. 2009-01-19 08:35:45 +00:00
ftsnames.h Minor doc fixes. 2010-02-13 07:53:37 +01:00
ftstroke.h Call it fixed-point. 2013-01-12 19:17:05 -05:00
ftsynth.h * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing. 2012-06-15 06:33:46 +02:00
ftsystem.h Add some memory checks (mainly for debugging). 2010-06-26 09:24:08 +02:00
fttrigon.h [base] Make `FT_Hypot' really internal. 2013-01-24 09:12:56 +01:00
ftttdrv.h [truetype] Add `interpreter-version' property. 2013-05-17 13:51:07 +02:00
fttypes.h New error management macros. 2013-03-14 15:49:49 +01:00
ftwinfnt.h Improve navigation in API reference. 2008-06-26 19:56:51 +00:00
ftxf86.h Document that FT_Get_X11_Font_Format() is a general call. 2009-08-28 09:08:00 +02:00
t1tables.h Typo. 2011-11-15 08:17:59 +01:00
ttnameid.h Improve documentation of Unicode IVS handling. 2012-11-04 17:25:29 +01:00
tttables.h Improve documentation of Unicode IVS handling. 2012-11-04 17:25:29 +01:00
tttags.h Add support for color embedded bitmaps (eg. color emoji). 2013-05-29 11:36:18 +02:00
ttunpat.h * src/tools/docmaker/sources.py (re_source_keywords): Add word 2006-05-12 08:00:13 +00:00