2021-01-15 Nikolaus Waxweiler [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 * src/tools/update-copyright-year: Fix single-year entry handling. 2021-01-16 Alexei Podtelezhnikov * builds/unix/unixddef.mk: Remove the second DEVEL_DIR definition. 2021-01-14 Dominik Röttsches [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 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 [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 [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 [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 [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 [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 [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 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 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 * builds/*: s/BUILD_DIR/PLATFORM_DIR/. The old variable name caused confusion. 2021-01-08 Alexei Podtelezhnikov [builds] Revert `FTMODULE_H' changes. * builds/toplevel.mk, builds/freetype.mk: Revert changes. 2021-01-07 Alexei Podtelezhnikov [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 [builds] Relocate `FTMODULE_H'. * builds/toplevel.mk: Place `FTMODULE_H' in include/. * builds/freetype.mk: Simplify included path. 2021-01-07 Werner Lemberg 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 [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 * meson.build: Add summary. Based on a patch from Vincent Torri . 2021-01-06 Torsten Hilbrich * meson.build: Fix 'png' build option (#59458). Without this patch, 'png' is always required. 2021-01-04 Alexei Podtelezhnikov [builds/windows] Add SDF to VC2010 project. * builds/windows/vc2010/freetype.vcxproj: Updated; AfterBuild conveniences. 2020-12-26 Werner Lemberg [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 * src/base/ftobjs.c (pixel_modes): Updated. 2020-12-26 Anuj Verma [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 [sdf] Fix `make multi`. * src/sdf/ftsdf.c: Include `ftoutln.h`. 2020-12-24 Werner Lemberg [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 [sdf] Add debugging function. * src/sdf/ftsdf.c (sdf_shape_dump): New function. 2020-08-20 Anuj Verma [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 [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 [sdf] Add function to copy SDF data into output bitmap. * src/sdf/ftbsdf.c (finalize_sdf): New function. 2020-08-20 Anuj Verma [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 [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 [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 [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 [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 [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 [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 [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 [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 [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 [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 [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 [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 [sdf] Add function to resolve corner distances. * src/sdf/ftsdf.c (resolve_corner): New function. 2020-08-18 Anuj Verma [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 [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 [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 [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 [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 [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 [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 [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 [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 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 [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 * 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 * meson.build (ft2_defines): Fix builds on Windows. 2020-12-18 Tatsuyuki Ishi [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 * 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 [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 [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 * builds/unix/configure.raw: Don't set `FT_DEBUG_LOGGING`. All debug options are handled exclusively in `ftoption.h`. 2020-12-07 Werner Lemberg * src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`. 2020-12-07 Werner Lemberg */*: s/FT_LOGGING/FT_DEBUG_LOGGING/. 2020-12-05 Werner Lemberg * builds/toplevel.mk (do-dist): Remove `submodules` directory. 2020-12-02 Werner Lemberg * 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 [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 * submodules/dlg: Updated to commit 9f0c8b22. 2020-12-02 Werner Lemberg * src/bdf/bdflib.c: Fix `-Wformat` warning. 2020-12-02 Werner Lemberg 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 [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 [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 * src/type42/t42parse.c: Fix `-Wformat` warnings. 2020-12-01 Priyesh Kumar [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 [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 Update logging related documentation. * docs/DEBUG: Updates related to `FT_LOGGING`. * README.git: Updates related to logging. 2020-11-30 Priyesh Kumar * src/*: Fix `-Wformat` warnings. 2020-11-30 Priyesh Kumar [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 [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 [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 [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 [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 [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 * .gitmodules: Add 'dlg' library's git repository as submodule. 2020-12-01 Werner Lemberg * src/tools/chktrcmp.py (trace_use_pat): Update to current use. 2020-11-20 Alexei Podtelezhnikov [cff,cid,type1] Demote old engine for lack of CFF2. * src/cff/cffobjs.c (cff_iriver_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 * src/type42/t42parse.c (t42_parse_sfnts): More tracing messages. 2020-11-04 Werner Lemberg * 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 [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 * 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 * 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 * 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 [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 * src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++. 2020-10-17 Alexei Podtelezhnikov * src/sfnt/sfwoff2.c (Read255UShort): Tweak types to please VC++. 2020-10-10 Werner Lemberg * 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 [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 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 * 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 . 2020-09-24 Werner Lemberg * src/base/ftobjs.c (FT_Load_Glyph): Trace glyph metrics. 2020-09-22 Werner Lemberg [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 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-.tar.gz freetype-.tar.xz ft.zip 2020-09-21 Werner Lemberg * scripts/extract_freetype_version.py: Fix regex typos. 2020-09-21 David Turner 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