1. 01 Jul, 2021 3 commits
    • Ben Wagner's avatar
      * src/truetype/ttgxvar.c (tt_set_mm_blend): Test `coords`. · d3dc2da9
      Ben Wagner authored and Werner Lemberg's avatar Werner Lemberg committed
      It is undefined behavior to pass `NULL` to `memcpy`.  `coords' is
      passed to `memcpy` but `TT_Get_MM_Blend` and `TT_Get_Var_Design`
      explictly call `tt_set_mm_blend` with `coords` as `NULL`.  In
      addition, `TT_Set_MM_Blend` has a similar possible issue.
    • Dominik Röttsches's avatar
      [sfnt] Support PaintScale in 'COLR' v1 parsing. · 286da6c5
      Dominik Röttsches authored and Werner Lemberg's avatar Werner Lemberg committed
      * include/freetype/ftcolor.h (FT_PaintFormat): Renumber values, add
      (FT_PaintScale): New structure to represent 'PaintScale*' tables.
      (FT_COLR_Paint): Updated.
      * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration.
      (read_paint): Parse 'PaintScale' and friends.
    • Dominik Röttsches's avatar
      [sfnt] Handle fonts without layer list in 'COLR' v1. · 0348c627
      Dominik Röttsches authored and Werner Lemberg's avatar Werner Lemberg committed
      'COLR' v1 fonts do not necessarily need to have a layer list; for
      this reason, 'fontTools' recently started generating fonts in a way
      that drops the layer list if there are no layers in it.  This
      results in the layer list offset becoming zero, which FreeType
      treated as an invalid table.  Fix that and handle the case for layer
      list offset being 0.  This slightly changes how we need to calculate
      the starting offset for paints.
      * src/sfnt/ttcolr.c (tt_face_load_colr): Handle case of layer list
      offset being zero without outright rejecting table.
  2. 30 Jun, 2021 4 commits
  3. 29 Jun, 2021 3 commits
  4. 28 Jun, 2021 2 commits
    • Dominik Röttsches's avatar
      [sfnt] Improve paint limit checks · 7d4e55c3
      Dominik Röttsches authored and Werner Lemberg's avatar Werner Lemberg committed
      Paint tables can appear before the `base_glyphs_v1` offset if the
      font is produced with the layer list before the base glyph list.  In
      this case paint tables can occur after the layer list but before the
      base glyph list.  Checks in the 'COLR' v1 code were rejecting fonts
      with this layout.  Improve these checks by calculating a minimum
      offset after which paint tables can occur and use that in safety
      * src/sfnt/ttcolr.c (Colr, tt_face_load_colr): Declare
      `paint_start_v1` and calculate that as the minimum of the end of
      layer list and base glyph list.
      (get_child_table_pointer, read_paint, tt_face_get_paint_layers):
      Use that in safety checks.
    • Alexei Podtelezhnikov's avatar
      [raster] Clean up vertical sweep. · 3a278381
      Alexei Podtelezhnikov authored
      * src/raster/ftraster.c (black_TWorker): Replace the current line
      offset with the pointer and drop the increment.
      (Function_Sweep_Init): Take values as arguments instead of pointers.
      (Vertical_Sweep_*, Horizontal_Sweep_Init, Draw_Sweep): Updated.
  5. 26 Jun, 2021 2 commits
  6. 25 Jun, 2021 2 commits
    • Alexei Podtelezhnikov's avatar
    • Werner Lemberg's avatar
      [base] Add trace level to logging output. · ff407765
      Werner Lemberg authored
      Some practical debugging work has shown that displaying level X of
      an `FT_TRACEX` macro in the output of `FT2_DEBUG="...  -v"` would be
      very helpful to find out which trace level should be selected.  As
      an example, we now get output like
      [ttobjs:2]    TTF driver
      [ttobjs:2]      SFNT driver
      [sfobjs:2]      not a font using the SFNT container format
      [t1objs:2]    Type 1 driver
      [stream:7]    FT_Stream_EnterFrame: 14 bytes
      * include/freetype/internal/ftdebug.h (FT_LOGGING_TAGX): New macro.
      (FT_LOG): Use it to add the trace level to the logging tag.
      * include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH):
      * docs/DEBUG: Updated.
  7. 24 Jun, 2021 2 commits
    • Alexei Podtelezhnikov's avatar
      [smooth, raster] Fix up and align error codes. · 1e0cef9e
      Alexei Podtelezhnikov authored
      FT_Render_Glyph picked up FAILURE or 1 returned from the raster
      function, which became a confusing error code. Instead, return
      Raster_Overflow in the unlikely event that banding does not help or
      another meaningful error.
      * src/smooth/ftgrays.c (gray_convert_glyph_inner, gray_convert_glyph):
      Use Raster_Overflow when the rendering pool is exhausted and return it
      if banding does not help.
      (gray_raster_render): Use Smooth_Err_Ok.
      * src/raster/ftraster.c (Render_Single_Pass): Return Raster_Overflow
      if banding does not help or another error code.
    • Alexei Podtelezhnikov's avatar
      [smooth, raster] Remove synonymous error macros. · d8ac180c
      Alexei Podtelezhnikov authored
      * src/smooth/ftgays.c [STANDALONE_]: s/ErrRaster_/Smooth_Err_/.
      (gray_convert_glyph_inner): Updated accordingly.
      * src/raster/ftraster.c [STANDALONE_]: Do not abbreviate error macros.
      (New_Profile, End_Profile, Insert_Y_Turn, Line_Up, Bezier_Up,
      Decompose_Curve, Draw_Sweep, Render_Single_Pass, ft_black_render):
      Updated accordingly.
  8. 23 Jun, 2021 1 commit
  9. 22 Jun, 2021 2 commits
  10. 20 Jun, 2021 1 commit
  11. 19 Jun, 2021 3 commits
  12. 18 Jun, 2021 2 commits
  13. 16 Jun, 2021 3 commits
    • David Turner's avatar
      Fix for issue 1063 · f8c5c546
      David Turner authored
      See freetype/freetype#1063
      for more details on the bug.
    • David Turner's avatar
      [meson] Add first regression test to FreeType · 6f273f68
      David Turner authored
      * tests/README.md: documentation explaining how to
        build and run the tests with the Meson build.
      * tests/scripts/download-test-fonts.sh: Simple script
        to download test font files to the 'tests/data/'
      * meson.build, meson_options.txt, tests/meson.build:
        Add 'tests' option to enable building and running the
        test programs, disabled by default.
      * tests/issue-1063/main.c: Simple regression test to
        exhibit issue 1063.
      * .gitignore: Ignore the content of the tests/data/
        folder for now.
    • Alexei Podtelezhnikov's avatar
      Add a comment. · c6fcd612
      Alexei Podtelezhnikov authored
  14. 13 Jun, 2021 1 commit
    • Alexei Podtelezhnikov's avatar
      [type42] Fix new memory leak. · 8336d53c
      Alexei Podtelezhnikov authored
      We need to inverse inheritance of FT_GlyphSlot_Internal so that we
      have a chance to free the rendered bitmap from the parent slot.
      * src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts
      of the child `ttslot' and replace it with the parent structure.
      (T42_GlyphSlot_Done): Updated accordingly.
  15. 12 Jun, 2021 2 commits
    • Werner Lemberg's avatar
      [psaux] Fix another assertion. · db0f2c44
      Werner Lemberg authored
      * src/psaux/psintrp.c (cf2_interpT2CharString)
      <cf2_escCALLOTHERSUBR>: Convert assertion into error, since the
      problem can happen with invalid user input.
      Test case is file
      in the `freetype2-testing` repository.
    • Werner Lemberg's avatar
      [psaux] Fix assertions. · a34afe67
      Werner Lemberg authored
      * src/psaux/pshints.c (cf2_hintmap_adjustHints): Check for overflow
      before emitting an assertion error.
  16. 10 Jun, 2021 1 commit
  17. 09 Jun, 2021 2 commits
  18. 08 Jun, 2021 4 commits