summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add function `FT_Get_GlyphLayers' to access `COLR' table data.Werner Lemberg2018-05-164-18/+43
| | | | | | | | | | | * include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec): Move this structure to... * include/freetype/freetype.h (FT_Glyph_LayerRec): ... this header file. (FT_Glyph_Layer): New typedef. Update code to use it where appropriate. * src/base/ftobjs.c (FT_Get_GlyphLayers): New function.
* [base] Fix mono bitmap presetting (#53896).Alexei Podtelezhnikov2018-05-151-19/+13
| | | | | | | | | | | | It is rather fundamental to set monochrome bitmap based on rounded CBox because the b/w rasterizer turns on pixels when their centers are inside the glyph outline. The dropout control is unpredictable and can distort narrow glyphs if the bitmap is too wide. Reported by Chris Liddell. * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): If BBox boundaries are too close, adjust them before rounding.
* [psaux] Fix compiler warning (#53915).Werner Lemberg2018-05-151-2/+9
| | | | * src/psaux/psft.c (cf2_freeT1SeacComponent): Do it.
* [sfnt] Fix memory leak in handling `COLR' data.Werner Lemberg2018-05-152-9/+8
| | | | | | * src/truetype/ttgload.c (TT_Load_Glyph): Free old `layers' array before reassigning allocated memory. Only allocate `color_layers' if we don't have one already.
* Grammar fixes.Werner Lemberg2018-05-151-4/+4
|
* [sfnt] If `COLR' is present, don't assume that all glyphs use it.Werner Lemberg2018-05-153-8/+16
| | | | | | | | * src/sfnt/ttcolr.c (tt_face_load_colr_layers): Return FT_Err_Ok if current glyph is not a `COLR' base glyph. * src/truetype/ttgload.c (TT_Load_Glyph): Don't allocate `color_layers' if there are no color layers.
* * src/base/ftobjs.c (FT_Load_Glyph): Fix signature of `pixel_modes'.Werner Lemberg2018-05-141-9/+11
|
* Provide dummy functions if `TT_CONFIG_OPTION_SFNT_NAMES' is not set.Werner Lemberg2018-05-141-1/+39
| | | | * src/base/ftsnames.c [!TT_CONFIG_OPTION_SFNT_NAMES]: Implement it.
* * src/base/ftobjs.c (FT_Load_Glyph): Improve tracing.Werner Lemberg2018-05-131-11/+28
|
* [sfnt] Preliminary support of coloured layer outlines.Shao Yu Zhang2018-05-1310-4/+737
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [pcf]Documentation Typo.Parth Wazurkar2018-05-111-1/+1
|
* [autofit] Avoid potential SEGV if running out of memory.Werner Lemberg2018-05-083-22/+75
| | | | | | | | | | | | | | | | | Problem reported by Shailesh Mistry <shailesh.mistry@hotmail.co.uk>. * src/autofit/afshaper.c (af_shaper_buf_create, af_shaper_buf_destroy) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Don't allocate and free a four-byte buffer. Instead, make those functions no-ops; the calling functions will provide a pointer to a buffer instead. * src/autofit/afcjk.c (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, af_cjk_metrics_check_digits), src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_metrics_init_blues, af_latin_metrics_check_digits) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Use pointer to local variable for `shaper_buf'.
* Remove FT_CONFIG_OPTION_PIC and related code.Werner Lemberg2018-05-0280-2718/+121
| | | | | | | | | | | | | | | | | */* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this preprocessor symbol. */*: Replace `XXX_GET' macros (which could be either a function in PIC mode or an array in non-PIC mode) with `xxx' arrays. * include/freetype/internal/ftpic.h, src/autofit/afpic.c, src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h, src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h, src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c, src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h, src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c, src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h: Removed.
* * Version 2.9.1 released.VER-2-9-1Werner Lemberg2018-05-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ========================= Tag sources with `VER-2-9-1'. * docs/VERSION.TXT: Add entry for version 2.9.1. * docs/CHANGES: Updated. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, src/base/ftver.rc, builds/windows/vc2005/index.html, builds/windows/vc2008/freetype.vcproj, builds/windows/vc2008/index.html, builds/windows/vc2010/freetype.vcxproj, builds/windows/vc2010/index.html, builds/windows/visualc/freetype.dsp, builds/windows/visualc/freetype.vcproj, builds/windows/visualc/index.html, builds/windows/visualce/freetype.dsp, builds/windows/visualce/freetype.vcproj, builds/windows/visualce/index.html, builds/wince/vc2005-ce/freetype.vcproj, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/freetype.vcproj, builds/wince/vc2008-ce/index.html: s/2.9/2.9.1/, s/29/291/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. * builds/unix/configure.raw (version_info): Set to 22:1:16. * CMakeLists.txt (VERSION_PATCH): Set to 1. * include/freetype/ftgasp.h: Use FT_BEGIN_HEADER and FT_END_HEADER.
* Another fix for handling invalid format 2 cmaps.Werner Lemberg2018-04-261-1/+1
| | | | | | | | | | | Sigh. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8003 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid an endless loop.
* [base] Avoid undefined behaviour in lcd filtering code (#53727).Ben Wagner2018-04-241-2/+2
| | | | | * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy): Ensure `height > 0'.
* * src/base/ftoutln.c (FT_Outline_Decompose): Improve error tracing.Werner Lemberg2018-04-221-3/+4
|
* [base] Fix bitmap emboldening.Alexei Podtelezhnikov2018-04-221-4/+6
| | | | | | | | Bug introduced after release 2.8. * src/base/ftbitmap.c (ft_bitmap_assure_buffer): We use `FT_QALLOC_MULT', which doesn't zero out the buffer. Adjust the bitmap copying code to take care of this fact.
* Revert "[base] Fix bitmap copying where the new pitch is smaller."Werner Lemberg2018-04-221-44/+14
| | | | This reverts commit c0f1adedcfaad4f7d2fe912ff4b2933845d61d93.
* [base] Fix bitmap copying where the new pitch is smaller.Werner Lemberg2018-04-221-14/+44
| | | | * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Handle it.
* Another fix for handling invalid format 2 cmaps.Werner Lemberg2018-04-221-1/+1
| | | | | | | | | | | The previous commit was incomplete. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7928 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid an endless loop.
* [autofit] Add support for Georgian Mtavruli characters.Werner Lemberg2018-04-194-150/+164
| | | | | | | | | This will be part of the forthcoming Unicode 11.0. * src/autofit/afblue.dat: Add blue zone data for Mtavruli. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Mtavruli standard character.
* Fix handling of invalid format 2 cmaps.Werner Lemberg2018-04-191-0/+7
| | | | | | | | | | The problem was introduced after the last release. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7828 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Avoid endless loop.
* [truetype] Integer overflow issues.Werner Lemberg2018-04-171-1/+1
| | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7739 * src/truetype/ttinterp.c (Ins_CEILING): Use FT_PIX_CEIL_LONG.
* [truetype] Integer overflow issues.Werner Lemberg2018-04-161-1/+1
| | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7718 * src/truetype/ttinterp.c (Ins_MIRP): Use ADD_LONG.
* [docmaker] Make it work with python3.Ankit Dhankhar2018-04-155-83/+81
| | | | | * src/tools/docmaker (*.py): Use parentheses around arguments of `print'. Remove unused imports.
* [truetype]: Limit `SLOOP' bytecode argument to 16 bits.Werner Lemberg2018-04-151-1/+4
| | | | | | | | This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7707 * src/truetype/ttinterp.c (Ins_SLOOP): Do it.
* [truetype] Integer overflow issues.Werner Lemberg2018-04-141-8/+10
| | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7652 * src/truetype/ttinterp.c (Ins_MDAP): Use SUB_LONG.
* [autofit] Update to Unicode 11.0.0.Werner Lemberg2018-04-141-9/+16
| | | | | | | | | | | But no support new scripts (volunteers welcomed). * src/autofit/afranges.c (af_arab_nonbase_uniranges, af_beng_nonbase_uniranges, af_cakm_nonbase_uniranges, af_deva_nonbase_uniranges, af_geor_uniranges, af_gujr_nonbase_uniranges, af_mlym_nonbase_uniranges, af_nkoo_nonbase_uniranges, af_telu_nonbase_uniranges, af_hani_uniranges): Add new data.
* [truetype] Integer overflow issues.Werner Lemberg2018-04-091-4/+4
| | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7453 * src/truetype/ttinterp.c (Round_Super, Round_Super_45): Use ADD_LONG and SUB_LONG.
* [cff, type1] Sanitize `BlueFuzz' and `BlueShift'.Werner Lemberg2018-04-043-2/+38
| | | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7371 * src/cff/cffload.c (cff_load_private_dict): Sanitize `priv->blue_shift' and `priv->blue_fuzz' to avoid overflows later on. * src/type1/t1load.c (T1_Open_Face): Ditto.
* * src/truetype/ttobjs.c (trick_names): Add 3 tricky fonts (#53554),suzuki toshiya2018-04-041-2/+20
| | | | | | `DFHei-Md-HK-BF', `DFKaiShu-Md-HK-BF' and `DFMing-Bd-HK-BF'. (tt_check_trickyness_sfnt_ids): Add checksums for 3 tricky fonts in above.
* [truetype] Fix memory leak (only if tracing is on).Werner Lemberg2018-03-301-0/+3
| | | | | * src/truetype/ttgxvar.c (TT_Get_MM_Var) [FT_DEBUG_LEVEL_TRACE}: Fix it.
* [sfnt] Correctly handle missing bitmaps in sbix format (#53404).Ben Wagner2018-03-231-1/+1
| | | | * src/sfnt/ttfsbit.c (tt_face_load_sbix_image): Fix return value.
* [truetype] Fix advance of empty glyphs in bitmap fonts (#53393).Ben Wagner2018-03-231-13/+19
| | | | | * src/truetype/ttgload.c (TT_Load_Glyph): Apply scaling to metrics for empty bitmaps.
* * src/sfnt/ttcmap.c (tt_cmap2_validate): Fix potential numericWerner Lemberg2018-03-131-10/+11
| | | | overflow.
* Fix cmap format 2 handling (#53320).Werner Lemberg2018-03-131-8/+7
| | | | | | The patch introduced for #52646 was not correct. * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition.
* Make `ftlcdfil.c' part of the `base' module.Werner Lemberg2018-03-053-1/+3
| | | | | | | | | | | | | | `ftobjs.c' needs `ft_lcd_padding'. Problem reported by duhuanpeng <548708880@qq.com>. * modules.cfg (BASE_EXTENSIONS): Don't include `ftlcdfil.c'. * src/base/ftbase.c: Include `ftlcdfil.c'. * src/base/rules.mk (BASE_SRC): Add `ftlcdfil.c'. * src/base/Jamfile (_sources): Adjusted. * docs/INSTALL.ANY: Updated.
* Make `ftfntfmt.c' part of the `base' module.Werner Lemberg2018-03-053-1/+3
| | | | | | | | | | | | | | `ftobjs.c' needs `FT_Get_Font_Format'. Problem reported by duhuanpeng <548708880@qq.com>. * modules.cfg (BASE_EXTENSIONS): Don't include `ftfntfmt.c'. * src/base/ftbase.c: Include `ftfntfmt.c'. * src/base/rules.mk (BASE_SRC): Add `ftfntfmt.c'. * src/base/Jamfile (_sources): Adjusted. * docs/INSTALL.ANY: Updated.
* * src/truetype/ttinterp.c (TT_RunIns): Fix tracing arguments.Werner Lemberg2018-03-011-2/+2
|
* [sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154).Werner Lemberg2018-02-171-0/+9
|
* s/sub-pixel/subpixel/.Werner Lemberg2018-02-173-5/+5
|
* [truetype] Integer overflow issues.Werner Lemberg2018-02-061-7/+33
| | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6027 * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIAP, Ins_MIRP): Use SUB_LONG; avoid FT_ABS.
* [truetype] Minor typo.Werner Lemberg2018-01-281-1/+1
|
* [truetype] Better protection against invalid VF data.Werner Lemberg2018-01-271-2/+3
| | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5739 Bug introduced in commit 08cd62deedefe217f2ea50e392923ce8b5bc7ac7. * src/truetype/ttgxvar.c (TT_Set_Var_Design): Always initialize `normalizedcoords'.
* * src/truetype/ttinterp.c (Ins_GETVARIATION): Avoid NULL reference.Werner Lemberg2018-01-271-2/+10
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5736
* * src/truetype/ttgxvar.c (tt_set_mm_blend): Minor.Werner Lemberg2018-01-271-2/+3
|
* [truetype] Better trace VF instances.Werner Lemberg2018-01-271-5/+50
| | | | | | | * src/truetype/ttgxvar.c (ft_var_to_normalized): Don't emit number of coordinates. (TT_Get_MM_Var): Trace instance indices names. (TT_Set_Var_Design): Updated.
* Fix comment.Werner Lemberg2018-01-271-2/+2
|
* [truetype] Beautify tracing of VF axis records.Werner Lemberg2018-01-271-9/+24
| | | | | * src/truetype/ttgxvar.c (TT_Get_MM_Var): Show axis records in a table-like manner.