1. 04 Mar, 2022 3 commits
    • Anuj Verma's avatar
      [sdf] Fixed corner checks and improved performance. · ab950e18
      Anuj Verma authored
      * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for
        corner if two distance (for different curves) are very close.
      
      * src/sdf/ftsdf.c (sdf_conic_to): Added check to figure out if
        the conic can be treated as a line (which happens if the control
        point coincide with any end-point).
      ab950e18
    • Anuj Verma's avatar
      [sdf] Impliment deviation based splitting for bezier curves. · b3d917d2
      Anuj Verma authored
      * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Added checks
        to figure out the deviation of bezier curves and stop splitting
        if the curve is flat enough.
      
      * src/sdf/ftsdfcommon.h (ONE_PIXEL): Added macro for unit pixel size
        in 26.6 fixed point representation.
      b3d917d2
    • Anuj Verma's avatar
      * include/freetype/freetype.h (FT_RENDER_MODE_SDF): Improve documentation. · 5f9bc4b8
      Anuj Verma authored
      * include/freetype/freetype.h (FT_RENDER_MODE_SDF): Added more
        documentation for the render mode regarding the stability and point
        where artifacts are expected to occur.  Also added more information
        for both `sdf`, `bsdf` and when they are used.
      5f9bc4b8
  2. 03 Mar, 2022 1 commit
    • Ben Wagner's avatar
      [sfnt] Fix bounds check in SVG. · 335224be
      Ben Wagner authored
      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
      335224be
  3. 23 Feb, 2022 1 commit
    • Ben Wagner's avatar
      [psaux] Full bounds check for OtherSubr 19. · 034e5dbf
      Ben Wagner authored and Werner Lemberg's avatar Werner Lemberg committed
      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
      034e5dbf
  4. 21 Feb, 2022 1 commit
    • suzuki toshiya's avatar
      [cmake] Drop the support of CMake 2.x. · bcdfa386
      suzuki toshiya authored
      * 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.
      bcdfa386
  5. 19 Feb, 2022 3 commits
  6. 17 Feb, 2022 1 commit
  7. 16 Feb, 2022 1 commit
  8. 13 Feb, 2022 1 commit
    • Alexei Podtelezhnikov's avatar
      [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value. · 00ae29fc
      Alexei Podtelezhnikov authored
      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/.
      00ae29fc
  9. 12 Feb, 2022 2 commits
  10. 11 Feb, 2022 1 commit
  11. 09 Feb, 2022 2 commits
    • Alexei Podtelezhnikov's avatar
      [pshinter] Clear reused mask. · 1680885a
      Alexei Podtelezhnikov authored
      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.
      1680885a
    • Alexei Podtelezhnikov's avatar
      [pshinter] Use unsigned indices. · 0447df71
      Alexei Podtelezhnikov authored
      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.
      0447df71
  12. 08 Feb, 2022 2 commits
    • Alexei Podtelezhnikov's avatar
      [pshinter] Fix mask merging. · ed0e2e76
      Alexei Podtelezhnikov authored
      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.
      ed0e2e76
    • Alexei Podtelezhnikov's avatar
      [pshinter] Revise the hint table handling. · 7c6b2f20
      Alexei Podtelezhnikov authored
      * 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.
      7c6b2f20
  13. 06 Feb, 2022 2 commits
  14. 03 Feb, 2022 1 commit
  15. 02 Feb, 2022 3 commits
  16. 31 Jan, 2022 4 commits
  17. 30 Jan, 2022 2 commits
  18. 29 Jan, 2022 1 commit
    • suzuki toshiya's avatar
      [cmake] Check the availability of `bzip2.pc'. · 35740aa6
      suzuki toshiya authored
      (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.
      35740aa6
  19. 28 Jan, 2022 2 commits
    • Werner Lemberg's avatar
      * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer. · fa226478
      Werner Lemberg authored
      Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`.
      fa226478
    • Alexei Podtelezhnikov's avatar
      Minor clean-ups. · b34741c1
      Alexei Podtelezhnikov authored
      * 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.
      b34741c1
  20. 27 Jan, 2022 4 commits
    • Ben Wagner's avatar
      Document `FT_Outline_Decompose` degenerate segments. · e34a860a
      Ben Wagner authored and Werner Lemberg's avatar Werner Lemberg committed
      `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.
      e34a860a
    • Anuj Verma's avatar
      Fix sdf computation while `USE_SQUARED_DISTANCES`. · ab1c98ac
      Anuj Verma authored
      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.
      ab1c98ac
    • Tapish Ojha's avatar
      [sfnt] Improve sRGB constants. · 3d77756e
      Tapish Ojha authored and Werner Lemberg's avatar Werner Lemberg committed
      * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly
      more precise values.
      
      Fixes #1018.
      3d77756e
    • Werner Lemberg's avatar
      docs/release: Updated. · 9476cb7e
      Werner Lemberg authored
      9476cb7e
  21. 26 Jan, 2022 2 commits