diff options
Diffstat (limited to 'ThirdParty/freetype/ChangeLog')
-rw-r--r-- | ThirdParty/freetype/ChangeLog | 7610 |
1 files changed, 5273 insertions, 2337 deletions
diff --git a/ThirdParty/freetype/ChangeLog b/ThirdParty/freetype/ChangeLog index 670e848..e649d31 100644 --- a/ThirdParty/freetype/ChangeLog +++ b/ThirdParty/freetype/ChangeLog @@ -1,3 +1,5274 @@ +2021-07-18 Werner Lemberg <wl@gnu.org> + + * Version 2.11.0 released. + ========================== + + + Tag sources with `VER-2-11-0'. + + * docs/VERSION.TXT: Add entry for version 2.11.0. + * docs/CHANGES: 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.10.4/2.11.0/, s/2104/2110/. + + * include/freetype/freetype.h (FREETYPE_MINOR): Set to 11. + (FREETYPE_PATCH): Set to 0. + + * builds/unix/configure.raw (version_info): Set to 24:0:18. + * CMakeLists.txt (VERSION_MINOR): Set to 11. + (VERSION_PATCH): Set to 0. + + * builds/toplevel.mk (dist): Ignore more git-related files. + +2021-07-17 David Turner <david@freetype.org> + + * src/smooth/ftgrays.c: Fix compilation if `FT_LONG64` is undefined. + + The code assumed that if `__SSE2__` is defined, then 64-bit integer + types are available. This is not the case apparently for certain + multilib compiler targets like 'x86_32.x86' used by Gentoo. + + This patch fixes the issue by disabling the special code path when + 64-bit integer types are not available. + + Fixes #1071. + +2021-07-16 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> + + [tests] Allow arbitrary build directories. + + * tests/issue-1063/main.c (main): I am building with a build + directory that is not directly inside the source tree, so the path + `../tests/data/As.I.Lay.Dying.ttf` does not resolve to the test + input file. This change passes the test data directory as an + environment variable to allow arbitrary build directories. + + * tests/meson.build: Updated. + +2021-07-16 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> + + * tests/issue-1063/main.c (main): Fix uninitialized variable. + + I tried running `meson test` but the test just crashed and gdb + reported that the face argument to `FT_Get_Char_Index` was nonsense. + With this change the test prints 'Could not open file: ' as it + should. + +2021-07-16 Werner Lemberg <wl@gnu.org> + + [smooth] Minor fixes. + + * src/smooth/ftgrays.c (gray_render_conic): Move variable and + structure declarations to beginning of function. Inspite of C99 + compliance we still do this for the sake of backward compatibility. + This also avoids a shadowing declaration of `count`. + (gray_convert_glyph_inner): Fix typo. + +2021-07-15 Ben Wagner <bungeman@chromium.org> + + * src/smooth/ftgrays.c: Guard inclusion of `emmintrin.h`. + + Guard inclusion of `emmintrin.h` with `#ifdef __SSE2__`. The gcc + version of this header, `xmmintrin.h`, and `mmintrin.h` check that + the appropriate defines are set before defining anything (are + internally guarded). However, the clang versions of these includes + are not internally guarded. As a result of this, externally guard + the inclusion of these headers. + +2021-07-15 David Turner <david@freetype.org> + + [smooth] Implement Bézier quadratic arc flattening with DDA. + + Benchmarking shows that this provides a very slighty performance + boost when rendering fonts with lots of quadratic Bézier arcs, + compared to the recursive arc splitting, but only when SSE2 is + available, or on 64-bit CPUs. + + On a 2017 Core i5-7300U CPU on Linux/x86_64: + + ftbench -p -s10 -t5 -cb DroidSansFallbackFull.ttf + + Before: 4.033 us/op (best of 5 runs for all numbers) + After: 3.876 us/op + + ftbench -p -s60 -t5 -cb DroidSansFallbackFull.ttf + + Before: 13.467 us/op + After: 13.385 us/op + + * src/smooth/ftgrays.c (gray_render_conic): New implementation + based on DDA and optionally SSE2. + +2021-07-15 David Turner <david@freetype.org> + + [smooth] Minor speedup to smooth rasterizer. + + This speeds up the smooth rasterizer by avoiding conditional + branches in the hot path. + + - Define a fixed 'null cell', which will be pointed to whenever the + current cell is outside of the current target region. This avoids + a `ras.cell != NULL` check in the `FT_INTEGRATE` macro. + + - Also use the null cell as a sentinel at the end of all `ycells` + linked-lists, by setting its x coordinate to `INT_MAX`. This + avoids a `if (!cell)` check in `gray_set_cell` as well. + + - Slightly change the worker struct fields to perform a little less + operations during rendering. + + Example results (on a 2013 Corei5-3337U CPU) + + out/ftbench -p -s10 -t5 -bc DroidSansFallbackFull.ttf + + Before: 5.472 us/op + After: 5.275 us/op + + out/ftbench -p -s60 -t5 -bc DroidSansFallbackFull.ttf + + Before: 17.988 us/op + After: 17.389 us/op + + * src/smooth/ftgrays.c (grat_TWorker): Replace `num_cells` field with + `cell_free` and `cell_limit`. + (NULL_CELL_PTR, CELL_MAX_X_VALUE, CELL_IS_NULL): New macros. + (gray_dump_cells, gray_set_cell, gray_sweep, gray_sweep_direct, + gray_convert_glyph_inner, gray_convert_glyph): Updated. + +2021-07-15 David Turner <david@freetype.org> + + [tests] Rewrite download script in Python3. + + This commit replaces the bash script with a Python script that does + the same work, plus avoiding to download anything if the files are + already installed with the right content. + + We now use the first 8 bytes of each file's sha256 hash for the + digest. + + * tests/scripts/download-test-fonts.sh: Removed. + * tests/scripts/download-test-fonts.py: New script. + * tests/README.md: Updated. + +2021-07-15 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> + + Support architectures where `long` is smaller than pointers. + + I am currently trying to compile FreeType for CHERI-extended ISAs + (CHERI-RISC-V and Arm's Morello), but I am getting compiler warnings + from the `FT_UINT_TO_POINTER` macro. When compiling with the CHERI + Clang compiler, not using `uinptr_t` for casts between integers an + pointers results in the following `-Werror` build failures: + + ``` + In file included from .../src/truetype/truetype.c:22: + .../src/truetype/ttgload.c:1925:22: error: + cast from provenance-free integer type to pointer type will + give pointer that can not be dereferenced + [-Werror,-Wcheri-capability-misuse] + node->data = FT_UINT_TO_POINTER( glyph_index ); + ^ + .../include/freetype/internal/compiler-macros.h:79:34: note: + expanded from macro 'FT_UINT_TO_POINTER' + ``` + + * include/freetype/internal/compiler-macros.h (FT_UINT_TO_POINTER): + The ISO C standard compliant fix for this would be to use + `uintptr_t` from `stdint.h`, but I am not sure if this is supported + by the minimum compiler version. Therefore, use the + compiler-defined `__UINTPTR_TYPE__` macro (supported in GCC 4.6+ and + Clang since about 3.0) before checking for `_WIN64` and falling back + to `unsigned long`. + +2021-07-13 Oleg Oshmyan <chortos@inbox.lv> + + [base] Fix `FT_Open_Face`'s handling of user-supplied streams. + + This was already true (though undocumented) most of the time, but + not if `FT_NEW` inside `FT_Stream_New` failed or if the + `FT_OPEN_XXX` flags were bad. + + Normally, `FT_Open_Face` calls `FT_Stream_New`, which returns the + user-supplied stream unchanged, and in case of any subsequent error + in `FT_Open_Face`, the stream is closed via `FT_Stream_Free`. + + Up to now, however, `FT_Stream_New` allocates a new stream even if + it is already given one by the user. If this allocation fails, the + user-supplied stream is not returned to `FT_Open_Face` and never + closed. Moreover, the user cannot detect this situation: all they + see is that `FT_Open_Face` returns `FT_Err_Out_Of_Memory`, but that + can also happen after a different allocation fails within the main + body of `FT_Open_Face`, when the user's stream has already been + closed by `FT_Open_Face`. It is plausible that the user stream's + `close` method frees memory allocated for the stream object itself, + so the user cannot defensively free it upon `FT_Open_Face` failure + lest it ends up doubly freed. All in all, this ends up leaking the + memory/resources used by user's stream. + + Furthermore, `FT_Stream_New` simply returns an error if the + `FT_OPEN_XXX` flags are unsupported, which can mean either an + invalid combination of flags or a perfectly innocent + `FT_OPEN_STREAM` on a FreeType build that lacks stream support. + With this patch, the user-supplied stream is closed even in these + cases, so the user can be sure that if `FT_Open_Face` failed, the + stream is definitely closed. + + * src/base/ftobjs.c (FT_Stream_New): Don't allocate a buffer + unnecessarily. + Move error-handling code to make the control flow more obvious. + Close user-supplied stream if the flags are unsupported. + `FT_Stream_Open` always sets `pathname.pointer`, so remove the + redundant (re)assignment. None of the `FT_Stream_Open...` functions + uses `stream->memory`, so keep just one assignment at the end, + shared among all possible control flow paths. + ('Unsupported flags' that may need a stream closure can be either an + invalid combination of multiple `FT_OPEN_XXX` mode flags or a clean + `FT_OPEN_STREAM` flag on a FreeType build that lacks stream + support.) + +2021-07-13 Oleg Oshmyan <chortos@inbox.lv> + + [base] Reject combinations of incompatible `FT_OPEN_XXX` flags. + + The three modes are mutually exclusive, and the documentation of the + `FT_OPEN_XXX` constants notes this. However, there was no check to + validate this in the code, and the documentation on `FT_Open_Args` + claimed that the corresponding bits were checked in a well-defined + order, implying it was valid (if useless) to specify more than one. + Ironically, this documented order did not agree with the actual + code, so it could not be relied upon; hopefully, nobody did this and + nobody will be hurt by the new validation. + + Even if multiple mode bits were allowed, they could cause memory + leaks: if both `FT_OPEN_STREAM` and `stream` are set along with + either `FT_OPEN_MEMORY` or `FT_OPEN_PATHNAME`, then `FT_Stream_New` + allocated a new stream but `FT_Open_Face` marked it as an 'external' + stream, so the stream object was never released. + + * src/base/ftobjs.c (FT_Stream_New): Reject incompatible + `FT_OPEN_XXX` flags. + +2021-07-12 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> + + * meson.build: Fix build for other UNIX systems (e.g., FreeBSD). + + Without this change the build of `unix/ftsystem.c` fails because the + `ftconfig.h` header that defines macros such as `HAVE_UNISTD_H` and + `HAVE_FCNTL_H` is only being generated for Linux, macOS, and Cygwin + systems: + + ``` + .../builds/unix/ftsystem.c:258:32: error: + use of undeclared identifier 'O_RDONLY' + file = open( filepathname, O_RDONLY ); + ``` + + Instead of hardcoding a list of operating systems for this check, + update the logic that decides whether to build the file and set a + boolean flag that can be checked instead. + +2021-07-12 Werner Lemberg <wl@gnu.org> + + [autofit] More clean-ups. + + * src/autofit/afhints.h (AF_GlyphHintsRec): Remove the no longer + needed fields `xmin_delta` and `xmax_delta`. + + * src/autofit/afhints.c (af_glyph_hints_reload), + src/autofit/afloader.c (af_loader_load_glyph): Updated. + +2021-07-12 Werner Lemberg <wl@gnu.org> + + Small clean-ups for the last few commits. + + * include/freetype/fttrace.h (afwarp): Removed. + +2021-07-12 David Turner <david@freetype.org> + + Remove obsolete `AF_Angle` type and related sources. + + * src/autofit/afangles.c: File removed. Functions related to + sorting moved to... + * src/autofit/afhints.c (af_sort_pos, af_sort_and_quantize_widths): + This file. + * src/autofit/afangles.h: File removed. + * src/autofit/aftypes.h: Updated. + * src/autofit/autofit.c: Updated. + + * src/autofit/rules.mk (AUTOF_DRV_SRC): Updated. + +2021-07-12 David Turner <david@freetype.org> + + Remove experimental auto-hinting 'warp' mode. + + This feature was always experimental, and probably never worked + properly. This patch completely removes it from the source code, + except for a documentation block describing it for historical + purposes. + + * devel/ftoption.h, include/freetype/config/ftoption.h: Remove + `AF_CONFIG_OPTION_USE_WARPER`. + + * include/freetype/ftdriver.h: Document 'warping' property as + obsolete. + + * src/autofit/afwarp.c, src/autofit/afwarp.h: Files removed. + * src/autofit/*: Remove any code related to warp mode. + +2021-07-12 David Turner <david@freetype.org> + + Remove experimental 'Latin2' writing system (`FT_OPTION_AUTOFIT2`). + + This code has always been experimental and was never compiled anyway + (`FT_OPTION_AUTOFIT2` does not appear in `ftoption.h` or even any of + our build files). + + * include/freetype/internal/fttrace.h (aflatin2): Removed. + * src/autofit/aflatin2.h, src/autofit/aflatin2.c: Files removed. + * src/autofit/afloader.c: Remove undocumented hook to activate + Latin2 system. + * src/autofit/afstyles.h: Remove `ltn2_dflt` style definition. + * src/autofit/afwrtsys.h: Remove `LATIN2` writing system definition. + * src/autofit/autofit.c: Updated. + +2021-07-05 Werner Lemberg <wl@gnu.org> + + * src/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix argument. + + Reported by Hin-Tak. + +2021-07-03 Werner Lemberg <wl@gnu.org> + + * meson_options.txt: Sort alphabetically; no final full stops. + +2021-07-01 Ben Wagner <bungeman@chromium.org> + + * src/truetype/ttgxvar.c (tt_set_mm_blend): Test `coords`. + + 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. + +2021-06-30 Dominik Röttsches <drott@chromium.org> + + [sfnt] Support PaintScale in 'COLR' v1 parsing. + + * include/freetype/ftcolor.h (FT_PaintFormat): Renumber values, add + `FT_COLR_PAINTFORMAT_SCALE`. + (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. + +2021-06-30 Dominik Röttsches <drott@chromium.org> + + [sfnt] Handle fonts without layer list in 'COLR' v1. + + '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. + +2021-06-30 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/raster/ftraster.c (Render_Single_Pass): Simplify `band_stack'. + +2021-06-29 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Do not skip the second pass without dropout control. + + The second pass also fixes horizontal lines through the pixel centers. + + * src/raster/ftraster.c (black_TWorker): Do not use `second_pass'. + (Render_Glyph): Skip the second pass only with the appropriate flag. + +2021-06-29 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Handle sub-band stack locally. + + * src/raster/ftraster.c (black_TWorker): Move `band_stack' from here.. + (Render_Single_Pass): ... to here and accept limit arguments. + (Render_Glyph): Updated. + +2021-06-25 Anurag Thakur <anuthadev@gmail.com> + + [CI] Introduce linux CI and refactor job names. + + * .gitlab-ci.yml: Added jobs for building freetype on linux. + +2021-06-28 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Handle Bézier stack locally. + + * src/raster/ftraster.c (black_TWorker): Move `arcs' from here... + (Conic_To, Cubic_To): ... to here to tighten their scope. + (Bezier_Up, Bezier_Down): ... Take the current `arc' argument. + +2021-06-28 Dominik Röttsches <drott@chromium.org> + + [sfnt] Improve paint limit checks + + 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 + checks. + + * 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. + +2021-06-28 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Clean up vertical sweep. + + * 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. + +2021-06-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Make `band_top' local variable. + + * src/raster/ftraster.c (black_TWorker): Move `band_top' from here... + (Render_Single_Pass): ... to here, and refactor. + (Render_Glyph): Updated. + +2021-06-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Adjust sub-band bisecting limits. + + We can bisect a band until it is just a single scan line. This might + be slow and cause time-outs but if we need to impose limits it should + be elsewhere. + + * src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding. + +2021-06-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/raster/ftraster.c (Render_Single_Pass): Remove dead code. + +2021-06-25 Werner Lemberg <wl@gnu.org> + + [base] Add trace level to logging output. + + 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): + Adjust. + + * docs/DEBUG: Updated. + +2021-06-24 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth, raster] Fix up and align error codes. + + 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. + +2021-06-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth, raster] Remove synonymous error macros. + + * 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. + +2021-06-22 Dominik Röttsches <drott@chromium.org> + + [sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/. + + * include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat, + FT_COLR_Paint): Do it to make it harmonize with other names such as + 'PaintTranslate'. + + * src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto. + +2021-06-22 Dominik Röttsches <drott@chromium.org> + + Move 'COLR' API to `ftcolor.h`. + + * include/freetype/freetype.h: Cut section layer managament + containing 'COLR' v0 and v1 API and move it to `ftcolor.h` as + requested by Werner on freetype-devel. + * include/freetype/ftcolor.h: Paste that section. + +2021-06-19 Werner Lemberg <david@freetype.org> + + [truetype] Fix integer overflow. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35312 + + * src/truetype/ttinterp.c (Ins_JMPR): Use `ADD_LONG`. + +2021-06-19 Werner Lemberg <david@freetype.org> + + [autofit] Prevent hinting if there are too many segments. + + This speeds up handling of broken glyphs. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35309 + + * src/autofit/aflatin.c (af_latin_hints_compute_segments): Implement + it. + +2021-06-18 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sdf/ftsdfrend.c (ft_(b)sdf_render): Do not FT_ERROR routinely. + +2021-06-16 David Turner <david@freetype.org> + + [autofit] Fix return value of `FT_Load_Glyph`. + + * src/autofit/afglobal.c (af_face_globals_get_metrics): The issue is + that `style_metrics_init` sometimes returns -1 without clearing + `error`. While looping to `Again`, the next operation is + successful, but -1 is still returned by the function. The fix is to + set `error` to 0 appropriately. + + Fixes #1063. + +2021-06-15 David Turner <david@freetype.org> + + [meson] Add first regression test to FreeType. + + * tests/README.md: New file that explains how to build and run the + tests with the Meson build. + + * tests/scripts/download-test-fonts.sh: New bash script to download + test font files to the `tests/data` folder. + + * meson.build, meson_options.txt: Add 'tests' option to enable + building and running the test programs (disabled by default). + + * tests/meson.build: New file. + + * tests/issue-1063/main.c: Simple regression test to exhibit issue + 1063. + + * .gitignore: Ignore the content of the `tests/data` folder for + now. + +2021-06-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + [type42] Fix new memory leak. + + 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. + +2021-06-12 Werner Lemberg <wl@gnu.org> + + [psaux] Fix another assertion. + + * 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 + + fuzzing/corpora/legacy/oss-fuzz/5754332360212480-unknown-read + + in the `freetype2-testing` repository. + +2021-06-12 Werner Lemberg <wl@gnu.org> + + [psaux] Fix assertions. + + * src/psaux/pshints.c (cf2_hintmap_adjustHints): Check for overflow + before emitting an assertion error. + + Test case is file + + fuzzing/corpora/legacy/oss-fuzz/4594115297673216-integer-overflow + + in the `freetype2-testing` repository. + +2021-06-09 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/truetype/ttinterp.c (TT_RunIns): Optimize tracing. + +2021-06-09 Alexei Podtelezhnikov <apodtele@gmail.com> + + [sdf] Fix SDF positioning. + + * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Add padding to + `bitmap_top' and `bitmap_left'. + + * sdf/sdf/ftsdf.c (sdf_generate_with_overlaps): Fix VC++ warning. + +2021-06-08 Werner Lemberg <wl@gnu.org> + + Fix 'devel' build for 'COLR' v1. + + * devel/ftoption.h: Synchronize with + `include/freetype/config/ftoption.h`. + +2021-06-08 Werner Lemberg <wl@gnu.org> + + [sfnt] Sanitize cmap4 table better. + + Fixes #1062. + + * src/sfnt/ttcmap.c (tt_cmap4_validate): Handle a too-small value of + `length` gracefully. + +2021-06-08 Dominik Röttsches <drott@chromium.org> + + [sfnt] Pointer validity check when reading 'COLR' v1 layers + + * src/sfnt/ttcolr.c (tt_face_get_paint_layers): In addition to the + existing sanity checks, ensure that the pointer to the layer to be + read is within the 'COLR' v1 table. + +2021-06-08 Werner Lemberg <wl@gnu.org> + + * src/sdf/ftsdfcommon.c: Fix inclusion of header files. + +2021-06-08 Werner Lemberg <wl@gnu.org> + + [sdf] Make `make multi` work. + + * src/sdf/ftsdf.c: Include `ftbitmap.h`. + + * src/sdf/ftsdfcommon.h: Move function bodies to `ftsdfcommon.c`. + Include `ftobjs.h` to get definitions of `FT_LOCAL` and friends. + + * src/sdf/ftsdfcommon.c: New file. + + * src/sdf/rules.mk, src/sdf/sdf.c: Updated. + +2021-06-08 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Use 8 bits for final SDF output instead of 16bits. + + Since 8-bits is enough to represent SDF data we no longer require + 16-bits for this purpose. Also, we now normalize the output data + to use the entire 8-bit range efficiently. For example: if we use + 3.5 format with a spread of 1 we basically only use the starting + 5-bits. By normalizing we can use the entire 8-bit range. + + * include/freetype/freetype.h (FT_Render_Mode): Updated description + for `FT_RENDER_MODE_SDF` regarding this change. + + * include/freetype/ftimage.h (FT_Pixel_Mode): Removed + `FT_PIXEL_MODE_GRAY16` since no longer required. + + * include/freetype/fttypes.h (FT_F6Dot10): Removed since no longer + required. + + * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Allocate 8-bit + bitmap instead of 16-bit buffer. + + * src/sdf/ftsdfcommon.h (map_fixed_to_sdf): Added function to convert + 16.16 distance value to our desired format. + + * src/sdf/ftsdf.c (sdf_generate_with_overlaps, + sdf_generate_bounding_box): Use the new `map_fixed_to_sdf` function + and also use 8-bit output buffer. + + * src/sdf/ftbsdf.c (finalize_sdf): Output to a 8-bit buffer instead + of 16-bit buffer. + +2021-06-02 Ben Wagner <bungeman@chromium.org> + Werner Lemberg <wl@gnu.org> + + [sfnt] Fix fallout from 2021-05-29 change. + + * src/sfnt/ttcolr.c (find_base_glyph_record, + find_base_glyph_v1_record): Adjust binary search. + + Needs to be updated with change to unsigned. + +2021-06-02 Werner Lemberg <wl@gnu.org> + + * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix tracing. + + Problem reported by Alexei. + +2021-06-02 Werner Lemberg <wl@gnu.org> + + [psaux] Fix MSVC compiler warnings. + + * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs): + Add cast. + +2021-05-29 Werner Lemberg <wl@gnu.org> + + Fix compilation errors and (some) warnings for clang++. + + * src/autofit/afmodule.c (AF_GlyphHintsRec): Make it static. + + * src/cache/ftcache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c + (ftc_snode_compare): Remove semicolon. + + * src/cff/cffparse.c (cff_parser_run): Add `break` statement. + + * src/cid/cidload.c (cid_hex_to_binary): Add cast. + + * src/sdf/ftbsdf.c (CHECK_NEIGHBOR): Use `do {} while(0)` loop. + (bsdf_init_distance_map, finalize_sdf, bsdf_raster_render): Add + casts. + * src/sdf/ftsdf.c (sdf_generate_bounding_box, + sdf_generate_with_overlaps): Ditto. + * src/sdf/ftsdfcommon.h (square_root): Ditto. + * src/sdf/ftsdfrend.c (sdf_property_get, ft_sdf_render, + ft_bsdf_render): Ditto. + + * src/sfnt/ttcolr.c (find_base_glyph_record, + find_base_glyph_v1_record): Fix variable signedness. + (read_color_line): Add cast. + (read_paint): Add casts. + Fix signedness issue. + (tt_face_get_colorline_stops) Fix signedness issues. + + * src/sfnt/ttpost.c (load_format_20): Add casts. + + * src/truetype/ttsubpix.c (TWEAK_RULES, TWEAK_RULES_EXCEPTIONS): + Remove final semicolons. + +2021-05-29 Werner Lemberg <wl@gnu.org> + + [build] Allow overriding of `ANSIFLAGS` for GNU make build. + + * builds/*: Implement it. + +2021-05-27 Alexei Podtelezhnikov <apodtele@gmail.com> + + [type42] Fix auto-hinting. + + The autohinter could not access the base (unscaled) outline in the + child TrueType glyph slot. We now share the internal parts between + the parent and child glyph slots. Fixes #1057. + + * src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts + of `T42_GlyphSlot' and replace it with the child TrueType structure. + (T42_GlyphSlot_Done): Updated accordingly. + +2021-05-25 Werner Lemberg <wl@gnu.org> + + [psaux] Guard and trace AFM kern data allocation. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31543 + + * include/freetype/internal/fttrace.h: Add 'afmparse' trace + component. + + * src/psaux/afmparse.c (FT_COMPONENT): Define. + (afm_parse_track_kern, afm_parse_kern_pairs): Protect against + allocations bombs. + Add tracing. + (afm_parse_kern_data): Don't allow multiple kern data sections. + +2021-05-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + * meson.build (ft2_public_headers): Add missing `ftcid.h'. + + Fixes #1058. + +2021-05-20 Alexei Podtelezhnikov <apodtele@gmail.com> + + [type42] Avoid some memory zeroing. + + * src/type42/t42objs.c (T42_Open_Face): Tweak allocation macro. + * src/type42/t42parse.c (t42_parse_sfnts): Ditto. + +2021-05-19 Nikolaus Waxweiler <madigens@gmail.com> + + [CMake] Update dependency finders. + + 1. Fixes CMake using any found HarfBuzz version lower than the minimum + required. This is based on HALX99's merge request at + https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/31 + 2. Update FindHarfBuzz.cmake from + https://github.com/WebKit/WebKit/blob/1ce32454/Source/cmake/FindHarfBuzz.cmake + and guard post-CMake-3.1 features to keep the minimum version unchanged + 3. Update FindBrotliDec.cmake to stop the warnings, based on what + https://github.com/google/woff2/blob/a0d0ed7d/cmake/FindBrotliDec.cmake + is doing + + * CMakeLists.txt, builds/cmake/FindHarfBuzz.cmake: Implement 1 and 2. + * builds/cmake/FindBrotliDec.cmake: Implement 3. + +2021-05-19 Ben Wagner <bungeman@chromium.org> + + [gzip] Use exact type for `ft_gzip_alloc` and `ft_gzip_free`. + + While a function pointer may be cast to another function pointer + type, it is required to cast the function pointer back to the + original function pointer type before calling it. If a parameter is + a pointer the exact pointer type is required. Using a pointer to a + different underlying type is technically undefined behavior. The + wrapper functions `ft_gzip_alloc` and `ft_gzip_free` took + `FT_Memory` (a `FT_MemoryRec_*`) instead of `voidpf` (`void*`), so + when gzip calls these callbacks through `alloc_func` or `free_func` + it invokes undefined behavior. On most platforms this works out as + expected, but newer undefined behavior detectors and targets like + wasm can detect this and will produce an error. + + * src/gzip/ftgzip.c (ft_gzip_alloc, ft_gzip_free): Update signatures + to exactly match `alloc_func` and `free_func`, respectively. + Internally, cast the `void*` opaque pointer to `FT_Memory`. + +2021-05-18 Alexei Podtelezhnikov <apodtele@gmail.com> + + Prioritize the anti-aliasing renderer module. + + * modules.cfg: Reorder the renderers. + * include/freetype/config/ftmodule.h: Ditto. + +2021-05-16 Alexei Podtelezhnikov <apodtele@gmail.com> + + [sfnt] Additional guards on the POST table. + + Fixes timeout (#1055) analyzed by Ben Wagner, reported as + + https://crbug.com/1194092 + + * src/sfnt/ttload.c (tt_face_load_post): Check POST format. + * src/sfnt/sfobjs.c (sfnt_load_face): Synthesize the missing unicode + charmap only if the glyph names exist. + * src/psnames/psmodule.c (ps_unicode_value): Short cut ".notdef" and + ".null". + +2021-05-13 Daniel McArdle <dmcardle@chromium.org> + + [psaux] Use doubling allocation strategy for CF2_ArrStack. + + Fixes timeout reported as + + https://crbug.com/1206181 + + * src/psaux/psarrst.c (cf2_arrstack_{push,init}): Implement it. + * src/psaux/psarrst.h (CF2_ArrStackiRec): Drop `chunk'. + +2021-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (FT_MAX_GRAY_SPANS): Increase from 10 to 16. + + Ten was barely enough for two slanted stems. Sixteen can actually fit + a bit more complicated scanlines. + +2021-05-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (FT_GRAY_SET): Adjust for better code. + +2021-05-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Faster bitmap sweeping. + + Selecting the fill rule or checking the direct mode each time we call + `gray_hline' is sub-optimal. This effectively splits the direct mode + into a separate code path while inlining `gray_hline' and saving 5-7% + of rendering time. + + * src/smooth/ftgrays.c (gray_hline): Eliminated in favor of... + (FT_FILL_RULE, FT_GRAY_SET): ... these new macros... + (gray_sweep): ... inlined here. + (gray_sweep_direct): New function that handles the direct span buffer. + (gray_TWorker): Remove the span buffer. + (gray_raster_render, gray_convert_glyph): Updated. + +2021-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (gray_hline): Simplify even-odd computations. + + It is too bad the even-odd rule is not used much. + +2021-05-07 Alexei Podtelezhnikov <apodtele@gmail.com> + + [type1] Avoid MM memory zeroing. + + * src/type1/t1load.c (t1_allocate_blend, parse_blend_design_map): + Tweak allocation macros. + * src/type1/t1objs.c (T1_Face_Done): Minor. + +2021-05-07 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/bdf/bdflib.c (_bdf_list_ensure): Tweak allocation macro. + +2021-05-06 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/psaux/psobjs.c (ps_parser_load_field): Tweak allocation macro. + +2021-05-06 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/sfobjs.c (sfnt_load_face): Tweak allocation macro. + +2021-05-06 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/cid/cidload.c (cid_read_subrs): Tweak allocation macro. + +2021-05-06 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Tweak allocation. + +2021-05-05 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cff,psaux] Avoid memory zeroing (contd.). + + * src/cff/cffload.c (cff_blend_doBlend, cff_blend_build_vector): Tweak + allocation macros. + * src/psaux/psarrst.c (cf2_arrstack_setNumElements): Ditto. + * src/psaux/psstack.c (cf2_stack_init): Ditto. + +2021-05-04 Ben Wagner <bungeman@chromium.org> + + * src/cid/cidload.c (cid_hex_to_binary): Improve return value. + + Add argument to return the actual number of bytes that were decoded. + The actual number of bytes decoded can be quite variable depending + on the number of ignored 'whitespace' bytes or early termination + with `>`. + (cid_face_open): Updated to use this calculated value. This avoids + trusting `parser->binary_length` is always be correct and reading + uninitialized bits if fewer are actually decoded. + + First reported as + + https://crbug.com/1203240 + +2021-05-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + [sfnt] Streamline POST format 2.0 handing. + + To reduce memory allocations, we read an entire Pascal-string buffer + and convert it to a C-string buffer. We also reject tables with + Postscript glyph names exceeding 63 bytes. + + * src/sfnt/ttpost.c (load_format20): Implement it. + (load_post_names): Check the minimal POST table size. + (load_format25, tt_face_free_ps_names): Updated accordingly. + +2021-05-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + [bdf,pcf] Avoid memory zeroing (contd.). + + * src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment, + _bdf_add_property, bdf_load_font): Tweak allocation macros. + * src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto. + +2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/cid/cidload.c (cid_read_subrs): Tweak allocaton macro. + +2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [sfnt] Avoid some memory zeroing. + + * src/sfnt/sfobjs.c (sfnt_open_font, sfnt_init_face, + tt_name_ascii_from_{utf16,other}): Tweak allocaton macros. + * src/sfnt/ttload.c (tt_face_load_name): Ditto. + +2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/ttpost.c (load_format_{20,25}): Tweak allocaton macros. + +2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/pngshim.c (Load_SBit_Png): Tweak allocaton macro. + +2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Avoid some memory zeroing. + + * src/truetype/ttinterp.c (Init_Context): Tweak allocation macro. + * src/truetype/ttpload.c (tt_face_load_cvt): Ditto. + +2021-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [woff2] Avoid some memory zeroing. + + * src/sfnt/sfwoff2.c (store_loca, woff2_open_font): Tweak macros. + +2021-04-30 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/gzip/ftgzip.c (ft_gzip_alloc): Zero out memory again. + +2021-04-27 Alexei Podtelezhnikov <apodtele@gmail.com> + + [lzw] Preserve decompression stack when relocating to heap. + + * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Copy stack when + relocating to heap. + +2021-04-27 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/cid/cidgload.c (cid_load_glyph): Restore the glyph_length check. + +2021-04-27 Werner Lemberg <wl@gnu.org> + + * src/psmodule.c (ps_unicodes_init): Ignore empty glyph names. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33637 + +2021-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/sfobjs.c (sfnt_init_face): Revert macro change. + +2021-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cff] Avoid some memory zeroing. + + * src/cff/cffparse.c (cff_parser_init): Tweak memory macro. + * src/cff/cffload.c (cff_index_load_offsets, cff_index_get_pointers, + cff_charset_load, cff_vstore_load): Ditto. + +2021-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + [pfr] Avoid some memory zeroing. + + * src/pfr/pfrobjs.c (pfr_face_init) : Tweak memory macro. + * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps, + pfr_phy_font_load): Ditto. + +2021-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/winfonts/winfnt.c (FNT_Face_Init): Tweak memory macro. + +2021-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + [psaux,psnames] Avoid some memory zeroing. + + * src/psaux/psstack.c (cf2_stack_init): Tweak memory macro. + * src/psnames/psmodule.c (ps_unicodes_init): Ditto. + +2021-04-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + [base] Avoid some memory zeroing. + + * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Use FT_QNEW_ARRAY. + * src/base/ftsnames.c (FT_Get_Sfnt_{Name,LangTag}): Ditto. + +2021-04-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + [bdf,pcf] Avoid some memory zeroing. + + * src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties, pcf_load_font): + Tweak memory macros. + * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto. + * src/bdf/bdflib.c (_bdf_readstreami, bdf_create_property, + _bdf_parse_glyphs, _bdf_parse_start): Ditto. + (_bdf_add_property): Do not handle zero size. + +2021-04-25 Issam E. Maghni <issam.e.maghni@mailbox.org> + + * builds/meson/process_ftoption_h.py: Add LF at EOF. + + This fixes + + .../ftoption.h:1030:10: error: + no newline at end of file [-Werror,-Wnewline-eof] + + for the generated `ftoption.h` file. + +2021-04-24 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/cff/cffload.c (cff_index_get_pointers): s/FT_QALLOC/FT_ALLOC/. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftobjs.c (Mac_Read_POST_Resource): s/FT_ALLOC/FT_QALLOC/. + * builds/mac/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sdf/ftsdf.c (sdf_{edge,contour,shape}_new): Use FT_QALLOC. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [sfnt] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/sfnt/sfdriver.c (get_win_string, get_apple_string, + sfnt_get_var_ps_name): Do not zero out the buffer. + * src/sfnt/sfobjs.c (sfnt_init_face): Ditto. + * src/sfnt/sfwoff.c (woff_open_font): Ditto. + * src/sfnt/sfwoff2.c (woff2_open_font): Ditto. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cff,type1,type42] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/cff/cffload.c (cff_index_get_pointers, cff_index_get_name): + Do not zero out the buffer. + * src/cff/cffdrivr.c (cff_ps_get_font_info): Ditto. + * src/type1/t1load.c (parse_subrs, parse_charstrings, + parse_blend_axis_types): Ditto. + * src/type1/t1parse.c (T1_New_Parser, T1_Get_Private_Dict): Ditto. + * src/type42/t42parse.c (t42_parser_init): Ditto. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cid] s/FT_ALLOC/FT_QALLOC/ and clean up. + + * src/cid/cidgload.c (cid_load_glyph): Do not zero out the buffer. + * src/cid/cidload.c (cid_face_open, cid_read_subrs): Ditto. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [pfr] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/pfr/pfrload.c (pfr_extra_item_load_font_id, pfr_aux_name_load): + Do not zero out the buffer. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [bzip2,gzip] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Do not zero out the buffer. + * src/gzip/ftgzip.c (ft_gzip_alloc, FT_Stream_OpenGzip): Ditto. + +2021-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + [pcf,bdf,winfonts] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/pcf/pcfread.c (pcf_interpret_style): Do not zero out the buffer. + * src/bdf/bdfdrivr.c (bdf_interpret_style): Ditto. + * src/winfonts/winfnt.c (FNT_Face_Init, FNT_Load_Glyph): Ditto. + +2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cache] Optimize SBit copying. + + * src/cache/ftcsbits.c (ftc_snode_load): Do not initialize the buffer. + (ftc_sbit_copy_bitmap): Accept zero size, s/FT_ALLOC/FT_QALLOC/. + +2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com> + + [gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/gxvalid/gxvmod.c (gxv_load_table): Do not zero out the buffer. + * src/otvalid/otvmod.c (otv_load_table): Ditto. + +2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com> + + [psaux] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/psaux/psobjs.c (ps_table_done, ps_parser_load_field): Do not + zero out the buffer. + +2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com> + + [base] s/FT_ALLOC/FT_QALLOC/ for initialized buffers. + + * src/base/ftobjs.c (open_face_PS_from_sfnt_stream, + Mac_Read_sfnt_Resource): Do not zero out the buffer. + * src/base/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto. + * src/base/ftrfork.c (raccess_make_file_name, + raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Ditto. + +2021-04-20 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cache] Restore SBit copying for unowned (BDF) bitmaps. + + * src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Restore. + (ftc_snode_load): Check ownership and copy unowned bitmaps. + +2021-04-19 Dominik Röttsches <drott@chromium.org> + + [sfnt] Return in 'COLR' v1 when layer pointer outside table + + * src/sfnt/ttcolr.c (tt_face_get_paint_layers): Add missing return + when paint pointer outside table. + (read_paint): Add missing return when paint pointer outside table. + +2021-04-18 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cache] Switch to lazy SBit setting. + + * src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Removed. + (ftc_snode_load): Take the bitmap ownership instead of copying. + +2021-04-16 Daniel Welty <@danielwelty> + + * src/cache/ftcsbits.c (ftc_snode_load): Properly handle short pitch. + +2021-04-16 Werner Lemberg <wl@gnu.org> + + * builds/unix/freetype2.m4: Fix help string formatting. + + The indented `dnl` macros inserted unwanted horizontal space. + + Problem reported by Ozkan Sezer <sezeroz@gmail.com>. + +2021-04-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Safeguard 'COLR' v1 layer extraction + + * src/sfnt/ttcolr.c (tt_face_get_paint_layers): Do not output + layer pointer to iterator if it is outside the 'COLR' table. + (read_paint): Do not attempt to read layers that are outside the + table. + +2021-04-02 Ben Wagner <bungeman@chromium.org> + + [base] Complete `ft_glyphslot_clear`. + + * src/base/ftobjs.c (ft_glyphslot_clear): This function is intended + to reset all the values of a glyph slot. However, it was not + resetting the values of the advances and `glyph_index`. Reset the + advances and `glyph_index` to zero. + +2021-04-02 Ben Wagner <bungeman@chromium.org> + + [truetype] Prevent glyph program state from persisting. + + `FDEF` instructions are specified as allowed only in 'prep' or + 'fpgm'. FreeType has attempted to prevent their use in the glyph + program, but they were still allowed in glyph programs if defined in + a function defined in 'prep' or 'fpgm' and called from the glyph + program. + + Similarly, `IDEF` instructions are specified not to be able to + modify any existing instruction. FreeType has attempted to prevent + their use in the glyph program, but they can still be used like + `FDEF`. + + This change stores the initial bytecode range type and disallows the + use of `FDEF` and `IDEF` while running the glyph program. + + Most other state is copied from the `TT_Size` into the execution + context. However, it is possible for a glyph program to use `WS` to + write to the storage area or `WCVTP`, `WCVTF`, and `DELTAC[123]` to + write to the control value table. + + Allowing any change to the global state from the glyph program is + problematic as the outlines of any given glyph may change based on + the order the glyphs are loaded or even how many times they are + loaded. There exist fonts that write to the storage area or the + control value table in the glyph program, so their use should not be + an error. + + Possible solutions to using these in the glyph program are + + * ignore the writes; + * value-level copy on write, discard modified values when finished; + * array-level copy on write, discard the copy when finished; + * array-level copy up-front. + + Ignoring the writes may break otherwise good uses. A full copy + up-front was implemented, but was quite heavy as even well behaved + fonts required a full copy and the memory management that goes along + with it. Value-level copy on write could use less memory but + requires a great deal more record keeping and complexity. This + change implements array-level copy on write. If any attempt is made + to write to the control value table or the storage area when the + initial bytecode range was in a glyph program, the relevant array + will be copied to a designated storage area and the copy used for + the rest of the glyph program's execution. + + * src/truetype/ttinterp.h (TT_ExecContextRec): New fields + `iniRange`, `glyfCvtSize`, `glyfCvt`, `origCvt`, `glyfStoreSize`, + `glyfStorage`, and `origStorage`. + + * src/truetype/ttinterp.c (Modify_CVT_Check): New function to handle + `exc->glyfCvt`. + (Write_CVT, Write_CVT_Stretched, Move_CVT, Move_CVT_Stretched): Use + it. + (Ins_WS): Handle `exc->glyfStorage`. + (Ins_FDEF, Ins_IDEF): Updated. + (TT_RunIns): Updated. + (TT_Done_Context): Free 'glyf' CVT working and storage area. + (TT_Load_Context): Fix/add casts. + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix cast. + +2021-03-30 Dominik Röttsches <drott@chromium.org> + + [sfnt] Check validity of pointer location of `read_color_line`. + + * src/sfnt/ttcolr.c (get_child_table_pointer): New function to fetch + child table pointer early for all paint formats that compute a child + table pointer. + (read_color_line, read_paint): Updated. + (tt_face_get_colorline_stops): Check `colr->table`. + +2021-03-28 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [docs] Update docwriter stylesheet for 1.3.1. + + This change is required to support docwriter 1.3.1. + + See + + https://gitlab.freedesktop.org/freetype/docwriter/-/merge_requests/101 + + for more information. + + * docs/markdown/stylesheets/extra.css: + (.wy-nav-content, .md-sidebar--secondary): Remove. + +2021-03-16 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later. + +2021-03-16 Ben Wagner <bungeman@google.com> + + [sfnt] Fix memory leak in png loading. + + Reported as + + https://bugs.chromium.org/p/chromium/issues/detail?id=1182552 + + Memory is allocated and the pointer assigned to `rows` inside a + 'setjmp' scope. This memory must be freed outside the 'setjmp' + scope after a 'longjmp'. Since `rows` is a local and modified + inside the 'setjmp' scope it must be marked volatile or it will have + an indeterminate value after the 'longjmp'. + + * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak of `rows`. + +2021-03-16 Christopher Degawa <ccom@randomderp.com> + + * CMakeLists.txt: Don't limit generation of 'pkg-config' file to UNIX. + + mingw-w64 uses the 'pkg-config' files but does not set UNIX. + +2021-03-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning. + +2021-03-13 Werner Lemberg <wl@gnu.org> + + Handle various VC++ compiler warnings. + + Fixes #1039. + + * src/base/ftstroke.c (ft_stroker_inside, ft_stroker_outside): + Initialize `sigma`. + + * src/sdf/ftsdf.c (sdf_generate_with_overlaps): Exit immediately if + function arguments are invalid. + * src/sdf/ftsdfrend.c (sdf_property_set) <"overlaps">: Fix cast. + + * src/sfnt/sfwoff2.c (woff2_decompress) + [!FT_CONFIG_OPTION_USE_BROTLI]: Use `FT_UNUSED`. + + * src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `fvar_head`. + +2021-03-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Reduce copying during integration phase. + + We now record `cover' and `area' directly into the linked list. This + makes rendering faster by 10% or even more at larger sizes. + + * src/smooth/ftgrays.c (FT_INTEGRATE): Write directly. + (gray_TWorker): Add direct cell reference and remove unused fields. + (gray_set_cell): Consolidate the linked list management and pointers. + (gray_convert_glyph, gray_convert_glyph_inner): Updated. + +2021-03-10 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (FT_INTEGRATE): New convenience macro. + (gray_render_line, gray_render_scanline): Use it. + +2021-03-09 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (gray_render_line): Rearrange conditionals. + + These produce faster or more optimizable code. + +2021-03-08 Tim-Philipp Müller <tim@centricular.com> + + [meson] Fix 'mmap' handling on Windows. + + * meson.build (ft2_sources): Always use `windows/ftsystem.c` on + Windows unless mmap has been disabled. + + https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/5#note_829289 + +2021-03-07 Tim-Philipp Müller <tim@centricular.com> + + [ci] Add basic support for Meson builds with MSVC on Windows. + + This adds meson jobs for VS2017 (x86 and x86_64). + + * .gitlab-ci.yml: New file. + +2021-03-07 Tim-Philipp Müller <tim@centricular.com> + + [meson] Add subproject fallbacks for 'libpng' and 'zlib'. + + * subprojects/libpng.wrap, subprojects/zlib.wrap: New files. + + * meson.build: Updated. + +2021-03-07 Xavier Claessens <xavier.claessens@collabora.com> + + [meson] Make it work with Windows. + + * meson.build: Do not process `ftconfig.h` when not using + `ftconfig.h.in`. + + Fixes #1029. + +2021-02-25 Werner Lemberg <wl@gnu.org> + + [woff2] Fix memory leak. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28148 + + * src/sfnt/sfwoff2.c (woff2_open_font): Reject fonts that have + multiple tables with the same tag. While not explicitly forbidden + in the OpenType specification, it is implicitly forbidden by + describing a binary search algorithm for tables that only works + reliably if table tags are unique. + +2021-02-22 Werner Lemberg <wl@gnu.org> + + * CMakeLists.txt: Update location of `LICENSE.TXT`. + + Fixes #1035. + +2021-02-19 Werner Lemberg <wl@gnu.org> + + * builds/unix/ax_pthread.m4: Update from 'autoconf-archive'. + + A bunch of fixes were added recently to its git repository. + +2021-02-17 Werner Lemberg <wl@gnu.org> + + [unix] Updates for autoconf 2.71. + + This fixes warnings reported by autoupdate. + + * builds/unix/ax_pthread.m4: Replace `as_echo` with `AS_ECHO`. + + * builds/unix/configure.raw: Remove obsolete `AC_HEADER_STDC`. + Don't escape back quotes in messages for `AC_MSG_WARN`. + +2021-02-16 Werner Lemberg <wl@gnu.org> + + * builds/toplevel.mk: Fix previous commit. + + <top_level>: Use `TOP_DIR` in `wildcard` function. + (check_out_submodule, copy_submodule): Move down to come after + definition of `all` rule. + Call `mkdir` conditionally. + +2021-02-16 Werner Lemberg <wl@gnu.org> + + * builds/toplevel.mk: Use rules for handling 'dlg'. + + Suggested by Alexei. + + (check_out_submodule, copy_submodule): New targets. + <top-level>: Replace calls to `shell` with rules. + +2021-02-16 Werner Lemberg <wl@gnu.org> + + * builds/toplevel.mk: Avoid side effects of `shell`. + + We use a dummy variable to catch its output. Otherwise the `make` + program is going to interpret the return value of `shell`; this can + cause obscure warning or error messages or even be harmful. + +2021-02-16 Werner Lemberg <wl@gnu.org> + + Move 'dlg' submodule to `subprojects` directory. + + This is for future changes with Meson, which doesn't allow a + different name for its `subprojects` directory. Having both a + `submodules` and a `subprojects` directory is confusing. + + * .gitmodules, autogen.sh (copy_submodule_files, DLG_INC_DIR, + DLG_SRC_DIR): Updated. + + * builds/toplevel.mk (<top-level>, do-dist), + builds/windows/vc2010/script.bat: Updated. + + * src/tools/no-copyright: Updated. + +2021-02-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Update paint format values to support non-variable paints. + + * freetype.h (FT_PaintFormat): Update paint format identifiers after + a specification change. The specification was updated to have + sibling formats, variable and non-variable variants for each. + Reflect that here. + + * sfnt/ttcolr.c (read_paint): Remove parsing of variable indices as + the non-variable formats no longer have them. + +2021-02-15 Daniel E <daniel.engberg.lists@pyret.net> + + * CMakeLists.txt: Improve 'bz2' support. + + Not all distributions such as FreeBSD provide a `.pc` file for + '(lib)bz2' so follow autotools and add it to `Libs.private` instead. + +2021-02-13 Werner Lemberg <wl@gnu.org> + + * src/tools/update-copyright-year: Fix single-year entry handling. + + The fix from 2021-01-17 didn't cover the case where the year to be + updated is identical to the current year. + +2021-02-13 Werner Lemberg <wl@gnu.org> + + Add new function `FT_Get_Transform`. + + See + + https://github.com/harfbuzz/harfbuzz/issues/2428 + + for some reasons to introduce this function. + + * include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Transform): + Implement it. + +2021-02-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + Decorate `qsort` callbacks with `cdecl`. + + * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): + Add new macro. + + * src/base/ftrfork.c, src/bdf/bdflib.c, src/gxvalid/gxvcommn.c, + src/psaux/afmparse.c, src/psnames/psmodule.c, src/type1/t1afm.c, + src/sfnt/sfwoff.c, src/sfnt/sfwoff2.c: Update `qsort` callbacks. + + Fixes #1026 when compiling FreeType with an unusual calling + convention while the C library function `qsort` still expects + `cdecl`. + +2021-02-10 Dominik Röttsches <drott@chromium.org> + + [sfnt] Implement 'COLR' v1 sweep gradients. + + * freetype.h (FT_PaintSweepGradient): Add `FT_PaintSweepGradient` to + represent a 'COLR' v1 sweep gradient. + Update format. + (FT_PaintFormat): Update shifted paint formats. + Sync with spec. + * sfnt/ttcolr.c (read_paint): Logic to parse sweep gradients. + Fix struct access in radial gradient implementation. + +2021-02-09 Dominik Röttsches <drott@chromium.org> + + [sfnt] Provide optional root transform for 'COLR' v1 glyph graph. + + * include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): + Additional function argument `root_transform` to control whether + root transform should be returned. + (FT_OpaquePaint): Additional tracking field to denote whether + root transform is to be returned. + * include/freetype/internal/sfnt.h + (TT_Get_Color_Glyph_Paint_Func): Propagate additional argument. + * src/base/ftobjs.c (FT_Get_Color_Glyph_Paint): Ditto. + * src/sfnt/ttcolr.c (tt_face_get_colr_glyph_paint): Return root + transform reflecting the size and tranform configured on + `FT_Face`. + (read_paint): Initialize and track status of insert_root_transform + flag. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + * meson.build: s/freetype2_dep/freetype_dep/. + + Many projects (e.g., fontconfig, cairo) hardcode the `freetype_dep` + variable name to use FreeType as subproject because that was the + variable name in Centricular's Meson port of FreeType. While they + should stop hardcoding that variable name, it does not cost us + anything to keep using that name to ease transition. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + [meson] Fix handling of HarfBuzz library. + + * meson.build (harfbuzz_dep): Do not fall back to HarfBuzz by + default. + + Otherwise it causes a dependency cycle: + + cairo => fontconfig => freetype2 => harfbuzz => cairo + + Meson will still fall back to HarfBuzz subprojects if the `harfbuzz` + option is set to `enabled` instead of `auto` and a + `subprojects/harfbuzz.wrap` file is present. In that case it is the + responsibility of the main project to set the proper options on each + subproject to break the dependency cycle. + + Fixes: #1028. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + [meson] Fix dependency lookup and generate `ftconfig.h`. + + - zlib: If not found on the system, meson can build it as a + subproject. We thus never use the (outdated) zlib support that + comes with FreeType. Doing so has the additional advantage that + the zlib code can be shared with other projects like GLib if both + are subprojects of an application. + - harfbuzz: Build as a subproject if not found on the system. + - 'QUESTION: What if the compiler doesn't support `-D` but uses `/D` + instead as on Windows?' Answer: Meson translate arguments for us. + - visibility: Replace self-made code with meson-specific solution. + + * meson.build (ft2_defines): Rewrite logic to set and handle it. + (process_header_command): New variable, previously called + `ftoption_command`. + (ftoption_command, ftconfig_command): New variables. + (zlib_option): Removed. + (zlib_dep): New variable. + (ft2_deps): Updated. + (harfbuzz_dep): Updated. + (ftconfig_h_in, ftconfig_h): New variables. + (ft2_sources): Updated. + (ft2_lib): Updated, handle visibility. + (summary): Updted. + + * meson_options.txt (zlib): Updated. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + * meson.build: Fix resource compilation on Windows. + + This is copied from GStreamer's meson port of FreeType. + + (ft2_sources): Add both debug and resource file (the latter for + Windows only). + (ft2_debug_src): Removed. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + * meson.build: s/ft2_libtool_version/ft2_pkgconfig_version/. + + (freetype2_dep): Use it. + + `ft2_libtool_version` would be the shared library version, not the + one we should use in file `freetype2.pc`. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + * meson.build: Use `meson.override_dependency`. + + This is a new meson mechanism to avoid other projects to hard-code + the `freetype2_dep` variable name in their build definition. It + also ensures that meson does not mix system and subproject versions + of FreeType inside of the same project. + + Also remove outdated TODO because `declare_dependency` was already + there. + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + * meson.build (bzip2_dep): Simplify. + + We remove `static:false` from `find_library('bz2')`. + + I don't know whether the previous code was a workaround for an old + meson bug, but at least with version >=0.55.0 (which FreeType uses) + it picks the shared library when both are available. + + File `freetype2.pc` still contains the full path to file `libbz2.so` + instead of `-lbz2` – that we need to do this is a meson bug even + present in the current version (0.57.0). + +2021-02-09 Xavier Claessens <xavier.claessens@collabora.com> + + * meson.build: Set project version. + +2021-02-04 Werner Lemberg <wl@gnu.org> + + [base] Fix Netpbm tracing message. + + * src/base/ftobjs.c (FT_Render_Glyph_Internal): Don't emit Netpbm + warning if there is nothing to output. + +2021-02-04 Werner Lemberg <wl@gnu.org> + + * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. + + This ensures good logging output, with all lines having a proper + prefix (if requested). + + This is a continuation of a similar patch from 2020-12-02, which + missed some locations. + +2021-02-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + * builds/unix/configure.raw [mmap]: Restore default path. + + Fixes #1023. + +2021-02-03 Werner Lemberg <wl@gnu.org> + + [psaux] Fix integer overflow. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30154 + + * src/psaux/psblues.c (cf2_blues_capture): Use `SUB_INT32`. + +2021-02-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + * builds/unix/configure.raw [mmap support]: Explicitly handle Windows. + + Fixes #1024. + +2021-01-31 Werner Lemberg <wl@gnu.org> + + * builds/unix/configure.raw [mmap support]: Correctly handle Windows. + + Fixes #1024. + +2021-01-31 Werner Lemberg <wl@gnu.org> + + * builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`. + +2021-01-31 Werner Lemberg <wl@gnu.org> + + Always provide logging API. + + It's easier to have stubs if FT_DEBUG_LOGGING is undefined than to + modify `ftexport.sym` conditionally. + + Problem reported by Alexei. + + * src/base/ftdebug.c: Include `ftlogging.h`. + (FT_Trace_Set_Level, FT_Trace_Set_Default_Level, FT_Set_Log_Handler, + FT_Set_Default_Log_Handler) [!FT_DEBUG_LOGGING]: Provide stubs. + +2021-01-31 Werner Lemberg <wl@gnu.org> + + * builds/unix/configure.raw: Fix typo. + + Bug introduced in Vincent's last commit bb33f03. + + Fixes issue #1021. + +2021-01-27 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftstroke.c (FT_Stroker_EndSubPath): Ignore tiny gaps. + + Fixes bug #1020. + +2021-01-27 Alexei Podtelezhnikov <apodtele@gmail.com> + + [stroker] Minor clean-up. + + * src/base/ftstroke.c (FT_Stroker_{ConicTo,CubicTo}): Reset the last + line length. + (FT_Stroker_EndSubPath): Call `ft_stroker_process_corner'. + +2021-01-27 Vincent Torri <vincent.torri@gmail.com> + + * builds/windows/ftsystem.c: Add shared memory support on Windows. + + * CMakeLists.txt (BASE_SRCS), builds/unix/configure.raw (FTSYS_SRC), + builds/windows/vc2010/freetype.vcxproj, + builds/windows/visualc/freetype.vcproj, meson.build (ft2_sources): + Add it (conditionally). + +2021-01-23 Werner Lemberg <wl@gnu.org> + + Require HarfBuzz 2.0.0. + + This is needed to make commit f1f9705f9 work. + + * CMakeLists.txt (HARFBUZZ_MIN_VERSION), builds/unix/configure.raw + (harfbuzz_pkg), meson.build (harfbuzz_dep): Updated. + +2021-01-22 Alexei Podtelezhnikov <apodtele@gmail.com> + + * autogen.sh: Absorb `version.sed'. + * version.sed: Removed. + +2021-01-19 Alexei Podtelezhnikov <apodtele@gmail.com> + + * srd/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix return value. + +2021-01-15 Nikolaus Waxweiler <madigens@gmail.com> + + [afshaper] Fix hb_ot_tags_from_script deprecation warning. + + * autofit/afshaper.c (af_shaper_get_coverage): Copy the source code + of the function as suggested in + https://github.com/harfbuzz/harfbuzz/issues/2737 and adjust to handle + at most three tags. + +2021-01-17 Werner Lemberg <wl@gnu.org> + + * src/tools/update-copyright-year: Fix single-year entry handling. + +2021-01-16 Alexei Podtelezhnikov <apodtele@gmail.com> + + * builds/unix/unixddef.mk: Remove the second DEVEL_DIR definition. + +2021-01-14 Dominik Röttsches <drott@chromium.org> + + [sfnt] Additional checks for 'colr' table presence. + + * sfnt/ttcolr.c (tt_face_get_colr_glyph_paint, + tt_face_get_colorline_stops, tt_face_get_paint): Additional checks + for whether colr table is present. Prevents crashes when these + methods are called on non-COLR fonts. + +2021-01-13 Dominik Röttsches <drott@chromium.org> + + Add config option to test for 'COLR' v1 support in headers. + + * include/freetype/config/ftoption.h (TT_SUPPORT_COLRV1): New macro + so that clients can test whether the FreeType checkout that they are + building against supports the 'COLR' v1 API. This is intended to be + a temporary solution until 'COLR' v1 support is released in a + FreeType version and such a check can be made by using the version + number instead. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + [base] Fill 'COLR' v1 API templates to make them work (#59703). + + * src/base/ftobjs.c (FT_Get_Color_Glyph_Paint, FT_Get_Paint_Layers, + FT_Get_Paint, FT_Get_Colorline_Stops): Add basic sanity checks, + check for existence of `FT_Face`, check arguments and delegate calls + for the respective 'COLR' v1 API to the SFNT driver. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Register 'COLR' v1 API in driver (#59703). + + * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_Paint_Func, + TT_Get_Paint_Layers_Func, TT_Get_Colorline_Stops_Func, + TT_Get_Paint_Func): New function pointer types. + (SFNT_Interface): Add them. + (FT_DEFINE_SFNT_INTERFACE): Updated. + + * src/sfnt/sfdriver.c (PUT_COLOR_LAYERS_V1): New macro. + (sfnt_interface): Add new function pointers. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Add 'COLR' v1 API to retrieve color layers (#59703). + + * src/sfnt/ttcolr.c (tt_face_get_paint_layers): New function to get + the layers of a `PaintColrLayers` table in the font, using an + `FT_LayerIterator` from an `FT_PaintColrLayers` object retrieved via + `tt_face_get_paint`. + + * src/sfnt/ttcolr.h: Updated. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Add 'COLR' v1 API to iterate color stops (#59703). + + * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): New function to + return the current `FT_ColorStop` object from `FT_ColorStopIterator`. + Also increment the iterator. + + * src/sfnt/ttcolr.h: Updated. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Add API to get actual paint from `FT_OpaquePaint` (#59703). + + * src/sfnt/ttcolr.c (tt_face_get_paint): New function to resolve an + `FT_OpaquePaint` paint reference into an `FT_COLR_Paint` object of a + certain format, which contains the detailed information stored in a + paint of the respective format. + (read_paint): New function to provide the format specific parsing + and to populate the data members of each specific `FT_COLR_Paint` + subtype. + (read_color_line): New function to parse retrieved color line + information into an `FT_ColorLine` object, which has information + about the color line extend mode as well as an + `FT_ColorStopIterator` object. + + * src/sfnt/ttcolr.h: Updated. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + [sfnt] Add API to retrieve 'COLR' v1 root paint (#59703). + + * src/sfnt/ttcolr.c (BaseGlyphV1Record): New structure. + (tt_face_load_colr): Handle version 1 table header. + (find_base_glyph_v1_record): New auxiliary function. + (tt_face_get_colr_glyph_paint): New function to find the root + `FT_OpaquePaint` object for a given glyph ID. + + * src/sfnt/ttcolr.h: Updated. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + Add new methods required for 'COLR' v1 to public API (#59703). + + * include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): New method + for retrieving the root paint object for a color glyph by specifying + a glyph ID. + (FT_Get_Paint_Layers): New method for retrieving the layers of a + `PaintColorGlyph`. + (FT_Get_ColorLine_Stops): New method for retrieving the stops of a + color. + (FT_Get_Paint): New method for resolving an `FT_OpaquePaint` into an + `FT_COLR_Paint` object. + +2020-12-16 Dominik Röttsches <drott@chromium.org> + + Add types required for 'COLR' v1 to public API (#59703). + + * include/freetype/freetype.h (FT_PaintFormat, FT_ColorStopIterator, + FT_ColorIndex, FT_ColorStop, FT_PaintExtend, FT_ColorLine, + FT_Affine23, FT_CompositeMode, FT_OpaquePaint, FT_PaintColrLayers, + FT_PaintSolid, FT_PaintLinearGradient, FT_PaintRadialGradient, + FT_PaintGlyph, FT_PaintColrGlyph, FT_PaintTransformed, + FT_PaintTranslate, FT_PaintRotate, FT_PaintSkew, FT_PaintComposite, + FT_COLR_Paint): Adding structs and enum to represent paint format, + color stop information, gradient extend information, structs to + reference paint offsets, and to define transforms and compositions. + Adding a union type to represent the union of the structs, + distinguished by `FT_PaintFormat`. + +2021-01-10 Werner Lemberg <wl@gnu.org> + + * builds/*: s/BUILD_DIR/PLATFORM_DIR/. + + The old variable name caused confusion. + +2021-01-08 Alexei Podtelezhnikov <apodtele@gmail.com> + + [builds] Revert `FTMODULE_H' changes. + + * builds/toplevel.mk, builds/freetype.mk: Revert changes. + +2021-01-07 Alexei Podtelezhnikov <apodtele@gmail.com> + + [builds/windows] Fix up DLG build with VC++. + + * builds/windows/vc2010/script.bat: Copy headers to include/. + * builds/windows/vc2010/freetype.vcxproj: Remove DLG paths. + +2021-01-07 Alexei Podtelezhnikov <apodtele@gmail.com> + + [builds] Relocate `FTMODULE_H'. + + * builds/toplevel.mk: Place `FTMODULE_H' in include/. + * builds/freetype.mk: Simplify included path. + +2021-01-07 Werner Lemberg <wl@gnu.org> + + Fix ABI incompatibility. + + * include/freetype/ftimage.h (FT_Pixel_Mode): Don't insert + `FT_PIXEL_MODE_GRAY16' but append it. + + * src/base/ftobjs.c (pixel_modes): Updated. + +2021-01-07 Alexei Podtelezhnikov <apodtele@gmail.com> + + [dlg] Move the headers to include/dlg to simplify their use. + + * autogen.sh, builds/toplevel.mk: Copy headers to include/dlg. + * builds/freetype.mk, builds/windows/vc2010/freetype.vcxproj: + Simplify included path. + * include/freetype/internal/ftdebug.h: Simplify #include. + * src/dlg/rules.mk, .gitignore: Updated. + +2021-01-06 Werner Lemberg <wl@gnu.org> + + * meson.build: Add summary. + + Based on a patch from Vincent Torri <vincent.torri@gmail.com>. + +2021-01-06 Torsten Hilbrich <emacs.nolkaf@hilbrich.tk> + + * meson.build: Fix 'png' build option (#59458). + + Without this patch, 'png' is always required. + +2021-01-04 Alexei Podtelezhnikov <apodtele@gmail.com> + + [builds/windows] Add SDF to VC2010 project. + + * builds/windows/vc2010/freetype.vcxproj: Updated; + AfterBuild conveniences. + +2020-12-26 Werner Lemberg <wl@gnu.org> + + [sdf] Use 'counter-clockwise', not 'anti-clockwise'. + + We prefer US nomenclature. + + * src/sdf/ftsdf.c (SDF_Contour_Orientation): + s/SDF_ORIENTATION-ACW/SDF_ORIENTATION_CCW/. + Update all users. + +2020-12-26 Werner Lemberg <wl@gnu.org> + + * src/base/ftobjs.c (pixel_modes): Updated. + +2020-12-26 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Remove custom memory tracker. + + The internal FreeType memory tracker is sufficient. + + * src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER, SDF_MemoryUser, + sdf_alloc, sdf_free, SDF_ALLOC, SDF_FREE, + SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP, + SDF_MEMORY_TRACKER_DONE): Removed. + + s/SDF_ALLOC/FT_ALLOC/. + s/SDF_FREE/FT_FREE/. + + Other updates. + +2020-12-24 Werner Lemberg <wl@gnu.org> + + [sdf] Fix `make multi`. + + * src/sdf/ftsdf.c: Include `ftoutln.h`. + +2020-12-24 Werner Lemberg <wl@gnu.org> + + [sdf] Fix tracing. + + * include/freetype/internal.fttrace.h: Add 'bsdf' component. + + * src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define. + +2020-08-21 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add debugging function. + + * src/sdf/ftsdf.c (sdf_shape_dump): New function. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add 'bsdf' renderer to 'sdf' module. + + * src/sdf/ftsdfrend.c (ft_bsdf_render): New function. + + (ft_bitmap_sdf_renderer_class): New structure. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add interface functions for the 'bsdf' rasterizer. + + * src/sdf/ftsdf.c (bsdf_raster_new, bsdf_raster_reset, + bsdf_raster_set_mode, bsdf_raster_render, bsdf_raster_done): New + functions. + + (ft_bitmap_sdf_raster): New variable. + + * src/sdf/ftsdf.h: Updated. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add function to copy SDF data into output bitmap. + + * src/sdf/ftbsdf.c (finalize_sdf): New function. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add '8-point sequential Euclidean distance mapping' algorithm. + + * src/sdf/ftbsdf.c (compare_neighbor, first_pass, second_pass, + edt8): New functions. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add function to copy source bitmap to distance map. + + * src/sdf/ftbsdf.c (bsdf_init_distance_map): New function. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add functions to compute pixel edge distances. + + * src/sdf/ftbsdf.c (compute_edge_distance, bsdf_approximate_edge): + New functions. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add function to find edge pixels in a grid of alpha values. + + * src/sdf/ftbsdf.c (bsdf_is_edge): New function. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add essential structures for the 'bsdf' rasterizer. + + * src/sdf/ftbsdf.c (ONE): New macro. + (BSDF_TRaster, ED, BSDF_Worker): New structures. + (zero_ed): New constant. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add 'sdf' module to non-gnumake build systems. + + * include/freetype/config/ftmodule.h: Add both the 'sdf' and 'bsdf' + renderers to the list of modules. + + * CMakeLists.txt (BASE_SRCS): Add 'sdf' single-object module. + +2020-08-20 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Added basic overlapping contour support. + + * src/sdf/ftsdf.c (sdf_generate_with_overlaps): New function. + (sdf_raster_render): Enable it. + +2020-08-19 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add build infrastructure. + + * src/sdf/module.mk, src/sdf/rules.mk: New files. + + * src/sdf/ftsdf.h (ft_sdf_raster): New forward declaration. + + * include/freetype/ftmoderr.h (FT_MODERRDEF): Add error definition + for the 'sdf' module. + + * include/freetype/internal/fttrace.h (FT_TRACE_DEF): Add trace + definition for the `sdf' module. + + * modules.cfg (RASTER_MODULES): Add the `sdf' module to the list of + rasterizers. + +2020-08-19 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add interface functions for the 'sdf' rasterizer. + + * src/sdf/ftsdf.c (sdf_raster_new, sdf_raster_reset, + sdf_raster_set_mode, sdf_raster_render, sdf_raster_done): New + functions. + (ft_sdf_raster): New structure. + +2020-08-19 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add subdivision and bounding box optimization. + + * src/sdf/ftsdf.c (sdf_generate_bounding_box): New function, which + is an optimized version of `sdf_generate`. + (sdf_generate_subdivision): New function. + +2020-08-19 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add function to generate SDF. + + * src/sdf/ftsdf.c (sdf_generate): New function, currently disabled. + This is a proof-of-concept implementation: It doesn't use any + optimization, it simply checks all grid points against all contours. + +2020-08-19 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add functions to get shortest distance from any edge/contour. + + * src/sdf/ftsdf.c (sdf_edge_get_min_distance): New function. + (sdf_contour_get_min_distance): New function, currently disabled. + +2020-08-18 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add shortest distance finding functions. + + * src/sdf/ftsdf.c (get_min_distance_line, get_min_distance_conic, + get_min_distance_cubic): New functions. Note that + `get_min_distance_conic` comes with two implementations (using an + analytical and an iterative method, to be controlled with the + `USE_NEWTON_FOR_CONIC` macro). + +2020-08-18 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add function to resolve corner distances. + + * src/sdf/ftsdf.c (resolve_corner): New function. + +2020-08-18 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add essential math functions. + + * src/sdf/ftsdf.c (cube_root, arc_cos) [!USE_NEWTON_FOR_CONIC]: New + auxiliary functions. + + * src/sdf/ftsdf.c (solve_quadratic_equation, solve_cubic_equation) + [!USE_NEWTON_FOR_CONIC]: New functions. + +2020-08-18 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add utility functions for contours. + + * src/sdf/ftsdf.c (get_control_box, get_contour_orientation): New + functions. + (split_conic, split_cubic, split_sdf_conic, split_sdf_cubic, + split_sdf_shape): New functions. + +2020-08-17 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add functions to decompose `FT_Outline`. + + * src/sdf/ftsdf.c (sdf_move_to, sdf_line_to, sdf_conic_to, + sdf_cubic_to): New auxiliary decomposition functions. + (sdf_compose_funcs): New structure. + (sdf_outline_decompose): New function. + +2020-08-17 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Structs, enums, macros, and functions for 'sdf' rasterizer. + + * src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER) + [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New macros. + (SDF_MemoryUser) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New + struct for memory usage tracing. + (sdf_alloc, sdf_free) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New + functions for memory usage tracing. + + (SDF_ALLOC, SDF_FREE): New macros for memory management. + (SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP, + SDF_MEMORY_TRACKER_DONE): New macros to set up memory usage tracing. + + (USE_NEWTON_FOR_CONIC, MAX_NEWTON_DIVISIONS, MAX_NEWTON_STEPS, + CORNER_CHECK_EPSILON, CG_DIMEN): New configuration macros for + controlling the process of finding the shortest distance. + + (MUL_26D6, VEC_26D6_DOT): New auxiliary macros. + + (SDF_TRaster, SDF_Edge, SDF_Contour, SDF_Shape, SDF_Signed_Distance, + SDF_Params): New structs for setting up SDF data. + (SDF_Edge_Type, SDF_Contour_Orientation): New enums for SDF data. + + (zero_vector, null_edge, null_contour, null_shape, max_sdf): Useful + constants. + + (sdf_edge_new, sdf_edge_done, sdf_contour_new, sdf_contour_done, + sdf_shape_new, sdf_shape_done): New constructors and destructors. + +2020-08-17 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add raster parameters structure. + + * src/sdf/ftsdf.h (SDF_Raster_Params): New structure. + + * src/sdf/sdf.c: Include source files in order to make a single + object of the module. + +2020-08-17 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add 'sdf' renderer. + + * src/sdf/ftsdf.c: Add 'sdf' renderer along with its interface + functions. + Also add functions to set and get properties. + +2020-08-17 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add common elements for 'sdf' and 'bsdf' renderers. + + * src/sdf/ftsdfrend.h (SDF_Rendere_Module, ft_sdf_renderer_class, + ft_bitmap_sdf_renderer_class): New structures. + + * src/sdf/ftsdfcommon.h (DEFAULT_SPREAD, MIN_SPREAD_MAX_SPREAD, + USE_SQUARED_DISTANCES): New macros. + (FT_INT_26D6, FT_INT_16D16, FT_26D6_16D16): New macros. + (FT_CALL, VECTOR_LENGTH_16D16): New macros. + (FT_26D6_Vec, FT_16D16_Vec, FT_16D16, FT_26D6, FT_6D10, FT_CBox): + New typedefs. + (square_root): New macro. + + * src/sdf/ftsdferrs.h: Add module error setup. + +2020-08-16 Anuj Verma <anujv@iitbhilai.ac.in> + + [sdf] Add files for new 'sdf' module. + + Here is a breakdown of what the files will contain. + + * src/sdf/ftsdfrend.c, src/sdf/ftsdfrend.h: The 'sdf' and 'bsdf' + renderers. + + * src/sdf/ftsdf.c, src/sdf/ftsdf.h: The rasterizer for the 'sdf' + renderer. + * src/sdf/ftbsdf.c, src/sdf/ftbsdf.h: The rasterizer for the 'bsdf' + renderer. + + * src/sdf/ftsdfcommon.h: Commmon properties and functions for both + rasterizers. + * src/sdf/ftsdferrs.h: Common error defines. + + * src/sdf/sdf.c: For building a single object of the entire module. + +2020-08-16 Anuj Verma <anujv@iitbhilai.ac.in> + + [base] Allow renderers of different formats. + + * src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the + glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`. The forthcoming + 'bsdf' renderer will require bitmaps for processing. + + * src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove + renderer's glyph format check before adding and removing them. The + 'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`. + +2020-08-16 Anuj Verma <anujv@iitbhilai.ac.in> + + Add data types required for the forthcoming 'sdf' module. + + * include/freetype/freetype.h (FT_Render_Mode): Add new render mode + `FT_RENDER_MODE_SDF`, which will be used to generate SDF. + + * include/freetype/ftimage.h (FT_Pixel_Mode): Add new pixel mode + `FT_PIXEL_MODE_GRAY16`, which will be the output of the 'sdf' + module. + (FT_RASTER_FLAG_SDF): New raster flag to be used internally by the + 'sdf' module. + + * include/freetype/fttypes.h (FT_F6Dot10): New data type. + +2020-08-16 Anuj Verma <anujv@iitbhilai.ac.in> + + [base] Allow renderers of different formats. + + * src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the + glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`. The forthcoming + 'bsdf' renderer will require bitmaps for processing. + + * src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove + renderer's glyph format check before adding and removing them. The + 'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`. + +2020-12-23 Werner Lemberg <wl@gnu.org> + + * builds/windows/detect.mk (COPY): Make it work with `shell`. + + Without this patch, we get the error + + builds/toplevel.mk:127: *** missing separator. Stop. + + Reported by Anuj, with a solution from Alexei. + +2020-12-23 Ignacio Casal Quinteiro <qignacio@amazon.com> + + * meson.build (ft2_defines): Fix builds on Windows. + +2020-12-18 Tatsuyuki Ishi <ishitatsuyuki@gmail.com> + + [autofit] Fix double division in stem darkening. + + The old code used to divide the darkening amount by em_ratio twice, + leading to unnecessarily bold stems on certain fonts with higher + units per em (e.g. Inter). This patch fixes it. + + The return value of af_loader_compute_darkening was also changed to + use 16.16 fixed point to get rid of a redundant truncation operation. + This should slightly improve the precision, although it's still + bottlenecked by the emboldening function, which uses 26.6 fixed point. + + * src/autofit/afloader.[ch] + (af_loader_compute_darkening): Return FT_Fixed. + (af_loader_embolden_glyph_in_slot): Revise calculations. + +2020-12-17 Alexei Podtelezhnikov <apodtele@gmail.com> + + * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): New public macro. + + The driver name is needed for `FT_Property_Set' and `FT_Property_Get'. + +2020-12-16 Chris Liddell <chris.liddell@artifex.com> + + [truetype] Fix incremental metrics (#59503). + + * src/truetype/ttgload.c (tt_get_metrics, load_truetype_glyph): + Previously, the code would populate the phantom points before + calling the `get_glyph_metrics` callback. For formats like PCL XL + format 1, class 2 downloaded fonts (where metrics are removed from + the TTF header), this causes problems when the hinting program uses + the phantom points (misplaced and distorted glyphs) due to the + metrics being unset (all zeros). + (tt_get_metrics_incr_overrides): Renamed to... + (tt_get_metrics_incremental): ... this. Updated caller + + * include/freetype/ftincrem.h: Update the documentation to make it + clearer that `get_glyph_metrics` is to retrieve metrics from a + non-standard source, but *not* for the purpose of imposing custom + metrics. + +2020-12-14 Werner Lemberg <wl@gnu.org> + + [type42] Pacify static analysis tools (#59682). + + * src/type42/t42objs.c (T42_Size_Init, T42_GlyphSlot_Init): Avoid + warnings about uninitialized variables. + +2020-12-07 Werner Lemberg <wl@gnu.org> + + * builds/unix/configure.raw: Don't set `FT_DEBUG_LOGGING`. + + All debug options are handled exclusively in `ftoption.h`. + +2020-12-07 Werner Lemberg <wl@gnu.org> + + * src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`. + +2020-12-07 Werner Lemberg <wl@gnu.org> + + */*: s/FT_LOGGING/FT_DEBUG_LOGGING/. + +2020-12-05 Werner Lemberg <wl@gnu.org> + + * builds/toplevel.mk (do-dist): Remove `submodules` directory. + +2020-12-02 Werner Lemberg <wl@gnu.org> + + * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. + + This ensures good logging output, with all lines having a proper + prefix (if requested). + +2020-12-02 Werner Lemberg <wl@gnu.org> + + [base] Don't close 'stderr' after logging. + + * src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit): + Fix it. + +2020-12-02 Werner Lemberg <wl@gnu.org> + + * submodules/dlg: Updated to commit 9f0c8b22. + +2020-12-02 Werner Lemberg <wl@gnu.org> + + * src/bdf/bdflib.c: Fix `-Wformat` warning. + +2020-12-02 Werner Lemberg <wl@gnu.org> + + Improve setup for 'dlg' library. + + * autogen.sh (copy_submodule_file), builds/toplevel.mk: Redirect + stderr to `/dev/null`. + + * builds/toplevel.mk: Move code block to handle 'dlg' stuff into + `check_platform` conditional. + Also fix wildcard expressions for guarding `git submodule` commands. + Also make file copying work with non-Unix platforms (untested). + +2020-12-01 Werner Lemberg <wl@gnu.org> + + [build] Use gcc (and clang) in C99 mode. + + Other compilers are unchanged. + + * builds/compiler/gcc-dev.mk, builds/compiler/gcc.mk (ANSIFLAGS): + s/-ansi/-std=c99/. + + * builds/freetype.mk (FT_CFLAGS): Remove `-std=c99`. + + * builds/unix/configure.raw: Handle C99. + Remove no longer needed test for gcc 4.6 and earlier. + +2020-12-01 Werner Lemberg <wl@gnu.org> + + [dlg] Fix compiler warnings. + + * src/dlg/dlgwrap.c: Duplicate some feature test macros from + `dlg.c`, which must come first before loading standard headers. For + example, `freetype.h` loads `stdio.h` if compiled in debug mode. + +2020-12-01 Werner Lemberg <wl@gnu.org> + + * src/type42/t42parse.c: Fix `-Wformat` warnings. + +2020-12-01 Priyesh Kumar <priyeshkkumar@gmail.com> + + [builds/unix] Check for 'pthread' library. + + * builds/unix/ax_pthread.m4: New file, taken from 'autoconf-archive' + git repository. + + * builds/unix/configure.raw: Check for 'pthread'; also check whether + it works. + +2020-12-01 Werner Lemberg <wl@gnu.org> + + [base] Implement vertical alignment of log printing. + + Based on a patch by Priyesh. + + * include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH): + New macro. + + * src/base/ftdebug.c, builds/windows/ftdebug.c (ft_log_handler): + Print logs after a fixed width to handle different lengths of + `FT_COMPONENT` entries. + Use `ft_strrchr` to check for final newline character. + +2020-11-30 Priyesh Kumar <priyeshkkumar@gmail.com> + + Update logging related documentation. + + * docs/DEBUG: Updates related to `FT_LOGGING`. + + * README.git: Updates related to logging. + +2020-11-30 Priyesh Kumar <priyeshkkumar@gmail.com> + + * src/*: Fix `-Wformat` warnings. + +2020-11-30 Priyesh Kumar <priyeshkkumar@gmail.com> + + [builds/windows] Changes to build 'dlg' with FreeType on Windows. + + We only support Visual C++ 2010 and newer. + + * builds/windows/vc2010/script.bat: New windows batch file to copy + necessary 'dlg' files from `submodules/dlg` to `src/dlg`. This file + is used as a pre-built event in Visual C++. + + * builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`. + + * builds/windows/vc2010/freetype.vcxproj.filters: Add + `src/dlgwrap.c`. + + * builds/windows/vc2010/freetype.vcxproj + (AdditionalIncludeDirectories): Add include files of dlg for 'Debug' + and 'Debug Static' configurations on both 'x64' and 'win32' + platforms. + (PreprocessorDefinitions): Add `FT_LOGGING` for 'Debug' and 'Debug + Static' configurations on both 'x64' and 'win32' platforms. + Add `DLG_STATIC' for 'Debug' configuration on 'x64' and 'win32' + platforms. + (DisableLanguageExtensions): We need to disable the `/Za` option + when building 'dlg' with FreeType as 'dlg' strictly follows the C99 + standard. Visual C++ produces behaves unexpectedly when + compiling a C99 file with `/Za` option enabled. + +2020-11-30 Priyesh Kumar <priyeshkkumar@gmail.com> + + [base] Add public API to change log handling function. + + * include/freetype/ftlogging.h (FT_Custom_Log_Handler): New function + typedef to store the custom callback logging function. + (FT_Set_Log_Handler, FT_Set_Default_Log_Handler): New functions to + set and reset custom log handler. + + * include/freetype/internal/ftdebug.h (custom_output_handler): New + variable to support a custom callback logging function. + (FT_Logging_Callback): A new function typedef to print log using + custom callback logging function, which is set using + `FT_Set_Log_Handler`. + (FT_Log): Use it. + + * src/base/ftdebug.c (FT_Set_Log_Handler, + FT_Set_Default_Log_Handler, FT_Logging_Callback): Add function + definitions. + +2020-11-28 Priyesh Kumar <priyeshkkumar@gmail.com> + + [base] Add public API to change the levels of tracing components. + + * include/freetype/ftlogging.h: New header file. + + * include/freetype/internal/ftdebug.h [FT_LOGGING]: Include + `ftlogging.h`. + + * src/base/ftdebug.c (ft_custom_trace_level): New variable. + (ft_debug_init): Update to support change of levels of tracing + components of FreeType at run-time. + (FT_Trace_Set_Level): New function to change the levels of tracing + components at run-time. + (FT_Trace_Set_Default_Level): New function to reset the levels of + tracing components back to default. + +2020-11-28 Priyesh Kumar <priyeshkkumar@gmail.com> + + [base] Updates to print timestamp and name of `FT_COMPONENT` in logs. + + * include/freetype/internal/ftdebug.h (FT_LOGGING_TAG, + FT_LOGGING_TAG_): New macros to resolve the value of `FT_COMPONENT' + into a string. + (ft_add_tag, ft_remove_tag): New functions to add and remove dlg tags. + + * src/base/ftdebug.c: Add new variables to control the logging of + timestamp and name of `FT_COMPONENT` along with actual logs. + (ft_add_tag, ft_remove_tag): Add function definitions. + (ft_log_handler): Updates to print timestamp and name of + `FT_COMPONENT`. + (ft_debug_init) [FT_LOGGING]: Users can now control the logging of + timestamp and name of `FT_COMPONENT` by adding tags in the + `FT2_DEBUG` environment variable. + +2020-11-27 Priyesh Kumar <priyeshkkumar@gmail.com> + + [base] Add functions and variables to print logs to a file. + + * include/freetype/internal/ftdebug.h: Added dlg's header files. + (FT_LOG): New macro to redirect trace logs to dlg's API's whenever + `FT_LOGGING' is defined. + (ft_logging_init, ft_logging_deinit): New functions to handle + initialization and uninitialization of logging related variables. + (ft_log_handler): New function to handle logs of FreeType. + + * src/base/ftdebug.c: Add necessary logging related variables. + (ft_logging_init, ft_logging_deinit, ft_log_handler): Add function + definitions. + + * src/base/ftinit.c (FT_Init_FreeType) [FT_LOGGING]: Call + `ft_logging_init`. + (FT_Done_FreeType) [FT_LOGGING]: Call `ft_logging_deinit`. + + * src/base/ftobjs.c (FT_New_Library): Call `ft_debug_init` only if + `FT_LOGGING` is not defined. + +2020-11-27 Priyesh Kumar <priyeshkkumar@gmail.com> + + [builds] Necessary changes to make 'dlg' compile. + + * autogen.sh (copy_submodule_files): New script to copy all the + necessary source and include files from `submodules/dlg` to + `src/dlg`. + + * src/dlg/dlgwrap.c: New wrapper file for `src/dlg.c`. It enables + the build of 'dlg' if the `FT_LOGGING` macro is defined. + + * src/dlg/rules.mk: New sub-Makefile. + + * builds/freetype.mk (DLG_DIR): New variable to include the + header files of the 'dlg' library. + (INCLUDES): Add `DLG_DIR`. + (FT_CFLAGS): Add `-std=c99' flag. + Include `src/dlg/rules.mk` file to build 'dlg' library. + (OBJ_S, OBJ_M): Add `DLG_OBJS_M` and `DLG_OBJS_S`. + + * builds/toplevel.mk: For builds directly from the git repository + we need to copy files from `submodule/dlg` to `src/dlg`. + + * include/freetype/config/ftoption.h, devel/ftoption.h (FT_LOGGING): + New macro to enable or disable the logging facility in FreeType. + +2020-11-27 Priyesh Kumar <priyeshkkumar@gmail.com> + + * .gitmodules: Add 'dlg' library's git repository as submodule. + +2020-12-01 Werner Lemberg <wl@gnu.org> + + * src/tools/chktrcmp.py (trace_use_pat): Update to current use. + +2020-11-20 Alexei Podtelezhnikov <apodtele@gmail.com> + + [cff,cid,type1] Demote old engine for lack of CFF2. + + * src/cff/cffobjs.c (cff_driver_init): Always default to Adobe engine. + * src/cid/cidobjs.c (cid_driver_init): Ditto. + * src/type1/t1objs.c (T1_Driver_Init): Ditto. + +2020-11-09 Werner Lemberg <wl@gnu.org> + + * src/type42/t42parse.c (t42_parse_sfnts): More tracing messages. + +2020-11-04 Werner Lemberg <wl@gnu.org> + + * meson.build: Fix .pc file generation. + + For backwards compatibility we need the libtool version, not the .so + number. + + Reported by Nikolaus. + +2020-10-28 Werner Lemberg <wl@gnu.org> + + [truetype] Minor update to forthcoming OpenType 1.8.4 standard. + + * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): Limit + size of `regionCount`. + +2020-10-26 Werner Lemberg <wl@gnu.org> + + * meson.build: Fix 'harfbuzz' and 'brotli' build options (#59347). + + Without this patch, 'harfbuzz' and 'brotli' are always required. + + Patch submitted anonymously in Savannah bug report. + +2020-10-23 Ben Wagner <bungeman@google.com> + + * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak (#59322). + + The issue is that `rows` is allocated but will not be freed in the + event that the call to `png_read_image` fails and calls `longjmp`. + +2020-10-20 Werner Lemberg <wl@gnu.org> + + * Version 2.10.4 released. + ========================== + + + Tag sources with `VER-2-10-4'. + + * docs/VERSION.TXT: Add entry for version 2.10.4. + * docs/CHANGES: 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.10.3/2.10.4/, s/2103/2104/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. + + * builds/unix/configure.raw (version_info): Set to 23:4:17. + * CMakeLists.txt (VERSION_PATCH): Set to 4. + +2020-10-19 Werner Lemberg <wl@gnu.org> + + [sfnt] Fix heap buffer overflow (#59308). + + This is CVE-2020-15999. + + * src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier. + +2020-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++. + +2020-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/sfwoff2.c (Read255UShort): Tweak types to please VC++. + +2020-10-10 Werner Lemberg <wl@gnu.org> + + * Version 2.10.3 released. + ========================== + + + Tag sources with `VER-2-10-3'. + + * docs/VERSION.TXT: Add entry for version 2.10.3. + + * 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.10.2/2.10.3/, s/2102/2103/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. + + * builds/unix/configure.raw (version_info): Set to 23:3:17. + * CMakeLists.txt (VERSION_PATCH): Set to 3. + +2020-09-25 Werner Lemberg <wl@gnu.org> + + [autofit] Synchronize with ttfautohint. + + This corresponds to the following commits in the ttfautohint git + repository: + + bb6842bd3bd437b7b4a7921b0376c860f5e73d18 Typo, formatting. + d5c91ddb1cb310257a3dfe9a8e20e1fc51335faa Add Medefaidrin script. + + * src/autofit/afblue.dat: Add blue zone data for Medefaidrin. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afscript.h: Add Medefaidrin standard characters. + + * src/autofit/afranges.c, src/autofit/afstyles.h: Add Medefaidrin + data. + +2020-09-25 Werner Lemberg <wl@gnu.org> + + Move `scripts/make_distribution_archives.py` to `src/tools`. + + * scr/tools/scripts/make_distribution_archives.py: (_TOP_DIR, + _SCRIPT_DIR): Updated to new location. + (main): s/shutils.copyfile/shutils.copy/ to preserve file + permissions. + (main): Prefix source file paths with `git_dir` while copying files + to allow calls of the script from other places than the top-level + directory. + +2020-09-24 Werner Lemberg <wl@gnu.org> + + * src/cff/cffgload.c (cff_slot_load): Scale `vertBearingY`. + + Towards the end of the the function there is a call to + `FT_Outline_Get_CBox` that retrieves the glyph bbox in scaled units. + That sets `horiBearing{X,Y}` and `vertBearingX` but `vertBearingY` + is left alone, and is not scaled. + + Patch from Eric Muller <emuller@amazon.com>. + +2020-09-24 Werner Lemberg <wl@gnu.org> + + * src/base/ftobjs.c (FT_Load_Glyph): Trace glyph metrics. + +2020-09-22 Werner Lemberg <wl@gnu.org> + + [meson] Move auxiliary scripts to `builds/meson`. + + Suggested by Alexei. + + * scripts/*.py: Move meson scripts to... + * builds/meson/*.py: ... this new location. + + * meson.build: Updated. + +2020-09-21 David Turner <david@freetype.org> + + Add python script for building tarballs. + + * scripts/make_distribution_archives.py: New file. + + This standalone Python script should be equivalent to running `make + dist` with the Make-based build system, with the following minor + differences: + + - Since `make distclean` doesn't always clean up `objs/` properly, + `make dist` archives may contain some stale binaries like + `objs/.libs/libfreetype.so.6` or others. + + - `config.guess` and `config.sub` are not updated unless option + `--gnu-config-dir=DIR` is used to specify the location of these + files. + + - Some bits of the auto-generated reference documentation may + appear in slightly different order, probably due to issues related + to mkdocs and docwriter. + + As an example, the call + + scripts/make_distribution_archives.py /tmp/freetype2-dist + + creates the following files under `/tmp/freetype2-dist`: + + freetype-<version>.tar.gz + freetype-<version>.tar.xz + ft<winversion>.zip + +2020-09-21 Werner Lemberg <wl@gnu.org> + + * scripts/extract_freetype_version.py: Fix regex typos. + +2020-09-21 David Turner <david@freetype.org> + + Add Meson build project file. + + Example usage: + + # Configure Meson build in directory `build-meson` to generate + # release binaries comparable to to the ones from the + # autotools/make build system. + meson setup build-meson \ + --prefix=/usr/local \ + --buildtype=debugoptimized \ + --strip \ + -Db_ndebug=true + + # After configuring the Meson build with the above command, + # compile and install to `/usr/local/`; this includes a pkg-config + # file. + ninja -C build-meson install + + # Alternatively, compile and install to `/tmp/aa/usr/local/...` + # for packaging. + DESTDIR=/tmp/aa ninja -C build-meson install + + # Generate documentation under `build-meson/docs`. + ninja -C build-meson docs + + Library size comparison for stripped `libfreetype.so` generated by + all three build systems: + + - Default build (autotools + libtool): 712 KiB + - CMake build (RelWithDebInfo): 712 KiB + - Meson build: 712 KiB + + + * meson.build: New top-level Meson build file for the library. + + * meson_options.txt: New file. It holds user-selectable options for + the build, which can be printed with `meson configure`, and selected + at `meson setup` or `meson --reconfigure` time with + `-D<option>=<value>`. + + * scripts/parse_modules_cfg.py: A script invoked by `meson.build` to + parse `modules.cfg` and extract important information out of it + (i.e., the list of modules). + + * scripts/process_ftoption_h.py: New script invoked by `meson.build` + to process the original `ftoption.h` file. It enables or disables + configuration macro variables based on the available dependencies. + This is similar to what other build systems are using (i.e., Meson's + `configure_file()` command is not used here). + + * scripts/extract_freetype_version.py: New script invoked by + `meson.build` to extract the FreeType version number from + `<freetype/freetype.h>`. + + * scripts/extract_libtool_version.py: New script invoked by + `meson.build` to extract the libtool `revision_info` data from + `builds/unix/configure.raw`, and to generate the corresponding + shared library suffix. + + * scripts/generate_reference_docs.py: New script invoked by + `meson.build` to generate the FreeType 2 reference documentation + (using the `docwriter` and `mkdocs` packages, which must be already + installed). + +2020-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Improve the second pass (#58373). + + Besides dropout control the second horizontal sweep is supposed to + clean up straight horizontal edges that are mishandled by the first + vertical sweep when a line passes through pixel centers. This line + would present as perfectly aligned span edges in the second sweep. + + * src/raster/ftraster.c (Horizontal_Sweep_Span): Replace the old + implementation with a better one focusing on aligned span edges only. + +2020-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Tune SMART macro (#58352). + + Windows seems to perform smart dropout control at 26.6 precision. + To mimick Windows independent of increased precision, we need to tweak + the macro so that some close calls break down rather than up. + + * src/raster/ftraster.c (SMART): Tweak the macro. + +2020-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> + + [raster] Introduce SMART macro. + + * src/raster/ftraster.c (SMART): New macro for smart dropout rounding. + (Verstical_Sweep_Drop, Horizontal_Sweep_Drop): Use it. + +2020-09-03 Boris Dalstein <dalboris@gmail.com> + + [build] Make CMake install basic version information. + + * CMakeLists.txt: Do it. + +2020-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Reduce Infinality footprint (cont'd). + + * src/truetype/ttinterp.c (Ins_DELTAP): Shrink variable scope. + (Ins_SHPIX, Ins_MIRP): Revise if-logic. + +2020-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Reduce Infinality footprint. + + * src/truetype/ttinterp.c (Ins_SHPIX, Ins_MSIRP, Ins_MIAP, Ins_MDRP, + Ins_MIRP): Shrink variable scopes and consolidate ifdefs. + +2020-09-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Refactor compensation color. + + * src/truetype/ttinterp.h (TT_Round_Func): Change the last argument. + * src/truetype/ttinterp.c (Ins_ROUND, Ins_NROUND, Ins_MDAP, Ins_MIAP, + Ins_MDRP, Ins_MIRP): Move compensation retrieval from here... + (Round_*): ... to here. + * src/truetype/ttobjs.c (tt_size_init_bytecode): Reserve zero + compensation at color index 3. + +2020-08-28 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Don't set target in direct mode. + + * src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Remove assignment. + (ft_smooth_raster_lcd) [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Ditto. + +2020-08-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Limit width. + + Segmentation fault reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24729 + +2020-08-22 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttgload.c (TT_Get_VMetrics): Add tracing message. + +2020-08-05 Alexei Podtelezhnikov <apodtele@gmail.com> + + [truetype] Retain OVERLAP_SIMPLE and OVERLAP_COMPOUND. + + For glyphs with OVERLAP_SIMPLE or OVERLAP_COMPOUND, set + FT_OUTLINE_OVERLAP to render them with direct oversampling, which + mitigates artifacts (see 3bb512bc9f62). + + * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Redefine to rhyme + with OVERLAP_SIMPLE. + * src/base/ftgloadr.c (FT_GlyphLoader_Rewind): Reset outline flags. + * src/truetype/ttgload.c + (TT_Load_Simple_Glyph): Retain OVERLAP_SIMPLE. + (load_truetype_glyph): Retain OVERLAP_COMPOUND. + +2020-08-04 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/truetype/ttgload.c (TT_Load_Glyph): More tracing. + +2020-07-28 Alexei Podtelezhnikov <apodtele@gmail.com> + + Hide internal functions with SunPro. + + * include/freetype/internal/compiler-macros.h + (FT_INTERNAL_FUNCTION_ATTRIBUTE) <__SUNPRO_C>: Define as __hidden. + +2020-07-28 Anuj Verma <anujv@iitbhilai.ac.in> + + Fix static compilation with Visual C. + + * include/freetype/internal/compiler-macros.h + (FT_INTERNAL_FUNCTION_ATTRIBUTE) <_WIN32>: Define as empty. + +2020-07-28 Priyesh Kumar <priyeshkkumar@gmail.com> + + Fix `-Wformat' compiler warnings. + + * src/*: Fix format specifiers. + + * builds/unix/ftsystem.c (FT_Stream_Open): Ditto. + +2020-07-25 Werner Lemberg <wl@gnu.org> + + Fix `-Wformat' compiler warnings. + + Problem reported by Priyesh kumar <priyeshkkumar@gmail.com> + + * src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments + to tracing macro. + + * src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property): + Ditto. + + * src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto. + Reformulate message. + + * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto. + + * src/sfnt/sfwoff2.c (woff2_open_font): Ditto. + Trace table offset, too. + + * src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto. + +2020-07-23 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning. + + Reported by Hin-Tak. + +2020-07-12 Werner Lemberg <wl@gnu.org> + + * builds/unix/configure.raw: Fix inclusion of `ftoption.h'. + +2020-07-07 Werner Lemberg <wl@gnu.org> + + Fix clang warnings. + + * include/freetype/internal/autohint.h + (FT_DECLARE_AUTOHINTER_INTERFACE): New macro. + * src/autofit/afmodule.h: Use it to declare + `af_autofitter_interface'. + + * include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro. + * src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and + `ft_outline_glyph_class'. + + * src/base/ftglyph.c: Include `ftbase.h'. + + * src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'. + + * src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'. + + * src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'. + * src/psaux/psauxmod.h: Declare `afm_parser_funcs', + `t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'. + + * src/pshinter/pshmod.c: Include `pshmod.h'. + + * src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign + conversion. + (compute_ULong_sum): Fix return type. + Fix implicit sign conversion. + (store_points): Fix type of `last_flag', `repeat_count', and `flag'. + Use casts to avoid warnings. + (reconstruct_glyf): Fix implicit sign conversion. + Use cast to avoid warning. + (get_x_mins): Fix implicit sign conversion. + * src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'. + * src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to + declare cmap classes. + + * src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast. + + * src/truetype/ttinterp.c (Ins_MIAP): Fix typo. + +2020-07-07 David Turner <david@freetype.org> + + [build] Really fix multi and C++ builds. + + The following builds were still failing due to previous changes: + + make multi + make multi CC="c++" + make CC="c++" + + This patch fixes the issues, which were missing includes to get the + right macro definitions in multi-build mode. + + Also, `FT_UNUSED' is actually used by third-party code, so move it + back to `public-macros.h' to avoid breaking it. + + * include/freetype/config/public-macros.h (FT_EXPORT): Remove + special definition for C++. + (FT_UNUSED): Define here instead of... + * include/freetype/config/compiler-macros.h: ... here. + (FT_FUNCTION_DECLARATION): Remove special definition for C++. + (FT_LOCAL_ARRAY_DEF): Fix definition. + + * src/cache/ftccback.h, src/lzw/ftzopen.h, src/gxvalid/gxvmort.h, + src/gxvalid/gxvmorx.h: Add `FT_BEGIN_HEADER' and `FT_END_HEADER'. + +2020-07-06 David Turner <david@freetype.org> + + [build] Fix multi and C++ builds. + + The following builds were failing due to previous changes: + + make multi + make multi CC="c++" + + * include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'. + + * include/freetype/config/ftheader.h (FT_BEGIN_HEADER, + FT_END_HEADER): Protect against redefinition. + + * src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h, + src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h, + src/sfnt/woff2tags.h: Include `compiler-macros.h'. + + * src/sfnt/woff2tags.c: Include `woff2tags.h'. + +2020-07-06 Werner Lemberg <wl@gnu.org> + + [psaux] Improve `t1_decoder_parse_metrics' (#58646). + + * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy + corresponding code from old engine's `t1_decoder_parse_charstrings' + function to handle `op_callsubr' and `op_return'. + +2020-07-05 David Turner <david@freetype.org> + + [build] Improve visibility support of library function names. + + * include/freetype/config/public-macros.h + (FT_PUBLIC_FUNCTION_ATTRIBUTE): New macro to tag functions as + public (and thus exportable). + (FT_EXPORT): Use it. + + * include/freetype/config/compiler-macros.h + (FT_INTERNAL_FUNCTION_ATTRIBUTE): New macro to tag functions as + internal to the library (and thus hidden). Note that on ELF + systems, all internal functions have hidden visibility, which avoids + the need to enforce this when invoking the compiler (e.g., with an + option like `-fvisibility=hidden'). + + (FT_FUNCTION_DECLARATION, FT_FUNCTION_DEFINITION): New base macros + to deal with C and C++ linkage issues at the same time. + + (FT_LOCAL, FT_LOCAL_DEF, FT_LOCAL_ARRAY, FT_LOCAL_ARRAY_DEF, + FT_BASE, FT_BASE_DEF, FT_EXPORT_VAR, FT_BASE_CALLBACK, + FT_BASE_CALLBACK_DEF): Redefined using new macros. + +2020-07-05 David Turner <david@freetype.org> + + [build] Split off more stuff from `ftconfig.h'. + + * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h, + include/freetype/config/ftconfig.h: Split off macro definitions + required by the FreeType API headers to... + * include/freetype/config/public-macros.h: ...this new file. + + * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h, + include/freetype/config/ftconfig.h: Split off macro definitions used + by the library but not to be exposed to clients to... + * include/freetype/config/compiler-macros.h: ...this new file. + + * include/freetype/internal/*.h, src/raster/ftraster.h: Include + `compiler-macros.h' where needed. + +2020-07-05 David Turner <david@freetype.org> + + [build] Move mac support code to `mac-support.h'. + + * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h, + include/freetype/config/ftconfig.h: Split off mac-specific stuff + to... + * include/freetype/config/mac-support.h: ...this new file. + + * CMakeLists.txt, builds/unix/configure.raw: Remove `/undef -> + #undef' string replacement; the affected code is no longer part of + the `ftconfig.h' template. + +2020-07-05 David Turner <david@freetype.org> + + [build] Put integer type definitions into `integer-types.h'. + + Refactor some of the `ftconfig.h' headers and template to move the + definition of the FreeType integer types (e.g., `FT_Int16') to a + common header file `freetype/config/integer-types.h'. + + * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h, + include/freetype/config/ftconfig.h: Split off integer type + definition stuff to... + * include/freetype/config/integer-types.h: ...this new file. + + * builds/unix/ftconfig.h.in: Control the definition of + `FT_SIZEOF_INT' and `FT_SIZEOF_LONG' with macro + `FT_USE_AUTOCONF_SIZEOF_TYPES'. If these are not defined, auto + detection happens in `integer-types.h' as usual based on `INTXX_MAX' + values. Otherwise the autoconf-detected values are used. + + * builds/unix/configure.raw (CPPFLAGS): Don't include path to + `config' directory. Instead, ... + (FT_CONFIG_STANDARD_LIBRARY_H): Use complete path. + +2020-07-05 David Turner <david@freetype.org> + + [build] Rename `build/unix/ftconfig.in' to `ftconfig.h.in'. + + Since we are no longer limited to 8.3 file names, it is simpler to + follow the usual conventions for template files. + + * builds/unix/ftconfig.in: Renamed to... + * builds/unix/ftconfig.h.in: ...this. + + * CMakeLists.txt, builds/unix/configure.raw: Updated. + +2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Introduce direct oversampling for overlaps. + + This implements oversampling to mitigate artifacts in pixels partially + covered by overlapping contours. It turns out that the 4x4 + oversampling is sufficient but, at least, quadruples the rendering + time. The outline has to set FT_OUTLINE_OVERLAP to use this method. + + * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): New flag. + * src/smooth/ftsmooth.c (ft_smooth_render): Check it to... + (ft_smooth_raster_overlap): ... inflate outline and set up direct + rendering for oversampling with... + (ft_smooth_overlap_spans): ... new span function that integrates them. + +2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Use direct rendering mode in Harmony. + + Instead of rendering 3 bitmaps side by side and reshuffling, we use + direct rendering to deliver the bitmaps on each third byte. + + * src/smooth/ftsmooth.c (ft_smooth_raster_lcd) + [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Set up direct mode with... + (ft_smooth_lcd_spans): ... new span function. + +2020-07-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Separate LCD paths from gray rendering. + + This makes `ft_smooth_render' a lot smaller and easier to follow. It + also cleanly separates Harmony and ClearType-style LCD rendering + algorithms. Now I only wish to move LCD filtering and geometry from + FT_Library to FT_Renderer. + + * src/smooth/ftsmooth.c (ft_smooth_render): Move LCD code from here... + (ft_smooth_raster_lcd, ft_smooth_raster_lcdv): ... to here. + [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Reorganize #ifdef's. + +2020-06-20 Sebastian Rasmussen <sebras@gmail.com> + + [cff] Fix handling of `style_name == NULL' (#58630). + + * src/cff/cffobjs.c (cff_face_init): If a call to `cff_strcpy' fails + by returning NULL in `cff_face_init', `remove_style' is still + called. This means that the NULL pointer is dereferenced, causing a + crash. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [cff] Fix another two memory leaks (#58629). + + * src/cff/cffobjs.c (cff_size_init): If a call to `funcs->create' + fails to allocate one of the `internal->subfont' variables, make + sure to free `internal->topfont' and any successfully allocated + subfonts. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [psaux] Fix memory leak (#58626). + + * src/psaux/psstack.c (cf2_stack_init): If `cf2_stack_init' fails to + allocate the stack, return error early. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [base] Fix memory leak (#58624). + + * src/base/ftobjs.c (FT_New_Size): Avoid trying to free + `size->internal' unless `size' has been allocated. This mistake + appeared in the fix for issue #58611. + +2020-06-19 Alexei Podtelezhnikov <apodtele@gmail.com> + + [base] Rework d1180b5f9598 until further notice. + + * src/base/ftoutln.c (FT_Outline_Get_Orientation): Reject large + outlines. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [cff, cid] Fix segfaults in case of error (#58621). + + * src/cff/cffobjs.c (cff_slot_done), src/cid/cidobjs.c + (cid_slot_done): If `ft_glyphslot_init' fails to allocate + `internal', then the class' `done_slot' callback (called by + `ft_glyphslot_done') must not dereference the pointer to `internal'. + +2020-06-19 Werner Lemberg <wl@gnu.org> + + [base] Fix UBSAN error. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23166 + + * src/base/ftoutln.c (FT_Outline_Get_Orientation): Avoid values + larger than 32 bits. + +2020-06-19 Werner Lemberg <wl@gnu.org> + + [woff2] Fix segfault. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23402 + + * src/sfnt/sfwoff2.c (get_x_mins): Check whether `loca' table + exists. + +2020-06-19 Stephen McDowell <svenevs.dev@gmail.com> + + [sfnt] Support Intel compilers. + + * src/sfnt/pngshim.c (premultiply_data): Intel compilers do not + currently support `__builtin_shuffle'. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [base] Fix memory leak (#58611). + + * src/base/ftobjs.c (FT_New_Size): When the call to `clazz->init_size' + fails, make sure to free `size->internal'. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [cff] Fix memory leak (#58610). + + * src/cff/cffobjs.c (cff_size_init): When the call to + `funcs->create' fails, make sure to free `internal'. + +2020-06-19 Werner Lemberg <wl@gnu.org> + + * src/cff/cffload.c (cff_index_get_pointers): Rename `t' to `tbl'. + +2020-06-19 Sebastian Rasmussen <sebras@gmail.com> + + [cff] Free table upon error allocating other data (#58609). + + * src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails + to allocate, make sure to free the table. Do the same for both + allocations if there is a later error. + +2020-06-13 Werner Lemberg <wl@gnu.org> + + Remove redundant inclusion of `ft2build.h'. + + * */*: Remove `#include <ft2build.h>' where possible. + + * include/freetype/freetype.h: Remove cpp error about missing + inclusion of `ft2build.h'. + +2020-06-08 David Turner <david@freetype.org> + + Make macros for header file names optional. + + We no longer have to take care of the 8.3 file name limit; this + allows us (a) to introduce longer, meaningful file names, and (b) to + avoid macro names in `#include' lines altogether since some + compilers (most notably Visual C++) doesn't support this properly. + + */*: Replace + + #include FOO_H + + with + + #include <freetype/foo.h> + + or something similar. Also update the documentation. + +2020-06-02 Werner Lemberg <wl@gnu.org> + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Trace number of cmaps. + +2020-05-18 David Turner <david@freetype.org> + + Remove obsolete HAVE_STDINT_H probing macro. + + This macro was updated by the unix configure script and the + `CMakeLists.txt' one, but is never used in the source tree (nor is + <stdint.h> included anywhere). + + * CMakeLists.txt, builds/unix/ftconfig.in: Don't handle + `HAVE_STDINT_H'. + +2020-05-18 David Turner <david@freetype.org> + + Remove Jamfile files from the tree. + + These have not been used in a very, very long time, so better remove + them. A corresponding patch will be submitted to the + `freetype2-demos' repository. + + * src/Jamfile, src/*/Jamfile, Jamrules: Delete. + +2020-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Turn on LCD filtering during FreeType initialization. + + * src/smooth/ftsmooth.c (ft_smooth_init): Enable LCD filtering. + + * include/freetype/ftlcdfil.h: Document it, remove patent warnings. + * include/freetype/freetype.h (FT_Render_Mode): Updated. + * include/freetype/config/ftoption.h, devel/ftoption.h + [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Do not mention patents. + +2020-05-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Stop using dedicated LCD modules and classes. + + The LCD modules were never truly independent. They mostly served as + a way to disable patented LCD rendering, which is no longer necessary. + The `smooth' module now handles LCD modes as well. + + * src/smooth/ftsmooth.c (ft_smooth_lcd_renderer_class. + ft_smooth_lcdv_renderer_class): Deleted. + (ft_render_smooth): Reworked from `ft_render_smooth_generic'. + * src/smooth/ftsmooth.h: Remove dedicated LCD classes. + * src/smooth/module.mk: Remove dedicated LCD modules. + * include/freetype/config/ftmodule.h: Ditto. + * builds/amiga/include/config/ftmodule.h: Ditto. + * include/freetype/ftmodapi.h: Do not mention LCD modules. + +2020-05-09 Werner Lemberg <wl@gnu.org> + + * Version 2.10.2 released. + ========================== + + + Tag sources with `VER-2-10-2'. + + * docs/VERSION.TXT: Add entry for version 2.10.2. + + * README, Jamfile (RefDoc), 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.10.1/2.10.2/, s/2101/2102/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. + + * builds/unix/configure.raw (version_info): Set to 23:2:17. + * CMakeLists.txt (VERSION_PATCH): Set to 2. + + * docs/CHANGES: Updated. + +2020-05-08 Jakub Alba <jalba@vewd.com> + + * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#58319). + + The font that exceeds the old limit is Icono Regular, version + 1.00000. + +2020-05-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + * builds/freetype.mk: Refactor for readability. + +2020-05-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + [builds] Clean up Windows CE project files. + + Remove version from filenames that caused a lot of polution in the + release process. Use VERSIONINFO resource instead. + + * builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2008-ce/freetype.vcproj, + builds/windows/visualce/freetype.vcproj, + builds/windows/visualce/freetype.dsp: s/2101//g, but add `ftver.rc'. + * builds/wince/vc2008-ce/index.html, + builds/wince/vc2005-ce/index.html, + builds/windows/visualce/index.html: s/2101//g. + +2020-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + * devel/ft2build.h: Override FT_CONFIG_MODULES_H here as well. + +2020-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + [builds/unix] Consolidate marco overrides (for the demos to see them). + + * builds/unix/unix-cc.in (FT_CONFIG_MODULES_H, FT_CONFIG_OPTIONS_H): + Override them here... + * builds/freetype.mk: ... instead of here. + +2020-04-08 Werner Lemberg <wl@gnu.org> + + Allow setting `CC' in Unix build (#58051). + + * builds/unix/unix-cc.in (CC): Use `override'. The command line + value of `CC' (if any) is stored already in `CCraw'. + +2020-04-04 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Return if single stream operation fails. + + * src/sfnt/sfwoff2.c (get_x_mins): Do it. + + * src/sfnt/woff2tags.c: Remove unused include. + +2020-03-22 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [docs] Fix building docs if `srcdir' != `builddir'. + + `docs/reference/*' was moved one directory up in commit 237fed6. + + * builds/unix/unix-def.in (PIP): Remove variable. + + * configure: Create `docs' directory and copy assets from + `docs/markdown'. + + * docs/README: Output directory is `reference'. + +2020-03-21 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [docwriter] Drop support for Python < 3.5. + + Python versions < 3.5 have reached end-of-life and as such, no + security or bug fixes will be provided for those versions. See + + https://devguide.python.org/#status-of-python-branches + + for more information. + + * Jamfile (RefDoc): Add `site' parameter. + + * builds/detect.mk (std_setup): Update Python version requirement. + + * builds/freetype.mk (refdoc-venv): Use pip as `python -m pip'. + + * builds/unix/ax_compare_version.m4, + builds/unix/ax_prog_python_version.m4: Macros to detect Python + version. New files. + + * builds/unix/configure.raw: Check for Python >= 3.5 and remove + check for `pip'. + + * docs/CHANGES, docs/INSTALL.GNU, docs/README: Updated. + +2020-03-02 Moazin Khatti <moazinkhatri@gmail.com> + + [gzip] Support `gzip' encoded header conditionally. + + In order to support `gzip' encoded header the call to + `inflateInit2' was modified in commit 6a92b1fadde26477a9179. + However, this code breaks with the outdated internal version + of zlib. This is a temporary fix to conditionally support + `gzip' encoded header whenever a system installation of zlib + is being used. + + Problem report in + + https://lists.nongnu.org/archive/html/freetype-devel/2020-02/msg00023.html + + * src/gzip/ftgzip.c (FT_Gzip_Uncompress): Change the the call to + `inflateInit2' depending on whether the system installation is + being used or the internal copy. + +2020-02-29 Ben Wagner <bungeman@google.com> + + [truetype] Fix state of `FT_Face' for buggy `gvar' tables (#57923). + + By resetting the blend as implemented with this commit fonts with + invalid `gvar' tables may keep calling into `ft_var_load_gvar' from + `tt_set_mm_blend' and failing, but the font was invalid anyway and + we want to keep seeing the failure in `tt_set_mm_blend'. + + * src/truetype/ttgxvar.c (ft_var_load_gvar): Calculate length of + offset array once. + Allocate arrays after `FT_FRAME_ENTER' (extra check before + allocating and avoid needing to free array later if error entering + frame). + Always call `FT_FRAME_EXIT'. + Consistently set counts immediately after array initialized. + Reset the blend (particularly `blend->glyphoffsets') on failure. + +2020-03-01 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [docs] Update docwriter stylesheet. + + This change is required to support docwriter 1.2.1. + + See + + https://github.com/freetype/docwriter/issues/36 + + for more information. + + * docs/markdown/stylesheets/extra.css: + (.md-typeset code) -> (.md-typeset pre>code) + (pre) -> (pre>code) + (p, .md-typeset p, h4): Remove commented styles. + (table.index): Remove unused styles. + +2020-02-28 Ben Wagner <bungeman@google.com> + + [truetype] Add better checks for loading `gvar' table (#57905). + + * src/truetype/ttgxvar.c (ft_var_load_gvar): Delay settings of any + `blend->xxxcount' values until the corresponding data has been + checked. + Also do some sanitizing to avoid a too early exit. + + (TT_Vary_Apply_Glyph_Deltas): Improve tracing message. + +2020-02-27 Werner Lemberg <wl@gnu.org> + + Make `FT_HAS_*' and `FT_IS_*' really return true (#57906). + + * include/freetype/freetype.h (FT_HAS_*, FT_IS_*): Implement it. + +2020-02-25 Dominik Röttsches <drott@chromium.org> + + Fix for CFF space glyph regression (#57541). + + * src/psaux/psft.c (cf2_decoder_parse_substrings): Replace early-out + with FT_OFFSET. + +2020-02-22 Werner Lemberg <wl@gnu.org> + + [woff2] Fix font table access. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20778 + + * src/sfnt/sfwoff2.c (get_x_mins): Explicitly check for presence of + `head' table, which might not have been processed yet. + +2020-02-21 Werner Lemberg <wl@gnu.org> + + [psaux] Make `t1_decoder_parse_metrics' handle `op_div' (#57519). + + * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy + corresponding code from old engine's `t1_decoder_parse_charstrings' + function. + +2020-02-19 Nikolaus Waxweiler <nikolaus.waxweiler@daltonmaag.com> + + [autofit] Add support for Hanifi Rohingya script. + + * src/autofit/afblue.dat: Add blue zone data for Hanifi Rohingya. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afscript.h: Add Hanifi Rohingya standard character. + + * src/autofit/afranges.c, src/autofit/afstyles.h: Add Hanifi + Rohingya data. + +2020-02-19 Werner Lemberg <wl@gnu.org> + + Require HarfBuzz 1.8. + + * builds/unix/configure.raw, CMakeLists.txt: Request HarfBuzz 1.8.0 + or newer. + + We are going to add auto-hinter support for Hanifi Rohingya, which + was introduced in Unicode 11.0. + +2020-02-12 Werner Lemberg <wl@gnu.org> + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Ignore version (#57708). + +2020-02-04 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#57732). + + The font that exceeds the old limit is Constantine, version 1.001. + +2020-01-04 Werner Lemberg <wl@gnu.org> + + [base] Fix `FREETYPE_PROPERTIES=type1:hinting-engine=adobe`. + + * src/base/ftpsprop.c (ps_property_set) [hinting-engine]: Avoid an + incorrect return value that caused a warning. The function did the + right thing, though. + +2020-01-03 Werner Lemberg <wl@gnu.org> + + [woff2] Fix memory leaks and a runtime warning. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19773 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18101 + + * src/sfnt/sfwoff2.c (compute_ULong_sum): Add missing cast. + (reconstruct_hmtx): Add missing deallocation calls. + +2020-01-02 Dominik Röttsches <drott@chromium.org> + + [truetype] Fix UBSan warning on offset to nullptr (#57501). + + * src/truetype/ttinterp.c (Ins_CALL): Fail if `exc->FDefs' is null. + +2019-12-31 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Allow bitmap-only fonts (#57394). + + * src/sfnt/sfwoff2.c (reconstruct_font): Fix test for `glyf' and + `loca' tables. + +2019-12-21 Hugh McMaster <hugh.mcmaster@outlook.com> + + [docs] (2/2) Fix generation of API documentation (#56745). + + Creating the API Reference in the (new) `reference' sub-directory is + consistent with other documentation sub-topics, such as `design', + `glyphs' and `tutorial'. + + This patch fixes broken hyperlinks in the documentation pointing to + and from the API Reference. It also allows web assets to load from + their relative paths. + + * builds/freetype.mk (DOC_DIR): Adjust. + (refdoc, refdoc-venv): Add `--site' argument. + + * builds/toplevel.mk (do-dist): Updated. + +2019-12-21 Hugh McMaster <hugh.mcmaster@outlook.com> + + [docs] (1/2) Move static web assets (#56745). + + * docs/reference/*: Move ... + * docs: ... one directory up. + +2019-12-21 Dominik Röttsches <drott@chromium.org> + + Fix more UBSan warnings on adding offset to nullptr (#57432). + + * src/truetype/ttinterp.c (Ins_LOOPCALL), src/psaux/psft.c + (cf2_initLocalRegionBuffer): Use `FT_OFFSET'. + +2019-12-16 Werner Lemberg <wl@gnu.org> + + [truetype] Fix UBSan warnings on adding offsets to nullptr. + + Reported as + + https://bugs.chromium.org/p/chromium/issues/detail?id=1032152 + + * src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Use `FT_OFFSET'. + +2019-12-14 Werner Lemberg <wl@gnu.org> + + [truetype] Fix integer overflow. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19305 + + * src/truetype/ttinterp.c (Ins_MIRP): Use `ADD_LONG'. + +2019-12-13 Werner Lemberg <wl@gnu.org> + + Another bunch of UBSan warnings on adding offsets to nullptr. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19427 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19433 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19441 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19451 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19452 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19457 + + * src/autofit/aflatin.c (af_latin_hints_compute_segments, + af_latin_hints_compute_edges): Use `FT_OFFSET'. + + * src/base/ftstream.c (FT_Stream_EnterFrame): Use `FT_OFFSET'. + + * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Exit early + if there is no charstring. + + * src/psaux/psobjs.c (t1_decrypt): Use `FT_OFFSET'. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Exit early for + zero bitmap dimensions. + +2019-12-09 Dominik Röttsches <drott@chromium.org> + + Fix more UBSan warnings on adding offset to nullptr (#57384). + + * src/smooth/ftsmooth.c (ft_smooth_render_generic), + src/psaux/psobjs.c (ps_table_add): Use `FT_OFFSET'. + +2019-12-05 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttinterp.c (TT_RunIns): Use `FT_OFFSET'. + + Reported as + + https://bugs.chromium.org/p/chromium/issues/detail?id=1030614 + +2019-12-03 Werner Lemberg <wl@gnu.org> + + More nullptr offset UBSan warnings (#57331, #57347). + + * src/autofit/afcjk.c (af_cjk_hints_compute_segments), + src/psaux/psft.c (cf2_getSeacComponent), src/truetype/ttinterp.c + (Ins_UNKNOWN): Use `FT_OFFSET'. + +2019-11-29 Dominik Röttsches <drott@chromium.org> + + Avoid more nullptr offset UBSan warnings (#57316). + + * src/base/ftoutln.c (FT_Outline_Transform): Bail on empty points. + * src/cff/cffload.c (cff_subfont_load): Use `FT_OFFSET'. + * src/psaux/psft.c (cf2_decoder_parse_substrings): Early out if + `charstring_base' or `charstring_len' are null. + * src/sfnt/ttload.c (tt_face_load_name): Use `FT_OFFSET'. + +2019-11-23 John Stracke <jstracke@Google.com> + + [base] Really fix #57194. + + Apply accidentally missed second part of patch. + + * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Call + `FT_GlyphLoader_CreateExtra'. + +2019-11-23 Werner Lemberg <wl@gnu.org> + + [truetype] Avoid sanitizer warning (#57289). + + * src/truetype/ttpload.c (tt_face_get_device_metrics): Use + `FT_OFFSET'. + +2019-11-23 Armin Hasitzka <prince.cherusker@gmail.com> + + [truetype] Fix integer overflow (#57287). + + * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'. + +2019-11-23 Ben Wagner <bungeman@google.com> + + [sfnt] Avoid sanitizer warning (#57286). + + * src/sfnt/ttcmap.c (tt_face_build_cmaps): Avoid possible `NULL + + offset' computation. + Tag `table' as `const'. + +2019-11-23 John Stracke <jstracke@Google.com> + Werner Lemberg <wl@gnu.org> + + [base] Fix `NULL + offset' sanitizer warnings (#57194). + + * src/base/ftgloadr.c (FT_GlyphLoader_Adjust_Points, + FT_GlyphLoader_Adjust_Subglyphs): Use `FT_OFFSET'. + (FT_GlyphLoader_CreateExtra): Add short cut if some values are zero. + +2019-11-23 Werner Lemberg <wl@gnu.org> + + * include/freetype/internal/ftmemory.h (FT_OFFSET): New macro. + + Use this for `base + offset' pointer calculations where `base' can + be NULL (triggering a sanitizer warning even if the resulting + pointer gets never dereferenced since it is undefined behaviour + in C). + + Suggested by Ben Wagner. + +2019-11-23 Ben Wagner <bungeman@google.com> + + [sfnt] Ensure OTTO fonts have tables (#57285). + + * src/sfnt/ttload.c (tt_face_load_font_dir): Add test. + +2019-11-23 Behdad Esfahbod <behdad@behdad.org> + + Minor fixes for recent compilers. + + * src/gzip/infutil.h (inflate_mask): Add `const'. + + * src/autofit/aflatin2.c: Include `ft2build.h'. + +2019-11-07 Nikolaus Waxweiler <madigens@gmail.com> + + * CMakeLists.txt: Minor additions to the notes, compile + builds/unix/ftsystem.c instead of src/base/ftsystem.c on UNIX. + + The latter change is based on the code proposed by rim in #55235. + +2019-10-25 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_open_font): Check `num_fonts' for TTCs. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18494 + +2019-10-22 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_open_font): Avoid undefined shift. + + Also improve tracing. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18390 + +2019-10-10 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/sfnt/pngshim.c (premultiply_data): Optimize for __SSE__ only. + +2019-10-10 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (reconstruct_glyf): Check `triplet_size'. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18108 + +2019-10-09 John Tytgat <John.Tytgat@esko.com> + + [cff] Fix FT_FACE_FLAG_GLYPH_NAMES for CFF2 based fonts (#57023). + + * src/cff/cffobjs.c (cff_face_init): Don't set + FT_FACE_FLAG_GLYPH_NAMES for CFF2 based fonts. + +2019-10-08 Werner Lemberg <wl@gnu.org> + + [woff2] Fix SFNT table checks. + + Also reduce number of SFNT table lookups. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18065 + + * include/freetype/internal/wofftypes.h (WOFF2_InfoRec): Add fields + `glyf_table', `loca_table', and `head_table'. + + * src/sfnt/sfwoff2.c (reconstruct_glyf): Update signature. + Use table pointers in `info' parameter. + (get_x_mins): Check `maxp_table' + Use table pointers in `info' parameter. + (reconstruct_font): Use and set table pointers in `info' parameter. + Fix check for `glyf' and `loca' tables. + Update call to `reconstruct_glyf'. + (woff2_open_font): Updated. + +2019-10-06 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (reconstruct_glyf): Fix reallocation. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18046 + +2019-10-06 Werner Lemberg <wl@gnu.org> + + Improve memory debugging. + + * include/freetype/internal/ftmemory.h (FT_MEM_FREE): Use + `FT_DEBUG_INNER' to set source code file name and line. + + * src/base/ftdbgmem.c (ft_mem_table_remove): Better formatting of + tracing message. + +2019-10-03 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2 (reconstruct_font): Fix reallocation. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17966 + +2019-10-01 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftstroke.c (ft_stroker_inside): Speed up. + +2019-10-01 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2 (woff2_open_font): Initialize `woff2.ttc_fonts'. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17804 + +2019-09-30 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (reconstruct_font): Fix memory leak. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17812 + +2019-09-30 Werner Lemberg <wl@gnu.org> + + [woff2] Reject fonts without `head' table. + + Also fix memory deallocation in case of error. + + `head' problem reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17820 + + * src/sfnt/sfwoff2.c (reconstruct_glyf): Don't use `stream_close'. + Abort if `head_table' is NULL. + Don't free `transformed_buf' in case of error. + (woff2_open_font): Don't set `uncompressed_buf' to NULL. + +2019-09-29 Werner Lemberg <wl@gnu.org> + + [woff2] Fix compiler warnings. + + Problem reported by Alexei. + + * src/sfnt/sfwoff2.c (reconstruct_glyf): Initialize `x_min'. + (reconstruct_font): Initialize `num_hmetrics'. + (woff2_open_font): Initialize `info'. + +2019-09-28 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_open_font): Fix sanity check. + + Correct thinkos in patch from 2019-09-01. + +2019-09-28 Werner Lemberg <wl@gnu.org> + + [woff2] Fix memory leaks. + + One of them reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17766 + + * src/sfnt/sfwoff2.c (woff2_open_font): Free `info->x_mins' and + `woff2->ttc_fonts'. + + (reconstruct_glyf): Initialize `info->x_mins'. + +2019-09-27 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftstroke.c (ft_stroker_cap): Speed up caps. + +2019-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftstroke.c (ft_stroker_outside): Speed up clipped miter. + * include/freetype/ftstroke.h: Wordsmith miter docs. + +2019-09-25 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_open_font): Check (sum of) table sizes. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17684 + +2019-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftstroke.c (ft_stroke_border_arcto): Speed up calculations. + +2019-09-20 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Fix memory leaks. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16896 + + * src/sfnt/sfwoff2.c (woff2_open_font): Fix error handling. + Free `uncompressed_buf'. + (reconstruct_font): Free `transformed_buf'. + +2019-09-17 Werner Lemberg <wl@gnu.org> + + * src/otvalid/otvcommon.c (otv_Coverage_get_last): Guard `count'. + + Problem reported by Marc Schönefeld <marc.schoenefeld@gmx.org>. + +2019-09-17 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_open_font): Check table index. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17100 + +2019-09-15 Avi Halachmi (:avih) <avihpit@yahoo.com> + + [cmake] Don't fail if brotli is missing (#56894). + + The libs which cmake controls are commented out at + + include/freetype/config/ftoption.h + + and cmake un-comment each enabled library, but the brotli option was + not commented out, therefore `FT_CONFIG_OPTION_USE_BROTLI' remained + defined even if brotli was missing/disabled/etc. + + Comment it such that cmake can control it, which means leaving it + undefined if brotli is missing. + + * include/freetype/config/ftoption.h: Fix typo. + +2019-09-05 Werner Lemberg <wl@gnu.org> + + [cmake] Add brotli support. + + * CMakeLists.txt (FT_WITH_BROTLI): New option. + + * builds/cmake/FindBrotliDec.cmake: New file. + +2019-09-05 Werner Lemberg <wl@gnu.org> + + Fix handling of `AF_CONFIG_OPTION_INDIC'. + + * devel/ftoption.h, include/freetype/config/ftoption.h: + `AF_CONFIG_OPTION_INDIC' needs `AF_CONFIG_OPTION_CJK'. + +2019-09-05 Werner Lemberg <wl@gnu.org> + + CMakeLists.txt: Fix generation of DLL related stuff (#56852). + + Extract `version_info' variable from `builds/unix/configure.raw' and + use the data to correctly set `LIBRARY_VERSION' and + `LIBRARY_SOVERSION'. + + Also use the data to set `ft_version' field in `freetype2.pc'. + Also fix the needed minimum version of HarfBuzz in `freetype2.pc'. + +2019-09-03 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (compute_ULong_sum): Fix undefined shift. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16933 + +2019-09-01 Werner Lemberg <wl@gnu.org> + + * src/sfnt/sfwoff2.c (woff2_open_font): Add sanity check. + + Don't trust `totalSfntSize' unconditionally. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16893 + +2019-08-27 Dominik Röttsches <drott@chromium.org> + + [woff2] Don't use `FT_UInt64' (#56815). + + * src/sfnt/sfwoff2.c (woff2_open_font): Use `FT_UInt32' for + `file_offset'. This fixes builds on platforms where `FT_LONG64' is + not defined while still being sufficient to store a file offset. + +2019-08-27 Werner Lemberg <wl@gnu.org> + + [truetype] Prevent crash in `TT_Set_Named_Instance' (#56813). + + * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Fix error + handling. + +2019-08-27 Werner Lemberg <wl@gnu.org> + + [woff2] Fix compiler warnings. + + * src/sfnt/sfwoff2.c (read_num_hmetrics): Remove unused argument + `table_len'. + Update caller. + (triplet_decode, compute_bbox, store_loca, reconstruct_glyf): Make + `i' variable unsigned. + (reconstruct_glyph): Remove condition which is always false. + (reconstruct_html): Removed unused argument `transformed_size'. + Update caller. + + * src/sfnt/woff2tags.c (woff2_known_tags): Remove condition which is + always false. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Check whether known tag is in array bounds. + + If table tag is not 0x3f, we expect a value between 0 and 62. If + this is not the case, exit with errors. + + * src/sfnt/sfwoff2/c: Check whether table tag makes sense. + + * src/sfnt/woff2tags.c: Return 0 if tag is out of bounds. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + * src/sfnt/sfwoff2.c: Improve trace comments. + + Adjust tracing levels for comments, and more formatting. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Support `hmtx' reconstruction when `glyf' is untransformed. + + `reconstruct_hmtx' requires `info->x_mins' and `info->num_glyphs' to + reconstruct the hmtx table. In case glyf is not transformed, we + call `get_x_mins' which does the necessary work. + + * src/sfnt/sfwoff2.c (get_x_mins): New function. + (reconstruct_font): Call get_x_mins. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [sfnt] Support `face->num_faces' for WOFF2 fonts. + + Set correct value of `face->num_faces' for WOFF2 fonts. This is + being handled separately because we only load the tables for the + requested font face in `woff2_open_font' and create a single-face + sfnt stream. + + The full discussion is at: + + https://lists.gnu.org/archive/html/freetype-devel/2019-08/msg00000.html + + * src/sfnt/sfobjs.c (sfnt_open_font): Add parameter + `woff2_num_faces'. + (sfnt_init_face): Introduce variable `woff2_num_faces', and change + `face->root.num_faces' if `woff2_num_faces' is set. + + * src/sfnt/sfwoff2.c (woff2_open_font): Validate requested face + index and handle negative face indices. + + * src/sfnt/sfwoff2.h (woff2_open_font): Add parameter `num_faces' to + declaration. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Improve memory and error handling. + + Free up memory after use, and improve error handling. + + * src/sfnt/sfwoff2.c (reconstruct_font, woff2_open_font): Implement + changes. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Avoid too many calls to `FT_REALLOC'. + + We do this by using `totalSfntSize' as an initial reference, and + extending the buffer when required. This reduces rendering time + considerably. + + * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add + `totalSfntSize', rename `total_sfnt_size' to `actual_sfnt_size'. + + * src/sfnt/sfwoff2.c (write_buf): Add parameter `dst_size' to keep + track of and update total size of stream. + + (WRITE_SFNT_BUF, WRITE_SFNT_BUF_AT): Modify macros accordingly. + + (pad4, store_loca, reconstruct_glyf, reconstruct_hmtx, + reconstruct_font): Update parameters to accept `sfnt_size'. + + (woff2_open_font): Add variable `sfnt_size'. Use WOFF2 header field + `totalSfntSize' as initial reference (if value makes sense) and + allocate `totalSfntSize' bytes for the sfnt stream. `write_buf' + handles reallocation if and when required. Also resize the stream + to `actual_sfnt_size' after reconstruction. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Reconstruct `loca', `hmtx', and swap out stream. + + Add necessary functions to reconstruct loca and hmtx tables (the two + remaining tables that can have a transform). `woff2_open_font' is + now capable of loading a woff2 font face. This code may still need + more refining and better memory management. + + * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add total + (final) size of sfnt stream. + + (WOFF2_InfoRec): Add header checksum value. + + * src/sfnt/sfobjs.c (sfnt_open_font): Change `face_instance_index' + parameter to its pointer so its value can be modified by + `woff2_open_font'. + + * src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF_AT): New macro to write into + sfnt buffer at given position. + + (write_buf): Add parameter `extend_buf' which allows caller to + specify whether buffer should be reallocated before copying data. + + (WRITE_SFNT_BUF): Updated. + + (pad4, store_loca, reconstruct_htmx): New functions. + + (reconstruct_glyf): Calculate loca values and store them. + + (reconstruct_font): Call `reconstruct_hmtx', write table record + entries, and calculate table checksums. Also calculate font + checksum and update `checksumAdjustment' entry in head table. + + (woff2_open_font): Open stream for sfnt buffer, swap out input + stream and return. + + * src/sfnt/sfwoff2.h (woff2_open_font): Modify parameter to accept + pointer to `face_index'. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Reconstruct transformed `glyf' table. + + Reconstruct `glyf' table if it is transformed in the uncompressed + table stream. Also add necessary structures, macros and functions. + + * include/freetype/internal/wofftypes.h (WOFF2_InfoRec, + WOFF2_SubstreamRec, WOFF2_PointRec): New structures. + (WOFF2_TableRec): s/OrigLength/dst_length/. + + * src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use + `FT_SET_ERROR' to set implicit `error' variable. + + (WRITE_SHORT): New macro. + + (N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM, + COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to + refer to substreams of the transformed `glyf' tables. + + (Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX' + macros. + + (with_sign, safe_int_addition): New functions to add sign to values + based on a flag and perform safe addition respectively. + + (triplet_decode): Decode variable-length (flag, xCoordinate, + yCoordinate) triplet for a simple glyph. See + + https://www.w3.org/TR/WOFF2/#triplet_decoding + + (store_points, compute_bbox, composteGlyph_size, reconstruct_glyf): + New functions. + + (reconstruct_font): Call `reconstruct_glyf'. + + * src/sfnt/sfwoff2.h: Add required constants. + + * src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Copy un-transformed tables to sfnt stream. + + Copy un-transformed tables to the sfnt stream. + + * src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF): New macro. + (write_buf): New function. Extend memory of `dst' buffer and copy + bytes from `src'. + (compute_ULong_sum): New function. Calculate checksum of table. + (reconstruct_font): Change `FT_Byte* sfnt' to `FT_Byte** + sfnt_bytes'. This has been done because we reallocate memory to + `sfnt' multiple times, which may change the pointer value of `sfnt'. + This new pointer must be propogated back to the caller. Same reason + for using a double pointer in `write_buf'. + + * src/sfnt/woff2tags.h (WOFF2_DEFAULT_MAX_SIZE): New macro used for + overflow checking. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Create stream for uncompressed buffer. + + Uncompressed buffer is now an `FT_Stream'. + + Perform basic checks and start iterating over tables. + + * src/sfnt/sfwoff2.c (stream_close, find_table, read_num_hmetrics): + New functions. + (reconstruct_font): Modify parameters and iterate over tables. + (woff2_open_font): Updated. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Handle TTCs and start reconstructing font. + + We `handle' TTCs by modifying the `indices' array to point to only + those tables that are part of the requested `face_index'. + + Set and use `num_tables' in `WOFF2_TtcFont'. + + * src/sfnt/sfwoff2.c (reconstruct_font): New function. + (woff2_open_font): Start reconstruction of font. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Get known tags from function. + + Change `KnownTags' to a function (`woff2_known_tags'). This avoids + introducing a global constant array. This function returns the + specified index without *any* checks. The caller must ensure that + `index' is within array limits. + + * src/sfnt/sfwoff2.c (woff2_open_font): Change `KnownTags[...]' + notation to `woff2_known_tags( ... )'. + + * src/sfnt/woff2tags.c: Perform changes. + + * src/sfnt/woff2tags.h: Update definitions. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Minor. + + * src/sfnt/sfwoff2.c (woff2_uncompress): Add error message + (woff2_open_font): Free `uncompressed_buf'. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Uncompress Brotli streams and `face_index' support. + + WOFF2 compressed stream is now uncompressed if Brotli is available. + This data is stored in a separate buffer (uncompressed_buf) because + it does not contain direct table data. Certain tables have + transformations applied to them, and they must be reconstructed + before we can write those tables to the SFNT stream. + + `face_index' is now being passed as a parameter to + `woff2_open_font'. + + * src/sfnt/sfobjs.c (sfnt_open_font): Add parameter + `face_instance_index'. + + * src/sfnt/sfwoff2.c (woff2_uncompress): New function. + (woff2_open_font): Call `woff2_uncompress'. + (compute_first_table_offset): Fix return type. + + * src/sfnt/sfwoff2.h (woff2_open_font): Modify declaration. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + * builds/unix/configure.raw: Change argument name to `brotli'. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + Add Brotli dependency and required checks. + + Brotli is required for decompressing WOFF2 font directory streams. + The library is thus being added as an optional dependency for + FreeType. + + * builds/unix/configure.raw: Add checks for `libbrotlidec'. + (REQUIRES_PRIVATE, LIBS_PRIVATE, LIBSSTATIC_CONFIG): Updated. + + * devel/ftoption.h, include/freetype/config/ftoption.h + (FT_CONFIG_OPTION_USE_BROTLI): New macro. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Write SFNT Offset table. + + * src/sfnt/sfwoff2.c (WRITE_USHORT, WRITE_ULONG): New macros. + (compare_tags): New function. + (woff2_open_font): Implement it. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + * src/sfnt/sfwoff2.c: #undef macros. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [woff2] Read table and collection directory. + + * include/freetype/internal/wofftypes.h (WOFF2_TtcFontRec): New + structure. + (WOFF2_HeaderRec): Add more fields. + + * src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128, ROUND4): New + macros. + (Read255UShort, CollectionHeaderSize, compute_first_table_offset): + New functions. + (ReadBase128): Use `FT_READ_BYTE'. + (woff2_open_font): Add functionality to read table directory and + collection directory (if present). + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [sfnt] Include `woff2tags.c' for building. + + * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `woff2tags.c'. + + * src/sfnt/sfnt.c: Include `woff2tags.c'. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [sfnt] Add WOFF2 constants. + + Add constants required for WOFF2, and known table tags as defined in + the specification. See + + https://www.w3.org/TR/WOFF2/#table_dir_format + + for details. + + * src/sfnt/woff2tags.c, src/sfnt/woff2tags.h: New files. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [sfnt] Read WOFF 2 header. + + Check for WOFF2 tag, call `woff2_open_font', and implement it to read + header according to specification. + + * include/freetype/internal/fttrace.h: Add `sfwoff2.c'. + + * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `sfwoff2.c'. + + * src/sfnt/sfnt.c: Include `sfwoff2.c'. + + * src/sfnt/sfobjs.c (sfnt_open_font): Check for `wOF2' tag and call + `woff2_open_font'. + + * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h: New files. + +2019-08-27 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + Add structures for WOFF2. + + Add structures and macro for WOFF 2 header and table directory. + + * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec, + WOFF2_TableRec_): New structures. + + * include/freetype/tttags.h (TTAG_wOF2): New macro. + +2019-08-26 Werner Lemberg <wl@gnu.org> + + * src/psaux/cffdecode.c (cff_operator_seac): Fix numeric overflow. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16470 + +2019-08-26 Werner Lemberg <wl@gnu.org> + + [type1] Fix `FT_Get_Var_Axis_Flags' (#56804). + + * src/type1/t1load.c (T1_Get_MM_Var): Allocate space for axis flags. + Also remove redundant assignment. + +2019-07-24 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/base/ftbbox.c (cubic_peak): Sanitize left shift (#56586). + +2019-07-22 Weiyi Wu <w1w2y3@gmail.com> + + * src/cid/cidload.c (cid_hex_to_binary): Fix typo (#56653). + +2019-07-12 Werner Lemberg <wl@gnu.org> + + [sfnt, winfonts] Avoid memory leaks in case of error (#56587). + + * src/sfnt/sfwoff.c (woff_open_font): Call `FT_FRAME_EXIT' in case + of error. + + * src/winfonts/winfnt.c (fnt_face_get_dll_font): Ditto. + +2019-07-12 Ben Wagner <bungeman@google.com> + + Properly handle phantom points for variation fonts (#56601). + + * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Scale phantom + points if HVAR and/or VVAR is present. + +2019-07-04 Werner Lemberg <wl@gnu.org> + + [psaux] (2/2) Handle fonts that use SEAC for ligatures (#56580). + + The same as previous commit but for the old engine. + + * src/psaux/t1decode.c (t1operator_seac): Implement it. + +2019-07-04 Chris Liddell <chris.liddell@artifex.com> + + [psaux] (1/2) Handle fonts that use SEAC for ligatures (#56580). + + As originally intended, a Type 1 SEAC charstring would be used for + an accented glyph (like `acaron' or `uumlaut'), where the advance + width of the SEAC glyph is the same as that of the `base' glyph + (like `a' or `u'). In this case it is not uncommon for the SEAC + glyph to not use an (H)SBW opcode of its own but to rely on the + value from the base glyph. + + However, out-of-spec fonts also use SEAC glyphs for ligatures (like + `oe' or `fi'), and in those cases the overall advance width is + greater than that of the `base' glyph. For this reason we have to + allow that the SEAC glyph can have an (H)SBW value of its own, and + if it has, retain this value, rather than the one from the base + glyph. + + * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escSEAC>: + Implement it. + +2019-07-01 Werner Lemberg <wl@gnu.org> + + * Version 2.10.1 released. + ========================== + + + Tag sources with `VER-2-10-1'. + + * docs/VERSION.TXT: Add entry for version 2.10.1. + + * README, Jamfile (RefDoc), src/base/ftver.rc, + 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.10.0/2.10.1/, s/2100/2101/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. + + * builds/unix/configure.raw (version_info): Set to 23:1:17. + * CMakeLists.txt (VERSION_PATCH): Set to 1. + + * include/freetype/fterrors.h (FT_Error_String): Fix C++ compilation. + +2019-06-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Fix inequality. + + Reported by Armin Hasitzka. + +2019-06-16 Werner Lemberg <wl@gnu.org> + + * src/tools/apinames.c: Formatting, minor edits. + +2019-06-16 Werner Lemberg <wl@gnu.org> + + [autofit] Disable hinting if no blue zones are available (#56450). + + * src/autofit/afglobal.c (af_face_global_get_metrics): Start again + (with dummy hinter module) if no blue zones are present. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Change + signature to return error code. + If no blue zones are found, update `glyph_styles' array to hold + AF_STYLE_NONE_DFLT instead of the current style. + (af_latin_metrics_init): Return internal error code if no blue zones + are found. + +2019-06-16 Werner Lemberg <wl@gnu.org> + + Towards better VMS support. + + More to come. + + * builds/vms/LIBS.OPT_IA64, builds/vms/_LINK.OPT_IA64, + builds/vms/vmslib.dat: New files provided by Jouk Jansen + <joukj@hrem.nano.tudelft.nl>. + + * builds/vms/ftconfig.h: Update, also from Jouk. + +2019-06-13 Werner Lemberg <wl@gnu.org> + + * src/autofit/aflatin.c (af_latin_metrics_init_widths): Minor. + +2019-06-13 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Restore the span buffering for direct mode only. + + The buffer size FT_MAX_GRAY_SPANS is set to 10 spans, which should be + enough to cover the entire scanline for simple glyphs in most cases: + each slightly slanted edge needs up to two spans, plus a filling span + in-between. This is not new, we used to do it before cb4388783cecc. + + * src/smooth/ftgrays.c (gray_TWorker): Add `spans' and `num_spans'. + (gray_hline, gray_sweep): Implement the span buffering. + (gray_raster_render): Use negative `num_spans' to avoid the direct + mode. + +2019-06-12 Alexei Podtelezhnikov <apodtele@gmail.com> + + * include/freetype/ftmodapi.h (FT_DebugHook_Func): Return error. + + Fix a warning by adding a return value as in `TT_RunIns', + which should not be a compatibility issue. + +2019-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/truetype/ttobjs.c (tt_check_trickyness_family): Add `const'. + +2019-06-11 Moazin Khatti <moazinkhatri@gmail.com> + + [gzip] Add support for `gzip' encoded header. + + * src/gzip/ftgzip.c (FT_Gzip_Uncompress): Modify the the call to + `inflateInit2' to enable support for `gzip' encoded headers. + +2019-06-10 Alexei Podtelezhnikov <apodtele@gmail.com> + + [type1,type42] Use `const' for string literals. + + * include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated. + * include/freetype/internal/t1types.h (T1_EncodingRec): Updated. + * src/psaux/psobjs.[ch] (ps_table_add): Updated. + * src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated. + * src/type42/t42objs.c (T42_Open_Face): Updated. + * src/type42/t42parse.c (t42_parse_encoding): Updated. + + * src/cff/cffobjs.c (cff_face_init): Minor. + +2019-06-10 Alexei Podtelezhnikov <apodtele@gmail.com> + + [bdf,pcf] Use `const' for string literals. + + * src/bdf/bdf.h (bdf_property_t): Updated `name'. + * src/bdf/bdflib.c (_bdf_list_split,bdf_create_property, + _bdf_add_property,_bdf_ato*): Updated. + * src/bdf/bdfdrivr.c (bdf_interpret_style): Updated. + * src/pcf/pcfread.c (pcf_intrpret_style): Ditto. + +2019-06-07 Philip Race <philip.race@oracle.com> + + * src/base/ftinit.c (FT_Set_Default_Properties): Fix crash. + + Terminate loop at end of environment. + +2019-05-31 Alexei Podtelezhnikov <apodtele@gmail.com> + + Solidify VC2005 builds. + + * include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Explicitly + declare `_BitScanReverse' intrinsic. + * builds/windows/visualc/freetype.vcproj [Debug]: Disable intrinsics. + +2019-05-30 Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com> + + [sfnt] Separate WOFF sources and headers. + + Move WOFF sources and headers to separate files. + + * include/freetype/internal/wofftypes.h, src/sfnt/sfwoff.c, + src/sfnt/sfwoff.h: New files. + + * include/freetype/internal/fttrace.h: Register `sfwoff.c'. + + * include/freetype/internal/internal.h: Define + FT_INTERNAL_WOFF_TYPES_H. + + * include/freetype/internal/sfnt.h: Include FT_INTERNAL_WOFF_TYPES_H. + + * include/freetype/internal/tttypes.h: Move out WOFF structures. + + * src/sfnt/rules.mk: Add `sfwoff.c'. + + * src/sfnt/sfnt.c: Include `sfwoff.c'. + + * src/sfnt/sfobjs.c: Include `sfwoff.h', move out WOFF sources. + +2019-05-30 Werner Lemberg <wl@gnu.org> + + [base] Fix `make multi'. + + Reported by Nikhil. + + * src/base/fterrors.c: Include FT_INTERNAL_DEBUG_H. + +2019-05-29 Ben Wagner <bungeman@google.com> + + [truetype] Fix copy-and-paste error (#56409). + + * src/truetype/ttgload.c (load_truetype_glyph): Use correct indices + into `unrounded' array for phantom points. + +2019-05-29 Werner Lemberg <wl@gnu.org> + + [truetype] Fix 32bit builds (#56404). + + Patch suggested by Ben Wagner <bungeman@google.com>. + + * src/truetype/ttgxvar.c (FT_fixedToInt, FT_fixedToFdot6): Remove + harmful cast to unsigned type. + +2019-05-26 Ben Wagner <bungeman@google.com> + + * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Improve accuracy. + +2019-05-23 Werner Lemberg <wl@gnu.org> + + [truetype] Draw glyphs without deltas in variation font (#56374). + + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Always fill + `unrounded' array. + +2019-05-21 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttinterp.c (opcode_name): Improve mnemonics. + +2019-05-16 Werner Lemberg <wl@gnu.org> + + [truetype] Actually scale varied CVT values. + + Up to now, only the unscaled CVT values were varied; in other words, + the `CVAR' data was never used for bytecode hinting. + + * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): New auxiliary + function. + (tt_face_vary_cvt): Use it to trigger rescaling of CVT values. + +2019-05-16 Werner Lemberg <wl@gnu.org> + + [truetype] Use 26.6 format for storing unscaled CVT values. + + If `CVAR' data is applied to variation fonts, fractional values are + possible. + + * include/freetype/internal/tttypes.h (TT_FaceRec): Change type of + `cvt' from `FT_Short' to `FT_Int32'. + + * src/truetype/ttgxvar.c (FT_fdot6ToFixed): New macro. + (tt_face_vary_cvt): Use it to update code to 26.6 format. + + * src/truetype/ttobjs.c (tt_size_run_prep): Update code to 26.6 + format. + + * src/truetype/ttpload.c (tt_face_load_cvt): Stora data in 26.6 + format. + +2019-05-16 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttgload.c (load_truetype_glyph): Init `unrounded'. + + This fixes linear advance width values for spacing glyphs. Bug + introduced 2019-05-09. + +2019-05-16 Werner Lemberg <wl@gnu.org> + + [truetype] Avoid code duplication. + + * src/truetype/ttobjs.c (tt_size_run_prep): Scale CVT values in this + function. + (tt_size_ready_bytecode): Updated. + * src/truetype/ttgload.c (tt_loader_init): Updated. + +2019-05-13 Jouk Jansen <joukj@hrem.nano.tudelft.nl> + + * vms_make.com: Updated. Handle `bzip2' directory, too. + +2019-05-13 Werner Lemberg <wl@gnu.org> + + * src/psaux/psfont.c (cf2_font_setup): Fix compiler warning. + +2019-05-12 Werner Lemberg <wl@gnu.org> + + [truetype] Doh. Fix last commit to make it work. + + Very embarassing :-) + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14701 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14705 + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14710 + + * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): Move up and add + argument; update all callers. + (TT_Process_Simple_Glyph): Use it. The `unrounded' array is active + for variation fonts only, thus also enclose related code with + `#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT ... #endif' where + necessary. + Revert commit a113e5d from 2019-05-09, and don't use `extra_points2' + but allocate a temporary array. + Speed up the scaling of the `unrounded' array. + + * src/truetype/ttgxvar.c (FT_fixedToInt, FT_FixedToFdot6): Fix type + conversions and rounding. The unsigned type must have more or equal + bits to the signed type. + +2019-05-09 Werner Lemberg <wl@gnu.org> + + [truetype] Increase precision of font variation (#54371). + + This patch makes FreeType use font units in 26.6 format internally + instead of integers. + + * src/truetype/ttgxvar.c (FT_fixedToFdot6): New macro. + (TT_Vary_Apply_Glyph_Deltas): Add argument to output unrounded font + coordinates. + * src/truetype/ttgxvar.h: Updated. + + * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Use + `extra_points2' array to temporarily hold unrounded point + coordinates; use them to compute scaled coordinates and linear + advance width and height. + (load_truetype_code): Adjust similarly. + +2019-05-09 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Minor. + +2019-05-08 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Faster fractions. + + * src/smooth/ftgrays.c (SUBPIXELS): Replace with... + (FRACT): A fractional coordinate macro to use in... + (gray_render_line, gray_render_scanline): ... here. + +2019-05-07 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/raster/ftraster.c (Draw_Sweep): Unbreak. + +2019-05-05 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/raster/ftraster.c: Clean-ups. + +2019-05-05 Werner Lemberg <wl@gnu.org> + + * src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'. + +2019-05-04 Alexei Podtelezhnikov <apodtele@gmail.com> + + * src/smooth/ftgrays.c (gray_render_line): Small shortcut. + +2019-05-04 Werner Lemberg <wl@gnu.org> + + Various clang 8.0 static analyzer fixes. + + Reported by Sender Ghost <lightside@gmx.com>. + + * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Catch a corner + case where `edge->first' could be NULL. + + * src/pfr/pfrobjs.c (pfr_slot_load): Remove unnecessary test of + `size'. + + * src/raster/ftraster.c (Draw_Sweep): Catch a corner case where + `draw_right' might be NULL. + + * src/sfnt/ttmtx.c (tt_face_get_metrics): Fix limit test for + `aadvance'. + Ensure `abearing' always hold a meaningful result. + + * src/truetype/ttgload.c (load_truetype_glyph): Ensure `subglyph' is + not NULL before accessing it. + * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Remove unnecessary + test of `namedstyle'. + + * src/type42/t42parse.c (t42_parser_done): Ensure + `parser->root.funcs.done' is not NULL before accessing it. + +2019-05-03 Alexei Podtelezhnikov <apodtele@gmail.com> + + Miscellaneous macro updates. + + * src/base/ftoutln.c (SCALED): Updated. + * src/smooth/ftgrays.c (SCALED): Ditto. + (FLOOR, ROUND, CEILING): Removed. + * src/psaux/psfixed.h (cf2_fracToFixed): Updated. + +2019-05-02 Alexei Podtelezhnikov <apodtele@gmail.com> + + Tweak LCD filtering. + + * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy): + Choose direction from bitmap's pixel_mode. + * include/freetype/internal/ftobjs.c (FT_Bitmap_LcdFilterFunc): + Updated. + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Updated. + +2019-05-02 Werner Lemberg <wl@gnu.org> + + * vms_make.com: Updated (#56253). + + Remove no longer existing directories (`autohint', `otlayout'). + Update used base extensions. + Activate `autofit' module. + Add `gxvalid' module. + Update copyright notices. + +2019-04-29 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Simplify cubic Bézier flattening. + + The previous implementation is correct but it is too complex. + The revised algorithm is based on the fact that each split moves + the control points closer to the trisection points on the chord. + The corresponding distances are good surrogates for the curve + deviation from the straight line. + + This cubic flattening algorithm is somewhat similar to the conic + algorithm based the distance from the control point to the middle of + the chord. The cubic distances, however, decrease less predictably + but are easy enough to calculate on each step. + + The new algorithm produces slightly larger number of splits, which is + compensated by its simplicity. The overall rendering performance is + improved by 1-2%. The larger number of splits does not necessarily + result in higher quality, which stays comparable. + + * src/smooth/ftgrays.c (gray_render_cubic): Replace the split + condition. + +2019-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Bithacks and cosmetics. + + * src/smooth/ftgrays.c (gray_record_cell, gray_set_cell, gray_hline, + gray_render_conic, gray_convert_glyph_inner): Updated. + +2019-04-25 Alexei Podtelezhnikov <apodtele@gmail.com> + + Optimize Bézier bisections. + + This change makes bisections faster by 20-30%. When inlined into + `gray_render_cubic', this makes the function faster by 10% and is + noticeable in the overall rendering performance. + + * src/raster/ftraster.c (Split_Conic, Split_Cubic): Use shifts and + refactor. + * src/smooth/ftgrays.c (gray_split_conic, gray_split_cubic): Ditto. + * src/base/ftstroke.c (ft_conic_split, ft_cubic_split): Ditto. + * src/base/ftbbox.c (cubic_peak): Use shifts. + +2019-04-23 Werner Lemberg <wl@gnu.org> + + * src/sfnt/ttcmap.c (tt_cmap12_next): Remove dead code. + + Found by clang 8.0's static analyzer and reported by Sender Ghost + <lightside@gmx.com>. + +2019-04-23 Werner Lemberg <wl@gnu.org> + + [base] Fix thinko in previous commit. + + * src/base/ftbitmap.c (FT_Bitmap_Blend): Check final width, not + target pitch. + + Problem reported by Sender Ghost <lightside@gmx.com>. + +2019-04-22 Werner Lemberg <wl@gnu.org> + + * src/base/ftbitmap.c (FT_Bitmap_Blend): Check target pitch. + + Problem reported by Sender Ghost <lightside@gmx.com>. + +2019-04-22 Werner Lemberg <wl@gnu.org> + + Fix return value of `FT_Set_Named_Instance' (#56186). + + * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Correctly handle + internal return value -1 of `TT_Set_Var_Design'. + +2019-04-18 Werner Lemberg <wl@gnu.org> + + [pcf] Fix handling of undefined glyph (#56067). + + This commit fixes the changes from 2018-07-21, which broke charmap + iteration. We now add the default character as a new glyph with + index 0, thus increasing the number of glyphs by one (as before). + + * src/pcf/pcfread.c (pcf_get_metrics): Adjust to new artificial + glyph with index 0. + Limit number of elements to 65534. + (pcf_get_bitmaps): Ditto. + Unify two loops into one; this avoids allocation of an intermediate + array. + (pcf_get_encodings): Don't flip indices but copy glyph metrics of + default character to index 0. + Also handle invalid default character. + + * docs/CHANGES: Updated. + +2019-04-15 Minmin Gong <gongminmin@msn.com> + + * CMakeLists.txt: Avoid rewriting of unchanged configuration files. + + Reported as + + https://savannah.nongnu.org/patch/index.php?9755 + +2019-04-15 JDG <JonathanG@iQmetrix.com> + + * src/tools/apinames.c (main): Fix error message. + + Reported as + + https://savannah.nongnu.org/patch/?9796 + +2019-04-11 Alexei Podtelezhnikov <apodtele@gmail.com> + + [smooth] Fix segfault in direct mode (#56092). + + * src/base/ftoutln.c (FT_Outline_Render): Set missing clip_box for + direct mode. + * src/smooth/ftgrays.c (gray_raster_render): Use it. + +2019-04-06 Werner Lemberg <wl@gnu.org> + + * src/sfnt/ttcmap.c (tt_get_glyph_name): Pacify compiler (#56061). + + This is for Visual Studio 2019 on ARM. + +2019-04-06 Werner Lemberg <wl@gnu.org> + + For distribution, replace `.tar.bz2' with `.tar.xz' bundles. + + * builds/toplevel.mk (build): Do it. + + * README, docs/CHANGES, docs/release: Updated. + +2019-04-06 Antony Lee <anntzer.lee@gmail.com> + + Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'. + + * include/freetype/freetype.h (FT_Get_Name_Index), + include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc), + include/freetype/internal/services/svgldict.h + (FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index), + src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c + (sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index), + src/type42/t42drivr.c (t42_get_name_index): Add `const' to second + argument. + +2019-03-31 Armin Hasitzka <prince.cherusker@gmail.com> + + [cff] Fix boundary checks. + + 642bc7590c701c8cd35a9f60fa899cfa518b17ff introduced dynamically + allocated memory when parsing CFF files with the "old" engine. Bounds + checks have never been updated, however, leading to pointless + comparisons of pointers in some cases. This commit presents a + solution for bounds checks in the CFF module with an extended logic + for the "old" engine while staying as concise as possible for the + "new" one. + + * src/cff/cffparse.h: Introduce the struct `CFF_T2_StringRec' and + the additional field `t2_strings' within `CFF_ParserRec'. + + * src/cff/cffparse.c (cff_parser_within_limits): Move all boundary + checks into this new function and update the rest of `cffparse.c' to + use it. + + Reported as + + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12137 + +2019-03-20 Werner Lemberg <wl@gnu.org> + + [autofit] Fix Mongolian blue zone characters. + + * src/autofit/afblue.dat: Use U+200D (ZERO-WIDTH JOINER) characters + to get medial forms for some Mongolian characters. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + +2019-03-19 Werner Lemberg <wl@gnu.org> + + [autofit] Add support for Mongolian script. + + As a de-facto standard, layouts using this script are constructed + horizontally line by line, then the lines are rotated clockwise for + vertical display. + + * src/autofit/afblue.dat: Add blue zone data for Mongolian. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/afscript.h: Add Mongolian standard characters. + + * src/autofit/afranges.c, src/autofit/afstyles.h: Add Mongolian + data. + 2019-03-15 Werner Lemberg <wl@gnu.org> * Version 2.10.0 released. @@ -2336,7 +7607,7 @@ 2018-05-13 Shao Yu Zhang <shaozhang@fb.com> Werner Lemberg <wl@gnu.org> - [sfnt] Preliminary support of coloured layer outlines (#44689). + [sfnt] Preliminary support of colored layer outlines (#44689). This commit enables OpenType's COLR/CPAL table handling; a typical application are color emojis that can be scaled to any size. @@ -2525,2345 +7796,10 @@ src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h: Removed. -2018-05-01 Werner Lemberg <wl@gnu.org> - - * Version 2.9.1 released. - ========================= - - - Tag sources with `VER-2-9-1'. - - * docs/VERSION.TXT: Add entry for version 2.9.1. - * docs/CHANGES: Updated. - - * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, - src/base/ftver.rc, 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.9/2.9.1/, s/29/291/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. - - * builds/unix/configure.raw (version_info): Set to 22:1:16. - * CMakeLists.txt (VERSION_PATCH): Set to 1. - - * include/freetype/ftgasp.h: Use FT_BEGIN_HEADER and FT_END_HEADER. - -2018-04-26 Werner Lemberg <wl@gnu.org> - - Another fix for handling invalid format 2 cmaps. - - Sigh. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8003 - - * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid - an endless loop. - -2018-04-24 Ben Wagner <bungeman@google.com> - - [base] Avoid undefined behaviour in lcd filtering code (#53727). - - * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy): - Ensure `height > 0'. - -2018-04-22 Werner Lemberg <wl@gnu.org> - - * src/base/ftoutln.c (FT_Outline_Decompose): Improve error tracing. - -2018-04-22 Alexei Podtelezhnikov <apodtele@gmail.com> - - [base] Fix bitmap emboldening. - - Bug introduced after release 2.8. - - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): We use - `FT_QALLOC_MULT', which doesn't zero out the buffer. Adjust the - bitmap copying code to take care of this fact. - -2018-04-22 Werner Lemberg <wl@gnu.org> - - Another fix for handling invalid format 2 cmaps. - - The previous commit was incomplete. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7928 - - * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid - an endless loop. - -2018-04-19 Werner Lemberg <wl@gnu.org - - [autofit] Add support for Georgian Mtavruli characters. - - This will be part of the forthcoming Unicode 11.0. - - * src/autofit/afblue.dat: Add blue zone data for Mtavruli. - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Mtavruli standard character. - -2018-04-18 Werner Lemberg <wl@gnu.org> - - Fix handling of invalid format 2 cmaps. - - The problem was introduced after the last release. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7828 - - * src/sfnt/ttcmap.c (tt_cmap2_char_next): Avoid endless loop. - -2018-04-17 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflow issues. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7739 - - * src/truetype/ttinterp.c (Ins_CEILING): Use FT_PIX_CEIL_LONG. - -2018-04-16 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflow issues. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7718 - - * src/truetype/ttinterp.c (Ins_MIRP): Use ADD_LONG. - -2018-04-15 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Use `info' function of make 3.81. - - * configure, docs/INSTALL, docs/INSTALL.CROSS, docs/INSTALL.GNU, - docs/INSTALL.UNIX, docs/MAKEPP: Bump make version requirements. - - * builds/detect.mk (std_setup): Replace `echo' with `info'. - (dos_setup): Removed. - * builds/unix/install.mk, builds/modules.mk, builds/dos/detect.mk, - builds/windows/detect.mk, builds/os2/detect.mk: Updated. - * builds/newline: No longer needed. - -2018-04-15 Werner Lemberg <wl@gnu.org> - - [truetype]: Limit `SLOOP' bytecode argument to 16 bits. - - This fixes - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7707 - - * src/truetype/ttinterp.c (Ins_SLOOP): Do it. - -2018-04-14 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflow issues. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7652 - - * src/truetype/ttinterp.c (Ins_MDAP): Use SUB_LONG. - -2018-04-14 Werner Lemberg <wl@gnu.org> - - [autofit] Update to Unicode 11.0.0. - - But no support new scripts (volunteers welcomed). - - * src/autofit/afranges.c (af_arab_nonbase_uniranges, - af_beng_nonbase_uniranges, af_cakm_nonbase_uniranges, - af_deva_nonbase_uniranges, af_geor_uniranges, - af_gujr_nonbase_uniranges, af_mlym_nonbase_uniranges, - af_nkoo_nonbase_uniranges, af_telu_nonbase_uniranges, - af_hani_uniranges): Add new data. - -2018-04-10 Nikolaus Waxweiler <madigens@gmail.com> - - * CMakeLists.txt, builds/cmake/FindHarfBuzz.cmake: Extensive - modernization measures. - - This brings up the minimum required CMake version to 2.8.12. - - The installation paths follow the GNU defaults now, e.g. installing on a - 64 bit host will place binaries into the lib64/ folder on e.g. Fedora. - - Symbols are hidden by default (e.g. `-fvisibility=hidden' on GCC). - - CMake will no longer look for a C++ compiler. - - Library and .so version now match the Autotools build. - - Comments in the build file and informational messages now use platform - agnostic example commands. - - ftoption.h and ftconfig.h are written directly without a redundant `-new' - copy. - - External dependencies are expressed as option()s and will turn up as such - in cmake-gui. - - Internal: Properties such as dependencies and include directories are now - privately set on the freetype library instead of globally. - - The CPack definitions have been cleaned up, the `make dist' has been - removed. Source packages generated with CPack don't contain Autotools - files and aren't used by the maintainers anyway. - - On Windows, src/base/ftver.rc is compiled to decorate the library with - version and copyright information. - - A pkg-config file is now generated and installed. - -2018-04-09 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflow issues. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7453 - - * src/truetype/ttinterp.c (Round_Super, Round_Super_45): Use - ADD_LONG and SUB_LONG. - -2018-04-06 Alexei Podtelezhnikov <apodtele@gmail.com> - - [windows, wince] Clean up legacy project files. - - * builds/wince/vc2005-ce/freetype.vcproj, - builds/wince/vc2008-ce/freetype.vcproj, - builds/windows/vc2005/freetype.vcproj, - builds/windows/vc2008/freetype.vcproj, - builds/windows/visualce/freetype.vcproj, - builds/windows/visualce/freetype.dsp, - builds/windows/visualc/freetype.vcproj, - builds/windows/visualc/freetype.dsp: Remove per-file compile flags. - -2018-04-04 Werner Lemberg <wl@gnu.org> - - [cff, type1] Sanitize `BlueFuzz' and `BlueShift'. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7371 - - * src/cff/cffload.c (cff_load_private_dict): Sanitize - `priv->blue_shift' and `priv->blue_fuzz' to avoid overflows later - on. - - * src/type1/t1load.c (T1_Open_Face): Ditto. - -2018-04-04 Ben Wagner <bungeman@google.com> - - * src/truetype/ttobjs.c (trick_names): Add 3 tricky fonts (#53554), - `DFHei-Md-HK-BF', `DFKaiShu-Md-HK-BF' and `DFMing-Bd-HK-BF'. - (tt_check_trickyness_sfnt_ids): Add checksums for 3 tricky fonts - in above. - -2018-04-01 Werner Lemberg <wl@gnu.org> - - * builds/toplevel.mk (work): Use $(SEP). - - This fixes the `make refdoc' using Cygwin: $(CAT) is `type' on this - platform, and this program only understands backslashes in paths. - - Reported by Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>. - -2018-03-30 Werner Lemberg <wl@gnu.org> - - [truetype] Fix memory leak (only if tracing is on). - - * src/truetype/ttgxvar.c (TT_Get_MM_Var) [FT_DEBUG_LEVEL_TRACE}: Fix - it. - -2018-03-23 Ben Wagner <bungeman@google.com> - - [sfnt] Correctly handle missing bitmaps in sbix format (#53404). - - * src/sfnt/ttfsbit.c (tt_face_load_sbix_image): Fix return value. - -2018-03-23 Ben Wagner <bungeman@google.com> - - [truetype] Fix advance of empty glyphs in bitmap fonts (#53393). - - * src/truetype/ttgload.c (TT_Load_Glyph): Apply scaling to metrics - for empty bitmaps. - -2018-03-22 Werner Lemberg <wl@gnu.org> - - Remove `ftlcdfil.c' and `ftfntfmt.c' from build files (#53415). - - builds/amiga/makefile, builds/amiga/makefile.os4, - builds/amiga/smakefile, builds/mac/FreeType.m68k_cfm.make.txt, - builds/mac/FreeType.m68k_far.make.txt, - builds/mac/FreeType.ppc_carbon.make.txt, - builds/mac/FreeType.ppc_classic.make.txt, - builds/symbian/freetype.mmp, builds/wince/vc2005-ce/freetype.vcproj, - builds/wince/vc2008-ce/freetype.vcproj, - builds/windows/vc2005/freetype.vcproj, - builds/windows/vc2008/freetype.vcproj, - builds/windows/vc2010/freetype.vcxproj, - builds/windows/vc2010/freetype.vcxproj.filters, - builds/windows/visualc/freetype.dsp, - builds/windows/visualc/freetype.vcproj, - builds/windows/visualce/freetype.dsp, - builds/windows/visualce/freetype.vcproj, vms_make.com: Do it. - -2018-03-13 Werner Lemberg <wl@gnu.org> - - * src/sfnt/ttcmap.c (tt_cmap2_validate): Fix potential numeric - overflow. - -2018-03-13 Werner Lemberg <wl@gnu.org> - - Fix cmap format 2 handling (#53320). - - The patch introduced for #52646 was not correct. - - * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition. - -2018-03-10 Nikolaus Waxweiler <madigens@gmail.com> - - * CMakeLists.txt (BASE_SRCS): Update to changes from 2018-03-05. - -2018-03-09 Chun-wei Fan <fanc999@yahoo.com.tw> - - * CMakeLists.txt [win32]: Allow MSVC DLL builds (#53287). - - Do not limit DLL builds to MinGW, since we already have - `__declspec(dllexport)' directives in `ftconfig.h'. - Also suppress more warnings for POSIX functions. - -2018-03-08 Hugh McMaster <hugh.mcmaster@outlook.com> - - Make installation of `freetype-config' optional (#53093). - - * builds/unix/configure.raw: Add option `--enable-freetype-config' - and set `INSTALL_FT2_CONFIG'. - * builds/unix/unix-def.in (INSTALL_FT2_CONFIG): Define. - * builds/unix/install.mk (install): Handle it. - -2018-03-05 Werner Lemberg <wl@gnu.org> - - Make `ftlcdfil.c' part of the `base' module. - - `ftobjs.c' needs `ft_lcd_padding'. - - Problem reported by duhuanpeng <548708880@qq.com>. - - * modules.cfg (BASE_EXTENSIONS): Don't include `ftlcdfil.c'. - - * src/base/ftbase.c: Include `ftlcdfil.c'. - * src/base/rules.mk (BASE_SRC): Add `ftlcdfil.c'. - * src/base/Jamfile (_sources): Adjusted. - - * docs/INSTALL.ANY: Updated. - -2018-03-05 Werner Lemberg <wl@gnu.org> - - Make `ftfntfmt.c' part of the `base' module. - - `ftobjs.c' needs `FT_Get_Font_Format'. - - Problem reported by duhuanpeng <548708880@qq.com>. - - * modules.cfg (BASE_EXTENSIONS): Don't include `ftfntfmt.c'. - - * src/base/ftbase.c: Include `ftfntfmt.c'. - * src/base/rules.mk (BASE_SRC): Add `ftfntfmt.c'. - * src/base/Jamfile (_sources): Adjusted. - - * docs/INSTALL.ANY: Updated. - -2018-03-01 Werner Lemberg <wl@gnu.org> - - * src/truetype/ttinterp.c (TT_RunIns): Fix tracing arguments. - -2018-02-23 Werner Lemberg <wl@gnu.org> - - * builds/unix/configure.raw: Need HarfBuzz 1.3.0 or newer. - - Problem reported by Alan Coopersmith <alan.coopersmith@oracle.com>. - -2018-02-17 Werner Lemberg <wl@gnu.org> - - [sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154). - -2018-02-06 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflow issues. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6027 - - * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIAP, Ins_MIRP): Use - SUB_LONG; avoid FT_ABS. - -2018-02-04 Alexei Podtelezhnikov <apodtele@gmail.com> - - [unix] Use -fvisibility=hidden. - - It is now widely recommended that ELF shared libraries hide symbols - except those with explicit __attribute__((visibility("default"))). - This is supported by all major compilers and should rather be an - option in libtool. - - * builds/unix/configure.raw: Add -fvisibility=hidden to CFLAGS. - * builds/unix/ftconfig.in, builds/vms/ftconfig.h, - include/freetype/config/ftconfig.h (FT_EXPORT): Use visibility - attribute. - -2018-01-27 Werner Lemberg <wl@gnu.org> - - [truetype] Better protection against invalid VF data. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5739 - - Bug introduced in commit 08cd62deedefe217f2ea50e392923ce8b5bc7ac7. - - * src/truetype/ttgxvar.c (TT_Set_Var_Design): Always initialize - `normalizedcoords'. - -2018-01-27 Werner Lemberg <wl@gnu.org> - - * src/truetype/ttinterp.c (Ins_GETVARIATION): Avoid NULL reference. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5736 - -2018-01-27 Werner Lemberg <wl@gnu.org> - - * src/truetype/ttgxvar.c (tt_set_mm_blend): Minor. - -2018-01-27 Werner Lemberg <wl@gnu.org> - - [truetype] Better trace VF instances. - - * src/truetype/ttgxvar.c (ft_var_to_normalized): Don't emit number - of coordinates. - (TT_Get_MM_Var): Trace instance indices names. - (TT_Set_Var_Design): Updated. - -2018-01-27 Werner Lemberg <wl@gnu.org> - - [truetype] Beautify tracing of VF axis records. - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Show axis records in a - table-like manner. - -2018-01-26 Ben Wagner <bungeman@google.com> - - [truetype] Fix multiple calls of `FT_Get_MM_Var' (#52955). - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Set - `face->blend->num_axis' in case we have to initialize the - `face->blend'. - -2018-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> - - [apinames] Anonymous version map for GNU linker. - - * src/tools/apinames.c (PROGRAM_VERSION): Set to 0.3. - (OutputFormat): Add `OUTPUT_GNU_VERMAP'. - (names_dump): Handle it. - (usage): Updated. - (main): Handle new command line flag `-wL'. - -2018-01-21 Alexei Podtelezhnikov <apodtele@gmail.com> - - [unix] Call libtool to clean up. - - * builds/unix/install.mk (clean_project_unix, distclean_project_unix): - Use libtool. - * builds/freetype.mk: Minor. - -2018-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> - - * src/base/ftver.rc: Fix mingw-w64 compilation. - -2018-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Enable VERSIONINFO resource for Cygwin/MinGW. - - * builds/unix/configure.raw: Check for resource compiler. - * builds/unix/unix-cc.in: Conditionally set up resource compiler. - * builds/freetype.mk: Add conditional rule for `ftver.rc'. - * src/base/ftver.rc: Copyright notice and year update. - -2018-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Move VERSIONINFO resource. - - * builds/windows/vc2010/freetype.vcxproj: Updated. - * builds/windows/ftver.rc: Move file from here... - * src/base/ftver.rc: ... to here. - -2018-01-12 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Expand dllexport/dllimport to Cygwin/MinGW. - - * include/freetype/config/ftconfig.h: Respect DLL_EXPORT, - s/_MSC_VER/_WIN32/. - * builds/unix/ftconfig.in: Replicate here. - * builds/vms/ftconfig.h: Replicate here. - -2018-01-12 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Improve and document MSVC build. - - * include/freetype/config/ftconfig.h: Guard dllexport/dllimport - attributes with _DLL and FT2_DLLIMPORT. - * builds/windows/vc2010/index.html: Update documentation. - -2018-01-10 Steve Robinson <ssrobins@gmail.com> - - * CMakeLists.txt [win32]: Suppress warnings for POSIX functions. - -2018-01-10 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Correctly handle Flex features (#52846). - - * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdVMOVETO, - cf2_cmdHMOVETO>: Do not move if doing Flex. - -2018-01-09 Alexei Podtelezhnikov <apodtele@gmail.com> - - * builds/windows/vc2010/freetype.sln: Synchronize with the project. - -2018-01-08 Werner Lemberg <wl@gnu.org> - - * Version 2.9 released. - ======================= - - - Tag sources with `VER-2-9'. - - * docs/VERSION.TXT: Add entry for version 2.9. - - * 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/windows/ftver.rc, - 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.8.1/2.9/, s/281/29/. - - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 9. - (FREETYPE_PATCH): Set to 0. - - * builds/unix/configure.raw (version_info): Set to 22:0:16. - * CMakeLists.txt (VERSION_PATCH): Set to 0. - -2018-01-07 Werner Lemberg <wl@gnu.org> - - Add check for librt, needed for `ftbench' (#52824). - - * builds/unix/configure.raw (LIB_CLOCK_GETTIME): Define; this will - hold `-lrt' if necessary. - - * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): New variable. - -2018-01-07 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Fix Type 1 glyphs with too many stem hints. - - According to the CFF specification, charstrings can have up to 96 stem - hints. Due to hint replacement routines in Type 1 charstrings, some - glyphs are rejected by the Adobe engine, which implements the above - limit. This fix turns off hinting for such glyphs. - - * src/psaux/pshints.c (cf2_hintmap_build): Reset the error from calling - `cf2_hintmask_setAll' on a problematic Type 1 charstring and turn off - hinting. - -2018-01-06 Werner Lemberg <wl@gnu.org> - - Add `FT_Done_MM_Var'. - - This is necessary in case the application's memory routines differ - from FreeType. A typical example is a Python application on Windows - that calls FreeType compiled as a DLL via the `ctypes' interface. - - * include/freetype/ftmm.h, src/base/ftmm.c (FT_Done_MM_Var): Declare - and define. - - * docs/CHANGES: Updated. - -2018-01-03 Werner Lemberg <wl@gnu.org> - - [truetype] Round offsets of glyph components only if hinting is on. - - * src/truetype/ttgload.c (TT_Process_Composite_Component): Implement - it. - -2018-01-03 Werner Lemberg <wl@gnu.org> - - * src/truetype/ttgxvar.c (ft_var_to_design): Remove dead code. - - This is a better fix than the previous commit, which is now - reverted. - -2018-01-03 Alexei Podtelezhnikov <apodtele@gmail.com> - - Move internal LCD-related declarations. - - * include/freetype/ftlcdfil.h (ft_lcd_padding, ft_lcd_filter_fir): - Move from here... - * include/freetype/internal/ftobjs.h: ... to here. - -2018-01-03 Alexei Podtelezhnikov <apodtele@gmail.com> - - * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF) - [_MSC_VER]: Limit Visual C++ attributes. - -2018-01-03 Werner Lemberg <wl@gnu.org> - - [truetype] Make blend/design coordinate round-tripping work. - - Behdad reported that setting blend coordinates, then getting design - coordinates did incorrectly return the default instance's - coordinates. - - * src/truetype/ttgxvar.c (tt_set_mm_blend): Fix it. - -2017-12-31 Werner Lemberg <wl@gnu.org> - - * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix endless loop. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4838 - -2017-12-31 Werner Lemberg <wl@gnu.org> - - Synchronize other Windows project files. - - * builds/windows/*: Add missing files. - -2017-12-31 Werner Lemberg <wl@gnu.org> - - Update Visual C 2010 project files. - - Problem reported by Hin-Tak. - - * builds/windows/vc2010/freetype.vcxproj: Add files `ftbdf.c' and - `ftcid.c'. - Sort entries. - * builds/windows/vc2010/freetype.vcxproj.filter: Ditto. - Fix members of `FT_MODULE' group. - -2017-12-30 Werner Lemberg <wl@gnu.org> - - * builds/vms/ftconfig.h: Synchronize with unix `ftconfig.in' file. - -2017-12-28 Werner Lemberg <wl@gnu.org> - - * builds/unix/ftconfig.in: Synchronize with main `ftconfig.h' file. - - Reported by Nikolaus. - -2017-12-27 Werner Lemberg <wl@gnu.org> - - Fix compiler warnings. - - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Make `pitch' and - `new_pitch' unsigned. - - * src/base/ftpsprop.c: Include FT_INTERNAL_POSTSCRIPT_PROPS_H. - -2017-12-27 Werner Lemberg <wl@gnu.org> - - Fixes for `make multi'. - - * include/freetype/internal/ftpsprop.h: Use `FT_BASE_CALLBACK'. - (ps_property_get): Harmonize declaration with corresponding - function typedef. - - * include/freety[e/internal/fttrace.h: Add `trace_psprops'. - - * src/base/ftpsprop.c: Include necessary header files. - (FT_COMPONENT): Define. - (ps_property_set): Tag with `FT_BASE_CALLBACK_DEF'. - (ps_property_get): Tag with `FT_BASE_CALLBACK_DEF'. - Harmonize declaration with corresponding function typedef. - -2017-12-27 Werner Lemberg <wl@gnu.org> - - Provide support for intra-module callback functions. - - This is needed especially for `make multi' with C++. - - * include/freetype/config/ftconfig.h (FT_BASE_CALLBACK, - FT_BASE_CALLBACK_DEF): New macros. - -2017-12-25 Ewald Hew <ewaldhew@gmail.com> - - Move PostScript drivers' property handlers to `base'. - - This reduces the amount of duplicated code across PostScript - drivers. - - * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c - ({cff,cid,t1}_property_{get,set}): Moved to... - * include/freetype/internal/ftpsprop.h: ...this new file. - (ps_property_{get,set}): New functions to replace moved ones. - - * src/base/ftpsprop.c: New file that implements above functions. - - * include/freetype/internal/internal.h - (FT_INTERNAL_POSTSCRIPT_PROPS_H): New macro. - - * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c: - Updated. - - * src/base/Jamfile, src/base/rules.mk (BASE_SRC), src/base/ftbase.c: - Updated. - -2017-12-20 Werner Lemberg <wl@gnu.org> - - Speed up FT_Set_Var_{Design,Blend}_Coordinates if curr == new. - - We exit early if the current design or blend coordinates are - identical to the new ones. - - * src/truetype/ttgxvar.c (tt_set_mm_blend, TT_Set_Var_Design): - Implement it, returning internal error code -1 if there will be no - variation change. - - * src/type1/t1load.c (t1_set_mm_blend): Ditto. - - * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, - FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Updated. - -2017-12-18 Werner Lemberg <wl@gnu.org> - - [sfnt] Fix charmap type 2 iterator (#52646). - - The subsetted demo font of the report that exhibits the bug has a - very unusual type 2 cmap for Unicode(!): It contains only two - sub-headers, one for one-byte characters (covering the range 0x20 to - 0xFA), and a second one for higher byte 0x01 (just for character - code U+0131). - - Before this commit, the iterator wasn't able to correctly handle a - sub-header for higher byte 0x01. - - * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix character increment - for outer loop. - -2017-12-18 Matthias Clasen <matthias.clasen@gmail.com> - - [truetype] Fix clamping, minor tracing code beautification. - - * src/truetype/ttgxvar.c (ft_var_to_normalized): Trace number of - design coordinates. - Use clamped value. - -2017-12-18 Werner Lemberg <wl@gnu.org> - - * src/*/*: Only use `ft_' and `FT_' variants of stdc library stuff. - -2017-12-18 Werner Lemberg <wl@gnu.org> - - * src/truetype/ttgxvar.c (tt_face_vary_cvt): Add size guard (#52688). - -2017-12-18 Werner Lemberg <wl@gnu.org> - - [truetype] Fix previous commit. - - * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Correctly handle - unhinted phantom points, which must be properly scaled. - -2017-12-18 Werner Lemberg <wl@gnu.org> - - [truetype] Don't apply HVAR and VVAR deltas twice (#52683). - - * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Always adjust - `pp1' to `pp4', except if we have an HVAR and/or VVAR table. - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Handle - alternative code branch identically w.r.t. presence of an HVAR - and/or VVAR table. - -2017-12-17 Jonathan Kew <jfkthame@gmail.com> - - [truetype] Correctly handle variation font phantom points (#52683). - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix phantom - point indices. - -2017-12-17 Jonathan Kew <jfkthame@gmail.com> - - Fix incorrect advance width scaling (#52683). - - * src/base/ftadvance.c (FT_Get_Advances): Always respect the - FT_LOAD_NO_SCALE flag if present. - -2017-12-16 Alexei Podtelezhnikov <apodtele@gmail.com> - - * builds/windows/vc2010/freetype.vcxproj: AfterBuild copy. - * objs/.gitignore: Ignore almost everything. - -2017-12-11 Werner Lemberg <wl@gnu.org> - - Fix compiler warning (#52640). - - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Remove unused - variable. - -2017-12-08 Azzuro <azzuro@team-mediaportal.com> - - * builds/windows/vc2010/freetype.vcxproj: Adjust output directory. - - This allows builds with different configurations in parallel. - -2017-12-08 Werner Lemberg <wl@gnu.org> - - Fix `make setup dos', second try (#52622). - - * builds/detect.mk (dos_setup): Don't use literal `>' character at - all. Mixing the different escaping rules from make, dos, and - windows is too fragile. - -2017-12-08 Werner Lemberg <wl@gnu.org> - - [docmaker] Fix code section parsing. - - Stuff like - - { - <bla> - } - - confused the parser, which incorrectly treated `<bla>' as a markup - tag. - - * src/tools/docmaker/content.py (ContentProcessor::process_content): - Apply `re_markup_tags' only outside of code sections. - -2017-12-08 Werner Lemberg <wl@gnu.org> - - New `ftdriver.h' file, covering all driver modules. - - This reduces redundancy and increases synergy; it also reduces the - number of header files. - - * include/freetype/config/ftheader.h (FT_DRIVER_H): New macro. - (FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H, - FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to - FT_DRIVER_H. - - * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h, - include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h, - include/freetype/ftttdrv.h: Replaced with... - * include/freetype/ftdriver.h: ...this new file. - (FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to... - (FT_HINTING_ADOBE): ... this new macro. - (FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to... - (FT_HINTING_FREETYPE): ... this new macro. - - * src/*/*: Updated accordingly. - -2017-12-08 Werner Lemberg <wl@gnu.org> - - Move `ftdriver.h' to `ftdrv.h'. - - * include/freetype/internal/ftdriver.h: Renamed to... - * include/freetype/internal/ftdrv.h: ... this name. - - * include/freetype/internal/internal.h (FT_INTERNAL_DRIVER_H): - Updated. - -2017-12-08 Werner Lemberg <wl@gnu.org> - - Fix access to uninitalized memory (#52613). - - Also reported as - - https://bugs.chromium.org/p/chromium/issues/detail?id=791317 - - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): If increasing the - bitmap size needs a larger bitmap buffer, assure that the new memory - areas are initialized also. - -2017-12-08 Werner Lemberg <wl@gnu.org> - - Fix `make setup dos' (#52622). - - * builds/detect.mk (dos_setup): Properly escape literal `>' - character. - -2017-12-07 Werner Lemberg <wl@gnu.org> - - Fix C++ compilation. - - * src/psaux/psauxmod.h: Use FT_CALLBACK_TABLE macro where necessary. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Fix warning. - -2017-12-07 Werner Lemberg <wl@gnu.org> - - Fix `make multi'. - - * include/freetype/internal/fttrace.h: Remove unused tracing macros. - s/pshalgo2/pshalgo/. - Add `trace_cffdecode'. - * src/pshinter/pshalgo.c (FT_COMPONENT): Updated. - - * src/cff/cffload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H. - * src/cff/cffobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H and - FT_SERVICE_CFF_TABLE_LOAD_H. - - * src/cid/cidriver.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H. - - * src/psaux/cffdecode.c: Include FT_FREETYPE_H and - FT_INTERNAL_DEBUG_H. - (FT_COMPONENT): Define. - * src/psaux/cffdecode.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H. - * src/psaux/psauxmod.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H. - Declare `cff_builder_funcs' and `ps_builder_funcs'. - * src/psaux/psft.c: Include `psobjs.h' and `cffdecode.h'. - * src/psaux/psobjs.c : Include `psauxmod.h'. - -2017-12-07 Werner Lemberg <wl@gnu.org> - - * include/freetype/config/ftheader.h: Some clean-up. - - This commit removes documentation of deprecated macros and does some - minor streamlining. - -2017-12-06 Werner Lemberg <wl@gnu.org> - - * builds/symbian/bld.inf: Updated. - -2017-12-06 Werner Lemberg <wl@gnu.org> - - New header file `ftparams.h' that collects all parameter tags. - - * include/freetype/config/ftheader.h (FT_PARAMETER_TAGS_H): New - macro. - (FT_TRUETYPE_UNPATENTED_H, FT_UNPATENTED_HINTING_H): Define it to - `ftparams.h'. - - * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h, - include/freetype/ftincrem.h, include/freetype/ftlcdfil.h, - include/freetype/ftsnames.h, include/freetype/ftt1drv.h: Include - FT_PARAMETER_TAGS_H. - Move FT_PARAM_TAG_XXX definitions to... - * include/freetype/ftparams.h: ...this new file. - - * include/freetype/ttunpat.h: Remove. No longer needed. - -2017-12-05 Werner Lemberg <wl@gnu.org> - - Improve tracing messages by using singular and plural forms. - - * src/*/*.c: Implement it. - -2017-12-04 Werner Lemberg <wl@gnu.org> - - [truetype] Allow shared points in `cvar' table (#52532). - - * src/truetype/ttgxvar.c (tt_face_vary_cvt): Implement it by copying - and adjusting the corresponding code from - `TT_Vary_Apply_Glyph_Deltas'. - -2017-11-28 Werner Lemberg <wl@gnu.org> - - [truetype] Improving tracing of composite glyphs. - - * src/truetype/ttgload.c (TT_Load_Composite_Glyph) - [FT_DEBUG_LEVEL_TRACE]: Show composite glyph information. - -2017-11-27 Werner Lemberg <wl@gnu.org> - - [type1] Allow (again) `/Encoding' with >256 elements (#52464). - - In version 2.6.1, this has been disallowed to better reject - malformed fonts; however, this restriction was too strong. This - time, we only take the first 256 elements into account, since - encoding arrays are always accessed with a 8bit integer, according - to the PostScript Language Reference. - - * src/type1/t1load.c (parse_encoding): Implement it. - -2017-11-27 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> - - Fix last commit (#52522). - - * builds/freetype.mk: Set `FT_OPTION_H' and `FTOPTION_FLAG' - properly if we have `ftoption.h' in `BUILD_DIR'. - -2017-11-24 Werner Lemberg <wl@gnu.org> - - [unix] Install a massaged `ftoption.h' file (#51780). - - * builds/unix/configure.raw (ftoption_set, ftoption_unset): New - auxiliary functions to construct... - (FTOPTION_H_SED): ... this new variable. - Apply it as a sed argument while copying `ftoption.h' to the - `builds/unix' directory (using `AC_CONFIG_FILES'). - Simplify code of test that checks cpp's computation of bit length - (the test previously created an empty `ftoption.h' file and deleted - it immediately afterwards); without this change, it can happen on my - GNU/Linux box that `configure's execution of `config.status' doesn't - create `ftoption.h' (no idea why this happens). - - * builds/unix/install.mk (install): Install - `builds/unix/ftoption.h'. - - * builds/unix/unix-def.in (DISTCLEAN): Updated. - - * builds/unix/.gitignore: Updated. - -2017-11-23 Tor Andersson <tor.andersson@artifex.com> - - Silence unused function warnings (#52465). - - Some static function declarations cause unused function warnings if - certain config options are turned off via `ftoption.h'. - - * src/base/ftbase.h, src/base/ftrfork.c, src/sfnt/ttbdf.h, - src/truetype/ttgxvar.h: Add #ifdef guards around these sections. - -2017-11-22 Ewald Hew <ewaldhew@gmail.com> - - * src/psaux/psft.c (cf2_setGlyphWidth): Check format before setting. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4377 - -2017-11-22 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Fix CFF advance widths. (#52466) - - Glyph advance widths were being written to the new `PS_Decoder' but not - saved to the underlying format specific decoder. This caused pure CFF - fonts to have bad advance width. - - * include/freetype/internal/psaux.h (PS_Decoder): Change `glyph_width' - field to pointer. - Remove unused fields. - * src/psaux/psobjs.c (ps_decoder_init): Change `glyph_width' from copy - to reference. - Remove unused. - * src/psaux/psft.c (cf2_setGlyphWidth): Update code. - -2017-11-15 Vlad Tsyrklevich <vtsyrklevich@google.com> - - * include/freetype/ftrender.h: Fix `FT_Renderer_RenderFunc' type. - -2017-11-14 Nikolaus Waxweiler <madigens@gmail.com> - - Use Adobe hinting engine for `light' hinting of both CFF and Type 1. - - Since Ewald Hew factored the Adobe hinting engine out of the CFF - driver code, we can now use it on Type 1 (and CID) font formats, as - both have the same hinting philosophy. - - This change activates the Adobe hinter when in LIGHT mode, and - therefore always unless explicitly asking for the auto-hinter. This - makes LIGHT behavior consistent with CFF fonts. As of this commit, - the hinting engine table looks as follows. - - LIGHT NORMAL - ------------------------- - TrueType Auto v40 - CFF Adobe Adobe - Type 1 Adobe Adobe - -2017-11-10 Yuri Levchenko <yuri_levchenko@boolat.com> - - * CMakeLists.txt: Add `DISABLE_FORCE_DEBUG_PREFIX' option. - -2017-11-06 Alexei Podtelezhnikov <apodtele@gmail.com> - - * src/base/ftobjs.c (FT_Load_Glyph): Relocate condition. - -2017-11-06 Alexei Podtelezhnikov <apodtele@gmail.com> - - * src/smooth/ftgrays.c (gray_set_cell): Fix uninitialized variables. - -2017-11-03 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Fix PostScript interpreter rewinding in Type 1 mode. (#52251) - - The interpreter in Type 1 mode rewinds the charstring after collecting - all hints for building the initial hintmap (commit d52dd7f). However, - some charstrings use `endchar' in a final subroutine call, rewinding to - the start of that subroutine, and only a small section of the actual - glyph is drawn. - - * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdENDCHAR>: - Ensure we are on the top level charstring before rewinding. - -2017-11-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> - - [truetype] Add more tricky fonts. - - See the report by Yang Yinsen. - https://lists.gnu.org/archive/html/freetype-devel/2017-11/msg00000.html - - * src/truetype/ttobjs.c (trick_names): Add `DFGothic-EB', - `DFGyoSho-Lt', `DFHSGothic-W5', `DFHSMincho-W3' and `DFHSMincho-W7'. - (tt_check_trickyness_sfnt_ids): Add checksums for DFGothic-EB, - DFGyoSho-Lt, DFHSGothic-W5, DFHSMincho-W3 and DFHSMincho-W7. Also - add checksums for DLCLiShu and DLCHayBold which their family names - were already listed but their checksums were previously unknown. - -2017-11-01 Alexei Podtelezhnikov <apodtele@gmail.com> - - [smooth] Fix complex rendering at high ppem. - - We used to split large glyphs into horizontal bands and continue - bisecting them still horizontally if that was not enough. This is - guaranteed to fail when a single scanline cannot fit into the - rendering memory pool. Now we bisect the bands vertically so that - the smallest unit is a column of the band height, which is guranteed - to fit into memory. - - * src/smooth/ftgrays.c (gray_convert_glyph): Implement it. - -2017-10-20 Alexei Podtelezhnikov <apodtele@gmail.com> - - [smooth] Improve complex rendering at high ppem. - - At large sizes almost but not exactly horizontal segments can quickly - drain the rendering pool. This patch at least avoids filling the pool - with trivial cells. Beyond this, we can only increase the pool size. - - Reported, analyzed, and tested by Colin Fahey. - - * src/smooth/ftgrays.c (gray_set_cell): Do not record trivial cells. - -2017-10-20 Alexei Podtelezhnikov <apodtele@gmail.com> - - [base] Improve tracing in FT_Load_Glyph, FT_*_Size. - - * src/base/ftobjs.c (FT_Load_Glyph): Tag tracing messages with - function name, glyph index, and load flags. - (FT_Select_Metrics, FT_Request_Metrics): Remove all tracing. - (FT_Select_Size, FT_Request_Size): Improve tracing. - -2017-10-18 Alexei Podtelezhnikov <apodtele@gmail.com> - - [base] Improve tracing in FT_Render_Glyph. - - * src/base/ftobjs.c (FT_Render_Glyph_Internal): Add total coverage - calculations and downgrade Netpbm dump to bitmap:7. - -2017-10-15 Ewald Hew <ewaldhew@gmail.com> - - [cff] Fix segfault on missing `psaux' (#52218) - - * src/cff/cffload.c (cff_done_blend): Add a check for possible nullptr. - - * modules.cfg: Update dependency list. - -2017-10-15 Alexei Podtelezhnikov <apodtele@gmail.com> - - [base, cff] Fix MSVC warnings. - - * src/base/ftobjs.c (FT_New_Library): C4702: unreachable code. - (ft_glyphslot_preset_bitmap): C4244: possible loss of data. - * src/cff/cffload.c (cff_blend_doBlend): C4244: possible loss of data. - Turn `sum' into unsigned. - -2017-10-14 Alexei Podtelezhnikov <apodtele@gmail.com> - - [base] Netpbm image tracing. - - * src/base/ftobjs.c (FT_Load_Glyph): Trace bitmap size. - (FT_Render_Glyph_Internal): Trace bitmap in Netpbm format. - - * src/smooth/ftgrays.c (gray_sweep): Sweep remnants of span tracing. - -2017-10-14 Alexei Podtelezhnikov <apodtele@gmail.com> - - * builds/windows/ftdebug.c (FT_Message): Print to stderr. - * builds/wince/ftdebug.c (FT_Message): Ditto. - -2017-10-14 Behdad Esfahbod <behdad@behdad.org> - - [afshaper] Delay creating `hb_set' objects until needed. - - In runs on Noto Naskh Arabic, this results in 89 sets created - instead of 340 before. Makes auto-hinter setup with HarfBuzz - enabled 20% to 30% faster. - - * src/autofit/afshaper.c (af_shaper_get_coverage): Implement it. - -2017-10-12 Ewald Hew <ewaldhew@gmail.com> - - [type1, cid] Add hinting engine switch. - - Implement property service in `type1' and `cid' drivers to allow - switching between FreeType or Adobe hinting engine when both are - available. - - * src/cid/cidriver.c (cid_property_{set,get}, cid_services), - src/type1/t1driver.c (t1_property_{set,get}, t1_services): Add - Properties service. - - * src/cid/cidobjs.c (cid_driver_init), src/type1/t1objs.c - (T1_Driver_Init): Add default property values. - -2017-10-12 Ewald Hew <ewaldhew@gmail.com> - - Add T1_CONFIG_OPTION_OLD_ENGINE configuration option. - - This controls whether the old Type 1 engine gets compiled into FreeType. - It is disabled by default. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (T1_CONFIG_OPTION_OLD_ENGINE): New macro. - - * include/freetype/internal/psaux.h (PS_Decoder): Remove unused field. - * include/freetype/internal/psaux.h, src/cid/cidgload.c - (cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c - (ps_builder_add_point), src/psaux/t1decode.c - (t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph, - t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h, - src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround - relevant code with macro. - Minor code changes. - -2017-10-12 Ewald Hew <ewaldhew@gmail.com> - - Extract width parsing from Type 1 parser. - - Duplicate the fast advance width calculations from the old parser. - This is to facilitate adding options for compiling out the old parser. - - * src/psaux/t1decode.{c,h} (t1_decoder_parse_metrics): New function. - * include/freetype/internal/psaux.h (T1_Decoder_Funcs): New entry - `parse_metrics'. - * src/psaux/psauxmod.c: Set the new entry. - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String), - src/cid/cidgload.c (cid_load_glyph): Separate - conditional for selecting engine. - -2017-10-09 Werner Lemberg <wl@gnu.org> - - * src/base/ftoutln.c (FT_Outline_Translate): Fix integer overflow. - - Reported as - - https://bugs.chromium.org/p/chromium/issues/detail?id=772775 - -2017-10-08 Werner Lemberg <wl@gnu.org> - - * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Integer overflows. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3579 - -2017-10-07 Werner Lemberg <wl@gnu.org> - - [sfnt] Adjust behaviour of PS font names for variation fonts. - - * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Use a named instance's - PS name only if no variation is applied. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - [cff, truetype] Adjust behaviour of named instances. - - This commit completely separates the interaction between named - instances and variation functions. In particular, resetting the - variation returns to the current named instance (if set) and not to - the base font. - - As a side effect, variation functions no longer change the named - instance index. - - * src/cff/cffobjs.c (cff_face_init): Use MM service's `set_instance' - function. - Also apply `MVAR' table to named instances. - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add cast. - (tt_set_mm_blend): No longer check whether requested variation - coincides with a named instance. - (TT_Set_Var_Design): Use current named instance for default - coordinates. - * src/truetype/ttobjs.c (tt_face_init): Use `TT_Set_Named_Instance'. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - Make `FT_Set_Named_Instance' work. - - * src/cff/cffdrivr.c (cff_set_instance): New function. - (cff_service_multi_masters): Register it. - - * src/truetype/ttgxvar.c (TT_Set_Named_Instance): New function. - * src/truetype/ttgxvar.h: Updated. - * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Register - it. - - * src/type1/t1load.c (T1_Reset_MM_Blend): New function. - * src/type1/t1load.h: Updated. - * src/type1/t1driver.c (t1_service_multi_masters): Register it. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - Make `FT_FACE_FLAG_VARIATION' work. - - * include/freetype/internal/tttypes.h (TT_Face): Remove - `is_default_instance'; this can be replaced with a combination of - `FT_IS_VARIATION' and `FT_IS_INSTANCE'. - - * src/cff/cffdrivr.c (cff_get_advances): Updated. - - * src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/sfobjs.c - (sfnt_init_face): Updated. - - * src/truetype/ttdriver.c (tt_get_advances), src/truetype/ttgload.c - (TT_Process_Simple_Glyph, load_truetype_glyph, IS_DEFAULT_INSTANCE), - src/truetype/ttgxvar.c (tt_set_mm_blend): Updated. - * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): - Handle `FT_FACE_FLAG_VARIATION'. - - * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Handle - `FT_FACE_FLAG_VARIATION'. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - New function `FT_Set_Named_Instance'. - - No effect yet. - - * src/base/ftmm.c (FT_Set_Named_Instance): New function. - - * include/freetype/ftmm.h: Updated. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - Add macros for checking whether a font variation is active. - - * include/freetype/freetype.h (FT_FACE_FLAG_VARIATION, - FT_IS_VARIATION): New macros. - No effect yet. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - Add framework for setting named instance in MM service. - - * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func): - New function typedef. - (MultiMasters): Add `set_instance' member. - (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. - - * src/cff/cffdrivr.c (cff_service_multi_masters), - src/truetype/ttdriver (tt_service_gx_multi_masters), - src/type1/t1driver.c (t1_service_multi_masters): Updated. - -2017-10-07 Werner Lemberg <wl@gnu.org> - - [type1] Minor code shuffling. - - * src/type1/t1load.c (T1_Set_MM_Blend): Make it a wrapper of... - (t1_set_mm_blend): ...this new function. - (T1_Set_MM_Design): Use `t1_set_mm_blend'. - -2017-10-05 Werner Lemberg <wl@gnu.org> - - * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Fix integer - overflow. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3539 - -2017-10-05 Werner Lemberg <wl@gnu.org> - - Fix compiler warnings. - - * src/cff/cffdrivr.c (cff_ps_get_font_extra): Avoid code that relies - on numeric overflow. - Add cast. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Fix variable - types, add cast. - -2017-10-04 John Tytgat <John.Tytgat@esko.com> - - [cff] Add support for `FSType'. - - * include/freetype/internal/cfftypes.h (CFF_FontRec): Add - `font_extra' entry. - - * src/cff/cffdrivr.c (cff_ps_get_font_extra): New function to - retrieve FSType info from the embedded PostScript data. - (cff_service_ps_info): Register function. - - * src/cff/cffload.c (cff_font_done): Free `font_extra'. - -2017-09-30 Alexei Podtelezhnikov <apodtele@gmail.com> - - Signedness fixes in bitmap presetting. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3514. - - * src/raster/ftrend1.c (ft_raster1_render): Explicitly signed height. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto. - * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Explicitly unsigned - subtraction. - -2017-09-29 Alexei Podtelezhnikov <apodtele@gmail.com> - - Bitmap metrics presetting [2/2]. - - * src/base/ftobjs.c (FT_Load_Glyph): Preset the bitmap metrics when - appropriate but `FT_Render_Glyph' is not called. - * include/freetype/freetype.h (FT_GlyphSlotRec): Document the change. - -2017-09-28 Alexei Podtelezhnikov <apodtele@gmail.com> - - [smooth, raster] Miscellaneous cleanups. - - * src/raster/ftrend1.c (ft_raster1_render): Clean up the exit. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Reduce - translations and clean up the exit. - (ft_smooth_render_lcd, ft_smooth_render_lcd): Remove unused `error'. - -2017-09-28 Ben Wagner <bungeman@google.com> - - [truetype] Really, really fix #52082. - - * src/truetype/ttinterp.c (Ins_MDRP): Correct conditional. - -2017-09-28 Werner Lemberg <wl@gnu.org> - - * src/psaux/psintrp.c (cf2_doStems): Fix integer overflow. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3510 - -2017-09-28 Ewald Hew <ewaldhew@gmail.com> - - * src/cid/cidgload.c (cid_slot_load_glyph): Fix memory leak. - - Reported as - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3489 - -2017-09-28 Alexei Podtelezhnikov <apodtele@gmail.com> - - Bitmap metrics presetting [1/2]. - - This mainly just extracts the code for presetting the bitmap metrics - from the monochrome, grayscale, and LCD renderers into a separate - function. - - * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): New function that - calculates prospective bitmap metrics for the given rendering mode. - * include/freetype/internal/ftobjs.h (ft_glyphslot_preset_bitmap): - Declare it. - - * src/base/ftlcdfil.c (ft_lcd_padding): New helper function that adds - padding to CBox taking into account pecularities of LCD rendering. - * include/freetype/ftlcdfil.h (ft_lcd_padding): Declare it. - - * src/raster/ftrend1.c (ft_raster1_render): Reworked to use - `ft_glyphslot_preset_bitmap'. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto. - (ft_smooth_render_lcd, ft_smooth_render_lcd): The pixel_mode setting - is moved to `ft_glyphslot_preset_bitmap'. - -2017-09-28 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Fix compiler warning. - - * src/psaux/pshints.c (cf2_hintmap_dump): Add switch for tracing - code. - -2017-09-27 Werner Lemberg <wl@gnu.org> - - * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning. - -2017-09-25 Werner Lemberg <wl@gnu.org> - - [psaux] Fix compiler warnings. - - * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant - test. - - * src/psaux/psintrp.c (cf2_interpT2CharString) - <cf2_escCALLOTHERSUBR>: Add casts. - - * src/psaux/psobjs.c (ps_decoder_init): Add cast. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Minor fixes. - - * include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}: - Rearrange `ps_builder_init' arguments to conventional order. - - * src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and - notice for `SubFont' in Type 1 mode. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Move `psdecode' into `psobjs'. - - As the former only contains a single procedure, move it into - `psobjs' for simplicity. Also change the parameter order to the - conventional one. - - * src/psaux/psdecode.c (ps_decoder_init): Moved to... - * src/psaux/psobjs.c: ...Here. - * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto. - - * include/freetype/internal/psaux.h (PSAux_ServiceRec): Update - `ps_decoder_init' function signature. - - * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c: - Update calls. - - * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes. - - * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC): - Update file references. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Fix Type 1 hinting. - - Type 1 hinting breaks sometimes when mid-charstring hints should - have been in the initial hintmap. This fix adds a preprocessing - pass that reads all hints and builds the correct initial hintmap - first, before proceeding to build the glyph outline. - - * src/psaux/psintrp.c (cf2_interpT2CharString): New - `initial_map_ready' boolean flag. - Ignore outline commands and hint changes on first pass. - <cf2_cmdENDCHAR>: Add section to build hintmap and rewind. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Add tracing for hints. - - * src/psaux/pshints.c (cf2_hintmap_dump): New function. - (cf2_hintmap_insertHint): Trace incoming and inserted hints. - (cf2_hintmap_build): Dump hintmap before and after hint adjustment. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Minor fixes. - - * src/psaux/psintrp.c (cf2_interpT2CharString): Fix check for pop - results. - s/font->decoder/decoder/ where necessary. - <cf2_cmdHSTEM, cf2_cmdVSTEM, cf2_escHSTEM3, cf2_escVSTEM3>: Use - offset parameter in `cf2_doStems' instead of doing correction for - left-sidebearing. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [cid] Use the new engine. - - * src/cid/cidgload.c: Update includes. - (cid_load_glyph, cid_slot_load_glyph): Implement changes to glyph - loading code as with `type1' module. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [cid] Add Adobe engine configuration. - - This is similar to what was done in the `type1' module. - - * src/cid/cidriver.c (t1cid_driver_class): Update declaration. - * src/cid/cidobjs.c: Include FT_TYPE1_DRIVER_H. - (cid_driver_init): Update code. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Change subfont synthesis for CID fonts. - - Change `t1_make_subfont' to take in the Private dict record as an - argument. This is because Type 1 and CID font records in FreeType - have this in different places. - - * src/psaux/psobjs.c (t1_make_subfont): Change `T1_Face' to - `FT_Face' so that CID is also accepted. - Take `PS_Private' as an argument and let caller figure out where the - Private dict actually is. - Update references. - - * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update - declaration. - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update - call. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [type1] Switch to Adobe engine. - - * src/type1/t1objs.c (T1_Driver_Init): Set default to Adobe engine. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (seac). - - This concludes the changes needed to add Type 1 support. - - * src/psaux/psintrp.c: Update includes. - (cf2_interpT2CharString) <cf2_escSEAC>: Implement this similarly to - implied seac for CFF. - - * src/psaux/t1decode.c (t1_lookup_glyph_by_stdcharcode_ps): New - function to look up the glyph index. - - * src/psaux/psft.c (cf2_getT1SeacComponent, - cf2_freeT1SeacComponent): New functions to get the charstrings for - seac components. - - * src/psaux/t1decode.h, src/psaux/psft.h: Update declarations. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (flex in callothersubr). - - * src/psaux/psintrp.c (cf2_interpT2CharString) - <cf2_escCALLOTHERSUBR>: Fix Flex feature handling (OtherSubrs 0, 1, - 2). - <cf2_cmdRMOVETO>: Do not actually move the `glyphPath' while doing - flex. This is to avoid closing the current contour. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (callothersubr). - - * src/psaux/psintrp.c (cf2_interpT2CharString) - <cf2_escCALLOTHERSUBR>: Copy code from - `t1_decoder_parse_charstrings' (in `t1decode.c'). - OtherSubr 3 (change hints) should reset the hintmask, so that the - new hints are applied. - Fix function calls and stack access. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (pop). - - * src/psaux/psintrp.c (cf2_interpT2CharString): Change how unhandled - OtherSubr results are stored. Implement the PostScript stack using - an array. - <cf2_escPOP>: Ensure that the stack is not cleared after getting - `OtherSubr' results. - Fix stack access. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (callsubr). - - * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdCALLSUBR>: - Type 1 mode. - - * src/psaux/psft.c (cf2_initLocalRegionBuffer): Add Type 1 mode. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (div, four-byte numbers). - - * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escDIV>: Add - Type 1 mode. Type 1 requires large integers to be followed by - `div'; cf. `Adobe Type 1 Font Format', section 6.2. - <op == 255>: Push Type 1 four-byte numbers as `Int' always. This is - to ensure `div' and `callsubr' get values they can use. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (hints). - - * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM, - cf2_cmdVSTEM>: Add correction for left sidebearing in Type 1 mode. - Allow adding hints mid-charstring. - <cf2_escVSTEM3, cf2_escHSTEM3>: Translate into equivalent commands - for three normal stem hints. This requires some recalculation of - stem positions. - Correction for left sidebearing. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (hsbw, sbw). - - * src/psaux/psintrp.c (cf2_doStems): `hsbw' or `sbw' must be the - first operation in a Type 1 charstring. - (cf2_interpT2CharString): Remove unused variables. - <cf2_cmdHMOVETO, cf2_cmdVMOVETO, cf2_cmdRMOVETO>: `hsbw' or `sbw' - must be the first operation in a Type 1 charstring. - <cf2_cmdHSBW, cf2_escSBW>: Fix data access and add correction for - left sidebearing. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (setcurrentpoint). - - * src/psaux/psintrp.c (cf2_interpT2CharString) - <cf2_escSETCURRENTPT>: Fix stack access. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Extend Adobe interpreter (closepath). - - * src/psaux/psintrp.c (cf2_interpT2CharString) <c2f_cmdCLOSEPATH>: - Use the right builder function. We can use the `haveWidth' boolean - already present, instead of implementing `parse_state'. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Add Type 1 operations to Adobe CFF interpreter. - - The following Type 1 specific ops have been added (copied from - `t1decode'): - - closepath - vstem3 - hstem3 - seac - sbw - callothersubr - pop - setcurrentpoint - hsbw - - The following require a Type 1 mode, because of differences in - specification: - - hstem - vstem - vmoveto - callsubr - div - rmoveto - hmoveto - Numbers - - The subsequent commits will implement these changes and adapt - accesses of data and objects to the new interpreter. - - NOTE: Will not compile in the meantime! - - * src/psaux/psintrp.c: Add opcodes to enum. - (cf2_interpT2CharString): Copy relevant code over from - `t1_decoder_parse_charstrings' (in `t1decode.c'). - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [type1] Fixes for rendering. - - The Type 1 advance width calculation passes null for glyph slot, - etc, which can cause null pointer access in the new interpreter. - Fall back to the old one for now. - - Fix the large glyph retry code and ensure hinting and scaling flags - are set properly. - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add a - check for metrics_only. - Set the `force_scaling' flag. - (T1_Parse_Glyph): Updated. - (T1_Load_Glyph): Add `hinting' and `scaled' flags. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Add missing objects (2/2). - - Synthesize a `SubFont' object for Type 1 fonts. This is used in the - interpreter to access Private dict data, which are stored in - different places for Type 1 and CFF. This allows the same data to - be used in either mode. - - * src/psaux/psobjs.c (t1_make_subfont): New procedure to copy - required values to a dummy `CFF_SubFont' object. This is similar to - `cff_make_private_dict'. - * src/psaux/psobjs.h: Add the new declaration. - - * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Ditto. - Add this to the PSAux Service for future use with CID fonts. - - * src/type1/t1gload.c: Include FT_INTERNAL_CFF_TYPES_H. - (T1_Parse_Glyph_And_Get_Char_String): Add the call. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Add missing objects for Type 1 (1/2). - - Move `CF2_Font' instance to `PS_Decoder'. This is the context for - the interpreter and since it is currently stored in `CFF_Font', is - unavailable in Type 1 mode. - - * include/freetype/internal/psaux.h (T1_Decoder, PS_Decoder): New - `cf2_instance' field. - - * src/psaux/psdecode.c (ps_decoder_init): Copy `cf2_instance' to - `PS_Decoder'. - - * src/psaux/t1decode.c (t1_decoder_done): Add finalization code. - - * src/psaux/psft.c (cf2_decoder_parse_charstrings): Update accesses. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - Allow `type1' module to use the Adobe engine. - - Add the callback and some conditionals to switch between the two - engines. - - * include/freetype/internal/psaux.h (T1_Decoder_FuncsRec): Change - function declarations. - * src/psaux/psauxmod.c (T1_Decoder_FuncsRec): Register the - callbacks. - - * src/psaux/psobjs.c (ps_builder_add_point): Add conditionals for - number conversion. - - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add code - to choose which renderer to use. - - * src/cid/cidgload.c (cid_load_glyph): Update call. - * src/base/ftobjs.c, src/psaux/psobjs.c, src/type1/t1gload.c: Update - includes. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [type1] Add Adobe engine configuration. - - Use the previously changed PS_Driver in type1 module to store - hinting engine configuration. - - * include/freetype/ftt1drv.h: New file. - Duplicate and rename config options from CFF. - * include/freetype/config/ftheader.h (FT_TYPE1_DRIVER_H): New macro. - - * src/type1/t1driver.c (t1_driver_class): Update declaration. - * src/type1/t1objs.c: Include FT_TYPE1_DRIVER_H. - (T1_Driver_Init): Update code. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [cff] Move and rename `CFF_Driver'. - - This is so that we can use the same hinting engine parameters for - Type 1. - - * include/freetype/internal/cffotypes.h (CFF_Driver): Rename and - move to... - * include/freetype/internal/psaux.h (PS_Driver): ...here. - - * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffload.c, - src/cff/cffobjs.c, src/cff/cffobjs.h, src/psaux/psft.c, - src/psaux/psobjs.c: Update references. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux, type1] Reorganize object fields. - - Make some fields more generic, so that we can access them the same - way regardless of Type 1 or CFF. - - * include/freetype/internal/psaux.h (PS_Builder): Change `TT_Face' - to `FT_Face'. - Remove unused fields. - - * src/psaux/psft.c: Update all accesses of `PS_Builder.face'. - Add some asserts to guard against casting `T1_Face' as `TT_Face'. - - * src/type1/t1objs.h (T1_GlyphSlot): Reorder fields to follow - `CFF_GlyphSlot', so that we can pretend they are the same in the - interpreter. - - * src/psaux/psobjs.c (ps_builder_init, ps_builder_add_point): - Updated with above changes. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Prepare for Type 1 mode. - - Add some checks for Type 1 data passing through. - - * src/psaux/psfont.h (CF2_Font): Add `isT1' flag. - * src/psaux/psfont.c (cf2_font_setup): Skip the variations and blend - code which is not applicable for Type 1. - - * src/psaux/psft.c (cf2_decoder_parse_charstrings): Avoid accessing - `decoder->cff' in Type 1 mode. - Copy `is_t1' flag to `CF2_Font'. - -2017-09-25 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Use the new objects. - - * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Fix - switching between new and old engines. - - * src/cff/cffgload.c, src/cff/cffparse.c: Update calls. - - * src/psaux/psblues.c, src/psaux/psfont.c, src/psaux/psfont.h, - src/psaux/psft.c, src/psaux/psft.h, src/psaux/psintrp.c: Update all - to use new objects. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Objects for new interpreter (part 2). - - Make the new objects copy over values. They are essentially wrapper - types for the different decoders/builders. - - * include/freetype/internal/psaux.h: Update declarations. - (PS_Builder): Add `is_t1' flag. - (PS_Decoder_{Get,Free}_Glyph_Callback): Renamed to... - (CFF_Decoder_{Get,Free}_Glyph_Callback: ... this. - (PS_Decoder): Updated. - Add `t1_parse_callback' member. - (PSAux_ServiceRec): Add `ps_decoder_init' member. - - * src/psaux/psdecode.h, src/psaux/psobjs.h: Update declarations. - - * src/psaux/psdecode.c, src/psaux/psobjs.c: Implement copy with two - modes. - - * src/psaux/psauxmod.c: Add builder and decoder functions to `PSAux' - service. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Add objects for new interpreter. - - Introduce `PS_Decoder' and `PS_Builder' which include all fields - from either Type 1 or CFF decoders/builders. - - * include/freetype/internal/psaux.h (PS_Builder, PS_Decoder): New - structs. - - * src/psaux/psobjs.c, src/psaux/psobjs.h: Add `PS_Builder' - functions. - - * src/psaux/psdecode.c, src/psaux/psdecode.h: New files to hold - `PS_Decoder' initialization functions. - - * src/psaux/psaux.c, src/psaux/Jamfile (_sources), - src/psaux/rules.mk (PSAUX_DRV_SRC): Updated. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Rename files. - - Replace the `cf2' file name prefix with `ps' as the Adobe engine - will be used for both PostScript Types 1 and 2 (CFF) instead of just - CFF. - - s/cf2/ps/ for all following. - - * src/psaux/cf2*: Rename files. - * src/psaux/*: Update includes. - - * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRC_SRC, - PSAUX_DRV_H): Update file references. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux] Minor fix. - - Use `MultiMasters' service in `psaux' instead of a call to `cff'. - The project builds if CFF_CONFIG_OPTION_OLD_ENGINE is not defined. - - * src/psaux/cf2ft.c: Update includes. - (cf2_getNormalizedVector): Use `mm->get_var_blend' instead of - `cff_get_var_blend'. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Move `cff_random' into `psaux' service. - - NOTE: Does not compile! - - Minor fix to allow both `cff' and `psaux' to use `cff_random'. - - * src/cff/cffload.c (cff_random): Move to... - * src/psaux/psobjs.c: Here. - * src/cff/cffload.h: Move corresponding declaration to - `src/psaux/psobjs.h'. - - * include/freetype/internal/psaux.h (PSAux_ServiceRec): Register the - function here... - * src/psaux/psauxmod.c: And here. - - * src/cff/cffload.c, src/psaux/cf2intrp.c: Update code. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [cff] Move struct declarations to `freetype/internal'. - - NOTE: Does not compile! - - This is so that the CFF functions moved to `psaux' can access the - same structs that they need. - - * src/cff/cfftypes.h: Moved to... - * include/freetype/internal/cfftypes.h: ...Here. - - * src/cff/cffobjs.h: Moved the struct declarations to... - * include/freetype/internal/cffotypes.h: ... this new file. - - * include/freetype/internal/internal.h (FT_INTERNAL_CFF_TYPES_H, - FT_INTERNAL_CFF_OBJECT_TYPES_H): New macros. - - * src/cff/cffcmap.h, src/cff/cffdrivr.c, src/cff/cffgload.c, - src/cff/cffgload.h, src/cff/cffload.h, src/cff/cffobjs.c, - src/cff/cffobjs.h, src/cff/cffparse.h, src/psaux/psobjs.h, - include/freetype/internal/psaux.h, - include/freetype/internal/services/svcfftl.h: Update includes. - - * src/cff/rules.mk (CFF_DRV_H): Updated. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Add new service for inter-module calls. - - NOTE: Does not compile! - - This is to allow CFF functions moved to `psaux' to call functions - declared in `src/cff/cffload.h'. - - * include/freetype/internal/services/svcfftl.h: New file, setting up - a `CFFLoad' service. - - * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC10, - FT_DEFINE_SERVICEDESCREC): New macros. - (FT_SERVICE_CFF_TABLE_LOAD_H): New macro. - - * src/cff/cffdrivr.c, src/cff/cffpic.h: Register the new service. - - * src/cff/cfftypes.h (CFF_FontRec), src/psaux/cf2font.h - (CF2_FontRec): Add service interface. - - * src/cff/cffobjs.c, src/psaux/cf2font.c, src/psaux/cf2ft.c, - src/psaux/cf2intrp.c, src/psaux/cffdecode.c: Use the new service. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Add callbacks for inter-module calls. - - NOTE: Does not compile! - - * include/freetype/internal/psaux.h: Add function pointer - declarations. - - * src/psaux/cffdecode.c (cff_decoder_init): Update to take in - callbacks. - * src/psaux/cffdecode.h: Ditto. - - * src/cff/cffgload.c (cff_compute_max_advance, cff_slot_load): - Update calls to pass in callbacks. - * src/psaux/cf2ft.c, src/psaux/cffdecode.c: Use them. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Create new `PSAux' service interface entries. - - NOTE: Does not compile! - - * include/freetype/internal/psaux.h: Include - FT_INTERNAL_TRUETYPE_TYPES_H. - (CFF_Builder_FuncsRec, CFF_Decocer_FuncsRec): New function tables. - (CFF_Builder): Updated. - Fix for forward declaration. - (PSAux_ServiceRec): New field `cff_decoder_funcs'. - - * src/psaux/psauxmod.c (cff_builder_funcs, cff_decoder_funcs): New - function tables. - (PSAux_Interface): Updated. - - * include/freetype/internal/tttypes.h (TT_FaceRec): Add `psaux' - service interface. - - * src/cff/cffgload.c, src/cff/cffobjs.c, src/cff/cffparse.c: Update - function calls to use psaux service. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Move CFF builder components into `psaux' module. - - NOTE: Does not compile! - - * src/cff/cffgload.c - (cff_builder_{init,done,add_point,add_point1,add_contour,start_point,close_contour}, - cff_check_points): Move to... - * src/psaux/psobjs.c: Here. - - * src/cff/cffgload.h: Move corresponding declarations to - `src/psaux/psobjs.h'. - - * src/cff/cffgload.h (CFF_Builder): Move struct declaration to... - * include/freetype/internal/psaux.h: Here. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Move CFF decoder components into `psaux' module. - - NOTE: Does not compile! - - * src/cff/cffgload.c (CFF_Operator, - CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts, - cff_operator_seac, cff_compute_bias, - cff_lookup_glyph_by_stdcharcode, - cff_decoder_{parse_charstrings,init,prepare}): Move to... - * src/psaux/cffdecode.c: This new file. - - * src/cff/cffgload.h: Move corresponding declarations to... - * src/psaux/cffdecode.h: This new file. - - * src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS}, - CFF_Decoder_Zone, CFF_Decoder): Move declarations to... - * include/freetype/internal/psaux.h: Here. - - * src/psaux/cf2ft.h: Update include. - - * src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with - the new file. - -2017-09-24 Ewald Hew <ewaldhew@gmail.com> - - [psaux, cff] Move Adobe's engine components into `psaux' module. - - This is the first patch of a sequence to move the Type 2 charstring - processing capability from the `cff' module to the `psaux' module. - - NOTE: Does not compile! - - * src/cff/cf2*: Move these files to... - * src/psaux/cf2*: Here. - - * src/cff/Jamfile (_sources), src/cff/rules.mk (CFF_DRV_SRC, - CFF_DRV_H), src/cff/cff.c, src/cff/cffgload.c: Remove file - references. - - * src/psaux/Jamfile (_sources), src/psaux/rules.mk, src/psaux/psaux.c - (PSAUX_DRV_SRC, PSAUX_DRV_H): Add file references. - -2017-09-24 Alexei Podtelezhnikov <apodtele@gmail.com> - - Tweak per-face LCD filtering controls. - - Thing are simpler with a NULL-function pointer. - - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New - pointer to the filter function. - (FT_LibraryRec): Remove unused `lcd_filter'. - (FT_Bitmap_LcdFilterFunc, ft_lcd_filter_fir): Move from here... - * include/freetype/ftlcdfil.h (FT_Bitmap_LcdFilterFunc, - ft_lcd_filter_fir): ... to here. - - * src/base/ftobjs.c (ft_open_face_internal): NULL-initialize the - per-face filter. - (FT_Face_Properties): Set it. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Simplify. - - * src/base/ftlcdfil.c (ft_lcd_filter_fir, FT_Libary_SetLcdFilter): - Minor. - -2017-09-24 Jonathan Kew <jfkthame@gmail.com> - - [sfnt] Fix `premultiply_data' (#52092). - - * src/sfnt/pngshim.c (premultiply_data): Don't use vector extension - if we have less than 16 bytes of data. - -2017-09-24 Werner Lemberg <wl@gnu.org> - - [otvalid] Fix handling of ValueRecords. - - For GPOS pair positioning format 1 the description of ValueRecords - in the OpenType specification (1.8.2, from today) is wrong – the - offset has to be taken from the parent structure; in this case the - `PairSet' table. - - * src/otvalid/otvgpos.c (otv_PairSet_validate): Set `extra3'. - (otv_PairPos_validate): Adjust. - -2017-09-23 Werner Lemberg <wl@gnu.org> - - [otvalid] Handle `GSUB' and `GPOS' v1.1 tables. - - * src/otvalid/otvgsub.c (otv_GSUB_validate), src/otvalid/otvgpos.c - (otv_GPOS_validate): Implement it. - -2017-09-23 Werner Lemberg <wl@gnu.org> - - [otvalid] Update common table handling to OpenType 1.8.2. - - * src/otvalid/otvcommn.c (otv_Device_validate): Handle - VariationIndex subtable. - (otv_Lookup_validate): Handle MarkFilteringSet. - -2017-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Windows-style DLL versioning. - - * build/windows/ftver.rc: New VERSIONINFO resource. - * build/windows/vc2010/freetype.vcxproj: Further improvements. - -2017-09-23 Ben Wagner <bungeman@google.com> - - [truetype] Really fix #52082. - - * src/truetype/ttinterp.c (Ins_MDRP): Correct conditional. - -2017-09-23 Werner Lemberg <wl@gnu.org> - - [otvalid] Handle `GDEF' v1.2 and v1.3 tables. - - No validation of variation stuff yet. - - * src/otvalid/otvgdef.c (otv_MarkGlyphSets_validate): New function. - (otv_GDEF_validate): Implement it. - -2017-09-22 Werner Lemberg <wl@gnu.org> - - [otvalid] Handle `BASE' v1.1 table. - - No validation of variation stuff yet. - - * src/otvalid/otvbase.c (otv_BASE_validate): Implement it. - -2017-09-22 Werner Lemberg <wl@gnu.org> - - [otvalid] Macros for 32bit offset support. - - * src/otvalid/otvcommn.h (OTV_OPTIONAL_TABLE32, - OTV_OPTIONAL_OFFSET32, OTV_SIZE_CHECK32): New macros. - -2017-09-21 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Simplify Visual C++ 2010 project. - - * build/windows/vc2010/freetype.vcxproj: Remove fake singlethreaded - configurations and tweak. - -2017-09-21 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflow (#52082). - - * src/truetype/ttinterp.c (Ins_MDRP): Avoid FT_ABS. - -2017-09-21 Werner Lemberg <wl@gnu.org> - - [sfnt] Fix postscript name for default instance of variation fonts. - - Problem reported by Behdad. - - * src/sfnt/sfdriver.c (sfnt_get_ps_name): Test - `is_default_instance'. - -2017-09-21 Werner Lemberg <wl@gnu.org> - - [truetype] Fix `mmvar' array pointers, part 2. - - The previous commit was incomplete. - - * src/truetype/ttgxvar.c: Properly initialize sub-array offsets for - `master' also. - -2017-09-21 Werner Lemberg <wl@gnu.org> - - [truetype] Fix `mmvar' array pointers. - - Without this change, clang's AddressSanitizer reports many runtime - errors due to misaligned addresses. - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use multiples of pointer - size for sub-array offsets into `mmvar'. - -2017-09-20 Werner Lemberg <wl@gnu.org> - - [truetype] Integer overflows. - - Changes triggered by - - https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3429 - - * src/truetype/ttinterp.c (Ins_SHPIX, Ins_DELTAP): Use NEG_LONG. - (Ins_MIAP): Use SUB_LONG. - -2017-09-19 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Fix DLL builds in Visual C++ project. - - * build/windows/vc2010/freetype.vcxproj: Use DynamicLibrary in Debug - and Release configurations. - * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF) - [_DLL]: Use Visual C++ extensions. - -2017-09-19 John Tytgat <John.Tytgat@esko.com> - - [cff] Fix family name logic of pure CFF fontdata (#52056). - - 1. If `FamilyName' is present in the CFF font, use this for - FT_Face's `family_name'. - 2. Otherwise, use the face name and chop off any subset prefix. - 3. If at this point FT_Face's `family_name' is set, use this - together with the full name to determine the style. - 4. Otherwise, use `CIDFontName' as FT_Face's `family_name'. - 5. If we don't have a valid style, use "Regular". - - Previously, FT_Face's `family_name' entry for pure CFF fontdata - nearly always was the fontname itself, instead of the `FamilyName' - entry in the CFF font (assuming there is one). - - * src/cff/cffobjs.c (cff_face_init) [pure_cff]: Implement it. - -2017-09-18 Alexei Podtelezhnikov <apodtele@gmail.com> - - [build] Declutter Visual C++ 2010-2017 project. - - * build/windows/vc2010/freetype.vcxproj: Use MaxSpeed (/02) - optimization for Release configuration throughout the project. - ---------------------------------------------------------------------------- -Copyright (C) 2017-2019 by +Copyright (C) 2018-2021 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, |