summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [sdf] Fix sdf computation while `USE_SQUARED_DISTANCES`.fix-sdf-squared-distancesAnuj Verma2022-01-272-7/+9
| | | | | | | | | | Function `map_fixed_to_sdf` expect spread to be absolute and not squared. * src/sdf/ftbsdf.c (finalize_sdf): Pass absolute spread while `map_fixed_to_sdf`. * src/sdf/ftsdf.c (sdf_generate_bounding_box): Ditto.
* [sfnt] Improve sRGB constants.Tapish Ojha2022-01-271-4/+4
| | | | | | | * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly more precise values. Fixes #1018.
* docs/release: Updated.Werner Lemberg2022-01-271-2/+10
|
* * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY.Alexei Podtelezhnikov2022-01-261-1/+1
|
* * src/sdf/ftsdf.c (sdf_*_new): Use standard macro.Alexei Podtelezhnikov2022-01-261-3/+3
|
* [pcf] Delay encoding allocation and avoid its zeroing.Alexei Podtelezhnikov2022-01-261-15/+10
| | | | * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY.
* Aarg, typo.Werner Lemberg2022-01-251-1/+1
|
* freetype.h: More updates to `FT_LOAD_COLOR` description.Werner Lemberg2022-01-251-4/+5
|
* * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`.Werner Lemberg2022-01-251-1/+1
| | | | | This helps in decoupling library support from `pkg-config` for other platforms.
* Update documentation for `FT_LOAD_COLOR`.Werner Lemberg2022-01-251-10/+18
|
* [pshinter] Ensure all point flags are initialized.Ben Wagner2022-01-241-4/+5
| | | | | | | | Only off curve point flags were fully initialized. * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930
* .mailmap: Typo.Werner Lemberg2022-01-241-1/+1
|
* * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.Werner Lemberg2022-01-232-1/+21
|
* .mailmap: Updated.Werner Lemberg2022-01-231-0/+3
|
* More documentation on handling OT-SVG.Werner Lemberg2022-01-234-33/+118
|
* * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency.Werner Lemberg2022-01-231-2/+2
|
* [sfnt] Reject malformed SVG tables.Werner Lemberg2022-01-221-1/+18
| | | | | | | | | | | * src/sfnt/ttsvg.c (SVG_TABLE_HEADER_SIZE, SVG_DOCUMENT_RECORD_SIZE, SVG_DOCUMENT_LIST_MINIMUM_SIZE, SVG_MINIMUM_SIZE): New macros. (tt_face_load_svg): Check offsets. Check table and record sizes. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43918
* * src/psaux/psobjs.c (ps_table_new): Revert to zeroing.Alexei Podtelezhnikov2022-01-211-2/+2
|
* [psaux, type1, type42] Avoid annecessary zeroing.Alexei Podtelezhnikov2022-01-203-6/+6
| | | | | | * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY. * src/type1/t1load.c (parse_encoding): Ditto. * src/type42/t42parse.c (t42_parse_encoding): Ditto.
* [builds/unix] Handle 'librsvg' for demo programs.Werner Lemberg2022-01-202-9/+28
| | | | | | | | | * builds/unix/configure.raw: Check for 'librsvg'. (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on... (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables. * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by... (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
* Add 'svg' module for OT-SVG rendering.Moazin Khatti2022-01-2017-5/+819
| | | | | | | | | | | | | | | | | | | | | | | | | | * CMakeLists.txt (BASE_SRCS): Add svg module file. * meson.build (ft2_public_headers): Add `otsvg.h`. * modules.cfg (RASTER_MODULES): Add `svg` module. * builds/meson/parse_modules_cfg.py: Add svg module. * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`. * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and `Missing_SVG_Hooks` error codes. * include/freetype/internal/fttrace.h: Add tracing for `otsvg`. * include/freetype/internal/svginterface.h: New file. It adds an interface to enable the presetting hook from the `base` module. * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func, SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering. (SVG_RendererHooks): New structure to access them. * src/base/ftobjs.c: Include `svginterface.h`. (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG glyphs. (ft_add_renderer): Updated. * src/svg/*: New files.
* Add `FT_Glyph` support for OT-SVG glyphs.Moazin Khatti2022-01-203-2/+340
| | | | | | | | | | | * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure. * src/base/ftglyph.c: Include `otsvg.h`. (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy, ft_svg_glyph_transform, ft_svg_glyph_prepare): New function. (ft_svg_glyph_class): New class. (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs. * src/base/ftglyph.h: Updated.
* [truetype, cff] Add code to load SVG document.Moazin Khatti2022-01-202-1/+133
| | | | | * src/cff/cffgload.c (cff_slot_load): Add code to load SVG doc. * src/truetype/ttgload.c (TT_Load_Glyph): Add code to load SVG doc.
* Add code to load OT-SVG glyph documents.Moazin Khatti2022-01-2018-24/+741
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro. * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros. (FT_LOAD_SVG_ONLY): New internal macro. * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value `FT_GLYPH_FORMAT_SVG`. * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro. * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`. * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New functions. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for the SVG table. * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the SVG document and other necessary information of an OT-SVG glyph in a glyph slot. * include/freetype/tttags.h (TTAG_SVG): New macro. * src/base/ftobjs.c: Include `otsvg.h`. (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other` if the SVG table exists. (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed glyph. (ft_glyphslot_done): Free the document data if it is a GZIP compressed glyph. (FT_Load_Glyph): Don't auto-hint SVG documents. * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for FT_GLYPH_FORMAT_SVG. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`. * src/sfnt/sfdriver.c: Include `ttsvg.h`. (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/sfnt.c: Include `ttsvg.c`. * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and free data of the the SVG table. * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/ttsvg.h: Declarations of the SVG functions in `ttsvg.c`.
* Add flag `FT_CONFIG_OPTION_SVG`.Moazin Khatti2022-01-202-2/+30
| | | | | | | | | This flag is going to be used to conditionally compile support for OT-SVG glyphs. FreeType will do the parsing and rely on external hooks for rendering of OT-SVG glyphs. * devel/ftoption.h, include/freetype/config/ftoption.h (FT_CONFIG_OPTION_SVG): New flag.
* [pshinter] Avoid unnecessary zeroing. Alexei Podtelezhnikov2022-01-201-6/+6
| | | | * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init, psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY.
* * include/freetype/freetype.h: Clarify `FT_Size` life cycle.Alexei Podtelezhnikov2022-01-201-6/+7
|
* [base] Undefined scale means no scale.Alexei Podtelezhnikov2022-01-192-11/+18
| | | | | | | | | | | | | | It might be surprising that FreeType does not have default ppem and the size has to be set explicitly or face undefined behavior with undefined variables and errors. This offers an alternative to missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined behavior is bettr than undefined one. This is alternative to !132 and discussed in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale. * include/freetype/freetype.h: Document it.
* * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.Alexei Podtelezhnikov2022-01-181-3/+5
| | | | | Everything in AF_FaceGlobals is initialized except metrics. Those are zeroed here and initialized on demand later.
* [bdf,type1] Avoid unnecessary hash zeroing.Alexei Podtelezhnikov2022-01-152-2/+2
| | | | | * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`. * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`.
* Add Watcom C/C++ calling.Ozkan Sezer2022-01-151-0/+2
| | | | | | | | | In the unlikely case the source is built with OpenWatcom's -ec? switches to enforce a calling convention, the qsort() compare function must still be set to __watcall. * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): Updated.
* [pshinter] Avoid accessing uninitialized zone.Ben Wagner2022-01-151-4/+7
| | | | | | | | | | | | The `normal_top.count` may be 0, implying no `normal_top.zones` exist. The code must not access these (non-existent) `normal_top.zones`. * src/pshinter/pshalgo.c (ps_hints_apply): Do not assume that `normal_top.zones[0]` is initialized. Test `normal_top.count` before using `normal_top.zones[0]`. Do not rescale if there are no `zones`. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43675
* [cache] Avoid unnecessary zeroing.Alexei Podtelezhnikov2022-01-143-5/+5
| | | | | | * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`. * src/cache/ftcimage.c (FTC_INode_New): Ditto. * src/cache/ftcsbits.c (FTC_SNode_New): Ditto.
* Add Watcom C/C++ support.Ozkan Sezer2022-01-142-2/+16
| | | | | | * include/freetype/config/integer-types.h: Make sure `long long` is used then available. * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
* * src/sdf/ftbsdf.c (ED): s/near/prox/.Alexei Podtelezhnikov2022-01-141-9/+9
| | | | | This works around the Watcom C definition of `near` as restricted __near.
* * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten.Alexei Podtelezhnikov2022-01-141-2/+2
| | | | This works around Watcom C library using __watcall.
* * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing.Alexei Podtelezhnikov2022-01-141-2/+2
| | | | | This large allocation is followed by careful initialization. Whatever is missed should be initialized manually.
* * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing.Alexei Podtelezhnikov2022-01-141-1/+1
|
* * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment.Alexei Podtelezhnikov2022-01-131-2/+0
|
* * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing.Alexei Podtelezhnikov2022-01-131-2/+2
|
* [bzip2] Reset bzip stream on any error.Ben Wagner2022-01-131-16/+24
| | | | | | | | | | | | | | | | | | According to the bzip documentation it is undefined what will happen if `BZ2_bzDecompress` is called on a `bz_stream` it has previously returned an error against. If `BZ2_bzDecompress` returns anything other than `BZ_OK` the only valid next action is `BZ2_bzDecompressEnd`. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564 * src/bzip2/ftbzip2.c (FT_BZip2FileRec_): Add `reset` to track the need to reset the stream. (ft_bzip2_file_init): Initialize `reset` to 0. (ft_bzip2_file_reset): Set `reset` to 0 after resetting. (ft_bzip2_file_fill_output): Set `reset` to 1 when `BZ2_bzDecompress` returns anything other than `BZ_OK`.
* .gitlab-ci.yml: Minor comment cleanups.Werner Lemberg2022-01-121-8/+18
|
* .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA.Azamat H. Hackimov2022-01-121-0/+3
| | | | | | Fetch current list of valid CAs from Windows Update and manually import them to trusted datastore. This action is required to make downloads work from sites that need recent Let's Encrypt ISRG Root X1 certificate.
* Revert "[bzip2] Avoid use of uninitialized memory."Ben Wagner2022-01-111-3/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit d276bcb7f0c02c20d3585b2e5626702df6d140a6. The original commit did avoid the use of uninitialized memory. However, it appears that the original commit is no longer required. The underlying issue was resolved by a change in freetype2-testing "Build bzip2 correctly." [0]. Prior to [0] bzip2 was built without msan, so bzip2 writes were not tracked or considered initialized. Clearing `buffer` in the original commit allowed msan to see the `buffer` content initialized once in FreeType code, but msan saw no writes into buffer from bzip2. With bzip2 now built with msan, the bzip2 writes are properly instrumented and msan sees the bzip2 writes into the buffer. As a result the original commit can be safely reverted to allow for better detection of other uninitialized data scenarios. * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Revert to using `FT_QNEW`. [0] https://github.com/freetype/freetype2-testing/commit/3c052a837a3c960709227a0d6ddd256e87b88853
* [type42] Track how much type42 ttf data is available.Ben Wagner2022-01-112-35/+45
| | | | | | | | | | | | | | | | | | | | | | | Currently `T42_Open_Face` eagerly allocates 12 bytes for the ttf header data which it expects `t42_parse_sfnts` to fill out from /sfnts data. However, there is no guarantee that `t42_parse_sfnts` will actually be called while parsing the type42 data as the /sfnts array may be missing or very short. This is also confusing behavior as it means `T42_Open_Face` is tightly coupled to the implementation of the very distant `t42_parse_sfnts` code which requires at least 12 bytes to already be reserved in `face->ttf_data`. `t42_parse_sfnts` itself eagerly updates `face->ttf_size` to track how much space is reserved for ttf data instead of traking how much data has actually been written into `face->ttf_data`. It will also act strangely in the presense of multiple /sfnts arrays. * src/type42/t42objs.c (T42_Open_Face): ensure `ttf_data` is initialized to NULL. Free `ttf_data` on error. * src/type42/t42parse.c (t42_parse_sfnts): delay setting `ttf_size` and set it to the actual number of bytes read. Ensure `ttf_data` is freed if there are multiple /sfnts arrays or there are any errors.
* [sfnt] Fix limit checks for `COLR` v1 ClipBoxesDominik Röttsches2022-01-111-4/+8
| | | | | * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Fix off-by-one in limit checks.
* Update all copyright notices.Werner Lemberg2022-01-11571-571/+571
|
* * src/sfnt/ttcolr.c (read_paint): Fix undefined left-shift operation.Werner Lemberg2022-01-111-2/+12
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43151
* * src/type42/t42objs.c (T42_Open_Face): Avoid use of uninitialized memory.Werner Lemberg2022-01-111-1/+2
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43508
* .gitlab-ci.yml: Fix typo in previous commit.Werner Lemberg2022-01-111-2/+1
|