summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Warning: Rebased force pushedewaldhew-refactor-cf2Ewald Hew2017-06-057-17/+26
| | | | Move cff_random to psaux
* Link CFF struct defsEwald Hew2017-06-0522-194/+218
| | | | | | | Move definition of CFF_Builder_Funcs Move psaux pointer from CFF_Font to TT_Face Move cfftypes.h to internal fix typos
* Move definition of CFF_Builder_FuncsEwald Hew2017-06-051-50/+51
|
* Add cffload serviceEwald Hew2017-06-0513-55/+213
|
* [ftserv] Add new macro FT_DEFINE_SERVICEDESCREC10Ewald Hew2017-06-051-0/+88
|
* Added func ptrs for cff get/free glyph_data (callback)Ewald Hew2017-06-058-30/+58
|
* Moved decoder and builderEwald Hew2017-06-0517-2779/+2993
| | | | manual merge cffgload.c change into cffdecode.c
* Moved CF2Ewald Hew2017-06-0524-24/+3
|
* [cff, truetype] Integer overflows.Werner Lemberg2017-06-043-23/+41
| | | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2075 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2088 * src/cff/cf2font.c (cf2_font_setup): Use OVERFLOW_MUL_INT32. * src/truetype/ttinterp.c (Ins_ISECT): Use OVERFLOW_MUL_LONG, OVERFLOW_ADD_LONG, and OVERFLOW_SUB_LONG.
* [base, cff, truetype] Integer overflows.Werner Lemberg2017-06-036-36/+93
| | | | | | | | | | | | | | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2060 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2062 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2063 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2068 * src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Use OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG. * src/cff/cf2blues.c (cf2_blues_capture), src/cff/cf2hints.c (cf2_hintmap_adjustHints): Use OVERFLOW_SUB_INT32. * src/truetype/ttgload.c (compute_glyph_metrics): User OVERFLOW_SUB_LONG. * src/truetype/ttinterp.c (Direct_Move, Direct_Move_Orig, Direct_Move_X, Direct_Move_Y, Direct_Move_Orig_X, Direct_Move_Orig_Y, Move_Zp2_Point, Ins_MSIRP): Use OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG.
* * builds/unix/freetype-config.in: Fix pkg-config test (#51162).Werner Lemberg2017-06-032-1/+7
| | | | Patch directly taken from bug report.
* [bdf] Synchronize sanity checks with pcf driver.Werner Lemberg2017-06-032-10/+111
| | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2054 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2058 * src/bdf/bdfdrivr.c (BDF_Face_Init): Check font ascent and descent. Check AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and RESOLUTION_Y properties.
* [cff, truetype] Integer overflows.Werner Lemberg2017-06-034-6/+22
| | | | | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2047 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2057 * src/cff/cf2hints.c (cf2_hintmap_map): Use OVERFLOW_SUB_INT32. * src/truetype/ttinterp.c (Ins_ADD): Use OVERFLOW_ADD_LONG. (Ins_SUB): Use OVERFLOW_SUB_LONG. (Ins_NEG): Use NEG_LONG.
* ftcalc.h: Avoid left-shift of negative numbers.Werner Lemberg2017-06-032-4/+15
| | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2055 * include/freetype/internal/ftcalc.h (INT_TO_F26DOT6, INT_TO_F2DOT14, INT_TO_FIXED, F2DOT14_TO_FIXED): Use multiplication.
* [cff] Even more integer overflows.Werner Lemberg2017-06-022-6/+19
| | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2046 * src/cff/cf2intrp.c (cf2_doStems, cf2_interpT2CharString): Use OVERFLOW_ADD_INT32.
* [cff] More integer overflows.Werner Lemberg2017-06-022-3/+16
| | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2032 * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
* [bdf] Don't left-shift negative numbers.Werner Lemberg2017-06-022-2/+12
| | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2031 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use multiplication.
* [bdf] Fix integer scanning routines.Werner Lemberg2017-06-022-4/+47
| | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2029 * src/bdf/bdflib.c (_bdf_atoul, _bdf_atol, _bdf_atous, _bdf_atos): Stop scanning if result would overflow.
* [cff] Fix integer overflows.Werner Lemberg2017-06-023-10/+27
| | | | | | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2027 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2028 * src/cff/cf2hints.c (cf2_hintmap_insertHint), src/cff/cf2intrp.c (cf2_doFlex): Use OVERFLOW_ADD_INT32 and OVERFLOW_SUB_INT32.
* [smooth] Some 32bit integer overflow run-time errors.Werner Lemberg2017-06-012-2/+24
| | | | | | | * src/smooth/ftgrays.c [STANDALONE] (OVERFLOW_ADD_LONG, OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG, NEG_LONG): New macros. [!STANDALONE]: Include FT_INTERNAL_CALC_H. (gray_render_cubic): Use those macros where appropriate.
* Minor comment.Werner Lemberg2017-06-011-0/+6
|
* * src/base/ftglyph.c (FT_Get_Glyph): Check `slot->advance'.Werner Lemberg2017-06-012-0/+17
|
* [psaux] 32bit integer overflow tun-time errors (#46149).Werner Lemberg2017-06-012-39/+60
| | | | | * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Use OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG where appropriate.
* * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter again.Werner Lemberg2017-06-012-2/+11
| | | | | | | | Problem reported by Marek Kašík <mkasik@redhat.com>. The problematic font that exceeds the old limit is Padauk-Bold, version 3.002, containing bytecode generated by a buggy version of ttfautohint.
* [cff] 32bit integer overflow run-time errors 2/2 (#46149).Werner Lemberg2017-05-315-133/+276
| | | | | | | | | | | | | | | | | | | | | This commit handles the new engine. * include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT32, OVERFLOW_SUB_INT32, OVERFLOW_MUL_INT32, NEG_INT, NEG_LONG, NEG_INT32): New macros. * src/cff/cf2ft.c (cf2_getScaleAndHintFlag): Use OVERFLOW_ADD_INT32. * src/cff/cf2hints.c (cf2_getWindingMomentum, cf2_hint_init, cf2_hintmap_map, cf2_glyphpath_hintPoint, cf2_glyphpath_computeIntersection, cf2_glyphpath_computeOffset, cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): Use OVERFLOW_ADD_INT32, OVERFLOW_SUB_INT32, OVERFLOW_MUL_INT32, and NEG_INT32 where appropriate. * src/cff/cf2intrp.c (cf2_doFlex, cf2_doBlend, cf2_interpT2CharString): Ditto. Also add some other code where needed to avoid overflow.
* [cff] 32bit integer overflow run-time errors 1/2 (#46149).Werner Lemberg2017-05-303-89/+161
| | | | | | | | | | | | | This commit handles the old engine. * src/cff/cffgload.c: Include FT_INTERNAL_CALC_H. (cff_decoder_parse_charstrings): Use OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG where needed. * src/cff/cffparse.c: Include FT_INTERNAL_CALC_H. (power_ten_limits): New static array. (do_fixed): Use it to prevent multiplication overflow. (cff_parser_run): Use OVERFLOW_ADD_LONG.
* [psaux] Correctly handle sequences of multiple number signs.Werner Lemberg2017-05-302-0/+15
| | | | | * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero if we encounter more than a single sign.
* [pcf] 32bit integer overflow run-time errors (#46149).Werner Lemberg2017-05-292-9/+79
| | | | | | | | * src/pcf/pcfread.c (pcf_get_accel): Add sanity checks for `fontAscent' and `fontDescent'. (pcf_load_font): Add sanity checks for global height. Add sanity checks for AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and RESOLUTION_Y properties.
* Handle some integer overflow run-time errors (#46149, #48979).Werner Lemberg2017-05-296-26/+99
| | | | | | | | | | | | | | | | | | | | | | | This commit (mainly for 32bit CPUs) is the first of a series of similar commits to handle known integer overflows. Basically, all of them are harmless, since they affect rendering of glyphs only, not posing security threats. It is expected that fuzzying will show up more overflows, to be fixed in due course. The idea is to mark places where overflows can occur, using macros that simply cast to unsigned integers, because overflow arithmetic is well defined in this case. Doing so suppresses run-time errors of sanitizers without adding computational overhead. * include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT, OVERFLOW_SUB_INT, OVERFLOW_MUL_INT, OVERFLOW_ADD_LONG, OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG): New macros. * src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_Matrix_Multiply, FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled, ft_corner_orientation): Use new macros. * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use new macros.
* * include/freetype/internal/ftcalc.h (FLOAT_TO_FIXED): Remove.Werner Lemberg2017-05-282-1/+6
| | | | This macro is not used.
* [cff] s/cf2_floatToFixed/cf2_doubleToFixed/.Werner Lemberg2017-05-286-14/+26
| | | | | | | | | | The new name better describes what the macro actually does; additionally, we don't need a trailing `f' for literals (there was only a single such instance in the code, but this caused a clang warning because the macro itself uses `double' literals). * src/cff/cf2blues.c, src/cff/cf2blues.h, src/cff/cf2fixed.h, src/cff/cf2font.c, src/cff/cf2hints.c: Updated.
* Fix negation of INT_MIN and LONG_MIN (#46149).Werner Lemberg2017-05-282-36/+46
| | | | | | | * src/base/ftcalc.c (FT_MOVE_SIGN): Add argument to pass unsigned value, to be used as the result. (FT_MulDiv, FT_MulDiv_No_Round, FT_DivFix, FT_MulFix, FT_Vector_NormLen): Updated.
* [truetype] Fix handling of design coordinates (#51127).Werner Lemberg2017-05-272-3/+34
| | | | | | | * src/truetype/ttgxvar.c (tt_set_mm_blend): Compute all design coordinates if we have to create the `blends->coord' array. (TT_Get_MM_Blend, TT_Get_Var_Design): Select default instance coordinates if no instance is selected yet.
* [bdf, pcf] Support ISO646.1991-IRV character encoding (aka ASCII).Werner Lemberg2017-05-243-2/+21
| | | | | | | | | Problem reported by Marek Kašík <mkasik@redhat.com>, cf. https://bugzilla.redhat.com/show_bug.cgi?id=1451795 * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdrivr.c (PCF_Face_Init): Implement it.
* [truetype] Always use interpreter v35 for B/W rendering (#51051).Nikolaus Waxweiler2017-05-204-29/+73
| | | | | | | | | | * src/truetype/ttgload.c (tt_loader_init) [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Adjust `subpixel_hinting_lean', `grayscale_cleartype', and `vertical_lcd_lean' accordingly. * src/truetype/ttinterp.c (Ins_GETINFO): Updated. (TT_RunIns): Update `backward_compatibility' flag.
* [smooth] Implement minimal dynamic padding for LCD filtering.Alexei Podtelezhnikov2017-05-204-33/+44
| | | | | | | | | | | | | | | | | | | Extra bitmap padding for LCD filtering depends on the filter. The default 5-tap filter needs 2 extra subpixels. The light 3-tap filter needs only 1 extra subpixel. This space could be already available due to rounding. In order to optimize the padding, we now expand CBox for the given filter weights before rounding. This change breakes current Skia (and Firefox). * include/freetype/internal/ftobjs.h (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Remove `lcd_extra' field. * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights, FT_Library_SetLcdFilter): Remove `lcd_extra' initializations. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Implement dymanic LCD padding.
* [autofit] More code sorting.Werner Lemberg2017-05-174-35/+35
|
* Code sorting.Werner Lemberg2017-05-171-12/+12
|
* [sfnt] Return proper scaling values for SBIX bitmaps.Werner Lemberg2017-05-152-0/+17
| | | | | | Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it.
* [truetype] Fix error handling for embedded bitmaps.Werner Lemberg2017-05-152-1/+17
| | | | | | | | Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/truetype/ttgload.c (TT_Load_Glyph) [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Handle error if font is not scalable.
* [autofit] Make autohint warping NORMAL option.Alexei Podtelezhnikov2017-05-155-31/+30
| | | | | | | | | | | | | | | This moves warping option from LIGHT to NORMAL mode. This makes LIGHT truly void of hinting in x-direction, with left side bearing never changed and right side bearing only altered by advance rounding. Therefore, LIGHT is now ready to return fractional advance. As a NORMAL option, warping substitutes normal hinting. * src/autofit/afcjk.c (af_cjk_hints_apply): Updated. * src/autofit/aflatin.c (af_latin_hints_apply): Updated. * src/autofit/aflatin2.c (af_latin2_hints_apply): Updated. * src/autofit/afloader.c (af_loader_load_glyph): Handle warping phantom points as normal.
* Remove remnants of raster pool.Werner Lemberg2017-05-146-35/+22
| | | | | | | | * include/freetype/internal/ftobjs.h (FT_LibraryRec): Remove `raster_pool' and `raster_pool_size' fields. * src/base/ftobjs.c (FT_New_Library), src/raster/ftrend1.c (ft_raster1_init), src/smooth/ftsmooth.c (ft_smooth_init): Updated.
* * Version 2.8 released.VER-2-8Werner Lemberg2017-05-1328-223/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ======================= Tag sources with `VER-2-8'. * docs/VERSION.TXT: Add entry for version 2.8. * docs/CHANGES: Updated. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, 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.7.1/2.8/, s/271/28/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 8. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 20:0:14. * CMakeLists.txt (VERSION_MINOR): Set to 8. (VERSION_PATCH): Set to 0.
* formats.txt: Properly document PFB.Werner Lemberg2017-05-131-3/+13
|
* Fix `FT_UINT_TO_POINTER' macro for Windows.Hin-Tak Leung2017-05-124-3/+11
| | | | | | * builds/unix/ftconfig.in, builds/vms/ftconfig.h, include/freetype/config/ftconfig.h (FT_UINT_TO_POINTER) [_WIN64]: Fix definition.
* Update CHANGES file.Werner Lemberg2017-05-111-0/+8
|
* s/AF_BLUE_STRINGSET_CANADIAN_SYLLABICS/AF_BLUE_STRINGSET_CANS/.Werner Lemberg2017-05-113-3/+3
|
* [autofit] Add support for Chakma script.Sascha Brawer2017-05-117-193/+259
| | | | | | | | | * src/autofit/afblue.dat: Add blue zone data for Chakma. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Chakma standard character. * src/autofit/afranges.c, src/autofit/afstyles.h: Add Chakma data.
* [autofit] Add support for Kayah Li script.Sascha Brawer2017-05-107-109/+190
| | | | | | | | | * src/autofit/afblue.dat: Add blue zone data for Kayah Li. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Kayah Li standard character. * src/autofit/afranges.c, src/autofit/afstyles.h: Add Kayah Li data.
* [autofit] Add support for Bamum script.Sascha Brawer2017-05-107-204/+267
| | | | | | | | | * src/autofit/afblue.dat: Add blue zone data for Bamum. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. * src/autofit/afscript.h: Add Bamum standard character. * src/autofit/afranges.c, src/autofit/afstyles.h: Add Bamum data.