Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| d6022b6d | 2025-07-26 07:00:51 | [smooth] Remove usage of setjmp and longjmp. To support WASM targets with slow or unsupported setjmp and longjmp, we eliminate these calls in favor of an error propagation model. When gray_set_cell is out of cells, it raises an exception which is later handled in gray_convert_glyph_inner. This is a less invasive alternative to !385. * src/smooth/ftgrays.c (gray_set_cell): Raise the overflow exception and redirect all work to `cell_null`. (gray_move,line,conic,cubic_to): Return the exception. (gray_convert_glyph, gray_convert_glyph_inner): Handle the exception. | ||
| b04db387 | 2025-07-04 19:52:53 | [sfnt] Rewrite GPOS kerning support. (2/2) The previous code had a fundamental flaw: it didn't validate the necessary parts of the 'GPOS' table before accessing it, causing crashes with malformed data (since `TT_CONFIG_OPTION_GPOS_KERNING` is off by default, standard fuzzers don't catch these problems). Additionally, it did a lot of parsing while accessing kerning data, making it rather slow. The new implementation fixes this. After validation, offsets to the 'GPOS' lookup subtables used in the 'kern' feature that correspond to 'simple' kerning (i.e., similar to 'kern' table kerning) are stored in `TT_Face`; this greatly simplifies and accelerates access to the kerning data. Testing with font `SF-Pro.ttf` version '1.00', the validation time for the 'GPOS' table increases the start-up time of `FT_New_Face` by less than 1%, while calls to `FT_Get_Kerning` become about 3.5 times faster. * include/freetype/internal (gpos_kerning_available): Replace with... (gpos_lookups_kerning, num_gpos_lookups_kerning): ... these new fields. Update callers. * src/ttgpos.c [TT_CONFIG_OPTION_GPOS_KERNING]: A new implementation. | ||
| ecbc1abf | 2025-07-04 06:12:34 | [cff] Support GPOS kerning. * src/cff/cffdrivr.c (cff_get_kerning) [TT_CONFIG_OPTION_GPOS_KERNING]: Add code similar to the one in `tt_get_kerning`. | ||
| fb6a7426 | 2025-07-04 06:03:37 | * src/sfnt/ttkern.h (TT_FACE_HAS_KERNING): Remove macro. Given that we also support (limited) 'GPOS' table kerning if `TT_CONFIG_OPTION_GPOS_KERNING` is defined, the name of this macro is misleading since it only is true for 'kern' table kerning. * src/sfnt/sfobjs.c (sfn_load_face): Replace `TT_FACE_HAS_KERNING` with plain code. | ||
| 8ef26a80 | 2025-07-04 19:50:48 | [sfnt] Rewrite GPOS kerning support. (1/2) This commit removes the previous implementation. | ||
| 0fd0cf33 | 2025-07-01 22:15:07 | [autofit] Remove `globals->gsub_length`. We completely validate the accessed data from the 'GSUB' table, making this field unnecessary. * src/autofit/afglobal.h (AF_FaceGlobalsRec): Remove `gsub_length` field. * src/autofit/afglobal.c (af_face_globals_new), src/autofit/afgsub.c (af_parse_gsub): Updated. | ||
| f1cd6dbf | 2025-07-01 21:32:47 | * src/truetype/ttobjs.c (tt_size_init_bytecode): Correct previous fix. `FT_NEW_ARRAY` expects a signed value, not an unsigned one. | ||
| 5e671510 | 2025-07-01 18:09:27 | * src/autofit/afgsub.c: Include `tttables.h` and `afgsub.h`. This fixes 'make multi' compilation with clang. Reported as https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/381#note_2984610 | ||
| 01695ea7 | 2025-07-01 18:06:17 | Various minor fixes. As reported by clang 19. * src/autofit/afadjust.c (adjustment_database): Make it static. * src/base/ftdbgmem.c (FT_MEM_SIZE_MIN): Remove unused macro. * src/psaux/psobjs.c (skip_procedure), src/truetype/ttinterp.c (Ins_IF, Ins_ELSE, Ins_FDEF, Ins_IDEF): Add `default` clause. | ||
| f1be7392 | 2025-07-01 18:00:12 | More signedness fixes. As reported by clang 19. * src/autofit/afadjust.c (add_substitute): Make first argument unsigned. Update all callers. Other minor signedness fixes. (af_reverse_character_map_new): Minor signedness fixes. * src/autofit/afgsub.c (af_hash_insert): Minor signedness fixes. * src/autofit/aflatin.c (af_glyph_hints_apply_vertical_separation_adjustments): Make third argument unsigned. Update all callers. Other minor signedness fixes. (af_latin_hints_apply): Minor signedness fixes. * src/bdf/bdflib.c (bdf_parse_bitmap_): Minor signedness fix. * src/truetype/ttobjs.c (tt_size_init_bytecode): Minor signedness fix. | ||
| 8d82c9fa | 2025-07-01 17:08:37 | */*: Fix trivial signedness issues with format strings in trace messages. As reported with clang 19's `-Wformat` option. | ||
| 346d8fae | 2025-07-01 05:16:54 | Fix `make multi`. Reported as https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/381#note_2984253 * src/base/fthash.c: Include `ftobjs.h`. * src/autofit/afgsub.c: Include `afglobal.h`. | ||
| 39d85f16 | 2025-06-30 09:32:19 | * MSBuild.sln: Minor. | ||
| d7e640b9 | 2025-06-29 07:45:09 | [doc] Revise font variation API. | ||
| 636aede9 | 2025-06-28 20:25:29 | [doc] Use 'Adobe MM', 'TrueType GX', and 'OpenType Font Variations'. | ||
| 61bacf3d | 2025-06-18 14:57:56 | Set minimum HarfBuzz version back to 2.0.0. Due to the new GSUB parsing we no longer need `hb_ot_layout_lookup_get_glyph_alternates`. This partially reverts commit 5d2fd7608a9. * CMakeLists.txt (HARFBUZZ_MIN_VERSION), meson.build (harfbuzz_dep), builds/unix/configure.raw (harfbuzz_pkg): Set version to 2.0.0. * src/autofit/ft-hb-decls.h: Remove entry for `hb_ot_layout_lookup_get_glyph_alternates`. | ||
| 6a982bde | 2025-06-14 16:21:44 | [autofit] Speed up computation of `af_reverse_character_map_new`. (4/4) With this commit, the start-up time for creating the reverse character map gets reduced from more than 300% to about 25% (as tested with `arial.ttf` version 7.00). * src/autofit/afadjust.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include `afgsub.h`. (add_substitute): New auxiliary function to recursively add elements to the reverse cmap. (af_reverse_character_map_new): New code that replaces the old code removed in the previous commit. | ||
| 9e8b642b | 2025-06-13 11:39:43 | [autofit] Speed up computation of `af_reverse_character_map_new`. (3/4) Rip out some HarfBuzz code of `af_reverse_character_map_new`. The new code comes immediately in a follow-up commit, making it easier to follow the changes. * src/autofit/afadjust.c (af_get_glyph_alternates_helper, af_get_glyph_alternates): Remove. (af_reverse_character_map_new): Remove code to create the `*map` hash. | ||
| 9bfb8e80 | 2025-06-13 11:27:09 | [autofit] Speed up computation of `af_reverse_character_map_new`. (2/4) Create an array of GSUB lookup indices for `SingleSubst` and `AlternateSubst` lookup types to exit early if we have different types. Also improve tracing. * src/autofit/afglobal.h (AF_FaceGlobals) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New fields `gsub_length`, `gsub`, and `gsub_lookups_single_alternate`. * src/autofit/afglobal.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include `afgsub.h`. (af_face_globals_new) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Call `af_parse_gsub` to fill `gsub_lookups_single_alternate`. (af_face_globals_free): Updated. * src/autofit/afadjust.c (af_get_glyph_alternates_helper): Exit early if we possible. (af_reverse_character_map_new): Trace GSUB lookup indices to be checked. | ||
| cda418a4 | 2025-06-13 11:23:14 | [autofit] Speed up computation of `af_reverse_character_map_new`. (1/4) Using HarfBuzz's API functions to construct the reverse map is too slow; we have to call `hb_ot_layout_lookup_get_glyph_alternates` far too often because it can only handle a single glyph at a time. For this reason we are going to parse the GSUB table by ourselves. The new non-local functions are `af_parse_gsub` and `af_map_lookup`. * src/autofit/afgsub.c, src/autofit/afgsub.h: New files for parsing, validating, and mapping the `SingleSubst` and `AlternateSubst` subtable types of a GSUB table. * src/autofit/autofit.c, src/autofit/rules.mk (AUTOF_DRV_SRC): Updated. | ||
| 2ab0357d | 2025-06-12 23:15:22 | [base] Add no-overwrite hash insert functions. * src/base/fthash.c (ft_hash_num_insert_no_overwrite, ft_hash_str_insert_no_overwrite): New functions. * include/freetype/internal/fthash.h: Updated. | ||
| 820df387 | 2025-06-02 16:16:06 | [base] Add iterators for `FT_Hash`. * src/base/fthash.c (ft_hash_num_iterator, ft_hash_str_iterator): New functions. * include/freetype/internal/fthash.h: Updated. | ||
| 58be4879 | 2025-06-24 13:31:10 | [truetype] Add comment to explain heuristic limit for twilight points. | ||
| 43940e4c | 2025-06-23 11:04:43 | [truetype] Restore non-persistent CVT and storage. According to specifications, CVT and storage area may or may not be persistent after modifications by a glyf program. FreeType had always reset them, which was broken by the last commit. * src/truetype/ttinterp.c (TT_Load_Context): Set CVT and storage here. * src/truetype.ttobjs.c (tt_size_run_prep): Prioritize TT_Load_Context. (tt_size_init_bytecode): Allocate but not set CVT and storage area. | ||
| 36ddd0cb | 2025-06-22 12:13:48 | [truetype] Deduplicate 'codeRangeTable'. * src/truetype/ttinterp.c (TT_Load_Context, TT_Save_Context): Do not copy 'codeRangeTable'. * src/truetype/ttobjs.h (TT_Size): Remove 'codeRangeTable'. (TT_CodeRange_Tag, TT_CodeRange, TT_DefArray): Moved to... * src/truetype/ttinterp.h: ... this header.1 | ||
| c9cbfacb | 2025-06-21 23:30:24 | [truetype] Simplify bytecode allocations. To avoid repeated synchronization, some TT_Size allocations are moved TT_ExecContext for good. The memory blocks are also consolidated. * src/truetype/ttinterp.c (TT_{Load,Save,Done}_Context): Remove synchronization and stack management. * src/truetype/ttobjs.c (tt_size_{init,done}_bytecode): Manage allocations and assign them to the execution context. (tt_size_run_prep): Updated. | ||
| 4c2437ef | 2025-06-21 22:59:29 | [truetype] Rework handling of rendering mode in bytecode. This replaces a large number of confusing boolean constructs that describe the target rendering mode in the execution context with the straight mode variable. It might fix some hidden bugs when FT_LOAD_TARGET_XXX were used as flags, which they are not. The condition that triggers the CV program re-execution is simplified. These events due the rendering mode change are rather rare and unexpected and, therefore, should not be over-analyzed. In v40, all mode changes now trigger the CV program. In v35, only switches to/from mono do. * src/truetype/ttinterp.h (TT_ExecContext): Replace 'grayscale', 'grayscale_cleartype', 'subpixel_hinting_lean', and 'vertical_lcd_lean' with the rendering 'mode'. * src/truetype/ttinterp.c (Ins_GETINFO): Updated. * src/truetype/ttgload.c (tt_loader_init): Replace 'prep' re-execution trigger and update 'backward_compatibility' condition. (tt_loader_set_pp): Updated. | ||
| 0e38fa75 | 2025-06-20 22:22:05 | * src/truetype/{ttinterp.c,ttobjs.c}: Minor. | ||
| 19770604 | 2025-06-20 21:48:14 | [truetype] Clean up bytecode execution triggers. This avoids executing the CV program twice and cleans up the use of 'fpgm' and 'prep' triggers * src/truetype/ttgload.c (tt_loader_init): Call 'tt_size_init_bytecode' and 'tt_size_run_prep' explicitly and avoid the call repetition. * src/truetype/ttobjs.c (tt_size_ready_bytecode): Removed as unused. (tt_size_init, tt_size_init_bytecode, tt_size_done_bytecode): Remove some 'fpgm' and 'prep' triggers and update. (tt_size_run_fpgm, tt_size_run_prep): Do not set the pedantic flag here. * src/truetype/ttobjs.h: Update signatures. | ||
| b647de09 | 2025-06-20 20:34:10 | * src/truetype/ttgload.c (tt_loader_init, load_sbit_image): Clean up. | ||
| 2041c65c | 2025-06-20 20:20:54 | [truetype] Simplify twilight zone management. * include/freetype/internal/tttypes.h (TT_GlyphZone): Remove 'memory'. * src/truetype/ttobjs.c (tt_glyphzone_done): Use 'memory' as argument. (tt_glyphzone_new, tt_glyphzone_done): Allocate/free as a single block. (tt_size_init_bytecode, tt_size_done_bytecode): Updated. * src/truetype/ttobjs.h (tt_glyphzone_done): Updated signature. | ||
| 3ccc27dc | 2025-06-19 08:06:53 | [autofit] Really fix handling of `RTLD_DEFAULT`. This commit actually implements what commit 43ec023e1a7 describes. * src/autofit/ft-hb.c (FT_RTLD_FLAGS): New macro for `dlopen`; it uses `RTLD_GLOBAL` only if `RTLD_DEFAULT` is available. | ||
| 738905b3 | 2025-06-14 20:18:48 | [truetype] Revise twilight zone initiation. This assures that twilight zone is reset before each CV program execution, including after the rendering mode switch. Fixes #1344. * src/truetype/ttobjs.c (tt_size_ready_bytecode): Relocate the GS the twilight zone initiation from here... (tt_size_run_prep): ... to this function, sho that it is always done prior to the CV program execution. * src/truetype/ttobjs.c (TT_Run_Context): Set twilight zone here... (TT_Load_Context): ... rather than here, as it used to be. | ||
| 04f68052 | 2025-06-12 21:02:57 | * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove check. The highest (sign) attribute bit is reserved and should be zero. It is harmless to omit this check however. Fixes #1342. | ||
| fc051dc0 | 2025-06-12 10:20:07 | [autofit] Ignore virtual glyph indices from GSUB lookups. Reported as https://issues.chromium.org/issues/420401651 * src/autofit/afadjust.c (af_reverse_character_map_new): Implement it. | ||
| 3c14c525 | 2025-06-11 15:32:11 | [truetype] Clean up TT_GlyphZone. * include/freetype/internal/tttypes.h (TT_GlyphZone): Delete fields. * src/truetype/ttobjs.c (tt_glyphzone_new, tt_glyphzone_done, tt_size_init_bytecode): Updated. | ||
| 1529bc6e | 2025-06-11 07:41:01 | [truetype] Use FT_ARRAY_ZERO. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Updated. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids, tt_size_ready_bytecode): Updated. | ||
| 5ab9e5c5 | 2025-06-08 07:51:08 | [truetype] Rearrange bytecode run. This is a minor change with large code rearrangements. * src/truetype/ttinterp.c (TT_RunIns): Just loop through instructions and move all setup to... (TT_Run_Context): ... here; relocated. (Compute_Round): Replaced by simple assignment, removed. | ||
| 68c62e19 | 2025-06-07 22:15:18 | [truetype] Relocate the interpreter pointer. This reduces dereferencing when calling the interpreter. * include/freetype/internal/tttypes.h (TT_Face): Move it from here... * src/truetype/ttinterp.h (TT_ExecContext): ... to here. * src/truetype/ttobjs.c (tt_size_init_bytecode): Move its initialization * src/truetype/ttinterp.c (TT_New_Context): ... to here. (TT_Run_Context): Updated. | ||
| ecfefd8c | 2025-06-07 22:12:45 | [truetype] Clean up the loader initiation. * include/freetype/internal/tttypes.h (TT_LoaderRec): Remove unused field. * src/truetype/ttgload.c (tt_loader_init): Refactor. | ||
| 5631650b | 2025-06-07 22:09:28 | [truetype] Modify bytecode initiation. This reduces the number of function calls and data copying events. * src/truetype/ttinterp.c (TT_Goto_CodeRange): Merge into... (TT_Set_CodeRange): ... this function. (TT_Load_Context): Do not set up any zones, copy GS, or prepare the execution... (TT_Run_Context): ... do this here instead.. * src/truetype/ttinterp.c (TT_Set_CodeRange): Update signature. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Call TT_Run_Context. * src/truetype/ttgload.c (TT_Hint_Glyph, tt_loader_init): Updated. | ||
| 70281e0f | 2025-06-07 21:59:50 | [truetype] Modify the graphics state management. Instead of restoring persistent GS variables, we only save modifications permitted by the CVT program. This reduces the context manipulations. * src/truetype/ttobjs.h (TT_GraphicsState): Reorder fields. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do not alter the context. * src/truetype/ttgload.c (TT_Hint_Glyph): Do not reset GS. (tt_loader_init): Fix potential issue in 'instruct_control' handling. * src/truetype/ttinterp.c (TT_Run_Context): Fully reset GS. (TT_Load_Conext): Rearrange and remove the 'size' check, already performed in FT_Load_Glyph. (TT_Save_Context): Save only modifiable GS parts. (tt_default_graphics_state): Updated. * src/truetype/ttinterp.h (TT_Run_Context): Update signature. | ||
| a67b2bab | 2025-06-10 12:11:41 | [gxvar] Really fix setting of named-instance to Regular. This fixes an ommission in commit cf06661c51. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize `error`. | ||
| d736e741 | 2025-06-10 05:09:58 | Two more link fixes. | ||
| 7f559fbe | 2025-06-10 04:55:43 | Update links. Found with `linkchecker --check-extern index.html` running locally in the 'freetype-web' repository. | ||
| cf06661c | 2025-05-31 15:57:41 | Fix setting of named-instance to Regular Fixes https://gitlab.freedesktop.org/freetype/freetype/-/issues/1341 And more elaborate avoidance of loading face->blend if all coords are zero. | ||
| 320b72a2 | 2025-06-04 07:51:46 | * src/type42/t42objs.c (T42_Size_Init): Fix uninitialized use. Found by Ozkan Sezer. | ||
| bd28cf7a | 2025-06-04 08:55:04 | [autofit] Fix `-Wunused-but-set-variable` warning in Windows builds. With this commit, the following warning gets removed. ``` In file included from src/autofit/autofit.c:21:0: src/autofit/ft-hb.c: In function 'ft_hb_funcs_init': src/autofit/ft-hb.c:75:35: warning: variable 'version_atleast' set but not used [-Wunused-but-set-variable] ft_hb_version_atleast_func_t version_atleast = NULL; ^~~~~~~~~~~~~~~ ``` * src/autofit/ft-hb.c (ft_hb_funcs_init): Move `NULL` check of `version_atleast` out of ifdefs. | ||
| 5bc20817 | 2025-06-04 08:21:50 | [build] Revise visibility attributes usage in autotools and CMake. * CMakeLists.txt: Set `C_VISIBILITY_PRESET` to hidden for non-Windows only. Windows handles exports with `DLL_EXPORT` defined, and old MinGW toolchains emit a lot of warnings about visibility attributes not being supported in this configuration. * build/unix/configure.raw: Revise visibility attributes checks by compiling a better test program with `-Werror` in `CFLAGS` so that warnings correctly indicate unsupported configurations. | ||
| 81f839a7 | 2025-06-03 23:15:32 | * CMakeLists.txt: Add support for `FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC`. This commit introduces a new CMake option `FT_DYNAMIC_HARFBUZZ`. | ||
| 1518bc83 | 2025-06-03 12:38:38 | * src/autofit/ft-hb.c: Fix definition of `_GNU_SOURCE`. Commit 43ec023e1a730f defined the macro too late. | ||
| 2adb5361 | 2025-06-03 10:35:16 | Replace 'www.freetype.org' with 'freetype.org'. | ||
| f0679e75 | 2025-05-29 07:20:04 | * builds/unix/configure.raw: Fix HarfBuzz library detection for MinGW. Set `have_harfbuzz*` variables explicitly to dynamic for MinGW, since Windows uses its own `LoadLibrary` call. This fixes a MinGW configuration error: ``` checking for HARFBUZZ... no checking for dlopen in -lc... no checking for dlopen in -ldl... no configure: error: harfbuzz support requested but library not found ``` | ||
| 3eb5188e | 2025-05-29 04:00:30 | * builds/unix/configure.raw: Improve check for `dlopen`. Look for `dlopen` first in 'libc', then in 'libdl'. | ||
| 43ec023e | 2025-06-03 07:56:13 | * src/autofit/ft-hb.c: Fix usage of `RTLD_DEFAULT`. Using `RTLD_DEFAULT` we see whether the process already has HarfBuzz linked in, and reuse it. If this symbol is not defined it is tempting to use `RTLD_GLOBAL` instead, which would make the library available to the whole process. However, without `RTLD_DEFAULT`, we would risk loading a second HarfBuzz library, and if the linker mixes them up, probably giving symbols from the new library to other clients, we might get into trouble. For this reason, we do not pass `RTLD_GLOBAL` to `dlopen`; the default is `RTLD_LOCAL`, and the rest of the process won't see the loaded HarfBuzz and hopefully all be happy. | ||
| 5a07f41d | 2025-05-28 09:52:44 | [sfnt] `FT_Load_Sfnt_Table` can now also load a font's table directory. Closes issue #1263. * src/sfnt/ttload.c (tt_face_load_any): Implement it. | ||
| 3aeabbf8 | 2025-05-28 07:09:40 | [gzip] Update sources to zlib 1.13.1. Fixes issue #1294. | ||
| 202297eb | 2025-05-25 12:15:11 | * src/base/ftobjs.c (FT_Load_Glyph): Loosen auto-hinting constraints. Fixes issue #1320. | ||
| d629c8bf | 2025-05-27 08:41:13 | Update `CHANGES` file. | ||
| f7fba637 | 2025-05-24 02:47:23 | [gxvar] Optimize out more bounds checking. Big win, ~20% in measured mega-var font, HarfBuzz's `benchmark-font` 'glyph_h_advances' benchmark. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Implement it in loops. | ||
| c0625140 | 2025-05-22 22:21:18 | * src/truetype/ttgload.c (load_truetype_glyph): Use `IS_DEFAULT_INSTANCE`. | ||
| f64c7db2 | 2025-05-27 06:59:16 | [gxvar] Set `doblend` to `FALSE` if at default location. * src/truetype/ttgxvar.c (tt_set_mm_blend, TT_Get_Var_Design): Do it. | ||
| fa412cf5 | 2025-05-23 15:41:26 | [mm/gxvar] Always detect default instance and use optimized codepath. Even if it was explicitly set by either design or normalized APIs. Also update documentation. * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): Use value -2 of `error` to indicate that we have a non-default instance. (TT_Set_Named_Instance): Updated. * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, FT_Set_Var_Blend_Coordinates): Updated. | ||
| deef6d2a | 2025-05-26 23:16:30 | Typo. | ||
| 31d05d08 | 2025-05-26 23:13:52 | * src/truetype/ttinterp.c (TT_Load_Context): Clean up. | ||
| c6abd1e4 | 2025-05-26 20:24:55 | [autofit] Fix integer overflow. Reported as https://issues.oss-fuzz.com/issues/420401635 * src/autofit/aflatin.c (af_latin_stretch_top_tilde, af_latin_stretch_bottom_tilde): Use `SUB_LONG`. | ||
| e07e56c7 | 2025-05-26 17:20:12 | [gxvar] Speed up handling of deltas in `ItemVariationStore`. (3/3) * src/base/ftcalc.c (FT_MulAddFix): Removed, no longer needed. * include/freetype/internal/ftcalc.h: Updated. | ||
| 86ab14e0 | 2025-05-26 08:20:21 | [gxvar] Speed up handling of deltas in `ItemVariationStore`. (2/3) Do all math in fixed integer and do a single divide at the end. Also don't use an array to read deltas; just read them as we go, and skip (branch-free) when scalar is 0. 30% speedup in measured mega-var font, HarfBuzz's `benchmark-font` 'glyph_h_advances' benchmark. | ||
| fe6854ba | 2025-05-26 08:18:00 | [gxvar] Speed up handling of deltas in `ItemVariationStore`. (1/3) * src/truetype/ttgxvar.c (ft_mul_add_delta_scalar, ft_round_and_shift16): New functions, reusing code from `ftcalc.c`. | ||
| 8eae0399 | 2025-05-26 08:16:53 | Lift `FT_Int64` type to global (internal) FreeType use. * src/base/ftcalc.c (FT_Int64) [!FT_INT64]: Move declaration to... * include/freetype/config/integer-types.h: ... this file. (FT_UInt64) [!FT_INT64]: New structure. (FT_INT64_ZERO): New macro. | ||
| b8444f2f | 2025-05-26 07:47:10 | [gxvar] Move scalar computation into its own function. * src/truetype/ttgxvar.c (tt_var_get_item_delta): Split off affected code into... (tt_calculate_scalar): ...this new function. | ||
| 57a87304 | 2025-05-26 06:28:09 | [autofit] Make the accent database work for more glyphs (again). See the added comment for an explanation. This partially undoes commit f68733d4a8. * src/autofit/afadjust.c (af_reverse_character_map_new): Always loop over all elements of the adjustment database. (in_range): Removed, no longer needed. | ||
| 87501e2e | 2025-05-25 22:21:21 | [trueetype] Remove useless assignments. * src/truetype/ttobjs.c (tt_size_run_fpgm): Remove assignment that is ignored and overridden later in 'Compute_Funcs'. * src/truetype/ttinterp.c (TT_RunIns): Ditto. (Ins_MIAP): Formatting. | ||
| ed0ab879 | 2025-05-21 07:56:08 | [autofit] Minor code cleanup. * src/autofit/afadjust.c (af_reverse_character_map_new): Rename `result_set` to `glyph_alternates` and move its clearing to... (af_get_glyph_alternates): ...this function. (af_get_glyph_alternates_helper): s/result/helper_result/. | ||
| a312820c | 2025-05-21 07:17:11 | [autofit] Speed up construction of reverse character map. (4/4) * src/autofit/afadjust.c (af_get_glyph_alternates): Move creation and deletion of the `helper_result` set to... (af_reverse_character_map_new): ...this function. Gain for `arial.ttf` version 7.00: approx. 1%. | ||
| c0e7df61 | 2025-05-20 18:59:00 | [autofit] Speed up construction of reverse character map. (3/4) * src/autofit/afadjust.c (af_reverse_character_map_new): Fold two loops into one. Gain for `arial.ttf` version 7.00: approx. 1%. | ||
| 3dd7fc42 | 2025-05-19 05:37:23 | [autofit] Speed up construction of reverse character map. (2/4) This commit, together with the previous one, makes the startup of the auto-hinter much faster. Note, though, that the startup time for handling the diacritic database is still rather large. For example, loading `arial.ttf` version 7.00 followed by auto-hinting a first Latin glyph is still approx. three times slower than before the introduction of the database (this is because function `hb_ot_layout_lookup_get_glyph_alternates` is called very often). * src/autofit/afshaper.c (scripts): Rename this array to... (af_hb_scripts): ...this and export it. (af_shaper_get_coverage_hb): Updated. * src/autofit/afshaper.h: Updated. * src/autofit/afadjust.c (af_reverse_character_map_new): Pass the current script to `hb_ot_layout_collect_lookups` to make HarfBuzz check less lookups while searching for glyph alternates. | ||
| f68733d4 | 2025-05-19 05:23:29 | [autofit] Speed up construction of reverse character map. (1/4) Build reverse cmap for characters of the current script style only. * src/autofit/afadjust.c (in_range): New function. (af_reverse_character_map_new): Pass `AF_StyleMetrics` instead of `AF_FaceGlobals` so that we can access the current script style. Use `in_range` to limit tested code points. * src/autofit/afadjust.h: Updated. * src/autofit/aflatin.c (af_latin_metrics_init): Updated. | ||
| 4514f051 | 2025-05-18 08:08:25 | [autofit] Avoid variable shadowing. * src/autofit/afadjust.c (af_reverse_character_map_new): Do it. | ||
| fd33c037 | 2025-05-18 08:00:54 | [autofit] Minor speedup of reverse charmap creation. * src/autofit/afglobal.h (AF_HAS_CMAP_ENTRY): New flag. (AF_STYLE_MASK): Update value. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Set `AF_HAS_CMAP_ENTRY`. * src/autofit/afadjust.c (af_reverse_character_map_new): For the creation of the reverse map, change code to handle glyphs with cmap entries before glyphs without cmap entries. Doing so avoids some code redundancy and reduces the number of hash lookups. | ||
| 541ad3d3 | 2025-05-18 19:09:19 | [autofit] Whitespace. | ||
| 72e0c071 | 2025-05-16 14:35:51 | [autofit] Use `FT_Offset`. * src/autofit/afadjust.c (af_adjustment_database_lookup, af_reverse_character_map_new): Do it. | ||
| 47e35a58 | 2025-05-16 08:08:53 | [autofit] Simplify return value of `af_adjustment_database_lookup`. * src/autofit/adfadjust.h (af_adjustment_database_lookup): Return integer. (AF_AdjustmentDatabaseEntry): Move structure to... * src/autofit/afadjust.c: ...this file. (af_adjustment_database_lookup, af_reverse_character_map_new): Updated. * src/autofit/aflatin.c (af_glyph_hints_apply_vertical_separation_adjustments): Updated. | ||
| 94e93c7c | 2025-05-16 07:46:43 | [autofit] Remove no longer used functions and structures. This is the clean-up from the previous commit. * src/autofit/afadjust.c (af_reverse_character_map_entry_compare, af_reverse_character_map_lookup, af_reverse_character_map_expand): Removed. * src/autofit/afadjust.h: Updated. * src/autofit/aftypes.h (AF_ReverseMapEntry, AF_ReverseCharacterMap): Removed. | ||
| 2492b547 | 2025-05-16 07:39:06 | [autofit] Use a hash for handling vertical accent adjustments. This greatly simplifies the code. * src/autofit/afadjust.c (af_reverse_character_map_new): Implement it. (af_reverse_character_map_done): Updated. * src/autofit/afadjust.h: Updated. * src/autofit/aflatin.c (af_glyph_hints_apply_vertical_separation_adjustments): Updated. * src/autofit/aftypes.h: Include `fthash.h`. (AF_StyleMetrics): Change type of `reverse_charmap` to `FT_Hash`. | ||
| 70154166 | 2025-05-16 07:20:57 | * src/autofit/aflatin.c (af_latin_hints_apply): Improve code legibility. | ||
| 9dc66cbd | 2025-05-20 05:36:49 | [autofit] Use `FT_LONG_MIN` and `FT_LONG_MAX` for `FT_Pos` variables. * src/autofit/aflatin.c (af_latin_metrics_init_blues, af_compute_vertical_extrema, af_find_highest_contour, af_find_second_highest_contour, af_find_lowest_contour, af_find_second_lowest_contour, af_check_contour_horizontal_overlap): Updated. | ||
| d6e087d1 | 2025-05-19 16:13:06 | [autofit] Fix uninitialized variables. * src/autofit/aflatin.c (af_latin_stretch_top_tilde, af_latin_stretch_bottom_tilde): Initialize `min_measurement`. | ||
| 5987a9f5 | 2025-05-22 02:51:36 | [ttmtx] Fix check for being non-default variation position. If user explicitly sets variations to `NULL` after it being set to something else, `face->blend` will still be non-`NULL`. The intention here however is correctly captured by `FT_IS_VARIATION`. * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `FT_IS_VARIATION`. | ||
| 75b84313 | 2025-05-23 08:03:59 | [gxvar] Optimize loading of 'gvar' table. * src/truetype/ttgxvar.c (tt_var_load_item_variation_store, tt_var_load_delta_set_index_mapping, ft_var_load_gvar): Use frames to reduce bounds checking. (TT_Vary_Apply_Glyph_Deltas): Better macro usage. | ||
| 42a649be | 2025-05-21 14:35:40 | [mm] Short-circuit setting face to default instance if already is so. I found that in hb-ft I need to sometime reset the face to the default instance. However, calling `FT_Set_Var_Design_Coordinates` with no coords was still slowing down at least the glyph-advance code by processing variations. Perhaps there's a better fix, but this handles the easy cases. * src/base/ftmm.c (FT_Set_Var_Design_Coordinates): Implement it. | ||
| 702e4a1d | 2025-05-21 14:55:25 | * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix allocation. Bug was introduced in commit 582de1a4b6f. | ||
| 013adc82 | 2025-05-21 17:28:52 | * src/truetype/ttgxvar.c (ft_var_apply_tuple): Remove redundant test. This was erroneously added in commit e6e9110a8. | ||
| 11fa9da7 | 2025-05-19 21:07:10 | [sdf] Skip neighbor comparison for pixels near edges. If the distance of the current pixel to the edge is less than or equal to 0.5, skip further neighbor comparisons to avoid unnecessary calculations. When the `USE_SQUARED_DISTANCES` macro is defined, compare to 0.25 instead. * src/sdf/ftbsdf.c (compare_neighbor): Add early return for pixels close to edges to avoid unnecessary neighbor checks. | ||
| d7b6e947 | 2025-05-21 01:34:08 | [gxvar] Cache shared-tuple scalar values. GoogleSansFlex HB benchmark-font draw results: Before: 2.13ms After: 1.65ms Speedup: 22% * src/truetype/ttgxvar.h (GX_BlendRec): Add `tuplescalars` field. * src/truetype/ttgxvar.c (ft_var_load_gvar): Allocate `tuplescalars` array. (tt_set_mm_blend): Set its values. (TT_Vary_Apply_Glyph_Deltas): Use it. (tt_done_blend): Deallocate it. | ||
| 582de1a4 | 2025-05-20 23:09:16 | [gxvar] Reduce number of mallocs. 8% speed up in drawing GoogleSansFlex variable in HB benchmark-font. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Use an allocation pool instead of individual allocations. | ||
| fd92af79 | 2025-05-20 16:55:38 | [gxvar] Another optimization in computing scalar. Another ~6% speedup in GoogleSansFlex var drawing. * src/truetype/ttgxvar.c (ft_var_apply_tuple): Test `ncv` for being zero. | ||
| e7cc14ba | 2025-05-21 01:33:22 | [gxvar] Remove stale comment. The code *does* check against start/end! | ||
| e6e9110a | 2025-05-20 16:51:25 | * src/truetype/ttgxvar.c (ft_var_apply_tuple): Micro-optimize. | ||
| 14399c73 | 2025-05-20 16:17:00 | [gxvar] Inline two USHORT reads. Speeds up GoogleSansFlex variable glyph drawing by ~13%. Before: 2.95ms After: 2.57ms * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Do it. |