freetype/src/base
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
..
basepic.c Whitespace. 2013-03-17 08:14:46 +01:00
basepic.h Whitespace. 2013-03-17 08:14:46 +01:00
ftadvanc.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftapi.c Remove trailing whitespace. From Alexei. 2007-01-16 06:11:27 +00:00
ftbase.c [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH. 2011-12-02 21:14:58 +09:00
ftbase.h [raccess] Modify for PIC build. 2012-01-17 15:13:50 +09:00
ftbbox.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftbdf.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftbitmap.c Add support for color embedded bitmaps (eg. color emoji). 2013-05-29 11:36:18 +02:00
ftcalc.c Fix Savannah bug #38967. 2013-05-12 07:29:04 +02:00
ftcid.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftdbgmem.c Change the type of FT_MEM_VAL() from FT_ULong to FT_PtrDist. 2010-10-25 00:35:59 +09:00
ftdebug.c Fix Savannah bug #38970. 2013-05-13 09:06:42 +02:00
ftfstype.c Formatting, copyright years. 2009-03-03 21:35:32 +00:00
ftgasp.c formatting, copyright years and messages, doc polishing 2007-01-09 10:37:36 +00:00
ftgloadr.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftglyph.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftgxval.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftinit.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftlcdfil.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftmac.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftmm.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftobjs.c Fix Savannah bug #38968. 2013-05-12 06:00:27 +02:00
ftotval.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftoutln.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftpatent.c * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo. 2011-07-20 06:30:20 +02:00
ftpfr.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftpic.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
ftrfork.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftsnames.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftstream.c Formatting. 2013-05-04 15:26:24 +02:00
ftstroke.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftsynth.c * src/base/ftsynth.c (FT_GlyphSlot_Oblique): Fix shear angle. 2012-08-17 09:28:28 +02:00
ftsystem.c */*: Use `FT_THROW'. 2013-03-14 10:27:35 +01:00
fttrigon.c Fix 64bit compilation issues. 2013-05-05 10:44:21 +02:00
fttype1.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftutil.c */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code. 2013-05-10 07:58:47 +02:00
ftwinfnt.c */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. 2013-03-14 17:50:49 +01:00
ftxf86.c Documentation updates, whitespace. 2004-12-13 23:16:59 +00:00
Jamfile Position Independent Code (PIC) support and infrastructure in base. 2009-04-05 17:59:26 +03:00
md5.c Fix compilation with C++. 2013-05-05 16:13:01 +02:00
md5.h Add output bitmap checksums. 2013-04-12 20:11:38 +02:00
rules.mk Add output bitmap checksums. 2013-04-12 20:11:38 +02:00