Commit Graph

16 Commits

Author SHA1 Message Date
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg 1658685967 Remove redundant inclusion of `ft2build.h'.
* */*: Remove `#include <ft2build.h>' where possible.

* include/freetype/freetype.h: Remove cpp error about missing
inclusion of `ft2build.h'.
2020-06-13 21:15:45 +02:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg 9ac9060df0 [GSoC] src/*.*: Convert block comments to `light' style.
This monster commit was created by applying Nikhil's scripts
`docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.

No change in functionality, of course.

I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git.
2018-06-03 09:08:41 +02:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Werner Lemberg 1c6fd99437 [sfnt] Improve FT_LOAD_BITMAP_METRICS_ONLY for `sbix' format.
It's unavoidable to call the PNG engine, but to get the metrics it
is sufficient to read the PNG image's header only.

* src/sfnt/pngshim.c (Load_SBit_Png): Add argument to control the
allocation of the glyph slot.
* src/sfnt/pngshim.h: Updated.
* src/sfnt/ttsbit.c (tt_sbit_decoder_load_png,
tt_face_load_sbix_image, tt_face_load_sbit_image): Updated.
2016-11-06 12:37:55 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 37412ff9f4 Don't use macro names that contain `__' [1/2].
Such macro names are reserved for both C and C++.

*/*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
2016-01-12 21:37:13 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg f796cf6c6b Normalize copyright notice format. 2015-01-17 20:11:10 +01:00
Werner Lemberg 01705395b0 [sfnt] Add support for Apple's `sbix' color bitmap table.
* include/freetype/internal/tttypes.h (TT_SBit_MetricsRec): Widen
fields to FT_Short and FT_UShort, respectively.
(TT_SBitTableType): New enumeration.
(TT_FaceRec): Add `sbit_table_type' field.

* include/freetype/tttags.h (TTAG_sbix): New macro.

* src/sfnt/pngshim.c (Load_SBit_Png): Pass a more generic
FT_GlyphSlot argument instead FT_Bitmap.
Add flag to control map and metrics handling.
Update all users.

* src/sfnt/ttsbit.c: Include `ttmtx.h'.
(tt_face_load_eblc): Renamed to...
(tt_face_load_sbit): This.
Handlic `sbix' bitmaps.
(tt_face_free_eblc): Renamed to...
(tt_face_load_sbit): This.
Updated.
(tt_face_load_strike_metrics): Handle `sbix' bitmaps.
(tt_face_load_sbix_image): New function.
(tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_image,
tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,
tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,
tt_sbit_decoder_load_image, tt_sbit_decoder_load_bitmap): Don't pass
and handle load flags.
(tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG]: Better
handle formats 17-19.
Move color to grayscale conversion to...
(tt_face_load_sbit_image): Here.
Handle `sbix' bitmaps.

* src/sfnt/pngshim.h: Updated.
* src/sfnt/ttsbit.h: Updated.
* src/sfnt/sfdriver.c: Updated.
2013-07-18 13:13:12 +02:00
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