ChangeLog (371372B)
1 2025-09-11 Werner Lemberg <wl@gnu.org> 2 3 * Version 2.14.1 released. 4 ========================== 5 6 Tag sources with `VER-2-14-1'. 7 8 * docs/VERSION.TXT: Add entry for version 2.14.1. 9 * docs/CHANGES: Updated. 10 * docs/release, docs/README, builds/macs/README: Updated. 11 12 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 13 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 14 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 15 docs/freetype-config.1: s/2.14.0/2.14.1/, s/2140/2141/. 16 17 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. 18 19 * builds/unix/configure.raw (version_info): Set to 26:4:20. 20 * CMakeLists.txt (VERSION_PATCH): Set to 1. 21 22 2025-09-10 Behdad Esfahbod <behdad@behdad.org> 23 24 [base] Fix return values of two Font Variation functions. 25 26 * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, 27 FT_Set_Var_Blend_Coordinates): Do it. 28 29 Fixes issue #1355. 30 31 2025-09-10 Werner Lemberg <wl@gnu.org> 32 33 * src/autofit/afgsub.c (af_map_lookup): Fix handling of lookup type 7. 34 35 Fixes issue #1356. 36 37 2025-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 38 39 * src/truetype/ttinterp.c (TT_Run_Context): Fix IUP tracking bits. 40 41 Correctly fixes #1353 and #1349. 42 43 2025-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 44 45 Typo! 46 47 2025-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 48 49 * src/truetype/ttinterp.c (TT_Run_Context): Reset IUP tracking bits. 50 51 Fixes #1353. 52 53 2025-09-08 Behdad Esfahbod <behdad@behdad.org> 54 55 [autofit] Fix HarfBuzz calling. 56 57 * src/autofit/afadjust.c (af_reverse_character_map_new) 58 [FT_CONFIG_OPTION_USE_HARFBUZZ]: Use `ft_hb_enabled`. 59 60 Fixes issue #1354. 61 62 2025-09-08 Werner Lemberg <wl@gnu.org> 63 64 * docs/release: Use `sshpass` for SourceForge.net password. 65 66 2025-09-08 Werner Lemberg <wl@gnu.org> 67 68 * docs/release: Fix `scp` usage with OpenSSH version >= 9.0. 69 70 Starting with this version, OpenSSH uses `scp` with the SFTP protocol as the 71 default. However, SFTP is disabled on savannah.gnu.org since January 2025. 72 73 2025-09-06 Werner Lemberg <wl@gnu.org> 74 75 * Version 2.14.0 released. 76 ========================== 77 78 Tag sources with `VER-2-14-0'. 79 80 * docs/VERSION.TXT: Add entry for version 2.14.0. 81 * docs/CHANGES: Updated. 82 * docs/release, docs/README, builds/macs/README: Updated. 83 84 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 85 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 86 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 87 docs/freetype-config.1: s/2.13.3/2.14.0/, s/2133/2140/. 88 89 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 14. 90 (FREETYPE_PATCH): Set to 0. 91 92 * builds/unix/configure.raw (version_info): Set to 26:3:20. 93 * CMakeLists.txt (VERSION_MINOR): Set to 14. 94 (VERSION_PATCH): Set to 0. 95 96 2025-09-06 Werner Lemberg <wl@gnu.org> 97 98 * builds/toplevel.mk (do-dist): Download shallow clone of `config.git`. 99 100 No need for any other commit than the current one. 101 102 2025-09-06 Werner Lemberg <wl@gnu.org> 103 104 Update all copyright notices. 105 106 2025-09-05 Werner Lemberg <wl@gnu.org> 107 108 src/sfnt/ttload.c (tt_face_load_any): Correctly handle font containers. 109 110 Reported as 111 112 https://issues.oss-fuzz.com/issues/424613326 113 114 2025-09-05 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 115 116 Clean up OpenVMS support. 117 118 This avoids cluttering the source code with VMS-specific changes. 119 120 * include/freetype/internal/ftcalc.h [__VMS], src/base/ftcalc.c 121 [vms_auto64_source]: Remove. 122 123 * builds/vms/patch_ftcalc.sed: New file. 124 125 * vms_make.com: Change macro definitions while this script is running; we 126 use `GNU sed` to inject the necessary preprocessor code on the fly. 127 128 2025-09-01 Alexei Podtelezhnikov <apodtele@gmail.com> 129 130 * src/psaux/psauxmod.h (psaux_driver_class): Removed declaration. 131 132 2025-08-29 Alexei Podtelezhnikov <apodtele@gmail.com> 133 134 [base] Use const FT_Module_Class. 135 136 This is intended to warn against modifying any fields in the class, 137 at compile-time and avoid crashes at run-time. 138 139 * include/freetype/internal/ftobjs.h (FT_ModuleRec): Do it. 140 * src/base/ftobjs.c (Destroy_Module, FT_Add_Module): Updated. 141 142 2025-08-27 Alexei Podtelezhnikov <apodtele@gmail.com> 143 144 * src/base/ftobjs.c (FT_Load_Glyph): Reduces scope of 'ttface'. 145 146 2025-08-25 Alexei Podtelezhnikov <apodtele@gmail.com> 147 148 * src/truetype/ttinterp.c: Fix some builds. 149 150 2025-08-23 Werner Lemberg <wl@gnu.org> 151 152 * subprojects/*.wrap: Updated. 153 154 2025-08-23 Werner Lemberg <wl@gnu.org> 155 156 Updating `CHANGES` file; minor fixes elsewhere (mostly formatting). 157 158 2025-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 159 160 [truetype] Fix compilation without bytecode. 161 162 Fixes #1351 and various warnings about unused variables. 163 164 * src/truetype/ttinterp.c: Put the entire body under #ifdef. 165 * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Relocate 166 some declarations. 167 * src/truetype/ttinterp.h: Remove some #ifdef conditions. 168 * src/truetype/ttobjs.c (tt_size_done): Modified. 169 170 2025-08-14 Alexei Podtelezhnikov <apodtele@gmail.com> 171 172 [truetype] Small fix in the incremental interface (again). 173 174 Fixes #1299, last [-Wdangling-pointer=] warning. 175 176 * src/truetype/ttgload.c (load_truetype_glyph): Restore original stream 177 on exit unconditionally. 178 179 2025-08-14 Alexei Podtelezhnikov <apodtele@gmail.com> 180 181 [truetype] Small fix in the incremental interface. 182 183 Fixes #1299, last [-Wdangling-pointer=] warning. 184 185 * src/truetype/ttgload.c (load_truetype_glyph): Restore original stream 186 on exit. 187 188 2025-08-14 Alexei Podtelezhnikov <apodtele@gmail.com> 189 190 * src/autofit/afgsub.c: Fix a warning. 191 192 Fixes [-Wunused-function] warning without HarfBuzz. 193 194 2025-08-11 Alexei Podtelezhnikov <apodtele@gmail.com> 195 196 * */ftoption.h: Update C99 wording. 197 198 2025-08-11 Alexei Podtelezhnikov <apodtele@gmail.com> 199 200 * */ftoption.h: Note C99 compliance. 201 202 2025-08-08 Behdad Esfahbod <behdad@behdad.org> 203 204 [ttgxvar] Fix caching of scalars when there are intermediate tuples. 205 206 For example, with `GoogleSansFlex-Regular.ttf` at ROND=100, the 'Q' glyph 207 was misrendering. 208 209 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Reset `tupleScalars` 210 earlier. 211 212 2025-08-05 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 213 214 Improvements to OpenVMS support. 215 216 * include/freetype/internal/ftcalc.h [__VMS]: Undefine `FT_MulFix`. 217 218 * src/base/ftcalc.c [vms_auto64_source]: Define `FT_MulFix`. 219 220 * vms_make.com: Also create 32bit version of the FreeType library. 221 222 2025-08-04 Alexei Podtelezhnikov <apodtele@gmail.com> 223 224 * docs/CHANGES: Mention 'ftmulti' improvements. 225 226 2025-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 227 228 [type1/MM] Correctly reset the default instance. 229 230 Call T1_Set_MM_WeightVector, which actually sets default weights, 231 instead of TT_Set_MM_Blend, which just centers the axes. 232 233 * src/type1/t1load.c (T1_Reset_MM_Blend): Do it. 234 235 2025-08-01 Alexei Podtelezhnikov <apodtele@gmail.com> 236 237 [truetype/v40] Fix ROUND_XY_TO_GRID handling. 238 239 Fixes #1346. 240 241 * src/truetype/ttgload.c (TT_Process_Composite_Component): Round 242 the x-position unless in backward_compatibility mode. 243 244 2025-07-30 Alexei Podtelezhnikov <apodtele@gmail.com> 245 246 * src/truetype/ttinterp.c (Ins_MDRP,MIRP): Small tweak. 247 248 2025-07-30 Alexei Podtelezhnikov <apodtele@gmail.com> 249 250 [truetype] Tweak size management. 251 252 * include/freetype/internal/services/svmetric.h (FT_Size_Reset_Func): 253 Update typedef, do not return error. 254 * src/truetype/ttobjs.c (tt_size_reset_height): Move the PPem error 255 handling from here... 256 (tt_size_reset): ... to here to improve readability. 257 src/truetype/ttobjs.h (tt_size_reset_height): Update prototype. 258 259 2025-07-30 Alexei Podtelezhnikov <apodtele@gmail.com> 260 261 [truetype] Relocate color compensation (cont'd). 262 263 * src/truetype/ttinterp.c (Inc_MDAR,MIAP,MDRP,MIRP): Fix forgotten 264 rounding. 265 266 2025-07-29 Alexei Podtelezhnikov <apodtele@gmail.com> 267 268 [truetype] Fix EVEN and ODD instructions. 269 270 It is possible to have a fractional part after rounding when rounding 271 to half-grid or super-rounding. The specs call to ignore the fractional 272 part in that case. 273 274 ^ src/truetype/ttinterp.c (Ins_EVEN, Ins_ODD): Fix mask. 275 276 2025-07-28 Alexei Podtelezhnikov <apodtele@gmail.com> 277 278 * src/truetype/ttinterp.c: Fix comments. 279 280 2025-07-28 Alexei Podtelezhnikov <apodtele@gmail.com> 281 282 * src/truetype/ttinterp.h (TT_Round_Func): Fix argument. 283 284 Fixes #1347: function type mismatch. 285 286 2025-07-27 Alexei Podtelezhnikov <apodtele@gmail.com> 287 288 [truetype] Clean up size validation. 289 290 Rely on non-zero ppem to validate the size object. 291 292 * src/truetype/ttobjs.h (TT_Size_Merics): Remove the `valid` flag. 293 * src/truetype/ttobjs.c (tt_size_init,done,reset,reset_height): Updated. 294 * src/truetype/ttgload.c (TT_Load_Glyph): Check for non-zero ppem. 295 296 2025-07-27 Alexei Podtelezhnikov <apodtele@gmail.com> 297 298 [truetype] Relocate color compensation. 299 300 The rounding color compensation, which is not used by FreeType, belongs 301 to GS. This is a more logical place for it, next to round_state. 302 303 * src/truetype/ttobjs.h (TT_GraphicsState): Move compensations here... 304 (TT_Size_Metrics): ... from here. 305 * src/truetype/ttobjs.c (tt_size_init_bytecode): Updated. 306 * src/truetype/ttinterp.c (tt_default_graphics_state): Updated. 307 (Ins_ROUND,NROUND,EVEN,ODD): Updated. 308 (Round_*): Updated. 309 310 2025-07-26 Alexei Podtelezhnikov <apodtele@gmail.com> 311 312 [smooth] Remove usage of setjmp and longjmp. 313 314 To support WASM targets with slow or unsupported setjmp and longjmp, 315 we eliminate these calls in favor of an error propagation model. 316 When gray_set_cell is out of cells, it raises an exception which is 317 later handled in gray_convert_glyph_inner. 318 This is a less invasive alternative to !385. 319 320 * src/smooth/ftgrays.c (gray_set_cell): Raise the overflow exception 321 and redirect all work to `cell_null`. 322 (gray_move,line,conic,cubic_to): Return the exception. 323 (gray_convert_glyph, gray_convert_glyph_inner): Handle the exception. 324 325 2025-07-05 Werner Lemberg <wl@gnu.org> 326 327 [sfnt] Rewrite GPOS kerning support. (2/2) 328 329 The previous code had a fundamental flaw: it didn't validate the necessary 330 parts of the 'GPOS' table before accessing it, causing crashes with 331 malformed data (since `TT_CONFIG_OPTION_GPOS_KERNING` is off by default, 332 standard fuzzers don't catch these problems). Additionally, it did a lot of 333 parsing while accessing kerning data, making it rather slow. 334 335 The new implementation fixes this. After validation, offsets to the 'GPOS' 336 lookup subtables used in the 'kern' feature that correspond to 'simple' 337 kerning (i.e., similar to 'kern' table kerning) are stored in `TT_Face`; 338 this greatly simplifies and accelerates access to the kerning data. 339 340 Testing with font `SF-Pro.ttf` version '1.00', the validation time for the 341 'GPOS' table increases the start-up time of `FT_New_Face` by less than 1%, 342 while calls to `FT_Get_Kerning` become about 3.5 times faster. 343 344 * include/freetype/internal (gpos_kerning_available): Replace with... 345 (gpos_lookups_kerning, num_gpos_lookups_kerning): ... these new fields. 346 Update callers. 347 348 * src/ttgpos.c [TT_CONFIG_OPTION_GPOS_KERNING]: A new implementation. 349 350 2025-07-05 Werner Lemberg <wl@gnu.org> 351 352 [sfnt] Rewrite GPOS kerning support. (1/2) 353 354 This commit removes the previous implementation. 355 356 2025-07-05 Werner Lemberg <wl@gnu.org> 357 358 [cff] Support GPOS kerning. 359 360 * src/cff/cffdrivr.c (cff_get_kerning) [TT_CONFIG_OPTION_GPOS_KERNING]: Add 361 code similar to the one in `tt_get_kerning`. 362 363 2025-07-05 Werner Lemberg <wl@gnu.org> 364 365 * src/sfnt/ttkern.h (TT_FACE_HAS_KERNING): Remove macro. 366 367 Given that we also support (limited) 'GPOS' table kerning if 368 `TT_CONFIG_OPTION_GPOS_KERNING` is defined, the name of this macro is 369 misleading since it only is true for 'kern' table kerning. 370 371 * src/sfnt/sfobjs.c (sfn_load_face): Replace `TT_FACE_HAS_KERNING` with 372 plain code. 373 374 2025-07-05 Werner Lemberg <wl@gnu.org> 375 376 [autofit] Remove `globals->gsub_length`. 377 378 We completely validate the accessed data from the 'GSUB' table, making this 379 field unnecessary. 380 381 * src/autofit/afglobal.h (AF_FaceGlobalsRec): Remove `gsub_length` field. 382 383 * src/autofit/afglobal.c (af_face_globals_new), src/autofit/afgsub.c 384 (af_parse_gsub): Updated. 385 386 2025-07-01 Werner Lemberg <wl@gnu.org> 387 388 * src/truetype/ttobjs.c (tt_size_init_bytecode): Correct previous fix. 389 390 `FT_NEW_ARRAY` expects a signed value, not an unsigned one. 391 392 2025-07-01 Werner Lemberg <wl@gnu.org> 393 394 * src/autofit/afgsub.c: Include `tttables.h` and `afgsub.h`. 395 396 This fixes 'make multi' compilation with clang. 397 398 Reported as 399 400 https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/381#note_2984610 401 402 2025-07-01 Werner Lemberg <wl@gnu.org> 403 404 Various minor fixes. 405 406 As reported by clang 19. 407 408 * src/autofit/afadjust.c (adjustment_database): Make it static. 409 410 * src/base/ftdbgmem.c (FT_MEM_SIZE_MIN): Remove unused macro. 411 412 * src/psaux/psobjs.c (skip_procedure), src/truetype/ttinterp.c (Ins_IF, 413 Ins_ELSE, Ins_FDEF, Ins_IDEF): Add `default` clause. 414 415 2025-07-01 Werner Lemberg <wl@gnu.org> 416 417 More signedness fixes. 418 419 As reported by clang 19. 420 421 * src/autofit/afadjust.c (add_substitute): Make first argument unsigned. 422 Update all callers. 423 Other minor signedness fixes. 424 (af_reverse_character_map_new): Minor signedness fixes. 425 426 * src/autofit/afgsub.c (af_hash_insert): Minor signedness fixes. 427 428 * src/autofit/aflatin.c 429 (af_glyph_hints_apply_vertical_separation_adjustments): Make third 430 argument unsigned. 431 Update all callers. 432 Other minor signedness fixes. 433 (af_latin_hints_apply): Minor signedness fixes. 434 435 * src/bdf/bdflib.c (bdf_parse_bitmap_): Minor signedness fix. 436 437 * src/truetype/ttobjs.c (tt_size_init_bytecode): Minor signedness fix. 438 439 2025-07-01 Werner Lemberg <wl@gnu.org> 440 441 */*: Fix trivial signedness issues with format strings in trace messages. 442 443 As reported with clang 19's `-Wformat` option. 444 445 2025-07-01 Werner Lemberg <wl@gnu.org> 446 447 Fix `make multi`. 448 449 Reported as 450 451 https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/381#note_2984253 452 453 * src/base/fthash.c: Include `ftobjs.h`. 454 * src/autofit/afgsub.c: Include `afglobal.h`. 455 456 2025-06-30 Alexei Podtelezhnikov <apodtele@gmail.com> 457 458 * MSBuild.sln: Minor. 459 460 2025-06-29 Werner Lemberg <wl@gnu.org> 461 462 [doc] Revise font variation API. 463 464 2025-06-29 Werner Lemberg <wl@gnu.org> 465 466 [doc] Use 'Adobe MM', 'TrueType GX', and 'OpenType Font Variations'. 467 468 2025-06-26 Werner Lemberg <wl@gnu.org> 469 470 Set minimum HarfBuzz version back to 2.0.0. 471 472 Due to the new GSUB parsing we no longer need 473 `hb_ot_layout_lookup_get_glyph_alternates`. 474 475 This partially reverts commit 5d2fd7608a9. 476 477 * CMakeLists.txt (HARFBUZZ_MIN_VERSION), meson.build (harfbuzz_dep), 478 builds/unix/configure.raw (harfbuzz_pkg): Set version to 2.0.0. 479 480 * src/autofit/ft-hb-decls.h: Remove entry for 481 `hb_ot_layout_lookup_get_glyph_alternates`. 482 483 2025-06-26 Werner Lemberg <wl@gnu.org> 484 485 [autofit] Speed up computation of `af_reverse_character_map_new`. (4/4) 486 487 With this commit, the start-up time for creating the reverse character map 488 gets reduced from more than 300% to about 25% (as tested with `arial.ttf` 489 version 7.00). 490 491 * src/autofit/afadjust.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include 492 `afgsub.h`. 493 (add_substitute): New auxiliary function to recursively add elements to 494 the reverse cmap. 495 (af_reverse_character_map_new): New code that replaces the old code 496 removed in the previous commit. 497 498 2025-06-26 Werner Lemberg <wl@gnu.org> 499 500 [autofit] Speed up computation of `af_reverse_character_map_new`. (3/4) 501 502 Rip out some HarfBuzz code of `af_reverse_character_map_new`. The new code 503 comes immediately in a follow-up commit, making it easier to follow the 504 changes. 505 506 * src/autofit/afadjust.c (af_get_glyph_alternates_helper, 507 af_get_glyph_alternates): Remove. 508 (af_reverse_character_map_new): Remove code to create the `*map` hash. 509 510 2025-06-26 Werner Lemberg <wl@gnu.org> 511 512 [autofit] Speed up computation of `af_reverse_character_map_new`. (2/4) 513 514 Create an array of GSUB lookup indices for `SingleSubst` and 515 `AlternateSubst` lookup types to exit early if we have different types. 516 517 Also improve tracing. 518 519 * src/autofit/afglobal.h (AF_FaceGlobals) [FT_CONFIG_OPTION_USE_HARFBUZZ]: 520 New fields `gsub_length`, `gsub`, and `gsub_lookups_single_alternate`. 521 522 * src/autofit/afglobal.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include 523 `afgsub.h`. 524 (af_face_globals_new) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Call 525 `af_parse_gsub` to fill `gsub_lookups_single_alternate`. 526 (af_face_globals_free): Updated. 527 528 * src/autofit/afadjust.c (af_get_glyph_alternates_helper): Exit early if we 529 possible. 530 (af_reverse_character_map_new): Trace GSUB lookup indices to be checked. 531 532 2025-06-26 Werner Lemberg <wl@gnu.org> 533 534 [autofit] Speed up computation of `af_reverse_character_map_new`. (1/4) 535 536 Using HarfBuzz's API functions to construct the reverse map is too slow; we 537 have to call `hb_ot_layout_lookup_get_glyph_alternates` far too often 538 because it can only handle a single glyph at a time. For this reason we are 539 going to parse the GSUB table by ourselves. 540 541 The new non-local functions are `af_parse_gsub` and `af_map_lookup`. 542 543 * src/autofit/afgsub.c, src/autofit/afgsub.h: New files for parsing, 544 validating, and mapping the `SingleSubst` and `AlternateSubst` subtable 545 types of a GSUB table. 546 547 * src/autofit/autofit.c, src/autofit/rules.mk (AUTOF_DRV_SRC): Updated. 548 549 2025-06-26 Werner Lemberg <wl@gnu.org> 550 551 [base] Add no-overwrite hash insert functions. 552 553 * src/base/fthash.c (ft_hash_num_insert_no_overwrite, 554 ft_hash_str_insert_no_overwrite): New functions. 555 * include/freetype/internal/fthash.h: Updated. 556 557 2025-06-26 Werner Lemberg <wl@gnu.org> 558 559 [base] Add iterators for `FT_Hash`. 560 561 * src/base/fthash.c (ft_hash_num_iterator, ft_hash_str_iterator): New 562 functions. 563 * include/freetype/internal/fthash.h: Updated. 564 565 2025-06-24 Werner Lemberg <wl@gnu.org> 566 567 [truetype] Add comment to explain heuristic limit for twilight points. 568 569 2025-06-23 Alexei Podtelezhnikov <apodtele@gmail.com> 570 571 [truetype] Restore non-persistent CVT and storage. 572 573 According to specifications, CVT and storage area may or may not be 574 persistent after modifications by a glyf program. FreeType had always 575 reset them, which was broken by the last commit. 576 577 * src/truetype/ttinterp.c (TT_Load_Context): Set CVT and storage here. 578 * src/truetype.ttobjs.c (tt_size_run_prep): Prioritize TT_Load_Context. 579 (tt_size_init_bytecode): Allocate but not set CVT and storage area. 580 581 2025-06-22 Alexei Podtelezhnikov <apodtele@gmail.com> 582 583 [truetype] Deduplicate 'codeRangeTable'. 584 585 * src/truetype/ttinterp.c (TT_Load_Context, TT_Save_Context): Do not 586 copy 'codeRangeTable'. 587 * src/truetype/ttobjs.h (TT_Size): Remove 'codeRangeTable'. 588 (TT_CodeRange_Tag, TT_CodeRange, TT_DefArray): Moved to... 589 * src/truetype/ttinterp.h: ... this header.1 590 591 2025-06-22 Alexei Podtelezhnikov <apodtele@gmail.com> 592 593 [truetype] Simplify bytecode allocations. 594 595 To avoid repeated synchronization, some TT_Size allocations are moved 596 TT_ExecContext for good. The memory blocks are also consolidated. 597 598 * src/truetype/ttinterp.c (TT_{Load,Save,Done}_Context): Remove 599 synchronization and stack management. 600 * src/truetype/ttobjs.c (tt_size_{init,done}_bytecode): Manage allocations 601 and assign them to the execution context. 602 (tt_size_run_prep): Updated. 603 604 2025-06-22 Alexei Podtelezhnikov <apodtele@gmail.com> 605 606 [truetype] Rework handling of rendering mode in bytecode. 607 608 This replaces a large number of confusing boolean constructs that 609 describe the target rendering mode in the execution context with 610 the straight mode variable. It might fix some hidden bugs when 611 FT_LOAD_TARGET_XXX were used as flags, which they are not. 612 613 The condition that triggers the CV program re-execution is simplified. 614 These events due the rendering mode change are rather rare and unexpected 615 and, therefore, should not be over-analyzed. In v40, all mode changes 616 now trigger the CV program. In v35, only switches to/from mono do. 617 618 * src/truetype/ttinterp.h (TT_ExecContext): Replace 'grayscale', 619 'grayscale_cleartype', 'subpixel_hinting_lean', and 'vertical_lcd_lean' 620 with the rendering 'mode'. 621 * src/truetype/ttinterp.c (Ins_GETINFO): Updated. 622 * src/truetype/ttgload.c (tt_loader_init): Replace 'prep' re-execution 623 trigger and update 'backward_compatibility' condition. 624 (tt_loader_set_pp): Updated. 625 626 2025-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 627 628 * src/truetype/{ttinterp.c,ttobjs.c}: Minor. 629 630 2025-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 631 632 [truetype] Clean up bytecode execution triggers. 633 634 This avoids executing the CV program twice and cleans up the use of 635 'fpgm' and 'prep' triggers 636 637 * src/truetype/ttgload.c (tt_loader_init): Call 'tt_size_init_bytecode' 638 and 'tt_size_run_prep' explicitly and avoid the call repetition. 639 * src/truetype/ttobjs.c (tt_size_ready_bytecode): Removed as unused. 640 (tt_size_init, tt_size_init_bytecode, tt_size_done_bytecode): Remove some 641 'fpgm' and 'prep' triggers and update. 642 (tt_size_run_fpgm, tt_size_run_prep): Do not set the pedantic flag here. 643 * src/truetype/ttobjs.h: Update signatures. 644 645 2025-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 646 647 * src/truetype/ttgload.c (tt_loader_init, load_sbit_image): Clean up. 648 649 2025-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 650 651 [truetype] Simplify twilight zone management. 652 653 * include/freetype/internal/tttypes.h (TT_GlyphZone): Remove 'memory'. 654 * src/truetype/ttobjs.c (tt_glyphzone_done): Use 'memory' as argument. 655 (tt_glyphzone_new, tt_glyphzone_done): Allocate/free as a single block. 656 (tt_size_init_bytecode, tt_size_done_bytecode): Updated. 657 * src/truetype/ttobjs.h (tt_glyphzone_done): Updated signature. 658 659 2025-06-19 Behdad Esfahbod <behdad@behdad.org> 660 661 [autofit] Really fix handling of `RTLD_DEFAULT`. 662 663 This commit actually implements what commit 43ec023e1a7 describes. 664 665 * src/autofit/ft-hb.c (FT_RTLD_FLAGS): New macro for `dlopen`; it uses 666 `RTLD_GLOBAL` only if `RTLD_DEFAULT` is available. 667 668 2025-06-15 Alexei Podtelezhnikov <apodtele@gmail.com> 669 670 [truetype] Revise twilight zone initiation. 671 672 This assures that twilight zone is reset before each CV program 673 execution, including after the rendering mode switch. Fixes #1344. 674 675 * src/truetype/ttobjs.c (tt_size_ready_bytecode): Relocate the GS 676 the twilight zone initiation from here... 677 (tt_size_run_prep): ... to this function, sho that it is always 678 done prior to the CV program execution. 679 * src/truetype/ttobjs.c (TT_Run_Context): Set twilight zone here... 680 (TT_Load_Context): ... rather than here, as it used to be. 681 682 2025-06-13 Alexei Podtelezhnikov <apodtele@gmail.com> 683 684 * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove check. 685 686 The highest (sign) attribute bit is reserved and should be zero. 687 It is harmless to omit this check however. Fixes #1342. 688 689 2025-06-12 Werner Lemberg <wl@gnu.org> 690 691 [autofit] Ignore virtual glyph indices from GSUB lookups. 692 693 Reported as 694 695 https://issues.chromium.org/issues/420401651 696 697 * src/autofit/afadjust.c (af_reverse_character_map_new): Implement it. 698 699 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 700 701 [truetype] Clean up TT_GlyphZone. 702 703 * include/freetype/internal/tttypes.h (TT_GlyphZone): Delete fields. 704 * src/truetype/ttobjs.c (tt_glyphzone_new, tt_glyphzone_done, 705 tt_size_init_bytecode): Updated. 706 707 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 708 709 [truetype] Use FT_ARRAY_ZERO. 710 711 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Updated. 712 * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids, 713 tt_size_ready_bytecode): Updated. 714 715 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 716 717 [truetype] Rearrange bytecode run. 718 719 This is a minor change with large code rearrangements. 720 721 * src/truetype/ttinterp.c (TT_RunIns): Just loop through instructions 722 and move all setup to... 723 (TT_Run_Context): ... here; relocated. 724 (Compute_Round): Replaced by simple assignment, removed. 725 726 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 727 728 [truetype] Relocate the interpreter pointer. 729 730 This reduces dereferencing when calling the interpreter. 731 732 * include/freetype/internal/tttypes.h (TT_Face): Move it from here... 733 * src/truetype/ttinterp.h (TT_ExecContext): ... to here. 734 * src/truetype/ttobjs.c (tt_size_init_bytecode): Move its initialization 735 * src/truetype/ttinterp.c (TT_New_Context): ... to here. 736 (TT_Run_Context): Updated. 737 738 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 739 740 [truetype] Clean up the loader initiation. 741 742 * include/freetype/internal/tttypes.h (TT_LoaderRec): Remove unused field. 743 * src/truetype/ttgload.c (tt_loader_init): Refactor. 744 745 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 746 747 [truetype] Modify bytecode initiation. 748 749 This reduces the number of function calls and data copying events. 750 751 * src/truetype/ttinterp.c (TT_Goto_CodeRange): Merge into... 752 (TT_Set_CodeRange): ... this function. 753 (TT_Load_Context): Do not set up any zones, copy GS, or prepare the 754 execution... 755 (TT_Run_Context): ... do this here instead.. 756 * src/truetype/ttinterp.c (TT_Set_CodeRange): Update signature. 757 * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Call 758 TT_Run_Context. 759 * src/truetype/ttgload.c (TT_Hint_Glyph, tt_loader_init): Updated. 760 761 2025-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 762 763 [truetype] Modify the graphics state management. 764 765 Instead of restoring persistent GS variables, we only save modifications 766 permitted by the CVT program. This reduces the context manipulations. 767 768 * src/truetype/ttobjs.h (TT_GraphicsState): Reorder fields. 769 * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): 770 Do not alter the context. 771 772 * src/truetype/ttgload.c (TT_Hint_Glyph): Do not reset GS. 773 (tt_loader_init): Fix potential issue in 'instruct_control' handling. 774 * src/truetype/ttinterp.c (TT_Run_Context): Fully reset GS. 775 (TT_Load_Conext): Rearrange and remove the 'size' check, already 776 performed in FT_Load_Glyph. 777 (TT_Save_Context): Save only modifiable GS parts. 778 (tt_default_graphics_state): Updated. 779 * src/truetype/ttinterp.h (TT_Run_Context): Update signature. 780 781 2025-06-10 Werner Lemberg <wl@gnu.org> 782 783 [gxvar] Really fix setting of named-instance to Regular. 784 785 This fixes an ommission in commit cf06661c51. 786 787 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize `error`. 788 789 2025-06-10 Werner Lemberg <wl@gnu.org> 790 791 Two more link fixes. 792 793 2025-06-10 Werner Lemberg <wl@gnu.org> 794 795 Update links. 796 797 Found with `linkchecker --check-extern index.html` running locally in the 798 'freetype-web' repository. 799 800 2025-06-07 Behdad Esfahbod <behdad@behdad.org> 801 802 Fix setting of named-instance to Regular 803 804 Fixes https://gitlab.freedesktop.org/freetype/freetype/-/issues/1341 805 806 And more elaborate avoidance of loading face->blend if all coords 807 are zero. 808 809 2025-06-04 Alexei Podtelezhnikov <apodtele@gmail.com> 810 811 * src/type42/t42objs.c (T42_Size_Init): Fix uninitialized use. 812 813 Found by Ozkan Sezer. 814 815 2025-06-04 Ozkan Sezer <sezeroz@gmail.com> 816 817 [autofit] Fix `-Wunused-but-set-variable` warning in Windows builds. 818 819 With this commit, the following warning gets removed. 820 821 ``` 822 In file included from src/autofit/autofit.c:21:0: 823 src/autofit/ft-hb.c: In function 'ft_hb_funcs_init': 824 src/autofit/ft-hb.c:75:35: warning: 825 variable 'version_atleast' set but not used [-Wunused-but-set-variable] 826 ft_hb_version_atleast_func_t version_atleast = NULL; 827 ^~~~~~~~~~~~~~~ 828 ``` 829 830 * src/autofit/ft-hb.c (ft_hb_funcs_init): Move `NULL` check of 831 `version_atleast` out of ifdefs. 832 833 2025-06-04 Ozkan Sezer <sezeroz@gmail.com> 834 835 [build] Revise visibility attributes usage in autotools and CMake. 836 837 * CMakeLists.txt: Set `C_VISIBILITY_PRESET` to hidden for non-Windows only. 838 Windows handles exports with `DLL_EXPORT` defined, and old MinGW 839 toolchains emit a lot of warnings about visibility attributes not being 840 supported in this configuration. 841 842 * build/unix/configure.raw: Revise visibility attributes checks by compiling a 843 better test program with `-Werror` in `CFLAGS` so that warnings correctly 844 indicate unsupported configurations. 845 846 2025-06-04 Ozkan Sezer <sezeroz@gmail.com> 847 848 * CMakeLists.txt: Add support for `FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC`. 849 850 This commit introduces a new CMake option `FT_DYNAMIC_HARFBUZZ`. 851 852 2025-06-03 Ozkan Sezer <sezeroz@gmail.com> 853 854 * src/autofit/ft-hb.c: Fix definition of `_GNU_SOURCE`. 855 856 Commit 43ec023e1a730f defined the macro too late. 857 858 2025-06-03 Werner Lemberg <wl@gnu.org> 859 860 Replace 'www.freetype.org' with 'freetype.org'. 861 862 2025-06-03 Ozkan Sezer <sezeroz@gmail.com> 863 864 * builds/unix/configure.raw: Fix HarfBuzz library detection for MinGW. 865 866 Set `have_harfbuzz*` variables explicitly to dynamic for MinGW, since 867 Windows uses its own `LoadLibrary` call. 868 869 This fixes a MinGW configuration error: 870 871 ``` 872 checking for HARFBUZZ... no 873 checking for dlopen in -lc... no 874 checking for dlopen in -ldl... no 875 configure: error: harfbuzz support requested but library not found 876 ``` 877 878 2025-06-03 Ozkan Sezer <sezeroz@gmail.com> 879 880 * builds/unix/configure.raw: Improve check for `dlopen`. 881 882 Look for `dlopen` first in 'libc', then in 'libdl'. 883 884 2025-06-03 Behdad Esfahbod <behdad@behdad.org> 885 886 * src/autofit/ft-hb.c: Fix usage of `RTLD_DEFAULT`. 887 888 Using `RTLD_DEFAULT` we see whether the process already has HarfBuzz linked 889 in, and reuse it. If this symbol is not defined it is tempting to use 890 `RTLD_GLOBAL` instead, which would make the library available to the whole 891 process. However, without `RTLD_DEFAULT`, we would risk loading a second 892 HarfBuzz library, and if the linker mixes them up, probably giving symbols 893 from the new library to other clients, we might get into trouble. For this 894 reason, we do not pass `RTLD_GLOBAL` to `dlopen`; the default is 895 `RTLD_LOCAL`, and the rest of the process won't see the loaded HarfBuzz and 896 hopefully all be happy. 897 898 2025-05-28 Werner Lemberg <wl@gnu.org> 899 900 [sfnt] `FT_Load_Sfnt_Table` can now also load a font's table directory. 901 902 Closes issue #1263. 903 904 * src/sfnt/ttload.c (tt_face_load_any): Implement it. 905 906 2025-05-28 Werner Lemberg <wl@gnu.org> 907 908 [gzip] Update sources to zlib 1.13.1. 909 910 Fixes issue #1294. 911 912 2025-05-27 Vítor Ramos <vitor.ramos@ufrn.br> 913 914 * src/base/ftobjs.c (FT_Load_Glyph): Loosen auto-hinting constraints. 915 916 Fixes issue #1320. 917 918 2025-05-27 Werner Lemberg <wl@gnu.org> 919 920 Update `CHANGES` file. 921 922 2025-05-27 Behdad Esfahbod <behdad@behdad.org> 923 924 [gxvar] Optimize out more bounds checking. 925 926 Big win, ~20% in measured mega-var font, HarfBuzz's `benchmark-font` 927 'glyph_h_advances' benchmark. 928 929 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Implement it in 930 loops. 931 932 2025-05-27 Behdad Esfahbod <behdad@behdad.org> 933 934 * src/truetype/ttgload.c (load_truetype_glyph): Use `IS_DEFAULT_INSTANCE`. 935 936 2025-05-27 Behdad Esfahbod <behdad@behdad.org> 937 938 [gxvar] Set `doblend` to `FALSE` if at default location. 939 940 * src/truetype/ttgxvar.c (tt_set_mm_blend, TT_Get_Var_Design): Do it. 941 942 2025-05-27 Behdad Esfahbod <behdad@behdad.org> 943 944 [mm/gxvar] Always detect default instance and use optimized codepath. 945 946 Even if it was explicitly set by either design or normalized APIs. 947 948 Also update documentation. 949 950 * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): Use value -2 951 of `error` to indicate that we have a non-default instance. 952 (TT_Set_Named_Instance): Updated. 953 954 * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, 955 FT_Set_Var_Blend_Coordinates): Updated. 956 957 2025-05-27 Alexei Podtelezhnikov <apodtele@gmail.com> 958 959 Typo. 960 961 2025-05-27 Alexei Podtelezhnikov <apodtele@gmail.com> 962 963 * src/truetype/ttinterp.c (TT_Load_Context): Clean up. 964 965 2025-05-26 Werner Lemberg <wl@gnu.org> 966 967 [autofit] Fix integer overflow. 968 969 Reported as 970 971 https://issues.oss-fuzz.com/issues/420401635 972 973 * src/autofit/aflatin.c (af_latin_stretch_top_tilde, 974 af_latin_stretch_bottom_tilde): Use `SUB_LONG`. 975 976 2025-05-26 Werner Lemberg <wl@gnu.org> 977 978 [gxvar] Speed up handling of deltas in `ItemVariationStore`. (3/3) 979 980 * src/base/ftcalc.c (FT_MulAddFix): Removed, no longer needed. 981 * include/freetype/internal/ftcalc.h: Updated. 982 983 2025-05-26 Behdad Esfahbod <behdad@behdad.org> 984 985 [gxvar] Speed up handling of deltas in `ItemVariationStore`. (2/3) 986 987 Do all math in fixed integer and do a single divide at the end. 988 989 Also don't use an array to read deltas; just read them as we go, and skip 990 (branch-free) when scalar is 0. 991 992 30% speedup in measured mega-var font, HarfBuzz's `benchmark-font` 993 'glyph_h_advances' benchmark. 994 995 2025-05-26 Behdad Esfahbod <behdad@behdad.org> 996 997 [gxvar] Speed up handling of deltas in `ItemVariationStore`. (1/3) 998 999 * src/truetype/ttgxvar.c (ft_mul_add_delta_scalar, ft_round_and_shift16): 1000 New functions, reusing code from `ftcalc.c`. 1001 1002 2025-05-26 Behdad Esfahbod <behdad@behdad.org> 1003 1004 Lift `FT_Int64` type to global (internal) FreeType use. 1005 1006 * src/base/ftcalc.c (FT_Int64) [!FT_INT64]: Move declaration to... 1007 * include/freetype/config/integer-types.h: ... this file. 1008 (FT_UInt64) [!FT_INT64]: New structure. 1009 (FT_INT64_ZERO): New macro. 1010 1011 2025-05-26 Behdad Esfahbod <behdad@behdad.org> 1012 1013 [gxvar] Move scalar computation into its own function. 1014 1015 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Split off affected code 1016 into... 1017 (tt_calculate_scalar): ...this new function. 1018 1019 2025-05-26 Werner Lemberg <wl@gnu.org> 1020 1021 [autofit] Make the accent database work for more glyphs (again). 1022 1023 See the added comment for an explanation. 1024 1025 This partially undoes commit f68733d4a8. 1026 1027 * src/autofit/afadjust.c (af_reverse_character_map_new): Always loop over all 1028 elements of the adjustment database. 1029 (in_range): Removed, no longer needed. 1030 1031 2025-05-26 Alexei Podtelezhnikov <apodtele@gmail.com> 1032 1033 [trueetype] Remove useless assignments. 1034 1035 * src/truetype/ttobjs.c (tt_size_run_fpgm): Remove assignment that 1036 is ignored and overridden later in 'Compute_Funcs'. 1037 * src/truetype/ttinterp.c (TT_RunIns): Ditto. 1038 (Ins_MIAP): Formatting. 1039 1040 2025-05-25 Werner Lemberg <wl@gnu.org> 1041 1042 [autofit] Minor code cleanup. 1043 1044 * src/autofit/afadjust.c (af_reverse_character_map_new): Rename `result_set` 1045 to `glyph_alternates` and move its clearing to... 1046 (af_get_glyph_alternates): ...this function. 1047 (af_get_glyph_alternates_helper): s/result/helper_result/. 1048 1049 2025-05-25 Werner Lemberg <wl@gnu.org> 1050 1051 [autofit] Speed up construction of reverse character map. (4/4) 1052 1053 * src/autofit/afadjust.c (af_get_glyph_alternates): Move creation and 1054 deletion of the `helper_result` set to... 1055 (af_reverse_character_map_new): ...this function. 1056 Gain for `arial.ttf` version 7.00: approx. 1%. 1057 1058 2025-05-25 Werner Lemberg <wl@gnu.org> 1059 1060 [autofit] Speed up construction of reverse character map. (3/4) 1061 1062 * src/autofit/afadjust.c (af_reverse_character_map_new): Fold two loops into 1063 one. 1064 Gain for `arial.ttf` version 7.00: approx. 1%. 1065 1066 2025-05-25 Werner Lemberg <wl@gnu.org> 1067 1068 [autofit] Speed up construction of reverse character map. (2/4) 1069 1070 This commit, together with the previous one, makes the startup of the 1071 auto-hinter much faster. 1072 1073 Note, though, that the startup time for handling the diacritic database is 1074 still rather large. For example, loading `arial.ttf` version 7.00 followed 1075 by auto-hinting a first Latin glyph is still approx. three times slower 1076 than before the introduction of the database (this is because function 1077 `hb_ot_layout_lookup_get_glyph_alternates` is called very often). 1078 1079 * src/autofit/afshaper.c (scripts): Rename this array to... 1080 (af_hb_scripts): ...this and export it. 1081 (af_shaper_get_coverage_hb): Updated. 1082 * src/autofit/afshaper.h: Updated. 1083 1084 * src/autofit/afadjust.c (af_reverse_character_map_new): Pass the current 1085 script to `hb_ot_layout_collect_lookups` to make HarfBuzz check less 1086 lookups while searching for glyph alternates. 1087 1088 2025-05-25 Werner Lemberg <wl@gnu.org> 1089 1090 [autofit] Speed up construction of reverse character map. (1/4) 1091 1092 Build reverse cmap for characters of the current script style only. 1093 1094 * src/autofit/afadjust.c (in_range): New function. 1095 (af_reverse_character_map_new): Pass `AF_StyleMetrics` instead of 1096 `AF_FaceGlobals` so that we can access the current script style. 1097 Use `in_range` to limit tested code points. 1098 * src/autofit/afadjust.h: Updated. 1099 * src/autofit/aflatin.c (af_latin_metrics_init): Updated. 1100 1101 2025-05-25 Werner Lemberg <wl@gnu.org> 1102 1103 [autofit] Avoid variable shadowing. 1104 1105 * src/autofit/afadjust.c (af_reverse_character_map_new): Do it. 1106 1107 2025-05-25 Werner Lemberg <wl@gnu.org> 1108 1109 [autofit] Minor speedup of reverse charmap creation. 1110 1111 * src/autofit/afglobal.h (AF_HAS_CMAP_ENTRY): New flag. 1112 (AF_STYLE_MASK): Update value. 1113 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Set 1114 `AF_HAS_CMAP_ENTRY`. 1115 1116 * src/autofit/afadjust.c (af_reverse_character_map_new): For the creation of 1117 the reverse map, change code to handle glyphs with cmap entries before 1118 glyphs without cmap entries. Doing so avoids some code redundancy and 1119 reduces the number of hash lookups. 1120 1121 2025-05-25 Werner Lemberg <wl@gnu.org> 1122 1123 [autofit] Whitespace. 1124 1125 2025-05-25 Werner Lemberg <wl@gnu.org> 1126 1127 [autofit] Use `FT_Offset`. 1128 1129 * src/autofit/afadjust.c (af_adjustment_database_lookup, 1130 af_reverse_character_map_new): Do it. 1131 1132 2025-05-25 Werner Lemberg <wl@gnu.org> 1133 1134 [autofit] Simplify return value of `af_adjustment_database_lookup`. 1135 1136 * src/autofit/adfadjust.h (af_adjustment_database_lookup): Return integer. 1137 (AF_AdjustmentDatabaseEntry): Move structure to... 1138 * src/autofit/afadjust.c: ...this file. 1139 (af_adjustment_database_lookup, af_reverse_character_map_new): Updated. 1140 * src/autofit/aflatin.c 1141 (af_glyph_hints_apply_vertical_separation_adjustments): Updated. 1142 1143 2025-05-25 Werner Lemberg <wl@gnu.org> 1144 1145 [autofit] Remove no longer used functions and structures. 1146 1147 This is the clean-up from the previous commit. 1148 1149 * src/autofit/afadjust.c (af_reverse_character_map_entry_compare, 1150 af_reverse_character_map_lookup, af_reverse_character_map_expand): 1151 Removed. 1152 * src/autofit/afadjust.h: Updated. 1153 * src/autofit/aftypes.h (AF_ReverseMapEntry, AF_ReverseCharacterMap): 1154 Removed. 1155 1156 2025-05-25 Werner Lemberg <wl@gnu.org> 1157 1158 [autofit] Use a hash for handling vertical accent adjustments. 1159 1160 This greatly simplifies the code. 1161 1162 * src/autofit/afadjust.c (af_reverse_character_map_new): Implement it. 1163 (af_reverse_character_map_done): Updated. 1164 * src/autofit/afadjust.h: Updated. 1165 1166 * src/autofit/aflatin.c 1167 (af_glyph_hints_apply_vertical_separation_adjustments): Updated. 1168 1169 * src/autofit/aftypes.h: Include `fthash.h`. 1170 (AF_StyleMetrics): Change type of `reverse_charmap` to `FT_Hash`. 1171 1172 2025-05-25 Werner Lemberg <wl@gnu.org> 1173 1174 * src/autofit/aflatin.c (af_latin_hints_apply): Improve code legibility. 1175 1176 2025-05-25 Werner Lemberg <wl@gnu.org> 1177 1178 [autofit] Use `FT_LONG_MIN` and `FT_LONG_MAX` for `FT_Pos` variables. 1179 1180 * src/autofit/aflatin.c (af_latin_metrics_init_blues, 1181 af_compute_vertical_extrema, af_find_highest_contour, 1182 af_find_second_highest_contour, af_find_lowest_contour, 1183 af_find_second_lowest_contour, af_check_contour_horizontal_overlap): 1184 Updated. 1185 1186 2025-05-25 Werner Lemberg <wl@gnu.org> 1187 1188 [autofit] Fix uninitialized variables. 1189 1190 * src/autofit/aflatin.c (af_latin_stretch_top_tilde, 1191 af_latin_stretch_bottom_tilde): Initialize `min_measurement`. 1192 1193 2025-05-23 Behdad Esfahbod <behdad@behdad.org> 1194 1195 [ttmtx] Fix check for being non-default variation position. 1196 1197 If user explicitly sets variations to `NULL` after it being set to something 1198 else, `face->blend` will still be non-`NULL`. The intention here however is 1199 correctly captured by `FT_IS_VARIATION`. 1200 1201 * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `FT_IS_VARIATION`. 1202 1203 2025-05-23 Behdad Esfahbod <behdad@behdad.org> 1204 1205 [gxvar] Optimize loading of 'gvar' table. 1206 1207 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store, 1208 tt_var_load_delta_set_index_mapping, ft_var_load_gvar): Use frames to 1209 reduce bounds checking. 1210 (TT_Vary_Apply_Glyph_Deltas): Better macro usage. 1211 1212 2025-05-22 Behdad Esfahbod <behdad@behdad.org> 1213 1214 [mm] Short-circuit setting face to default instance if already is so. 1215 1216 I found that in hb-ft I need to sometime reset the face to the default 1217 instance. However, calling `FT_Set_Var_Design_Coordinates` with no coords 1218 was still slowing down at least the glyph-advance code by processing 1219 variations. 1220 1221 Perhaps there's a better fix, but this handles the easy cases. 1222 1223 * src/base/ftmm.c (FT_Set_Var_Design_Coordinates): Implement it. 1224 1225 2025-05-22 Behdad Esfahbod <behdad@behdad.org> 1226 1227 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix allocation. 1228 1229 Bug was introduced in commit 582de1a4b6f. 1230 1231 2025-05-21 Werner Lemberg <wl@gnu.org> 1232 1233 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Remove redundant test. 1234 1235 This was erroneously added in commit e6e9110a8. 1236 1237 2025-05-21 ColdPaleLight <coldpalelight@gmail.com> 1238 1239 [sdf] Skip neighbor comparison for pixels near edges. 1240 1241 If the distance of the current pixel to the edge is less than or equal 1242 to 0.5, skip further neighbor comparisons to avoid unnecessary 1243 calculations. When the `USE_SQUARED_DISTANCES` macro is defined, 1244 compare to 0.25 instead. 1245 1246 * src/sdf/ftbsdf.c (compare_neighbor): Add early return for pixels 1247 close to edges to avoid unnecessary neighbor checks. 1248 1249 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1250 1251 [gxvar] Cache shared-tuple scalar values. 1252 1253 GoogleSansFlex HB benchmark-font draw results: 1254 1255 Before: 2.13ms 1256 After: 1.65ms 1257 Speedup: 22% 1258 1259 * src/truetype/ttgxvar.h (GX_BlendRec): Add `tuplescalars` field. 1260 1261 * src/truetype/ttgxvar.c (ft_var_load_gvar): Allocate `tuplescalars` array. 1262 (tt_set_mm_blend): Set its values. 1263 (TT_Vary_Apply_Glyph_Deltas): Use it. 1264 (tt_done_blend): Deallocate it. 1265 1266 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1267 1268 [gxvar] Reduce number of mallocs. 1269 1270 8% speed up in drawing GoogleSansFlex variable in HB benchmark-font. 1271 1272 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Use an allocation 1273 pool instead of individual allocations. 1274 1275 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1276 1277 [gxvar] Another optimization in computing scalar. 1278 1279 Another ~6% speedup in GoogleSansFlex var drawing. 1280 1281 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Test `ncv` for being zero. 1282 1283 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1284 1285 [gxvar] Remove stale comment. 1286 1287 The code *does* check against start/end! 1288 1289 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1290 1291 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Micro-optimize. 1292 1293 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1294 1295 [gxvar] Inline two USHORT reads. 1296 1297 Speeds up GoogleSansFlex variable glyph drawing by ~13%. 1298 1299 Before: 2.95ms 1300 After: 2.57ms 1301 1302 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Do it. 1303 1304 2025-05-21 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1305 1306 [gxvar] Micro-optimize loop end condition. 1307 1308 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Do it. 1309 1310 2025-05-21 Behdad Esfahbod <behdad@behdad.org> 1311 1312 [truetype] Don't process `mvar` metrics if default instance. 1313 1314 GoogleSansFlex default-instance HarfBuzz benchmark-font draw: 1315 1316 Before: 0.610ms 1317 After: 0.435ms 1318 Speedup: 28% 1319 1320 * src/truetype/ttobjs.c (tt_face_init) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: 1321 Check `instance_index`. 1322 1323 2025-05-21 Alexei Podtelezhnikov <apodtele@gmail.com> 1324 1325 * src/truetype/ttinterp.c (Ins_MIRP,DELTAP,DELTAC): Minor. 1326 1327 2025-05-20 Alexei Podtelezhnikov <apodtele@gmail.com> 1328 1329 [truetype] Update bytecode error handling. 1330 1331 * src/truetype/ttinterp.c (Ins_SHP,SHPIX,ALIGNRP): Return appropriate 1332 error in case of stack underflow. 1333 (Ins_IP): Ditto and remove redundant check. 1334 1335 2025-05-19 Werner Lemberg <wl@gnu.org> 1336 1337 * src/aflatin.c (af_latin_hint_edges): Refine fix for serif handling. 1338 1339 Commit 11432424 (from 2025-May-12) was too aggressive; it is now restricted 1340 to edges that are not too far away. 1341 1342 2025-05-19 Werner Lemberg <wl@gnu.org> 1343 1344 * src/afadjust.c (adjustment_database): Make it complete up to U+FFFF. 1345 1346 Also fix two entries. 1347 1348 This is for Unicode 17.0. 1349 1350 2025-05-19 Werner Lemberg <wl@gnu.org> 1351 1352 [autofit] Fix vertical adjustment of (mainly) double diacritics. 1353 1354 The series of commits that introduced this adjustment support had some 1355 flaws. 1356 1357 - If there were two diacritics on top of a base glyph, and the upper 1358 diacritic was a tilde, the vertical centering correction was incorrectly 1359 applied to the lower, non-tilde glyph instead of the tilde. 1360 1361 - The maximum value allowed to shift a glyph was too strict (and also not 1362 handling rounding issues), causing some diacritics and combinations of 1363 diacritics to be not shifted at all. 1364 1365 * src/autofit/aflatin.c 1366 (af_glyph_hints_apply_vertical_separation_adjustments): Correctly handle 1367 vertical centering correction. 1368 1369 2025-05-19 Werner Lemberg <wl@gnu.org> 1370 1371 [autofit] Code hygiene. 1372 1373 * src/autofit/aflatin.c 1374 (af_glyph_hints_apply_vertical_separation_adjustments): Use more flag 1375 variables and improve trace messages. 1376 1377 2025-05-19 Werner Lemberg <wl@gnu.org> 1378 1379 * src/autofit/aflatin.c (af_latin_hint_edges): Fix handling of serifs. 1380 1381 This has been discovered while inspecting the auto-hinting results of 1382 character 'Ễ' in font `arial.ttf` (version 7.00) at 13ppem. 1383 1384 2025-05-19 Werner Lemberg <wl@gnu.org> 1385 1386 [autofit] Minor. 1387 1388 * src/autofit/aflatin.c (af_latin_hint_edges): Rename `has_serifs` to 1389 `has_non_stem_edges` and make it of type `FT_Bool`. 1390 1391 2025-05-19 Werner Lemberg <wl@gnu.org> 1392 1393 [autofit] New algorithm for preventing hinting of tilde glyphs. 1394 1395 The old algorithm removed segments from edges to make the auto-hinter ignore 1396 a tilde. However, the implementation had two flaws. 1397 1398 - Edge array elements were moved around without reordering them afterwards. 1399 - The linking between edges and segments wasn't correctly updated for moved 1400 edges, which could cause endless loops. 1401 1402 Correcting both problems are non-trivial; additionally, a fix would make 1403 the auto-hinter slower. 1404 1405 For these reasons, a new, simpler approach is taken: A new flag allows 1406 points to be tagged as being ignored, and if such a point is enountered, it 1407 doesn't get added to a segment. 1408 1409 Fixes issue #1333. 1410 1411 * src/autofit/afhints.h (AF_FLAG_IGNORE): New macro. 1412 1413 * src/autofit/aflatin.c (af_latin_hints_compute_segments, af_touch_contour): 1414 Use it. 1415 (af_remove_segments_containing_point, af_remove_top_points_from_edges, 1416 af_remove_bottom_points_from_edges): Removed. 1417 (af_latin_stretch_top_tilde): Call `af_touch_top_contours` and 1418 `af_touch_bottom_contours` unconditionally. 1419 (af_latin_hints_apply): Updated. 1420 1421 2025-05-16 Alexei Podtelezhnikov <apodtele@gmail.com> 1422 1423 * src/truetype/ttinterp.c (TT_DotFix14): Silence UBSAN. 1424 1425 2025-05-16 Alexei Podtelezhnikov <apodtele@gmail.com> 1426 1427 * src/truetype/ttinterp.c (Ins_DELTAP): Flip if-else. 1428 1429 2025-05-15 Alexei Podtelezhnikov <apodtele@gmail.com> 1430 1431 [truetype] Optimize DELTAP and DELTAC. 1432 1433 * src/truetype/ttinterp.c (Ins_DELTAP,DELTAC): Perform PPEM range- 1434 checking and manipulations outside the loop. 1435 1436 2025-05-14 Alexei Podtelezhnikov <apodtele@gmail.com> 1437 1438 * src/truetype/ttinterp.c (Compute_Funcs): Replace shifts. 1439 1440 2025-05-14 Alexei Podtelezhnikov <apodtele@gmail.com> 1441 1442 [truetype] Tighten code overflow checks. 1443 1444 Fixes #1336. 1445 1446 * src/truetype/ttinterp.c (Ins_NPUSHB,NPUSHW,PUSHB, PUSHW): 1447 Tighten conditions. 1448 1449 2025-05-14 Chris Liddell <chris.liddell@artifex.com> 1450 1451 [type1] Fix memory leak on CharString error. 1452 1453 In the event that a CharString retrieved via the incremental interface 1454 caused an error, the memory for that CharString was not being freed. 1455 1456 * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Free charstring. 1457 1458 2025-05-14 Werner Lemberg <wl@gnu.org> 1459 1460 Whitespace, formatting, minor spelling fix. 1461 1462 2025-05-14 Werner Lemberg <wl@gnu.org> 1463 1464 Adminstrativa. 1465 1466 2025-05-13 Alexei Podtelezhnikov <apodtele@gmail.com> 1467 1468 [truetype] Finalize bytecode changes. 1469 1470 * src/truetype/ttinterp.c: Formatting, minor. 1471 (TT_Goto_CodeRange): Initialize 'iniRange' here... 1472 (TT_RunIns): ... instead of here. 1473 * docs/CHANGES: Updated. 1474 1475 2025-05-13 Alexei Podtelezhnikov <apodtele@gmail.com> 1476 1477 [truetype] Streamline backward compatibility. 1478 1479 The 'backward_compatibility' is only set in v40: no need to check 1480 the interpreter version again and again. In addition, we now track 1481 IUP in its lower bits. After both IUPx and IUPy have been called, 1482 'backward_compatibility' becomes equal to 0x7. 1483 1484 * src/truetype/ttinterp.h (TT_ExecContextRec): Wrap 'iup?_called' 1485 into 'backward_compatibility'. 1486 * src/truetype/ttinterp.c (Ins_INSTCTRL): Sync 'backward_compatibility'. 1487 (Direct_Move, Direct_Move_X/Y, Move_Zp2_Point, 1488 Ins_FLIPPT,FLIPRGON,FLIPRGOFF,SHPIX,DELTAP): Updated. 1489 (TT_RunIns): Do not mess with IUP flags. 1490 * src/truetype/ttgload.c (tt_loader_init): Set 'backward_compatibility'. 1491 (TT_Hint_Glyph): Updated. 1492 1493 2025-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1494 1495 [truetype] Optimize bytecode movements. 1496 1497 Replacing FT_MulDiv with FT_MulFix gives large performance gains. 1498 1499 * src/truetype/ttinterp.h (TT_ExecContextRec): Store "projected" 1500 freedom vector. 1501 * src/truetype/ttinterp.c (Compute_Funcs): Compute "projected" 1502 freedom vector. 1503 (Direct_Move, Direct_Move_Orig, Compute_Point_displacement): Use it. 1504 1505 2025-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1506 1507 [truetype] Simplify stack access. 1508 1509 * src/truetype/ttinterp.c (Ins_MINDEX,CINDEX): Use local stack pointers. 1510 (Ins_DELTAP,DELTAC): Ditto; limit the number of pairs before looping. 1511 1512 2025-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1513 1514 [truetype] Tweak bytecode looping. 1515 1516 * src/truetype/ttinterp.c (Ins_FLIPPT,SHP,SHPIX,IP,ALIGNRP): Handle 1517 counters and stack locally. 1518 (TT_RunIns): Updated. 1519 1520 2025-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1521 1522 [truetype] Tweak bytecode initiation. 1523 1524 * src/truetype/ttinterp.c (TT_Load_Context): Init stack tops. 1525 * src/truetype/ttinterp.h (TT_ExecContextRec): Document it and clean. 1526 * src/truetype/ttobjs.c (tt_size_run_prep,fpgm): Updated. 1527 * src/truetype/ttgload.c (tt_loader_init): Minor. 1528 1529 2025-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1530 1531 [truetype] Modify stack handling. 1532 1533 * src/truetype/ttinterp.c (Ins_GETVARIATION): Increment stack. 1534 (Ins_NPUSHB,NPUSHW,PUSHB,PUSHW): Handle the code stack here, ... 1535 (TT_RunIns): ... instead of here. Consolidate error handling. 1536 (SkipCode): Remove preemptive check. 1537 1538 2025-05-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1539 1540 [truetype] Modify bytecode steps. 1541 1542 * src/truetype/ttinterp.h (TT_Exec_ContextRec): Remove 'step_ins'. 1543 * src/truetype/ttinterp.c (TT_RunIns, Ins_Goto_CodeRange, 1544 Ins_JMPR,ENDF,PUSHW,NPUSHW): Set and use zero increment 'length' instead. 1545 (Ins_CALL,LOOPCALL,UNKNOWN): Updated. 1546 1547 2025-05-10 Werner Lemberg <wl@gnu.org> 1548 1549 [autofit] Add safety check for accent adjustments. 1550 1551 This commit does two things. 1552 1553 - Ignore accents that have too large heights. This situation can happen if 1554 an accent outline is unexpectedly not the highest (or lowest) contour. 1555 - Add a new adjustment flag `AF_ADJUST_NO_HEIGHT_CHECK` to override the 1556 height check. 1557 1558 * src/autofit/afadjust.h (AF_ADJUST_NO_HEIGHT_CHECK): New macro. 1559 1560 * src/autofit/afadjust.c (adjustment_database): Updated. 1561 1562 * src/autofit/aflatin.c (af_latin_hints_apply): Handle new flag. 1563 (af_glyph_hints_apply_vertical_separation_adjustments): Check limit. 1564 1565 2025-05-10 Werner Lemberg <wl@gnu.org> 1566 1567 [autofit] Better handling of characters with attached diacritics. (3/3) 1568 1569 Fixes issue #136. 1570 1571 * src/autofit/afadjust.c (adjustment_database): Updated. 1572 1573 2025-05-10 Werner Lemberg <wl@gnu.org> 1574 1575 [autofit] Better handling of characters with attached diacritics. (2/3) 1576 1577 * src/autofit/afadjust.h (AF_IGNORE_CAPITAL_TOP, AF_IGNORE_CAPITAL_BOTTOM, 1578 AF_IGNORE_SMALL_TOP, AF_IGNORE_SMALL_BOTTOM): New macros. 1579 1580 * src/autofit/afadjust.c (af_reverse_character_map_new) 1581 [FT_DEBUG_LEVEL_TRACE]: Updated. 1582 Also fix debugging strings of other flags. 1583 1584 * src/autofit/afhints.h (AF_EDGE_NO_BLUE): New edge flag to make the 1585 auto-hinter ignore the edge while assigning blue zones. 1586 1587 * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Use it. 1588 (af_prevent_top_blue_alignment, af_prevent_bottom_blue_alignment, 1589 af_latin_get_base_glyph_blues, af_latin_ignore_top, 1590 af_latin_ignore_bottom): New functions. 1591 (af_latin_hints_apply): Updated. 1592 1593 2025-05-10 Werner Lemberg <wl@gnu.org> 1594 1595 [autofit] Better handling of characters with attached diacritics. (1/3) 1596 1597 Introduce blue zone properties that will be used to make the auto-hinter 1598 ignore diacritics attached on the top or the bottom of a base character. 1599 1600 * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM, 1601 AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM): New properties. 1602 * src/autofit/afblue.dat: Use them. 1603 1604 * src/autofit/afblue.c, src/autofit/afblue.h: Rengenerated. 1605 1606 * src/autofit/aflatin.h (AF_LATIN_IS_CAPITAL_BOTTOM_BLUE, 1607 AF_LATIN_IS_SMALL_BOTTOM_BLUE, AF_LATIN_BLUE_BOTTOM, 1608 AF_LATIN_BLUE_BOTTOM_SMALL): New macros. 1609 1610 * src/autofit/aflatin.c (af_latin_metrics_init_blues)[FT_DEBUG_LEVEL_TRACE]: 1611 Updated. 1612 1613 2025-05-09 Alexei Podtelezhnikov <apodtele@gmail.com> 1614 1615 * src/raster/ftraster.c (Line_Up): Use 64-bit calculations. 1616 1617 Attempt to fix #1332. 1618 1619 2025-05-09 Werner Lemberg <wl@gnu.org> 1620 1621 [sfnt] Avoid allocation bomb in compressed SVG documents. 1622 1623 Reported as 1624 1625 https://issues.oss-fuzz.com/issues/416538625 1626 1627 * src/sfnt/ttsvg.c (MAX_SVG_SIZE): New macro. 1628 (tt_face_load_svg_doc): Reject too large buffer. 1629 1630 2025-05-08 Werner Lemberg <wl@gnu.org> 1631 1632 * include/freetype/ttnameid.h (TT_UCR_*): Define with unsigned long. 1633 (TT_UCR_PHAGSPA): Fix definition. 1634 1635 Fixes issue #1300. 1636 1637 2025-05-08 Werner Lemberg <wl@gnu.org> 1638 1639 [doc] Mention that there is no rendering support for 'COLR' v1 tables. 1640 1641 Handles issue #1319. 1642 1643 2025-05-08 Alexei Podtelezhnikov <apodtele@gmail.com> 1644 1645 * src/truetype/ttinterp.c (TT_DotFix14): Silence UBSAN. 1646 1647 2025-05-07 Alexei Podtelezhnikov <apodtele@gmail.com> 1648 1649 * src/cff/cffgload.c (cff_slot_load): Fix autohinter scaling. 1650 1651 Fixes #1330. 1652 1653 2025-05-05 Werner Lemberg <wl@gnu.org> 1654 1655 [autofit] Avoid division by zero. 1656 1657 Fixes issue #1331. 1658 1659 * src/autofit/aflatin.c (af_latin_stretch_bottom_tilde): Don't divide by 1660 zero. 1661 1662 2025-05-04 Carlo Bramini <carlo.bramix@libero.it> 1663 1664 Fix Cygwin visibility attributes. 1665 1666 Reported as compilation warnings in #1329. 1667 1668 * include/freetype/config/public-macros.h: Check __CYGWIN__. 1669 * include/freetype/internal/compiler-macros.h: Ditto. 1670 1671 2025-05-03 KatekovAnton <void0main@gmail.com> 1672 1673 * CMakeLists.txt: Fix cmake 4 error by specifying the policy version. 1674 1675 2025-04-29 Werner Lemberg <wl@gnu.org> 1676 1677 * docs/CHANGES: Updated. 1678 1679 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1680 1681 Provide configuration option to dynamically load the HarfBuzz library. 1682 1683 We now request HarfBuzz version 2.6.8 (published in June 2020) or newer to 1684 simplify the setup; this version introduced function 1685 `hb_ot_layout_lookup_get_glyph_alternates`, which we need for the adjustment 1686 database of the auto-hinter. 1687 1688 No CMake support yet for dynamic loading. 1689 1690 * include/freetype/config/ftoption.h, devel/ftoption.h 1691 (FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC): New configuration macro. 1692 1693 * builds/unix/configure.raw: Implement `--with-harfbuzz=dynamic`. 1694 This gets tested automatically if we can't link with `libharfbuzz`. 1695 (ft_option_set, ft_option_unset): Refine. 1696 Require at least HarfBuzz version 2.6.8. 1697 1698 * meson.build: Do the same as `configure.raw`. 1699 * meson_options.txt: Updated. 1700 1701 * CMakeLists.txt: Require at least HarfBuzz version 2.6.8. 1702 1703 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1704 1705 [autofit] Enable dynamic loading of HarfBuzz. (2/2) 1706 1707 Handle the case where loading HarfBuzz dynamically fails. 1708 1709 * src/autofit/ft-hb.c, src/autofit/ft-hb.h (ft_hb_enabled): New function. 1710 1711 * src/autofit/afglobal.c (af_face_globals_new, af_face_globals_free): 1712 Guard HarfBuzz functions with `ft_hb_enabled`. 1713 1714 * src/autofit/aflatin.c (af_latin_metrics_init_widths, 1715 af_latin_metrics_init_blues, af_latin_metrics_check_digits): Simplify 1716 setup of `shaper_buf`. 1717 Guard calls of `af_shaper_buf_create` with `ft_hb_enabled`. 1718 1719 * src/autofit/afcjk.c (af_cjk_metrics_init_widths, 1720 af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Dito. 1721 1722 * src/autofit/afshaper.c: Guard all HarfBuzz function calls with 1723 `ft_hb_enabled`. 1724 1725 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1726 1727 [autofit] Enable dynamic loading of HarfBuzz. (1/2) 1728 1729 This commit activates the mini-HarfBuzz header files and provides the 1730 necessary infrastructure for dynamically loading HarfBuzz if 1731 `FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC` is defined (this macro gets set up 1732 in a follow-up commit). 1733 1734 * src/autofit/ft-hb.c: New file, providing `ft_hb_funcs_init` and 1735 `ft_hb_funcs_done` for loading HarfBuzz dynamically. The name of the 1736 library is hold in the macro `FT_LIBHARFBUZZ`, which can be overridden. 1737 1738 * src/autofit/ft-hb.h: Don't include `hb.h` but `ft-hb-types.h`. 1739 (hb): Modified to handle both standard linking and dynamically 1740 loading of HarfBuzz. 1741 (HB_EXTERN): New macro to load `ft-hb-decls.h`. 1742 1743 * src/autofit/afadjust.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: For the sake of 1744 dynamically loading the HarfBuzz library, replace the compile-time macro 1745 `HB_VERSION_ATLEAST` with a call to the run-time function 1746 `hb_version_atleast` where necessary – a follow-up commit will set the 1747 minimum version of HarfBuzz to 2.6.8, which provides all necessary 1748 functions needed by FreeType. 1749 1750 * src/autofit/afmodule.h: Include `ft-hb.h`. 1751 (AF_ModuleRec) [FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC]: Add `hb_funcs` 1752 structure to hold pointers to the dynamically loaded HarfBuzz functions. 1753 1754 * src/autofit/afmodule.c (af_autofitter_init, af_autofitter_done) 1755 [FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC]: Call `ft_hb_funcs_init` and 1756 `ft_hb_funcs_done`. 1757 1758 * src/autofit/afshaper.h: Updated. 1759 * src/autofit/autofit.c: Include `ft-hb.c`. 1760 1761 * src/autofit/rules.mk (AUTOF_DRV_SRC, AUTOF_DRV_H): Updated. 1762 1763 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1764 1765 [autofit] Some preparations for loading HarfBuzz dynamically. (4/4) 1766 1767 Add 'mini' HarfBuzz declarations to make FreeType independent on HarfBuzz 1768 header files. 1769 1770 The files get activated in a follow-up commit. 1771 1772 * src/autofit/ft-hb-decls.h, src/autofit/ft-hb-types.h: New files, holding 1773 verbatim (or slightly massaged) entries from public HarfBuzz header files. 1774 1775 * src/autofit/hb-script: New file. 1776 A verbatim copy of a public HarfBuzz header file. 1777 1778 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1779 1780 [autofit] Some preparations for loading HarfBuzz dynamically. (3/4) 1781 1782 * src/autofit/afshaper.c: Move around code so that the non-HarfBuzz code is 1783 present even if `FT_CONFIG_OPTION_USE_HARFBUZZ` is not defined. This is a 1784 preliminary step to allow deactivation of HarfBuzz at run-time. 1785 1786 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1787 1788 [autofit] Some preparations for loading HarfBuzz dynamically. (2/4) 1789 1790 Pass `AF_FaceGlobals` to many functions, or provide it, tagged with 1791 `FT_UNUSED`. We need this later on to access a dynamically linked HarfBuzz 1792 library. 1793 1794 * src/autofit/ft-hb-ft.h (ft_hb_ft_font_create): Use `globals` argument. 1795 Drop unused `destroy` argument. 1796 * src/autofit/ft-hb-ft.c (ft_hb_ft_face_create, ft_hb_ft_font_create): Use 1797 `globals` argument. 1798 Drop unused `destroy` argument. 1799 (ft_hb_ft_face_create, ft_hb_ft_reference_table): Cast `user_data` to 1800 `AF_FaceGlobals`. 1801 1802 * src/autofit/afadjust.c (af_get_glyph_alternates_helper, 1803 af_get_glyph_alternates): Add `globals` argument. 1804 Update callers. 1805 1806 * src/autofit/afshaper.c, src/autofit/afshaper.h (af_shaper_buf_create, 1807 af_shaper_buf_destroy): Use `globals` argument. 1808 1809 * src/autofit/afglobal.c (af_face_globals_new): Updated. 1810 1811 * src/autofit/afcjk.c (af_cjk_metrics_init_widths, 1812 af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated. 1813 * src/autofit/aflatin.c (af_latin_metrics_init_widths, 1814 af_latin_metrics_init_blues, af_latin_metrics_check_digits): Updated. 1815 1816 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1817 1818 [autofit] Some preparations for loading HarfBuzz dynamically. (1/4) 1819 1820 * src/autofit/ft-hb.h: New file, defining the `hb` macro. Later on, we 1821 provide a different definition of this macro depending on a yet-to-come 1822 configuration option to support dynamic loading of HarfBuzz functions. 1823 1824 * src/autofit/afadjust.c, src/autofit/afglobal.c, src/autofit/afshaper.c, 1825 stc/ft-hb-ft.c: Use it. 1826 1827 2025-04-29 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 1828 1829 [autofit] Rename 'ft-hb' to 'ft-hb-ft'. 1830 1831 Since it's a (shrinked) copy of 'hb-ft'. 1832 1833 * src/autofit/afglobal.c (af_face_globals_new), src/autofit/afshaper.h, 1834 src/autofit/autofit.c: Updated. 1835 1836 * src/autofit/ft-hb.c, src/autofit/ft-hb.h: Renamed to... 1837 * src/autofit/ft-hb-ft.c, src/autofit/ft-hb-ft.h: ...this; updated. 1838 1839 * src/autofit/rules.mk (AUTOF_DRV_SRC): Updated. 1840 1841 2025-04-29 Werner Lemberg <wl@gnu.org> 1842 1843 * src/autofit/aflatin.c (af_latin_stretch_top_tilde): Don't divide by zero. 1844 1845 Reported as 1846 1847 https://issues.oss-fuzz.com/issues/414320186 1848 1849 2025-04-28 Werner Lemberg <wl@gnu.org> 1850 1851 [autofit] Extend adjustment database with characters up to U+1FFF. 1852 1853 This adds many pre-combined Latin glyphs, Cyrillic, Greek, and some 1854 characters from other scripts (or rather, Unicode blocks). 1855 1856 Fixes issues #112 and #471. 1857 1858 2025-04-28 Werner Lemberg <wl@gnu.org> 1859 1860 [autofit] Support diacritics with special vertical minima. 1861 1862 This code catches situations like U+1F90 ('ᾐ'), where some fonts have 1863 exactly the same vertical minimum for the lower accent as for the base 1864 glyph. 1865 1866 * src/autofit/aflatin.c (af_find_highest_contour, af_find_lowest_contour): 1867 Handle it. 1868 1869 2025-04-28 Werner Lemberg <wl@gnu.org> 1870 1871 [autofit] More tilde stretch support. (3/3) 1872 1873 The auto-hinter now supports up to four tilde glyphs (two above and two 1874 below a base character). 1875 1876 Note that diacritics above (or below) a tilde are now also ignored by the 1877 auto-hinter. 1878 1879 * src/autofit/afadjust.h (AF_ADJUST_TILDE_TOP2, AF_ADJUST_TILDE_BOTTOM2): 1880 New macros. 1881 * src/autofit/afadjust.c (af_reverse_character_map_new): Updated. 1882 1883 * src/autofit/aflatin.c (af_remove_top_points_from_edges, 1884 af_remove_bottom_points_from_edges): Make functions also handle all 1885 contours higher (or lower) of the given one in the argument. 1886 (af_touch_top_contours, af_touch_bottom_contours): New functions. 1887 (af_latin_stretch_top_tilde, af_latin_stretch_bottom_tilde): Use it to 1888 also handle all contours higher (or lower) than the tilde contour. 1889 1890 * (af_latin_hints_apply): Handle more tilde glyphs. 1891 1892 2025-04-28 Werner Lemberg <wl@gnu.org> 1893 1894 [autofit] More tilde stretch support. (2/3) 1895 1896 * src/autofit/aflatin.c (af_latin_stretch_top_tilde, 1897 af_latin_stretch_bottom_tilde): Return vertical size difference between 1898 stretched and original contour. 1899 (af_latin_align_top_tilde, af_latin_align_bottom_tilde): Return applied 1900 delta. 1901 (af_latin_hints_apply): Updated; the return values are not used yet. 1902 1903 2025-04-28 Werner Lemberg <wl@gnu.org> 1904 1905 [autofit] More tilde stretch support. (1/3) 1906 1907 Move some existing code that we soon need elsewhere into separate functions. 1908 1909 * src/autofit/aflatin.c (af_move_contours_up, af_move_contours, down): New 1910 functions. 1911 (af_glyph_hints_apply_vertical_separation_adjustments): Use them. 1912 (af_touch_contour): New function. 1913 (af_latin_stretch_top_tilde, af_latin_stretch_bottom_tilde): Use it. 1914 1915 (af_latin_remove_top_tilde_points_from_edges, 1916 af_latin_remove_bottom_tilde_points_from_edges): Renamed to... 1917 (af_remove_top_points_from_edges, af_remove_bottom_points_from_edges): 1918 ...this. 1919 Update callers. 1920 1921 2025-04-28 Werner Lemberg <wl@gnu.org> 1922 1923 [autofit] Support two below/above accents for vertical adjustment. (2/2) 1924 1925 * src/autofit/afadjust.h (AF_ADJUST_UP2, AF_ADJUST_DOWN2): New macros. 1926 * src/autofit/afadjust.c (af_reverse_character_map_new): Updated. 1927 1928 * src/autofit/aflatin.c 1929 (af_glyph_hints_apply_vertical_separation_adjustments): Implement it. 1930 1931 2025-04-28 Werner Lemberg <wl@gnu.org> 1932 1933 [autofit] Support two below/above accents for vertical adjustment. (1/2) 1934 1935 Some variable renamings. 1936 1937 2025-04-28 Werner Lemberg <wl@gnu.org> 1938 1939 [autofit] Routines for finding the second highest/lowest contour. 1940 1941 * src/autofit/aflatin.c (af_find_second_highest_contour, 1942 af_find_second_lowest_contour): New functions. 1943 1944 2025-04-28 Werner Lemberg <wl@gnu.org> 1945 1946 [autofit] Use more functions to reduce code. 1947 1948 * src/autofit/aflatin.c (af_find_highest_contour, af_find_lowest_contour): 1949 Updated. 1950 (af_glyph_hints_apply_vertical_separation_adjustments): Use 1951 `af_compute_vertical_extrema`, `af_find_highest_contour`, and 1952 `af_find_lowest_contour`. 1953 (af_latin_hints_apply): Use `af_compute_vertical_extrema`, 1954 1955 2025-04-28 Werner Lemberg <wl@gnu.org> 1956 1957 * src/autofit/aflatin.c (af_compute_vertical_extrema): New function. 1958 1959 To be used in a follow-up commit. 1960 1961 2025-04-28 Werner Lemberg <wl@gnu.org> 1962 1963 * src/autofit/aflatin.c: Some variable renaming. 1964 1965 2025-04-28 Werner Lemberg <wl@gnu.org> 1966 1967 [autofit] Avoid recomputation of highest and lowest contour. 1968 1969 * src/autofit/aflatin.c (af_latin_hints_apply): Compute highest and lowest 1970 contour in this function. 1971 (af_latin_remove_top_tilde_points_from_edges, 1972 af_latin_remove_bottom_tilde_points_from_edges, 1973 af_latin_stretch_top_tilde, af_latin_stretch_bottom_tilde, 1974 af_latin_align_top_tilde, af_latin_align_bottom_tilde): Updated. 1975 1976 2025-04-28 Werner Lemberg <wl@gnu.org> 1977 1978 * src/aflatin.c (af_latin_trace_height): Remove. 1979 Update caller. 1980 1981 The algorithm works fine. 1982 1983 2025-04-28 Werner Lemberg <wl@gnu.org> 1984 1985 [autofit] Support vertical stretching of tilde below base glyph. (2/2) 1986 1987 * src/autofit/afadjust.h (AF_ADJUST_TILDE_BOTTOM): New macro. 1988 * src/autofit/afadjust.c (af_reverse_character_map_new): Updated. 1989 1990 * src/autofit/aflatin.c (af_find_lowest_contour, 1991 af_latin_remove_bottom_tilde_points_from_edges, 1992 af_latin_stretch_bottom_tilde, af_latin_align_bottom_tilde): New functions 1993 in analogy to the top tilde versions. 1994 (af_glyph_hints_apply_vertical_separation_adjustments): Add support in 1995 analogy to the top tilde code. 1996 (af_latin_hints_apply): Updated. 1997 1998 2025-04-28 Werner Lemberg <wl@gnu.org> 1999 2000 [autofit] Support vertical stretching of tilde below base glyph. (1/2) 2001 2002 * src/autofit/aflatin.c (af_latin_remove_tilde_points_from_edges, 2003 af_latin_stretch_tilde, af_latin_align_tilde): Rename to... 2004 (af_latin_remove_top_tilde_points_from_edges, af_latin_stretch_top_tilde, 2005 af_latin_align_top_tilde): ...this. 2006 Update all callers. 2007 (af_latin_hints_apply): Rename `is_tilde` to `is_top_tilde`. 2008 2009 2025-04-28 Werner Lemberg <wl@gnu.org> 2010 2011 [autofit] Allow vertical adjustment at the top and bottom simultaneously. 2012 2013 This will be used to hint characters like U+1FB7 ('ᾷ'). 2014 2015 * src/autofit/aflatin.c 2016 (af_glyph_hints_apply_vertical_separation_adjustments): Implement it. 2017 2018 2025-04-28 Werner Lemberg <wl@gnu.org> 2019 2020 * src/autofit/afadjust.c (af_reverse_character_map_new): Update tracing. 2021 2022 2025-04-28 Werner Lemberg <wl@gnu.org> 2023 2024 [autofit] Indicate tilde handling with a flag macro, too. 2025 2026 * src/autofit/afadjust.h (AF_ADJUST_TILDE_TOP): New macro. 2027 (AF_AdjustmentDatabaseEntry): Remove field `apply_tilde`. 2028 2029 * src/autofit/afadjust.c (adjustment_database, 2030 af_reverse_character_map_new), src/autofit/aflatin.c 2031 (af_glyph_hints_apply_vertical_separation_adjustments, 2032 af_latin_hints_apply): Updated. 2033 2034 2025-04-28 Werner Lemberg <wl@gnu.org> 2035 2036 [aflatin] Convert adjustment database enum to macros. 2037 2038 We are going to add more values, and we want to use combinations of them. 2039 2040 * src/autofit/afadjust.h (AF_VerticalSeparationAdjustmentType): Replace 2041 with... 2042 (AF_ADJUST_UP, AF_ADJUST_DOWN, AF_ADJUST_NONE): ... new macros. 2043 (AF_AdjustmentDatabaseEntry): Rename field 2044 `vertical_separation_adjustment_type` to `flags`. 2045 2046 * src/autofit/afadjust.c (af_reverse_character_map_new), 2047 src/autofit/aflatin.c 2048 (af_glyph_hints_apply_vertical_separation_adjustments): Updated. 2049 2050 2025-04-28 Werner Lemberg <wl@gnu.org> 2051 2052 [autofit] Shorten adjustment enum names. 2053 2054 * src/autofit/afadjust.h (AF_VERTICAL_ADJUSTMENT_TOP_CONTOUR_UP, 2055 AF_VERTICAL_ADJUSTMENT_BOTTOM_CONTOUR_DOWN, AF_VERTICAL_ADJUSTMENT_NONE): 2056 Renamed to... 2057 (AF_ADJUST_UP, AF_ADJUST_DOWN, AF_ADJUST_NONE): ...this. 2058 2059 * src/autofit/afadjust.c (adjustment_database, 2060 af_reverse_character_map_expand), src/autofit/aflatin.c 2061 (af_glyph_hints_apply_vertical_separation_adjustments): Updated. 2062 2063 2025-04-26 Werner Lemberg <wl@gnu.org> 2064 2065 * src/autofit/afranges.c: Updated to Unicode 17.0. 2066 2067 But no support for new scripts (volunteers welcomed). 2068 2069 2025-04-26 Werner Lemberg <wl@gnu.org> 2070 2071 * src/autofit/afranges.c: Updated to Unicode 16.0. 2072 2073 But no support for new scripts (volunteers welcomed). 2074 2075 2025-04-26 Werner Lemberg <wl@gnu.org> 2076 2077 * src/autofit/afranges.c: Updated to Unicode 15.1. 2078 2079 But no support for new scripts (volunteers welcomed). 2080 2081 2025-04-26 Werner Lemberg <wl@gnu.org> 2082 2083 * src/autofit/afranges.c: Updated to Unicode 14.0. 2084 2085 But no support for new scripts (volunteers welcomed). 2086 2087 2025-04-26 Werner Lemberg <wl@gnu.org> 2088 2089 * src/autofit/afranges.c: Updated to Unicode 13.0. 2090 2091 But no support for new scripts (volunteers welcomed). 2092 2093 2025-04-26 Werner Lemberg <wl@gnu.org> 2094 2095 * src/autofit/afranges.c: Updated to Unicode 12.0. 2096 2097 But no support for new scripts (volunteers welcomed). 2098 2099 2025-04-25 Alexei Podtelezhnikov <apodtele@gmail.com> 2100 2101 * include/freetype/internal/ftcalc.h (FT_MulFix_64): Silence UBSAN. 2102 2103 2025-04-22 Behdad Esfahbod <behdad@behdad.org> 2104 2105 * src/autofit/afadjust.c (af_get_glyph_alternates): Fix endless loop. 2106 2107 2025-04-20 Werner Lemberg <wl@gnu.org> 2108 2109 * src/afadjust.c: Fix test for newer HarfBuzz version (second try). 2110 2111 2025-04-20 Werner Lemberg <wl@gnu.org> 2112 2113 * src/afadjust.c: Fix test for newer HarfBuzz version. 2114 2115 2025-04-20 Werner Lemberg <wl@gnu.org> 2116 2117 [autofit] Request at least HarfBuzz 7.2.0 for diacritic support. (3/3) 2118 2119 This version (from April 2023) added 'SingleSubst' support to 2120 `hb_ot_layout_lookup_get_glyph_alternates`. 2121 2122 2025-04-20 Werner Lemberg <wl@gnu.org> 2123 2124 [autofit] Speed up creation of the adjustment database's reverse map. (2/3) 2125 2126 Remove the old code and activate the new one. 2127 2128 2025-04-20 Werner Lemberg <wl@gnu.org> 2129 2130 [autofit] Speed up creation of the adjustment database's reverse map. (1/3) 2131 2132 As it turns out, the original implementation using 2133 `hb_ot_shape_glyphs_closure` is extremely slow if a font has a rich set of 2134 OpenType features. For example, this function was called 66954 times while 2135 loading font `arial.ttf` version 7.00, increasing FreeType's startup time by 2136 a factor of 10, which is unacceptable. 2137 2138 The new algorithm uses a completely different, more low-level approach, no 2139 longer working with OpenType features but with OpenType lookups. It relies 2140 on function `hb_ot_layout_lookup_get_glyph_alternates`, also replacing 2141 recursion with a simple loop. In total, this brings the additional startup 2142 time back to an acceptable range of a few percent. 2143 2144 A side effect of the new approach is that it catches more alternate forms: 2145 the old code didn't properly handle script-specific features. 2146 2147 To make the change more readable, this commit only adds new code. 2148 2149 2025-04-18 Werner Lemberg <wl@gnu.org> 2150 2151 * src/autofit/afadjust.c (af_reverse_character_map_new): Check `map` limit. 2152 2153 Reported as 2154 2155 https://issues.chromium.org/issues/410925355 2156 2157 2025-04-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2158 2159 * include/freetype/internal/ftcalc.h: Fix fringe compilation. 2160 2161 2025-04-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2162 2163 * src/base/ftcalc.c (ft_corner_orientation) [!FT_INT32]: Fix up. 2164 2165 2025-04-17 Werner Lemberg <wl@gnu.org> 2166 2167 [autofit] Don't access uninitialized memory. 2168 2169 Reported as 2170 2171 https://bugs.ghostscript.com/show_bug.cgi?id=708295 2172 2173 * src/autofit/aflatin.c 2174 (af_glyph_hints_apply_vertical_separation_adjustments): Initialize all 2175 array elements of `contour_y_minima` and `contour_y_maxima`. 2176 2177 2025-04-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2178 2179 * src/truetype/ttinterp.c (TT_MulFix14,TT_DotFix14)[!FT_INT64]: Sync. 2180 2181 2025-04-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2182 2183 * src/truetype/ttinterp.c (TT_DotFix14): Silence UBSAN. 2184 2185 2025-04-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2186 2187 * src/base/ftcalc.c: Miscellaneous cleanups. 2188 2189 2025-04-16 Werner Lemberg <wl@gnu.org> 2190 2191 [autofit] Avoid crash. 2192 2193 Reported as 2194 2195 https://issues.oss-fuzz.com/issues/410811029 2196 2197 * src/autofit/aflatin.c (af_remove_segments_containing_point): Check 2198 `edge->last`. 2199 2200 2025-04-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2201 2202 [base, truetype] Silence UBSAN (cont'd). 2203 2204 * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Use MUL_INT64. 2205 * include/freetype/internal/ftcalc.c (FT_MulFix): Ditto. 2206 2207 2025-04-15 Werner Lemberg <wl@gnu.org> 2208 2209 [autofit] Avoid unnecessary recomputation of HarfBuzz data. 2210 2211 Call the functions once per font instead of once per glyph. 2212 2213 * src/autofit/afadjust.c (af_all_glyph_variants): Move code to compute the 2214 `feature_tags` and `type_3_lookup_indices` sets to... 2215 (af_reverse_character_map_new): ...this function. 2216 2217 2025-04-15 Werner Lemberg <wl@gnu.org> 2218 2219 [autofit] Fix creation of the adjustment database's reverse map. 2220 2221 Due to the way the reverse map array gets constructed with HarfBuzz, there 2222 might be multiple, identical glyph index entries with different character 2223 values in the array. As an example, an OpenType feature like 'unic' might 2224 map lowercase glyph 'ae' to uppercase glyph 'AE', in addition to the already 2225 present cmap entry for 'AE'. 2226 2227 In most cases, this incorrect mapping is harmless (but still wrong). 2228 However, there exist some lowercase/uppercase character pairs where the 2229 diacritic for the uppercase character is on the other vertical side of the 2230 base character as for the lowercase character. An example is U+0122 (LATIN 2231 CAPITAL LETTER G WITH CEDILLA) and U+0123 (LATIN SMALL LETTER G WITH 2232 CEDILLA): the former has the cedilla below, the latter above. A wrong 2233 mapping would thus shift the base glyph 'G' up by a pixel instead of 2234 shifting the cedilla down. 2235 2236 We fix this by always giving precedence to cmap entries. 2237 2238 * src/autofit/afadjust.c (af_reverse_character_map_entry_compare): Do a 2239 secondary sort on the character code. 2240 2241 (af_reverse_character_map_lookup): Adjust binary search to return the 2242 first occurrence of an entry (i.e., the one with the lowest array index). 2243 2244 (af_reverse_character_map_new)[FT_CONFIG_OPTION_USE_HARFBUZZ]: Implement 2245 cmap priority. 2246 2247 2025-04-15 Werner Lemberg <wl@gnu.org> 2248 2249 [autofit] Reduce adjustment database lookups. 2250 2251 This is also in preparation for a follow-up commit. 2252 2253 * src/autofit/afadjust.h (af_lookup_vertical_separation_type, 2254 af_lookup_tilde_correction_type): Replaced with... 2255 (af_adjustment_database_lookup, af_reverse_character_map_lookup): 2256 ... this. 2257 2258 * src/autofit/afadjust.c (af_adjustment_database_lookup, 2259 af_adjustment_database_lookup): Updated. 2260 (af_lookup_vertical_separation_type, af_lookup_tilde_correction_type): 2261 Removed. 2262 (af_reverse_character_map_new)[FT_DEBUG_LEVEL_TRACE]: Updated. 2263 2264 * src/autofit/aflatin.c 2265 (af_glyph_hints_apply_vertical_separation_adjustments, 2266 af_latin_hints_apply): Updated. 2267 2268 2025-04-15 Werner Lemberg <wl@gnu.org> 2269 2270 * src/afadjust.c (adjustment_database): Make it complete up to U+017F. 2271 2272 2025-04-15 Werner Lemberg <wl@gnu.org> 2273 2274 * src/autofit/afadjust.c (af_reverse_character_map_new): Add tracing code. 2275 2276 2025-04-15 Werner Lemberg <wl@gnu.org> 2277 2278 * src/afadjust.c: Minor fixes. 2279 2280 2025-04-15 Werner Lemberg <wl@gnu.org> 2281 2282 [autofit] Better vertical separation adjustment support. (2/2) 2283 2284 * src/autofit/aflatin.c 2285 (af_glyph_hints_apply_vertical_separation_adjustments): Handle diacritics 2286 with more than a single contour. 2287 2288 2025-04-15 Werner Lemberg <wl@gnu.org> 2289 2290 [autofit] Better vertical separation adjustment support. (1/2) 2291 2292 Test vertical maxima instead of vertical minima to identify the highest 2293 contour (and vice versa to identify the lowest contour). Doing so will 2294 allow support of diacritics that consist of more than a single outline. 2295 2296 This works because of the topological constraints ensured by the adjustment 2297 database. 2298 2299 * src/autofit/aflatin.c (af_find_highest_contour, 2300 af_glyph_hints_apply_vertical_separation_adjustments): Implement it. 2301 2302 2025-04-15 Werner Lemberg <wl@gnu.org> 2303 2304 [autofit] Use new y extrema arrays. 2305 2306 * src/autofit/aflatin.c 2307 (af_glyph_hints_apply_vertical_separation_adjustments): Implement it. 2308 2309 2025-04-15 Werner Lemberg <wl@gnu.org> 2310 2311 [autofit] Provide infrastructure for storing y extrema of contours. 2312 2313 We need this for better positioning support of diacritics. 2314 2315 * src/autofit/afhints.h (AF_GlyphHintsRec): New fields `contour_y_minima` 2316 and `contour_y_maxima`, together with its embedded variants. 2317 2318 * src/autofit/afhints.c (af_glyph_hints_done, af_glyph_hints_reload): Handle 2319 new arrays. 2320 2321 2025-04-15 Werner Lemberg <wl@gnu.org> 2322 2323 [autofit] Avoid crash. 2324 2325 Reported as 2326 2327 https://issues.oss-fuzz.com/issues/410609442 2328 2329 * src/autofit/aflatin.c (af_remove_segments_containing_point): Check `edge`. 2330 2331 2025-04-14 Werner Lemberg <wl@gnu.org> 2332 2333 [autofit] Fix just introduced heap buffer overflow 2334 2335 Reported as 2336 2337 https://issues.oss-fuzz.com/issues/410393975 2338 2339 * src/autofit/afadjust.c [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Synchronize with 2340 HarfBuzz code. 2341 2342 2025-04-14 Werner Lemberg <wl@gnu.org> 2343 2344 * docs/CHANGES: Mention Craig's GSoC 2023 project. 2345 2346 2025-04-14 Craig White <gerzytet@gmail.com> 2347 2348 [autofit] Add GSUB table handling to reverse character map generation. 2349 2350 If HarfBuzz is enabled, the reverse character map generation now considers 2351 GSUB entries when looking for glyphs that correspond to a code point. 2352 2353 * src/autofit/afadjust.c (af_all_glyph_variants_helper, 2354 af_all_glyph_variants) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New functions. 2355 2356 (af_reverse_character_map_new) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Call new 2357 code. 2358 2359 2025-04-14 Craig White <gerzytet@gmail.com> 2360 2361 [autofit] Add tilde-unflattening algorithm. 2362 2363 * src/autofit/aflatin.c (af_find_highest_contour, 2364 af_remove_segments_containing_point, 2365 af_latin_remove_tilde_points_from_edges, af_latin_stretch_tilde, 2366 af_latin_align_tilde): New functions. 2367 (af_latin_hints_apply): Call tilde-unflatting code if necessary. 2368 2369 2025-04-14 Craig White <gerzytet@gmail.com> 2370 2371 [autofit] Implement vertical separation adjustment. 2372 2373 * src/autofit/aflatin.c: Include `afadjust.h`. 2374 (af_latin_metrics_init): Call `af_reverse_character_map_new`. 2375 (af_latin_metrics_done): New function. 2376 2377 (af_move_contour_vertically, af_check_contour_horizontal_overlap, 2378 af_glyph_hints_apply_vertical_separation_adjustments): New functions. 2379 2380 (af_latin_hints_apply): Call 2381 `af_glyph_hints_apply_vertical_separation_adjustments`. 2382 2383 (af_latin_writing_system_class): Updated. 2384 2385 * src/autofit/aftypes.h (AF_StyleMetricsRec): Add `reverse_charmap` field. 2386 2387 2025-04-14 Craig White <gerzytet@gmail.com> 2388 2389 [autofit] Add code for reverse charmaps and adjustment database lookup. 2390 2391 * src/autofit/aftypes.h (AF_ReverseMapEntry, AF_ReverseCharacterMap): New 2392 structures. 2393 2394 * src/autofit/afadjust.c (af_adjustment_database_lookup, 2395 af_reverse_character_map_entry_compare, af_reverse_character_map_lookup, 2396 af_lookup_vertical_separation_type, af_lookup_tilde_correction_type, 2397 af_reverse_character_map_expand, af_reverse_character_map_new, 2398 af_reverse_character_map_done): New functions. 2399 2400 * src/autofit/afadjust.c: Updated. 2401 2402 2025-04-14 Craig White <gerzytet@gmail.com> 2403 2404 [autofit] Add adjustment database. 2405 2406 * src/autofit/afadjust.c, src/autofit/afadjust.h: New files. 2407 2408 * include/freetype/internal/fttrace.h: Add 'afadjust' component. 2409 2410 * src/autofit/autofit.c: Include `afadjust.c`. 2411 2412 * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afadjust.c`. 2413 2414 2025-04-14 Craig White <gerzytet@gmail.com> 2415 2416 [base] Make `find_unicode_charmap` a base function. 2417 2418 This is needed for forthcoming changes in the auto-hinter. 2419 2420 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: Updated. 2421 2422 2025-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2423 2424 * src/bdf/bdflib.c (hdigits): Removed. 2425 2426 Fixes #1325. 2427 2428 2025-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2429 2430 * include/freetype/internal/ftcalc.h (FT_MSB) [__CC_ARM]: Added. 2431 2432 2025-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2433 2434 Typos in macros. 2435 2436 * include/freetype/internal/ftcalc.h: s/_M_X86/_M_IX86/. 2437 * src/truetype/ttinterp.c: s/_M_X86/_M_IX86/. 2438 2439 2025-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2440 2441 * docs/CHANGES: Updated. 2442 2443 2025-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2444 2445 [base, truetype] Silence UBSAN. 2446 2447 * src/truetype/ttinterp.c (TT_MulFix14_64): Use unsigned multiplication. 2448 * include/freetype/internal/ftcalc.h (FT_MulFix_64): Ditto. 2449 2450 2025-04-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2451 2452 [base, truetype] Synchronize MulFix assembly. 2453 2454 * include/freetype/internal/ftcalc.h (FT_MulFix_*), 2455 src/truetype/ttinterp.c (TT_MulFix14_*): Synchronize routines. 2456 2457 2025-04-10 Alexei Podtelezhnikov <apodtele@gmail.com> 2458 2459 [truetype] Modernize bytecode projections. 2460 2461 With 64-bit platforms widely available, it is more efficient to use 2462 64-bit variables readily. It results in noticeable 10% improvement 2463 in glyph loading speed. 2464 2465 * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14) [FT_INT64]: 2466 Prioritize available implementation with arguments adjusted based on 2467 the use cases. 2468 2469 2025-04-09 Alexei Podtelezhnikov <apodtele@gmail.com> 2470 2471 [base] Update FT_MulFix inlining. 2472 2473 Resolves inconsistencies in 64-bit multiplication discussed in !355. 2474 Importantly, FT_MulFix arguments and return value is FT_Long, 2475 whatever sizeof FT_Long is on 64-bit platforms: 8 bytes on Linux or 2476 4 bytes on Windows. 2477 2478 * include/freetype/internal/ftcalc.h (FT_MulFix_x86_64): Removed. 2479 (FT_MulFix_64): Generalize and prioritize the inline implementation 2480 for all 64-bit platforms ifdef FT_INT64. 2481 * src/base/ftcalc.c (FT_MulFix)[FT_INT64]: Call 'FT_MulFix_64'. 2482 * src/base/ftbase.c: Include 'ftcalc.c' after the FT_MulFix callers 2483 to enable its inlining. 2484 2485 2025-04-09 Alexei Podtelezhnikov <apodtele@gmail.com> 2486 2487 [base] Update FT_MulFix inlining. 2488 Resolves inconsistencies in 64-bit multiplication discussed in !355. Importantly, FT_MulFix arguments and return value is FT_Long, whatever sizeof FT_Long is on 64-bit platforms: 8 bytes on Linux or 4 bytes on Windows. * include/freetype/internal/ftcalc.h (FT_MulFix_x86_64): Removed. (FT_MulFix_64): Generalize and prioritize the inline implementation 2489 for all 64-bit platforms ifdef FT_INT64. * src/base/ftcalc.c (FT_MulFix)[FT_INT64]: Call 'FT_MulFix_64'. * src/base/ftbase.c: Include 'ftcalc.c' after the FT_MulFix callers to enable its inlining. 2490 2491 2025-04-05 Graham Asher <graham.asher@cartotype.com> 2492 2493 Missing header wrappers. 2494 2495 * include/freetype/config/integer-types.h, src/smooth/ftgrays.h: 2496 Add missing FT_BEGIN_HEADER and FT_END_HEADER. 2497 * src/smooth/ftgrays.c: Cosmetics. 2498 2499 2025-03-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2500 2501 [bdf] Clarify callback flow. 2502 2503 * src/bdf/bdflib.c (bdf_line_func_t_): Modify callback prototype. 2504 (bdf_parse_*_): Updated. 2505 (bdf_load_font, bdf_readstream_): Delay callback initiation. 2506 2507 2025-03-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2508 2509 * src/bdf/bdflib.c (bdf_readstream_): Relocate. 2510 2511 2025-03-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2512 2513 * src/bdf/bdflib.c (bdf_is_atom_): Do not check tabs. 2514 2515 2025-03-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2516 2517 * src/bdf/bdflib.c (_bdf_strncmp): Macro removed, callers updated. 2518 2519 2025-02-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2520 2521 .gitlab-ci.yml: Minor. 2522 2523 2025-02-26 Tim-Philipp Müller <tim@centricular.com> 2524 2525 * .gitlab-ci.yml: Switch to arm64 runners for macOS CI. 2526 2527 2025-02-25 Behdad Esfahbod <behdad@behdad.org> 2528 2529 [sfnt/CPAL] Return early if user requested currently-set palette 2530 2531 Before, we were loading a palette (again and again) even if the 2532 same was requested. Even if the font only had one palette... 2533 2534 For a font like NotoColorEmoji that has over 5000 colors in its 2535 palette, this was dominating the COLRv1 loading times for HarfBuzz 2536 (and I believe all other clients) because they have to set the 2537 palette to get access to the colors. 2538 2539 * src/base/ftcolor.c (FT_Palette_Select): Check the current palette. 2540 2541 2025-01-29 Alexei Podtelezhnikov <apodtele@gmail.com> 2542 2543 * src/bdf/bdflib.c (bdf_parse_start_): Move setup of properties. 2544 2545 2025-01-25 Alexei Podtelezhnikov <apodtele@gmail.com> 2546 2547 [bdf] Treat all comments uniformly. 2548 2549 * src/bdf/bdflib.c (bdf_parse_start_): Reject fonts with initial 2550 COMMENTs. 2551 (bdf_parse_properties_): Skip COMMENTs so that... 2552 (bdf_add_property_): Do not make exception for COMMENT. 2553 (bdf_parse_glyphs_, bdf_add_comments): Updated. 2554 2555 2025-01-25 Alexei Podtelezhnikov <apodtele@gmail.com> 2556 2557 * src/bdf/bdflib.c (BDF_SWIDTH_ADJ_): Remove clashing flag and update. 2558 2559 2025-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2560 2561 * src/bdf/bdflib.c (bdf_atous_): Remove unnecessary checks. 2562 2563 2025-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2564 2565 * src/bdf/bdflib.c (bdf_ato{i.ul.s.us}_]): Remove uncecessary checks. 2566 2567 2025-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2568 2569 [bdf] Postpone font default char handling. 2570 2571 * src/bdf/bdflib.c (bdf_parse_start_, bdf_add_property_): Delay handling 2572 of the default char until... 2573 * src/bdf/bdfdrivr.c (BDF_Face_Init): ... handles all other properties. 2574 2575 2025-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2576 2577 [bdf] Postpone font spacing handling. 2578 2579 * src/bdf/bdf.h (bdf_font_t): Remove `monowidth`. 2580 * src/bdf/bdflib.c (bdf_parse_start_, bdf_add_property_): Delay handling 2581 of the font spacing until... 2582 * src/bdf/bdfdrivr.c (BDF_Face_Init): ... handles all other properties. 2583 2584 2025-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2585 2586 [bdf] Postpone font ascent and descent handling. 2587 2588 * src/bdf/bdflib.c (bdf_parse_start_, bdf_add_property_): Delay handling 2589 of the font ascent and descent until... 2590 * src/bdf/bdfdrivr.c (BDF_Face_Init): ... handles all other properties. 2591 2592 2025-01-22 Alexei Podtelezhnikov <apodtele@gmail.com> 2593 2594 * src/bdf/bdflib.c (bdf_parse_start_): Relax the header order. 2595 2596 We now check that the header is complete in no specific order. 2597 2598 2025-01-20 Chad Brokaw <cbrokaw@gmail.com> 2599 2600 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Fix all shared values. 2601 2602 Applying cvar deltas to all shared points was incorrectly omitted. 2603 Fixes #1314. 2604 2605 2025-01-19 Alexei Podtelezhnikov <apodtele@gmail.com> 2606 2607 * src/bdf/bdflib.c (bdf_parse_glyphs_): Fix tracing. 2608 2609 2025-01-19 Alexei Podtelezhnikov <apodtele@gmail.com> 2610 2611 [bdf] Tokenize input instead of listing. 2612 2613 Instead of cumbersome field list mamangement, we will tokenize input 2614 using custom `bdf_strtok_`. 2615 2616 * src/bdf/bdflib.c (bdf_list_t_, bdf_list_init_, bdf_list_ensure_, 2617 bdf_list_shift_, bdf_list_join_, bdf_list_split_, 2618 bdf_set_default_spacing_): Removed. 2619 (bdf_strtok_): New function which NUL-terminates the first token at 2620 the delimiter position and returns the next token that follows 2621 consequtive delimiters. 2622 (bdf_parse_*_, bdf_load_font): Updated. 2623 2624 * docs/CHANGES: Claim overall 75% performance improvement. 2625 2626 2025-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2627 2628 * src/bdf/bdflib.c (bdf_parse_start_): Prevent another STARTPROPERTIES. 2629 2630 Only one STARTPROPERTIES was permitted in the old flow preventing 2631 leaks and overflows. 2632 2633 See https://issues.oss-fuzz.com/issues/389968131 2634 https://issues.oss-fuzz.com/issues/390464875 2635 2636 2025-01-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2637 2638 * src/bdf/bdflib.c (bdf_parse_start_): Do not overwrite flags. 2639 2640 2025-01-16 Alexei Podtelezhnikov <apodtele@gmail.com> 2641 2642 * src/bdf/bdflib.c (bdf_readstream_): Skip all control characters. 2643 2644 This agrees with specifications and makes the code a lot simpler. 2645 2646 2025-01-16 Alexei Podtelezhnikov <apodtele@gmail.com> 2647 2648 * src/bdf/bdflib.c (bdf_parse_start_): Reserve space for artificial properties. 2649 2650 2025-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2651 2652 * src/bdf/bdflib.c (bdf_add_property_): Add extra protection. 2653 2654 See https://issues.oss-fuzz.com/issues/389972472 2655 https://issues.oss-fuzz.com/issues/389968131 2656 2657 2025-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2658 2659 * src/bdf/bdflib.c: Clean up. 2660 2661 2025-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2662 2663 [bdf] Use flags instead of options. 2664 2665 * src/bdf/bdf.h (bdf_options_t): Removed. 2666 (BDF_KEEP_COMMENTS, BDF_KEEP_UNENCODED, BDF_CORRECT_METRICS): Updated 2667 to avoid collisions with the other parsing flags. 2668 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use default flags explicitly. 2669 * src/bdf/bdflib.c (bdf_load_font): Use flags as an argument to 2670 initialize the parser. 2671 (bdf_set_fedault_spacing_): Default to BDF_PROPORTIONAL explicitly. 2672 (bdf_parse_*_): Updated. 2673 2674 2025-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2675 2676 [bdf] Adjust parsing flow and CHARS handling. 2677 2678 * src/bdf/bdflib.c (bdf_readstream_): Remove CHARS exception. 2679 (bdf_parse_glyphs_): Move glyphs allocation... 2680 (bdf_parse_properties_): and missing ascent and descent handling... 2681 (bdf_parse_start_): ...to here under CHARS. 2682 2683 2025-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2684 2685 * src/bdf/bdflib.c (bdf_readstream_): Tweak variables and loop design. 2686 2687 2025-01-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2688 2689 * src/bdf/bdflib.c (bdf_parse_glyphs_): Free unused glyph_name. 2690 2691 See https://issues.oss-fuzz.com/issues/389330334. 2692 2693 2025-01-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2694 2695 * src/bdf/bdflib.c (bdf_parse_glyphs_): Store glyph as soon as possible. 2696 2697 2025-01-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2698 2699 * src/bdf/bdflib.c (bdf_parse_glyphs_): Avoid possible leak. 2700 2701 2025-01-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2702 2703 [bdf] Speed up bitmap parsing. 2704 2705 A dedicated parser of bitmap data with minimal error checking and 2706 no string comparisons helps to improve performance. 2707 2708 * src/bdf/bdflib.c (bdf_parse_bitmap_): New dedicated bitmap parser. 2709 (bdf_parse_glyphs_): Pass to `bdf_parse_bitmap_` on BITMAP. 2710 2711 2025-01-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2712 2713 * src/bdf/bdflib.c (a2i): Formatting. 2714 2715 2025-01-11 Alexei Podtelezhnikov <apodtele@gmail.com> 2716 2717 * src/bdf/bdflib.c (bdf_parse_*_): Minor improvements. 2718 2719 2025-01-11 Alexei Podtelezhnikov <apodtele@gmail.com> 2720 2721 * src/bdf/bdf.h (bdf_font_t): Correct `internal` type. 2722 * src/bdf/bdflib.c (*): Update users. 2723 2724 2025-01-10 Alexei Podtelezhnikov <apodtele@gmail.com> 2725 2726 * builds/windows/ftsystem.c: Fix ancient condition. 2727 2728 2025-01-10 Alexei Podtelezhnikov <apodtele@gmail.com> 2729 2730 * src/bdf/bdflib.c (bdf_parse_start_): Fix tracing labels. 2731 2732 2025-01-09 Alexei Podtelezhnikov <apodtele@gmail.com> 2733 2734 * MSBuild.rsp: Force console color for mintty. 2735 2736 2025-01-09 Heiko Lewin <hlewin@worldiety.de> 2737 2738 * CMakeLists.txt: Use modern IMPORTED targets. 2739 2740 This resolves build problems with newer libPNG versions by switching 2741 to using IMPORTED CMake targets for common libraries where provided. 2742 To do this the required CMake version is raised to version 3.12. 2743 Doing this seems justified as using IMPORTED targets is a cleaner 2744 and more powerful solution that can leverage advanced and CMake-specific 2745 features that may be utilized by the referred dependencies' CMake modules. 2746 2747 Resolves #1311. 2748 2749 2025-01-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2750 2751 [cff] Remove size/slot checks. 2752 2753 After the previous commit, cff_glyph_load is no longer called 2754 without first checking for valid size and glyph objects in 2755 FT_Glyph_Load and these checks can be removed downstream. 2756 2757 * src/cff/cffdrivr.c (cff_glyph_load): Remove `size` and `glyph` checks. 2758 * src/cff/cffgload.c (cff_slot_load): Ditto. 2759 2760 2025-01-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2761 2762 * src/cff/cffdrivr.c (cff_get_advances): Do only fast advances. 2763 2764 Otherwise, let TT_Get_Advances fall back on cff_load_glyph to do 2765 slow advances. This avoids unchecked access to cff_load_glyph and 2766 this is how tt_get_advances is implemented. 2767 2768 2025-01-04 Alexei Podtelezhnikov <apodtele@gmail.com> 2769 2770 * src/truetype/ttgload.c (TT_Load_Glyph): Consolidate flag setting. 2771 2772 2025-01-04 Alexei Podtelezhnikov <apodtele@gmail.com> 2773 2774 Delay FT_GLYPH_FORMAT_OUTLINE assignmets. 2775 2776 This assignmets used to be done prematurely before errors were checked 2777 and outlines were actually loaded. Delaying the assignment provides 2778 certain protection against careless usage of malformed input that 2779 should now remain FT_GLYPH_FORMAT_NONE. 2780 2781 * src/cff/cffgload.c (cff_slot_load): Ditto. 2782 * src/cid/cidgload.c (cid_slot_load_glyph): Ditto. 2783 * src/pfr/pfrobjs.c (pfr_slot_load): Ditto. 2784 * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. 2785 * src/type1/t1gload.c (T1_Load_Glyph): Ditto. 2786 2787 2025-01-03 Alexei Podtelezhnikov <apodtele@gmail.com> 2788 2789 * builds/compiler/gcc-dev.mk: Silence some warnings. 2790 2791 2025-01-02 Alexei Podtelezhnikov <apodtele@gmail.com> 2792 2793 Remove superfluous outline zeroing. 2794 2795 This is already done by `ft_glyphslot_clear`. 2796 2797 * src/cff/cffgload.c (cff_slot_load): Do not zero outline fields. 2798 * src/cid/cidgload.c (cid_slot_load_glyph: Ditto. 2799 * src/pfr/pfrobjs.c (pfr_slot_load): Ditto. 2800 * src/truetype/ttgload.c (load_sbit_image): Ditto. 2801 * src/type1/t1gload.c (T1_Load_Glyph): Ditto. 2802 2803 2025-01-02 Alexei Podtelezhnikov <apodtele@gmail.com> 2804 2805 * src/truetype/ttobjs.c: Abbreviate tracing. 2806 2807 2025-01-02 Alexei Podtelezhnikov <apodtele@gmail.com> 2808 2809 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Refactor `flip`. 2810 2811 2025-01-01 Alexei Podtelezhnikov <apodtele@gmail.com> 2812 2813 [truetype] Consolidate bitmap strike handling. 2814 2815 * src/truetype/ttgload.c (TT_Load_Glyph): Relocate omitted whitespace 2816 strike handling from here... 2817 (load_sbit_image): ... to here. 2818 2819 2024-12-31 Alexei Podtelezhnikov <apodtele@gmail.com> 2820 2821 [truetype] Ingnore FT_LOAD_NO_BITMAP in bitmap-only fonts. 2822 2823 For consistency with other bitmap-only fonts, we should ignore this 2824 flag of the font is not scalable. 2825 2826 * src/truetype/ttgload.c (TT_Load_Glyph): Check if face is scalable 2827 when checking for FT_LOAD_NO_BITMAP. 2828 2829 * docs/CHANGES: Start new chapter wtith this change. 2830 2831 2024-12-16 Ben Wagner <bungeman@chromium.org> 2832 2833 [ftstroke] Fix invalid pointer assignement to `arc` 2834 2835 In `FT_Stroker_ConicTo` and `FT_Stroker_CubicTo` there is a `bez_stack`. 2836 `arc` is initialized with `arc = bez_stack` and is never set to point 2837 into any different object. The main loop looks like `while ( arc >= 2838 bez_stack )` which is depending on a later `arc -= 2` (or `arc -= 3`) to 2839 make `arc` point to before `bez_stack`. However, using pointer 2840 subtraction to make `arc` point outside the array is undefined behavior, 2841 and attempting to use the value in the loop predicate is "very" 2842 undefined behavior. (C99 "Additive operators" 6.5.6.8.) 2843 2844 This particular undefined behavior was discovered as either hangs or 2845 MemorySantizer issues after "[InstCombine] Infer nuw for gep inbounds 2846 from base of object" [0]. With this change, clang can infer that `arc` 2847 must always point into the `bez_stack` object and therefore cannot be at 2848 a "negative index" so the predicate is always true. 2849 2850 [0] https://github.com/llvm/llvm-project/commit/e21ab4d16b555c28ded307571d138f594f33e325 2851 2852 * src/base/ftstroke.c (FT_Stroker_ConicTo, FT_Stroker_CubicTo): test 2853 loop exit condition (there are no more arcs to process) before 2854 decrementing `arc` 2855 2856 Fixes: #1307 2857 2858 2024-12-04 Ben Wagner <bungeman@chromium.org> 2859 2860 [cff] Fix leak of cmap data 2861 2862 When `sfnt->load_face` succeeds it has already loaded any (optional) 2863 cmap data. As a result, a subsequent call to `sfnt->load_cmap` will 2864 overwrite the cmap data pointer with a new copy of the data but not free 2865 the old, leading to a leak. 2866 2867 This is a fix for "* src/cff/cffobjs.c (cff_face_init): Better handling 2868 of Type0 fonts.". This still allows the cmap to be missing but avoids 2869 the leak by only calling `sfnt->load_cmap` when there is no `head` 2870 table (the font data is not being loaded as OpenType/CFF). 2871 2872 * src/cff/cffobjs.c (cff_face_init): Fix leak 2873 2874 Fixes: #1306 2875 2876 2024-11-06 Honnesh Ramachandra <hramachandra@adobe.com> 2877 2878 * src/cff/cffobjs.c (cff_face_init): Better handling of Type0 fonts. 2879 2880 This issue relates to the PDF specification and its usage of CFF-based 2881 embedded Type0 fonts. For Type0 fonts containing CID-keyed descendant 2882 CFF-based fonts, the glyph index is the CID present in the content stream. 2883 As a result, there is no requirement for a 'cmap' table to be present in the 2884 font since the glyph indices are derived directly from the CIDs. FreeType 2885 throws an error when it doesn’t find a 'cmap' table for such an Open Type 2886 font containing CFF outlines. This commit relaxes this requirement for a 2887 'cmap' table for such fonts. 2888 2889 2024-10-18 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2890 2891 Download the latest gnu-config files in `make dist`. 2892 2893 * builds/toplevel.mk: In `make dist`, checkout gnu-config 2894 git repository at savannah, copy the latest versions of 2895 `config.guess` and `config.sub` to builds/unix/. Also 2896 the latest version of `gitlog-to-changelog` is used to 2897 generate `ChangeLog`. 2898 2899 2024-10-16 Behdad Esfahbod <behdad@behdad.org> 2900 2901 Move generic destroy to later in the face and size destruction. 2902 2903 * src/base/ftobjs.c (destroy_size, destroy_face): This is such that the 2904 generic destroy can be used to call `FT_Done_Library`. For that to work, 2905 it needs to call it *after* having removed the face from the respective 2906 module. 2907 2908 2024-10-14 Alexei Podtelezhnikov <apodtele@gmail.com> 2909 2910 * src/truetype/ttgload.c (load_truetype_glyph): Rearrange. 2911 2912 2024-10-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2913 2914 * autogen.sh: Fix for Solaris 10. 2915 2916 o Replace `test -e` by `test -d` (directory) and `-h` 2917 (symlink), because pre-POSIX /bin/sh of Solaris 10 2918 does not support `test -e`. 2919 o Replace the combination of `head` and `sed ...` by 2920 single sed command `sed -n 1...p`. GNU libtoolize 2921 with Solaris 10 /bin/sh complains "Broken Pipe" for 2922 the closure of stdout by `head`. Let `sed` receive 2923 all stdout and discard. 2924 2925 2024-10-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2926 2927 * src/smooth/ftgrays.c (gray_convert_glyph): Clear stack pointers. 2928 2929 Fixes a dangling pointer warning, see #1299. 2930 2931 2024-10-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2932 2933 apinames: Fix a buffer overrun for VMS platform. 2934 2935 Some output formats may rewrite symbol names during the output, 2936 like the concatenation of "64__" suffix on VMS. To estimate 2937 sufficient size to store symbol name, pass the output format 2938 info to `names_add`. For VMS, `names_add` allocates longer 2939 buffer to append "64__". 2940 2941 * apinames.c (SUFFIX_VMS_64ADDR): New macro of "64__". 2942 (main): Pass the format info to `read_header_file`. 2943 (read_header_file): Pass the format info to `names_add`. 2944 (names_add): Receive the format info, and reserve the symbol 2945 name buffer 4 byte longer in the case of VMS, to append the 2946 suffix in `names_dump`. 2947 2948 2024-10-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2949 2950 apinames: Fix out-of-scope reference of a static array. 2951 2952 * apinames.c (names_dump): For WATCOM_LBC format, the 2953 DLL name with no suffix is constructed on a static 2954 array temp[], but the scope is closed before use it. 2955 The declaration of temp[] is moved to the wider 2956 scope for the dumping part to refer it. 2957 2958 2024-10-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2959 2960 * vms_make.com: Format rules. 2961 2962 Use tabs in rules only à la Makefile. 2963 2964 2024-10-12 Marian Klymov <nekto1989@gmail.com> 2965 2966 * meson.build: Define DLL_EXPORT for shared library only. 2967 2968 Fixes #1298. 2969 2970 2024-10-12 Benoit Pierre <benoit.pierre+freedesktop@gmail.com> 2971 2972 * meson.build: Minor improvements. 2973 2974 2024-10-12 Benoit Pierre <benoit.pierre+freedesktop@gmail.com> 2975 2976 * meson.build: Fix `bzip2` option handling. 2977 2978 2024-10-12 Benoit Pierre <benoit.pierre+freedesktop@gmail.com> 2979 2980 * meson.build: Add support for compiling with error strings. 2981 * meson_options.txt: Document it. 2982 2983 2024-10-10 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2984 2985 Fix help message of apinames. 2986 2987 * src/tools/apinames.c: The first header file must be 2988 given after the options. All arguments after the 2989 first header file are dealt as header files to be 2990 parsed, regardless with their leading "-". 2991 2992 For example, 2993 "apinames include/freetype/freetype.h -dFREETYPE.DLL" 2994 warns "unable to open -dFREETYPE.DLL". 2995 2996 Thus, the "header1" must be given after the arguments 2997 to be parsed as the options. 2998 2999 2024-09-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 3000 3001 Minor fixes for OpenVMS. 3002 3003 * vms_name.com: Suppress a warning with the latest Clang compiler. 3004 3005 * builds/vms/apinames_vms.bash: Use absolute path to avoid dependency on the 3006 environment. 3007 3008 2024-09-07 Alexei Podtelezhnikov <apodtele@gmail.com> 3009 3010 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Respect metrics_only. 3011 3012 Also fixes recursive flip. 3013 3014 2024-09-06 Alexei Podtelezhnikov <apodtele@gmail.com> 3015 3016 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Tweak loop. 3017 3018 2024-09-06 Andrew Murray <radarhere@users.noreply.github.com> 3019 3020 [sfnt] Support sbix graphicType 'flip'. 3021 3022 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Currently undocumented by 3023 Apple, this flips the bitmap data horizontally. It is used on macOS in 3024 Apple Color Emoji; 19.4d6e1; 2024-02-05 (file `Apple Color Emoji.ttc`). 3025 3026 Fixes issue #1282. 3027 3028 2024-09-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 3029 3030 Add `clang` to host compiler candidates in cross building. 3031 3032 * builds/unix/configure.raw: In cross building, 3033 `clang` is tried if there is no `gcc`, nor `cc`. 3034 3035 2024-09-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 3036 3037 Improve the build rule for `apinames`. 3038 3039 * builds/unix/configure.raw: copy `CFLAGS` & 3040 `LDFLAGS` values to `CFLAGS_BUILD` & 3041 `LDFLAGS_BUILD`, in a self-hosting case. 3042 3043 * builds/unix/unix-cc.in: set `CCexe_CFLAGS` & 3044 `CCexe_LDFLAGS` by `CFLAGS_BUILD` & 3045 `LDFLAGS_BUILD`. 3046 3047 In some confused environments, simple building 3048 like `cc -o apinames apinames.c` is no longer 3049 able to build an executable running on the host. 3050 3051 The validity of `CC` is tested with consideration 3052 of `CFLAGS` and `LDFLAGS`, thus, duplicating 3053 `CFLAGS` & `LDFLAGS` to `CCexe_CFLAGS` & 3054 `CCexe_LDFLAGS` (via XXX_BUILD) would be slightly 3055 safer in a self-hosting build. 3056 3057 Fixes the issue #1296. 3058 3059 2024-08-26 Alexei Podtelezhnikov <apodtele@gmail.com> 3060 3061 * src/sfnt/ttcmap.c (tt_cmap*_get_info): Remove casting. 3062 3063 2024-08-25 Alexei Podtelezhnikov <apodtele@gmail.com> 3064 3065 * include/freetype/ftimage.h (FT_Bitmap): Describe empty bitmap. 3066 3067 2024-08-14 luz paz <luzpaz@github.com> 3068 3069 Fix various typos. 3070 3071 2024-08-13 Alexei Podtelezhnikov <apodtele@gmail.com> 3072 3073 * messon.build: Install `include/freetype/ftlogging.h`. 3074 3075 Fixes #1292. 3076 3077 2024-08-12 Werner Lemberg <wl@gnu.org> 3078 3079 * Version 2.13.3 released. 3080 ========================== 3081 3082 Tag sources with `VER-2-13-3'. 3083 3084 * docs/VERSION.TXT: Add entry for version 2.13.3. 3085 * docs/CHANGES: Updated. 3086 * docs/release, docs/README, builds/macs/README: Updated. 3087 3088 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 3089 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 3090 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 3091 docs/freetype-config.1: s/2.13.2/2.13.3/, s/2132/2133/. 3092 3093 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. 3094 3095 * builds/unix/configure.raw (version_info): Set to 26:2:20. 3096 * CMakeLists.txt (VERSION_PATCH): Set to 3. 3097 3098 2024-08-12 Werner Lemberg <wl@gnu.org> 3099 3100 * meson.build: Install `freetype2.m4`. 3101 3102 Fixes #1290. 3103 3104 2024-08-12 Werner Lemberg <wl@gnu.org> 3105 3106 * src/*/*: Fix C++ compilation; fix clang warnings. 3107 3108 2024-08-12 Werner Lemberg <wl@gnu.org> 3109 3110 * subprojects/*.wrap: Updated. 3111 3112 2024-08-12 Werner Lemberg <wl@gnu.org> 3113 3114 Various minor documentation or formatting fixes. 3115 3116 2024-08-07 Werner Lemberg <wl@gnu.org> 3117 3118 tttables.h (FT_Get_CMap_Format): Minor documentation improvement. 3119 3120 2024-08-05 Alexei Podtelezhnikov <apodtele@gmail.com> 3121 3122 * src/truetype/ttgxvar.c (ft_var_readpacked*): Minor. 3123 3124 2024-08-05 Alexei Podtelezhnikov <apodtele@gmail.com> 3125 3126 * src/base/ftstream.c (FT_Stream_ReadFields): Switch to `FT_Offset`. 3127 3128 2024-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 3129 3130 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Unwrap arithmetic. 3131 3132 2024-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 3133 3134 * src/base/ftstream.c (FT_Stream_ReadFields): Update condition. 3135 3136 2024-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 3137 3138 [truetype/GX] Use more robust conditions. 3139 3140 * src/truetype/ttgxvar.c (ft_var_readpacked{points,deltas}): Rewrite 3141 conditions to avoid undefined behavior. 3142 3143 2024-07-31 Alexei Podtelezhnikov <apodtele@gmail.com> 3144 3145 [truetype/GX] Read points and deltas more carefully. 3146 3147 Hopefully fixes newly introduced buffer overflows: 3148 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70807 3149 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70809 3150 3151 * src/truetype/ttgxvar.c (ft_var_readpacked{points,deltas}): Explicitly 3152 check stream frame limits and modify run counting. 3153 3154 2024-07-30 Alexei Podtelezhnikov <apodtele@gmail.com> 3155 3156 [truetype/GX] Read stream more aggressively. 3157 3158 With ample checks against the table size, we should be able to use 3159 macros without the limit checks and functional calls. 3160 3161 * src/truetype/ttgxvar.c (ft_var_readpacked{points,deltas}): 3162 Use FT_NEXT_* instead of FT_GET_*. 3163 3164 2024-07-29 Alexei Podtelezhnikov <apodtele@gmail.com> 3165 3166 * src/sfnt/ttload.c (tt_face_load_name): Shorten dereference. 3167 3168 2024-07-29 Alexei Podtelezhnikov <apodtele@gmail.com> 3169 3170 * src/autofit/afmodule.c (af_autofitter_load_glyph): Shorten deref. 3171 3172 2024-07-29 Alexei Podtelezhnikov <apodtele@gmail.com> 3173 3174 [bdf,pcf,winfonts,sfnt] Remove barely used marcros. 3175 3176 * include/freetype/internal/ftobjs.h (FT_FACE_SIZE, FT_SIZE_FACE): 3177 Removed. 3178 * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Updated. 3179 * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto. 3180 * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto 3181 * src/sfnt/ttbdf.c (tt_face_find_bdf_prop): Ditto. 3182 3183 2024-07-27 Dan Rosser <danoli3@gmail.com> 3184 3185 * include/freetype/internal/ftcalc.h (FT_MSB)[_M_ARM64EC]: Added. 3186 3187 2024-07-19 Werner Lemberg <wl@gnu.org> 3188 3189 * src/truetype/ttobjs.c (tt_size_run_prep): Correct scaling of CVT values. 3190 3191 This reverts the scaling behaviour introduced in commit 37580053. 3192 3193 Fixes issue #1005. 3194 3195 2024-06-29 Philip Race <philip.race@oracle.com> 3196 3197 * psobjs.c (ps_table_add): Check length before calling `FT_MEM_CPY`. 3198 3199 Fixes issue #1280. 3200 3201 2024-06-29 Don Olmstead <don.j.olmstead@gmail.com> 3202 3203 CMakeLists.txt: Respect FT_DISABLE_ZLIB value 3204 3205 The CMake build uses `find_package` to look for dependencies. Before calling `find_package` it looks to see if the dependency was disabled. If not the associated `_FOUND` variable will be set. This value is then checked to determine if the dependency is added. 3206 3207 However `find_package(PNG)` calls `find_package(ZLIB)` within its find module. So in the case of `FT_DISABLE_ZLIB=TRUE` and `FT_DISABLE_PNG=FALSE` the `ZLIB_FOUND` value can be set and even though `FT_DISABLE_ZLIB` is turned on. 3208 3209 Unset the value of `ZLIB_FOUND` after the call to `find_package(PNG)` so the value is only set when `FT_DISABLE_ZLIB` is turned off. 3210 3211 2024-06-26 Werner Lemberg <wl@gnu.org> 3212 3213 Make 'multi' build work again. 3214 3215 * src/psaux/psobjs.c: Include `psft.h`. 3216 3217 * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttgpos.c`. 3218 3219 Fixes issue #1284. 3220 3221 2024-06-23 Alexei Podtelezhnikov <apodtele@gmail.com> 3222 3223 * src/truetype/ttgload.c (load_truetype_glyph): Unsigned fix. 3224 3225 2024-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3226 3227 Use unsigned tags `FT_Outline`. 3228 3229 This change comes along with 2a7bb4596f56 ans is only meant to reduce 3230 pointer casting in the code. 3231 3232 * include/freetype/ftimage.h (FT_Outline): Do it. 3233 * src/*: Update `FT_Outline` users. 3234 3235 2024-06-21 Ben Wagner <bungeman@chromum.org> 3236 3237 [ttgxvar] Avoid "applying zero offset to null pointer" 3238 3239 In C it is undefined behavior to do arithmetic on a null pointer, including 3240 adding zero. When using NotoSansKhmer[wdth,wght].ttf UBSAN produces a report 3241 like 3242 3243 ttgxvar.c:1052:31: runtime error: applying zero offset to null pointer 3244 3245 when adding zero to `varData->deltaSet` (which is null) to produce `bytes`. 3246 Protect against all the potential issues of this kind by returning early if 3247 `varData->regionIdxCount == 0`. 3248 3249 * src/truetype/ttgxvar.c (tt_var_get_item_delta): early return on no regions 3250 3251 2024-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3252 3253 Use unsigned point and contour indexing in `FT_Outline`. 3254 3255 This doubles the number or allowed points, see 3256 https://github.com/harfbuzz/harfbuzz/issues/4752 3257 3258 Although it is hardly practical to use more than 32767 points, 3259 other font engines seem to support it. 3260 3261 * docs/CHANGES: Announce it. 3262 * include/freetype/ftimage.h (FT_Outline): Do it and update limits. 3263 * src/*: Update `FT_Outline` users. 3264 3265 2024-06-20 Alexei Podtelezhnikov <apodtele@gmail.com> 3266 3267 * src/pfr/pfrgload.c (pfr_glyph_curve_to): Avoid casting. 3268 3269 2024-06-19 Alexei Podtelezhnikov <apodtele@gmail.com> 3270 3271 * src/base/ftgloadr.c (FT_GlyphLoader_Prepare): Minor refactoring. 3272 3273 2024-06-18 Alexei Podtelezhnikov <apodtele@gmail.com> 3274 3275 [base, autofit, psaux] Remove unnecessary casting. 3276 3277 * src/autofit/afhints.c (af_glyph_hints_reload): Remove (short) casting. 3278 * src/base/ftgloadr.c (FT_GlyphLoader_Add): Ditto. 3279 * src/psaux/psobjs.c ({t1,cff,ps}_builder_{add,close}_contour): Ditto. 3280 3281 2024-06-18 Alexei Podtelezhnikov <apodtele@gmail.com> 3282 3283 * include/freetype/ftimage.h: Explain standard types. 3284 3285 2024-05-29 Ben Wagner <bungeman@chromium.org> 3286 3287 [ttgxvar] Replace tabs with spaces 3288 3289 Also clarify comments around conversion and clamping. 3290 3291 * src/truetype/ttgxvar.c (ft_var_to_normalized): doit 3292 3293 2024-05-27 Alexei Podtelezhnikov <apodtele@gmail.com> 3294 3295 [truetype/GX] Consolidate memory allocations. 3296 3297 * src/truetype/ttgxvar.c (tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): 3298 Allocate and split bigger memory blocks, avoid unnecessary zeroing, 3299 do not copy shared tuples, revise error exit paths. 3300 3301 2024-05-26 Alexei Podtelezhnikov <apodtele@gmail.com> 3302 3303 Whitespace. 3304 3305 2024-05-24 Alexei Podtelezhnikov <apodtele@gmail.com> 3306 3307 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Reduce checks. 3308 3309 2024-05-24 Alexei Podtelezhnikov <apodtele@gmail.com> 3310 3311 Revert "[truetype] Reduce allocation scope." 3312 3313 This reverts commit 9ff4153cbfd60491f11bb56905ce6e20e94d23c7. 3314 3315 2024-05-23 Alexei Podtelezhnikov <apodtele@gmail.com> 3316 3317 [truetype] Reduce allocation scope. 3318 3319 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Reduce scope 3320 of `points_org` and 'points_out`. 3321 3322 2024-05-23 Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com> 3323 3324 * .gitlab-ci.yml: Disable UWP compilation. 3325 3326 2024-05-23 Alexei Podtelezhnikov <apodtele@gmail.com> 3327 3328 * include/freetype/internal/ftmemory.h (FT_MEM_DUP): Fix g++ error. 3329 3330 2024-05-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3331 3332 [cff, truetype] Validate variation axes immediately. 3333 3334 Instead of validating variation axes in every access, OpenType specs 3335 suggest that peak = 0 be used to tag invalid ranges. This implements 3336 just that once during loading. 3337 3338 * src/cff/cffload.c (cff_blend_build_vector): Move the range checks... 3339 (cff_vstore_load): ... here. 3340 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Ditto... 3341 (tt_var_load_item_variation_store): ... ditto. 3342 3343 2024-05-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3344 3345 [cff, truetype] Rearrange variation range checks. 3346 3347 This should achieve quicker results for common cases. 3348 3349 * src/cff/cffload.c (cff_blend_build_vector): Rearrange conditionals. 3350 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Ditto. 3351 3352 2024-05-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3353 3354 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Align with specs. 3355 3356 2024-05-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3357 3358 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Minor refactoring. 3359 3360 2024-05-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3361 3362 [cff] Optimize the blend vector computations. 3363 3364 * src/cff/cffload.c (cff_blend_build_vector): Use FT_MulDiv and skip 3365 multiplying by 1. 3366 3367 2024-05-20 Alexei Podtelezhnikov <apodtele@gmail.com> 3368 3369 [bdf] Use concise macros. 3370 3371 * src/bdf/bdflib.c (bdf_create_property): Use FT_STRDUP. 3372 (bdf_parse_glyphs_, bdf_parse_start_): Use FT_DUP for brevity. 3373 3374 2024-05-20 Alexei Podtelezhnikov <apodtele@gmail.com> 3375 3376 [cache] Use FT_DUP to duplicate data. 3377 3378 * src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Use concise FT_MEM_DUP. 3379 3380 2024-05-20 Alexei Podtelezhnikov <apodtele@gmail.com> 3381 3382 [truetype, type1] Use FT_DUP to duplicate data. 3383 3384 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use concise FT_DUP. 3385 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Ditto. 3386 * src/type1/t1load.c (parse_subrs): Ditto. 3387 3388 2024-05-18 Alexei Podtelezhnikov <apodtele@gmail.com> 3389 3390 * builds/windows/ftsystem.c: Use _WINRT_DLL to check for UWP. 3391 3392 Fixes compilation using Windows GDK, reported by Erin Melucci. 3393 3394 2024-05-13 Alexei Podtelezhnikov <apodtele@gmail.com> 3395 3396 * include/freetype/ftmm.h: Include `freetype.h`. 3397 3398 Reported by Ben Wagner, see !326. 3399 3400 2024-05-13 Alexei Podtelezhnikov <apodtele@gmail.com> 3401 3402 [type1/MM] Safer handle arrays of different types. 3403 3404 * src/type1/t1load.c (parse_blend_design_map): Separately allocate... 3405 (T1_Done_Blend): ... and free `design_points` and `blend_points`. 3406 3407 2024-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> 3408 3409 * src/type1/t1load.c (parse_blend_design_map): Add risky cast. 3410 3411 2024-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> 3412 3413 * docs/CHANGES: Mention the last commit. 3414 3415 2024-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> 3416 3417 [type1/MM] Tighten headers. 3418 3419 * include/freetype/internal/t1types.h: Host PS_DesignMap and PS_Blend. 3420 * include/freetype/ftmm.h: Host and document TT_MAX_MM_XXX. 3421 * include/freetype/t1tables.h: Remove them from here. 3422 3423 2024-05-11 Alexei Podtelezhnikov <apodtele@gmail.com> 3424 3425 * src/pshinter/pshrec.c (ps_hints_stem): Correct argument. 3426 3427 2024-05-08 Ben Wagner <bungeman@chromium.org> 3428 3429 [psaux] Fix location and type order in initializer 3430 3431 `T1_FIELD_ZERO` is used to zero initialize a `T1_FieldRec`. 3432 `T1_FIELD_ZERO` is currently initilizing `T1_FieldRec::location` with a 3433 `T1_FieldType` and `T1_FieldRec::type` with a `T1_FieldLocation`. This 3434 was detected with `-Wenum-conversion`. 3435 3436 * include/freetype/internal/psaux.h (T1_FIELD_ZERO): correct order of 3437 initalizers 3438 3439 2024-05-08 Alexei Podtelezhnikov <apodtele@gmail.com> 3440 3441 * include/freetype/internal/psaux.h: Fix g++ warning. 3442 3443 Reported by Hin-Tak Leung. 3444 3445 2024-05-08 Ben Wagner <bungeman@chromium.org> 3446 3447 [colr] Avoid overflow in range checks 3448 3449 In 32 bit builds `FT_ULong` is 32 bits and can silently overflow when a 3450 large number is read into one and then it is summed or multiplied with 3451 another number. Checks for range overflow must be written so that they 3452 themselves do not overflow. Also ensure that the table_size is always the 3453 first part of the range check and consistently use `<` or `<=`. 3454 3455 * src/sfnt/ttcolr.c (tt_face_load_colr): Avoid overflow. 3456 (find_base_glyph_v1_record): Remove old work-around. 3457 3458 Bug: https://issues.chromium.org/issues/41495455 3459 Bug: https://issues.chromium.org/issues/40945818 3460 3461 2024-05-06 Werner Lemberg <wl@gnu.org> 3462 3463 .mailmap: Fix entry for Ben Wagner. 3464 3465 2024-05-06 Alexei Podtelezhnikov <apodtele@gmail.com> 3466 3467 [sdf, bsdf] Use shared FT_SqrtFixed. 3468 3469 FT_SqrtFixed (95b0fe2a6dff) is faster and does not overflow. 3470 3471 * src/sdf/ftsdfcommin.h (square_root): Replace with a macro. 3472 * src/sdf/ftsdfcommin.c (square_root): Remove function. 3473 3474 2024-05-04 Alexei Podtelezhnikov <apodtele@gmail.com> 3475 3476 * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Remove FT_ABS. 3477 3478 See 3479 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68679 3480 3481 2024-05-03 Alexei Podtelezhnikov <apodtele@gmail.com> 3482 3483 * src/sfnt/sfwoff2.c (woff2_open_font): Fix copy-paste typo. 3484 3485 2024-05-03 Alexei Podtelezhnikov <apodtele@gmail.com> 3486 3487 [woff,woff2] Limit the number of tables and use FT_MSB. 3488 3489 The upper limit of 4095 is implied by the SFNT header format 3490 where the multiplication by 16 would overflow without it. 3491 3492 * src/sfnt/sfwoff.c (woff_open_font): Updated. 3493 * src/sfnt/sfwoff2.c (woff2_open_font): Ditto. 3494 3495 2024-05-02 Ben Wanger <bungeman@gmail.com> 3496 3497 [woff2] Disallow zero table font entries 3498 3499 The existing code already disallows zero table woff2 overall, but still 3500 allows for individual CollectionFontEntry to create font instances with 3501 zero tables. Such fonts are not useful so error early. 3502 3503 This also fixes an MSAN discovered issue where if a CollectionFontEntry 3504 numTables is zero then the sfnt_header was not fully initialized. 3505 3506 * src/sfnt/sfwoff2.c (woff2_open_font): error on zero tables, always 3507 initalize sfnt_header 3508 3509 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=68384 3510 3511 2024-05-02 Alexei Podtelezhnikov <apodtele@gmail.com> 3512 3513 [sfnt] Use faster macros in checksums. 3514 3515 * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Use FT_NEXT_XXX. 3516 * src/sfnt/sfwoff2.c (compute_ULong_sum): Use macros. 3517 3518 2024-05-01 Alexei Podtelezhnikov <apodtele@gmail.com> 3519 3520 * src/sfnt/sfwoff2.c (compute_ULong_sum): Clean up. 3521 3522 2024-04-30 Alexei Podtelezhnikov <apodtele@gmail.com> 3523 3524 * docs/CHANGES: Updated. 3525 3526 2024-04-30 Alexei Podtelezhnikov <apodtele@gmail.com> 3527 3528 * src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Remove nodes instantly. 3529 3530 2024-04-29 Alexei Podtelezhnikov <apodtele@gmail.com> 3531 3532 [cache] Remove unused `node_reset`. 3533 3534 * src/cache/ftcmru.h (FTC_MruListClassRec): Remove `node_reset` field. 3535 * src/cache/ftcbasic.c (ftc_basic_{image,sbit}_family_class): Ditto. 3536 * src/cache/ftcmanag.c (ftc_face_list_class): Ditto. 3537 (ftc_size_node_reset): Remove function. 3538 * src/cache/ftcglyph.h: Fix comment. 3539 3540 2024-04-29 Alexei Podtelezhnikov <apodtele@gmail.com> 3541 3542 * src/cache/ftcmru.c (FTC_MruList_New): Do not reset nodes. 3543 3544 Resetting of the size nodes can crash, if a parent face purge happens 3545 simultaneously and destroys the node. It is safer to create a new node. 3546 Fixes #1270, reopened with a separate issue. 3547 3548 2024-04-28 Alexei Podtelezhnikov <apodtele@gmail.com> 3549 3550 * src/cache/ftcimage.c (ftc_inode_weight): Formatting. 3551 3552 2024-04-28 Alexei Podtelezhnikov <apodtele@gmail.com> 3553 3554 Document the SDF spread further. 3555 3556 2024-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> 3557 3558 * include/freetype/ftdriver.h: s/truncated/clamped/. 3559 3560 2024-04-23 Alexei Podtelezhnikov <apodtele@gmail.com> 3561 3562 Improve SDF documentation. 3563 3564 2024-04-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3565 3566 [cache] Minor tweaks. 3567 3568 * src/cache/ftcimage.c (ftc_inode_free): Remove unnecessary check. 3569 * src/cache/ftcmanag.c (FTC_Manager_Done): Do not zero before freeing. 3570 3571 2024-04-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3572 3573 * src/cache/ftcbasic.c: Cosmetic harmonization. 3574 3575 2024-04-20 Alexei Podtelezhnikov <apodtele@gmail.com> 3576 3577 [cache] Reduce type mismatches. 3578 3579 * src/cache/ftcbasic.c (FTC_BasicAttrRec): Match type of `load_flags` 3580 to its main purpose in `FT_Load_Glyph`. 3581 (FTC_ImageCache_Lookup{,Scaler},FTC_SBitCache_Lookup{,Scaler}): Updated. 3582 3583 2024-04-19 Alexei Podtelezhnikov <apodtele@gmail.com> 3584 3585 * src/cache/{ftcbasic.c,ftccmap.c}: Use FTC_INLINE. 3586 3587 2024-04-19 Alexei Podtelezhnikov <apodtele@gmail.com> 3588 3589 [cache] Tweak headers. 3590 3591 * src/cache/ftccback.h: Include less and move `ftc_node_destroy`... 3592 * src/cache/ftccache.h: ... to here. 3593 * src/cache/ftcmanag.c: Include less. 3594 3595 2024-04-19 Alexei Podtelezhnikov <apodtele@gmail.com> 3596 3597 * src/cache/ftcglyph.c [!FTC_INLINE]: Fix compilation. 3598 3599 2024-04-17 Alexei Podtelezhnikov <apodtele@gmail.com> 3600 3601 [cache] Improve MRU list management. 3602 3603 * src/cache/ftcmru.c (FTC_MruList_Remove): Cosmetic. 3604 (FTC_MruList_New): Accept only valid changes. 3605 * src/cache/ftcmanag.c (ftc_size_node_done): Simplify. 3606 3607 2024-04-17 Alexei Podtelezhnikov <apodtele@gmail.com> 3608 3609 [cache] Fix error handling. 3610 3611 Manipulate the cache after a face is requested or a size is looked up 3612 successfully. Fixes #1270. 3613 3614 * src/cache/ftcmanag.c (ftc_size_node_init, ftc_size_node_reset, 3615 ftc_face_node_init): Check for errors before accepting a change. 3616 * src/cache/ftcmru.c (FTC_MruList_New): Do nothing if reset fails. 3617 3618 2024-04-14 Alexei Podtelezhnikov <apodtele@gmail.com> 3619 3620 [smooth] Switch to vertical bisections. 3621 3622 With horizontal bisections, the smallest section is a whole single 3623 scanline. Almost horizontal lines or other complex scanlines can 3624 easily overflow the rendering pool. Switching to vertical bisections 3625 splits the scanlines and should rule out the overflows. Fixes #1269. 3626 3627 * src/smooth/ftgrays.c (gray_convert_glyph): Bisect vertically. 3628 3629 2024-04-14 Alexei Podtelezhnikov <apodtele@gmail.com> 3630 3631 * src/smooth/ftgrays.c (gray_convert_glyph): Refactor for convenience. 3632 3633 2024-04-14 Alexei Podtelezhnikov <apodtele@gmail.com> 3634 3635 [smooth] Store persistent clipping box. 3636 3637 * src/smooth/ftgrays.c (gray_TWorker, gray_raster_render): Add and set 3638 the new structure field. 3639 (gray_convert_glyph): Use it. 3640 3641 2024-03-08 Ben Wanger <bungeman@gmail.com> 3642 3643 [colr] Ensure enough bytes for PaintColrLayers 3644 3645 * src/sfnt/ttcolr.c (read_paint): check that there are five additional 3646 bytes to be read when reading PaintColrLayers. 3647 3648 Reported as 3649 3650 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66566 3651 3652 2024-03-08 Ben Wagner <bungeman@gmail.com> 3653 3654 Avoid n^2 scanning for binary data. 3655 3656 When creating a CID parser the location of the 'StartData' or '/sfnts' 3657 tokens needs to be known. However, the token parser requires that the 3658 entire document be in memory and flattening the entire stream into memory is 3659 to be avoided. 3660 3661 To avoid forcing the entire stream into memory, previously this code would 3662 scan through the stream looking for 'StartData' or '/sfnts' as strings. 3663 However, these strings could have been in a comment or string token, so the 3664 stream would be read into memory up to that point and the parser run to 3665 check that these strings were actually tokens. This forced a parser restart 3666 from the beginning each time; as a result, data with many 'StartData' 3667 non-tokens would take n^2 time to check. 3668 3669 * src/cid/cidparse.c (cid_parser_new): Change algorithm to make the initial 3670 scan look for the last possible 'StartData' or '/sfnts' string in the 3671 stream. The stream is read forward instead of backward as a typical normal 3672 CID font will have one 'StartData' toward the beginning of the data and it 3673 it much faster to read the data from beginning to end instead of end to 3674 beginning. For memory-based fonts the limit is set to the end of the stream 3675 since the stream is already in memory. Then the parser is run once to look 3676 for 'StartData' or '/sfnts' tokens. If they are found the parser is re-set 3677 to reflect this new information. 3678 3679 Reported as 3680 3681 https://issues.chromium.org/issues/40201695 3682 3683 2024-03-06 Alexei Podtelezhnikov <apodtele@gmail.com> 3684 3685 * CMakeLists.txt: Bump required version to 3.5. 3686 3687 Fixes #1267. 3688 3689 2024-03-04 Jordan Williams <jordan@jwillikers.com> 3690 3691 meson: Use the standard dependency mechanism to find bzip2 3692 3693 This follows standard conventions in Meson by using the pkg-config file. 3694 This change allows Conan to switch to the Meson build system. 3695 3696 2024-02-29 Ben Wanger <bungeman@gmail.com> 3697 3698 [cff, truetype] Always set up default variable instance. 3699 3700 For default variable instances `cff_face_init` did not set the blend. This 3701 mostly worked as later use of the unset blend produced the default 3702 variation. However, if a user called `TT_Get_MM_Var` the blend would be 3703 partially set up, but not fully. In particular the number of axes, the axis 3704 definitions, and the instance locations would be set up, but not the current 3705 instance location (`coords` and `normalizedcoords`). This could lead to the 3706 default instances of CFF2 fonts erroring on any use of `blend`. 3707 3708 Ensure the default variable instance is fully set up by always calling 3709 `FT_Set_Named_Instance` on a variable face. 3710 3711 * src/cff/cffobjs.c (cff_face_init): Call `FT_Set_Named_Instance` on 3712 default instances. 3713 * src/truetype/ttobjs.c (tt_face_init): Ditto. 3714 3715 Fixes #1268. 3716 3717 2024-02-23 Werner Lemberg <wl@gnu.org> 3718 3719 * src/truetype/ttgxvar.c (ft_var_to_normalized): Integer overflow. 3720 3721 Reported as 3722 3723 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66543 3724 3725 2024-01-27 Alexei Podtelezhnikov <apodtele@gmail.com> 3726 3727 Update all copyright notices. 3728 3729 2024-01-27 Alexei Podtelezhnikov <apodtele@gmail.com> 3730 3731 * src/sfnt/ttgpos.c (tt_gpos_get_glyph_class): Fix warning C4018. 3732 3733 2024-01-27 David Saltzman <davidbsaltzman@gmail.com> 3734 3735 Add support for kerning from 'GPOS' tables. 3736 3737 This commit adds support for kerning from 'GPOS' tables, while maintaining 3738 support for basic 'kern' tables. `FT_HAS_KERNING` will be true for a font 3739 with either available and `FT_Get_Kerning` will still use the basic 'kern' 3740 table data if avilable, otherwise check the GPOS 'kern' feature. 3741 3742 This feature is disabled by default; it can be enabled with the 3743 `TT_CONFIG_OPTION_GPOS_KERNING` flag. 3744 3745 Only basic kerning (pair positioning with just an x advance) is supported 3746 from the GPOS layout features; support for that was added to make the 3747 existing `FT_Get_Kerning` API more consistently functional. FreeType does 3748 not intend to extend itself to further GPOS functionality though; a 3749 higher-level library like HarfBuzz can be used instead for that. 3750 3751 * include/freetype/config/ftoption.h, include/devel/ftoption.h 3752 (TT_CONFIG_OPTION_GPOS_KERNING): New configuration option. 3753 3754 * include/freetype/internal/fttrace.h: Add `ttgpos` trace handler. 3755 3756 * include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_gpos` and 3757 `get_gpos_kerning` fields. 3758 (FT_DEFINE_SFNT_INTERFACE): Updated. 3759 3760 * include/freetype/internal/tttypes.h: Include `fttypes.h`. 3761 (TT_FaceRec) [TT_CONFIG_OPTION_GPOS_KERNING]: Add `gpos_table` and 3762 `gpos_kerning_available` fields. 3763 3764 * src/sfnt/ttgpos.c, src/sfnt/ttgpos.h: New files. 3765 3766 * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_GPOS_KERNING]: Include `ttgpos.h`. 3767 (sfnt_interface): Updated. 3768 3769 * src/sfnt/sfnt.c: Include `ttgpos.c`. 3770 3771 * src/sfnt/sfobjs.c [TT_CONFIG_OPTION_GPOS_KERNING]: Include `ttgpos.h`. 3772 (sfnt_load_face) [TT_CONFIG_OPTION_GPOS_KERNING]: Load and free GPOS kerning 3773 data; check GPOS kerning availability. 3774 3775 * src/truetype/ttdriver.c (tt_get_kerning): Use GPOS kerning if there's no 3776 'kern' table. 3777 3778 2024-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 3779 3780 [smooth] Remove SSE2. 3781 3782 As a result of 7b308a29dd10, the regular 64-bit execution is now faster 3783 than SSE2. The rendering speed of script fonts at 64 ppem or larger is 3784 improved by about 3% without SSE2. See !314 for the testing results. 3785 3786 * src/smooth/ftgrays.c (gray_render_conic)[FT_INT64]: Remove SSE2 code. 3787 3788 2024-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 3789 3790 * CMakeLists.txt: Accommodate MingGW. 3791 3792 See https://github.com/StephanTLavavej/mingw-distro/issues/97. 3793 3794 2024-01-08 Ozkan Sezer <sezeroz@gmail.com> 3795 3796 * src/sfnt/ttcolr.c (find_base_glyph_v1_record): Fix build in C90 mode. 3797 3798 2024-01-07 Alexei Podtelezhnikov <apodtele@gmail.com> 3799 3800 [base] Fix up Mac resource forks and dfonts. 3801 3802 * src/base/ftobjs.c (IsMacResource): Assign `face_index`. 3803 * src/base/ftmac.c (FT_New_Face_From_Suitcase): Ditto after rework. 3804 3805 2024-01-05 Alexei Podtelezhnikov <apodtele@gmail.com> 3806 3807 [sfnt] Restrict POST version 1.0. 3808 3809 A font has surfaced with `post` version 1.0 and fewer than 258 glyphs. 3810 Its glyphs did not correspond to their names. We now reject such `post` 3811 strictly following specifications. 3812 3813 * src/sfnt/ttpost.c (tt_face_get_ps_name): Check the number of glyphs 3814 for version 1.0. 3815 3816 2024-01-03 Alexei Podtelezhnikov <apodtele@gmail.com> 3817 3818 * .gitlab-ci.yml: Use detached CI pipelines. 3819 3820 See issue freedesktop/freedesktop#540. 3821 3822 2024-01-02 Werner Lemberg <wl@gnu.org> 3823 3824 [sfnt] Guard access in 'COLR' v1 glyph binary search. 3825 3826 Reported as 3827 3828 https://bugs.chromium.org/p/chromium/issues/detail?id=1505216 3829 3830 * src/sfnt/ttcolr.c (find_base_glyph_v1_record): Guard access of the search 3831 pointer during binary search. The pointer needs to be checked as we go as 3832 the test that compares number of v1 glyphs with table size at the time of 3833 loading the table is not sufficient on its own. 3834 3835 A scenario is possible in which the `BaseGlyphRecord` list extends into 3836 non-`BaseGlyphRecord` parts of the 'COLR' v1 table (but passed the size 3837 comparison check). Then, at those locations, invalid glyph ID values are 3838 read and may provoke an invalid read due to reassigning min and max values 3839 during the binary search. 3840 3841 2023-12-18 Alexei Podtelezhnikov <apodtele@gmail.com> 3842 3843 [ci] Add support for MSBuild on Windows. 3844 3845 This adds msbuild job for VS2019 (x64). 3846 3847 * .gitlab-ci.yml: Added "windows msbuild vs2019 amd64". 3848 3849 2023-12-14 Skef Iterum <github@skef.org> 3850 3851 [CFF] Extract `BlueValues` as `Fixed` rather than `Int`. 3852 3853 This is a follow-up to commit 26a7f047, 3854 3855 [cff] Make blend operator work with floats in private dicts. 3856 3857 which addressed the 'party baseline' bug. However, the reporting user 3858 indicated that the default location and some other points in design space 3859 rendered OK, but other points in design space still had problems. The most 3860 obvious issue being that the x-heights of lower-case letters did not align; 3861 see 3862 3863 https://github.com/adobe-fonts/source-serif/issues/121#issuecomment-1773794136 3864 3865 After some analysis we determined that this was due to an interaction 3866 between `BlueValue` rounding and the zone-based algorithm. In short, for a 3867 point to be considered in a zone it must fall within the bounds of the zone. 3868 (There is a slop factor in some cases, but only a very small one.) In the 3869 Adobe-contributed side of the code, point values are not integer-rounded, 3870 instead they're kept as (some form of) fixed. Rounding just the `BlueValues` 3871 means that points that need to be considered within a zone will fall outside 3872 of it at some points in design space. 3873 3874 The majority of this patch changes the storage and parsing of `BlueValues` 3875 to keep them as `FT_Fixed`. No significant code changes were needed because 3876 the values are converted to `Fixed` anyway when stored in `CF_BlueRec`. No 3877 attempt was made to address problems in the older pshinter code beyond 3878 converting the values from `FT_Fixed` to `FT_Short` when copying the private 3879 dictionary. (However, as the point values are also rounded in that code, 3880 the problem is much less likely to occur, although inconsistency between 3881 rounding and truncation could cause an analogous problem.) 3882 3883 * include/freetype/internal/cfftypes.h (CFF_PrivateRec): Use `FT_Fixed` for 3884 `blue_values`, `other_blues`, `family_blues`, and `family_other_blues`. 3885 3886 * src/cff/cffload.c (cff_blend_doBlend): Updated. 3887 3888 * src/cff/cffobjs.c (CFF_fixedToInt): New macro. 3889 (cff_make_private_dict): Use it. 3890 3891 * src/cff/cffparse.h (cff_kind_delta_fixed): New enum value. 3892 3893 * src/cff/cffparse.c (do_fixed): Updated. 3894 (CFF_FIELD_DELTA, CFF_FIELD_DELTA_FIXED, CFF_DELTA_KIND): New set of macros, 3895 replacing `CFF_FIELD_DELTA`. 3896 (cff_parser_run): Updated to handle fixed-float deltas. 3897 3898 * src/cff/cfftoken.h: Updated to use `CFF_FIELD_DELTA_FIXED` for blue 3899 values. 3900 3901 * src/psaux/psblues.c (cf2_blueToFixed): Removed, no longer needed. 3902 (cf2_blues_init): Updated. 3903 3904 * src/pxaux/psft.c, src/pxaux/psft.h (cf2_getBlueValues, cf2_getOtherBlues, 3905 cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated signatures. 3906 3907 * src/psaux/psobjs.c (t1_make_subfont): Updated. 3908 3909 2023-12-14 Skef Iterum <github@skef.org> 3910 3911 [psaux] Improve tracing. 3912 3913 * src/psaux/psintrp.c (cf2_doBlend, cf2_interpT2CharString [cf2_cmdBLEND]): 3914 Show blended values. 3915 3916 2023-12-14 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 3917 3918 * vms_make.com: Switch to `clang`. 3919 3920 Also add proper bzip2 support. 3921 3922 2023-12-14 Werner Lemberg <wl@gnu.org> 3923 3924 * src/truetype/ttgxvar.c (ft_var_to_normalized): Fix undefined left-shift. 3925 3926 Reported as 3927 3928 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63723 3929 3930 2023-12-07 Alexei Podtelezhnikov <apodtele@gmail.com> 3931 3932 [msbuild] Streamline the process. 3933 3934 MSBuild.exe can now be fired from the root folder without options. 3935 3936 * builds/windows/vc2010/freetype.sln: Relocated to... 3937 * MSBuild.sln: ... here with minor changes. 3938 * MSBuild.rsp: New file with command line options. 3939 * docs/INSTALL: Reference `MSBuild.sln`. 3940 3941 2023-12-02 Alexei Podtelezhnikov <apodtele@gmail.com> 3942 3943 * src/raster/ftraster.c (Draw_Sweep): Swap stub conditions. 3944 3945 2023-12-02 Alexei Podtelezhnikov <apodtele@gmail.com> 3946 3947 * src/raster/ftmisc.h (FT_MulDiv): Remove unused copy. 3948 3949 2023-11-28 Alexei Podtelezhnikov <apodtele@gmail.com> 3950 3951 [raster] Speed up Bézier arches with extrema. 3952 3953 While it is recommended to have an explicit point at each curve 3954 extrema, they might be missing or outline could be rotated. This 3955 leads to excessive bisections in raster to find them. This change 3956 helps to decrease the number of bisections. The scanline 3957 intersections remain monotonous, of course. 3958 3959 * src/raster/ftraster.c (Conic_To, Cubic_To): Check that control 3960 points cross the scanlines to bisect. 3961 3962 2023-11-25 Alexei Podtelezhnikov <apodtele@gmail.com> 3963 3964 * docs/*: Typos. 3965 3966 2023-11-24 Alexei Podtelezhnikov <apodtele@gmail.com> 3967 3968 [raster] Eliminate intensive flow checking. 3969 3970 * src/raster/ftraster.c (Draw_Sweep): Pass the flow increment. 3971 (Increment): Accept the flow increment. 3972 3973 2023-11-23 Alexei Podtelezhnikov <apodtele@gmail.com> 3974 3975 * src/raster/ftraster.c: Comments, defines, includes, cleanups. 3976 3977 2023-11-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3978 3979 * src/raster/ftraster.c (FT_Outline_Get_CBox ) [STANDALONE_]: Removed. 3980 3981 2023-11-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3982 3983 * src/raster/ftraster.c (Draw_Sweep): No-fault return. 3984 (Render_Single_Pass): Updated. 3985 3986 2023-11-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3987 3988 [raster] Sweep polishing. 3989 3990 * src/raster/ftraster.c (*_Sweep_Span): Polish. 3991 (*_Sweep_Drop): Restore tracing, polish. 3992 (Draw_Sweep): Simplify the dropout processing loop. 3993 3994 2023-11-21 Alexei Podtelezhnikov <apodtele@gmail.com> 3995 3996 [raster] Rearrange dropout control. 3997 3998 This reduces the code duplication. 3999 4000 * src/raster/ftraster.c (Function_Sweep_Span): Change signature. 4001 (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Focus on pixel setting 4002 and move duplicated the dropout control logic to... 4003 (Draw_Sweep): ... this function and refactor. 4004 (Vertical_Sweep_Span, Horizontal_Sweep_Span): Minor. 4005 4006 2023-11-21 Alexei Podtelezhnikov <apodtele@gmail.com> 4007 4008 [raster] Use bitwise dropout mode interpretation. 4009 4010 * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, 4011 Draw_Sweep, Render_GLyph): Interpret dropout mode using bit masks. 4012 4013 2023-11-16 Alexei Podtelezhnikov <apodtele@gmail.com> 4014 4015 * docs/CHANGES: Updated. 4016 4017 2023-11-16 Alexei Podtelezhnikov <apodtele@gmail.com> 4018 4019 [raster] Keep only bottom y-turns. 4020 4021 This results in noticeable performance improvement. 4022 4023 * src/raster/ftraster.c (Insert_Y_Turns): All bottom y-turns are still 4024 sorted and stored; only the maximum top y-turn is recorded now. The 4025 function is renamed. 4026 (End_Profile): Updated accordingly. 4027 (Convert_Glyph): Reserve space for the top value. 4028 4029 2023-11-15 Alexei Podtelezhnikov <apodtele@gmail.com> 4030 4031 * src/raster/ftraster.c (End_Profile): Reduce branching. 4032 (InsNew): Tweak condition. 4033 4034 2023-11-15 Alexei Podtelezhnikov <apodtele@gmail.com> 4035 4036 * src/raster/ftraster.c (Draw_Sweep): Use more natural loop. 4037 4038 2023-11-15 Alexei Podtelezhnikov <apodtele@gmail.com> 4039 4040 [raster] Dissolve a loop. 4041 4042 * src/raster/ftraster.c (End_Profile): Set initial `X` here... 4043 (Draw_Sweep): ... instead of here; delay the `start` decrement. 4044 4045 2023-11-15 Alexei Podtelezhnikov <apodtele@gmail.com> 4046 4047 * src/raster/ftraster.c: Comments. 4048 4049 2023-11-14 Alexei Podtelezhnikov <apodtele@gmail.com> 4050 4051 [raster] Stylistic changes. 4052 4053 * src/raster/ftraster.c (Line_To): Code it similar to curves; 4054 shortcut the flat lines here... 4055 (Line_Up): ... instead of here. 4056 4057 2023-11-14 Alexei Podtelezhnikov <apodtele@gmail.com> 4058 4059 [raster] Revise overshoot setting. 4060 4061 * src/raster/ftraster.c (New_Profile, End_Profile): Deal with overshoots 4062 locally. 4063 (Line_To, Conic_To, Cubic_To): Update callers. 4064 4065 2023-11-14 Alexei Podtelezhnikov <apodtele@gmail.com> 4066 4067 * src/raster/ftraster.c (Conic_To, Cubic_To): Fix recent regression. 4068 4069 2023-11-14 Alexei Podtelezhnikov <apodtele@gmail.com> 4070 4071 * include/freetype/ftimage.h: Fix type and link. 4072 4073 2023-11-14 Alexei Podtelezhnikov <apodtele@gmail.com> 4074 4075 * src/raster/ftraster.c (Increment): Minor tweak. 4076 4077 2023-11-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4078 4079 [raster] Get rid of the fresh flag. 4080 4081 * src/raster/ftraster.c (black_TWorker): Remove the fresh flag. 4082 (New_Profile): Set the starting scanline here based on the current 4083 coordinate and initialize the joint crossing if necessary. 4084 (Line_Up, Bezier_Up): Do not deal with fresh and joint starts at all. 4085 (Line_Down, Bezier_Down): Simplify. 4086 (Conic_To, Cubic_To): Update the current coordinate after each 4087 subsection. 4088 4089 2023-11-12 Alexei Podtelezhnikov <apodtele@gmail.com> 4090 4091 [raster] Get rid of the joint flag. 4092 4093 * src/raster/ftraster.c (Line_Up, Bezier_Up): Deal with the scanline 4094 joints directly based on the initial y-coordinate. 4095 (New_Profile, black_TWorker): Remove the boolean flag. 4096 4097 2023-11-11 Alexei Podtelezhnikov <apodtele@gmail.com> 4098 4099 * src/raster/ftraster.c (Line_Up, Bezier_Up): Check "between" earlier. 4100 4101 2023-11-11 Alexei Podtelezhnikov <apodtele@gmail.com> 4102 4103 * src/raster/ftraster.c (Line_Up): Updated and fixed up. 4104 4105 This largely synchronizes the entries into `Line_Up` and `Bezier_Up`. 4106 Minor bugs in the remainder calculations and accumulations are fixed. 4107 4108 2023-11-10 Alexei Podtelezhnikov <apodtele@gmail.com> 4109 4110 * src/raster/ftraster.c (End_Profile, Convert_Glyph): Clean up. 4111 4112 2023-11-10 Alexei Podtelezhnikov <apodtele@gmail.com> 4113 4114 * src/raster/ftraster.c (Bezier_Up): Improve joint and loop. 4115 4116 2023-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 4117 4118 [raster] Harmonize target bitmap navigation. 4119 4120 * src/raster/ftraster.c (black_TWorker): Store signed maximum indexes 4121 in both directions instead of unsigned dimensions of the original bitmap. 4122 (*_Sweep_*, Render_Glyph, ft_black_render): Updated all users. 4123 4124 2023-11-06 Alexei Podtelezhnikov <apodtele@gmail.com> 4125 4126 * src/raster/ftraster.c (Bezier_Up): Improve flow. 4127 4128 2023-11-06 Alexei Podtelezhnikov <apodtele@gmail.com> 4129 4130 [raster] Reshuffle code for readability. 4131 4132 * src/raster/ftraster.c (Render_Glyph): Setup the rendering pool here. 4133 (ft_black_render): Setup the target bitmap helpers here. 4134 4135 2023-11-04 Alexei Podtelezhnikov <apodtele@gmail.com> 4136 4137 [raster] Improve profile accounting during sweeping. 4138 4139 * src/raster/ftraster.c (TProfile): Get rid of `countL`. 4140 (Draw_Sweep): Use `start` for countdown to activation. 4141 (Horizontal_Sweep_Drop, Vertical_Sweep_Drop): Rely on `height` and 4142 `offset` to verify profile ends for the stub detection. 4143 4144 2023-11-04 Alexei Podtelezhnikov <apodtele@gmail.com> 4145 4146 [raster] Consolidate profile increment to the next line. 4147 4148 * src/raster/ftraster.c (s/Sort/Increment): Rename this function to 4149 reflect its true purpose, delete exhausted profiles here... 4150 (Draw_Sweep): ... instead of here. 4151 4152 2023-11-04 Alexei Podtelezhnikov <apodtele@gmail.com> 4153 4154 [raster] Instantly remove profiles from linked lists. 4155 4156 * src/raster/ftraster.c (DelOld): Remove loopy function. 4157 (Draw_Sweep): Implement instant profile removal. 4158 4159 2023-11-03 Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com> 4160 4161 [raster] Modify the split condition. 4162 4163 While curving close to a pixel center, vertical and horizontal pass 4164 might split the curve differently and cause a rare dropout. This 4165 makes the split condition invariant of the sweep direction and more 4166 robust. 4167 4168 * src/raster/ftraster.c (Bezier_Up): Modify the split condition. 4169 4170 2023-11-03 Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com> 4171 4172 [raster] Remove the jitter exception. 4173 4174 The jitter exception used to be applied when two neighboring pixels 4175 were barely inside the outline. One the left one was turned on then, 4176 which contradicts the OpenType specifications. Intended to remove 4177 glitches, it caused disappearing lines and was softened by adding an 4178 exception to the exception (#54589). 4179 4180 * src/raster/ftraster.c (Vertical_Sweep_Span): Drop the jitter exception. 4181 4182 2023-10-31 Alexei Podtelezhnikov <apodtele@gmail.com> 4183 4184 [raster] Simplify dropout detection. 4185 4186 * src/raster/ftrater.c (Draw_Sweep): Use a single dropout condition. 4187 4188 2023-10-31 Alexei Podtelezhnikov <apodtele@gmail.com> 4189 4190 [raster] Simplify sweeping entry and exit. 4191 4192 * src/raster/ftraster.c (Draw_Sweep): Use y-turns to set the range, 4193 correctly set the initial position, directly loop through y_turns, 4194 and remove a 5-gray remnant at exit. 4195 4196 2023-10-26 Alexei Podtelezhnikov <apodtele@gmail.com> 4197 4198 [raster] Switch to routine Int instead of Short. 4199 4200 This is mostly cosmetic and removes a few casts, plus Short is 4201 promoted to Int in calculations anyway. 4202 4203 * src/raster/ftraster.c (Vertical_Sweep_Init, Vertical_Sweep_Span, 4204 Vertical_Sweep_Drop, Horizontal_Sweep_Init, Horizontal_Sweep_Span, 4205 Horizontal_Sweep_Drop, Draw_Sweep): Mostly s/Short/Int/ and remove 4206 casting. 4207 4208 2023-10-24 Alexei Podtelezhnikov <apodtele@gmail.com> 4209 4210 [raster] Increase the raster pool density. 4211 4212 This only helps to delay the pool overflow and bisections to larger 4213 sizes and benefits only very intricate glyphs at reasonable sizes. 4214 4215 * src/raster/ftraster.c (TProfile): Use Int instead of Long or PLong 4216 when it is sufficient. 4217 (New_Profile, End_Profuile, Bezier_Up, Sort): Updated accordingly. 4218 4219 2023-10-23 Alexei Podtelezhnikov <apodtele@gmail.com> 4220 4221 [raster] Slightly improve the pool design. 4222 4223 * src/raster/ftraster.c (TProfile): Include the variable array member 4224 and repackage with pointers first. 4225 (New_Profile): Advance the top using the variable array pointer. 4226 4227 2023-10-22 Alexei Podtelezhnikov <apodtele@gmail.com> 4228 4229 [raster] Clean up sweeping. 4230 4231 * src/raster/ftraster.c (Draw_Sweep): Zero initialize the working 4232 lists directly and remove unnecessary y-turn checks. 4233 (Init_Linked): Removed. 4234 4235 2023-10-22 Alexei Podtelezhnikov <apodtele@gmail.com> 4236 4237 * src/raster/ftraster.c (Insert_Y_Turn): Improve flow. 4238 4239 2023-10-22 Alexei Podtelezhnikov <apodtele@gmail.com> 4240 4241 * src/pcf/pcfutil.c (BSWAP16): Limit clang support. 4242 4243 These ancient builtins have been supported by clang since 2013. We 4244 condition it somewhat stricter but still around 2017. This is more 4245 portable than `__has_builtin`. Fixes #1260. 4246 4247 2023-10-19 Alexei Podtelezhnikov <apodtele@gmail.com> 4248 4249 [raster] Small optimizations. 4250 4251 * src/raster/ftraster.c (New_Profile): Set important fields only and 4252 delay setting `gProfile` until... 4253 (End_Profile): ... it is checked to be valid here. 4254 (Convert_Glyph): Updated. 4255 4256 2023-10-18 Alexei Podtelezhnikov <apodtele@gmail.com> 4257 4258 * src/raster/ftraster.c (Convert_Glyph): Remove redundant check. 4259 4260 2023-10-18 Alexei Podtelezhnikov <apodtele@gmail.com> 4261 4262 [raster] Fix linked profiles in contour loops. 4263 4264 This fixes a subtle bug when the last profile in a contour was not 4265 properly short-circuited if it was still empty at `End_Profile`. 4266 We finalize all linking in `Finalize_Profile_List` now and do nothing 4267 else there. The turns are added in `End_Profile`. 4268 4269 * src/raster/ftraster.c (Insert_Y_Turn): Moved up unchanged. 4270 (End_Profile): Take care of turns but set only preliminary linking. 4271 (Finalize_Profile_Table): Take care of linking and null-termination. 4272 (Convert_Glyph): Adjusted accordingly. 4273 4274 2023-10-15 Alexei Podtelezhnikov <apodtele@gmail.com> 4275 4276 * src/raster/ftraster.c: Improve tracing. 4277 4278 2023-10-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4279 4280 [raster] Improve profile accounting. 4281 4282 * src/raster/ftraster.c (End_Profile): Do not initiate next profile. 4283 (New_Profile): Fully initiate new profile. 4284 (Convert_Glyph): Clean up variables, initialize `fProfile` here. 4285 4286 2023-10-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4287 4288 * src/raster/ftraster.c (Convert_Glyph): Fix null-dereference. 4289 4290 2023-10-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4291 4292 [raster] Fix pool overflow checking. 4293 4294 * src/raster/ftraster.c (New_Profile, End_Profile): Check for overflow 4295 immediately. 4296 (Convert_Glyph, Render_Single_Pass): Fix boundaries. 4297 4298 2023-10-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4299 4300 [raster] Miscellaneous clean-ups. 4301 4302 * src/raster/ftraster.c (New_Profile): Use NULL. 4303 (End_Profile): Optimize variables. 4304 (Convert_Glyph): Do not initialize `cProfile` yet. 4305 (Render_Single_Pass): Tracing. 4306 4307 2023-10-10 Alexei Podtelezhnikov <apodtele@gmail.com> 4308 4309 * src/smooth/ftgrays.c: Move the sweep functions... 4310 4311 ... out of the setjmp/longjmp scope for readability. 4312 4313 2023-10-10 Alexei Podtelezhnikov <apodtele@gmail.com> 4314 4315 * src/raster/ftraster.c: Tracing updates. 4316 4317 2023-10-09 Zachary Zollman <zacharyzollman@pm.me> 4318 4319 fix typo in FT_Outline_Decompose note 4320 4321 2023-09-29 Alexei Podtelezhnikov <apodtele@gmail.com> 4322 4323 * src/smooth/ftgrays.c (gray_render_conic) [SSE2]: Improve flow. 4324 4325 2023-09-26 Alexei Podtelezhnikov <apodtele@gmail.com> 4326 4327 * src/gxvalid/gxvcommn.h (GXV_USHORT_TO_SHORT): Removed. 4328 4329 2023-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 4330 4331 Comment typos. 4332 4333 2023-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 4334 4335 * src/base/ftcalc.c (FT_MOVE_SIGN): Enclose assignments. 4336 4337 2023-09-21 Alexei Podtelezhnikov <apodtele@gmail.com> 4338 4339 * include/freetype/internal/ftcalc.h (FT_MSB): Define for Solaris 11. 4340 4341 2023-09-20 Alexei Podtelezhnikov <apodtele@gmail.com> 4342 4343 [psaux] Use `FT_SqrtFixed`. 4344 4345 * src/psaux/cffdecode.c <cff_op_sqrt>: Call `FT_SqrtFixed`. 4346 * src/psaux/psintrp.c <cf2_escSQRT>: Ditto. 4347 4348 2023-09-20 Alexei Podtelezhnikov <apodtele@gmail.com> 4349 4350 [base] Reintroduce `FT_SqrtFixed`. 4351 4352 The general square root calculations are not necessary in FreeType. 4353 For vector normalization or length, FreeType uses special functions. 4354 It is, however, required in the legacy CFF specifications. 4355 4356 * src/base/ftcalc.c (FT_SqrtFixed): New function that uses either 4357 Babylonian or bit-wise algorithm, whichever is faster for the given 4358 situation. 4359 * include/freetype/internal/ftcalc.h (FT_SqrtFixed): Declare it. 4360 4361 2023-09-18 Alexei Podtelezhnikov <apodtele@gmail.com> 4362 4363 * src/base/ftcalc.c /* FT_SqrtFixed */: Fix defunct overflow. 4364 4365 2023-09-14 Alexei Podtelezhnikov <apodtele@gmail.com> 4366 4367 * src/tools/apinames.c (read_header_file): Typos. 4368 4369 2023-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4370 4371 Update 2 files 4372 4373 - /src/base/ftcalc.c 4374 - /include/freetype/internal/ftcalc.h 4375 4376 2023-09-13 Ben Wagner <bungeman@chromium.org> 4377 4378 [base] Fix typo to correct predicate for call 4379 4380 * src/base/ftobj.c (FT_Get_Color_Glyph_Paint): check 4381 `get_colr_glyph_paint` before calling `get_colr_glyph_paint` and not 4382 `get_colr_layer` 4383 4384 2023-09-12 Alexei Podtelezhnikov <apodtele@gmail.com> 4385 4386 * src/psaux/cffdecode.c (cff_op_sqrt): Correct upper limit. 4387 4388 2023-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> 4389 4390 * src/psaux/cffdecode.c (cff_op_sqrt): Improve initial guess. 4391 4392 2023-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> 4393 4394 src/psaux/psintrp.c (cf2_escSQRT): Improve initial guess. 4395 4396 The worst number of iterations decreased from 11 to 5. 4397 4398 2023-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> 4399 4400 * src/type1/t1afm.c (t1_get_index): Restore `strlen` call. 4401 4402 This reverts commit 8ed6d97446f2f3e5523da62eefbbf32ef7c1290e 4403 and fixes 4404 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62246 4405 4406 2023-09-10 Alexei Podtelezhnikov <apodtele@gmail.com> 4407 4408 * src/cff/cffparse.c (CFF_Field_Handler): Some s/0/NULL/. 4409 4410 2023-09-10 Alexei Podtelezhnikov <apodtele@gmail.com> 4411 4412 [type1, cid, type42] Post-cleanup. 4413 4414 * include/freetype/internal/psaux.h (T1_FIELD_ZERO): Terminating macro. 4415 * src/cid/cidload.c (cid_parse_dict): Use while-loop. 4416 * src/type1/t1load.c (parse_dict): Ditto. 4417 * src/type42/t42parse.c (t42_parse_dict): Ditto. 4418 4419 2023-09-09 Alexei Podtelezhnikov <apodtele@gmail.com> 4420 4421 Update forgotten array termini. 4422 4423 * src/cid/cidload.c (cid_field_records): Account for added `len`. 4424 * src/type1/t1load.c (t1_keywords): Ditto. 4425 * src/type42/t42parse.c (t42_keywords): Ditto. 4426 4427 2023-09-09 Alexei Podtelezhnikov <apodtele@gmail.com> 4428 4429 [type1, cid, type42] Streamline dictionary parsing. 4430 4431 When matching the keywords, we avoid calculating their lengths by 4432 checking the stored values. This itself is a sufficient pre-check 4433 before diving into `memcmp`. Therefore, we remove explicit check of 4434 the first characters. 4435 4436 * include/freetype/internal/psaux.h (T1_FieldRec): Store length. 4437 * src/cid/cidload.c (cid_parse_dict): Use `memcmp` and stored length. 4438 * src/type1/t1load.c (parse_dict): Ditto. 4439 * src/type42/t42parse.c (t42_parse_dict): Ditto. 4440 4441 2023-09-09 Alexei Podtelezhnikov <apodtele@gmail.com> 4442 4443 * src/type1/t1afm.c (t1_get_index): Avoid `strlen` call. 4444 4445 Instead, we check the terminal zero. 4446 4447 2023-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 4448 4449 * src/type1/t1driver.c (t1_ps_get_font_value): Avoid redundant null. 4450 4451 2023-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 4452 4453 [cff, truetype] Improve prefix and suffix removal. 4454 4455 * src/cff/cffobjs.c (remove_style): Rewrite using pointers. 4456 (remove_subset_prefix): Unwrap loop and use `memmove`. 4457 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): Unwrap loop 4458 and avoid `strlen`. 4459 4460 2023-09-07 Alexei Podtelezhnikov <apodtele@gmail.com> 4461 4462 * src/sfnt/ttpost.c (load_format_20): Micro-optimize. 4463 4464 2023-09-05 Werner Lemberg <wl@gnu.org> 4465 4466 [autofit] Fix synchronization mistake between FreeType and ttfautohint. 4467 4468 Found by Behdad. 4469 4470 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix array size of 4471 `blue_sorted`: FreeType doesn't have artificial blue zones. 4472 4473 2023-09-04 Werner Lemberg <wl@gnu.org> 4474 4475 [autofit] Fix typos. 4476 4477 This also reduces the used heap size by a large factor. 4478 4479 From Behdad. 4480 4481 * src/autofit/afcjk.h (AF_CJKAxisRec): Use `AF_BLUE_STRINGSET_MAX_LEN`. 4482 * src/autofit/aflatin.h (AF_LatinAxisRec): Ditto. 4483 4484 2023-08-31 Alexei Podtelezhnikov <apodtele@gmail.com> 4485 4486 * src/sfnt/ttpost.c (load_format_20): Rework tracing. 4487 4488 2023-08-30 Alexei Podtelezhnikov <apodtele@gmail.com> 4489 4490 [builds] Abbreviate the DLG submodule update. 4491 4492 * autogen.sh, builds/toplevel.mk: Revise the command options. 4493 4494 2023-08-29 Alexei Podtelezhnikov <apodtele@gmail.com> 4495 4496 Comment added. 4497 4498 2023-08-29 Alexei Podtelezhnikov <apodtele@gmail.com> 4499 4500 * src/sfnt/ttpost.c (load_format_20): Permit long names. 4501 4502 Fixes #1254. 4503 4504 2023-08-27 Werner Lemberg <wl@gnu.org> 4505 4506 [gzip] Update sources to zlib 1.13. 4507 4508 2023-08-25 Werner Lemberg <wl@gnu.org> 4509 4510 docs/release: Minor fixes. 4511 4512 2023-08-25 Anurag Thakur <anuthadev@gmail.com> 4513 4514 docs/freetype-web.txt: New file. 4515 4516 2023-08-25 Werner Lemberg <wl@gnu.org> 4517 4518 * Version 2.13.2 released. 4519 ========================== 4520 4521 Tag sources with `VER-2-13-2'. 4522 4523 * docs/VERSION.TXT: Add entry for version 2.13.2. 4524 * docs/CHANGES: Updated. 4525 * docs/release, docs/README, builds/macs/README: Updated. 4526 4527 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 4528 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 4529 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 4530 docs/freetype-config.1: s/2.13.1/2.13.2/, s/2131/2132/. 4531 4532 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. 4533 4534 * builds/unix/configure.raw (version_info): Set to 26:1:20. 4535 * CMakeLists.txt (VERSION_PATCH): Set to 2. 4536 4537 2023-08-25 Alexei Podtelezhnikov <apodtele@gmail.com> 4538 4539 * src/base/ftcalc.c (FT_MulAddFix): Simplify 32-bit rounding. 4540 4541 2023-08-25 Werner Lemberg <wl@gnu.org> 4542 4543 Fix clang warnings. 4544 4545 * src/cffload.c (cff_blend_doBlend): Fix type of `sum`. 4546 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Fix type of 4547 `word_delta_count`. 4548 4549 2023-08-24 Werner Lemberg <wl@gnu.org> 4550 4551 * subprojects/*.wrap: Updated. 4552 4553 2023-08-24 Hugh McMaster <hugh.mcmaster@outlook.com> 4554 4555 builds/unix/configure.raw: Use variable to specify minimum Python version. 4556 4557 2023-08-24 Alexei Podtelezhnikov <apodtele@gmail.com> 4558 4559 * builds/toplevel.mk: Simplify version extraction. 4560 4561 2023-08-22 Alexei Podtelezhnikov <apodtele@gmail.com> 4562 4563 [base] Improve the matrix degeneracy check. 4564 4565 Also fixes #1251. 4566 4567 * src/base/ftcalc.c (FT_Matrix_Check): To avoid overflow, scale by shifting. 4568 * include/freetype/internal/ftcalc.h (FT_Matrix_Check): Update description. 4569 4570 2023-08-22 Werner Lemberg <wl@gnu.org> 4571 4572 builds/toplevel.mk: Don't use `\#` in functions. 4573 4574 The behaviour changed in GNU make 4.3, where `#` (without the backslash) 4575 would be necessary. Using a variable instead the code works with both older 4576 and newer GNU make versions. 4577 4578 Fixes #1252. 4579 4580 2023-08-19 Hugh McMaster <hugh.mcmaster@outlook.com> 4581 4582 builds/freetype.mk: Invoke `mkdocs` as a Python module 4583 4584 FreeType's `refdoc` target currently allows users to override the 4585 default Python path, which is useful for testing and development. 4586 4587 In contrast, `mkdocs` is invoked via the default Python path. 4588 4589 Invoking `mkdocs` via Python's module syntax allows for greater 4590 flexibility, although there is no change for the default use case. 4591 4592 2023-08-17 Ben Wagner <bungeman@chromium.org> 4593 4594 [base] Avoid UB with memcpy 4595 4596 `FT_NEW_ARRAY(p, 0)` sets `p` to `NULL`. `FT_Stream_ReadAt` with a 4597 memory based stream uses `FT_MEM_COPY` which is `memcpy` which specifies 4598 that it is undefined behavior for either the `src` or `dst` to be 4599 `NULL`. Instead of forcing all callers work around calling 4600 `FT_Stream_Read` when `buffer == NULL && count == 0` do the check in 4601 `FT_StreamRead`. This allows any call with `count == 0` to succesfully 4602 read zero bytes without UB. 4603 4604 * src/base/ftstream.c (FT_Stream_ReadAt): skip `FT_MEM_COPY` when 4605 `count == 0`. (FT_Stream_TryRead): ditto 4606 4607 Fixes: #1250 4608 4609 2023-08-12 Werner Lemberg <wl@gnu.org> 4610 4611 Fix warnings in tracing messages for 32bit compilation. 4612 4613 Since we now require C99, use `%td` for `ptrdiff_t` and `%zu` for `size_t`. 4614 4615 2023-08-04 Ben Wagner <bungeman@chromium.org> 4616 4617 Avoid overflow in COLR bounds checks. 4618 4619 The values read into `base_glyphs_offset_v1` and `layer_offset_v1` may 4620 be in the range 0xFFFFFFFD-0xFFFFFFFF. On systems where `unsigned long` 4621 is 32 bits adding 4 to such values will wrap and pass bounds checks but 4622 accessing values at such offsets will be out of bounds. 4623 4624 On the other hand `table_size` has already been tested to be at least 4625 `COLRV1_HEADER_SIZE` (34) so it is safe to subtract 4 from it. 4626 4627 * src/sfnt/ttcolr.c (tt_face_load_colr): subtract 4 from `table_size` 4628 instead of adding 4 to font data offsets in bounds checks 4629 4630 Fixes: https://crbug.com/1469348 4631 4632 2023-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 4633 4634 * src/base/ftobjs.c (open_face_from_buffer): Silence `maybe-uninitialized`. 4635 4636 We never call this function without a `driver_name` (#1245). 4637 4638 2023-07-29 Alexei Podtelezhnikov <apodtele@gmail.com> 4639 4640 [truetype] Reduce v40 footprint. 4641 4642 * src/truetype/ttgload.c (TT_HInt_Glyph, tt_loader_set_pp, 4643 tt_loader_init): Refactor code. 4644 4645 2023-07-27 Alexei Podtelezhnikov <apodtele@gmail.com> 4646 4647 [truetype] Remove Infinality for good (remaining bits). 4648 4649 * src/truetype/ttobjs.h: Remove remaining fields. 4650 * src/truetype/ttinterp.c: Do not initialize them. 4651 * include/freetype/internal/tttypes.h: Remove descriptions. 4652 4653 2023-07-27 Alexei Podtelezhnikov <apodtele@gmail.com> 4654 4655 [truetype] Remove Infinality for good. 4656 4657 Remove everything `#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY`, 4658 which was undefined for a while now. 4659 4660 * include/freetype/internal/tttypes.h: Ditto. 4661 * src/truetype/truetype.c: Ditto. 4662 * src/truetype/ttdriver.c: Ditto. 4663 * src/truetype/ttgload.c: Ditto. 4664 * src/truetype/ttinterp.c: Ditto. 4665 * src/truetype/ttinterp.h: Ditto. 4666 * src/truetype/ttobjs.c: Ditto. 4667 * src/truetype/ttsubpix.[ch]: Remove files. 4668 * src/truetype/rules.mk: Don't mention "ttsubpix.c". 4669 4670 2023-07-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 4671 4672 * vms_make.com: Provide separate library compiled with C++. 4673 4674 Some types on OpenVMS x86_64 (for example, `long') have different sizes 4675 depending on whether compiled with either C or C++. In particular, 4676 X-Windows applications crash if linked with the C++ version. 4677 4678 This patch makes `vms_make.com` create a second version of the FreeType 4679 library compiled with C++ if OpenVMS is running on the x86_64 platform. 4680 4681 2023-07-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 4682 4683 * vms_make.com: Fix typos. 4684 4685 2023-07-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 4686 4687 * src/smooth/ftgrays.c (FT_SSE2): Fix definition for VMS. 4688 4689 2023-07-19 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 4690 4691 vms_make.com: Make use of additional libraries optional. 4692 4693 Check whether `.olb` files are present. 4694 4695 Also check for the HarfBuzz library. 4696 4697 2023-07-19 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 4698 4699 vms_make.com: Add `/warn=noinfo` to `CFLAGS`. 4700 4701 This reduces enormously the informationals while compiling on x86_64 (i.e., 4702 which `.h` file is inluded form where). 4703 4704 2023-07-18 Ben Wagner <bungeman@chromium.org> 4705 4706 [woff2] Clean up on large brotli expansion 4707 4708 * src/sfnt/sfwoff2.c (woff2_open_font): set error and goto cleanup 4709 4710 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60711 4711 4712 2023-07-16 Werner Lemberg <wl@gnu.org> 4713 4714 [woff2] Avoid allocation bomb. 4715 4716 This is a fix for commit 85167dbd5, reported as 4717 4718 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60615 4719 4720 * src/sfnt/sfwoff2.c (MAX_SFNT_SIZE): New macro. 4721 (woff2_open_font): Use it to limit the maximum size of an uncompressed WOFF2 4722 font. 4723 4724 2023-07-14 Werner Lemberg <wl@gnu.org> 4725 4726 [cff] Fix compiler warning. 4727 4728 * src/cff/cffparse.c, src/cff/cffparse.h: Make `cff_parse_fixed` a local 4729 function. 4730 4731 2023-07-14 Ben Wagner <bungeman@chromium.org> 4732 4733 [woff2] Remove sfnt size guess check 4734 4735 In WOFF the `totalSfntSize` must be correct, however in WOFF2 this value 4736 is now just a hint and a conforming implementation must not reject 4737 otherwise valid data if the `totalSfntSize` turns out not to be exact. 4738 4739 * src/sfnt/sfwoff2.c (woff2_open_font): remove check that uncompressed 4740 woff2 data would fit in the sfnt size guess. 4741 4742 Fixes: #1235 4743 4744 2023-07-14 Skef Iterum <github@skef.org> 4745 4746 [cff] Make blend operator work with floats in private dicts. 4747 4748 The CFF2 blend operator takes N default values and corresponding 4749 sets of deltas and pushes N values specific to a designspace 4750 location. CFF has a floating point numeric type and the FreeType 4751 blending code was not converting those into its internal 16.16 4752 Fixed type format. 4753 4754 Fixes #1243. 4755 4756 * src/cff/cffparse.c (do_fixed): Handle floating point numbers. 4757 Also fix scaling overflow check for integer-to-fixed conversion. 4758 4759 * src/cff/cffload.c (cff_blend_doBlend): Updated. 4760 4761 2023-07-08 Hin-Tak Leung <htl10@users.sourceforge.net> 4762 4763 * src/truetype/ttgload.c (TT_Hint_Glyph): More mostly cosmetic update. 4764 4765 This is a follow-up to commit 49c74ac02, which creates a new local variable 4766 "exec = loader->exec", and shortening a lot of "loader->exec". This commit 4767 does two more such changes missed in that first commit. 4768 4769 2023-07-06 Hugh McMaster <hugh.mcmaster@outlook.com> 4770 4771 [gzip] Don't compile internal zlib development files when using system zlib. 4772 4773 `src/gzip/rules.mk` compiles the internal zlib sources even when using the 4774 zlib development files provided by a host system. If the internal zlib 4775 development files are not present, FreeType fails to build from source. 4776 4777 This patch ensures the internal zlib development files are only 4778 prerequisites when not using zlib development files on a host system. 4779 4780 * src/gzip/rules.mk (GZIP_DRV_SRCS): Define conditionally. 4781 4782 2023-06-24 Werner Lemberg <wl@gnu.org> 4783 4784 * Version 2.13.1 released. 4785 ========================== 4786 4787 Tag sources with `VER-2-13-1'. 4788 4789 * docs/VERSION.TXT: Add entry for version 2.13.1. 4790 * docs/CHANGES: Updated. 4791 * docs/release, docs/README, builds/macs/README: Updated. 4792 4793 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 4794 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 4795 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 4796 docs/freetype-config.1: s/2.13.0/2.13/1/, s/2130/2131/. 4797 4798 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. 4799 4800 * builds/unix/configure.raw (version_info): Set to 26:0:20. 4801 * CMakeLists.txt (VERSION_PATCH): Set to 1. 4802 4803 * subprojects/libpng.wrap, subprojects/zlib.wrap, subprojects/dlg: Updated. 4804 4805 2023-06-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 4806 4807 Comment fixes. 4808 4809 2023-06-09 Werner Lemberg <wl@gnu.org> 4810 4811 [sdf] Correct handling of empty glyphs. 4812 4813 This is a refinement of commit 7b3ebb9. 4814 4815 * src/sdf/ftsdfrend.c (ft_sdf_render): Goto 'Exit' instead of directly 4816 returning. 4817 (fd_bsdf_render): Ditto, also taking care of setting `FT_GLYPH_OWN_BITMAP` 4818 correctly. 4819 4820 2023-06-05 Ben Wagner <bungeman@chromium.org> 4821 4822 Mark FT_Renderer_Class::raster_class as pointer to const 4823 4824 The `FT_DEFINE_RASTER_FUNCS` macro declares a `const FT_Raster_Funcs`. 4825 The address of the definition is taken and assigned to 4826 `FT_Renderer_Class::raster_class` which is currently `FT_Raster_Funcs*`. 4827 Until recently the `const` was cast away and with the removal of the 4828 cast there are now warnings about dropping this `const`. Instead of 4829 adding back the casts, make `FT_Renderer_Class::raster_class` a pointer 4830 to const, as is done with pointers in other interfaces. 4831 4832 * include/freetype/ftrender.h (FT_Renderer_Class_): mark `raster_class` 4833 as const. 4834 4835 2023-06-03 Ben Wagner <bungeman@chromium.org> 4836 4837 Fix some `FT_Fixed` vs. `FT_Long` confusion. 4838 4839 `FT_Fixed` and `FT_Long` are both typedef'ed to be `signed long`. However, 4840 `FT_Fixed` implies that the lower 16 bits are being used to express 4841 fractional values and so these two types should not be confused. 4842 4843 * include/freetype/internal/services/svmm.h (FT_Set_MM_Blend_Func): Use 4844 `FT_Fixed` for `coords`. Users are passing `FT_Fixed` and implementations 4845 are taking `FT_Fixed`. 4846 (FT_Get_MM_Blend_Func): Ditto. 4847 4848 * src/autofit/afcjk.c (af_cjk_metrics_check_digits): Use `FT_Long` for 4849 `advance` and `old_advance`. `advance`'s address is passed as `FT_Long*` to 4850 `af_shaper_get_elem`, which writes the advance in em units (not fixed). The 4851 exact value is not important here as it is only compared to check whether it 4852 has changed. 4853 4854 * src/autofit/aflatin.c (af_latin_metrics_check_digits): Ditto. 4855 4856 2023-06-03 Ben Wagner <bungeman@chromium.org> 4857 4858 */*: Remove many function pointer casts. 4859 4860 In C it is undefined behavior to call a function through a function pointer 4861 of a different type. This is now detected by the Control Flow Integrity 4862 Sanitizer. All known issues have already been fixed. Prevent any 4863 accidental re-introduction by removing function pointer casts when defining 4864 services. The services will call the service functions through the function 4865 pointers on the service. As a result the functions must have the same type 4866 so there should be no need to cast. Removing the casts allows compilers to 4867 warn about assignment to an incompatible function pointer type. 4868 4869 2023-06-03 Werner Lemberg <wl@gnu.org> 4870 4871 Minor formatting. 4872 4873 2023-05-23 Werner Lemberg <wl@gnu.org> 4874 4875 Replace `sprintf` with `snprintf`. 4876 4877 Fixes #1233. 4878 4879 * include/freetype/config/ftstdlib.h (ft_sprintf): Replace with... 4880 (ft_snprintf): This new macro. 4881 4882 * src/autofit/afhints.c (af_print_idx): Add argument to pass the buffer 4883 size. 4884 (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, 4885 af_glyph_hints_dump_edges): Updated. 4886 4887 * src/bdf/bdflib.c (BUFSIZE): New macro. 4888 (bdf_parse_properties_, bdf_parse_start_): Use `ft_snprintf`. 4889 4890 * src/tools/ftrandom/ftrandom.c (do_test): Use `snprintf`. 4891 4892 2023-05-23 Werner Lemberg <wl@gnu.org> 4893 4894 docs/DEBUG: Formatting. 4895 4896 2023-05-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 4897 4898 [doc] Type1 GX (sfnt-wrapped Type1) is not supported. 4899 4900 * docs/formats.txt: Clarify the reference of Type1 GX, 4901 and state that this format is not supported. This 4902 is because the content `TYP1' table is not exactly same 4903 with the Type1 font format specification; no eexec 4904 encryption is used. For detail and concrete examples, 4905 see the analysis on: 4906 4907 https://gitlab.freedesktop.org/freetype/freetype/-/issues/1231 4908 4909 2023-05-19 Craig White <gerzytet@gmail.com> 4910 4911 Add missing end quote of a string in the example code of FT_Trace_Set_Level 4912 4913 2023-05-19 Seigo Nonaka <nona@google.com> 4914 4915 [truetype] Reduce heap allocation of `deltaSet` variation data. 4916 4917 `deltaSet` is an array of packed integers that can be 32 bits, 16 bits, or 4918 8 bits. Before this change, these values were unpacked to 32-bit integers. 4919 However, this can cause big heap allocations, e.g., around 500 KByte for 4920 'NotoSansCJK'. To reduce this amount, store the packed integers and unpack 4921 them just before passing to the calculation. At calculation time, due to 4922 the variable length of region indices, temporary heap allocations are 4923 necessary. This heap allocation is not negligible and visible in `ftbench` 4924 results. So, use stack-allocated arrays for short array calculations. 4925 4926 Fixes #1230. 4927 4928 * include/freetype/internal/ftmmtypes.h (GX_ItemVarDataRec): New fields 4929 `wordDeltaCount` and `longWords`. 4930 4931 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Load packed 4932 data. 4933 (tt_var_get_item_delta): Unpack data before applying. 4934 4935 2023-05-17 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 4936 4937 vms_make.com: Create shared executable for x86 version of OpenVMS. 4938 4939 2023-05-15 Werner Lemberg <wl@gnu.org> 4940 4941 Add new load flag `FT_LOAD_NO_SVG`. 4942 4943 Modern color fonts often contain both an 'SVG' and 'COLR' table. FreeType 4944 always preferred 'SVG' over 'COLR' (this was a design decision), however, 4945 this might not be the right choice for the user. The new flags makes 4946 FreeType ignore the 'SVG' table while loading a glyph. 4947 4948 Fixes #1229. 4949 4950 * include/freetype/freetype.h (FT_LOAD_NO_SVG): New macro. 4951 4952 * src/base/ftobjs.c (FT_Load_Glyph), src/cff/cffgload.c (cff_slot_load), 4953 src/truetype/ttgload.c (TT_Load_Glyph): Use it. 4954 4955 2023-05-13 Werner Lemberg <wl@gnu.org> 4956 4957 .mailmap: Updated. 4958 4959 2023-05-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4960 4961 [cache] Merge functions. 4962 4963 * src/cache/ftccache.c (FTC_Cache_Init): Merge into... 4964 (ftc_cache_done): ... this function, with unnecessary checks removed. 4965 4966 2023-05-13 Alexei Podtelezhnikov <apodtele@gmail.com> 4967 4968 [cache] Minor casting and cosmetic updates. 4969 4970 * src/cache/ftcglyph.c (ftc_gcache_{init,done}): Remove casting. 4971 (FTC_GCache_Lookup): Cosmetic variable renaming. 4972 * src/cache/ftcsbits.c (ftc_snode_compare): Formatting. 4973 4974 2023-05-12 Werner Lemberg <wl@gnu.org> 4975 4976 * include/freetype/ftcache.h: Typo, punctuation. 4977 4978 2023-05-12 Alexei Podtelezhnikov <apodtele@gmail.com> 4979 4980 * include/freetype/ftcache.h: Formatted and updated. 4981 4982 2023-05-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 4983 4984 * include/freetype/internal/t1types.h: Fix the indentation. 4985 4986 2023-05-11 Alexei Podtelezhnikov <apodtele@gmail.com> 4987 4988 [cache] Revise the dynamic hash table accounting. 4989 4990 Instead of counting entries relative to the middle of the hash table, 4991 this switches to the absolute counter with the full index range mask. 4992 As a result, some calculations become a bit simpler. The cache resizing 4993 logic stays largely the same. 4994 4995 * src/cache/ftccache.h (FTC_NODE_TOP_FOR_HASH): Revised with new counter. 4996 * src/cache/ftccache.c (ftc_get_top_node_for_hash): Ditto. 4997 (ftc_cache_resize): Simplify reallocations and stop their zeroing. 4998 (ftc_cache_init): Stop over-allocating but keep zeroing initially. 4999 (FTC_Cache_Clear, FTC_Cache_RemoveFaceID): Updated accordingly. 5000 5001 2023-05-11 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 5002 5003 [t1cid] Set FT_FACE_FLAG_CID_KEYED. 5004 5005 * cidobjs.c (cid_face_init): Set FT_FACE_FLAG_CID_KEYED. 5006 5007 * cidriver.c (cid_get_is_cid): Comment about the case that 5008 is_cid cannot guarantee the glyph collection specification. 5009 5010 2023-05-09 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 5011 5012 * src/smooth/ftgrays.c (FT_SSE2): Don't define for VMS. 5013 5014 2023-05-08 Werner Lemberg <wl@gnu.org> 5015 5016 * src/cff/cffdrivr.c (cff_glyph_load): Fix guard for `size`. 5017 5018 This was forgotten to change in commit 2b54eba36b (in May 2004). 5019 5020 Reported as 5021 5022 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58739 5023 5024 2023-05-08 Werner Lemberg <wl@gnu.org> 5025 5026 Minor compiler warning fixes. 5027 5028 * src/autofit/afcjk.c (af_cjk_get_standard_widths), src/autofit/aflatin.c 5029 (af_latin_get_standard_widths): Use `FT_CALLBACK_DEF`. 5030 5031 * src/cff/cffparse.c (cff_parser_run): Initialize and fix allocation of `q`. 5032 5033 2023-05-08 Werner Lemberg <wl@gnu.org> 5034 5035 * src/psaux/t1cmap.c: Signature fixes. 5036 5037 2023-05-08 Werner Lemberg <wl@gnu.org> 5038 5039 * src/bzip2/ftbzip2.c: Signature fixes. 5040 5041 2023-05-08 Werner Lemberg <wl@gnu.org> 5042 5043 [cache] Signature fixes. 5044 5045 * src/cache/ftcglyph.c, src/cache/ftcglyph.h (FTC_GNode_Compare): Remove 5046 redundant function. It is equivalent to `ftc_gnode_compare` and becomes 5047 completely meaningless with fixed signatures. 5048 Update all callers. 5049 5050 * src/cache/ftcsbits.c, src/cache/ftcsbits.h (FTC_SNode_Compare): Remove 5051 redundant function. It is equivalent to `ftc_snode_compare` and becomes 5052 completely meaningless with fixed signatures. 5053 Update all callers. 5054 5055 2023-05-07 Werner Lemberg <wl@gnu.org> 5056 5057 [sdf] Signature fixes. 5058 5059 2023-05-07 Werner Lemberg <wl@gnu.org> 5060 5061 * src/svg/ftsvg.c: Signature fixes. 5062 5063 2023-05-07 Werner Lemberg <wl@gnu.org> 5064 5065 [raster] Signature fixes. 5066 5067 2023-05-07 Werner Lemberg <wl@gnu.org> 5068 5069 [smooth] Signature fixes. 5070 5071 2023-05-07 Werner Lemberg <wl@gnu.org> 5072 5073 [pshinter] Signature fixes. 5074 5075 * src/pshinter/pshrec.c (t1_hints_close, t1_hints_apply): New wrapper 5076 functions. 5077 (t1_hints_funcs_init): Use them. 5078 (t2_hints_close, t2_hints_apply): New wrapper functions. 5079 (t2_hints_funcs_init): Use them. 5080 5081 2023-05-07 Werner Lemberg <wl@gnu.org> 5082 5083 [autofit] Signature fixes. 5084 5085 2023-05-07 Werner Lemberg <wl@gnu.org> 5086 5087 * src/sfnt/ttcmap: Signature fixes. 5088 5089 2023-05-07 Werner Lemberg <wl@gnu.org> 5090 5091 * src/pcf/pcfdrivr.c: Signature fix. 5092 5093 2023-05-07 Werner Lemberg <wl@gnu.org> 5094 5095 * src/winfonts/winfnt.c: Signature fixes. 5096 5097 2023-05-07 Werner Lemberg <wl@gnu.org> 5098 5099 * src/type42/t42parse.c: Signature fixes. 5100 5101 2023-05-07 Werner Lemberg <wl@gnu.org> 5102 5103 [pfr] Signature fixes. 5104 5105 2023-05-07 Werner Lemberg <wl@gnu.org> 5106 5107 * src/cid/cidload.c: Signature fixes. 5108 5109 2023-05-07 Werner Lemberg <wl@gnu.org> 5110 5111 * src/cff/cffcmap.c: Signature fixes. 5112 5113 2023-05-07 Werner Lemberg <wl@gnu.org> 5114 5115 * src/type1/t1load.c: Signature fixes. 5116 5117 2023-05-07 Werner Lemberg <wl@gnu.org> 5118 5119 [truetype] Signature fixes. 5120 5121 2023-05-07 Werner Lemberg <wl@gnu.org> 5122 5123 [base] Signature fixes. 5124 5125 2023-05-07 Werner Lemberg <wl@gnu.org> 5126 5127 * src/type42/t42drivr.c: Clean up interface. 5128 5129 Ensure that all driver functions use the signature of the service or driver. 5130 This avoids pointer mismatches, which are technically undefined behaviour. 5131 Recent compilers are more picky in catching them as part of Control Flow 5132 Integrity tests. 5133 5134 2023-05-07 Werner Lemberg <wl@gnu.org> 5135 5136 * src/type1/*: Clean up interface. 5137 5138 Ensure that all driver functions use the signature of the service or driver. 5139 This avoids pointer mismatches, which are technically undefined behaviour. 5140 Recent compilers are more picky in catching them as part of Control Flow 5141 Integrity tests. 5142 5143 2023-05-07 Werner Lemberg <wl@gnu.org> 5144 5145 * src/truetype/*: Clean up interface. 5146 5147 Ensure that all driver functions use the signature of the service or driver. 5148 This avoids pointer mismatches, which are technically undefined behaviour. 5149 Recent compilers are more picky in catching them as part of Control Flow 5150 Integrity tests. 5151 5152 2023-05-07 Werner Lemberg <wl@gnu.org> 5153 5154 * src/sfnt/sfdriver.c, src/sfnt/ttbdf.c: Clean up interface. 5155 5156 Ensure that all driver functions use the signature of the service or driver. 5157 This avoids pointer mismatches, which are technically undefined behaviour. 5158 Recent compilers are more picky in catching them as part of Control Flow 5159 Integrity tests. 5160 5161 * src/sfnt/sfdriver.c (sfnt_load_table): New wrapper function. 5162 (sfnt_service_sfnt_table): Use it. 5163 5164 2023-05-07 Werner Lemberg <wl@gnu.org> 5165 5166 * src/psnames/psmodule.c: Use `FT_CALLBACK_DEF`. 5167 5168 2023-05-07 Werner Lemberg <wl@gnu.org> 5169 5170 * src/pfr/pfrdrivr.c: face -> pfrface, pfrface -> face. 5171 5172 2023-05-07 Werner Lemberg <wl@gnu.org> 5173 5174 * src/pcf/pcfdrivr.c: Clean up interface. 5175 5176 Ensure that all driver functions use the signature of the service or driver. 5177 This avoids pointer mismatches, which are technically undefined behaviour. 5178 Recent compilers are more picky in catching them as part of Control Flow 5179 Integrity tests. 5180 5181 2023-05-07 Werner Lemberg <wl@gnu.org> 5182 5183 * src/cid/cidriver.c: Clean up interface. 5184 5185 Ensure that all driver functions use the signature of the service or driver. 5186 This avoids pointer mismatches, which are technically undefined behaviour. 5187 Recent compilers are more picky in catching them as part of Control Flow 5188 Integrity tests. 5189 5190 2023-05-07 Werner Lemberg <wl@gnu.org> 5191 5192 * src/bdf/bdfdrivr.c: Clean up interface. 5193 5194 Ensure that all driver functions use the signature of the service or driver. 5195 This avoids pointer mismatches, which are technically undefined behaviour. 5196 Recent compilers are more picky in catching them as part of Control Flow 5197 Integrity tests. 5198 5199 2023-05-07 Werner Lemberg <wl@gnu.org> 5200 5201 * src/cff/*: Clean up interface. 5202 5203 Ensure that all driver functions use the signature of the service or driver. 5204 This avoids pointer mismatches, which are technically undefined behaviour. 5205 Recent compilers are more picky in catching them as part of Control Flow 5206 Integrity tests. 5207 5208 2023-05-06 Werner Lemberg <wl@gnu.org> 5209 5210 [truetype] Fix style name handling for variation fonts. 5211 5212 * include/freetype/internal/tttypes.h (TT_FaceRec): New field 5213 `non_var_style_name`. 5214 5215 * src/sfnt/sfobjs.c (sfnt_load_face): Initialize `non_var_style_name`. 5216 (sfnt_done_face): Free `non_var_style_name`. 5217 5218 * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Restore non-VF style name 5219 if switching back to non-VF mode. 5220 5221 2023-05-06 Werner Lemberg <wl@gnu.org> 5222 5223 [truetype] Fix PostScript name handling for variation fonts. 5224 5225 A variation font's PostScript name of a named instance is usually different 5226 from the PostScript name of an unnamed instance. However, if a change 5227 between a named instance and an unnamed instance with exactly the same 5228 design axis values happened, it was possible that the PostScript name wasn't 5229 correctly updated. 5230 5231 This commit reorganizes the code to handle this issue within the top-level 5232 API functions, using a new service to trigger recomputation of the 5233 PostScript name. 5234 5235 * include/freetype/internal/services/svmm.h (FT_Construct_PS_Name_Func): New 5236 typedef. 5237 (FT_Service_MultiMasters): New field `construct_ps_name`. 5238 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. 5239 5240 * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, 5241 FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Call 5242 `mm->construct_ps_name` to handle `postscript_name`. 5243 (FT_Set_Named_Instance): Call `mm->construct_ps_name` to handle 5244 `postscript_name`. 5245 Use shortcut. 5246 * src/cff/cffdrivr.c (cff_construct_ps_name): New function. 5247 (cff_service_multi_masters): Updated. 5248 5249 * src/truetype/ttgxvar.c (tt_set_mm_blend): Don't handle `postscript_name`. 5250 (TT_Set_MM_Blend): Simplify. 5251 (TT_Set_Named_Instance): Return -1 if axis values haven't changed. 5252 Don't set `face_index`. 5253 (tt_construct_ps_name): New function. 5254 5255 * src/truetype/ttgxvar.h: Updated. 5256 5257 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. 5258 5259 * src/type1/t1driver.c (t1_service_multi_masters): Updated. 5260 5261 * src/type1/t1load.c (T1_Set_MM_Blend): Simplify. 5262 5263 2023-05-06 Werner Lemberg <wl@gnu.org> 5264 5265 * include/freetype/internal/services/svmm.h: Minor changes. 5266 5267 2023-05-06 Werner Lemberg <wl@gnu.org> 5268 5269 [truetype] Fix deactivation of variation font handling. 5270 5271 According to the documentation, the functions `FT_Set_Named_Instance`, 5272 `FT_Set_MM_Design_Coordinates`, `FT_Set_Var_Design_Coordinates`, and 5273 `FT_Set_Var_Blend_Coordinates` can unset the `FT_FACE_FLAG_VARIATION` flag. 5274 (The same is true for `FT_Set_MM_WeightVector` but this information was 5275 accidentally omitted from the documentation.) 5276 5277 However, if a call of these functions didn't change the axis values this 5278 could fail because internal shortcuts exited too early. 5279 5280 This commit reorganizes the code to handle `FT_FACE_FLAG_VARIATION` in the 5281 top-level API functions, also taking care of the issue at hand. 5282 5283 * src/base/ftmm.c (FT_Set_MM_Design_Coordinates, FT_Set_MM_WeightVector, 5284 FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates, 5285 FT_Set_Var_Blend_Coordinates): Handle `FT_FACE_FLAG_VARIATION`. 5286 5287 * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design, 5288 TT_Set_Named_Instance) Don't handle `FT_FACE_FLAG_VARIATION`. 5289 5290 * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_WeightVector, 5291 T1_Set_MM_Design): Ditto. 5292 5293 * src/cff/cffobjs.c (cff_face_init): Use `FT_Set_Named_Instance` instead of 5294 low-level functions. 5295 5296 * src/truetype/ttobjs.c (tt_face_init): Ditto. 5297 5298 2023-05-06 Werner Lemberg <wl@gnu.org> 5299 5300 s/set_instance/set_named_instance/ 5301 5302 * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func): Renamed 5303 to... 5304 (FT_Set_Named_Instance_Func): ...this. 5305 (FT_Service_MultiMasters): Rename `set_instance` to `set_named_instance`. 5306 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. 5307 5308 * src/base/ftmm.c (FT_Set_Named_Instance): Updated. 5309 5310 * src/cff/cffdrivr.c (cff_set_instance): Renamed to... 5311 (cff_set_named_instance): ...this. 5312 (cff_service_multi_masters): Updated. 5313 * src/cff/cffobjs.c (cff_face_init): Updated. 5314 5315 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. 5316 5317 * src/type1/t1driver.c (t1_service_multi_masters): Updated. 5318 5319 2023-05-06 Werner Lemberg <wl@gnu.org> 5320 5321 New Variation Font function `FT_Get_Default_Named_Instance`. 5322 5323 * include/freetype/ftmm.h, src/base/ftmm.c (FT_Get_Default_Named_Instance): 5324 New function. 5325 5326 * include/freetype/internal/services/svmm.h 5327 (FT_Get_Default_Named_Instance_Func): New typedef. 5328 (FT_Service_MultiMasters): New field `get_default_named_instance`. 5329 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. 5330 5331 * include/freetype/internal/tttypes.h (TT_Face): New field 5332 `var_default_named_instance`. 5333 5334 * src/sfnt/sfobjc.s (sfnt_init_face): Initialize 5335 `var_default_named_instance`. 5336 5337 * src/cff/cffdrivr.c (cff_get_default_named_instance): New function. 5338 (cff_service_multi_masters): Updated. 5339 5340 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize 5341 `var_default_named_instance`. 5342 (TT_Get_Default_Named_Instance): New function. 5343 * src/truetype/ttgxvar.h: Updated. 5344 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. 5345 5346 * src/type1/t1driver.c (t1_service_multi_masters): Updated. 5347 5348 * docs/CHANGES: Updated. 5349 5350 2023-05-06 Werner Lemberg <wl@gnu.org> 5351 5352 [cid] Improve tracing messages; formatting. 5353 5354 2023-05-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5355 5356 * src/cache/ftccache.c (ftc_node_hash_unlink): Minor. 5357 5358 2023-05-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5359 5360 * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Purge backwards. 5361 5362 2023-05-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5363 5364 [cache] Revise list cleansing. 5365 5366 * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Use one loop to 5367 do it. 5368 * src/cache/ftcmanag.c (FTC_Manager_Compress, FTC_Manager_FlushN): 5369 Streamline loops. 5370 5371 2023-05-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 5372 5373 [t1cid] Improve cid_get_cid_from_glyph_index(). 5374 5375 Update cid_get_cid_from_glyph_index() to 5376 return an error and CID=0 in the case that 5377 the specified glyph index points to an invalid 5378 entry. 5379 5380 cidgload.h (cid_compute_fd_and_offsets): 5381 Declare new helper function to set the 5382 fd_select and 2 offsets to access the glyph 5383 description data. 5384 5385 cidgload.c (cid_compute_fd_and_offsets): 5386 Move the part loading fd_select and 2 offsets 5387 from cid_load_glyph() to here. If the loaded 5388 parameters are broken, return the Invalid_Offset 5389 error. This function does not load the glyph 5390 data, only fills these parameters. 5391 5392 (cid_load_glyph): Use new helper function in above. 5393 5394 cidriver.c (cid_get_cid_from_glyph_index): 5395 Check whether the requested glyph index points 5396 to a valid entry, by calling cid_compute_fd_and_offsets(). 5397 If it is valid, fill the cid by the glyph 5398 index (=CID). If it is invalid, return an 5399 error and fill the cid by 0. 5400 5401 2023-04-30 Werner Lemberg <wl@gnu.org> 5402 5403 API documentation: Re-organize chapters and sections 5404 5405 * Split the very long 'Base Interface' section into smaller sections. 5406 * Split the 'Core API' chapter into two chapters. 5407 * Remove single enumeration values from `@order` fields since they have no 5408 effect. 5409 5410 2023-04-29 Alexei Podtelezhnikov <apodtele@gmail.com> 5411 5412 * src/sfnt/pngshim.c (Load_SBit_Png): Remove FALL_THROUGH warning. 5413 5414 2023-04-28 Werner Lemberg <wl@gnu.org> 5415 5416 * src/sfnt/ttload.c (tt_face_load_font_dir): Add another guard. 5417 5418 Reject 'OTTO' fonts with no valid tables. 5419 5420 2023-04-28 Werner Lemberg <wl@gnu.org> 5421 5422 * src/cff/cffdrivr/c (cff_get_ps_name): Avoid unnecessary crash. 5423 5424 The situation can happen if `FT_New_Face` (or one of its siblings) is called 5425 with a negative index to get the number of contained faces, followed 5426 immediately by a call to `FT_Get_Postscript_Name`. While this is not a valid 5427 use of the FreeType library there is no need for a crash. 5428 5429 Fixes #1219. 5430 5431 2023-04-28 Werner Lemberg <wl@gnu.org> 5432 5433 * src/cff/cffdrivr.c (cff_ps_get_font_info): Reject 'CFF2' format. 5434 5435 2023-04-28 Werner Lemberg <wl@gnu.org> 5436 5437 * src/cid/cidgload.c (cid_load_glyph): Fix compiler warnings. 5438 5439 2023-04-28 Werner Lemberg <wl@gnu.org> 5440 5441 Minor documentation updates. 5442 5443 2023-04-27 Werner Lemberg <wl@gnu.org> 5444 5445 * src/ttgxvar.c: Minor changes. 5446 5447 (TT_Get_MM_Var): Improve tracing messages. 5448 (tt_set_mm_blend): Minor speed-up. 5449 5450 2023-04-27 Werner Lemberg <wl@gnu.org> 5451 5452 s/this is,/that is,/ 5453 5454 2023-04-27 Alexei Podtelezhnikov <apodtele@gmail.com> 5455 5456 [bdf] Clean up the atom property parsing. 5457 5458 * src/bdflib.c (bdf_is_atom_): Refactor code with fewer checks. 5459 (bdf_list_join_): Return NULL. 5460 (bdf_add_comment_): Use const argument. 5461 (bdf_get_property): Ditto, ditto, make the function static. 5462 * src/bdf.h (bdf_get_property): Remove prototype. 5463 5464 2023-04-25 Werner Lemberg <wl@gnu.org> 5465 5466 Improve/add source comments and documentation. 5467 5468 2023-04-25 Werner Lemberg <wl@gnu.org> 5469 5470 [sfnt] Fix handling of PS names for Variation Fonts. 5471 5472 * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Continue 5473 construction of string if an invalid character is encountered. 5474 5475 Fixes #1218. 5476 5477 2023-04-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 5478 5479 [t1cid] Change the trace messages of the charstrings retrieval errors. 5480 5481 The t1cid driver catches 3 types of errors in 5482 the charstrings retrieval; 5483 A) The invalid FD number, there are 2 subtypes; 5484 A-1) FD number is the maximum number fitting to FDBytes. 5485 A-2) FD number is greater than num_dicts. 5486 B) Declared length is overrunning. 5487 C) Declared length is invalid (its end is before its head). 5488 5489 Considering that some widely distributed fonts 5490 (e.g., "CJKV" book by O'Reilly) have A-1 errors 5491 in the unimplemented glyphs, the trace level for 5492 A-1 is calmed to level 1. 5493 5494 The errors A-2, B, and C would be irregular; 5495 their trace levels are kept at level 0, but 5496 the updated trace messages include the CID number. 5497 5498 2023-04-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 5499 5500 [truetype] Fix `make multi'. 5501 5502 * src/truetype/ttgxvar.c: Include freetype/internal/services/svmetric.h 5503 for the FT_Service_MetricsVariations type definition. 5504 5505 2023-04-19 Ben Wagner <bungeman@chromium.org> 5506 5507 [services] FT_Size_Reset_Func to return FT_Error 5508 5509 The `MetricsVariations` `FT_Size_Reset_Func` is currently defined to 5510 return `void`, but the implementations return `FT_Error`. Even though 5511 the pointers passed will be the same at runtime, calling a function 5512 through a pointer of a different type from the original function pointer 5513 type is undefined behavior. This may be caught at runtime by Control 5514 Flow Integrity with something like clang's `cfi-icall`. 5515 5516 Issue: https://crbug.com/1433651 5517 5518 * include/freetype/internal/services/svmetric.h (FT_Size_Reset_Func): 5519 return `FT_Error` instead of `void`. 5520 5521 2023-04-17 Ben Wagner <bungeman@chromum.org> 5522 5523 [truetype] tt_size_reset_height to take FT_Size 5524 5525 The `MetricsVariations` `FT_Size_Reset_Func` is defined to take an 5526 `FT_Size`. Because `tt_size_reset_height` is to be used as such a 5527 function, it must also take an `FT_Size` instead of a `TT_Size`. Even 5528 though the pointers passed will be the same at runtime, calling a 5529 function through a pointer of a different type from the original 5530 function pointer type is undefined behavior. This may be caught at 5531 runtime by Control Flow Integrity with something like clang's 5532 `cfi-icall`. 5533 5534 Issue: https://crbug.com/1433651 5535 5536 * src/truetype/ttobjs.h (tt_size_reset_height): take `FT_Size` 5537 5538 * src/truetype/ttobjs.c (tt_size_reset_height): take `FT_Size` and 5539 update documentation 5540 5541 2023-04-13 Werner Lemberg <wl@gnu.org> 5542 5543 * src/truetype/ttinterp.c: Remove outdated comments. 5544 5545 2023-04-11 Ben Wagner <bungeman@chromium.org> 5546 5547 [sfnt, truetype] Add `size_reset` to `MetricsVariations`. 5548 5549 This is a generalization of commit 5550 5551 ``` 5552 commit e6699596af5c5d6f0ae0ea06e19df87dce088df8 5553 Author: Werner Lemberg <wl@gnu.org> 5554 Date: Thu Feb 2 11:38:04 2017 +0100 5555 5556 [truetype] Fix MVAR post-action handling. 5557 ``` 5558 5559 It is also possible for plain `CFF ` style fonts to contain an `fvar` and 5560 `MVAR` table and use `cff_metrics_adjust`. `tt_size_reset` should only be 5561 called with `TT_Size` and never with `CFF_Size`. 5562 5563 Allow the "metrics-variations" service to specify the correct function (if 5564 any) to reset `FT_Size`s after adjusting metrics. 5565 5566 * src/truetype/ttobjs.c (tt_size_reset): Split off some functionality 5567 into... 5568 (tt_size_reset_height): ... this new function. 5569 5570 * src/truetype/ttdriver.c (tt_service_metrics_variations): Add 5571 `size_reset`. 5572 (tt_size_select, tt_size_request): Updated. 5573 5574 * src/truetype/ttobjs.h: Updated. 5575 5576 * include/freetype/internal/services/svmetric.h (MetricsVariations): Add 5577 `size_reset`. 5578 (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Updated. 5579 5580 * include/freetype/internal/tttypes.h (TT_FaceRec_): Rename `var` to 5581 `tt_var` and add `face_var`. 5582 5583 * src/cff/cffdrivr.c (cff_service_metrics_variations): Add `size_reset`. 5584 (cff_hadvance_adjust, cff_metrics_adjust): Updated. 5585 5586 * src/cff/cffobjs.c (cff_face_init): Use `face_var`. 5587 5588 * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `face_var`. 5589 5590 * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `tt_var`. 5591 5592 * src/truetype/ttgxvar.c (tt_size_reset_iterator): Renamed to... 5593 (ft_size_reset_iterator): ... this new function. 5594 Call `size_reset`. 5595 (tt_apply_mvar): Pass `size_reset` to `ft_size_reset_iterator`. 5596 5597 Fixes #1211 5598 5599 2023-04-10 Alexei Podtelezhnikov <apodtele@gmail.com> 5600 5601 * src/cff/cffcmap.c (cff_cmap_encoding_char_next): Abbreviate. 5602 5603 2023-04-10 Alexei Podtelezhnikov <apodtele@gmail.com> 5604 5605 Align `char_next` return types. 5606 5607 This is mostly cosmetic because FT_UInt and FT_UInt32 are likely identical. 5608 5609 * src/sfnt/ttcmap.c, src/cff/cffcmap.c, src/psaux/t1cmap.c, 5610 src/psnames/psmodule.c, include/freetype/internal/service/svpcsmap.h, 5611 src/pfr/pfrcmap.c, src/winfonts/winfnt.c (*_char_next): return FT_UInt. 5612 5613 2023-04-09 Alexei Podtelezhnikov <apodtele@gmail.com> 5614 5615 [sfnt] Clean up CMAP{4,12,13} handling. 5616 5617 This moves the charcode overflow checks upstream and turns some 5618 while-loops into the do-while ones to avoid the uninitialized warnings. 5619 This should slightly reduce the number of checks and jumps. 5620 5621 * src/sfnt/ttcmap.c (tt_cmap{4,12,13}_next, 5622 tt_cmap{4.12.13}_char_map_linear): Remove the charcode overflow check. 5623 (tt_cmap{4,12,13}_char_map_binary): Ditto and use do-while. 5624 (tt_cmap{12,13}_char_next): Add the overflow check. 5625 5626 2023-04-03 Alexei Podtelezhnikov <apodtele@gmail.com> 5627 5628 * src/sfnt/ttpost.c (load_format_25): Do not abort frame reading. 5629 5630 2023-04-03 Alexei Podtelezhnikov <apodtele@gmail.com> 5631 5632 * src/sfnt/ttpost.c (load_format_*): Streamline frame reading. 5633 5634 2023-04-02 Alexei Podtelezhnikov <apodtele@gmail.com> 5635 5636 * src/sfnt/ttpost.c: Formatting and comments. 5637 5638 2023-04-02 Alexei Podtelezhnikov <apodtele@gmail.com> 5639 5640 [sfnt] Consolidate POST version 2.0 and 2.5 (pt 2). 5641 5642 * src/sfnt/ttpost.c (load_format_20, load_format_25): Update arguments 5643 and move shared calls and checks upstream to... 5644 (load_post_names): ... this function. 5645 (tt_face_free_ps_names, tt_face_get_ps_name): Updated. 5646 5647 2023-04-02 Alexei Podtelezhnikov <apodtele@gmail.com> 5648 5649 [sfnt] Consolidate POST version 2.0 and 2.5 (pt 1). 5650 5651 The deprecated POST version 2.5 can be handled using the data 5652 structures of version 2.0. The goal is to reduce the footprint. 5653 5654 * include/freetype/internal/tttypes.h (TT_Post_Names): Absorb and... 5655 (TT_Post_20, TT_Post_25): ... remove these structures. 5656 src/sfnt/ttpost.c (load_post_names, tt_face_get_ps_name, 5657 tt_face_free_ps_names, load_format_20): Updated accordingly. 5658 (load_format_25): ditto and convert offsets to glyph indices. 5659 5660 2023-04-01 Alexei Podtelezhnikov <apodtele@gmail.com> 5661 5662 [sfnt] Miscellaneous POST clean-ups. 5663 5664 * src/sfnt/ttpost.c (load_format_20): Decrease casts. 5665 (load_format_25): Check the table length and impose a theoretical 5666 glyph number limit usable with 8-bit offset. Decrease casts. 5667 (load_post_names): Pass the mapping data length without 2 bytes. 5668 5669 2023-03-30 Alexei Podtelezhnikov <apodtele@gmail.com> 5670 5671 * src/sfnt/ttpost.c (load_format_20): Simplify comutations. 5672 5673 2023-03-29 Alexei Podtelezhnikov <apodtele@gmail.com> 5674 5675 [sfnt] Streamline POST format 2.0 handing (cont'd). 5676 5677 * src/sfnt/ttpost.c (load_format_20): Co-allocate the string data and 5678 their pointers, which makes it easier to handle and free them. 5679 (tt_face_free_ps_names): Updated. 5680 * include/freetype/internal/tttypes.h (TT_Post_20): Update type. 5681 5682 2023-03-20 Alexei Podtelezhnikov <apodtele@gmail.com> 5683 5684 [cff] Simplify `t2_strings` management in the old engine. 5685 5686 * src/cff/cffparse.c (cff_parser_run): Allocate the charstring buffers 5687 and the list nodes together so that they can be freed at once. 5688 (finalize_t2_strings): Removed as no longer needed. 5689 (cff_parser_done): Updated. 5690 5691 2023-03-19 Alexei Podtelezhnikov <apodtele@gmail.com> 5692 5693 [cff] Rework the stream limit checks. 5694 5695 The old stream limit checks, before 6986ddac1ece, were good but 5696 pointless for the crafted t2_strings. Checking limits there is 5697 not necessary as they are created to hold all data. By using two 5698 conditions, we can detect the actual crossing of the stream boundary 5699 as appropriate for the stream pointer only. The t2_strings parsing 5700 will not be triggering these checks. 5701 5702 * src/cff/cffparse.c (cff_parser_within_limits): Removed. 5703 (cff_parse_real, cff_parse_integer): Redesign the stream limit check. 5704 (cff_parse_num, do fixed, cff_parse_fixed_dynamic): Update callers. 5705 5706 2023-03-18 Alexei Podtelezhnikov <apodtele@gmail.com> 5707 5708 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use for-loop. 5709 5710 Even though we never call `TT_Load_Simple_Glyph` with zero contours, 5711 out of abundance of precaution, let's handle this case properly. 5712 5713 2023-03-18 Alexei Podtelezhnikov <apodtele@gmail.com> 5714 5715 [truetype] Clean up zeroing and local variables. 5716 5717 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Avoid zeroing. 5718 (load_truetype_glyph): Avoid zeroing and clean local variables. 5719 5720 2023-03-16 Werner Lemberg <wl@gnu.org> 5721 5722 * include/freetype/ftsystem.h (FT_Stream_IoFunc): Improve documentation. 5723 5724 Fixes #1208. 5725 5726 2023-03-16 Alexei Podtelezhnikov <apodtele@gmail.com> 5727 5728 * src/base/ftsynth.c (FT_GlyphSlot_AdjustWeight): New API. 5729 5730 2023-03-16 Alexei Podtelezhnikov <apodtele@gmail.com> 5731 5732 [truetype] Clean up glyph loading. 5733 5734 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Clean space checking. 5735 (TT_Hint_Glyph): Don't copy the outline structure. 5736 (TT_Process_Simple_Glyph): Cosmetic update. 5737 5738 2023-03-15 Alexei Podtelezhnikov <apodtele@gmail.com> 5739 5740 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Clean up. 5741 5742 2023-03-13 Werner Lemberg <wl@gnu.org> 5743 5744 builds/vms/apinames_vms.bash: Fix `unzip` artifact 5745 5746 The problem occured when unpacking a zip file created on OpenVMS on Linux. 5747 While OpenVMS knows many different file formats, Unix only knows stream-LF 5748 and binary. In principle `zip` on Linux should have translated the file to 5749 stream-LF but failed to do so. That caused the file to incorrectly contain 5750 only one line with control-characters. 5751 5752 2023-03-11 Alexei Podtelezhnikov <apodtele@gmail.com> 5753 5754 [truetype] Fix recent fallout in memory management. 5755 5756 * src/truetype/ttgload.c (TT_Process_Composite_Glyph, 5757 TT_Load_Simple_Glyph): Clean up old instructions regardless of 5758 new ones, postpone setting `control_len` and `control_data` until... 5759 (TT_Load_Glyph): ... the exit from this function. 5760 5761 2023-03-10 Jouk Jansen <joukj@hrem.nano.tudelft.nl> 5762 5763 Update VMS installation support. 5764 5765 2023-03-10 Alexei Podtelezhnikov <apodtele@gmail.com> 5766 5767 * src/truetype/ttgload.c (TT_Hint_Glyph): Mostly cosmetic update. 5768 5769 The number of instructions is now taken from the executed context. 5770 Technically, this means that `control_len` and `control_data` 5771 values are no longer _used_ internally but only expose them. 5772 5773 2023-03-08 Werner Lemberg <wl@gnu.org> 5774 5775 apinames.c: Add comment. 5776 5777 2023-03-07 Werner Lemberg <wl@gnu.org> 5778 5779 [gzip] File `infback.c` is not needed. 5780 5781 * src/gzip/infback.c: Remove. 5782 * src/gzip/rules.mk (GZIP_DRV_SRCS): Updated. 5783 5784 2023-03-07 Werner Lemberg <wl@gnu.org> 5785 5786 [apinames] Fix VMS handling of overly long function names. 5787 5788 Based on ideas from Jouk Jansen <joukj@hrem.nano.tudelft.nl>. 5789 5790 * src/tools/vms_shorten_symbol.c: New file, taken from 5791 5792 https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/vms_shorten_symbol.c 5793 5794 with some minor edits to allow compilation with C++ and being included in 5795 another source code file. 5796 5797 * src/tools/apinames.c: Include `vms_shorten_symbol.c`. 5798 (PROGRAM_VERSION): Set to '0.5'. 5799 (names_dump) [OUTPUT_VMS_OPT]: Call `vms_shorten_symbol` to get unique function 5800 identifiers not longer than 31 characters. 5801 5802 2023-03-07 Werner Lemberg <wl@gnu.org> 5803 5804 * src/tools/apinames.c (panic): Accept variable number of arguments. 5805 5806 2023-03-07 Alexei Podtelezhnikov <apodtele@gmail.com> 5807 5808 * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix leak too. 5809 5810 2023-03-07 Alexei Podtelezhnikov <apodtele@gmail.com> 5811 5812 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Triage memory leak. 5813 5814 This leak has been introduced in the previous commit and immediately 5815 detected: 5816 https://chromium-review.googlesource.com/c/chromium/src/+/4313202 5817 5818 2023-03-06 Alexei Podtelezhnikov <apodtele@gmail.com> 5819 5820 [truetype] Simplify memory management. 5821 5822 Instead of using `Update_Max`, switch to regular FreeType memory 5823 allocation macros, stop pre-allocating the glyph instruction arrays. 5824 5825 * src/truetype/ttgload.c (TT_Load_Simple_Glyph, 5826 TT_Process_Composite_Glyph): Switch to regular memory allocation. 5827 * src/truetype/ttinterp.c (Update_Max): Removed. 5828 (TT_Load_Context): Reallocate stack and free old instructions. 5829 (Modify_CVT_Check, Ins_WS): Switch to regular memory allocation. 5830 * src/truetype/ttinterp.h (Update_Max): Removed. 5831 5832 2023-03-06 David PROVENT <dprovent@annecy-elec.local> 5833 5834 Added information about the zlib version update in the changelog 5835 5836 2023-03-06 Alexei Podtelezhnikov <apodtele@gmail.com> 5837 5838 Fix a couple of MSVC warnings. 5839 5840 * src/base/ftcalc.c (FT_MulAddFix): Add cast. 5841 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Ditto. 5842 5843 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com> 5844 5845 * builds/windows/vc2010/freetype.vcxproj: Suppress C4267 on _WIN64. 5846 5847 This usually comes from `strlen` returning 64-bit `size_t`, which 5848 we often assign to 32-bit `FT_ULong` on Windows-64 (LLP64). 5849 5850 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com> 5851 5852 * src/cff/cffparse.c (cff_parser_run): Thinko. 5853 5854 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com> 5855 5856 [cff] Clean up CharString number encoding. 5857 5858 * src/cff/cffparser.c (cff_parser_run): Work with signed numbers. 5859 5860 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com> 5861 5862 * src/cff/cffparse.c (cff_parser_run): Fix variable type. 5863 5864 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5865 5866 [cff] Clean up memory management in the old engine. 5867 5868 * src/cff/cffparse.c (finalize_t2_strings): Fix NULL-dereferencing 5869 in the out-of-memory situation, use `FT_FREE`. 5870 (cff_parser_run): Use FreeType memory allocation macros and avoid 5871 uninitialized pointers. 5872 5873 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5874 5875 * src/cff/cffobjs.c (cff_size_init): Synonymous change. 5876 5877 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5878 5879 * src/sfnt/sfobjs.c (sfnt_load_face): Shorten de-referencing. 5880 5881 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com> 5882 5883 [pfr] Shorten de-referencing. 5884 5885 * src/pfr/pfrobjs.c (pfr_face_done, pfr_face_init): Use closer `memory`. 5886 * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove `loader`. 5887 5888 2023-03-03 Alexei Podtelezhnikov <apodtele@gmail.com> 5889 5890 * src/cff/cffobjs.c (cff_size_get_globals_funcs): Shorten de-referencing. 5891 5892 2023-03-03 Alexei Podtelezhnikov <apodtele@gmail.com> 5893 5894 [cff,cid,type1] Shorten de-referencing. 5895 5896 * src/cff/cffobjs.c (cff_clot_init): Use immediate library reference. 5897 * src/cid/cidobjs.c (cid_slot_init): Ditto. 5898 * src/type1/t1objs.c (T1_GlyphSlot_Init): Ditto. 5899 5900 2023-03-02 Alexei Podtelezhnikov <apodtele@gmail.com> 5901 5902 * configure: Use `sed` instead of `grep`. 5903 5904 This is more portable and consistent with `autogen.sh`. 5905 5906 2023-03-02 Ben Wagner <bungeman@chromium.org> 5907 5908 Avoid strtol on non-null-terminated data. 5909 5910 Technically, `strtol` can only be used with C strings terminated with 5911 `\0`. CID data is not generally null-terminated and often does not 5912 contain a `\0` if it is hex-encoded. AddressSanitizer with `ASAN_OPTIONS` 5913 containing `strict_string_checks=1` verifies this by using an adversarial 5914 `strtol` that always reads to the terminating `\0`. 5915 5916 To avoid undefined behavior from `strtol` in `cid_parser_new`, use the 5917 parser to parse the tokens instead of attempting to parse them ad-hoc. 5918 This will internally use `PS_Conv_Strtol` to parse the integer, which 5919 respects the parser's limits and directly implements the PostScript 5920 parsing rules for integers. 5921 5922 * src/cid/cidparse.c (cid_parser_new): Use the parser to parse the 5923 tokens. 5924 5925 Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1420329 5926 5927 2023-03-02 Alexei Podtelezhnikov <apodtele@gmail.com> 5928 5929 * src/cff/cffload.c (cff_subfont_load): Synonymous update. 5930 5931 2023-03-01 ubawurinna <ubawurinna-6079@yopmail.com> 5932 5933 * src/gzip/README.freetype: Update version. 5934 5935 2023-03-01 ubawurinna <you@example.com> 5936 5937 [gzip] Fix static linking. 5938 5939 Without this patch, static linking with MS Visual Studio causes linking 5940 errors. 5941 5942 * src/gzip/ftgzip.c: Set `ZEXPORT` to nothing and `ZEXTERN` to static for 5943 all compilers. 5944 5945 2023-03-01 Werner Lemberg <wl@gnu.org> 5946 5947 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update. 5948 5949 This follows 5950 5951 https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00200.html 5952 5953 2023-02-28 Alexei Podtelezhnikov <apodtele@gmail.com> 5954 5955 [truetype] Treat 38 as 40 without Infinality. 5956 5957 * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Reinstate. 5958 * src/truetype/ttdriver.c (tt_property_set): Fallback from 38 to 40. 5959 5960 2023-02-26 Werner Lemberg <wl@gnu.org> 5961 5962 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update. 5963 5964 This follows 5965 5966 https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00159.html 5967 5968 2023-02-26 Werner Lemberg <wl@gnu.org> 5969 5970 * src/*: Replace leading underscores with trailing ones in dummy variables. 5971 5972 This is to avoid clang warnings. 5973 5974 2023-02-26 Karl Berry <karl@freefriends.org> 5975 5976 * configure: Don't hardcode `grep -E`. 5977 5978 TeXLive still supports Solaris 5.10, where the system's `grep` doesn't 5979 accept the `-E` option. We thus introduce an `EGREP` variable that is set 5980 to either `grep -E` or `-egrep`. 5981 5982 2023-02-26 Alexei Podtelezhnikov <apodtele@gmail.com> 5983 5984 * src/cff/cffload.c (cff_encoding_load): Optimize array zeroing. 5985 5986 This is unnecessary for predefined standard and expert encodings. 5987 Even for custom encodings the arrays might be already zeroed when 5988 CFF_FontRec is created but we keep it just in case. 5989 5990 2023-02-25 Alexei Podtelezhnikov <apodtele@gmail.com> 5991 5992 * src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing. 5993 5994 2023-02-25 Tamir Duberstein <tamird@google.com> 5995 5996 * src/base/ftsystem.c (ft_ansi_stream_io): Avoid undefined behaviour. 5997 Also short-circuit on `offset` to avoid checking `count` a second time when 5998 `ft_ansi_stream_io` is used for reading. 5999 6000 Per ISO/IEC 9899: 6001 6002 If an argument to a function has an invalid value (such as a value outside 6003 the domain of the function, or a pointer outside the address space of the 6004 program, or a null pointer, or apointer to non-modifiable storage when the 6005 corresponding parameter is not const-qualified) or a type (after 6006 promotion) not expected by a function with variable number of arguments, 6007 the behavior is undefined. If a function argument is described as being 6008 an array, the pointer actually passed to the function shall have a value 6009 such that all address computations and accesses to objects (that would be 6010 valid if the pointer did point to the first element of such an array) are 6011 in fact valid. 6012 6013 Per IEEE Std 1003.1: 6014 6015 size_t fread(void *restrict ptr, size_t size, size_t nitems, 6016 FILE *restrict stream); 6017 6018 The `fread` function shall read into the array pointed to by `ptr` up to 6019 `nitems` elements whose size is specified by `size` in bytes, from the 6020 stream pointed to by `stream`. 6021 6022 Since the first argument to `fread` is described as being an array, its 6023 behavior is undefined when that argument is a null pointer. 6024 6025 Per the documentation on `ft_ansi_stream_io`: 6026 6027 If `count' is zero (this is, the function is used for seeking), a non-zero 6028 return value indicates an error. 6029 6030 Thus the intent is clear, and the call to `fread` can be skipped, avoiding 6031 undefined behaviour. 6032 6033 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6034 6035 [raster] Clean up contour indexing. 6036 6037 * src/raster/ftraster.c (Decompose_Curve, Convert_Glyph): Use consistent 6038 index types (Int) and compact iterations. 6039 6040 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6041 6042 [autofit] Clean up contour indexing. 6043 6044 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Refactor. 6045 * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Ditto. 6046 6047 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6048 6049 * src/base/ftoutln.c (FT_Outline_Check): Fix C4701 warning. 6050 6051 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6052 6053 * src/sdf/ftsdf.c (get_min_distance_cubic): Fix C4701, typos. 6054 6055 2023-02-20 Alexei Podtelezhnikov <apodtele@gmail.com> 6056 6057 * src/base/ftstroke.c (FT_Stroker_ParseOutline): Clean up contour indexing. 6058 6059 2023-02-20 Alexei Podtelezhnikov <apodtele@gmail.com> 6060 6061 [base] Clean up contour indexing. 6062 6063 * src/base/ftoutln.c (FT_Outline_Reverse, FT_Outline_EmboldenXY, 6064 FT_Outline_Get_Orientation): Set the first and last indexes together. 6065 (FT_Outline_Decompose): Ditto and check them more stringently. 6066 * src/smooth/ftgrays.c (FT_Outline_Decompose)[STANDALONE_]: Ditto. 6067 6068 2023-02-20 Alexei Podtelezhnikov <apodtele@gmail.com> 6069 6070 * src/base/ftoutln.c (FT_Outline_Check): Update error code, clean up. 6071 6072 2023-02-17 Alexei Podtelezhnikov <apodtele@gmail.com> 6073 6074 [truetype] Hide Infinality. 6075 6076 Remove Infinality as an option before its complete extraction. 6077 6078 * include/freetype/ftoption.h: Remove the Infinality option. 6079 * devel/ftoption.h: Ditto. 6080 * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Is 40 now. 6081 6082 2023-02-17 Alex Ringlein <aringlein@figma.com> 6083 6084 * src/base/ftoutln.c (FT_Outline_Reverse): Anchor first contour points. 6085 6086 A cubic contour has to always start from an on-point. Therefore, we 6087 should not swap the first with the last point, which might be off, and 6088 obtain an invalid contour. This does not matter for conic contours. 6089 If anything, it also saves one swap there. Fixes #1207. 6090 6091 2023-02-16 Werner Lemberg <wl@gnu.org> 6092 6093 Documentation improvement for `FT_Bitmap`. 6094 6095 Fixes #1205. 6096 6097 2023-02-10 Alexei Podtelezhnikov <apodtele@gmail.com> 6098 6099 [type1/MM] Round design coordinates. 6100 6101 The design coordinates for MM fonts were not rounded. For example, 6102 `FT_Get_Var_Design_Coordinates` returned values with fractional part. 6103 6104 * src/type1/t1load.c (mm_axis_unmap): Refactor with rounding. 6105 6106 * include/freetype/ftmm.h (FT_Var_Axis, FT_Set_Var_Design_Coordinates, 6107 FT_Get_Var_Design_Coordinates): Reword documentation. 6108 6109 2023-02-09 Jan Alexander Steffens (heftig) <heftig@archlinux.org> 6110 6111 * builds/meson/parse_modules_cfg.py: Handle `gxvalid` and `otvalid`. 6112 6113 These need a name mapping similar to what was done for other modules, 6114 or linking will fail. 6115 6116 2023-02-09 Werner Lemberg <wl@gnu.org> 6117 6118 * build/toplevel.mk (do_dist): Fix typo. 6119 6120 2023-02-09 Werner Lemberg <wl@gnu.org> 6121 6122 * Version 2.13 released. 6123 ========================== 6124 6125 Tag sources with `VER-2-13-0'. 6126 6127 * docs/VERSION.TXT: Add entry for version 2.13. 6128 * docs/CHANGES: Updated. 6129 6130 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 6131 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 6132 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 6133 docs/freetype-config.1: s/2.12.1/2.13/, s/2121/2130/. 6134 6135 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 13. 6136 (FREETYPE_PATCH): Set to 0. 6137 6138 * builds/unix/configure.raw (version_info): Set to 25:0:19. 6139 * CMakeLists.txt (VERSION_MINOR): Set to 13. 6140 (VERSION_PATCH): Set to 0. 6141 6142 2023-02-09 Alexei Podtelezhnikov <apodtele@gmail.com> 6143 6144 Comment on `FT_GlyphSlot_Slant'. 6145 6146 2023-02-08 Werner Lemberg <wl@gnu.org> 6147 6148 [autofit] Fix 'multi' compilation. 6149 6150 * src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`. 6151 Add ANSI boilerplate code for otherwise empty file. 6152 * src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`. 6153 Use `FT_BEGIN_HEADER` and `FT_END_HEADER`. 6154 Decorate with `FT_LOCAL`. 6155 6156 * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`. 6157 6158 2023-02-08 Werner Lemberg <wl@gnu.org> 6159 6160 Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags. 6161 6162 2023-02-08 Werner Lemberg <wl@gnu.org> 6163 6164 Fix 'fall-through' warning messages. 6165 6166 Modern compilers get more insistent on that... 6167 6168 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Define. 6169 * src/*: Use it instead of `/* fall through */` comments. 6170 6171 2023-02-08 Werner Lemberg <wl@gnu.org> 6172 6173 For debugging, avoid implicit conversion from integer to double. 6174 6175 Otherwise we get zillions of clang 15 warnings. 6176 6177 * src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c, 6178 src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c, 6179 src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c, 6180 src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use 6181 `double` cast in debugging and tracing macros. 6182 6183 2023-02-08 Werner Lemberg <wl@gnu.org> 6184 6185 Avoid reserved identifiers that are globally defined. 6186 6187 This is mandated by the C99 standard, and clang 15 produces zillions of 6188 warnings otherwise. 6189 6190 * devel/ftoption.h, include/freetype/config/ftoption.h, 6191 include/freetype/internal/ftmemory.h, src/autofit/afhints.h, 6192 src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c, 6193 src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c, 6194 src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`. 6195 6196 2023-02-08 Werner Lemberg <wl@gnu.org> 6197 6198 Fix minor clang and clang++ warnings. 6199 6200 2023-02-08 Alexei Podtelezhnikov <apodtele@gmail.com> 6201 6202 [truetype, type1] Additional variation tags. 6203 6204 Sync with 6205 https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags 6206 6207 * src/truetype/ttgxvar.h (TTAG_ital): New tag. 6208 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it. 6209 * src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'. 6210 6211 2023-02-08 Alexei Podtelezhnikov <apodtele@gmail.com> 6212 6213 * src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant. 6214 * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it. 6215 6216 2023-02-08 anuj <95867901+anuj99@users.noreply.github.com> 6217 6218 [sdf] Use 32-bit integers internally. 6219 6220 * src/sdf/ftsdfcommon.h (FT_16D16, FT_26D6): Use 32-bit integers 6221 instead of `FT_Fixed` for internal data types. `FT_Fixed` i.e. 6222 `signed long` is 64-bit on some architectures. 6223 6224 2023-02-07 Werner Lemberg <wl@gnu.org> 6225 6226 docs/CHANGES: Updated. 6227 6228 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com> 6229 6230 Comment on optional ascender and descender. 6231 6232 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com> 6233 6234 * src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender. 6235 6236 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com> 6237 6238 * src/type1/t1afm.c (T1_Read_Metrics): Validate ascender and descender. 6239 6240 The ascender and descender are optional in the AFM specifications. 6241 They could be omitted or even set to zero, e.g., in the current release 6242 of URW++ base 35 fonts. 6243 6244 2023-02-02 Werner Lemberg <wl@gnu.org> 6245 6246 * src/cff/cffgload.c (cff_slot_load): Avoid memory leak. 6247 6248 Fixes issue #1204. 6249 6250 2023-02-01 Werner Lemberg <wl@gnu.org> 6251 6252 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Check `face->blend`. 6253 6254 Reported as 6255 6256 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55581 6257 6258 2023-02-01 Werner Lemberg <wl@gnu.org> 6259 6260 * docs/CHANGES: Add news for 'freetype-demos'. 6261 6262 2023-01-30 Werner Lemberg <wl@gnu.org> 6263 6264 * subprojects/harfbuzz.wrap, subprojects/libpng.wrap: Updated. 6265 6266 2023-01-28 Werner Lemberg <wl@gnu.org> 6267 6268 Minor changes. 6269 6270 Comment fixes, typos, removing of unnecessary parentheses. 6271 6272 2023-01-28 Werner Lemberg <wl@gnu.org> 6273 6274 Whitespace. 6275 6276 2023-01-27 Behdad Esfahbod <behdad@behdad.org> 6277 6278 [ttgxvar] Fix crash in COLRv1. 6279 6280 This is a stopgap until issue #1202 is properly fixed. 6281 6282 * src/truetype/ttxgvar.c (tt_var_get_item_delta): Check `normalizedcoords`. 6283 6284 2023-01-19 Werner Lemberg <wl@gnu.org> 6285 6286 The 'COLR' v1 API will no longer be experimental in the next release. 6287 6288 2023-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> 6289 6290 * docs/oldlogs/ChangeLog.210: Typos. 6291 6292 2023-01-18 Ben Wagner <bungeman@chromium.org> 6293 6294 [base] Fix typo. 6295 6296 * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Request module 't1cid', 6297 not 'cid'. 6298 6299 2023-01-18 Ben Wagner <bungeman@chromium.org> 6300 6301 [base] Return error if requested driver is not found. 6302 6303 In `open_face_from_buffer` it is possible that a driver is requested but 6304 FreeType was built without the requested module. Return an error in this 6305 case to indicate that the request could not be satisfied, rather than trying 6306 all existing driver modules. 6307 6308 * src/base/ftobjs.c (open_face_from_buffer): Return `FT_Err_Missing_Module` 6309 if a driver is specified but not found. 6310 6311 2023-01-18 Dominik Röttsches <drott@chromium.org> 6312 6313 [sfnt] Avoid nullptr dereference in reading malformed 'COLR' v1 table. 6314 6315 Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1408044. 6316 6317 * src/sfnt/ttcolr.c (tt_face_load_colr): When the 'COLR' v1 table header is 6318 too small, don't deallocate delta set index map structures. 6319 6320 2023-01-17 Werner Lemberg <wl@gnu.org> 6321 6322 * src/tools/update-copyright: Allow execution from other repositories. 6323 6324 We use this for `freetype-demos`. 6325 6326 2023-01-17 Werner Lemberg <wl@gnu.org> 6327 6328 Update all copyright notices. 6329 6330 2023-01-17 Werner Lemberg <wl@gnu.org> 6331 6332 * src/tools/no-copyright: Updated. 6333 6334 2023-01-17 Ben Wagner <bungeman@chromium.org> 6335 6336 [base] 'close' callback may not use `stream->memory`. 6337 6338 The documentation for `FT_StreamRec::memory` states that it 'shouldn't be 6339 touched by stream implementations'. This is true even for internal 6340 implementations of the 'close' callback, since it is not guaranteed that 6341 `memory` will even be set when the 'close' callback occurs. 6342 6343 * src/base/ftobjs.c (new_memory_stream): stash current `memory` in 6344 `stream->descriptor`. 6345 (memory_stream_close): Use it. 6346 6347 2023-01-17 Ben Wagner <bungeman@chromium.org> 6348 6349 [base] Always close user-provided stream. 6350 6351 The `FT_Open_Face` documentation states 6352 6353 > If `FT_OPEN_STREAM` is set in `args->flags`, the stream in `args->stream` 6354 > is automatically closed before this function returns any error (including 6355 > `FT_Err_Invalid_Argument`). 6356 6357 However, if the user provides a stream in `args.stream` with 6358 `FT_OPEN_STREAM` set and a `close` function, but then for some reason passes 6359 NULL for `aface` and a non-negative `face_index`, the error 6360 `Invalid_Argument` is returned but the `close` callback will not be called 6361 on the user-provided stream. This may cause resource leaks if the caller is 6362 depending on the `close` callback to free resources. 6363 6364 The difficulty is that a user may fill out a `FT_StreamRec` and pass its 6365 address as `args.stream`, but the stream isn't really 'live' until 6366 `FT_Stream_New` is called on it (and `memory` is set). In particular, it 6367 cannot really be cleaned up properly in `ft_open_face_internal` until the 6368 stream pointer has been copied into the `stream` local variable. 6369 6370 * src/base/ftobj.c (ft_open_face_internal): Ensure that user-provided 6371 `args.stream.close` is called even with early errors. 6372 6373 2023-01-17 Ben Wagner <bungeman@chromium.org> 6374 6375 [base] Fix leak of internal stream marked external. 6376 6377 `open_face_from_buffer` allocates a new `FT_Stream` to pass to 6378 `ft_open_face_internal`. Because this is an `FT_OPEN_STREAM`, 6379 `ft_open_face_internal` will mark this as an 'external stream', which the 6380 caller must free. However, `open_face_from_buffer` cannot directly free it 6381 because the stream must last as long as the face. There is currently an 6382 attempt at this by clearing the 'external stream' bit after 6383 `open_face_from_buffer` returns successfully. However, this is too late as 6384 the original stream may have already been closed and the stream on the face 6385 may not be the same stream as originally passed. 6386 6387 It is tempting to use `FT_OPEN_MEMORY` and let `ft_open_face_internal` 6388 create the stream internally. However, with this method there is no means 6389 to pass through a 'close' function to the created stream to free the 6390 underlying data, which must be owned by the stream. 6391 6392 A possibility is to check on success if the stream of the face is the same 6393 as the original stream. If it is then unset the external flag. If not, 6394 then free the original stream. Unfortunately, while no current 6395 implementation does so, it is possible that the face still has the original 6396 stream somewhere other than as the `FT_FaceRec::stream`. The stream needs 6397 to remain available for the life of the face or until it is closed, 6398 whichever comes earlier. 6399 6400 The approach taken here is to let the stream own itself. When the stream is 6401 closed it will free itself. 6402 6403 * src/base/ftobjs.c (memory_stream_close): Free `stream`. 6404 (open_face_from_buffer): Simplify error handling, since 6405 `ft_open_face_internal` always closes `args.stream` on any error. 6406 6407 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54930 6408 6409 2023-01-16 Werner Lemberg <wl@gnu.org> 6410 6411 sr/*.c: Various minor fixes. 6412 6413 * src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after 6414 variable declarations. 6415 6416 * src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate 6417 unused variable. 6418 6419 * src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++ 6420 compiler. 6421 6422 * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid 6423 compiler warning. 6424 6425 * src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning. 6426 6427 2023-01-16 Dominik Röttsches <drott@chromium.org> 6428 6429 [sfnt] Remove temporary runtime flag for variable 'COLR' v1. 6430 6431 Fixes #1187. 6432 6433 * src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr, 6434 tt_face_free_colr, get_deltas_for_var_index_base, 6435 tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro 6436 definition `VARIABLE_COLRV1_ENABLED` and its usage. 6437 6438 * src/truetype/ttdriver.c (tt_property_set): Remove parsing of 6439 'TEMPORARY-enable-variable-colrv1' property name. 6440 6441 * src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1` 6442 flag. 6443 6444 2023-01-07 Werner Lemberg <wl@gnu.org> 6445 6446 * src/autofit/ft-hb.c (_hb_ft_reference_table): Minor integration fixes. 6447 6448 2023-01-07 Ben Wagner <bungeman@chromium.org> 6449 6450 [truetype] Reset cvt and storage in context load. 6451 6452 Currently the cvt and storage are saved and restored in `TT_RunIns`. 6453 However, this is too granular as the cvt and storage area should be set to 6454 the original cvt and storage area only when setting up the hinting context. 6455 This allows for the cvt and storage area to be modified while parsing 6456 multiple glyphs, as is the case with composite glyphs. 6457 6458 * src/truetype/ttinterp.h (TT_ExecContextRec): Remove `origCvt` and 6459 `origStorage`. 6460 6461 * src/truetype/ttinterp.c (TT_RunIns): Don't save and restore the cvt and 6462 storage area. 6463 (Modify_CVT_Check, Ins_WS): Switch from "if in glyph and using original data 6464 do copy on write" to "if in glyph and not using glyph specific data do copy 6465 on write". 6466 6467 2023-01-06 Matthias Clasen <mclasen@redhat.com> 6468 6469 [autofit] Don't depend on 'hb-ft'. 6470 6471 The circular dependency is still there, but at least we no longer depend on 6472 the HarfBuzz API that is only present if HarfBuzz has been built with 6473 FreeType support, making the bootstrapping a bit easier. 6474 6475 * src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing 6476 `_hb_ft_font_create`, which is more or less a verbatim copy of the 6477 corresponding HarfBuzz code from file `hb-ft.cc`. 6478 6479 * src/autofit/afglobal.c (af_face_globals_new): Use it. 6480 * src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`. 6481 * src/autofit/autofit.c: Include `ft-hb.c`. 6482 6483 * LICENSE.TXT: Updated. 6484 6485 2023-01-06 Ben Wagner <bungeman@chromium.org> 6486 6487 [truetype] Keep variation store consistent. 6488 6489 `tt_var_load_item_variation_store` fills out a `GX_ItemVarStore`. While it 6490 may return an error, the item store must be left in a consistent state so 6491 that any use or destruction of the item store can properly use or free the 6492 data in it. Before this change the counts from the font data were read 6493 directly into the item store before the actual allocation of the arrays to 6494 which they referred. There exist many opportunities between the time the 6495 counts are read and the arrays are allocated to return early due to invalid 6496 data. When this happened the item store claimed to have entires it actually 6497 did not, leading to crashes later when it was used. 6498 6499 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54449 6500 6501 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Read the counts 6502 into local variables and store them in the item store only after the related 6503 arrays are actually created on the item store. 6504 6505 2023-01-05 Ben Wagner <bungeman@chromium.org> 6506 6507 [base] Report used stream's external status. 6508 6509 In `open_face` the initial stream is set on the face, along with the 6510 information about if FreeType is the owner of the stream object itself. The 6511 loaders may in the course of their work replace this stream with a new 6512 stream (as is the case for 'woff' and 'woff2'), which may have a different 6513 ownership than the initial stream object (likely the original stream object 6514 is owned by the user and is external, while the new stream object is created 6515 internally to FreeType and is internal). When the stream is replaced, the 6516 face's flags are updated with the new ownership status. 6517 6518 However, `open_face` cannot itself free this stream as its caller 6519 `ft_open_face_internal` is responsible for this. In addition, in the case 6520 of an error `open_face` cannot return an actual face with the new stream and 6521 its ownership status to the caller. As a result, it must pass this 6522 information back to the caller as a sort of "failed face" so that the caller 6523 can clean up. 6524 6525 `open_face` was already passing back the new stream but was not passing back 6526 the stream ownership information. As a result the stream may not have been 6527 free'd when needed. 6528 6529 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54700 6530 6531 * src/base/ftobjs.c (open_face): Pass back the ownership information as 6532 well. 6533 (ft_open_face_internal): Updated. 6534 6535 2023-01-05 Noah Cabral <cnoah1705@gmail.com> 6536 6537 fix spelling err in LICENSE.txt 6538 6539 2023-01-05 Dominik Röttsches <drott@chromium.org> 6540 6541 [sfnt] Fix color stop bounds check calculation at table end. 6542 6543 Fixes https://bugs.chromium.org/p/skia/issues/detail?id=14021 6544 6545 * src/sfnt/ttcolr.c (VAR_IDX_BASE_SIZE): New macro. 6546 (tt_face_get_colorline_stops): Fix off-by-one bounds check calculation, take 6547 `VarColorStop` into account, and hopefully make it easier to read. 6548 6549 2023-01-05 Alexei Podtelezhnikov <apodtele@gmail.com> 6550 6551 * src/base/ftobjs.c (FT_Request_Metrics): Avoid division by zero. 6552 6553 The division-by-zero might happen in broken fonts (see #1194). 6554 Instead of returning a huge number from FT_DivFix and failing 6555 to scale later, we now bail immediately. 6556 6557 2022-12-20 Alexei Podtelezhnikov <apodtele@gmail.com> 6558 6559 [psaux] Delay the upem validity assertion. 6560 6561 Fixes #1194. 6562 6563 * src/psaux/psft.c (cf2_getUnitsPerEm): Remove the upem assert. 6564 (cf2_checkTransform): Assert the upem validity after checking the scale. 6565 6566 2022-12-14 David Vanderson <david.vanderson@gmail.com> 6567 Werner Lemberg <wl@gnu.org> 6568 6569 [gzip] Make static compilation not leak global symbols. 6570 6571 * src/gzip/ftgzip.c (HAVE_HIDDEN): Do not define; it is no longer needed 6572 because everything is static. 6573 (HAVE_MEMCPY): Define. 6574 (zcalloc, zcfree): Remove no longer needed definitions (because `Z_SOLO` is 6575 active). 6576 6577 * src/gzip/patches/freetype-zlib.diff: Regenerated. 6578 6579 Fixes #1146. 6580 6581 2022-12-14 Werner Lemberg <wl@gnu.org> 6582 6583 * src/gzip/ftzconf.h: Updated to zlib 1.2.13. 6584 6585 I forgot to copy that file. 6586 6587 2022-12-14 Werner Lemberg <wl@gnu.org> 6588 6589 * builds/unix/configure.raw: Don't check for `memcpy` and `memmove`. 6590 6591 We expect a C99 compiler, and both functions are part of this standard. 6592 6593 2022-12-13 Werner Lemberg <wl@gnu.org> 6594 6595 [sdf, sfnt] Handle minor compiler warnings. 6596 6597 * src/sdf/ftsdf.c (get_min_distance_conic): Initialize `nearest_point`. 6598 6599 * src/sfnt/ttsvg.c (find_doc): Initialize `mid_doc`. 6600 6601 Fixes #1195. 6602 6603 2022-12-07 Werner Lemberg <wl@gnu.org> 6604 6605 * subprojects/zlib.wrap: Micro-update from upstream. 6606 6607 2022-12-06 Jiří Malák <malak.jiri@gmail.com> 6608 6609 * include/freetype/internal/ftcalc.h (FT_MSB): Support Open Watcom 2.0. 6610 6611 Closes !232. 6612 6613 2022-11-23 Luca Bacci <luca.bacci982@gmail.com> 6614 6615 * src/base/ftdbgmem.c (ft_mem_source_compare): Add FT_COMPARE_DEF. 6616 6617 Closes !230. 6618 6619 2022-11-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6620 6621 * src/autofit/afloader.c (af_loader_load_glyph): Remove `size` check. 6622 6623 This is done by `FT_Load_Glyph`. 6624 6625 2022-11-18 Alexei Podtelezhnikov <apodtele@gmail.com> 6626 6627 Comments added. 6628 6629 2022-11-16 Johan Matsson <mjunix@ at github> 6630 6631 * src/autofit/afloader.c (af_loader_load_glyph): Fix dereference. 6632 6633 This must happen after the NULL check. 6634 6635 Taken from 6636 6637 https://github.com/freetype/freetype/pull/2 6638 6639 2022-11-15 Alexei Podtelezhnikov <apodtele@gmail.com> 6640 6641 * src/pcf/pcfutil.c ({Two,Four}ByteSwap): Use builtins or shifts. 6642 6643 We trust glibc which uses shifts or builtins to swap bytes. This 6644 must be more efficient. 6645 6646 2022-11-14 Werner Lemberg <wl@gnu.org> 6647 6648 * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Integer overflow. 6649 6650 Reported as 6651 6652 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50462 6653 6654 2022-11-14 Loïc Yhuel <loic.yhuel@softathome.com> 6655 6656 [meson] Use generated ftmodule.h 6657 6658 ftmodule.h is generated at the root of the build directory, but FT_CONFIG_MODULES_H 6659 (freetype/config/ftmodule.h) is used instead. 6660 This makes the build fail when disabling modules in modules.cfg. 6661 6662 * meson.build (harfbuzz_dep): Add '-DFT_CONFIG_MODULES_H=<ftmodule.h>'. 6663 6664 2022-11-14 Loïc Yhuel <loic.yhuel@softathome.com> 6665 6666 [meson] Fix generated ftmodule.h 6667 6668 The sdf module wasn't recognized, so the generated ftmodule.h had "None_renderer_class". 6669 6670 * builds/meson/parse_modules_cfg.py: Handle sdf in RASTER_MODULES. 6671 6672 2022-11-12 Dominik Röttsches <drott@chromium.org> 6673 6674 Add `TT_CONFIG_OPTION_NO_BORING_EXPANSION` configuration macro. 6675 6676 This gives users a possibility to deactivate new features not (yet) in the 6677 OpenType standard. 6678 6679 * include/freetype/config/ftoption.h, devel/ftoption.h 6680 (TT_CONFIG_OPTION_NO_BORING_EXPANSION): New macro. 6681 6682 * src/truetype/ttgxvar.c (ft_var_load_avar): Use it to disable 'avar' 6683 version 2.0 support. 6684 6685 2022-11-12 Behdad Esfahbod <behdad@behdad.org> 6686 6687 [truetype] Improve bounds checks for `ItemVariationStore`. 6688 6689 * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Move bounds check ... 6690 (tt_var_get_item_delta): ... to this function, because it is safer. For 6691 example, the 'avar' table 2.0 codepath was not performing a bounds check at 6692 all. 6693 6694 2022-11-12 Behdad Esfahbod <behdad@behdad.org> 6695 6696 [truetype] In `ItemVariationStore`, value 0xFFFF for `dataCount` is valid. 6697 6698 It corresponds to outer indices of 0 to 0xFFFE. 6699 6700 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Remove invalid 6701 code. 6702 6703 2022-11-11 Alexei Podtelezhnikov <apodtele@gmail.com> 6704 6705 [pcf] Improve CMap efficiency and readability. 6706 6707 * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Check and walk 6708 the encoding array indexes. 6709 6710 2022-11-10 Sam James <sam@gentoo.org> 6711 6712 Fix `-Wstrict-prototypes`. 6713 6714 * builds/unix/configure.raw: Fix `-Wstrict-prototypes`. 6715 Clang 16 warns on these and they will be dropped in C23. 6716 6717 * builds/unix/freetype2.m4: Ditto. 6718 6719 2022-11-09 Ben Wagner <bungeman@chromium.org> 6720 6721 [truetype] Check avar_segment before access 6722 6723 * src/truetype/ttgxvar.c (tt_done_blend): check `avar_segment` before 6724 accessing to free its `correspondence`. 6725 6726 Reported as: 6727 6728 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53062 6729 6730 2022-11-09 Ben Wagner <bungeman@chromium.org> 6731 6732 [truetype] Restore behavior of ft_var_load_hvvar 6733 6734 * src/truetype/ttgcvar.c (ft_var_load_hvvar): restore previous behavior 6735 6736 In a previous change [0] the behavior of `ft_var_load_hvvar` was changed 6737 to not load the item variation store if it was at offset 0, but not 6738 return an error when this happened. This broke any users, like 6739 `tt_hvadvance_adjust`, that rely on successful completion of 6740 `ft_var_load_hvvar` to imply that returned table's `itemStore` had been 6741 initialized. This lead such users to dereference NULL. 6742 6743 This change appears to have been unintentional and unrelated to the 6744 actual avar2 changes. As a result, fix these NULL dereferences by 6745 restoring the code to always attempt to initialize the `itemStore`. 6746 6747 [0] ae4eb996 "[truetype] Add support for `avar` table 2.0 format." 6748 6749 Reported as 6750 6751 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53061 6752 6753 2022-11-08 Werner Lemberg <wl@gnu.org> 6754 6755 docs/CHANGES: Updated. 6756 6757 2022-11-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 6758 6759 [build] use AC_CHECK_PROG() macro for libpng-config detection 6760 6761 * builds/unix/configure.raw: use AC_CHECK_PROG() instead of `which` to find `libpng-config`. 6762 6763 2022-11-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 6764 6765 [build] fix for make multi 6766 6767 Fix "make multi" by MR !223 6768 6769 * include/freetype/internal/services/svmm.h: include ftmm.h to define FT_Get_MM_Func. 6770 * src/truetype/ttgxvar.h: include ftmmtypes.h to use GX_AVarTable properly. 6771 * src/base/ftmac.c: include ftdebug.h to use FT_THROW() properly. 6772 6773 2022-11-08 Alexei Podtelezhnikov <apodtele@gmail.com> 6774 6775 * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Accelerate the search. 6776 6777 This is mostly for consistency because PFR fonts with bitmap strikes 6778 do not seem to exist. 6779 6780 2022-11-06 Alexei Podtelezhnikov <apodtele@gmail.com> 6781 6782 [bdf, pfr, psnames] Accelarate charmap searches. 6783 6784 The binary searches within charmaps can be accelerated because they 6785 often contain dense continuous blocks of character codes. Within such 6786 blocks, you can predict matches based on misses. This method has been 6787 deployed in `bdf` since 0f122fef34; we only refactor it there. We now 6788 use it in `pfr` and `psnames`, which speeds up the unicode charmap 6789 access by about 50% in PFR and Type 1 fonts. 6790 6791 * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Refactor. 6792 * src/pfr/pfrcmap.c (pfr_cmap_char_{index,next}): Predict `mid` based 6793 on the mismatch distance. 6794 * src/psnames/psmodule.c (ps_unicodes_char_{index,next}): Ditto. 6795 6796 2022-11-04 Behdad Esfahbod <behdad@behdad.org> 6797 6798 [truetype] Add support for `avar` table 2.0 format. 6799 6800 See 6801 6802 https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2.md 6803 6804 for the specification. 6805 6806 Currently, this is implemented only in most recent OS versions on Apple 6807 platforms and in the HarfBuzz library, but it is expected to be added to the 6808 OpenType standard soon. 6809 6810 * src/truetype/ttgxvar.h (GX_AVarTableRec): New structure. 6811 (GX_BlendRec): Use it to replace `avar_segment` with `avar_table`. 6812 6813 * src/truetype/ttgxvar.c (ft_var_load_avar): Load new table version. 6814 (ft_var_to_normalized, tt_done_blend): Extend for new format. 6815 (ft_var_load_hvvar, ft_var_to_design): Updated. 6816 6817 2022-10-24 Werner Lemberg <wl@gnu.org> 6818 6819 Replace '1/64th' (and similar entries) with '1/64' in docs and comments. 6820 6821 2022-10-24 Ivan Panchenko <ivanpan3@gmail.com> 6822 6823 * include/freetype/*: Fix documentation typos. 6824 6825 2022-10-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6826 6827 * src/truetype/ttgload.c: Cosmetic changes. 6828 6829 2022-10-21 Alexei Podtelezhnikov <apodtele@gmail.com> 6830 6831 [cff, truetype] Simplify SVG metrics scaling. 6832 6833 Use pre-calculated scaling factors. Also, the advance widths used 6834 to be rounded, which was incorrect. 6835 6836 * src/cff/cffgload.c (cff_slot_load): Use `x_scale` and `y_scale`. 6837 * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. 6838 6839 2022-10-20 Werner Lemberg <wl@gnu.org> 6840 6841 * subprojects/zlib.wrap: Update to zlib version 1.2.13. 6842 6843 2022-10-18 Dominik Röttsches <drott@chromium.org> 6844 6845 [sfnt] Additional bounds checks for `COLR` v1 table handling. 6846 6847 * src/sfnt/ttcolr.c (read_paint): Add `colr` argument, necessary for... 6848 ... another use of `ENSURE_READ_BYTES`. 6849 Update callers. 6850 (tt_face_get_paint_layers): Ensure that the 4-byte paint table 6851 offset can be read. 6852 6853 This is a follow-up to !124 and issue 6854 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404 6855 6856 2022-10-18 Werner Lemberg <wl@gnu.org> 6857 6858 [gzip] Update sources to zlib 1.2.13. 6859 6860 2022-10-18 Alexei Podtelezhnikov <apodtele@gmail.com> 6861 6862 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Simplify calculations. 6863 6864 2022-10-18 Werner Lemberg <wl@gnu.org> 6865 6866 Minor formatting. 6867 6868 2022-10-18 Dominik Röttsches <drott@chromium.org> 6869 6870 [sfnt] Guard individual `COLR` v1 paint field reads. 6871 6872 * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): New macro. 6873 (read_paint): Use it – after the start pointer `p` has been checked for 6874 whether it allows reading the format byte, each successive paint table field 6875 read need to be bounds-checked before reading further values. 6876 6877 Reported as 6878 6879 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404 6880 6881 2022-10-17 Xiang Xiao <xiaoxiang@xiaomi.com> 6882 6883 * builds/toplevel.mk: Prefix all paths with `$(TOP_DIR)/`. 6884 6885 This is useful for builds that are not started from the root directory. 6886 6887 2022-10-17 Liu Kunpeng(柳鲲鹏) <liukunpeng@ts-it.cn> 6888 6889 * src/base/ftsynth.c (FT_GlyphSlot_Slant): New API with custom slant. 6890 * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Declare it. 6891 6892 2022-10-15 Alexei Podtelezhnikov <apodtele@gmail.com> 6893 6894 Note the lack of floating-point data types. 6895 6896 2022-10-10 Werner Lemberg <wl@gnu.org> 6897 6898 [cff] Remove `FT_CONFIG_OPTION_NO_GLYPH_NAMES`. 6899 6900 This ancient option stayed completely undocumented. Given that the 'cff' 6901 driver requires the 'psnames' module, it makes no sense today to have this 6902 macro. 6903 6904 * src/cff/cffdrivr.c (cff_services), src/cff/cffobjs.c (cff_face_init): 6905 Remove corresponding conditional code. 6906 6907 2022-10-10 Werner Lemberg <wl@gnu.org> 6908 6909 Synchronize `ftoption.h` flavours. 6910 6911 2022-10-10 Werner Lemberg <wl@gnu.org> 6912 6913 Minor comment changes. 6914 6915 2022-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 6916 6917 Improve FT_Get_Name_Index docs and place it next to FT_Get_Glyph_Name. 6918 6919 2022-10-04 Alexei Podtelezhnikov <apodtele@gmail.com> 6920 6921 [autofit] Reset the face charmap directly. 6922 6923 There is no need to validate the original charmap in `FT_Set_Charmap`. 6924 It can be reset directly. 6925 6926 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): 6927 Use direct assignment. 6928 * src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto. 6929 6930 2022-10-04 Alexei Podtelezhnikov <apodtele@gmail.com> 6931 6932 * src/type1/t1afm.c (T1_Read_PFM): Set charmaps directly. 6933 6934 As with the previous commit, we can avoid the validation checks 6935 of `FT_Set_Charmap` and set it directly when choosing from the 6936 available list. 6937 6938 2022-10-03 Alexei Podtelezhnikov <apodtele@gmail.com> 6939 6940 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`. 6941 6942 Set charmap aggressively without all validations of `FT_Set_Charmap` 6943 because we take it from the available array and only temporarily. 6944 Even CMap Format 14 will gracefully return 0. 6945 6946 2022-10-03 Alexei Podtelezhnikov <apodtele@gmail.com> 6947 6948 * src/cache/ftcbasic.c (ftc_basic_family_get_count): Remove redundancy. 6949 6950 2022-09-30 Werner Lemberg <wl@gnu.org> 6951 6952 * src/psaux/pshints.c (cf2_hintmap_insertHint): Fix midpoint computation. 6953 6954 Replace '(start + end) / 2' with 'start + (end - start) / 2' to avoid 6955 overflow. 6956 6957 Fixes #1180. 6958 6959 2022-09-30 Werner Lemberg <wl@gnu.org> 6960 6961 * src/psaux/pshints.c (cf2_hintmap_build): Improve debugging output. 6962 6963 2022-09-29 mlugg <mlugg@mlugg.co.uk> 6964 6965 [truetype] Fix undefined pointer arithmetic. 6966 6967 * src/truetype/ttgxvar.c (tt_var_get_item_delta, ft_var_load_mvar): Use 6968 `FT_OFFSET`. 6969 6970 2022-09-29 Alexei Podtelezhnikov <apodtele@gmail.com> 6971 6972 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Use lighter FT_DivFix. 6973 6974 2022-09-29 Ali Chraghi <alichraghi@pm.me> 6975 6976 [base] FT_Attach_Stream: Make `parameters` argument constant. 6977 6978 2022-09-29 Azamat Hackimov <azamat.hackimov@gmail.com> 6979 6980 * src/tools/*.py: Migrate to Python 3. 6981 6982 Fixes #1185, closes !205. Formatting changes according to PEP8. 6983 6984 2022-09-27 Dominik Röttsches <drott@chromium.org> 6985 6986 [sfnt] Guard access in 'COLR' table when requesting child table pointer. 6987 6988 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Tighten 6989 pointer bounds checks. 6990 (get_child_table_pointer): Check whether incoming pointer `p` lies within 6991 the 'COLR' table. 6992 6993 Reported as 6994 6995 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51816 6996 6997 2022-09-27 Ben Wagner <bungeman@chromium.org> 6998 6999 [sfnt] Add SVG document bounds checking. 7000 7001 Add a check that the document content is actually contained within the 7002 `SVG ` table. Without this check a malformed font may claim arbitrary 7003 memory as its document content. 7004 7005 * src/sfnt/ttsvg.c (tt_face_load_svg): Take `numEntries` into account when 7006 testing 'documentRecord' extents. 7007 (find_doc): Rename `stream` to `document_records` for clarity. 7008 (tt_face_load_svg_doc): Split `doc` from `doc_list` pointer for clarity. 7009 Test that the document content is contained within the table. 7010 Ensure minimum length of document before testing for gzip format. 7011 7012 Reported as 7013 7014 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51812 7015 7016 2022-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> 7017 7018 [base] Clean up the bitmap flow control. 7019 7020 * src/base/ftbitmap.c (FT_Bitmap_Copy): Flip the copy if its pitch 7021 is trully opposite, zero is not a positive value. 7022 (FT_Bitmap_Convert): Set negative pitch as needed, accept negative 7023 alignment values. 7024 7025 2022-09-22 Alexei Podtelezhnikov <apodtele@gmail.com> 7026 7027 [base] Discard and recreate bitmaps for copying and converting. 7028 7029 Reusing target bitmaps for copying and converting is permitted. It is, 7030 however, pointless to preserve their content before overwriting. Free- 7031 malloc might be faster than realloc. 7032 7033 * src/base/ftbitmap.c (FT_Bitmap_Copy, FT_Bitmap_Convert): Free 7034 an old buffer and create a new one. 7035 7036 2022-09-16 Dominik Röttsches <drott@chromium.org> 7037 7038 Reject 'COLR' table if version is 1 but header too small. 7039 7040 * src/sfnt/ttcolr.c (tt_face_load_colr): If the version is determined to 7041 be 1, then the table size has to be at least the size of the v1 header. 7042 Also, for peeking the number of base glyphs and entries in the layer list, 7043 ensure that the table is sufficiently long. 7044 7045 Fixes #1179. Original patch by Sergey Temnikov. 7046 7047 2022-09-15 Werner Lemberg <wl@gnu.org> 7048 7049 * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix format 1 handling. 7050 7051 Fixes #1181. 7052 7053 2022-09-06 Dominik Röttsches <drott@chromium.org> 7054 7055 [truetype] Reject 'fvar' loading when `num_instances` is too small. 7056 7057 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Reject retrieving master when 7058 'fvar' values locally do not match with sanitized values from initialization 7059 at `sfnt_init_face` time. 7060 7061 Reported as 7062 7063 https://bugs.chromium.org/p/chromium/issues/detail?id=1360295 7064 7065 2022-09-05 Dominik Röttsches <drott@chromium.org> 7066 7067 [sfnt] Handle variable `COLR` v1 fonts without delta set index map 7068 7069 Fixes #1178. 7070 7071 * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Set outer index to 7072 0 and inner index to the delta index when retrieving deltas if the 7073 `COLR` table has no delta set index map. 7074 7075 2022-09-05 Dominik Röttsches <drott@chromium.org> 7076 7077 [sfnt] Pointer sanity checks before reading layer info in 'COLR' v0 7078 7079 * src/sfnt/ttcolr.c (tt_face_get_colr_layer): Check that the pointer to 7080 read from is within the 'COLR' table. 7081 7082 Reported as 7083 7084 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50633 7085 7086 2022-09-05 Werner Lemberg <wl@gnu.org> 7087 7088 [autofit] Minor fix. 7089 7090 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Avoid 7091 compiler warning. 7092 7093 2022-09-05 Dominik Röttsches <drott@chromium.org> 7094 7095 [sfnt] Don't require 'gvar' table to support variation fonts. 7096 7097 Fixes #1172. 7098 7099 * src/sfnt/sfobjs.c (sfnt_load_face): Tag font as Multiple Masters font if 7100 `fvar` is present; do not require other tables to be present. 7101 7102 * src/truetype/ttgxvar.c (tt_set_mm_blend): Allow for a missing 'gvar' table 7103 when setting variation coordinates. However, if a 'gvar' table is actually 7104 present, do perform a sanity check and fail on malformedness. 7105 (TT_Get_MM_Var): Don't assume 'fvar' needs 'gvar' or 'CFF2 tables in all 7106 cases, which is an overly tight check. 7107 7108 2022-08-27 Alexei Podtelezhnikov <apodtele@gmail.com> 7109 7110 * src/base/ftver.rc: Explicitly use UTF-16. 7111 7112 Fixes #1177 to avoid mistranslation and other problems. 7113 7114 2022-08-26 Dominik Röttsches <drott@chromium.org> 7115 7116 [sfnt] Avoid undefined shifts in `COLR` v1 color line retrieval 7117 7118 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): Disambiguate shift 7119 behavior by using multiplication using macros from ftcalc.h. 7120 7121 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50573 7122 7123 2022-08-21 Sean Farrell <sean.farrell@rioki.org> 7124 7125 CMakeLists.txt (FT_ENABLE_ERROR_STRINGS): New configuration option. 7126 7127 This option uncomments FreeType configuration macro 7128 `FT_CONFIG_OPTION_ERROR_STRINGS` to make function `FT_Error_String` return 7129 meaningful error strings. 7130 7131 This option is off by default. 7132 7133 2022-08-21 Chris Liddell <chris.liddell@artifex.com> 7134 7135 [base, type1] Better handling of out-of-memory situations. 7136 7137 This follows similar code in `cff_slot_done`. 7138 7139 * src/base/ftobjs.c (ft_glyphslot_done), src/type1/t1objs.c 7140 (T1_GlyphSlot_Done): Check `internal` pointer. 7141 7142 The Type1 problems was reported as 7143 7144 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50057. 7145 7146 2022-08-06 Tim-Philipp Müller <tim@centricular.com> 7147 7148 ci: bump windows image and use newer runner and vs2019 7149 7150 The old 1809 runner will be decommissioned at some point. 7151 7152 2022-08-04 @udoudou <> 7153 7154 * src/cache/ftcmanag.c (FTC_Manager_New): Initialize `cur_weight`. 7155 7156 See !192. 7157 7158 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 7159 7160 * src/sfnt/ttload.c: Trace formatting updates. 7161 7162 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 7163 7164 * src/psaux/psobjs.c (ps_table_release): Remove redundant casting. 7165 7166 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 7167 7168 * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Reduce casting. 7169 7170 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com> 7171 7172 [cache] Remove some casts, clean up tracing. 7173 7174 * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup): 7175 Clean up tracing types. 7176 * src/cache/ftccache.c (ftc_node_destroy): Ditto. 7177 * src/cache/ftcmanag.c (FTC_Manager_Check): Ditto. 7178 (FTC_Manager_Check, FTC_Node_Unref): Remove a cast. 7179 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto. 7180 7181 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com> 7182 7183 [autofit] Updated to reduce casting (cont'd). 7184 7185 * src/autofit/afmodule.h (AF_ModuleRec): Change `default_script` type. 7186 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): 7187 Remove casting. 7188 * src/autofit/afmodule.c (af_property_{set,get}): Updated accordingly. 7189 7190 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com> 7191 7192 [autofit] Updated to reduce casting. 7193 7194 * src/autofit/afglobal.h (AF_FaceGlobalsRec): Change `glyph_count` type. 7195 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage, 7196 af_face_globals_get_metrics, af_face_globals_is_digit, 7197 af_face_globals_new): Changed local types and updated accordingly. 7198 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Ditto. 7199 7200 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com> 7201 7202 [psaux] Remove unused structure field. 7203 7204 * include/freetype/internal/psaux.h (PS_TableRec): Remove `num_elems`. 7205 * src/psaux/psobjs.c (ps_table_new): Remoove its initialization. 7206 7207 2022-07-30 Dominik Röttsches <drott@chromium.org> 7208 7209 [sfnt] Implement VarClipBox. 7210 7211 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Depending on the 7212 format, read `var_index_base`, then retrieve and apply scaled deltas. 7213 7214 2022-07-30 Dominik Röttsches <drott@chromium.org> 7215 7216 [sfnt] Fix typo in clip box computation. 7217 7218 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Use appropriate 7219 scale factor for `yMin` and `yMax`. 7220 7221 2022-07-30 Alexei Podtelezhnikov <apodtele@gmail.com> 7222 7223 [autofit] Use unsigned accounting for hints. 7224 7225 * src/autofit/afhints.h (AF_AxisHintsRec): Use unsigned types. 7226 7227 * src/autofit/afhints.c (af_axis_hints_new_{segment,edge}, 7228 af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset): 7229 Updated accordingly. 7230 * src/autofit/aflatin.c (af_cjk_hints_compute_edges): Ditto. 7231 * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Ditto. 7232 7233 2022-07-30 Alexei Podtelezhnikov <apodtele@gmail.com> 7234 7235 * src/autofit/afhints.h: Remove dead code. 7236 7237 2022-07-29 Werner Lemberg <wl@gnu.org> 7238 7239 * src/base/ftglyph.c (FT_Get_Glyph): Set `*aglyph` to NULL in case of error. 7240 7241 2022-07-29 Werner Lemberg <wl@gnu.org> 7242 7243 Fix compilation if `TT_CONFIG_OPTION_GX_VAR_SUPPORT` is not set. 7244 7245 * src/sfnt/ttcolr.c: Protect relevant code with 7246 `TT_CONFIG_OPTION_GX_VAR_SUPPORT`. 7247 7248 2022-07-29 Werner Lemberg <wl@gnu.org> 7249 7250 Fix clang14 compiler warnings. 7251 7252 * include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE): 7253 Fix type. 7254 7255 * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean 7256 value. 7257 (tt_face_get_colorline_stops): Fix type of `var_index_base`. 7258 7259 2022-07-26 Alexei Podtelezhnikov <apodtele@gmail.com> 7260 7261 [pfr] Fortify the kerning code. 7262 7263 Any array index must be strictly less then the array size. Therefore, 7264 we must reject indexes that are equal to the array size. Alternatively, 7265 we should move the bounds check before the index decrement but that 7266 would be confusing. 7267 7268 In addition, it is ok to decrement zero (.notdef) and get UINT_MAX, 7269 which is then automatically rejected in the bounds check. 7270 7271 * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix the bounds checking. 7272 7273 2022-07-26 Werner Lemberg <wl@gnu.org> 7274 7275 [pfr] Add some safety guards. 7276 7277 * src/pfr/pfrload.c (pfr_phy_font_load): Check resolutions and number of 7278 characters. 7279 7280 Fixes #1174. 7281 7282 2022-07-26 Werner Lemberg <wl@gnu.org> 7283 7284 * src/pfr/*.c: Trivial improvements and formatting. 7285 7286 2022-07-24 Werner Lemberg <wl@gnu.org> 7287 7288 * configure: s/egrep/grep -E/ 7289 7290 `egrep` is deprecated. 7291 7292 2022-07-23 Ben Wagner <bungeman@chromium.org> 7293 7294 [base] Build outlines in amortized constant time. 7295 7296 When resizing the loader's points and contours, resize them to at least 1.5 7297 times their current size. The code currently only reserves as much space as 7298 is currently required, leading to O(n^2) runtime when adding points one at a 7299 time. 7300 7301 This change does not attempt to ever shrink the loader's point and contour 7302 storage since this was not attempted previously either. The 1.5 multiple 7303 was chosen as a trade-off between potentially unused space and the runtime. 7304 7305 * src/base/ftgloader.c (FT_GlyphLoader_CheckPoints): Implement it. 7306 7307 Fixes #1173. 7308 7309 2022-07-09 Dominik Röttsches <drott@chromium.org> 7310 7311 [sfnt] Support variable 'COLR' v1 `PaintVarSkew*`. 7312 7313 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values 7314 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW`, 7315 `FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER`, and 7316 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER`. 7317 (read_paint): Handle new enumeration values. 7318 7319 2022-07-09 Dominik Röttsches <drott@chromium.org> 7320 7321 [sfnt] Support variable 'COLR' v1 `PaintVarRotate*`. 7322 7323 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values 7324 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE` and 7325 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER`. 7326 (read_paint): Handle new enumeration values. 7327 7328 2022-07-09 Dominik Röttsches <drott@chromium.org> 7329 7330 [sfnt] Support 'COLR' v1 variable `PaintVarScale*`. 7331 7332 * src/sfnt/ttcolr.c: (FT_PaintFormatInternal): New enumeration values 7333 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE`, 7334 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER`, 7335 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM`, and 7336 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER`. 7337 (read_paint): Handle new enumeration values. 7338 7339 2022-07-09 Dominik Röttsches <drott@chromium.org> 7340 7341 [sfnt] Support for 'COLR' v1 variable translate. 7342 7343 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration value 7344 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE`. 7345 (read_paint): Handle new enumeration value. 7346 7347 2022-07-09 Dominik Röttsches <drott@chromium.org> 7348 7349 [sfnt] Support for 'COLR' v1 variable transforms. 7350 7351 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration value 7352 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM`. 7353 (read_paint): Handle new enumeration value. 7354 7355 2022-07-09 Dominik Röttsches <drott@chromium.org> 7356 7357 [sfnt] Deltas for 'COLR' v1 gradient coordinates. 7358 7359 * src/sfnt/ttcolr.c (read_paint) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Read and 7360 apply deltas to radial, linear, and sweep gradient coordinates such as 'p0', 7361 'p1', 'p2', 'center', 'radii', and 'angles'. 7362 7363 2022-07-08 Dominik Röttsches <drott@chromium.org> 7364 7365 [sfnt] Support variable 'COLR' v1 color lines. 7366 7367 * include/freetype/ftcolor.h (FT_ColorStopIterator): Add field 7368 `read_variable` to indicate whether a variation index base should be read. 7369 7370 * src/sfnt/ttcolr.c: (FT_PaintFormat_Internal): New enumerations 7371 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT` 7372 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT`, and 7373 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT`. 7374 (read_color_line): New parameter `read_variable`; update callers. 7375 (read_paint): Handle new enumerations. 7376 7377 2022-07-07 Dominik Röttsches <drott@chromium.org> 7378 7379 [sfnt] Apply variation deltas to `PaintVarSolid`. 7380 7381 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal_): New enumeration 7382 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID`. 7383 7384 (get_deltas_for_var_index_base) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New 7385 function to retrieve an array of delta values, which will be used for most 7386 of 'COLR' v1 variation formats (in follow-up commits). 7387 7388 (read_paint): Add `face` parameter; update caller. 7389 Handle `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID`. 7390 7391 2022-07-07 Dominik Röttsches <drott@chromium.org> 7392 7393 [sfnt] Check safety of cast to `TT_Driver` before accessing member. 7394 7395 * src/sfnt/ttcolr.c (VARIABLE_COLRV1_ENABLED): Access 7396 `enable_variable_colrv1` only if driver class matches. 7397 7398 2022-07-06 Stephen Holdaway <stecman@gmail.com> 7399 7400 doc: Clarify description of `FT_Stream_IoFunc`. 7401 7402 The existing documentation comments on `FT_Stream_IoFunc` hinted at the dual 7403 seek/read behavior required for custom stream implementations to work, but 7404 it didn't explicitly explain it. Without looking at the internals of 7405 FreeType, it was easy for someone to assume their implementation should 7406 handle both seek and read operations all the time. If this is done, you get 7407 a variety of errors, but mostly just `Unknown_File_Format` (error code 7408 0x02). 7409 7410 2022-07-04 Dominik Röttsches <drott@chromium.org> 7411 7412 [sfnt] Load variation store for 'COLR' v1. 7413 7414 * src/sfnt/ttcolr.c: Include `ttobjs.h` temporarily. 7415 (VARIABLE_COLRV1_ENABLED): New temporary macro to detect whether variable 7416 COLRv1 is enabled. 7417 (Colr): New fields `var_store` and `delta_set_idx_map`. 7418 (tt_face_load_colr, tt_face_free_colr) [VARIABLE_COLRV1_ENABLED]: Load and 7419 free variation store data using the functions from the Multiple Masters 7420 service. 7421 7422 2022-07-03 Chris Liddell <chris.liddell@artifex.com> 7423 7424 [base] Improve error handling in `FT_GlyphLoader_CheckPoints`. 7425 7426 If `FT_GlyphLoader_CreateExtra` returns an error (and a couple of other 7427 places), `FT_GlyphLoader_CheckPoints` would propagate the error immediately, 7428 rather than cleaning up the partially set up `FT_GlyphLoader`. As a 7429 consequence, a subsequent attempt to create a glyph could result in a crash. 7430 7431 * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Ensure all the error 7432 conditions exits are consistent, eventually calling `FT_GlyphLoader_Reset`. 7433 7434 2022-07-03 Thomas Sondergaard <thomas@sondergaard.cc> 7435 7436 CMakeLists.txt: Provide both 'freetype' and 'Freetype::Freetype' targets. 7437 7438 FreeType can be located by consuming projects that use 7439 `find_package(Freetype)` either via the old `MODULE` path (which uses 7440 `FindFreetype.cmake` supplied by CMake), or via the new `CONFIG` path (which 7441 uses `freetype-config.cmake` as supplied by this project). Up to this point 7442 the CMake module has supplied the target `Freetype::Freetype` and the config 7443 file provided by this project the target `freetype`. Now we supply both 7444 `freetype` and `Freetype::Freetype` so that consuming projects can always 7445 use the target `Freetype::Freetype` regardless of what path was taken by 7446 `find_package(Freetype)`. 7447 7448 Fixes #1165. 7449 7450 2022-07-02 Werner Lemberg <wl@gnu.org> 7451 7452 include/freetype/ftmm.h: Improve documentation. 7453 7454 2022-07-01 Dominik Röttsches <drott@chromium.org> 7455 7456 [base] Round values in `FT_MulAdd_Fix`. 7457 7458 This avoids regressing Blink layout tests and makes `FT_MulAdd_Fix` delta 7459 retrieval implementation consistent with the previous implementation, which 7460 used `FT_fixedToInt` and included rounding. 7461 7462 * src/base/ftcalc.c (FT_MulAdd_Fix): Implement it. 7463 Also fix remaining `temp` initialization compilation issue. 7464 7465 Fixes #1169. 7466 7467 2022-07-01 Werner Lemberg <wl@gnu.org> 7468 7469 Minor formatting. 7470 7471 2022-06-30 Dominik Röttsches <drott@chromium.org> 7472 7473 Fix initialisation of temp variable in new FT_MulAddFix 7474 7475 src/truetype/ttgxvar.c (FT_MulAddFix): Initialise `temp`. 7476 7477 2022-06-29 Dominik Röttsches <drott@chromium.org> 7478 7479 [truetype] Perform variation store delta computation with 64-bit precision. 7480 7481 * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Make type 7482 explicitly 32-bit. 7483 * include/freetype/internal/services/svmm.h 7484 (FT_Var_Get_Item_Delta_Func): Change return type to `FT_ItemVarDelta` 7485 * truetype/ttgxvar.h (tt_var_get_item_delta): Change return type to 7486 `FT_ItemVarDelta`. 7487 * truetype/ttgxvar.c (tt_var_get_item_delta): Store scalars and deltas 7488 to intermediate array, perform computation using new method 7489 `FT_MulAddFix`. 7490 7491 2022-06-29 Dominik Röttsches <drott@chromium.org> 7492 7493 New function `FT_MulAddFix` to compute the sum of fixed-point products. 7494 7495 This function, based on the code of `FT_MulFix`, uses 64-bit precision 7496 internally for intermediate computations. 7497 7498 * include/freetype/internal/ftcalc.h, base/ftcalc.c (FT_MulAddFix): 7499 Implement it. 7500 7501 2022-06-22 Werner Lemberg <wl@gnu.org> 7502 7503 CMakeLists.txt: Move inclusion of `FindPkgConfig` down. 7504 7505 It must come after `CMAKE_TOOLCHAIN_FILE`. 7506 7507 Fixes #1167. 7508 7509 2022-06-22 Dominik Röttsches <drott@chromium.org> 7510 7511 [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14 7512 7513 2022-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 7514 7515 * docs/CHANGES: Announce impending Infinality removal. 7516 7517 2022-06-21 Alexei Podtelezhnikov <apodtele@gmail.com> 7518 7519 * ttgload.c (TT_Process_Composite_Glyph): Fix a signedness warning. 7520 7521 2022-06-21 Werner Lemberg <wl@gnu.org> 7522 7523 s/fixed point/fixed-point/ 7524 7525 2022-06-21 Werner Lemberg <wl@gnu.org> 7526 7527 .gitlab-ci.yml: Correctly upgrade `meson`. 7528 7529 2022-06-21 Dominik Röttsches <drott@chromium.org> 7530 7531 Proposal: Feature control for variable COLRv1 7532 7533 * include/freetype/ftdriver.h (variable-color-v1 property): Add documentation 7534 for variable-colr-v1 property. 7535 * src/truetype/ttdriver.c (tt_property_set): Ingest variable-control property 7536 when called, set to enable_variable_colrv1 driver flag. 7537 * src/truetype/ttobjs.h (TT_DriverRec): Add enable_variable_colrv1 flag. 7538 7539 2022-06-21 Xavier Claessens <xavier.claessens@collabora.com> 7540 7541 [meson] Disable FreeType in HarfBuzz fallback. 7542 7543 This avoids cyclic subproject configuration when the 'harfbuzz' feature is 7544 enabled, or `--wrap-mode=forcefallback` is used, but HarfBuzz is built as a 7545 subproject. HarfBuzz does the same and disables HarfBuzz support when 7546 configuring FreeType as a subproject. 7547 7548 * meson.build (harfbuzz_dep): Implement it. 7549 7550 * subprojects/harfbuzz.wrap: New file. 7551 7552 * .gitlab-ci.yml [windows meson]: Use latest version of the meson 0.59 7553 series, which has a necessary bug fix to make CI work. 7554 7555 2022-06-19 Alexei Podtelezhnikov <apodtele@gmail.com> 7556 7557 [truetype] Clean up phantom point accounting. 7558 7559 This formalizes that the phantom points appended in the outline 7560 do not increase its point count, nor are they tagged or included 7561 in any additional contours. Only their coordinates are stored. 7562 They are counted in the glyph zone, however. 7563 7564 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Infer `n_points` 7565 from the outline size plus four phantom points. 7566 * src/truetype/ttgxvar.h (TT_Vary_Apply_Glyph_Deltas): Remove this 7567 argument. 7568 * src/truetype/ttgload.c (tt_prepare_zone): Add phantom four. 7569 (TT_Process_Simple_Glyph, load_truetype_glyph): Update all callers. 7570 7571 2022-06-19 Alexei Podtelezhnikov <apodtele@gmail.com> 7572 7573 [truetype/GX] Clean up phantom point adjustment. 7574 7575 This moves phantom point and advance variation adjustment next to 7576 calculations. The logic stays the same, HVAR and VVAR take priority. 7577 7578 * src/truetype/ttgload.c (load_truetype_glyph): Move it from here... 7579 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): ... to here 7580 and check for HVAR and VVAR presence outside the main loop. 7581 7582 2022-06-18 Ben Wagner <bungeman@chromium.org> 7583 7584 [stream] Fix reading s32 when long is s64 7585 7586 `FT_READ_LONG`, `FT_GET_LONG`, and related macros did not return 7587 negative values when `long` is more than 32 bits. `FT_Stream_ReadULong` 7588 would read four bytes into the LSB of an `FT_ULong` and return that. 7589 Since this can never set the MSb of the `FT_ULong` when `FT_ULong` is 7590 more than 32 bits the cast to `FT_Long` never resulted in a negative 7591 value. 7592 7593 Fix this by modifying `FT_Stream_Read*` to return a type of the same 7594 size as the bytes it is reading and changing the `FT_READ_*` and 7595 `FT_GET_*` macros to cast to the same type returned by `FT_Stream_Read*` 7596 but with the correctly signed type (instead of casting to what is 7597 assumed to be the type of `var` which will happen automatically anyway). 7598 7599 There exist a few cases like with the `OFF3` variants where there isn't 7600 generally a type with the correct size. `FT_PEEK_OFF3` works around this 7601 loading the bytes into the three most significant bits and then doing a 7602 signed shift down. `FT_NEXT_OFF3` also already worked correctly by 7603 casting this signed value to another signed type. `FT_Stream_GetUOffset` 7604 works correctly but one must be careful not to attempt to cast the 7605 returned value to a signed type. Fortunately there is only 7606 `FT_GET_UOFF3` and no `FT_GET_OFF3`. 7607 7608 All of these cases are handled correctly when reading values through 7609 `FT_Stream_ReadFields` since it generically computes the signed value 7610 through an `FT_Int32`. This change is essentially doing the same for 7611 these macros. 7612 7613 * include/freetype/internal/ftstream.h (FT_NEXT_*, FT_GET_*, FT_READ*): 7614 Update macros and return types to use fixed size types for fixed size 7615 values. 7616 7617 * src/base/ftstream.c (FT_StreamGet*, FT_StreamRead*): Dito. 7618 7619 Issue: #1161 7620 7621 2022-06-17 Alexei Podtelezhnikov <apodtele@gmail.com> 7622 7623 [truetype/GX] Fix an old typo. 7624 7625 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Vertical 7626 advance is measured along y-coordinate. 7627 7628 2022-06-16 Alexei Podtelezhnikov <apodtele@gmail.com> 7629 7630 [truetype/GX] Clean up advance adjustment (Brrr). 7631 7632 * src/truetype/ttgload.c (load_truetype_glyph): Remove remaining code. 7633 7634 2022-06-16 Ben Wagner <bungeman@chromium.org> 7635 7636 [type1] Directly search for eexec in private dict 7637 7638 This code originally just searched for `eexec`. This was later modified 7639 to check that the `eexec` found is valid (not in a string or comment). 7640 This was done by searching for `eexec` as before and then, for each 7641 `eexec` found, searching from the beginning using the correct parsing to 7642 see if the `eexec` was still found. If the private dictionary is large 7643 and contains many copies of `eexec` which are not valid, the initial 7644 part of the private dictionary is scanned once for each, potentially 7645 leading to n^2 parsing time. 7646 7647 Instead of finding an initial `eexec` and then re-parsing to discover if 7648 it is valid, drop the initial search for `eexec` and just parse to find 7649 a valid `eexec`. This is strictly faster since the validation must 7650 happen anyway and avoids restarting from the beginning each time an 7651 `eexec` is found in the data. 7652 7653 * src/type1/t1parse.c (T1_Get_Private_Dict): avoid n^2 parsing 7654 7655 Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1328883 7656 7657 2022-06-16 Alexei Podtelezhnikov <apodtele@gmail.com> 7658 7659 [truetype/GX] Clean up advance adjustment. 7660 7661 * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph): 7662 Move the advance adjustment from here... 7663 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): ... to here and 7664 simplify arguments. 7665 * src/truetype/ttgxvar.h (TT_Vary_Apply_Glyph_Deltas): Update prototype 7666 with fewer arguments. 7667 7668 2022-06-14 Ben Wagner <bungeman@chromium.org> 7669 7670 [gzip] Handle inflate returning Z_NEED_DICT 7671 7672 When `inflate` returns `Z_NEED_DICT` this is currently not reported as 7673 an error and callers may assume that the decompression succeeded when it 7674 did not. In particular, a compressed table in a woff file may not 7675 actually be decompressed and written as expected, leaving the backing 7676 memory for the expanded table uninitialized. 7677 7678 * src/gzlip/ftgzip.c (FT_Gzip_Uncompress): treat `Z_NEED_DICT` as 7679 indicating invalid data since there is no means to provide a dictionary. 7680 7681 Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335712 7682 7683 2022-06-13 Ben Wagner <bungeman@chromium.org> 7684 7685 [woff] Don't allocate table entries until needed 7686 7687 * src/sfnt/sfwoff.c (woff_open_font): delay allocating space for the 7688 table entries until they are actually written out with the data. 7689 7690 2022-06-12 Alexei Podtelezhnikov <apodtele@gmail.com> 7691 7692 * src/sfnt/sfwoff2.c (woff2_open_font): Partial revert. 7693 7694 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47981. 7695 7696 2022-06-12 Alexei Podtelezhnikov <apodtele@gmail.com> 7697 7698 * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Cosmetic macro change. 7699 7700 2022-06-11 Alexei Podtelezhnikov <apodtele@gmail.com> 7701 7702 [woff, woff2] Avoid buffer zeroing. 7703 7704 * src/sfnt/sfwoff.c (woff_open_font): Use Q-macros. 7705 * src/sfnt/sfwoff2.c: Ditto. 7706 (reconstruct_font): Allocate table_entry on stack. 7707 7708 2022-06-10 Alexei Podtelezhnikov <apodtele@gmail.com> 7709 7710 [smooth] Fix GCC LTO crashes on Windows. 7711 7712 Fixes #1164 by using a volatile variable around `setjmp`. It is hard to 7713 say how this fixes crashes related to certain link-time optimizations. 7714 This does not decrease the rendering performance. 7715 7716 * src/smooth/ftgrays.c (gray_convert_glyph_inner): Use volatile `error`. 7717 7718 2022-06-09 bruvzg <@bruvzg> 7719 7720 * src/smooth/ftgrays.c [FT_STATIC_RASTER]: Fix compilation. 7721 7722 2022-06-06 Ben Wagner <bungeman@chromium.org> 7723 7724 [svg] Set linear advances when loading SVG glyphs 7725 7726 * include/freetype/freetype.h (FT_GlyphSlotRec_): update doc 7727 * src/cff/cffgload.c (cff_slot_load): do it 7728 * src/truetype/ttgload.c (TT_Load_Glyph): do it 7729 7730 Fixes: #1156 7731 7732 2022-06-01 Ben Wagner <bungeman@chromium.org> 7733 7734 [svg] Clear correct flags for doc ownership 7735 7736 This issue was discovered with an SVG based font with some documents 7737 compressed and other uncompressed. After loading the first compressed 7738 document the ownership flag on the glyph slot was set to true but never 7739 set to false. As a result after loading a compressed document a glyph 7740 from an uncompressed document would load fine, but when this glyph slot 7741 was cleared it would try to free its document resulting in a wild free. 7742 7743 * src/base/ftobjs.c (ft_glyphslot_clear): clear correct flags 7744 7745 Fixes: #1162 7746 7747 2022-06-01 Alexei Podtelezhnikov <apodtele@gmail.com> 7748 7749 [docs] Correct favicon. 7750 7751 2022-06-01 Alexei Podtelezhnikov <apodtele@gmail.com> 7752 7753 [docs] Use hinted favicon. 7754 7755 2022-05-27 Alexei Podtelezhnikov <apodtele@gmail.com> 7756 7757 [docs] Update favicon. 7758 7759 2022-05-25 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> 7760 7761 * src/sfnt/ttmtx.c (tt_face_get_metrics): Apply variations unconditionally. 7762 7763 This causes a speed-up of approx. 20% for getting advance widths. 7764 7765 2022-05-23 Dominik Röttsches <drott@chromium.org> 7766 7767 [truetype] Support reading 32bit/16bit VarStore deltas 7768 7769 * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Define type 7770 to be used for delta arrays, upgrade to FT_long. 7771 * src/truetype/ttgxvar.c: Adhere to long_words bit and read either 7772 Short/Byte pairs or Long/Short pairs, as defined by spec. For better 7773 readability, define macro for repetitive read code. 7774 7775 2022-05-20 Dominik Röttsches <drott@chromium.org> 7776 7777 [truetype] Handle 0xFFFF special value inside delta retrieval function 7778 7779 * truetype/ttgxvar.c (tt_hvadvance_adjust, tt_apply_mvar, 7780 tt_var_get_item_delta): Remove special 0xFFFF handling in favor of less 7781 redundant handling inside the tt_var_get_item_delta function, as it is 7782 equivalent to returning a 0 delta. Avoids code-duplication checking for 7783 special value 0xFFFF. 7784 7785 2022-05-19 Dominik Röttsches <drott@chromium.org> 7786 7787 [truetype, snft] Add service methods for `DeltaSetIdxMap` and `VarStore`. 7788 7789 This will be needed for 'COLR' v1 variation support. 7790 7791 * src/truetype/ttgxvar.h (GX_ItemVarData, GX_AxisCoords, GX_VarRegion, 7792 GX_VarItemStore, GX_DeltaSetIdxMap): Move structures to... 7793 * include/freetype/internal/ftmmtypes.h: ... this new file. 7794 7795 * include/freetype/internal/service/svmm.h (MultiMasters): Include 7796 `ftmmtypes.h`. 7797 (FT_Var_Load_Delta_Set_Idx_Map_Func, FT_Var_Load_Item_Var_Store_Func, 7798 FT_Var_Get_Item_Delta_Func, FT_Var_Done_Item_Var_Store_Func, 7799 FT_Var_Done_Delta_Set_Idx_Map_Func): New function typedefs. 7800 (MultiMasters): Add them. 7801 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. 7802 7803 * src/cff/cffdrivr.c (cff_load_item_variation_store, 7804 cff_load_delta_set_index_mapping, cff_get_item_delta, 7805 cff_done_item_variation_store, cff_done_delta_set_index_map): New wrapper 7806 methods calling into mm service. 7807 (cff_service_multi_masters): Updated. 7808 7809 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store, 7810 ft_var_load_delta_set_index_mapping, ft_var_get_item_delta, 7811 ft_var_done_item_variation_store, ft_var_done_delta_set_index_map): Renamed 7812 to ... 7813 (tt_var_load_item_variation_store, tt_var_load_delta_set_index_mapping, 7814 tt_var_get_item_delta, tt_var_done_item_variation_store, 7815 tt_var_done_delta_set_index_map): ... this for consistency. 7816 Mark them as non-static. 7817 * src/truetype/ttgxvar.h: Add corresponding prototypes. 7818 7819 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. 7820 7821 * src/type1/t1driver.c (t1_service_multi_masters): Updated. 7822 7823 2022-05-19 Dominik Röttsches <drott@chromium.org> 7824 7825 [truetype] Move deallocation of `DeltaSetIdxMap` into own function. 7826 7827 This is a preparation for handling `DeltaSetIdxMap` and `VarStore` as a 7828 FreeType service. 7829 7830 * src/truetype/ttgxvar.c (ft_var_done_delta_set_index_map): New function. 7831 (tt_done_blend): Use it. 7832 7833 2022-05-18 Werner Lemberg <wl@gnu.org> 7834 7835 * builds/toplevel.mk (do-dist): Don't remove meson wrap files. 7836 7837 Fixes #1157. 7838 7839 2022-05-18 Werner Lemberg <wl@gnu.org> 7840 7841 * subprojects/zlib.wrap: Update to zlib version 1.2.12. 7842 7843 2022-05-18 Werner Lemberg <wl@gnu.org> 7844 7845 REAMDE: Mention that gitlab's 'download' button doesn't work. 7846 7847 This is because the `git archive` command doesn't preserve submodules. 7848 7849 Note that currently there is no support for disabling the 'download' button 7850 in gitlab (https://gitlab.com/gitlab-org/gitlab/-/issues/17032). 7851 7852 Fixes issue #1158. 7853 7854 2022-05-11 Werner Lemberg <wl@gnu.org> 7855 7856 [truetype] Handle inner/outer index values 0xFFFF/0xFFFF. 7857 7858 This was introduced in OpenType 1.8.4. 7859 7860 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping, 7861 tt_hvadvance_adjust, ft_var_load_mvar, tt_apply_mvar): Handle special 7862 inner/outer index values. 7863 (ft_var_load_item_variation_store): Add test. 7864 7865 Fixes #1154. 7866 7867 2022-05-01 Werner Lemberg <wl@gnu.org> 7868 7869 * Version 2.12.1 released. 7870 ========================== 7871 7872 Tag sources with `VER-2-12-1'. 7873 7874 * docs/VERSION.TXT: Add entry for version 2.12.1. 7875 * docs/CHANGES, docs/release: Updated. 7876 7877 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 7878 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 7879 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 7880 docs/freetype-config.1: s/2.12.0/2.12.1/, s/2120/2121/. 7881 7882 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. 7883 7884 * builds/unix/configure.raw (version_info): Set to 24:3:18. 7885 * CMakeLists.txt (VERSION_PATCH): Set to 1. 7886 7887 2022-04-30 Anuj Verma <anuj@posteo.net> 7888 7889 [sdf] Do not throw errors for invisible glyphs. 7890 7891 * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Return `FT_Err_Ok` if 7892 width or height is zero, since some glyphs do not generate visible bitmaps. 7893 7894 Fixes #1150. 7895 7896 2022-04-30 Werner Lemberg <wl@gnu.org> 7897 7898 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_COLOR` for SVG fonts. 7899 7900 Fixes #1151. 7901 7902 2022-04-27 Brendan Shanks <bshanks@codeweavers.com> 7903 7904 autogen.sh: Fix building when freetype is itself a git submodule. 7905 7906 There are situations where .git is not a directory, like when 7907 freetype is a submodule in another repository. 7908 7909 2022-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> 7910 7911 [builds/windows] Simplify non-desktop UWP check. 7912 7913 Fixes mingw compilation described in !159. 7914 7915 * builds/windows/ftsystem.c: Do not use WINAPI_FAMILY_PARTITION macro. 7916 7917 2022-04-25 Alexei Podtelezhnikov <apodtele@gmail.com> 7918 7919 [truetype] Reset IUP flags in `TT_RunIns`. 7920 7921 Fixes #1148 by moving the flag initialization back, partly reverting 7922 7809007a and fd03dcc1. Initializing these flags elsewhere skips 'cvt'. 7923 7924 * src/truetype/ttinterp.c (TT_RunIns): Initialize the IUP flag here... 7925 (TT_Run_Context): ... instead of here. 7926 7927 2022-04-24 Xavier Claessens <xavier.claessens@collabora.com> 7928 7929 [meson] Remove `default_library=both` from `default_options`. 7930 7931 It is inconsistent with what all other Meson projects do. 7932 7933 It also prevents static linking to FreeType when it is a subproject because 7934 `default_options` in a subproject takes precedence on values set on the main 7935 project. For example, building 'GStreamer' with `-Ddefault_library=static` 7936 would still dynamically link on FreeType unless the user also sets 7937 `-Dfreetype2:default_library=static`. 7938 7939 * meson.build: Updated. 7940 7941 * .gitlab-ci.yml: Retain `both` option for testing. 7942 7943 2022-04-19 Werner Lemberg <wl@gnu.org> 7944 7945 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Integer overflow. 7946 7947 Reported as 7948 7949 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46792 7950 7951 2022-04-16 Georg Brandl <georg@python.org> 7952 7953 * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]: Fix segfault. 7954 7955 This can happen if the function is called with `size` being `NULL`. 7956 7957 Fixes #1147. 7958 7959 2022-04-14 Steve Lhomme <robux4@ycbcr.xyz> 7960 7961 .gitlab-ci.yml: Add a Universal Windows build target 7962 7963 It's compiled for Windows 10 and up, ensuring UNICODE is set (default for UWP) 7964 and selecting the proper WINAPI_FAMILY (WINAPI_FAMILY_APP). 7965 7966 Do not try to run the UWP exe in the Docker as it doesn't work. 7967 7968 2022-04-04 Ben Wagner <bungeman@chromium.org> 7969 7970 [sfnt] Correct FT_ColorStopIterator documentation. 7971 7972 * include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not 7973 set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and 7974 `num_color_stops` are set by `FT_Get_Paint`. `p` and 7975 `current_color_stop` are updated by `FT_Get_Colorline_Stops`. 7976 7977 2022-04-01 Werner Lemberg <wl@gnu.org> 7978 7979 * builds/unix/configure.raw: Add option `--with-librsvg`. 7980 7981 Since 'librsvg' is written in Rust, this option allows distributions to 7982 avoid a dependency on the entire Rust toolchain to provide the FreeType demo 7983 programs. 7984 7985 Suggested by Lars Wendler in !156. 7986 7987 2022-04-01 Werner Lemberg <wl@gnu.org> 7988 7989 * src/sfnt/sfwoff.c (reconstruct_glyf): Fix gcc 10 warning. 7990 7991 2022-04-01 Werner Lemberg <wl@gnu.org> 7992 7993 [gzip] Update sources to zlib 1.2.12. 7994 7995 2022-04-01 Eric Jing <@CPUcontrol> 7996 7997 CMakeLists.txt: Fix `Info.plist` path. 7998 7999 When building a framework using CMake with `add_subdirectory`, CMake must be 8000 able to find `freetype-Info.plist` when configuring the framework 8001 properties. 8002 8003 Fixes #1145. 8004 8005 2022-04-01 Werner Lemberg <wl@gnu.org> 8006 8007 Whitespace. 8008 8009 2022-04-01 Ben Wagner <bungeman@chromium.org> 8010 8011 [truetype] Use SUB_LONG for component offset. 8012 8013 * src/truetype/ttgload.c (TT_Process_Composite_Component): do it. 8014 8015 Bug: https://crbug.com/1309429 8016 8017 2022-03-31 Werner Lemberg <wl@gnu.org> 8018 8019 CMakeList.txt: Update code to handle recent changes for `freetype.pc`. 8020 8021 Fixes #1144. 8022 8023 2022-03-31 Werner Lemberg <wl@gnu.org> 8024 8025 CMakeLists.txt: s/PKG_CONFIG/PKGCONFIG/, s/REQUIRED_/REQUIRES_/. 8026 8027 2022-03-31 Werner Lemberg <wl@gnu.org> 8028 8029 * Version 2.12.0 released. 8030 ========================== 8031 8032 Tag sources with `VER-2-12-0'. 8033 8034 * docs/VERSION.TXT: Add entry for version 2.12.0. 8035 * docs/CHANGES, docs/release: Updated. 8036 8037 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 8038 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 8039 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 8040 docs/freetype-config.1: s/2.11.1/2.12.0/, s/2111/2120/. 8041 8042 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12. 8043 (FREETYPE_PATCH): Set to 0. 8044 8045 * builds/unix/configure.raw (version_info): Set to 24:2:18. 8046 * CMakeLists.txt (VERSION_MINOR): Set to 12. 8047 (VERSION_PATCH): Set to 0. 8048 8049 * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits 8050 since version 2.11.0 (when we stopped creating this file manually). 8051 8052 2022-03-31 Werner Lemberg <wl@gnu.org> 8053 8054 Fix clang++ warnings. 8055 8056 * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c 8057 (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new), 8058 src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW), 8059 src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c 8060 (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize 8061 variables used for allocation. 8062 8063 * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of 8064 `max_splits` to FT_UInt. 8065 (sdf_generate_bounding_box): Add cast. 8066 8067 2022-03-30 Werner Lemberg <wl@gnu.org> 8068 8069 Whitespace. 8070 8071 2022-03-30 Werner Lemberg <wl@gnu.org> 8072 8073 [builds] Fix creation of `freetype2.pc` for static-only builds. 8074 8075 We have to help `pkg-config` since it can't recognize that there is no 8076 shared library installed. 8077 8078 Note that meson already does exactly the same. 8079 8080 * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to... 8081 (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them 8082 depending on `$enable_shared`. 8083 (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables. 8084 8085 * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated 8086 variables. 8087 8088 2022-03-25 Werner Lemberg <wl@gnu.org> 8089 8090 Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`. 8091 8092 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY, 8093 FT_HAS_SBIX_OVERLAY): New macro. 8094 8095 * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`. 8096 Remove obsolete tracing message. 8097 8098 2022-03-25 Werner Lemberg <wl@gnu.org> 8099 8100 Add `FT_PARAM_TAG_IGNORE_SBIX`. 8101 8102 This is another bit to handle 'sbix' tables as described in the OpenType 8103 specification. 8104 8105 * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro. 8106 8107 * src/sfnt/sfobjc.c (is_apple_sbix): Rename to... 8108 (has_sbix): ... this. 8109 Check for more sbit tables. 8110 Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`. 8111 Only call sbit table loader if an sbit table is present. 8112 8113 2022-03-25 Werner Lemberg <wl@gnu.org> 8114 8115 [truetype] Fix 'sbix' table handling. 8116 8117 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of 8118 'metrics->horiBearingY'. 8119 Set vertical metrics. 8120 8121 * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`. 8122 Handle metrics of fonts with 'sbix' table. 8123 8124 * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply 8125 bbox offset and bearing values of the corresponding glyph in the 'glyf' 8126 table if it exists and has a contour. 8127 8128 * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table. 8129 8130 Fixes issue #998. 8131 8132 2022-03-25 Werner Lemberg <wl@gnu.org> 8133 8134 Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`. 8135 8136 Fonts with 'sbix' tables need special handling by the application. 8137 8138 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros. 8139 8140 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix' 8141 table is present. 8142 8143 2022-03-25 Werner Lemberg <wl@gnu.org> 8144 8145 * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public. 8146 8147 2022-03-24 Carlo Bramini <carlo.bramix@libero.it> 8148 8149 [builds/windows] Fix WCE support. 8150 8151 * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by 8152 _alloca. 8153 8154 2022-03-24 Steve Lhomme <robux4@ycbcr.xyz> 8155 8156 [build/windows] Improve UWP support. 8157 8158 * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA. 8159 8160 2022-03-21 Werner Lemberg <wl@gnu.org> 8161 8162 * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table. 8163 8164 Fixes #1141. 8165 8166 2022-03-20 Ben Wagner <bungeman@chromium.org> 8167 8168 [woff2] Support overlap flag for simple glyphs. 8169 8170 In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag 8171 to be retained through the woff2 format [0]. 8172 8173 [0] https://www.w3.org/TR/WOFF2/#glyf_table_format 8174 8175 * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag. 8176 8177 * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and 8178 overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's 8179 flag if the overlap bit is set. 8180 8181 2022-03-19 Werner Lemberg <wl@gnu.org> 8182 8183 [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`. 8184 8185 * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro. 8186 (cff_slot_load): Use it. 8187 8188 2022-03-19 Werner Lemberg <wl@gnu.org> 8189 8190 * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`. 8191 8192 Fixes #1140. 8193 8194 2022-03-19 Werner Lemberg <wl@gnu.org> 8195 8196 * src/base/ftobjs.c (ft_open_face_internal): Thinko. 8197 8198 2022-03-19 Ben Wagner <bungeman@chromium.org> 8199 8200 [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3. 8201 8202 * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added. 8203 8204 2022-03-19 Werner Lemberg <wl@gnu.org> 8205 8206 * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`. 8207 8208 We must ensure that the cast to `FT_Int` doesn't change the sign. 8209 8210 Fixes #1139. 8211 8212 2022-03-17 Werner Lemberg <wl@gnu.org> 8213 8214 [sfnt] Avoid invalid face index. 8215 8216 Fixes #1138. 8217 8218 * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font): 8219 Check `face_index` before decrementing. 8220 8221 2022-03-07 Werner Lemberg <wl@gnu.org> 8222 8223 Documentation, whitespace. 8224 8225 2022-03-05 Anuj Verma <anuj@womp.xyz> 8226 8227 [sdf] Fix corner checks and improve performance. 8228 8229 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if 8230 two distances (for different curves) are very close. 8231 8232 (sdf_conic_to): Check whether the conic curve can be treated as a line 8233 (which happens if the control point coincides with any end point). 8234 8235 2022-03-05 Anuj Verma <anuj@womp.xyz> 8236 8237 [sdf] Implement deviation-based splitting for Bezier curves. 8238 8239 * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure 8240 out the deviation of Bezier curves and stop splitting if the curve is flat 8241 enough. 8242 8243 * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro. 8244 8245 2022-03-05 Anuj Verma <anuj@womp.xyz> 8246 8247 * include/freetype/freetype.h: Improve SDF documentation. 8248 8249 2022-03-03 Ben Wagner <bungeman@chromium.org> 8250 8251 [sfnt] Fix bounds check in SVG. 8252 8253 The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not 8254 protected by parentheses. As a result, the expression 8255 `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to 8256 `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected 8257 `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect 8258 bounds check which may lead to reading past the end of the `SVG ` table. 8259 8260 * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in 8261 parentheses. 8262 8263 Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179 8264 8265 2022-02-23 Ben Wagner <bungeman@chromium.org> 8266 8267 [psaux] Full bounds check for OtherSubr 19. 8268 8269 It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is 8270 NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with 8271 `blend->num_designs` set to 2, and the user supplied `idx` to be large (for 8272 example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds 8273 check overflows in a well defined manner, allowing for an invalid call to 8274 `memcpy`. 8275 8276 In addition, it is possible to call OtherSubr 19 with 8277 `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying 8278 that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes 8279 the bounds check (it is logically always fine to copy nothing starting at 8280 index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed 8281 by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is 8282 undefined behavior (even if `count` is zero). 8283 8284 * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that 8285 `blend->num_designs` can be copied to `decoder->buildchar[idx]`. 8286 Also avoid passing NULL to `ft_memcpy`. 8287 8288 Bug: https://crbug.com/1299259 8289 8290 2022-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 8291 8292 [cmake] Drop the support of CMake 2.x. 8293 8294 * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer. 8295 8296 The issue #1059 reports the difficulty to support both of 8297 CMake 2.x and newer one by single CMakeLists.txt without 8298 the inflation of cmake_policy() workarounds. 8299 8300 For better maintainability, the support of CMake 2.x is 8301 dropped. 8302 8303 2022-02-19 Werner Lemberg <wl@gnu.org> 8304 8305 * src/bdf/README: Updated. 8306 8307 2022-02-19 Werner Lemberg <wl@gnu.org> 8308 8309 * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|. 8310 8311 2022-02-19 Werner Lemberg <wl@gnu.org> 8312 8313 src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize. 8314 8315 A kerning table can be handled by binary search if it has equal entries. 8316 8317 Fixes #1132. 8318 8319 2022-02-17 Steve Lhomme <robux4@ycbcr.xyz> 8320 Alexei Podtelezhnikov <apodtele@gmail.com> 8321 8322 [builds/windows] Add support for legacy UWP builds. 8323 8324 * builds/windows/ftsystem.c: Add neccessary macro substitutions to 8325 enable strict UWP builds. 8326 8327 See !141. 8328 8329 2022-02-16 Werner Lemberg <wl@gnu.org> 8330 8331 ftmm.h: Minor documentation improvement. 8332 8333 2022-02-13 Alexei Podtelezhnikov <apodtele@gmail.com> 8334 8335 [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value. 8336 8337 Before the change, the hinting engine frequently confused horizontal 8338 stem and serif hints making some stems too thin and some serifs too 8339 thick. The value was tuned using serif fonts from the URW+ base 35 8340 collection. 8341 8342 * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/. 8343 8344 2022-02-12 Werner Lemberg <wl@gnu.org> 8345 8346 t1tables.h: Documentation improvements. 8347 8348 2022-02-12 Werner Lemberg <wl@gnu.org> 8349 8350 t1tables.h: Whitespace. 8351 8352 2022-02-11 Werner Lemberg <wl@gnu.org> 8353 8354 [type42] Fix `FT_Get_PS_Font_Private` for this format. 8355 8356 Since Type42 fonts don't have a 'Private' dictionary, the return value 8357 should be `FT_Err_Invalid_Argument`. 8358 8359 * src/type42/t42drivr.c (t42_ps_get_font_private): Removed. 8360 (t42_service_ps_info): Updated. 8361 8362 2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com> 8363 8364 [pshinter] Clear reused mask. 8365 8366 In PS hinter, memory allocations persist until the module is done. 8367 Therefore, we have to clear reused masks. 8368 8369 * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask. 8370 8371 2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com> 8372 8373 [pshinter] Use unsigned indices. 8374 8375 This reduces casting and eliminates some checks. 8376 8377 * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge, 8378 ps_dimension_add_t1stem, ps_hints_t1stem3): Updated. 8379 (ps_dimension_add_counter): Updated, unnecessary checks removed. 8380 8381 2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com> 8382 8383 [pshinter] Fix mask merging. 8384 8385 We forgot to update the number of bits when merging a larger mask 8386 into a smaller one. This fix might have rendering effects. 8387 8388 * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number 8389 of bits from a larger mask. There is no need to zero unused bits, 8390 already zeroed during allocation. 8391 (ps_mask_clear_bit): Removed. 8392 (ps_mask_ensure): Minor. 8393 8394 2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com> 8395 8396 [pshinter] Revise the hint table handling. 8397 8398 * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size 8399 check; avoid array zeroing because it is fully initialized when used. 8400 (ps_hint_table_alloc): Fix off-by-one comparison and remove another 8401 zeroing of the array elements. 8402 8403 2022-02-06 Werner Lemberg <wl@gnu.org> 8404 8405 Various minor doc fixes. 8406 8407 2022-02-06 Alexei Podtelezhnikov <apodtele@gmail.com> 8408 8409 [builds/windows] Add SVG to to project files. 8410 8411 * builds/windows/vc2010/freetype.vcxproj: Updated. 8412 * builds/windows/vc2010/freetype.vcxproj.filters: Updated. 8413 * builds/windows/visualc/freetype.vcproj: Updated. 8414 8415 2022-02-03 Alexei Podtelezhnikov <apodtele@gmail.com> 8416 8417 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources. 8418 8419 2022-02-02 Eric Jing <@CPUcontrol> 8420 8421 [cmake] Fix build on MacOS. 8422 8423 * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building 8424 of a framework on MacOS. 8425 8426 * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier 8427 lowercase only. 8428 8429 Fixes #1127. 8430 8431 2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com> 8432 8433 [psaux] Revise `PS_Table` handling. 8434 8435 The old impleemntation was not using `FT_REALLOC`, buing too careful 8436 with the offset rebasing. It shoudl be safe to rely on the base 8437 movements. 8438 8439 * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine 8440 into... 8441 (ps_table_realloc): ... this function based on `FT_REALLOC`. 8442 (ps_table_done): Simplified. 8443 (ps_table_add): Updated. 8444 8445 2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com> 8446 8447 * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing. 8448 8449 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com> 8450 8451 [cache] Partially revert 9870b6c07e2c. 8452 8453 Fix crashes reported by Werner. 8454 8455 * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again. 8456 8457 2022-01-31 Werner Lemberg <wl@gnu.org> 8458 8459 freetype.h: Minor documentation improvement. 8460 8461 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com> 8462 8463 [cache] Fix fallouts from edd4fedc5427. 8464 8465 Reported by Werner. 8466 8467 * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph. 8468 * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit. 8469 8470 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com> 8471 8472 Clean-up - do not doubt FT_FREE. 8473 8474 * src/base/ftobjs.c (memory_stream_close): Do not reassign zero 8475 after `FT_FREE`. 8476 * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto. 8477 * src/sfnt/sfwoff2.c (stream_close): Ditto. 8478 * src/psaux/psobjs.c (ps_parser_load_field): Ditto. 8479 * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend, 8480 tt_set_mm_blend): Ditto. 8481 8482 2022-01-30 Werner Lemberg <wl@gnu.org> 8483 8484 * CMakeLists.txt: Include 'FindPkgConfig' module. 8485 8486 Older cmake versions don't provide `pkg_check_modules` by default. 8487 8488 Fixes #1126. 8489 8490 2022-01-30 Alexei Podtelezhnikov <apodtele@gmail.com> 8491 8492 * src/psaux/psobjs.c (ps_parser_load_field): Reduce `string` scope. 8493 8494 2022-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 8495 8496 [cmake] Check the availability of `bzip2.pc'. 8497 8498 (CMakeLists.txt): Check the availability of `bzip2.pc'. 8499 8500 * If `bzip2.pc' is available, Requires.private should include 8501 bzip2, but Libs.private should not include -lbz2. 8502 8503 * If `bzip2.pc' is unavailable, Requires.private cannot include 8504 bzip2, but Libs.private should include -lbz2. 8505 8506 Fix #897. 8507 8508 2022-01-28 Werner Lemberg <wl@gnu.org> 8509 8510 * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer. 8511 8512 Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`. 8513 8514 2022-01-28 Alexei Podtelezhnikov <apodtele@gmail.com> 8515 8516 Minor clean-ups. 8517 8518 * src/base/ftrfork.c (raccess_make_file_name): Do not set error. 8519 * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto. 8520 * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error. 8521 * src/psaux/psobjs.c (ps_table_done): Ditto. 8522 * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto. 8523 8524 2022-01-27 Ben Wagner <bungeman@chromium.org> 8525 8526 Document `FT_Outline_Decompose` degenerate segments. 8527 8528 `FT_Outline_Decompose` does not filter out and can return degenerate 8529 segments in an outline. This can be surprising when attemping to 8530 stroke such an outline. Clarify the existing documentation on this 8531 matter to cover all forms of degeneracy (without specifying exactly 8532 how they will be reported), why they might arise, and better explain in 8533 what cases they may be an issue. 8534 8535 * include/freetype/ftoutlin.h (FT_Outline_Decompose): update 8536 documentation. 8537 8538 Fixes #952. 8539 8540 2022-01-27 Anuj Verma <anujv@posteo.net> 8541 8542 Fix sdf computation while `USE_SQUARED_DISTANCES`. 8543 8544 Function `map_fixed_to_sdf` expects spread to be absolute 8545 and not squared. 8546 8547 * src/sdf/ftbsdf.c (finalize_sdf): Pass absolute spread 8548 while `map_fixed_to_sdf`. 8549 8550 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Ditto. 8551 8552 2022-01-27 Tapish Ojha <tapishojha2000@gmail.com> 8553 8554 [sfnt] Improve sRGB constants. 8555 8556 * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly 8557 more precise values. 8558 8559 Fixes #1018. 8560 8561 2022-01-27 Werner Lemberg <wl@gnu.org> 8562 8563 docs/release: Updated. 8564 8565 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com> 8566 8567 * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY. 8568 8569 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com> 8570 8571 * src/sdf/ftsdf.c (sdf_*_new): Use standard macro. 8572 8573 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com> 8574 8575 [pcf] Delay encoding allocation and avoid its zeroing. 8576 8577 * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY. 8578 8579 2022-01-25 Werner Lemberg <wl@gnu.org> 8580 8581 Aarg, typo. 8582 8583 2022-01-25 Werner Lemberg <wl@gnu.org> 8584 8585 freetype.h: More updates to `FT_LOAD_COLOR` description. 8586 8587 2022-01-25 Werner Lemberg <wl@gnu.org> 8588 8589 * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`. 8590 8591 This helps in decoupling library support from `pkg-config` for other 8592 platforms. 8593 8594 2022-01-25 Werner Lemberg <wl@gnu.org> 8595 8596 Update documentation for `FT_LOAD_COLOR`. 8597 8598 2022-01-24 Ben Wagner <bungeman@chromium.org> 8599 8600 [pshinter] Ensure all point flags are initialized. 8601 8602 Only off curve point flags were fully initialized. 8603 8604 * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags. 8605 8606 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930 8607 8608 2022-01-24 Werner Lemberg <wl@gnu.org> 8609 8610 .mailmap: Typo. 8611 8612 2022-01-23 Werner Lemberg <wl@gnu.org> 8613 8614 * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers. 8615 8616 2022-01-23 Werner Lemberg <wl@gnu.org> 8617 8618 .mailmap: Updated. 8619 8620 2022-01-23 Werner Lemberg <wl@gnu.org> 8621 8622 More documentation on handling OT-SVG. 8623 8624 2022-01-23 Werner Lemberg <wl@gnu.org> 8625 8626 * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency. 8627 8628 2022-01-22 Werner Lemberg <wl@gnu.org> 8629 8630 [sfnt] Reject malformed SVG tables. 8631 8632 * src/sfnt/ttsvg.c (SVG_TABLE_HEADER_SIZE, SVG_DOCUMENT_RECORD_SIZE, 8633 SVG_DOCUMENT_LIST_MINIMUM_SIZE, SVG_MINIMUM_SIZE): New macros. 8634 (tt_face_load_svg): Check offsets. 8635 Check table and record sizes. 8636 8637 Reported as 8638 8639 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43918 8640 8641 2022-01-22 Alexei Podtelezhnikov <apodtele@gmail.com> 8642 8643 * src/psaux/psobjs.c (ps_table_new): Revert to zeroing. 8644 8645 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 8646 8647 [psaux, type1, type42] Avoid annecessary zeroing. 8648 8649 * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY. 8650 * src/type1/t1load.c (parse_encoding): Ditto. 8651 * src/type42/t42parse.c (t42_parse_encoding): Ditto. 8652 8653 2022-01-20 Werner Lemberg <wl@gnu.org> 8654 8655 [builds/unix] Handle 'librsvg' for demo programs. 8656 8657 * builds/unix/configure.raw: Check for 'librsvg'. 8658 (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on... 8659 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables. 8660 8661 * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by... 8662 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables. 8663 8664 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 8665 8666 Add 'svg' module for OT-SVG rendering. 8667 8668 * CMakeLists.txt (BASE_SRCS): Add svg module file. 8669 * meson.build (ft2_public_headers): Add `otsvg.h`. 8670 8671 * modules.cfg (RASTER_MODULES): Add `svg` module. 8672 8673 * builds/meson/parse_modules_cfg.py: Add svg module. 8674 8675 * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`. 8676 * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and 8677 `Missing_SVG_Hooks` error codes. 8678 * include/freetype/internal/fttrace.h: Add tracing for `otsvg`. 8679 * include/freetype/internal/svginterface.h: New file. It adds an interface 8680 to enable the presetting hook from the `base` module. 8681 * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func, 8682 SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering. 8683 (SVG_RendererHooks): New structure to access them. 8684 8685 * src/base/ftobjs.c: Include `svginterface.h`. 8686 (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG 8687 glyphs. 8688 (ft_add_renderer): Updated. 8689 8690 * src/svg/*: New files. 8691 8692 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 8693 8694 Add `FT_Glyph` support for OT-SVG glyphs. 8695 8696 * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure. 8697 8698 * src/base/ftglyph.c: Include `otsvg.h`. 8699 (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy, 8700 ft_svg_glyph_transform, ft_svg_glyph_prepare): New function. 8701 (ft_svg_glyph_class): New class. 8702 (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs. 8703 * src/base/ftglyph.h: Updated. 8704 8705 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 8706 8707 [truetype, cff] Add code to load SVG document. 8708 8709 * src/cff/cffgload.c (cff_slot_load): Add code to load SVG doc. 8710 * src/truetype/ttgload.c (TT_Load_Glyph): Add code to load SVG doc. 8711 8712 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 8713 8714 Add code to load OT-SVG glyph documents. 8715 8716 * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro. 8717 * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros. 8718 (FT_LOAD_SVG_ONLY): New internal macro. 8719 * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value 8720 `FT_GLYPH_FORMAT_SVG`. 8721 * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro. 8722 * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`. 8723 * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New 8724 functions. 8725 * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for 8726 the SVG table. 8727 * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the 8728 SVG document and other necessary information of an OT-SVG glyph in a glyph 8729 slot. 8730 * include/freetype/tttags.h (TTAG_SVG): New macro. 8731 8732 * src/base/ftobjs.c: Include `otsvg.h`. 8733 (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other` 8734 if the SVG table exists. 8735 (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed 8736 glyph. 8737 (ft_glyphslot_done): Free the document data if it is a GZIP compressed 8738 glyph. 8739 (FT_Load_Glyph): Don't auto-hint SVG documents. 8740 8741 * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for 8742 FT_GLYPH_FORMAT_SVG. 8743 8744 * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`. 8745 * src/sfnt/sfdriver.c: Include `ttsvg.h`. 8746 (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and 8747 `tt_face_load_svg_doc`. 8748 * src/sfnt/sfnt.c: Include `ttsvg.c`. 8749 * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and 8750 free data of the the SVG table. 8751 * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`, 8752 `tt_face_free_svg` and `tt_face_load_svg_doc`. 8753 * src/sfnt/ttsvg.h: Declarations of the SVG functions in 8754 `ttsvg.c`. 8755 8756 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 8757 8758 Add flag `FT_CONFIG_OPTION_SVG`. 8759 8760 This flag is going to be used to conditionally compile support for OT-SVG 8761 glyphs. FreeType will do the parsing and rely on external hooks for 8762 rendering of OT-SVG glyphs. 8763 8764 * devel/ftoption.h, include/freetype/config/ftoption.h 8765 (FT_CONFIG_OPTION_SVG): New flag. 8766 8767 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 8768 8769 [pshinter] Avoid unnecessary zeroing. 8770 8771 * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init, 8772 psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY. 8773 8774 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 8775 8776 * include/freetype/freetype.h: Clarify `FT_Size` life cycle. 8777 8778 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 8779 8780 [base] Undefined scale means no scale. 8781 8782 It might be surprising that FreeType does not have default ppem and 8783 the size has to be set explicitly or face undefined behavior with 8784 undefined variables and errors. This offers an alternative to 8785 missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined 8786 behavior is bettr than undefined one. 8787 8788 This is alternative to !132 and discussed in 8789 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708 8790 8791 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale. 8792 * include/freetype/freetype.h: Document it. 8793 8794 2022-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> 8795 8796 * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing. 8797 8798 Everything in AF_FaceGlobals is initialized except metrics. Those 8799 are zeroed here and initialized on demand later. 8800 8801 2022-01-16 Alexei Podtelezhnikov <apodtele@gmail.com> 8802 8803 [bdf,type1] Avoid unnecessary hash zeroing. 8804 8805 * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`. 8806 * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`. 8807 8808 2022-01-16 Ozkan Sezer <sezeroz@gmail.com> 8809 8810 Add Watcom C/C++ calling. 8811 8812 In the unlikely case the source is built with OpenWatcom's -ec? 8813 switches to enforce a calling convention, the qsort() compare 8814 function must still be set to __watcall. 8815 8816 * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): 8817 Updated. 8818 8819 2022-01-15 Ben Wagner <bungeman@chromium.org> 8820 8821 [pshinter] Avoid accessing uninitialized zone. 8822 8823 The `normal_top.count` may be 0, implying no `normal_top.zones` exist. 8824 The code must not access these (non-existent) `normal_top.zones`. 8825 8826 * src/pshinter/pshalgo.c (ps_hints_apply): Do not assume that 8827 `normal_top.zones[0]` is initialized. Test `normal_top.count` 8828 before using `normal_top.zones[0]`. Do not rescale if there are no 8829 `zones`. 8830 8831 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43675 8832 8833 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 8834 8835 [cache] Avoid unnecessary zeroing. 8836 8837 * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`. 8838 * src/cache/ftcimage.c (FTC_INode_New): Ditto. 8839 * src/cache/ftcsbits.c (FTC_SNode_New): Ditto. 8840 8841 2022-01-15 Ozkan Sezer <sezeroz@gmail.com> 8842 8843 Add Watcom C/C++ support. 8844 8845 * include/freetype/config/integer-types.h: Make sure `long long` is 8846 used then available. 8847 * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma. 8848 8849 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 8850 8851 * src/sdf/ftbsdf.c (ED): s/near/prox/. 8852 8853 This works around the Watcom C definition of `near` as restricted 8854 __near. 8855 8856 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 8857 8858 * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten. 8859 8860 This works around Watcom C library using __watcall. 8861 8862 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 8863 8864 * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing. 8865 8866 This large allocation is followed by careful initialization. Whatever 8867 is missed should be initialized manually. 8868 8869 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 8870 8871 * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing. 8872 8873 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 8874 8875 * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment. 8876 8877 2022-01-13 Alexei Podtelezhnikov <apodtele@gmail.com> 8878 8879 * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing. 8880 8881 2022-01-13 Ben Wagner <bungeman@chromium.org> 8882 8883 [bzip2] Reset bzip stream on any error. 8884 8885 According to the bzip documentation it is undefined what will happen if 8886 `BZ2_bzDecompress` is called on a `bz_stream` it has previously returned an 8887 error against. If `BZ2_bzDecompress` returns anything other than `BZ_OK` 8888 the only valid next action is `BZ2_bzDecompressEnd`. 8889 8890 Reported as 8891 8892 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564 8893 8894 * src/bzip2/ftbzip2.c (FT_BZip2FileRec_): Add `reset` to track the need to 8895 reset the stream. 8896 (ft_bzip2_file_init): Initialize `reset` to 0. 8897 (ft_bzip2_file_reset): Set `reset` to 0 after resetting. 8898 (ft_bzip2_file_fill_output): Set `reset` to 1 when `BZ2_bzDecompress` 8899 returns anything other than `BZ_OK`. 8900 8901 2022-01-12 Werner Lemberg <wl@gnu.org> 8902 8903 .gitlab-ci.yml: Minor comment cleanups. 8904 8905 2022-01-12 Azamat H. Hackimov <azamat.hackimov@gmail.com> 8906 8907 .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA. 8908 8909 Fetch current list of valid CAs from Windows Update and manually import them 8910 to trusted datastore. This action is required to make downloads work from 8911 sites that need recent Let's Encrypt ISRG Root X1 certificate. 8912 8913 2022-01-11 Ben Wagner <bungeman@chromium.org> 8914 8915 Revert "[bzip2] Avoid use of uninitialized memory." 8916 8917 This reverts commit d276bcb7f0c02c20d3585b2e5626702df6d140a6. 8918 8919 The original commit did avoid the use of uninitialized memory. However, 8920 it appears that the original commit is no longer required. The 8921 underlying issue was resolved by a change in freetype2-testing "Build 8922 bzip2 correctly." [0]. Prior to [0] bzip2 was built without msan, so 8923 bzip2 writes were not tracked or considered initialized. Clearing 8924 `buffer` in the original commit allowed msan to see the `buffer` content 8925 initialized once in FreeType code, but msan saw no writes into buffer 8926 from bzip2. With bzip2 now built with msan, the bzip2 writes are 8927 properly instrumented and msan sees the bzip2 writes into the buffer. As 8928 a result the original commit can be safely reverted to allow for better 8929 detection of other uninitialized data scenarios. 8930 8931 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Revert to using `FT_QNEW`. 8932 8933 [0] https://github.com/freetype/freetype2-testing/commit/3c052a837a3c960709227a0d6ddd256e87b88853 8934 8935 2022-01-11 Ben Wagner <bungeman@chromium.org> 8936 8937 [type42] Track how much type42 ttf data is available. 8938 8939 Currently `T42_Open_Face` eagerly allocates 12 bytes for the ttf header 8940 data which it expects `t42_parse_sfnts` to fill out from /sfnts data. 8941 However, there is no guarantee that `t42_parse_sfnts` will actually be 8942 called while parsing the type42 data as the /sfnts array may be missing 8943 or very short. This is also confusing behavior as it means 8944 `T42_Open_Face` is tightly coupled to the implementation of the very 8945 distant `t42_parse_sfnts` code which requires at least 12 bytes to 8946 already be reserved in `face->ttf_data`. 8947 8948 `t42_parse_sfnts` itself eagerly updates `face->ttf_size` to track how 8949 much space is reserved for ttf data instead of traking how much data has 8950 actually been written into `face->ttf_data`. It will also act strangely 8951 in the presense of multiple /sfnts arrays. 8952 8953 * src/type42/t42objs.c (T42_Open_Face): ensure `ttf_data` is initialized 8954 to NULL. Free `ttf_data` on error. 8955 8956 * src/type42/t42parse.c (t42_parse_sfnts): delay setting `ttf_size` and 8957 set it to the actual number of bytes read. Ensure `ttf_data` is freed 8958 if there are multiple /sfnts arrays or there are any errors. 8959 8960 2022-01-11 Dominik Röttsches <drott@chromium.org> 8961 8962 [sfnt] Fix limit checks for `COLR` v1 ClipBoxes 8963 8964 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Fix off-by-one in 8965 limit checks. 8966 8967 2022-01-11 Werner Lemberg <wl@gnu.org> 8968 8969 Update all copyright notices. 8970 8971 2022-01-11 Werner Lemberg <wl@gnu.org> 8972 8973 * src/sfnt/ttcolr.c (read_paint): Fix undefined left-shift operation. 8974 8975 Reported as 8976 8977 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43151 8978 8979 2022-01-11 Werner Lemberg <wl@gnu.org> 8980 8981 * src/type42/t42objs.c (T42_Open_Face): Avoid use of uninitialized memory. 8982 8983 Reported as 8984 8985 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43508 8986 8987 2022-01-11 Werner Lemberg <wl@gnu.org> 8988 8989 .gitlab-ci.yml: Fix typo in previous commit. 8990 8991 2022-01-11 Werner Lemberg <wl@gnu.org> 8992 8993 .gitlab-ci.yml: Update Windows image. 8994 8995 The old image produced errors like 8996 8997 ``` 8998 Downloading zlib patch from 8999 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch 9000 A fallback URL could be specified using patch_fallback_url key in the wrap file 9001 WrapDB connection failed to 9002 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch 9003 with error 9004 <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 9005 failed: certificate has expired (_ssl.c:1122)> 9006 ``` 9007 9008 2022-01-11 Werner Lemberg <wl@gnu.org> 9009 9010 * subprojects/zlib.wrap: Update from upstream. 9011 9012 2022-01-10 Werner Lemberg <wl@gnu.org> 9013 9014 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Add limit checks. 9015 9016 Reported as 9017 9018 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40716 9019 9020 2022-01-10 Werner Lemberg <wl@gnu.org> 9021 9022 [zlib] Don't typedef `ptrdiff_t`. 9023 9024 While using zlib in 'solo' mode (via the `Z_SOLO` macro), we actually 9025 include some standard header files, making the typedef fail on systems where 9026 the native `ptrdiff_t` type differs. 9027 9028 Fixes #1124. 9029 9030 * src/zlib/zutil.h: Comment out definition; it doesn't work on Windows. 9031 9032 * src/zlib/patches/freetype-zlib.diff: Updated. 9033 9034 2022-01-10 Werner Lemberg <wl@gnu.org> 9035 9036 [zlib] Some organizational changes. 9037 9038 We now first apply zlib's `zlib2ansi` script, then FreeType's patch file. 9039 9040 * src/gzip/README.freetype: Updated. 9041 9042 * patches/0001-zlib-Fix-zlib-sources-to-compile-for-FreeType.patch: Renamed 9043 to... 9044 * patches/freetype-zlib.diff: This. 9045 Clean up description, then regenerate it as follows: 9046 9047 - Copy unmodified files from `zlib` repository. 9048 - Run `zlib2ansi` script. 9049 - Run `git diff -R > patches/freetype-zlib.diff.new`. 9050 - Insert patch description of old diff file, then replace old diff with 9051 new diff file. 9052 9053 2022-01-09 David Turner <david@freetype.org> 9054 9055 [gzip] Update sources to zlib 1.2.11 9056 9057 This can be tested by building with the Unix development build 9058 9059 make setup devel 9060 make 9061 9062 or by building the freetype-demos programs with 9063 9064 meson setup build -Dfreetype2:zlib=internal 9065 meson compile -C out 9066 9067 and trying to run `ftview` with a `.pcf.gz` font file. 9068 9069 * src/gzip/ftgzip.c, src/gzip/rules.mk: Update for new zlib sources. Also 9070 remove the temporary fix introduced in commit 6a431038 to work around the 9071 fact that the internal sources were too old. 9072 9073 * src/gzip/README.freetype: New file describing the origin of the sources 9074 and how they were modified. 9075 9076 * src/gzip/patches/*: Patch files applied to original sources. 9077 9078 * src/gzip/*: Updated zlib sources with the patch file(s) from 9079 `src/gzip/patches/` applied, followed by a conversion with zlib's 9080 `zlib2ansi` script. 9081 9082 2022-01-09 David Turner <david@freetype.org> 9083 9084 [meson] Change Zlib configuration option. 9085 9086 * meson_options.txt, meson.build: Change the format of the 'zlib' meson 9087 build configuration option to be a combo with the following choices: 9088 9089 - none: Do not support gzip-compressed streams at all. 9090 9091 - internal: Support gzip-compressed streams using the copy of the gzip 9092 sources under `src/gzip/`; this should only be used during development 9093 to ensure these work properly. 9094 9095 - external: Support gzip-compressed streams using the 'zlib' Meson 9096 subproject, linked as a static library. 9097 9098 - system: Support gzip-compressed streams using a system-installed version 9099 of zlib. 9100 9101 - auto: Support gzip-compressed streams using a system-installed version 9102 of zlib, if available, or using the 'zlib' subproject otherwise. This 9103 is the default. 9104 9105 - disabled: Backward-compatible alias for 'none'. 9106 9107 - enabled: Backward-compatible alias for 'auto'. 9108 9109 2022-01-09 Werner Lemberg <wl@gnu.org> 9110 9111 [bzip2] Avoid use of uninitialized memory. 9112 9113 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but 9114 `FT_NEW` for setting up `zip` to avoid uninitialized memory access while 9115 handling malformed PCF fonts later on. 9116 9117 Fixes 9118 9119 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800 9120 9121 2022-01-09 Alexei Podtelezhnikov <apodtele@gmail.com> 9122 9123 [sfnt] Fix off-by-one error. 9124 9125 The 0-base index is equal to the number of previosly parsed entries. 9126 It is an error to adjust it by one to get the number truncated by 9127 a stream error. This is probably inconsequential because valid 9128 entries are correctly accounted for. 9129 9130 * src/sfnt/ttload.c (check_table_dir): Do not adjust the truncated 9131 number of tables. 9132 9133 2022-01-08 Werner Lemberg <wl@gnu.org> 9134 9135 [sfnt, type42] Correct previous commit. 9136 9137 Really fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773. 9138 9139 * src/sfnt/ttload.c (check_table_dir): Revert change. 9140 9141 * src/type42/t42.parse.c (t42_parse_sfnts): Don't use `FT_QREALLOC` but 9142 `FT_REALLOC` for setting up `ttf_data` to avoid uninitialized memory access 9143 while handling malformed TrueType fonts later on. 9144 9145 2022-01-07 Werner Lemberg <wl@gnu.org> 9146 9147 * src/sfnt/ttload.c (check_table_dir): Initialize `table`. 9148 9149 Reported as 9150 9151 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773 9152 9153 2022-01-07 Werner Lemberg <wl@gnu.org> 9154 9155 [sfnt] Avoid 'runtime error: applying zero offset to null pointer'. 9156 9157 * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if 9158 `line` is NULL. 9159 9160 2022-01-07 Werner Lemberg <wl@gnu.org> 9161 9162 [autofit, pshinter] Use `FT_OFFSET`. 9163 9164 This avoids 9165 9166 ``` 9167 runtime error: applying zero offset to null pointer 9168 ``` 9169 9170 warnings of clang's undefined behaviour sanitizer. 9171 9172 * src/autofit/afcjk.c (af_cjk_hints_link_segments, 9173 af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges, 9174 af_cjk_hint_edges, af_cjk_align_edge_points): Do it. 9175 9176 * src/autofit/afhints.c (af_glyph_hints_align_edge_points, 9177 af_glyph_hints_align_strong_points): Ditto. 9178 9179 * src/autofit/aflatin.c (af_latin_metrics_init_widths, 9180 af_latin_hints_link_segments, af_latin_hints_compute_edges, 9181 af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto. 9182 9183 * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto. 9184 9185 2022-01-06 Ben Wagner <bungeman@chromium.org> 9186 9187 [truetype] Reset localpoints when varying cvt. 9188 9189 When iterating over the cvt tuples and reading in the points it is necessary 9190 to set all of `localpoints`, `points`, and `point_count` in all cases. The 9191 existing code did not reset `localpoints` to `NULL` when there were no 9192 private point numbers. If the previous tuple did have private point numbers 9193 and set `localpoints` to `ALL_POINTS` this would not be cleared and the 9194 wrong branch would be taken later, leading to possible heap buffer overflow. 9195 9196 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Reset `localpoints` to `NULL` 9197 when it isn't valid. 9198 9199 Fixes: https://crbug.com/1284742 9200 9201 2022-01-02 Werner Lemberg <wl@gnu.org> 9202 9203 * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable. 9204 9205 This was accidentally removed with commit 93ebcbd0 almost eight years ago. 9206 9207 2021-12-27 Alexander Borsuk <me@alex.bio> 9208 9209 Fix warnings for CMake Unity builds. 9210 9211 * src/cache/ftcbasic.c (FT_COMPONENT): Undefine macro before redefinition. 9212 * src/smooth/ftgrays.c (TRUNC, FRACT): Ditto. 9213 9214 2021-12-18 Alexander Borsuk <alexander.borsuk@qnective.com> 9215 9216 Clang-Tidy warning fixes. 9217 9218 * src/base/ftobjs.c (FT_Get_Paint): Operator has equivalent nested operands. 9219 * src/bdf/bdflib.c (_bdf_add_property): Value stored to `fp` is never read. 9220 * src/sdf/ftbsdf.c (bsdf_init_distance_map): Value stored to `pixel` is 9221 never read. 9222 * src/sdf/ftsdf.c (split_sdf_shape): Value stored to `error` is never read. 9223 9224 2021-12-17 Eli Schwartz <eschwartz@archlinux.org> 9225 9226 * meson.build: Optimize lookup for `python3` program. 9227 9228 The python module's `find_installation` method is intended to provide 9229 routines for compiling and installing python modules into the 9230 `site-packages` directory. It does a couple of slow things, including run 9231 an introspection command to scrape sysconfig info from the detected 9232 interpreter, which are not needed for the sole use case of invoking the 9233 found installation as an executable. 9234 9235 Furthermore, when invoked without the name or path of a python binary, it is 9236 hardcoded to always look for `python3` corresponding to the interpreter 9237 meson itself uses to run. So using `find_installation` did not even allow 9238 detecting `python2` as a fallback. 9239 9240 Instead, switch to a simple `find_program` lookup that finishes as soon as 9241 the program is found. 9242 9243 2021-12-17 Eli Schwartz <eschwartz@archlinux.org> 9244 9245 * builds/meson/*.py: Fix name of python executable for auxiliary scripts. 9246 9247 The previous change to check the return code of `run_command` invocations 9248 caused the CI to fail. Although most scripts used `python_exe` as the 9249 program command, the script to determine the project version did not. 9250 9251 But, all scripts used `python` as the shebang, and this is not available on 9252 all systems. Particularly Debian does not provide a `python` command, 9253 though `python3` does exist. This meant that formerly the version number 9254 was lacking, and now the build simply fails. 9255 9256 Instead, rely on `python3` since it is guaranteed to exist when running 9257 meson, and `python2` is end of life anyway. 9258 9259 2021-12-17 Eli Schwartz <eschwartz@archlinux.org> 9260 9261 * meson.build: Check the return value of `run_command`. 9262 9263 By default, errors are not checked and a command that is somehow broken will 9264 just capture incorrect output (likely an empty string). Current development 9265 versions of meson now raise a warning for this implicit behavior, and advise 9266 explicitly setting the `check:` keyword argumend to determine whether a 9267 failing return code should be considered an error. 9268 9269 Since none of the commands in this project are expected to fail, mark them 9270 as required to succeed. 9271 9272 2021-12-13 Alexei Podtelezhnikov <apodtele@gmail.com> 9273 9274 [truetype] Upstream the hdmx binary search. 9275 9276 * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx 9277 widths. 9278 * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even 9279 though it might never be used by the interpreter. 9280 * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches 9281 in the hdmx table. 9282 9283 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9284 9285 [truetype] Reset the IUP-called flags for each subglyph. 9286 9287 This fixes fall-out from 7809007a5b88b15, where the composite 9288 accents were no longer hinted. 9289 9290 * src/truetype/ttgload.c (ttloader_init): Move the IUP-called flag 9291 initialization from here... 9292 * src/truetype/ttinterp.c (TT_Run_Context): ... to here. 9293 9294 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9295 9296 [truetype] Binary search through the `hdmx` records. 9297 9298 The `hdmx` table is supposed to be sorted by ppem size, which 9299 enables binary search. We also drop the check for the sufficient 9300 length of the record because it is now enforced when the table 9301 is loaded. 9302 9303 * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx` 9304 record pointers sorted by ppem instead of ppem's themselves. 9305 * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records. 9306 (tt_face_get_device_metrics): Implement binary search to retrieve 9307 advances. 9308 9309 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9310 9311 [truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable. 9312 9313 This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY 9314 is specified by FT_Get_Advances and the `hdmx` data are located. 9315 Particularly, the classic v35 interpreter or "verified" ClearType 9316 fonts might see 100x speed up in retrieving the hdmx cache. 9317 9318 * src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut. 9319 9320 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9321 9322 [truetype] Initialize the loader with `hdmx` data. 9323 9324 The `hdmx` matching can be done before the glyph is loaded. 9325 9326 * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field. 9327 * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx` 9328 code from here... 9329 (tt_loader_init): ... to here, before the glyph is loaded. 9330 9331 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9332 9333 [truetype] Relocate subpixel flag setting. 9334 9335 `TT_RunIns` is too busy to deal with subpixel flags. It is better 9336 to set them in `tt_loader_init`, which is executed before each 9337 glyph program. 9338 9339 * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting from 9340 here... 9341 * src/truetype/ttgload.c (tt_loader_init): ... to here. 9342 9343 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9344 9345 [truetype] Limit INSTCTRL appication within specs. 9346 9347 * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects 9348 to the CVT program and local effects to the glyph program. 9349 9350 This also fixes an Infinality buglet. The `ignore_x_mode` should be 9351 locally unset by the glyph program. 9352 9353 2021-12-09 Ben Wagner <bungeman@chromium.org> 9354 9355 [bdf] Fix use of uninitialized value. 9356 9357 In _bdf_readstream if the data contained no newline then the buffer 9358 would continue to grow and uninitialized data read until either the 9359 uninitialized data contained a newline or the buffer reached its 9360 maxiumum size. The assumption was that the line was always too long and 9361 the buffer had been filled, however this case can also happen when there 9362 is not enough data to fill the buffer. 9363 9364 Correct this by properly setting the cursor to the end of the available 9365 data, which may be different from the end of the buffer. This may still 9366 result in one extra allocation, but only on malformed fonts. 9367 9368 * src/bdf/bdflib.c (_bfd_readstream): Correctly update cursor. Remove 9369 unread set of `avail`. 9370 9371 Bug: https://lists.nongnu.org/archive/html/freetype-devel/2021-12/msg00001.html 9372 9373 2021-12-07 Alexei Podtelezhnikov <apodtele@gmail.com> 9374 9375 [truetype] Reduce Infinality footprint again. 9376 9377 * src/truetype/ttgload.c (compute_glyph_metrics): Streamline and 9378 prioritize the Infinality checks to use `hdmx`. 9379 9380 2021-12-07 Cameron Cawley <ccawley2011@gmail.com> 9381 9382 [builds/windows] Guard some non-ancient API. 9383 9384 We can support Windows 98 and NT 4.0 in principle... 9385 9386 * builds/windows/ftdebug.c, builds/windows/ftsystem.c: Check for the 9387 ancient SDK using _WIN32_WINDOWS, _WIN32_WCE, or _WIN32_WINNT. 9388 9389 2021-12-07 Cameron Cawley <ccawley2011@gmail.com> 9390 9391 * builds/windows/visualc/freetype.vcproj: Add missing file. 9392 9393 2021-12-02 Werner Lemberg <wl@gnu.org> 9394 9395 * Version 2.11.1 released. 9396 ========================== 9397 9398 Tag sources with `VER-2-11-1'. 9399 9400 * docs/VERSION.TXT: Add entry for version 2.11.1. 9401 * docs/CHANGES, docs/release: Updated. 9402 9403 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 9404 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 9405 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 9406 docs/freetype-config.1: s/2.11.0/2.11.1/, s/2110/2111/. 9407 9408 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. 9409 9410 * builds/unix/configure.raw (version_info): Set to 24:1:18. 9411 * CMakeLists.txt (VERSION_PATCH): Set to 1. 9412 9413 * builds/toplevel.mk (version_tag, CHANGELOG_SCRIPT): New variables. 9414 (do-dist): Generate `ChangeLog` file with all commits since last release. 9415 9416 2021-11-30 Alexei Podtelezhnikov <apodtele@gmail.com> 9417 9418 [builds/windows] Improve debugging. 9419 9420 * builds/windows/ftdebug.c (FT_Message, FT_Panic): Buffer output 9421 and call `OutputDebugStringA` only if `IsDebuggerPresent`. 9422 [_WIN32_WCE] (OutputDebugStringA): Implement the missing API. 9423 9424 2021-11-29 Seigo Nonaka <nona@google.com> 9425 9426 * src/base/ftobjs.c (FT_Request_Metrics): Fix build warning on Android. 9427 9428 Use casts since `FT_USHORT_MAX` is unsigned short in bionic (libc used in 9429 Android). 9430 9431 2021-11-28 Alexei Podtelezhnikov <apodtele@gmail.com> 9432 9433 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Minor tweak. 9434 9435 2021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com> 9436 9437 * src/truetype/ttpload.c (tt_face_load_hdmx): Added comments. 9438 9439 2021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com> 9440 9441 [truetype] Quietly reject out-of-spec `hdmx` tables. 9442 9443 The `hdmx` table is optional and can be safely rejected without 9444 an error if it does not follow specifications. The record size 9445 must be equal to the number of glyphs + 2 + 32-bit padding. 9446 9447 * src/truetype/ttpload.c (tt_face_load_hdmx): Thoroughly check 9448 the record size and improve tracing. 9449 9450 2021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com> 9451 9452 [truetype] Partly revert 5b626281. 9453 9454 Fixes #1118. 9455 9456 * src/truetype/ttpload.c (tt_face_load_hdmx): Do not assume that 9457 `record_size` is rounded even though the records are padded. 9458 9459 2021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com> 9460 9461 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Use transforms. 9462 9463 2021-11-22 Werner Lemberg <wl@gnu.org> 9464 9465 Update `CHANGES` files, other minor whitespace and documentation issues. 9466 9467 2021-11-21 Werner Lemberg <wl@gnu.org> 9468 9469 formats.txt: Add info about WOFF and WOFF2. 9470 9471 2021-11-21 Werner Lemberg <wl@gnu.org> 9472 9473 meson.build: Initialize `common_ldflags`. 9474 9475 2021-11-21 Lukas Oberhuber <@lukaso> 9476 9477 * meson.build: Fix compatibility version on MacOS. 9478 9479 Fixes #1117. 9480 9481 2021-11-21 Werner Lemberg <wl@gnu.org> 9482 9483 * src/truetype/ttinterp.c (Ins_MD): Avoid `FT_ABS`. 9484 9485 Reported as 9486 9487 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38562 9488 9489 2021-11-20 Alexei Podtelezhnikov <apodtele@gmail.com> 9490 9491 * include/freetype/fttypes.h (FT_MAKE_TAG): Remove the same casting. 9492 9493 2021-11-20 Werner Lemberg <wl@gnu.org> 9494 9495 [gxvalid] Fix minor compilation warning. 9496 9497 * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup): Declare 9498 as static. 9499 9500 2021-11-20 Werner Lemberg <wl@gnu.org> 9501 9502 [smooth] Fix stand-alone compilation. 9503 9504 * src/smooth/ftgrays.c (FT_Trace_Enable, FT_Trace_Disable)[STANDALONE_]: 9505 Define. 9506 9507 2021-11-20 Werner Lemberg <wl@gnu.org> 9508 9509 Avoid undefined left-shifts. 9510 9511 We really have to use double casts to avoid issues with C's and C++'s 9512 signedness propagation rules in implicit casts. 9513 9514 Reported as 9515 9516 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41178 9517 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41182 9518 9519 * include/freetype/config/public-macros.h (FT_STATIC_CAST, 9520 FT_REINTERPRET_CAST): Modify macro to take two arguments. 9521 Update all callers. 9522 (FT_STATIC_BYTE_CAST): New macro. 9523 9524 * include/freetype/freetype.h (FT_ENC_TAG): Use `FT_STATIC_BYTE_CAST`. 9525 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto. 9526 * include/freetype/fttypes.h (FT_MAKE_TAG): Ditto. 9527 Use `FT_Tag` for casting. 9528 9529 * src/ftraster/ftmisc.h (FT_MAKE_TAG): Removed, no longer needed. 9530 (FT_STATIC_BYTE_CAST): New macro. 9531 9532 * src/smooth/ftgrays.c (FT_STATIC_CAST): Replace with... 9533 (FT_STATIC_BYTE_CAST): ... this. 9534 9535 2021-11-18 Werner Lemberg <wl@gnu.org> 9536 9537 Provide C++ versions for public macros with casts. 9538 9539 Many FreeType clients use C++. However `g++ -Wold-style-cast` warns for 9540 macros with C-style casts even for system header files; this also affects 9541 directories included with `-isystem`. While this could be seen as a problem 9542 with g++, the problem is more a philosophical one: Over the time, C and C++ 9543 diverged more and more, and some features of C are no longer the 'right' 9544 solution in C++. 9545 9546 * include/freetype/config/public-macros.h (FT_STATIC_CAST, 9547 FT_REINTERPRET_CAST): New macros. 9548 9549 * include/freetype/freetype.h (FT_ENC_TAG, FT_LOAD_TARGET_, 9550 FT_LOAD_TARGET_MODE): Use `FT_STATIC_CAST`. 9551 Correctly handle negative 'signed char' input. 9552 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto. 9553 * include/freetype/fttypes.h (FT_MAKE_TAG, FT_BOOL): Ditto. 9554 * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): Use 9555 `FT_REINTERPRET_CAST`. 9556 9557 * src/smooth/ftgrays.c (FT_STATIC_CAST)[STANDALONE_]: New macro. 9558 [!STANDALONE]: Include `FT_CONFIG_CONFIG_H`. 9559 9560 Fixes #1116. 9561 9562 2021-11-16 Werner Lemberg <wl@gnu.org> 9563 9564 Fix clang++ warnings. 9565 9566 * src/*: Initialize some variables to NULL. 9567 9568 2021-11-16 Werner Lemberg <wl@gnu.org> 9569 9570 [truetype] Updates for the forthcoming OpenType 1.9 standard (2/2). 9571 9572 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): 9573 s/shortDeltaCount/wordDeltaCount/ (as done in the specification, too). 9574 Recognize new format and reject it for now. 9575 9576 2021-11-16 Werner Lemberg <wl@gnu.org> 9577 9578 [truetype] Updates for the forthcoming OpenType 1.9 standard (1/2). 9579 9580 This is in preparation for implementing `DeltaSetIndexMap` format 1, which 9581 is used by `COLR` v1 tables, and which allows 32bit indices. 9582 9583 https://docs.microsoft.com/en-us/typography/opentype/otspec190/delta/otvarcommonformats_delta.html 9584 9585 * src/truetype/ttgxvar.h (GX_DeltaSetIdxMapRec): Change type of `mapCount` 9586 to `FT_ULong`. 9587 9588 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping): Add argument 9589 for passing the table size; update caller. 9590 Implement new format. 9591 9592 2021-11-14 Werner Lemberg <wl@gnu.org> 9593 9594 Fix clang warnings. 9595 9596 * src/gxvalid/gxvcmmn.h (GXV_SET_ERR_IF_PARANOID): Use 'do' block. 9597 * src/gxvalid/gxvmod.c (GXV_TABLE_LOAD, GXV_TABLE_VALIDATE): Ditto. 9598 9599 * src/smooth/ftgrays.c (gray_convert_glyph): Add cast. 9600 9601 * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Remove cast. 9602 * src/type1/t1load.c (read_binay_data): Use `FT_ULong` for `size` parameter. 9603 (parse_subrs, parse_charstrings, parse_dict): Ditto; also add some casts. 9604 9605 2021-11-13 Dominik Röttsches <drott@chromium.org> 9606 9607 [sfnt] Avoid undefined shifts in `COLR` v1 paint parsing 9608 9609 * src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Tighten shift 9610 behavior by using multiplication, mostly using macros from ftcalc.h. 9611 9612 Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1269168 9613 9614 2021-11-13 Alexei Podtelezhnikov <apodtele@gmail.com> 9615 9616 [builds/windows] Improve `DlgCopy` target. 9617 9618 Fixes #1113. 9619 9620 * builds/windows/vc2010/freetype.vcxproj: Run `DlgCopy` conditionally 9621 and decouple it from `Build`. 9622 9623 2021-11-12 Alexei Podtelezhnikov <apodtele@gmail.com> 9624 9625 Explicitly define `FT_MSB` for Clang. 9626 9627 * include/freetype/internal/ftcalc.h [__clang__] (FT_MSB): Updated. 9628 9629 2021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com> 9630 9631 * src/truetype/ttgxvar.c (ft_var_to_normalized): Edge optimization. 9632 9633 2021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com> 9634 9635 Additional `FT_MSB` macro definitions. 9636 9637 Better macros for Windoes CE and ARM in general, based on !109 9638 from metarutaiga. 9639 9640 * include/freetype/internal/ftcalc.h [_MSC_VER] (FT_MSB): Updated. 9641 9642 2021-11-09 Alexei Podtelezhnikov <apodtele@gmail.com> 9643 9644 [build/windows] Remove logging from default debug configurations. 9645 9646 DLG is rather costly for performance and should be used judiciously. 9647 This removes it from the default configurations but gives an example 9648 how to enable it using the `UserDefines` property. 9649 9650 * builds/windows/vc2010/freetype.vcxproj: Hide FT_DEBUG_LOGGING. 9651 9652 2021-11-08 Werner Lemberg <wl@gnu.org> 9653 9654 * src/sfnt/sfobjs.c (sfnt_open_font): Fix typo. 9655 9656 2021-11-08 Werner Lemberg <wl@gnu.org> 9657 9658 * src/gxvalid.*, src/otvalid.*: Fix `-Wformat` warnings. 9659 9660 2021-11-08 Werner Lemberg <wl@gnu.org> 9661 9662 [pshinter] Fix C++ compilation. 9663 9664 * src/pshinter/pshalgo.c (psh_compute_dir): Fix type of `result`. 9665 (psh_hint_table_find_strong_points): Add cast. 9666 9667 2021-11-08 Werner Lemberg <wl@gnu.org> 9668 9669 [sfnt] Reduce footprint if WOFF and WOFF2 support is not needed. 9670 9671 Based on a patch from metarutaiga (MR !106). The gist of this commit is 9672 that it doesn't make sense to support WOFF without compression (which would 9673 be only possible in WOFF 1.0 anyway). 9674 9675 * src/sfnt/sfobjs.c (sfnt_open_font): Guard WOFF code with 9676 `FT_CONFIG_OPTION_USE_ZLIB` block. 9677 Guard WOFF2 code with `FT_CONFIG_OPTION_USE_BROTLI` block. 9678 9679 * src/sfnt/sfwoff.c, src/sfnt/sfwoff.h: Guard files with 9680 `FT_CONFIG_OPTION_USE_ZLIB` blocks, not parts of the code. 9681 9682 * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h, src/sfnt/woff2tags.c, 9683 src/sfnt/woff2tags.h: Guard files with `FT_CONFIG_OPTION_USE_BROTLI` blocks, 9684 not parts of the code. 9685 9686 Fixes #1111. 9687 9688 2021-11-08 Werner Lemberg <wl@gnu.org> 9689 9690 [truetype] Make trickyness checks depend on TT_USE_BYTECODE_INTERPRETER. 9691 9692 Based on a patch from metarutaiga (MR !106). 9693 9694 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag, 9695 tt_check_trickyness_family, tt_synth_sfnt_checksum, tt_get_sfnt_checksum, 9696 tt_check_trickyness_sfnt_ids, tt_check_trickyness): Put functions into a 9697 `TT_USE_BYTECODE_INTERPRETER` block. 9698 (tt_face_init): Put trickyness checks into a `TT_USE_BYTECODE_INTERPRETER` 9699 block. 9700 9701 Fixes #1111. 9702 9703 2021-11-08 Alexei Podtelezhnikov <apodtele@gmail.com> 9704 9705 * src/sfnt/ttload.c (tt_face_load_gasp): Fix a type mismatch warning. 9706 9707 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 9708 9709 [dlg] Define DLG_STATIC explicitly. 9710 9711 DLG_STATIC is intended to disable Windows DLL linking attributes. 9712 It does not hurt to define it explicitly when we wrap DLG code. 9713 This fixes tons of LNK4286 and C4273 warnings from MSVC if we 9714 forget to define DLG_STATIC as a compiler option. 9715 9716 * builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option. 9717 * src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC. 9718 * include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto. 9719 9720 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 9721 9722 [dlg] Lighten up the inclusions. 9723 9724 The DLG wrapper needs to know if FT_DEBUG_LOGGING is defined in 9725 `ftoption.h`. It does not need entire FreeType. 9726 9727 * src/dlg/dlgwrap.c: Include FT_CONFIG_OPTIONS_H directly. 9728 9729 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 9730 9731 [truetype] Avoid some memory zeroing in variations. 9732 9733 * src/truetype/ttgxvar.c (ft_var_readpackeddeltas, ft_var_load_avar, 9734 ft_var_load_item_variation_store, ft_var_load_gvar): Use FT_QNEW_ARRAY 9735 if memory immediately initialized or discarded otherwise. 9736 9737 2021-11-05 Jany Belluz <jany.belluz@daltonmaag.com> 9738 9739 [truetype] Fix handling of packed deltas in Variation Fonts. 9740 9741 * src/truetype/ttgxvar (ft_var_readpackeddeltas): Don't expect the number of 9742 bytes used to encode the deltas to be higher than the number of encoded 9743 values. The specification allows a very compact encoding; for example, a 9744 list of 200 zeros can be encoded with just a couple of bytes. 9745 9746 We now count the consumed bytes to make sure to not read more than expected. 9747 9748 2021-11-04 Jany Belluz <jany.belluz@daltonmaag.com> 9749 9750 [truetype] Fix CVAR handling of tuples for all points. 9751 9752 * src/truetype/ttgxvar (tt_face_vary_cvt): Function 9753 `ft_var_readpackedpoints`, when it returns `ALL_POINTS`, also sets 9754 `point_count` to value 0. However, the CVAR code was incorrectly expecting 9755 that `point_count` would be set to match the length of the CVT table. 9756 9757 2021-11-04 Jany Belluz <jany.belluz@daltonmaag.com> 9758 9759 * src/truetype/ttgxvar.c: Fix typos in macros that guard CVAR code. 9760 9761 2021-11-04 Alexei Podtelezhnikov <apodtele@gmail.com> 9762 9763 * docs/INSTALL: Mention Meson and MSBuild more prominently. 9764 9765 2021-11-03 Gabor Kertesz <gabor.kertesz@linaro.org> 9766 9767 [libpng] Update Meson wrap for win-arm64 9768 9769 1.6.37-5 released patches for win-arm64 to successfully build 9770 libpng with Meson: 9771 https://github.com/mesonbuild/wrapdb/pull/205 9772 https://github.com/mesonbuild/wrapdb/pull/216 9773 9774 Updated by the following command: 9775 meson wrap update libpng 9776 9777 Tested on win-arm64 and x64. 9778 9779 2021-11-03 Dominik Röttsches <drott@chromium.org> 9780 9781 [sfnt] Clarify `COLR` v1 FT_Paint* format representations 9782 9783 * include/freetype/ftcolor.h (FT_PaintLinearGradient, 9784 FT_PaintRadialGradient, FT_PaintSweepGradient, FT_PaintTransform, 9785 FT_PaintTranslate, FT_PaintScale, FT_PaintRotate, FT_PaintSkew): Clarify 9786 16.16 fixed point representation of struct fields. 9787 * src/sfnt/ttcolr.c (read_paint): Shift coordinates for 9788 FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient 9789 accordingly. 9790 9791 Fixes: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1110 9792 9793 2021-11-03 Alexei Podtelezhnikov <apodtele@gmail.com> 9794 9795 [builds/windows] Let MSBuild handle DLG copy. 9796 9797 * builds/windows/vc2010/freetype.vcxproj: Specify DlgCopy target. 9798 * builds/windows/vc2010/script.bat: Deleted. 9799 9800 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com> 9801 9802 * src/truetype/ttgload.c (load_truetype_glyph): Fix MSVC warning C4312. 9803 9804 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com> 9805 9806 [builds/windows] Separate MSVC linker and librarian. 9807 9808 MSVC uses LIB for static and LINK for dynamic libraries. They are 9809 related but the former has much smaller set of options. 9810 9811 * builds/windows/vc2010/freetype.vcxproj: Updated. 9812 9813 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com> 9814 9815 [builds/windows] Revise MSVC linking optimizations. 9816 9817 * builds/windows/vc2010/freetype.vcxproj: Optimize DLL linking only. 9818 * builds/windows/visualc/freetype.dsp: Ditto. 9819 * builds/windows/visualc/freetype.vcproj: Ditto. 9820 9821 2021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com> 9822 9823 [woff] Optimize table tagging. 9824 9825 * include/freetype/internal/wofftypes.h (WOFF_TableRec): Use 9826 32-bit tag. 9827 * src/sfnt/sfwoff.c (woff_open_font): Use 32-bit tag. 9828 9829 2021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com> 9830 9831 [woff2] Optimize table tagging. 9832 9833 Fixes #1107. 9834 9835 * include/freetype/internal/wofftypes.h (WOFF2_TableRec): Use 9836 32-bit tag. 9837 * src/sfnt/sfwoff2.c (compare_tags, find_table, woff2_open_font): 9838 Use 32-bit tag. 9839 * src/sfnt/woff2tags.[ch] (woff2_known_tags): Use static storage and 9840 return 32-bit tag. 9841 9842 2021-10-26 Werner Lemberg <wl@gnu.org> 9843 9844 Formatting. 9845 9846 2021-10-26 Ben Wagner <bungeman@chromium.org> 9847 9848 [mm] Tolerate missing Blend dictionary entries 9849 9850 In a Multiple Master font, the Blend dictionary must contain valid 9851 Private, FontInfo, and FontBBox. The current code will error if any of 9852 these are present and invalid, but will not error and will provide 9853 uninitialized data if the Blend dictionary exists but does not contain 9854 one of these entries. This change reverts to the older behavior of 9855 treating any missing entries as containing all zero data and not 9856 returning an error. 9857 9858 In the future it may be best to keep track of when these are actually 9859 initialized and error if they are not. 9860 9861 * src/type1/t1load.c (t1_allocate_blend): Zero initiailize. 9862 9863 2021-10-26 Alexei Podtelezhnikov <apodtele@gmail.com> 9864 9865 [builds/windows] Add MSVC linker optimazations. 9866 9867 We continue to build static libraries with statically linked C run- 9868 time and add options to optimize references. 9869 9870 * builds/windows/vc2010/freetype.vcxproj: Sort entries, add options. 9871 9872 2021-10-23 Alexei Podtelezhnikov <apodtele@gmail.com> 9873 9874 * builds/windows/vc2010/freetype.vcxproj: Use MachineARM64. 9875 9876 2021-10-22 Alexei Podtelezhnikov <apodtele@gmail.com> 9877 9878 [builds/windows] Prioritize x64. 9879 9880 * builds/windows/vc2010/freetype.sln: Sort entries. 9881 9882 2021-10-22 Gabor Kertesz <gabor.kertesz@linaro.org> 9883 9884 [builds/windows] Add ARM64 platform. 9885 9886 * builds/windows/vc2010/freetype.sln: Updated 9887 * builds/windows/vc2010/freetype.vcxproj: Updated. 9888 * builds/windows/vc2010/freetype.vcxproj.filters: Minor fix. 9889 9890 2021-10-21 Ben Wagner <bungeman@chromium.org> 9891 9892 [mm] Delay setting blend weight and design position. 9893 9894 Previously the `blend->weight_vector`, `blend->default_weight_vector`, 9895 and `blend->design_pos` were set early to allocated but uninitialized 9896 memory under the assumption that the memory would eventually be 9897 initialized. However, it is possible that some of the required 9898 keywords may not actually be present, leaving the memory uninitialized. 9899 This is different from a present but invalid table, which would produce 9900 an error. 9901 9902 Reported as 9903 https://bugs.chromium.org/p/chromium/issues/detail?id=1261762 9904 9905 * src/type1/t1load.c (t1_allocate_blend): Remove early allocation and 9906 initialization. 9907 (parse_blend_design_positions, parse_weight_vector): Parse into local 9908 and assign to blend if valid. 9909 (T1_Open_Face): Check that if a blend exists that it has the weight 9910 vector and design positions. 9911 9912 2021-10-21 Ben Wagner <bungeman@chromium.org> 9913 9914 [cff] Commit vstore data and regions on allocation. 9915 9916 The vstore->regionCount and vstore->dataCount were read directly 9917 from the data. However, vstore->varRegionList and vstore->varData 9918 would still contain uninitialized entries with uninitialized 9919 pointers in the event of an error, leading to issues when attempting 9920 to clean up. 9921 9922 Reportd as 9923 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40104 9924 9925 * src/cff/cffload.c (cff_vstore_load): Read the region and data counts 9926 into locals and update the vstore counts immediately after each entry 9927 becomes free-able. 9928 9929 2021-10-20 Ben Wagner <bungeman@chromium.org> 9930 9931 [sfnt] Delay setting gasp ranges and count until computed. 9932 9933 Previously, the gasp.numRanges was set and gasp.gaspRanges was 9934 allocated and assigned before a possible early exit if the frame could 9935 not be entered. It is also possible that the gaspRanges allocation 9936 could fail but the numRanges still be set to non-zero. In such cases 9937 an error would be returned, but the face would have a gasp in an 9938 inconsistent state which may still be accessed. 9939 9940 Reported as 9941 https://bugs.chromium.org/p/chromium/issues/detail?id=1261450 9942 9943 * src/sfnt/ttload.c (tt_face_load_gasp): Delay setting gasp.numRanges 9944 and gasp.gaspRanges until after the ranges are initialized. 9945 9946 2021-10-20 Ben Wagner <bungeman@chromium.org> 9947 9948 [sfnt] Delay setting names and langTags until computed. 9949 9950 Previously, the table->names and table->langTags fields were created 9951 pointing to uninitialized memory and an early exit could happen if the 9952 frame could not be entered. The caller would then be unable to properly 9953 dispose of the memory as the string fields had not been initialized. 9954 9955 Reported as 9956 https://bugs.chromium.org/p/chromium/issues/detail?id=1261343 9957 9958 * src/sfnt/ttload.c (tt_face_load_name): delay setting table->langTags 9959 and table->names until after the memory they will point to is fully 9960 initialized. 9961 9962 2021-10-20 Alexei Podtelezhnikov <apodtele@gmail.com> 9963 9964 * tests/issue-1063/main.c: s/PATH_MAX/FILENAME_MAX/. 9965 9966 Closes !97 for Windows by using a standard macro. 9967 9968 2021-10-19 Werner Lemberg <wl@gnu.org> 9969 9970 [bdf, cid, pfr, winfonts] Improve rejection of other font formats. 9971 9972 This is mainly for better diagnostics of malformed fonts. 9973 9974 * src/bdf/bdflib.c (_bfd_readstream): Stop font format testing if the first 9975 input line is too long or doesn't end with `\r` or `\n`. 9976 9977 * src/cid/cidparse.c (cid_parser_new): Don't handle too short input as an 9978 error but as an unknown format. 9979 9980 * src/pfr/pfrobjs.c (pfr_face_init): Ditto. 9981 9982 * src/winfonts/winfnt.c (fnt_font_load, fnt_face_get_dll_font): Ditto. 9983 9984 2021-10-19 Alexei Podtelezhnikov <apodtele@gmail.com> 9985 9986 [pcf] Zero out the allocated properties. 9987 9988 Fallout reported as 9989 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40033 9990 9991 * src/pcf/pcfread.c (pcf_get_properties): Use FT_NEW_ARRAY and zero 9992 out `properties` in case of failure. 9993 9994 2021-10-18 Werner Lemberg <wl@gnu.org> 9995 9996 configure: Use string comparison for directory inodes. 9997 9998 Inode values might be larger than integers supported by the shell. 9999 10000 Fixes #1105. 10001 10002 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> 10003 10004 * src/sfnt/ttload.c (tt_face_load_name): NULL-initialize langTag. 10005 10006 Another attempt to fix fallout reported as 10007 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40024 10008 10009 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> 10010 10011 [bdf] Fix up user properties. 10012 10013 Fallout reported as 10014 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40027 10015 10016 * src/bdf/bdflib.c (_bdf_add_property): Cosmetic NULL. 10017 (bdf_create_property): Limit allocations to customary signed 10018 FT_Long and NULL-initialize unused storage. 10019 (bdf_free_font): Do not free unused storage. 10020 10021 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> 10022 10023 * src/sfnt/ttload.c (tt_face_load_name): Accounting fix. 10024 10025 Fallout reported as 10026 https://crbug.com/40024 10027 10028 2021-10-16 Ben Wagner <bungeman@chromium.org> 10029 10030 Fix typos in memory macros. 10031 10032 FT_QNEW_ARRAY and FT_QRENEW_ARRAY were using the non-Q 10033 FT_MEM_NEW_ARRAY and FT_MEM_RENEW_ARRAY. Change these to use the Q 10034 versions. Also fix the one issue discovered in tt_face_load_name 10035 where table->names is created with FT_QNEW_ARRAY but the extra 10036 string member is not initialized to NULL. 10037 10038 * include/freetype/internal/ftmemory.h (FT_Q(RE)NEW_ARRAY): 10039 Use FT_MEM_Q(RE)NEW_ARRAY as needed. 10040 10041 * src/sfnt/ttload.c (tt_face_load_name): Initialize `entry->string`. 10042 10043 2021-10-15 Ben Wagner <bungeman@chromium.org> 10044 10045 [truetype] Reload context after re-executing `prep`. 10046 10047 When a different hinting mode from the current is selected, the `prep` table 10048 must be re-executed with the new mode. After this happens the context must 10049 be re-loaded in preparation for the glyph program to be run. 10050 10051 Fixes #1104. 10052 10053 * truetype/ttgload.c (tt_loader_init): Add call to `TT_Load_Context`. 10054 10055 2021-10-15 Werner Lemberg <wl@gnu.org> 10056 10057 [truetype] Minor documentation improvements. 10058 10059 2021-10-14 Anurag Thakur <anuthadev@gmail.com> 10060 10061 Add clang build to linux CI 10062 10063 2021-10-12 Anurag Thakur <anuthadev@gmail.com> 10064 10065 CI: Add macOS CI, including a clang build 10066 10067 2021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com> 10068 10069 * src/cid/cidload.c (parse_fd_array): Protect against trancation. 10070 10071 2021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com> 10072 10073 [type1] Revert to signed size for binary data. 10074 10075 Recently introduced and reported as 10076 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39838 10077 10078 * src/type1/t1load.c (read_binary_data): Reject negative size. 10079 (parse_subrs, parse_charstrings): Use customary signed size. 10080 10081 2021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com> 10082 10083 [psaux] Signedness revisions. 10084 10085 Unsigned indexes are easier to check. 10086 10087 * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Updated. 10088 * src/psaux/psintrp.c (cf2_interpT2CharString): Ditto. 10089 * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. 10090 * src/type1/t1load.c (read_binary_data): Ditto. 10091 10092 2021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com> 10093 10094 [cid] Signedness revisions. 10095 10096 Unsigned checks are simpler. 10097 10098 * include/freetype/t1tables.h (CID_FaceInfoRec): Change to unsignd 10099 `num_dicts`. 10100 * src/cid/cidparse.h (CID_Parser): Change to unsigned `num_dict`. 10101 10102 * src/cid/cidgload.c (cid_load_glyph): Updated. 10103 * src/cid/cidload.c (cid_load_keyword, parse_fd_array, 10104 parse_expansion_factor, parse_font_name, cid_read_subrs, 10105 cid_face_open): Updated. 10106 * src/cid/cidobjs.c (cid_face_done): Updated. 10107 * src/cid/cidparse.c (cid_parser_new): Updated. 10108 10109 2021-10-09 Alexei Podtelezhnikov <apodtele@gmail.com> 10110 10111 * src/cid/cidload.c (cid_face_open): Streamline CIDCount check. 10112 10113 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com> 10114 10115 * src/cid/cidload.c (cid_face_open): Streamline SubrCount check. 10116 10117 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com> 10118 10119 * src/cid/cidgload.c (cid_load_glyph): Fortify incremental loading. 10120 10121 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com> 10122 10123 Signedness revisions. 10124 10125 This eliminates explicit casting by switching to unsigned fields. 10126 The revisions mostly impact the handling of CID fonts. 10127 10128 * include/freetype/fttypes.h (FT_Data): Change to unsigned `length`. 10129 * include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`. 10130 (CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`. 10131 * include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for 10132 `byte_len`. 10133 10134 * src/cid/cidgload.c (cid_load_glyph): Updated. 10135 * src/cid/cidload.h (cid_get_offset): Update argument. 10136 * src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open): 10137 Updated. 10138 * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): 10139 Updated. 10140 * src/psaux/psft.c (cf2_getT1SeacComponent): Updated. 10141 * src/truetype/ttgload.c (TT_Process_Composite_Glyph, 10142 load_truetype_glyph): Updated. 10143 10144 2021-10-07 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> 10145 10146 meson.build (gen_docs): Use `current_source_dir` instead of `source_root`. 10147 10148 These two are not equal when FreeType is used as a subproject, such as in 10149 `freetype-demos`. In that case, `source_root` points at the root project, 10150 causing the docs build to fail. 10151 10152 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 10153 10154 * src/smooth/ftgrays.c (FT_DIV_MOD): Limit the ARM workaround. 10155 10156 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 10157 10158 [builds/unix, builds/vms] Standardize `mmap` failure. 10159 10160 * builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED. 10161 * builds/vms/ftsystem.c (FT_Stream_Open): Ditto. 10162 10163 This should cover https://savannah.nongnu.org/patch/?5909 as well. 10164 10165 2021-10-05 Hugh McMaster <hugh.mcmaster@outlook.com> 10166 10167 autogen.sh: Only copy submodules if building from a git branch. 10168 10169 `autogen.sh` fails if building from a standard source tarball. Firstly, git 10170 expects to be called in a git repository, then `copy_submodule_files` 10171 blindly attempts to copy files. 10172 10173 Debian, Ubuntu, Linux Mint, and other derivatives all run `autogen.sh` 10174 before compiling to regenerate build files. 10175 10176 This patch ensures that various git commands are only called and 'dlg' files 10177 are only copied if `autogen.sh` is called from a git repository. 10178 10179 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 10180 10181 * include/freetype/internal/ftgloadr.h: Add missing header. 10182 10183 Noticed by Jouk Jansen. 10184 10185 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 10186 10187 [pshinter] Additional clean-ups. 10188 10189 * src/pshinter/pshalgo.h (psh_hint_table_find_strong_points): Streamline code. 10190 * src/pshinter/pshalgo.h (PSH_Glyph): Remove unused fields. 10191 10192 2021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com> 10193 10194 [pshinter] More convenient direction definition. 10195 10196 It is easier to check directions using flags than integer values. 10197 10198 * src/pshinter/pshalgo.h (PSH_Dir): Redefine directions. 10199 (PSH_PointRec): Use them as an enum type. 10200 10201 * src/pshinter/pshalgo.c (psh_compute_dir): Modify return type. 10202 (psh_glyph_init, psh_hint_table_find_strong_points, 10203 psh_glyph_find_blue_points): Update users. 10204 10205 2021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com> 10206 10207 [pshinter] Remove unnecessary check. 10208 10209 * src/pshinter/pshalgo.c (psh_hint_table_find_strong_points): Do not 10210 check if direction is defined before checking how. 10211 10212 2021-10-02 AnuthaDev <anuthadev@gmail.com> 10213 10214 CI: Hardcode meson version to fix build failure on windows 10215 10216 2021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com> 10217 10218 Additional `FT_MSB` macro definitions. 10219 10220 * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins 10221 and intrinsics. 10222 10223 2021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com> 10224 10225 * src/autofit/afhints.c (af_glyph_hints_reload): Decrease casting. 10226 10227 2021-09-30 Alexei Podtelezhnikov <apodtele@gmail.com> 10228 10229 * src/tools/apinames.c: Facilitate OpenVMS linker options. 10230 10231 2021-09-29 Alexei Podtelezhnikov <apodtele@gmail.com> 10232 10233 * src/winfonts/winfnt.c (FNT_Face_Init): Correct reallocation. 10234 10235 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 10236 10237 [builds/unix] Do not use autoconf SIZEOF. 10238 10239 * builds/unix/ftconfig.h.in [FT_USE_AUTOCONF_SIZEOF_TYPES]: Removed. 10240 * builds/unix/configure.raw: Remove AC_CHECK_SIZEOF and update. 10241 10242 After this commit, autoconf builds will fully rely on <limits.h> 10243 rather than falling back on it if AC_CHECK_SIZEOF failed for some 10244 reason. There is a risk that misconfigured cross-compilation might 10245 have wrong headers. Note that Meson and CMake builds always relied on 10246 <limits.h> for sizes and availability of integer types. 10247 10248 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 10249 10250 Propagate sign when reading OFF3. 10251 10252 Signed 24-bit values are extremely rare. FreeType only reads them in 10253 PFR fonts with bitmap strikes conditionally. They have not been seen 10254 in the known fonts. That is why this bug could never be discovered. 10255 `FT_FRAME_OFF3` propagates sign correctly. 10256 10257 * include/freetype/internal/ftstream.h (FT_PEEK_OFF3, FT_PEEK_OFF3_LE): 10258 Propagate sign into 32-bit value. 10259 (FT_GET_OFF3, FT_READ_OFF3): Needed fixing but removed as unused. 10260 10261 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 10262 10263 [bdf] Simplify comment collection or lack thereof. 10264 10265 BDF comments are neither actually collected nor retrieved. There is 10266 no need to be fancy with delimiters. 10267 10268 * src/bdf/bdflib.c (_add_bdf_comment): Delimit comments with zeros... 10269 (bdf_load_font): ...and do not null-terminate comments additionally. 10270 (_bdf_parse_glyphs): Check if comments are kept, which they are not. 10271 (_bdf_parse_start): Minor clean up. 10272 10273 2021-09-24 Alexei Podtelezhnikov <apodtele@gmail.com> 10274 10275 Use NULL for pointers only. 10276 10277 * src/bdf/bdflib.c (*): Code changes. 10278 * include/freetype/freetype.h: Comments only. 10279 * src/cff/cffload.c, src/cff/cffobjs.c: Ditto. 10280 * src/winfonts/winfnt.c: Ditto. 10281 10282 2021-09-23 Werner Lemberg <wl@gnu.org> 10283 10284 Minor documentation fixes and improvements. 10285 10286 2021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> 10287 10288 Reference `fopen` in the docs. 10289 10290 2021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> 10291 10292 [bdf, pcf] Minor optimization. 10293 10294 * src/pcf/pcfread.c (pcf_load_font): Do not call `FT_MulDiv` for a 10295 small job. 10296 * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto. 10297 * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a comment. 10298 10299 2021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com> 10300 10301 [base] Initialize stream memory earlier. 10302 10303 With Windows memory management tracking heap, it is important to use 10304 it during the stream opening fallback. In Unix, the argument is 10305 unused, but it is better to set it correctly. 10306 10307 * src/base/ftobjs.c (FT_Stream_New): Set memory before calling 10308 `FT_Stream_Open`. 10309 * builds/windows/ftsystem.c, builds/unix/ftsystem.c (FT_Stream_Open, 10310 ft_close_stream_by_free): Call `ft_alloc` and `ft_free` with proper 10311 memory argumment. 10312 10313 2021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com> 10314 10315 [builds/windows] Revert back to `CreateFileA` only. 10316 10317 Calling `CreateFileW` without making sure that the patname is really 10318 `wchar_t` is a bad idea and can lead to unpredictable overreads. For 10319 Windows CE, we impelemnt the missing API. 10320 10321 Fixes #1098 and !76 again. 10322 10323 * builds/windows/ftsystem.c (FT_Stream_Open): Call `CreateFileA`. 10324 [_WIN32_WCE] (CreateFileA, FileSizeEx): Implement missing interfaces. 10325 10326 2021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com> 10327 10328 * src/bdf/bdflib.c (_bdf_parse_{start,glyphs}): Use appropriate scanner. 10329 10330 2021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com> 10331 10332 Minor. 10333 10334 2021-09-20 Alexei Podtelezhnikov <apodtele@gmail.com> 10335 10336 * src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW. 10337 10338 2021-09-18 Alexei Podtelezhnikov <apodtele@gmail.com> 10339 10340 [cache] Minor clean-ups. 10341 10342 * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Remove parantheses. 10343 * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto. 10344 (FTC_Cache_RemoveFaceID): Remove unnecessary variable. 10345 10346 2021-09-17 Alexei Podtelezhnikov <apodtele@gmail.com> 10347 10348 [builds/windows] Try both wide and narrow `CreateFile` 10349 10350 Windows handles wchar_t* UTF-16 and char* ANSI (presently UTF-8) 10351 filenames using alternative -A and -W API. We'll try them both 10352 when opening a file. This means that you should not worry about 10353 about conversions. 10354 10355 Fixes #1098 and !76. 10356 10357 * builds/windows/ftsystem.c (FT_Stream_Open): Call alternative 10358 `CreateFile` in the case of failure. 10359 10360 2021-09-17 Edwin Steiner <edwin.steiner@gmail.com> 10361 10362 [cff] Explicitly set StandardEncoding or ExpertEncoding offsets. 10363 10364 Fixes #1097. 10365 10366 * src/cff/cffload.c (cff_encoding_load): Set special offset values. 10367 10368 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com> 10369 10370 [cache] Miscellaneous clean-ups. 10371 10372 * src/cache/ftccache.c (ftc_get_top_node_for_hash, FTC_Cache_Clear): 10373 Remove barely used variables. 10374 (ftc_cache_add): Adjust casting. 10375 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Remove casting. 10376 * src/cache/ftcsbits.c (ftc_snode_load): Remove casting. 10377 10378 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com> 10379 10380 * src/cff/cffload.c (cff_fd_select_get): Remove casting. 10381 10382 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com> 10383 10384 * src/pcf/pcfread.c (pcf_read_TOC): Remove casting. 10385 10386 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com> 10387 10388 Minor type adjustments. 10389 10390 * src/cff/cffobjs.c (cff_face_init): Reduce casting. 10391 * src/truetype/ttobjs.c (tt_size_ready_bytecode): Ditto. 10392 * src/type1/t1load.c (T1_Set_MM_Design): Ditto. 10393 10394 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com> 10395 10396 Replace boolean allocation macros with MEM ones. 10397 10398 * src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro. 10399 * src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto. 10400 * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto. 10401 * src/cache/ftccache.c (ftc_cache_init): Ditto 10402 * src/gzip/ftgzip.c (ft_gzip_alloc): Ditto. 10403 * src/psnames/psmodule.c (ps_unicodes_init): Ditto. 10404 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. 10405 * src/sfnt/ttload.c (tt_face_load_name): Ditto. 10406 10407 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com> 10408 10409 [cache] Revert to some zeroing. 10410 10411 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Zero 10412 `buckets` again to fix some crashes. 10413 10414 2021-09-14 Alexei Podtelezhnikov <apodtele@gmail.com> 10415 10416 * src/pshinter/pshrec.c (ps_mask_table_merge_all): Tweak loops. 10417 10418 Fixes fallout from 731d0b685685 reported as 10419 10420 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38685 10421 10422 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10423 10424 [cff, pshinter] Clean up unsigned counters. 10425 10426 Loops with unsigned decrement can be reliably stopped when the counter 10427 wraps around after reaching zero. 10428 10429 * src/cff/cffload.c (cff_charset_compute_cids): Use unsigned counter. 10430 * src/pshinter/pshalgo.c (psh_hint_table_activate_mask): Ditto. 10431 * src/pshinter/pshrec.c (ps_mask_table_merge): Ditto. 10432 10433 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10434 10435 [bdf, psnames, sfnt] Avoid some memory zeroing. 10436 10437 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro. 10438 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. 10439 * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero. 10440 10441 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10442 10443 * src/base/ftobjs.c (FT_CMap_New): Revert to zeroing. 10444 10445 Fixes fallout from c1fa7aa2bc96, reported as 10446 10447 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38641 10448 10449 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10450 10451 [truetype] Clean up `exec` initialization. 10452 10453 * src/truetype/ttinterp.c (Init_Context): Absorbed into... 10454 (TT_New_Context): ... this function. 10455 10456 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10457 10458 [truetype] Avoid some memory zeroing. 10459 10460 * src/truetype/ttgload.c (load_truetype_glyph): Use Q-macro. 10461 * src/truetype/ttinterp.c (Update_Max): Ditto. 10462 * src/truetype/ttpload.c (src/truetype/ttpload.c): Ditto. 10463 10464 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10465 10466 [base] Avoid some memory zeroing. 10467 10468 * src/base/ftobjs.c (FT_New_Size, FT_CMap_New, FT_CMap_Done, 10469 ft_open_face_internal, ft_open_face_internal): Use Q-macros. 10470 10471 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 10472 10473 [cache, psaux] Remove zeros. 10474 10475 * src/cache/ftcmru.c (FTC_MruList_New): Remove initialization. 10476 * src/psaux/psstack.c (cf2_stack_init): Ditto. 10477 10478 2021-09-12 Alexei Podtelezhnikov <apodtele@gmail.com> 10479 10480 [cache] Avoid some memory zeroing. 10481 10482 * src/cache/ftcmru.c (FTC_MruList_New): Use Q-macro. 10483 * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Ditto. 10484 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Ditto. 10485 10486 2021-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> 10487 10488 * src/cache/ftcmanag.c (FTC_Manager_New): Add missing zero. 10489 10490 Fixes fall out from a7b199d081e7. 10491 10492 2021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com> 10493 10494 [truetype] Tweak `hdmx` checking. 10495 10496 Fixes #1096. 10497 10498 * src/truetype/ttpload.c (tt_face_load_hdmx): Account for padding. 10499 10500 2021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com> 10501 10502 [truetype] Tweak `loca` clamping. 10503 10504 Fixes #1095. 10505 10506 * src/truetype/ttpload.c (tt_face_load_loca): Fix up clamping. 10507 * include/freetype/internal/tttypes.h (TT_Face): Correct docs. 10508 10509 2021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 10510 10511 Fortify memory debugging (cont'd). 10512 10513 * src/base/ftdbgmem.c (FT_DumpMemory): Check for active debugger. 10514 (ft_mem_table_destroy): Move `FT_DumpMemory` call from here... 10515 (ft_mem_debug_done): ... to here. 10516 10517 2021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 10518 10519 Fortify memory debugging. 10520 10521 These changes are neccessary to properly recover `memory->user` that 10522 holds the Windows heap handle now. 10523 10524 * src/base/ftdbgmem.c (ft_mem_debug_init): Handle all table allocations, 10525 initializations, and sizing instead of... 10526 (ft_mem_table_new): ... this function removed. 10527 (ft_mem_debug_done): Better check for the active debugger and free the 10528 debugger table here instead of... 10529 (ft_mem_table_destroy): ... here. 10530 10531 2021-09-08 Werner Lemberg <wl@gnu.org> 10532 10533 src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): Set to 600. 10534 10535 This allows C99 compilation on Solaris. 10536 10537 Problem reported by Mojca Miklavec. 10538 10539 2021-09-07 Alexei Podtelezhnikov <apodtele@gmail.com> 10540 10541 [builds/windows] Use native memory allocation API. 10542 10543 * builds/windows/ftsystem.c (ft_alloc, ft_realloc, ft_free): 10544 Wrap HeapAlloc, HeapReAlloc, and HeapFree. 10545 (FT_New_Memory): Set the heap handle. 10546 10547 2021-09-07 Werner Lemberg <wl@gnu.org> 10548 10549 [dlg] Synchronize with upstream. 10550 10551 * src/dlg/dlgwrap.c (_XOPEN_SOURCE): Set to 600. 10552 10553 Fixes #1093. 10554 10555 2021-09-04 Alexei Podtelezhnikov <apodtele@gmail.com> 10556 10557 Cosmetic zeros. 10558 10559 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 10560 10561 * src/bdf/bdflib.c (_bdf_parse_start): Keep parser memory. 10562 10563 2021-09-03 Werner Lemberg <wl@gnu.org> 10564 10565 autogen.sh: Make it work with old Solaris 10 shell. 10566 10567 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 10568 10569 [smooth, raster, sdf] Clean up initialization calls. 10570 10571 * src/raster/ftraster.c (ft_black_init): Removed. 10572 (ft_black_new): Clean up. 10573 * src/sdf/ftbsdf.c (bsdf_raster_new): Ditto. 10574 * src/sdf/ftsdf.c (sdf_raster_new): Ditto. 10575 * src/smooth/ftgrays.c (gray_raster_new): Ditto. 10576 10577 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 10578 10579 * src/cache/ftcmanag.c (FTC_Manager_New): Avoid some zeroing. 10580 10581 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 10582 10583 * src/bdf/bdflib.c (bdf_load_font): Remove memory shuffling. 10584 10585 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 10586 10587 Cosmetic zeros. 10588 10589 2021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> 10590 10591 [base] Clean up stream reading. 10592 10593 * src/base/ftstream.c (FT_Stream_ReadUShort, FT_Stream_ReadUOffset, 10594 FT_Stream_ReadULong and their LE variants): Remove unnecessary 10595 initialization and slightly refactor. 10596 (FT_Stream_GetByte, FT_Stream_ReadByte): Rename to return unsigned 10597 value and align with sister functions. 10598 10599 * include/freetype/internal/ftstream.h (FT_Stream_GetByte, 10600 FT_Stream_ReadByte): Update prototypes and caller macros. 10601 10602 2021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> 10603 10604 s/0/NULL/ where appropriate. 10605 10606 2021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com> 10607 10608 * builds/windows/ftsystem.c (FT_Stream_Open): Fix double-close. 10609 10610 2021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com> 10611 10612 [smooth] Reduce shift in multiply-shift optimization. 10613 10614 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): Reduce shift. 10615 10616 Smaller shifts that keep the division operands of FT_UDIVPREP within 10617 32 bits result in slightly faster divisions, which is noticeable in 10618 the overall performance. The loss of precision is tolerable until the 10619 divisors (the components dx and dy) approach 32 - PIXEL_BITS. With 10620 PIXEL_BITS = 8, this corresponds to 65,000 pixels or the bitmap size 10621 that we refuse to render anyway. 10622 10623 Using `ftbench -p -s60 -t5 -bc timesi.ttf`, 10624 10625 Before: 8.52 us/op 10626 After: 8.32 us/op 10627 10628 2021-08-28 Werner Lemberg <wl@gnu.org> 10629 10630 [truetype] Fix compilation if !TT_CONFIG_OPTION_BYTECODE_INTERPRETER. 10631 10632 * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): Compile function 10633 conditionally. 10634 (tt_face_vary_cvt) [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Add code. 10635 10636 Fixes #1091. 10637 10638 2021-08-27 Alexei Podtelezhnikov <apodtele@gmail.com> 10639 10640 [builds/windows] Revise SSE2 settings. 10641 10642 * builds/windows/vc2010/freetype.vcxproj [x64]: Remove explicit SSE2. 10643 * builds/windows/visualc/freetype.vcproj [Win32]: Add explicit SSE2. 10644 10645 2021-08-27 Ben Wagner <bungeman@chromium.org> 10646 10647 [smooth] Detect SSE2 with MSVC for x86 10648 10649 MSVC does not set `__SSE2__`. Instead one must check whether `_M_IX86_FP` is 10650 defined and greater than or equal to 2. 10651 10652 * src/smooth/ftgrays.c (FT_SSE2): New macro. 10653 Use it where appropriate. 10654 10655 2021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com> 10656 10657 Expand comment (cont'd). 10658 10659 2021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com> 10660 10661 Expand comment. 10662 10663 2021-08-24 Alexei Podtelezhnikov <apodtele@gmail.com> 10664 10665 * src/smooth/ftgrays.c (gray_render_conic): Refactor redundancy. 10666 10667 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 10668 10669 [truetype] Fix for the family name shorter than 8 characters. 10670 10671 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): 10672 If the family name to be checked is shorter than 8 characters, 10673 do not check its syntax. 10674 10675 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 10676 10677 [truetype] Simplify `trick_names'. 10678 10679 * src/truetype/ttobjs.c (tt_check_trickyness_family): For the case 10680 that the beginning part of a long tricky family name is already 10681 registered as another tricky family name, no need to double-check 10682 the longer one. Such long tricky family names are removed from 10683 the `trick_names'. 10684 10685 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 10686 10687 [truetype] Add 2 tricky font names. 10688 10689 Additional fix for the issue #1087. 10690 10691 * src/truetype/ttobjs.c (tt_check_trickyness_family): Add 2 tricky 10692 font names reported in #1087. 10693 10694 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 10695 10696 [truetype] New function to skip the randomization tag. 10697 10698 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): 10699 New function to skip the randomization tag in the names of the 10700 fonts embedded in a PDF. It is used by tt_check_trickyness_family(), 10701 to keep from mistaking "DLC" in the randomization tag as a 10702 tricky font name. See discussion in: 10703 10704 https://lists.nongnu.org/archive/html/freetype-devel/2021-02/msg00002.html 10705 10706 For technical detail about the randomization tag, please find 10707 PDF Reference 5.5.3 "Font Subsets". Thanks to Justyna Wawrzynska 10708 for pointing out the issue caused by the randomization tag. 10709 10710 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 10711 10712 [truetype] Add checksums for 2 tricky fonts. 10713 10714 Thanks to Ting717 for providing sample PDF. Fixes #1087. 10715 10716 * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Add 10717 checksums for 2 tricky fonts `DFHei-Bd-WIN-HK-BF' and 10718 `DFMing-Md-WIN-HK-BF'. 10719 10720 2021-08-23 Alexei Podtelezhnikov <apodtele@gmail.com> 10721 10722 Whitespace formatting. 10723 10724 2021-08-22 Alexei Podtelezhnikov <apodtele@gmail.com> 10725 10726 Decorate const arguments. 10727 10728 * src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it. 10729 * include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap): 10730 Do it. 10731 10732 2021-08-21 Alexei Podtelezhnikov <apodtele@gmail.com> 10733 10734 [smooth] Clean up the null cell usage. 10735 10736 Put the null cell at the end of the pool and store it explicitly so that 10737 we can use it as both the limit and the dumpster. 10738 10739 * src/smooth/ftgrays.c (gray_TWorker): Store the last `cell_null` and 10740 remove unnecesary fields. 10741 (NULL_CELL_PTR, CELL_IS_NULL): Remove in favor of explicit `cell_null`. 10742 (gray_dump_cells, gray_set_cell, gray_sweep{,_direct}): Update callers. 10743 (gray_convert_glyph_inner): Trace remaining cells (oh well). 10744 (gray_convert_glyph): Set up `cell_null` and slightly improve the pool 10745 management. 10746 10747 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 10748 10749 [base] Restore quiet no-op rendering of bitmap glyphs. 10750 10751 Fixes #1076. 10752 10753 * src/base/ftobjs.c (FT_Render_Glyph_Internal): Discard an error when 10754 rendering a bitmap glyph. 10755 10756 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 10757 10758 [smooth] Fortify 64-bit algorithm. 10759 10760 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): s/long/FT_Int64/ and 10761 s/unsigned long/FT_UInt64/. 10762 (gray_render_line): Adjust a critical variable type. 10763 10764 2021-08-20 Carlo Bramini <carlo.bramix@libero.it> 10765 10766 * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows. 10767 10768 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 10769 10770 Determine `long long` availability based on its size. 10771 10772 MSVC, for example, used `long long` even without full C99 support. 10773 10774 * include/freetype/config/ftstdlib.h: Check if `long long` limits are 10775 defined in <limits.h>. 10776 * include/freetype/config/integer-types.h: Check `long long` size and 10777 use it to typedef FT_Int64. 10778 10779 2021-08-19 Dominik Röttsches <drott@chromium.org> 10780 10781 [sfnt] Fix format expectation for `COLR` v1 ClipList 10782 10783 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Change ClipList 10784 format expectation to 1 instead of 0 to make it compliant with the 10785 latest spec. 10786 10787 2021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com> 10788 10789 Readily use `long long` as a 64-bit type in C99 mode. 10790 10791 * include/freetype/config/integer-types.h (FT_INT64): 10792 FT_CONFIG_OPTION_FORCE_INT64 is no longer required to use `long long`. 10793 10794 2021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com> 10795 10796 Use FT_INT64 instead of FT_LONG64. 10797 10798 * include/freetype/config/integer-types.h: Remove synonymous FT_LONG64. 10799 * include/freetype/internal/ftcalc.h: s/FT_LONG64/FT_INT64/. 10800 * src/base/ftcalc.c: Ditto. 10801 * src/base/fttrigon.c: Ditto. 10802 * src/smooth/ftgrays.c: Ditto. 10803 10804 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> 10805 10806 [builds/windows] Do not set CharacterSet for VC++. 10807 10808 * builds/windows/vc2010/freetype.vcxproj: s/Unicode/NotSet/. 10809 * builds/windows/visualc/freetype.vcproj: s/"1"/"0"/. 10810 10811 2021-08-18 Werner Lemberg <wl@gnu.org> 10812 10813 * src/sdf/ftsdf.c (get_control_box): Fix compiler warning. 10814 10815 2021-08-18 Werner Lemberg <wl@gnu.org> 10816 10817 [base] Fix ppem size overflow. 10818 10819 Fixes #1086. 10820 10821 * src/base/ftobjs.c (FT_Request_Metrics): Add return value. 10822 Check whether ppem values fit into unsigned short values. 10823 (FT_Request_Size): Updated. 10824 10825 * include/freetype/internal/ftobjs.h: Updated. 10826 10827 * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c 10828 (cid_size_request), src/truetype/ttdriver.c (tt_size_request), 10829 src/type1/t1objs.c (T1_Size_Request): Updated. 10830 10831 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> 10832 10833 * builds/windows/ftsystem.c (FT_Stream_Open): Cast to remove warning. 10834 10835 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> 10836 10837 * builds/windows/ftsystem.c (FT_Stream_Open): Support UNICODE compilation. 10838 10839 2021-08-09 Werner Lemberg <wl@gnu.org> 10840 10841 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Minor fix. 10842 10843 2021-08-09 Dominik Röttsches <drott@chromium.org> 10844 10845 [sfnt] Add missing blend mode 'plus' to 'COLR' v1. 10846 10847 * include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode 10848 'plus' after it was added to the spec. 10849 10850 2021-08-08 Werner Lemberg <wl@gnu.org> 10851 10852 include/freetype/freetype.h (FT_Encoding): Improve documentation. 10853 10854 Based on a suggestion by Antony Lee <anntzer.lee@gmail.com>. 10855 10856 2021-08-07 Werner Lemberg <wl@gnu.org> 10857 10858 [smooth] Avoid integer overflow. 10859 10860 Reported as 10861 10862 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36243 10863 10864 * src/smooth/ftgrays.c(ADD_LONG, SUB_LONG, MUL_LONG, NEG_LONG) 10865 [STANDALONE_]: Removed, unused. 10866 (ADD_INT) [STANDALONE_]: New macro. 10867 (FT_INTEGRATE): Use ADD_INT. 10868 10869 2021-08-07 Dominik Röttsches <drott@chromium.org> 10870 10871 [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table. 10872 10873 The optional 'COLR' v1 glyph-specific clip box helps upstream graphics 10874 libraries allocate a sufficiently large bitmap for a glyph without having to 10875 traverse the glyph graph for that. See 10876 10877 https://github.com/googlefonts/colr-gradients-spec/issues/251 10878 10879 for background on the introduction of this specification change. 10880 10881 * include/freetype/ftcolor.h (FT_ClipBox): New structure. 10882 (FT_Get_Color_Glyph_ClipBox): New function declaration. 10883 10884 * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_ClipBox_Func): 10885 New function type. 10886 (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Use it. 10887 10888 * src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API 10889 with SFNT implementation. 10890 10891 * src/sfnt/sfdriver.c (sfnt_interface): Updated. 10892 * src/sfnt/ttcolr.c (Colr): New field `clip_list`. 10893 (tt_face_load_colr): Parse global clip list offset. 10894 (tt_face_get_color_glyph_clipbox): New function to find the clip box for a 10895 glyph id from the clip list array. 10896 * src/sfnt/ttcolr.h: Updated. 10897 10898 2021-08-06 Werner Lemberg <wl@gnu.org> 10899 10900 [smooth] Fix left shifts of negative numbers. 10901 10902 Reported as 10903 10904 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36241 10905 10906 * src/smooth/ftgrays.c (LEFT_SHIFT): New macro. 10907 (gray_render_conic) [BEZIER_USE_DDA]: Use it. 10908 10909 2021-08-02 Werner Lemberg <wl@gnu.org> 10910 10911 * meson.build: Fix zlib support. 10912 10913 This commit synchronizes zlib support with both autotools and cmake: If no 10914 external zlib is found (or intentionally disabled on the command line), use 10915 the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without 10916 modifying `FT_CONFIG_OPTION_USE_ZLIB`. 10917 10918 Also improve summary output. 10919 10920 Problem reported by Moazin. 10921 10922 2021-08-02 Anuj Verma <anujv@iitbhilai.ac.in> 10923 10924 [sdf] Fix out-of-range-access. 10925 10926 * src/sdf/ftbsdf.c (first_pass, second_pass): Fix range during forward pass. 10927 Otherwise the index goes out of range for the last column. 10928 10929 Fixes issue #1077. 10930 10931 2021-08-02 Anuj Verma <anujv@iitbhilai.ac.in> 10932 10933 Fix invalid memory access in `bsdf` rasterizer. 10934 10935 Do not generate SDF from bitmap if the `FT_GLYPH_OWN_BITMAP` flag is not 10936 set. In some cases the bitmap buffer is freed but still points to a valid 10937 address; to handle those cases check the flag before accessing the memory. 10938 10939 * src/sdf/ftsdfrend.c (ft_bsdf_render): Handle the above case. 10940 Also, return an error message if the bitmap's rows/pitch is invalid, 10941 otherwise `slot->buffer` might be assigned to some invalid memory location. 10942 (ft_sdf_render): Same as above. 10943 Plus, move the outline back to original state after rasterization and not if 10944 any error occurs. 10945 10946 2021-07-29 Heiko Becker <heirecka@exherbo.org> 10947 10948 * meson.build: Honor `--includedir` instead of hard-coding 'include'. 10949 10950 2021-07-29 Werner Lemberg <wl@gnu.org> 10951 10952 src/sfnt/ttcolr.c: Minor formatting. 10953 10954 2021-07-29 Dominik Röttsches <drott@chromium.org> 10955 10956 [sfnt] 'COLR' v1 PaintSweepGradient spec update 10957 10958 * src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other 10959 spec changes and now has the angles specified as F2DOT14, reflect 10960 that in the implementation. 10961 * include/freetype/ftcolor.h (FT_PaintSweepGradient): Update 10962 documentation. 10963 10964 2021-07-29 Dominik Röttsches <drott@chromium.org> 10965 10966 [sfnt] Retrieve affine matrix from offset in 'COLR' v1 parsing. 10967 10968 * src/sfnt/ttcolr.c (read_paint): Implement spec change where 10969 affine transform matrix is now referenced by offset instead of 10970 being placed inline in the PaintTransform table. 10971 10972 2021-07-29 Dominik Röttsches <drott@chromium.org> 10973 10974 [sfnt] 'COLR' v1 PaintSkew related spec updates 10975 10976 * src/sfnt/ttcolr.c (read_paint): Implement spec changes around 10977 PaintSkew, PaintSkewAroundCenter. Update parsing to read shorter 10978 values as changed in the spec. 10979 * include/freetype/ftcolor.h (FT_PaintSkew): Update documentation. 10980 10981 2021-07-29 Dominik Röttsches <drott@chromium.org> 10982 10983 [sfnt] PaintRotate/PaintRotateAroundCenter spec updates 10984 10985 * src/sfnt/ttcolr.c (read_paint): Implement spec change where 10986 PaintRotate and PaintRotateAroundCenter were split for a more 10987 compact format definition. Update parsing to read shorter values 10988 as changed in the spec. 10989 * include/freetype/ftcolor.h (FT_PaintRotate): Update documentation. 10990 10991 2021-07-29 Dominik Röttsches <drott@chromium.org> 10992 10993 [sfnt] 'COLR' v1 PaintTranslate and PaintScale precision 10994 10995 * src/sfnt/ttcolr.c (read_paint): Implement spec changes in 10996 PaintTranslate and PaintScale and friends. Update parsing to read 10997 new shorter values. 10998 10999 2021-07-29 AnuthaDev <anuthadev@gmail.com> 11000 11001 README.git: Add Code of Conduct. 11002 11003 2021-07-25 Werner Lemberg <wl@gnu.org> 11004 11005 ChangeLog housekeeping. 11006 11007 Archive old `ChangeLog` file. 11008 11009 We no longer write ChangeLog entries manually; instead, the file will be 11010 created from commit messages (which should be formatted in GNU's ChangeLog 11011 style) by a call to 11012 11013 gitlog-to-changelog --format='%B%n' 11014 11015 or something similar (this script is part of the 'gnulib' repository). 11016 11017 2021-07-24 Werner Lemberg <wl@gnu.org> 11018 11019 Fix some `cppcheck` warnings. 11020 11021 * src/bzip2/ftbzip2.c (ft_bzip2_file_skip_output), src/gzip/ftgzip.c 11022 (ft_gzip_file_skip_output): Reduce scope of `delta`. 11023 11024 * src/psaux/psintrp.c, src/psaux/psintrp.h (cf2_interpT2CharString): Add 11025 `const` to `buf` parameter. 11026 11027 * src/raster/ftraster.c (DelOld): Add `const` to `profile` parameter. 11028 (Vertical_Sweep_Span): Reduce scope of `target`. 11029 (FT_Outline_Get_CBox): Reduce scope of `xMin`, `xMax`, `yMin`, `yMax`. 11030 11031 * src/smooth/ftgrays.c (gray_render_conic): Reduce scope of `split`. 11032 (gray_sweep, gray_sweep_direct): Reduce scope of `area`. 11033 11034 * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Reduce scope of 11035 `temp`. 11036 11037 2021-07-24 AnuthaDev <anuthadev@gmail.com> 11038 11039 * .gitlab-ci.yml: Fixed cmake build, using correct options. 11040 11041 2021-07-24 AnuthaDev <anuthadev@gmail.com> 11042 11043 * CMakeLists.txt: Make `cmake` handle disabled dependencies correctly. 11044 11045 Include 'CMakeDependentOption'. 11046 11047 Replace `FT_WITH_XXX` options with `FT_DISABLE_XXX` and `FT_REQUIRE_XXX` 11048 pairs. Update option logic accordingly. 11049 11050 Fixes #1066. 11051 11052 2021-07-24 Ben Wagner <bungeman@chromium.org> 11053 11054 [autofit] Split `afwrtsys.h`. 11055 11056 The header file `afwrtsys.h` has two distinct functions: to include the 11057 required writing system headers and also to generate code for each writing 11058 system. At each current use site only one or the other is used, with 11059 various macro trickery selecting one or the other. Split this header into 11060 `afws-decl.h` for the required writing system declarations and `afws-iter.h` 11061 for iterating over the writing systems to generate code. 11062 11063 The motivation for this change is that the Visual C++ compiler treats the 11064 standard include guard idiom like `#pragma once` 'if no non-comment code or 11065 preprocessor directive comes before or after the standard form of the 11066 idiom'. It appears to check this after macro expansion, so if 11067 `WRITING_SYSTEM` expands to empty the bottom of `afwrtsys.h` is empty and 11068 looks like the standard include guard idiom which is treated like `#pragma 11069 once`, so subsequent inclusion of `afwrtsys.h` is elided. 11070 11071 Fixes #1075. 11072 11073 * src/autofit/afglobal.c (af_writing_system_classes), src/autofit/aftypes.h 11074 (AF_WritingSystem), src/autofit/rules.mk (AUTOF_DRV_H): Updated. 11075 11076 * src/autofit/afwrtsys.h: Split into... 11077 * src/autofit/afws-decl.h, src/autofit/afws-iter.h: New files.