Log

Author Commit Date CI Message
Werner Lemberg 8a33164d 2022-03-31T20:50:39 CMakeLists.txt: s/PKG_CONFIG/PKGCONFIG/, s/REQUIRED_/REQUIRES_/.
Werner Lemberg e50798b7 2022-03-30T14:06:21 * Version 2.12.0 released. ========================== Tag sources with `VER-2-12-0'. * docs/VERSION.TXT: Add entry for version 2.12.0. * docs/CHANGES, docs/release: Updated. * README, src/base/ftver.rc, builds/windows/vc2010/index.html, builds/windows/visualc/index.html, builds/windows/visualce/index.html, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, docs/freetype-config.1: s/2.11.1/2.12.0/, s/2111/2120/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 24:2:18. * CMakeLists.txt (VERSION_MINOR): Set to 12. (VERSION_PATCH): Set to 0. * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits since version 2.11.0 (when we stopped creating this file manually).
Werner Lemberg 87989a14 2022-03-31T07:43:41 Fix clang++ warnings. * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new), src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW), src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize variables used for allocation. * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of `max_splits` to FT_UInt. (sdf_generate_bounding_box): Add cast.
Werner Lemberg 97cdbb24 2022-03-30T14:06:15 Whitespace.
Werner Lemberg 119e404b 2022-03-18T13:25:51 [builds] Fix creation of `freetype2.pc` for static-only builds. We have to help `pkg-config` since it can't recognize that there is no shared library installed. Note that meson already does exactly the same. * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to... (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them depending on `$enable_shared`. (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables. * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated variables.
Werner Lemberg ac4c1ebf 2022-02-07T06:55:54 [truetype] Fix 'sbix' table handling. * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of 'metrics->horiBearingY'. Set vertical metrics. * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`. Handle metrics of fonts with 'sbix' table. * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply bbox offset and bearing values of the corresponding glyph in the 'glyf' table if it exists and has a contour. * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table. Fixes issue #998.
Werner Lemberg 907715a6 2022-02-09T07:31:56 Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`. Fonts with 'sbix' tables need special handling by the application. * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros. * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix' table is present.
Werner Lemberg 06727a52 2022-02-09T08:36:15 * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public.
Werner Lemberg a8e4563c 2022-03-19T23:54:31 Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`. * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY, FT_HAS_SBIX_OVERLAY): New macro. * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`. Remove obsolete tracing message.
Werner Lemberg 1949a7ec 2022-03-19T18:51:34 Add `FT_PARAM_TAG_IGNORE_SBIX`. This is another bit to handle 'sbix' tables as described in the OpenType specification. * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro. * src/sfnt/sfobjc.c (is_apple_sbix): Rename to... (has_sbix): ... this. Check for more sbit tables. Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`. Only call sbit table loader if an sbit table is present.
Carlo Bramini 127c1e83 2022-03-23T22:53:07 [builds/windows] Fix WCE support. * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by _alloca.
Steve Lhomme 0574692c 2022-03-23T22:46:15 [build/windows] Improve UWP support. * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA.
Werner Lemberg fc15ebe0 2022-03-21T11:15:41 * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table. Fixes #1141.
Ben Wagner a960be9e 2022-03-18T17:41:01 [woff2] Support overlap flag for simple glyphs. In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag to be retained through the woff2 format [0]. [0] https://www.w3.org/TR/WOFF2/#glyf_table_format * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag. * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's flag if the overlap bit is set.
Werner Lemberg d2c3bbcd 2022-03-19T19:31:25 [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`. * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro. (cff_slot_load): Use it.
Werner Lemberg 0c2bdb01 2022-03-19T09:37:28 * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`. Fixes #1140.
Werner Lemberg d014387a 2022-03-19T09:30:45 * src/base/ftobjs.c (ft_open_face_internal): Thinko.
Ben Wagner 7789f2bb 2022-03-18T15:52:47 [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3. * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
Werner Lemberg 22a0cccb 2022-03-19T06:40:17 * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`. We must ensure that the cast to `FT_Int` doesn't change the sign. Fixes #1139.
Werner Lemberg 53dfdcd8 2022-03-17T19:24:16 [sfnt] Avoid invalid face index. Fixes #1138. * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font): Check `face_index` before decrementing.
Werner Lemberg 1e2eb650 2022-03-07T10:13:29 Documentation, whitespace.
Anuj Verma 360e2507 2022-03-04T16:58:50 [sdf] Fix corner checks and improve performance. * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if two distances (for different curves) are very close. (sdf_conic_to): Check whether the conic curve can be treated as a line (which happens if the control point coincides with any end point).
Anuj Verma 2600ef63 2022-03-04T16:53:27 [sdf] Implement deviation-based splitting for Bezier curves. * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure out the deviation of Bezier curves and stop splitting if the curve is flat enough. * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro.
Anuj Verma 5499d7bf 2022-03-04T16:42:02 * include/freetype/freetype.h: Improve SDF documentation.
Ben Wagner 335224be 2022-03-03T16:33:40 [sfnt] Fix bounds check in SVG. The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not protected by parentheses. As a result, the expression `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect bounds check which may lead to reading past the end of the `SVG ` table. * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in parentheses. Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179
Ben Wagner 034e5dbf 2022-02-22T20:37:43 [psaux] Full bounds check for OtherSubr 19. It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with `blend->num_designs` set to 2, and the user supplied `idx` to be large (for example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds check overflows in a well defined manner, allowing for an invalid call to `memcpy`. In addition, it is possible to call OtherSubr 19 with `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes the bounds check (it is logically always fine to copy nothing starting at index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is undefined behavior (even if `count` is zero). * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that `blend->num_designs` can be copied to `decoder->buildchar[idx]`. Also avoid passing NULL to `ft_memcpy`. Bug: https://crbug.com/1299259
suzuki toshiya bcdfa386 2022-02-20T23:55:32 [cmake] Drop the support of CMake 2.x. * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer. The issue #1059 reports the difficulty to support both of CMake 2.x and newer one by single CMakeLists.txt without the inflation of cmake_policy() workarounds. For better maintainability, the support of CMake 2.x is dropped.
Werner Lemberg 6c5522c6 2022-02-19T13:37:07 * src/bdf/README: Updated.
Werner Lemberg ca46bc0c 2022-02-19T13:34:05 * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|.
Werner Lemberg 5b26e92a 2022-02-19T05:26:53 src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize. A kerning table can be handled by binary search if it has equal entries. Fixes #1132.
Steve Lhomme 20ec99be 2022-02-17T13:35:52 [builds/windows] Add support for legacy UWP builds. * builds/windows/ftsystem.c: Add neccessary macro substitutions to enable strict UWP builds. See !141. Co-authored-by: Alexei Podtelezhnikov <apodtele@gmail.com>
Werner Lemberg 01d4deb0 2022-02-16T14:21:00 ftmm.h: Minor documentation improvement.
Alexei Podtelezhnikov 00ae29fc 2022-02-12T23:42:08 [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value. Before the change, the hinting engine frequently confused horizontal stem and serif hints making some stems too thin and some serifs too thick. The value was tuned using serif fonts from the URW+ base 35 collection. * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/.
Werner Lemberg 5a53e51b 2022-02-12T07:58:43 t1tables.h: Documentation improvements.
Werner Lemberg c67ecb8c 2022-02-12T07:52:57 t1tables.h: Whitespace.
Werner Lemberg 338b4e88 2022-02-11T19:32:49 [type42] Fix `FT_Get_PS_Font_Private` for this format. Since Type42 fonts don't have a 'Private' dictionary, the return value should be `FT_Err_Invalid_Argument`. * src/type42/t42drivr.c (t42_ps_get_font_private): Removed. (t42_service_ps_info): Updated.
Alexei Podtelezhnikov 1680885a 2022-02-09T16:41:07 [pshinter] Clear reused mask. In PS hinter, memory allocations persist until the module is done. Therefore, we have to clear reused masks. * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask.
Alexei Podtelezhnikov 0447df71 2022-02-09T15:04:58 [pshinter] Use unsigned indices. This reduces casting and eliminates some checks. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge, ps_dimension_add_t1stem, ps_hints_t1stem3): Updated. (ps_dimension_add_counter): Updated, unnecessary checks removed.
Alexei Podtelezhnikov ed0e2e76 2022-02-08T16:35:14 [pshinter] Fix mask merging. We forgot to update the number of bits when merging a larger mask into a smaller one. This fix might have rendering effects. * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number of bits from a larger mask. There is no need to zero unused bits, already zeroed during allocation. (ps_mask_clear_bit): Removed. (ps_mask_ensure): Minor.
Alexei Podtelezhnikov 7c6b2f20 2022-02-08T14:37:34 [pshinter] Revise the hint table handling. * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size check; avoid array zeroing because it is fully initialized when used. (ps_hint_table_alloc): Fix off-by-one comparison and remove another zeroing of the array elements.
Werner Lemberg 24db55ec 2022-02-05T09:06:39 Various minor doc fixes.
Alexei Podtelezhnikov a173aead 2022-02-06T08:25:52 [builds/windows] Add SVG to to project files. * builds/windows/vc2010/freetype.vcxproj: Updated. * builds/windows/vc2010/freetype.vcxproj.filters: Updated. * builds/windows/visualc/freetype.vcproj: Updated.
Alexei Podtelezhnikov dd8676b2 2022-02-03T14:32:50 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources.
Eric Jing 56d182a7 2022-02-02T18:14:19 [cmake] Fix build on MacOS. * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building of a framework on MacOS. * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier lowercase only. Fixes #1127.
Alexei Podtelezhnikov 8e39e42e 2022-02-02T11:35:14 [psaux] Revise `PS_Table` handling. The old impleemntation was not using `FT_REALLOC`, buing too careful with the offset rebasing. It shoudl be safe to rely on the base movements. * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine into... (ps_table_realloc): ... this function based on `FT_REALLOC`. (ps_table_done): Simplified. (ps_table_add): Updated.
Alexei Podtelezhnikov c6dd509b 2022-02-02T11:32:58 * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing.
Alexei Podtelezhnikov 946e1353 2022-01-31T14:19:07 [cache] Partially revert 9870b6c07e2c. Fix crashes reported by Werner. * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again.
Werner Lemberg 36ee3160 2022-01-31T10:37:56 freetype.h: Minor documentation improvement.
Alexei Podtelezhnikov 983d4358 2022-01-30T22:13:51 [cache] Fix fallouts from edd4fedc5427. Reported by Werner. * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph. * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit.
Alexei Podtelezhnikov bee88864 2022-01-30T21:55:21 Clean-up - do not doubt FT_FREE. * src/base/ftobjs.c (memory_stream_close): Do not reassign zero after `FT_FREE`. * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto. * src/sfnt/sfwoff2.c (stream_close): Ditto. * src/psaux/psobjs.c (ps_parser_load_field): Ditto. * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend, tt_set_mm_blend): Ditto.
Werner Lemberg 7fd03a3e 2022-01-30T20:50:42 * CMakeLists.txt: Include 'FindPkgConfig' module. Older cmake versions don't provide `pkg_check_modules` by default. Fixes #1126.
Alexei Podtelezhnikov da877c86 2022-01-29T22:46:56 * src/psaux/psobjs.c (ps_parser_load_field): Reduce `string` scope.
suzuki toshiya 35740aa6 2022-01-28T12:04:36 [cmake] Check the availability of `bzip2.pc'. (CMakeLists.txt): Check the availability of `bzip2.pc'. * If `bzip2.pc' is available, Requires.private should include bzip2, but Libs.private should not include -lbz2. * If `bzip2.pc' is unavailable, Requires.private cannot include bzip2, but Libs.private should include -lbz2. Fix #897.
Werner Lemberg fa226478 2022-01-28T15:20:12 * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer. Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`.
Alexei Podtelezhnikov b34741c1 2022-01-27T22:55:34 Minor clean-ups. * src/base/ftrfork.c (raccess_make_file_name): Do not set error. * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto. * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error. * src/psaux/psobjs.c (ps_table_done): Ditto. * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto.
Ben Wagner e34a860a 2022-01-27T11:50:12 Document `FT_Outline_Decompose` degenerate segments. `FT_Outline_Decompose` does not filter out and can return degenerate segments in an outline. This can be surprising when attemping to stroke such an outline. Clarify the existing documentation on this matter to cover all forms of degeneracy (without specifying exactly how they will be reported), why they might arise, and better explain in what cases they may be an issue. * include/freetype/ftoutlin.h (FT_Outline_Decompose): update documentation. Fixes #952.
Anuj Verma ab1c98ac 2022-01-27T15:23:47 Fix sdf computation while `USE_SQUARED_DISTANCES`. Function `map_fixed_to_sdf` expects 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.
Tapish Ojha 3d77756e 2022-01-27T08:34:48 [sfnt] Improve sRGB constants. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly more precise values. Fixes #1018.
Werner Lemberg 9476cb7e 2022-01-27T08:32:42 docs/release: Updated.
Alexei Podtelezhnikov 837f0345 2022-01-26T15:49:24 * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY.
Alexei Podtelezhnikov 0ac53590 2022-01-26T14:02:27 * src/sdf/ftsdf.c (sdf_*_new): Use standard macro.
Alexei Podtelezhnikov 09223ef9 2022-01-26T11:23:38 [pcf] Delay encoding allocation and avoid its zeroing. * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY.
Werner Lemberg 267c6918 2022-01-25T14:46:36 Aarg, typo.
Werner Lemberg 9af1127f 2022-01-25T14:45:10 freetype.h: More updates to `FT_LOAD_COLOR` description.
Werner Lemberg 8b7226bb 2022-01-25T14:28:45 * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`. This helps in decoupling library support from `pkg-config` for other platforms.
Werner Lemberg 6a8e95b7 2022-01-25T08:49:41 Update documentation for `FT_LOAD_COLOR`.
Ben Wagner 5e9caaee 2022-01-24T12:19:20 [pshinter] Ensure all point flags are initialized. 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
Werner Lemberg 65774521 2022-01-24T07:57:20 .mailmap: Typo.
Werner Lemberg ef48a332 2022-01-23T19:05:15 * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.
Werner Lemberg cddfe657 2022-01-23T12:28:21 .mailmap: Updated.
Werner Lemberg 21d0fa37 2022-01-23T12:03:44 More documentation on handling OT-SVG.
Werner Lemberg 9c153852 2022-01-23T08:56:17 * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency.
Werner Lemberg 112527dd 2022-01-22T11:45:30 [sfnt] Reject malformed SVG tables. * 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
Alexei Podtelezhnikov 706c79a1 2022-01-21T22:46:35 * src/psaux/psobjs.c (ps_table_new): Revert to zeroing.
Alexei Podtelezhnikov 0d2b4952 2022-01-20T14:47:01 [psaux, type1, type42] Avoid annecessary zeroing. * 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.
Werner Lemberg 02fa26f4 2022-01-03T17:48:36 [builds/unix] Handle 'librsvg' for demo programs. * 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.
Moazin Khatti 0bf49bd2 2021-12-25T20:14:11 Add 'svg' module for OT-SVG rendering. * 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.
Moazin Khatti 97c09a80 2021-12-25T19:55:58 Add `FT_Glyph` support for OT-SVG glyphs. * 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.
Moazin Khatti 5cf01aa2 2021-12-25T19:46:46 [truetype, cff] Add code to load SVG document. * 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.
Moazin Khatti f93a897a 2021-12-25T19:20:44 Add code to load OT-SVG glyph documents. * 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`.
Moazin Khatti 06c1a25e 2021-12-25T17:59:42 Add flag `FT_CONFIG_OPTION_SVG`. 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.
Alexei Podtelezhnikov 0b635b1e 2022-01-20T15:06:25 [pshinter] Avoid unnecessary zeroing. * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init, psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY.
Alexei Podtelezhnikov 99a940f8 2022-01-20T15:06:09 * include/freetype/freetype.h: Clarify `FT_Size` life cycle.
Alexei Podtelezhnikov 054782c4 2022-01-19T22:14:06 [base] Undefined scale means no scale. 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.
Alexei Podtelezhnikov 773e31c7 2022-01-18T14:05:46 * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing. Everything in AF_FaceGlobals is initialized except metrics. Those are zeroed here and initialized on demand later.
Alexei Podtelezhnikov d118bf8e 2022-01-15T23:09:53 [bdf,type1] Avoid unnecessary hash zeroing. * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`. * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`.
Ozkan Sezer 3f6497bd 2022-01-15T22:44:28 Add Watcom C/C++ calling. 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.
Ben Wagner 5e227133 2022-01-15T17:08:18 [pshinter] Avoid accessing uninitialized zone. 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
Alexei Podtelezhnikov edd4fedc 2022-01-14T22:53:57 [cache] Avoid unnecessary zeroing. * 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.
Ozkan Sezer 11ea89b5 2022-01-14T22:07:44 Add Watcom C/C++ support. * 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.
Alexei Podtelezhnikov ba5d661f 2022-01-14T21:54:17 * src/sdf/ftbsdf.c (ED): s/near/prox/. This works around the Watcom C definition of `near` as restricted __near.
Alexei Podtelezhnikov 7f7bf6f0 2022-01-14T20:33:28 * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten. This works around Watcom C library using __watcall.
Alexei Podtelezhnikov 7eb9a9db 2022-01-14T14:40:11 * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing. This large allocation is followed by careful initialization. Whatever is missed should be initialized manually.
Alexei Podtelezhnikov 81b81feb 2022-01-14T18:22:23 * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing.
Alexei Podtelezhnikov 904ad212 2022-01-13T23:38:56 * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment.
Alexei Podtelezhnikov ee52b571 2022-01-13T09:45:48 * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing.
Ben Wagner 6ee89519 2022-01-12T15:12:53 [bzip2] Reset bzip stream on any error. 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`.
Werner Lemberg b647dbde 2022-01-12T06:21:52 .gitlab-ci.yml: Minor comment cleanups.
Azamat H. Hackimov ca44a236 2022-01-12T04:26:39 .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA. 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.
Ben Wagner f1d3b9f1 2022-01-11T17:15:35 Revert "[bzip2] Avoid use of uninitialized memory." 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