12022-05-01 Werner Lemberg <wl@gnu.org> 2 3 * Version 2.12.1 released. 4 ========================== 5 6 Tag sources with `VER-2-12-1'. 7 8 * docs/VERSION.TXT: Add entry for version 2.12.1. 9 * docs/CHANGES, docs/release: Updated. 10 11 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 12 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 13 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 14 docs/freetype-config.1: s/2.12.0/2.12.1/, s/2120/2121/. 15 16 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. 17 18 * builds/unix/configure.raw (version_info): Set to 24:3:18. 19 * CMakeLists.txt (VERSION_PATCH): Set to 1. 20 212022-04-30 Anuj Verma <anuj@posteo.net> 22 23 [sdf] Do not throw errors for invisible glyphs. 24 25 * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Return `FT_Err_Ok` if 26 width or height is zero, since some glyphs do not generate visible bitmaps. 27 28 Fixes #1150. 29 302022-04-30 Werner Lemberg <wl@gnu.org> 31 32 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_COLOR` for SVG fonts. 33 34 Fixes #1151. 35 362022-04-27 Brendan Shanks <bshanks@codeweavers.com> 37 38 autogen.sh: Fix building when freetype is itself a git submodule. 39 40 There are situations where .git is not a directory, like when 41 freetype is a submodule in another repository. 42 432022-04-26 Alexei Podtelezhnikov <apodtele@gmail.com> 44 45 [builds/windows] Simplify non-desktop UWP check. 46 47 Fixes mingw compilation described in !159. 48 49 * builds/windows/ftsystem.c: Do not use WINAPI_FAMILY_PARTITION macro. 50 512022-04-25 Alexei Podtelezhnikov <apodtele@gmail.com> 52 53 [truetype] Reset IUP flags in `TT_RunIns`. 54 55 Fixes #1148 by moving the flag initialization back, partly reverting 56 7809007a and fd03dcc1. Initializing these flags elsewhere skips 'cvt'. 57 58 * src/truetype/ttinterp.c (TT_RunIns): Initialize the IUP flag here... 59 (TT_Run_Context): ... instead of here. 60 612022-04-24 Xavier Claessens <xavier.claessens@collabora.com> 62 63 [meson] Remove `default_library=both` from `default_options`. 64 65 It is inconsistent with what all other Meson projects do. 66 67 It also prevents static linking to FreeType when it is a subproject because 68 `default_options` in a subproject takes precedence on values set on the main 69 project. For example, building 'GStreamer' with `-Ddefault_library=static` 70 would still dynamically link on FreeType unless the user also sets 71 `-Dfreetype2:default_library=static`. 72 73 * meson.build: Updated. 74 75 * .gitlab-ci.yml: Retain `both` option for testing. 76 772022-04-19 Werner Lemberg <wl@gnu.org> 78 79 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Integer overflow. 80 81 Reported as 82 83 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46792 84 852022-04-16 Georg Brandl <georg@python.org> 86 87 * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]: Fix segfault. 88 89 This can happen if the function is called with `size` being `NULL`. 90 91 Fixes #1147. 92 932022-04-14 Steve Lhomme <robux4@ycbcr.xyz> 94 95 .gitlab-ci.yml: Add a Universal Windows build target 96 97 It's compiled for Windows 10 and up, ensuring UNICODE is set (default for UWP) 98 and selecting the proper WINAPI_FAMILY (WINAPI_FAMILY_APP). 99 100 Do not try to run the UWP exe in the Docker as it doesn't work. 101 1022022-04-04 Ben Wagner <bungeman@chromium.org> 103 104 [sfnt] Correct FT_ColorStopIterator documentation. 105 106 * include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not 107 set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and 108 `num_color_stops` are set by `FT_Get_Paint`. `p` and 109 `current_color_stop` are updated by `FT_Get_Colorline_Stops`. 110 1112022-04-01 Werner Lemberg <wl@gnu.org> 112 113 * builds/unix/configure.raw: Add option `--with-librsvg`. 114 115 Since 'librsvg' is written in Rust, this option allows distributions to 116 avoid a dependency on the entire Rust toolchain to provide the FreeType demo 117 programs. 118 119 Suggested by Lars Wendler in !156. 120 1212022-04-01 Werner Lemberg <wl@gnu.org> 122 123 * src/sfnt/sfwoff.c (reconstruct_glyf): Fix gcc 10 warning. 124 1252022-04-01 Werner Lemberg <wl@gnu.org> 126 127 [gzip] Update sources to zlib 1.2.12. 128 1292022-04-01 Eric Jing <@CPUcontrol> 130 131 CMakeLists.txt: Fix `Info.plist` path. 132 133 When building a framework using CMake with `add_subdirectory`, CMake must be 134 able to find `freetype-Info.plist` when configuring the framework 135 properties. 136 137 Fixes #1145. 138 1392022-04-01 Werner Lemberg <wl@gnu.org> 140 141 Whitespace. 142 1432022-04-01 Ben Wagner <bungeman@chromium.org> 144 145 [truetype] Use SUB_LONG for component offset. 146 147 * src/truetype/ttgload.c (TT_Process_Composite_Component): do it. 148 149 Bug: https://crbug.com/1309429 150 1512022-03-31 Werner Lemberg <wl@gnu.org> 152 153 CMakeList.txt: Update code to handle recent changes for `freetype.pc`. 154 155 Fixes #1144. 156 1572022-03-31 Werner Lemberg <wl@gnu.org> 158 159 CMakeLists.txt: s/PKG_CONFIG/PKGCONFIG/, s/REQUIRED_/REQUIRES_/. 160 1612022-03-31 Werner Lemberg <wl@gnu.org> 162 163 * Version 2.12.0 released. 164 ========================== 165 166 Tag sources with `VER-2-12-0'. 167 168 * docs/VERSION.TXT: Add entry for version 2.12.0. 169 * docs/CHANGES, docs/release: Updated. 170 171 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 172 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 173 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 174 docs/freetype-config.1: s/2.11.1/2.12.0/, s/2111/2120/. 175 176 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12. 177 (FREETYPE_PATCH): Set to 0. 178 179 * builds/unix/configure.raw (version_info): Set to 24:2:18. 180 * CMakeLists.txt (VERSION_MINOR): Set to 12. 181 (VERSION_PATCH): Set to 0. 182 183 * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits 184 since version 2.11.0 (when we stopped creating this file manually). 185 1862022-03-31 Werner Lemberg <wl@gnu.org> 187 188 Fix clang++ warnings. 189 190 * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c 191 (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new), 192 src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW), 193 src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c 194 (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize 195 variables used for allocation. 196 197 * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of 198 `max_splits` to FT_UInt. 199 (sdf_generate_bounding_box): Add cast. 200 2012022-03-30 Werner Lemberg <wl@gnu.org> 202 203 Whitespace. 204 2052022-03-30 Werner Lemberg <wl@gnu.org> 206 207 [builds] Fix creation of `freetype2.pc` for static-only builds. 208 209 We have to help `pkg-config` since it can't recognize that there is no 210 shared library installed. 211 212 Note that meson already does exactly the same. 213 214 * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to... 215 (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them 216 depending on `$enable_shared`. 217 (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables. 218 219 * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated 220 variables. 221 2222022-03-25 Werner Lemberg <wl@gnu.org> 223 224 Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`. 225 226 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY, 227 FT_HAS_SBIX_OVERLAY): New macro. 228 229 * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`. 230 Remove obsolete tracing message. 231 2322022-03-25 Werner Lemberg <wl@gnu.org> 233 234 Add `FT_PARAM_TAG_IGNORE_SBIX`. 235 236 This is another bit to handle 'sbix' tables as described in the OpenType 237 specification. 238 239 * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro. 240 241 * src/sfnt/sfobjc.c (is_apple_sbix): Rename to... 242 (has_sbix): ... this. 243 Check for more sbit tables. 244 Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`. 245 Only call sbit table loader if an sbit table is present. 246 2472022-03-25 Werner Lemberg <wl@gnu.org> 248 249 [truetype] Fix 'sbix' table handling. 250 251 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of 252 'metrics->horiBearingY'. 253 Set vertical metrics. 254 255 * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`. 256 Handle metrics of fonts with 'sbix' table. 257 258 * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply 259 bbox offset and bearing values of the corresponding glyph in the 'glyf' 260 table if it exists and has a contour. 261 262 * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table. 263 264 Fixes issue #998. 265 2662022-03-25 Werner Lemberg <wl@gnu.org> 267 268 Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`. 269 270 Fonts with 'sbix' tables need special handling by the application. 271 272 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros. 273 274 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix' 275 table is present. 276 2772022-03-25 Werner Lemberg <wl@gnu.org> 278 279 * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public. 280 2812022-03-24 Carlo Bramini <carlo.bramix@libero.it> 282 283 [builds/windows] Fix WCE support. 284 285 * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by 286 _alloca. 287 2882022-03-24 Steve Lhomme <robux4@ycbcr.xyz> 289 290 [build/windows] Improve UWP support. 291 292 * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA. 293 2942022-03-21 Werner Lemberg <wl@gnu.org> 295 296 * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table. 297 298 Fixes #1141. 299 3002022-03-20 Ben Wagner <bungeman@chromium.org> 301 302 [woff2] Support overlap flag for simple glyphs. 303 304 In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag 305 to be retained through the woff2 format [0]. 306 307 [0] https://www.w3.org/TR/WOFF2/#glyf_table_format 308 309 * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag. 310 311 * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and 312 overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's 313 flag if the overlap bit is set. 314 3152022-03-19 Werner Lemberg <wl@gnu.org> 316 317 [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`. 318 319 * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro. 320 (cff_slot_load): Use it. 321 3222022-03-19 Werner Lemberg <wl@gnu.org> 323 324 * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`. 325 326 Fixes #1140. 327 3282022-03-19 Werner Lemberg <wl@gnu.org> 329 330 * src/base/ftobjs.c (ft_open_face_internal): Thinko. 331 3322022-03-19 Ben Wagner <bungeman@chromium.org> 333 334 [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3. 335 336 * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added. 337 3382022-03-19 Werner Lemberg <wl@gnu.org> 339 340 * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`. 341 342 We must ensure that the cast to `FT_Int` doesn't change the sign. 343 344 Fixes #1139. 345 3462022-03-17 Werner Lemberg <wl@gnu.org> 347 348 [sfnt] Avoid invalid face index. 349 350 Fixes #1138. 351 352 * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font): 353 Check `face_index` before decrementing. 354 3552022-03-07 Werner Lemberg <wl@gnu.org> 356 357 Documentation, whitespace. 358 3592022-03-05 Anuj Verma <anuj@womp.xyz> 360 361 [sdf] Fix corner checks and improve performance. 362 363 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if 364 two distances (for different curves) are very close. 365 366 (sdf_conic_to): Check whether the conic curve can be treated as a line 367 (which happens if the control point coincides with any end point). 368 3692022-03-05 Anuj Verma <anuj@womp.xyz> 370 371 [sdf] Implement deviation-based splitting for Bezier curves. 372 373 * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure 374 out the deviation of Bezier curves and stop splitting if the curve is flat 375 enough. 376 377 * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro. 378 3792022-03-05 Anuj Verma <anuj@womp.xyz> 380 381 * include/freetype/freetype.h: Improve SDF documentation. 382 3832022-03-03 Ben Wagner <bungeman@chromium.org> 384 385 [sfnt] Fix bounds check in SVG. 386 387 The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not 388 protected by parentheses. As a result, the expression 389 `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to 390 `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected 391 `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect 392 bounds check which may lead to reading past the end of the `SVG ` table. 393 394 * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in 395 parentheses. 396 397 Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179 398 3992022-02-23 Ben Wagner <bungeman@chromium.org> 400 401 [psaux] Full bounds check for OtherSubr 19. 402 403 It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is 404 NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with 405 `blend->num_designs` set to 2, and the user supplied `idx` to be large (for 406 example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds 407 check overflows in a well defined manner, allowing for an invalid call to 408 `memcpy`. 409 410 In addition, it is possible to call OtherSubr 19 with 411 `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying 412 that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes 413 the bounds check (it is logically always fine to copy nothing starting at 414 index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed 415 by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is 416 undefined behavior (even if `count` is zero). 417 418 * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that 419 `blend->num_designs` can be copied to `decoder->buildchar[idx]`. 420 Also avoid passing NULL to `ft_memcpy`. 421 422 Bug: https://crbug.com/1299259 423 4242022-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 425 426 [cmake] Drop the support of CMake 2.x. 427 428 * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer. 429 430 The issue #1059 reports the difficulty to support both of 431 CMake 2.x and newer one by single CMakeLists.txt without 432 the inflation of cmake_policy() workarounds. 433 434 For better maintainability, the support of CMake 2.x is 435 dropped. 436 4372022-02-19 Werner Lemberg <wl@gnu.org> 438 439 * src/bdf/README: Updated. 440 4412022-02-19 Werner Lemberg <wl@gnu.org> 442 443 * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|. 444 4452022-02-19 Werner Lemberg <wl@gnu.org> 446 447 src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize. 448 449 A kerning table can be handled by binary search if it has equal entries. 450 451 Fixes #1132. 452 4532022-02-17 Steve Lhomme <robux4@ycbcr.xyz> 454 Alexei Podtelezhnikov <apodtele@gmail.com> 455 456 [builds/windows] Add support for legacy UWP builds. 457 458 * builds/windows/ftsystem.c: Add neccessary macro substitutions to 459 enable strict UWP builds. 460 461 See !141. 462 4632022-02-16 Werner Lemberg <wl@gnu.org> 464 465 ftmm.h: Minor documentation improvement. 466 4672022-02-13 Alexei Podtelezhnikov <apodtele@gmail.com> 468 469 [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value. 470 471 Before the change, the hinting engine frequently confused horizontal 472 stem and serif hints making some stems too thin and some serifs too 473 thick. The value was tuned using serif fonts from the URW+ base 35 474 collection. 475 476 * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/. 477 4782022-02-12 Werner Lemberg <wl@gnu.org> 479 480 t1tables.h: Documentation improvements. 481 4822022-02-12 Werner Lemberg <wl@gnu.org> 483 484 t1tables.h: Whitespace. 485 4862022-02-11 Werner Lemberg <wl@gnu.org> 487 488 [type42] Fix `FT_Get_PS_Font_Private` for this format. 489 490 Since Type42 fonts don't have a 'Private' dictionary, the return value 491 should be `FT_Err_Invalid_Argument`. 492 493 * src/type42/t42drivr.c (t42_ps_get_font_private): Removed. 494 (t42_service_ps_info): Updated. 495 4962022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com> 497 498 [pshinter] Clear reused mask. 499 500 In PS hinter, memory allocations persist until the module is done. 501 Therefore, we have to clear reused masks. 502 503 * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask. 504 5052022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com> 506 507 [pshinter] Use unsigned indices. 508 509 This reduces casting and eliminates some checks. 510 511 * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge, 512 ps_dimension_add_t1stem, ps_hints_t1stem3): Updated. 513 (ps_dimension_add_counter): Updated, unnecessary checks removed. 514 5152022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com> 516 517 [pshinter] Fix mask merging. 518 519 We forgot to update the number of bits when merging a larger mask 520 into a smaller one. This fix might have rendering effects. 521 522 * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number 523 of bits from a larger mask. There is no need to zero unused bits, 524 already zeroed during allocation. 525 (ps_mask_clear_bit): Removed. 526 (ps_mask_ensure): Minor. 527 5282022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com> 529 530 [pshinter] Revise the hint table handling. 531 532 * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size 533 check; avoid array zeroing because it is fully initialized when used. 534 (ps_hint_table_alloc): Fix off-by-one comparison and remove another 535 zeroing of the array elements. 536 5372022-02-06 Werner Lemberg <wl@gnu.org> 538 539 Various minor doc fixes. 540 5412022-02-06 Alexei Podtelezhnikov <apodtele@gmail.com> 542 543 [builds/windows] Add SVG to to project files. 544 545 * builds/windows/vc2010/freetype.vcxproj: Updated. 546 * builds/windows/vc2010/freetype.vcxproj.filters: Updated. 547 * builds/windows/visualc/freetype.vcproj: Updated. 548 5492022-02-03 Alexei Podtelezhnikov <apodtele@gmail.com> 550 551 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources. 552 5532022-02-02 Eric Jing <@CPUcontrol> 554 555 [cmake] Fix build on MacOS. 556 557 * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building 558 of a framework on MacOS. 559 560 * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier 561 lowercase only. 562 563 Fixes #1127. 564 5652022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com> 566 567 [psaux] Revise `PS_Table` handling. 568 569 The old impleemntation was not using `FT_REALLOC`, buing too careful 570 with the offset rebasing. It shoudl be safe to rely on the base 571 movements. 572 573 * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine 574 into... 575 (ps_table_realloc): ... this function based on `FT_REALLOC`. 576 (ps_table_done): Simplified. 577 (ps_table_add): Updated. 578 5792022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com> 580 581 * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing. 582 5832022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com> 584 585 [cache] Partially revert 9870b6c07e2c. 586 587 Fix crashes reported by Werner. 588 589 * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again. 590 5912022-01-31 Werner Lemberg <wl@gnu.org> 592 593 freetype.h: Minor documentation improvement. 594 5952022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com> 596 597 [cache] Fix fallouts from edd4fedc5427. 598 599 Reported by Werner. 600 601 * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph. 602 * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit. 603 6042022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com> 605 606 Clean-up - do not doubt FT_FREE. 607 608 * src/base/ftobjs.c (memory_stream_close): Do not reassign zero 609 after `FT_FREE`. 610 * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto. 611 * src/sfnt/sfwoff2.c (stream_close): Ditto. 612 * src/psaux/psobjs.c (ps_parser_load_field): Ditto. 613 * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend, 614 tt_set_mm_blend): Ditto. 615 6162022-01-30 Werner Lemberg <wl@gnu.org> 617 618 * CMakeLists.txt: Include 'FindPkgConfig' module. 619 620 Older cmake versions don't provide `pkg_check_modules` by default. 621 622 Fixes #1126. 623 6242022-01-30 Alexei Podtelezhnikov <apodtele@gmail.com> 625 626 * src/psaux/psobjs.c (ps_parser_load_field): Reduce `string` scope. 627 6282022-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 629 630 [cmake] Check the availability of `bzip2.pc'. 631 632 (CMakeLists.txt): Check the availability of `bzip2.pc'. 633 634 * If `bzip2.pc' is available, Requires.private should include 635 bzip2, but Libs.private should not include -lbz2. 636 637 * If `bzip2.pc' is unavailable, Requires.private cannot include 638 bzip2, but Libs.private should include -lbz2. 639 640 Fix #897. 641 6422022-01-28 Werner Lemberg <wl@gnu.org> 643 644 * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer. 645 646 Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`. 647 6482022-01-28 Alexei Podtelezhnikov <apodtele@gmail.com> 649 650 Minor clean-ups. 651 652 * src/base/ftrfork.c (raccess_make_file_name): Do not set error. 653 * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto. 654 * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error. 655 * src/psaux/psobjs.c (ps_table_done): Ditto. 656 * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto. 657 6582022-01-27 Ben Wagner <bungeman@chromium.org> 659 660 Document `FT_Outline_Decompose` degenerate segments. 661 662 `FT_Outline_Decompose` does not filter out and can return degenerate 663 segments in an outline. This can be surprising when attemping to 664 stroke such an outline. Clarify the existing documentation on this 665 matter to cover all forms of degeneracy (without specifying exactly 666 how they will be reported), why they might arise, and better explain in 667 what cases they may be an issue. 668 669 * include/freetype/ftoutlin.h (FT_Outline_Decompose): update 670 documentation. 671 672 Fixes #952. 673 6742022-01-27 Anuj Verma <anujv@posteo.net> 675 676 Fix sdf computation while `USE_SQUARED_DISTANCES`. 677 678 Function `map_fixed_to_sdf` expects spread to be absolute 679 and not squared. 680 681 * src/sdf/ftbsdf.c (finalize_sdf): Pass absolute spread 682 while `map_fixed_to_sdf`. 683 684 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Ditto. 685 6862022-01-27 Tapish Ojha <tapishojha2000@gmail.com> 687 688 [sfnt] Improve sRGB constants. 689 690 * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly 691 more precise values. 692 693 Fixes #1018. 694 6952022-01-27 Werner Lemberg <wl@gnu.org> 696 697 docs/release: Updated. 698 6992022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com> 700 701 * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY. 702 7032022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com> 704 705 * src/sdf/ftsdf.c (sdf_*_new): Use standard macro. 706 7072022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com> 708 709 [pcf] Delay encoding allocation and avoid its zeroing. 710 711 * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY. 712 7132022-01-25 Werner Lemberg <wl@gnu.org> 714 715 Aarg, typo. 716 7172022-01-25 Werner Lemberg <wl@gnu.org> 718 719 freetype.h: More updates to `FT_LOAD_COLOR` description. 720 7212022-01-25 Werner Lemberg <wl@gnu.org> 722 723 * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`. 724 725 This helps in decoupling library support from `pkg-config` for other 726 platforms. 727 7282022-01-25 Werner Lemberg <wl@gnu.org> 729 730 Update documentation for `FT_LOAD_COLOR`. 731 7322022-01-24 Ben Wagner <bungeman@chromium.org> 733 734 [pshinter] Ensure all point flags are initialized. 735 736 Only off curve point flags were fully initialized. 737 738 * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags. 739 740 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930 741 7422022-01-24 Werner Lemberg <wl@gnu.org> 743 744 .mailmap: Typo. 745 7462022-01-23 Werner Lemberg <wl@gnu.org> 747 748 * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers. 749 7502022-01-23 Werner Lemberg <wl@gnu.org> 751 752 .mailmap: Updated. 753 7542022-01-23 Werner Lemberg <wl@gnu.org> 755 756 More documentation on handling OT-SVG. 757 7582022-01-23 Werner Lemberg <wl@gnu.org> 759 760 * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency. 761 7622022-01-22 Werner Lemberg <wl@gnu.org> 763 764 [sfnt] Reject malformed SVG tables. 765 766 * src/sfnt/ttsvg.c (SVG_TABLE_HEADER_SIZE, SVG_DOCUMENT_RECORD_SIZE, 767 SVG_DOCUMENT_LIST_MINIMUM_SIZE, SVG_MINIMUM_SIZE): New macros. 768 (tt_face_load_svg): Check offsets. 769 Check table and record sizes. 770 771 Reported as 772 773 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43918 774 7752022-01-22 Alexei Podtelezhnikov <apodtele@gmail.com> 776 777 * src/psaux/psobjs.c (ps_table_new): Revert to zeroing. 778 7792022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 780 781 [psaux, type1, type42] Avoid annecessary zeroing. 782 783 * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY. 784 * src/type1/t1load.c (parse_encoding): Ditto. 785 * src/type42/t42parse.c (t42_parse_encoding): Ditto. 786 7872022-01-20 Werner Lemberg <wl@gnu.org> 788 789 [builds/unix] Handle 'librsvg' for demo programs. 790 791 * builds/unix/configure.raw: Check for 'librsvg'. 792 (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on... 793 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables. 794 795 * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by... 796 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables. 797 7982022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 799 800 Add 'svg' module for OT-SVG rendering. 801 802 * CMakeLists.txt (BASE_SRCS): Add svg module file. 803 * meson.build (ft2_public_headers): Add `otsvg.h`. 804 805 * modules.cfg (RASTER_MODULES): Add `svg` module. 806 807 * builds/meson/parse_modules_cfg.py: Add svg module. 808 809 * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`. 810 * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and 811 `Missing_SVG_Hooks` error codes. 812 * include/freetype/internal/fttrace.h: Add tracing for `otsvg`. 813 * include/freetype/internal/svginterface.h: New file. It adds an interface 814 to enable the presetting hook from the `base` module. 815 * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func, 816 SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering. 817 (SVG_RendererHooks): New structure to access them. 818 819 * src/base/ftobjs.c: Include `svginterface.h`. 820 (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG 821 glyphs. 822 (ft_add_renderer): Updated. 823 824 * src/svg/*: New files. 825 8262022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 827 828 Add `FT_Glyph` support for OT-SVG glyphs. 829 830 * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure. 831 832 * src/base/ftglyph.c: Include `otsvg.h`. 833 (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy, 834 ft_svg_glyph_transform, ft_svg_glyph_prepare): New function. 835 (ft_svg_glyph_class): New class. 836 (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs. 837 * src/base/ftglyph.h: Updated. 838 8392022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 840 841 [truetype, cff] Add code to load SVG document. 842 843 * src/cff/cffgload.c (cff_slot_load): Add code to load SVG doc. 844 * src/truetype/ttgload.c (TT_Load_Glyph): Add code to load SVG doc. 845 8462022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 847 848 Add code to load OT-SVG glyph documents. 849 850 * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro. 851 * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros. 852 (FT_LOAD_SVG_ONLY): New internal macro. 853 * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value 854 `FT_GLYPH_FORMAT_SVG`. 855 * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro. 856 * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`. 857 * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New 858 functions. 859 * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for 860 the SVG table. 861 * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the 862 SVG document and other necessary information of an OT-SVG glyph in a glyph 863 slot. 864 * include/freetype/tttags.h (TTAG_SVG): New macro. 865 866 * src/base/ftobjs.c: Include `otsvg.h`. 867 (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other` 868 if the SVG table exists. 869 (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed 870 glyph. 871 (ft_glyphslot_done): Free the document data if it is a GZIP compressed 872 glyph. 873 (FT_Load_Glyph): Don't auto-hint SVG documents. 874 875 * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for 876 FT_GLYPH_FORMAT_SVG. 877 878 * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`. 879 * src/sfnt/sfdriver.c: Include `ttsvg.h`. 880 (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and 881 `tt_face_load_svg_doc`. 882 * src/sfnt/sfnt.c: Include `ttsvg.c`. 883 * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and 884 free data of the the SVG table. 885 * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`, 886 `tt_face_free_svg` and `tt_face_load_svg_doc`. 887 * src/sfnt/ttsvg.h: Declarations of the SVG functions in 888 `ttsvg.c`. 889 8902022-01-20 Moazin Khatti <moazinkhatri@gmail.com> 891 892 Add flag `FT_CONFIG_OPTION_SVG`. 893 894 This flag is going to be used to conditionally compile support for OT-SVG 895 glyphs. FreeType will do the parsing and rely on external hooks for 896 rendering of OT-SVG glyphs. 897 898 * devel/ftoption.h, include/freetype/config/ftoption.h 899 (FT_CONFIG_OPTION_SVG): New flag. 900 9012022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 902 903 [pshinter] Avoid unnecessary zeroing. 904 905 * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init, 906 psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY. 907 9082022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 909 910 * include/freetype/freetype.h: Clarify `FT_Size` life cycle. 911 9122022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com> 913 914 [base] Undefined scale means no scale. 915 916 It might be surprising that FreeType does not have default ppem and 917 the size has to be set explicitly or face undefined behavior with 918 undefined variables and errors. This offers an alternative to 919 missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined 920 behavior is bettr than undefined one. 921 922 This is alternative to !132 and discussed in 923 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708 924 925 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale. 926 * include/freetype/freetype.h: Document it. 927 9282022-01-18 Alexei Podtelezhnikov <apodtele@gmail.com> 929 930 * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing. 931 932 Everything in AF_FaceGlobals is initialized except metrics. Those 933 are zeroed here and initialized on demand later. 934 9352022-01-16 Alexei Podtelezhnikov <apodtele@gmail.com> 936 937 [bdf,type1] Avoid unnecessary hash zeroing. 938 939 * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`. 940 * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`. 941 9422022-01-16 Ozkan Sezer <sezeroz@gmail.com> 943 944 Add Watcom C/C++ calling. 945 946 In the unlikely case the source is built with OpenWatcom's -ec? 947 switches to enforce a calling convention, the qsort() compare 948 function must still be set to __watcall. 949 950 * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): 951 Updated. 952 9532022-01-15 Ben Wagner <bungeman@chromium.org> 954 955 [pshinter] Avoid accessing uninitialized zone. 956 957 The `normal_top.count` may be 0, implying no `normal_top.zones` exist. 958 The code must not access these (non-existent) `normal_top.zones`. 959 960 * src/pshinter/pshalgo.c (ps_hints_apply): Do not assume that 961 `normal_top.zones[0]` is initialized. Test `normal_top.count` 962 before using `normal_top.zones[0]`. Do not rescale if there are no 963 `zones`. 964 965 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43675 966 9672022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 968 969 [cache] Avoid unnecessary zeroing. 970 971 * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`. 972 * src/cache/ftcimage.c (FTC_INode_New): Ditto. 973 * src/cache/ftcsbits.c (FTC_SNode_New): Ditto. 974 9752022-01-15 Ozkan Sezer <sezeroz@gmail.com> 976 977 Add Watcom C/C++ support. 978 979 * include/freetype/config/integer-types.h: Make sure `long long` is 980 used then available. 981 * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma. 982 9832022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 984 985 * src/sdf/ftbsdf.c (ED): s/near/prox/. 986 987 This works around the Watcom C definition of `near` as restricted 988 __near. 989 9902022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com> 991 992 * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten. 993 994 This works around Watcom C library using __watcall. 995 9962022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 997 998 * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing. 999 1000 This large allocation is followed by careful initialization. Whatever 1001 is missed should be initialized manually. 1002 10032022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 1004 1005 * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing. 1006 10072022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com> 1008 1009 * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment. 1010 10112022-01-13 Alexei Podtelezhnikov <apodtele@gmail.com> 1012 1013 * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing. 1014 10152022-01-13 Ben Wagner <bungeman@chromium.org> 1016 1017 [bzip2] Reset bzip stream on any error. 1018 1019 According to the bzip documentation it is undefined what will happen if 1020 `BZ2_bzDecompress` is called on a `bz_stream` it has previously returned an 1021 error against. If `BZ2_bzDecompress` returns anything other than `BZ_OK` 1022 the only valid next action is `BZ2_bzDecompressEnd`. 1023 1024 Reported as 1025 1026 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564 1027 1028 * src/bzip2/ftbzip2.c (FT_BZip2FileRec_): Add `reset` to track the need to 1029 reset the stream. 1030 (ft_bzip2_file_init): Initialize `reset` to 0. 1031 (ft_bzip2_file_reset): Set `reset` to 0 after resetting. 1032 (ft_bzip2_file_fill_output): Set `reset` to 1 when `BZ2_bzDecompress` 1033 returns anything other than `BZ_OK`. 1034 10352022-01-12 Werner Lemberg <wl@gnu.org> 1036 1037 .gitlab-ci.yml: Minor comment cleanups. 1038 10392022-01-12 Azamat H. Hackimov <azamat.hackimov@gmail.com> 1040 1041 .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA. 1042 1043 Fetch current list of valid CAs from Windows Update and manually import them 1044 to trusted datastore. This action is required to make downloads work from 1045 sites that need recent Let's Encrypt ISRG Root X1 certificate. 1046 10472022-01-11 Ben Wagner <bungeman@chromium.org> 1048 1049 Revert "[bzip2] Avoid use of uninitialized memory." 1050 1051 This reverts commit d276bcb7f0c02c20d3585b2e5626702df6d140a6. 1052 1053 The original commit did avoid the use of uninitialized memory. However, 1054 it appears that the original commit is no longer required. The 1055 underlying issue was resolved by a change in freetype2-testing "Build 1056 bzip2 correctly." [0]. Prior to [0] bzip2 was built without msan, so 1057 bzip2 writes were not tracked or considered initialized. Clearing 1058 `buffer` in the original commit allowed msan to see the `buffer` content 1059 initialized once in FreeType code, but msan saw no writes into buffer 1060 from bzip2. With bzip2 now built with msan, the bzip2 writes are 1061 properly instrumented and msan sees the bzip2 writes into the buffer. As 1062 a result the original commit can be safely reverted to allow for better 1063 detection of other uninitialized data scenarios. 1064 1065 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Revert to using `FT_QNEW`. 1066 1067 [0] https://github.com/freetype/freetype2-testing/commit/3c052a837a3c960709227a0d6ddd256e87b88853 1068 10692022-01-11 Ben Wagner <bungeman@chromium.org> 1070 1071 [type42] Track how much type42 ttf data is available. 1072 1073 Currently `T42_Open_Face` eagerly allocates 12 bytes for the ttf header 1074 data which it expects `t42_parse_sfnts` to fill out from /sfnts data. 1075 However, there is no guarantee that `t42_parse_sfnts` will actually be 1076 called while parsing the type42 data as the /sfnts array may be missing 1077 or very short. This is also confusing behavior as it means 1078 `T42_Open_Face` is tightly coupled to the implementation of the very 1079 distant `t42_parse_sfnts` code which requires at least 12 bytes to 1080 already be reserved in `face->ttf_data`. 1081 1082 `t42_parse_sfnts` itself eagerly updates `face->ttf_size` to track how 1083 much space is reserved for ttf data instead of traking how much data has 1084 actually been written into `face->ttf_data`. It will also act strangely 1085 in the presense of multiple /sfnts arrays. 1086 1087 * src/type42/t42objs.c (T42_Open_Face): ensure `ttf_data` is initialized 1088 to NULL. Free `ttf_data` on error. 1089 1090 * src/type42/t42parse.c (t42_parse_sfnts): delay setting `ttf_size` and 1091 set it to the actual number of bytes read. Ensure `ttf_data` is freed 1092 if there are multiple /sfnts arrays or there are any errors. 1093 10942022-01-11 Dominik Röttsches <drott@chromium.org> 1095 1096 [sfnt] Fix limit checks for `COLR` v1 ClipBoxes 1097 1098 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Fix off-by-one in 1099 limit checks. 1100 11012022-01-11 Werner Lemberg <wl@gnu.org> 1102 1103 Update all copyright notices. 1104 11052022-01-11 Werner Lemberg <wl@gnu.org> 1106 1107 * src/sfnt/ttcolr.c (read_paint): Fix undefined left-shift operation. 1108 1109 Reported as 1110 1111 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43151 1112 11132022-01-11 Werner Lemberg <wl@gnu.org> 1114 1115 * src/type42/t42objs.c (T42_Open_Face): Avoid use of uninitialized memory. 1116 1117 Reported as 1118 1119 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43508 1120 11212022-01-11 Werner Lemberg <wl@gnu.org> 1122 1123 .gitlab-ci.yml: Fix typo in previous commit. 1124 11252022-01-11 Werner Lemberg <wl@gnu.org> 1126 1127 .gitlab-ci.yml: Update Windows image. 1128 1129 The old image produced errors like 1130 1131 ``` 1132 Downloading zlib patch from 1133 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch 1134 A fallback URL could be specified using patch_fallback_url key in the wrap file 1135 WrapDB connection failed to 1136 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch 1137 with error 1138 <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 1139 failed: certificate has expired (_ssl.c:1122)> 1140 ``` 1141 11422022-01-11 Werner Lemberg <wl@gnu.org> 1143 1144 * subprojects/zlib.wrap: Update from upstream. 1145 11462022-01-10 Werner Lemberg <wl@gnu.org> 1147 1148 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Add limit checks. 1149 1150 Reported as 1151 1152 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40716 1153 11542022-01-10 Werner Lemberg <wl@gnu.org> 1155 1156 [zlib] Don't typedef `ptrdiff_t`. 1157 1158 While using zlib in 'solo' mode (via the `Z_SOLO` macro), we actually 1159 include some standard header files, making the typedef fail on systems where 1160 the native `ptrdiff_t` type differs. 1161 1162 Fixes #1124. 1163 1164 * src/zlib/zutil.h: Comment out definition; it doesn't work on Windows. 1165 1166 * src/zlib/patches/freetype-zlib.diff: Updated. 1167 11682022-01-10 Werner Lemberg <wl@gnu.org> 1169 1170 [zlib] Some organizational changes. 1171 1172 We now first apply zlib's `zlib2ansi` script, then FreeType's patch file. 1173 1174 * src/gzip/README.freetype: Updated. 1175 1176 * patches/0001-zlib-Fix-zlib-sources-to-compile-for-FreeType.patch: Renamed 1177 to... 1178 * patches/freetype-zlib.diff: This. 1179 Clean up description, then regenerate it as follows: 1180 1181 - Copy unmodified files from `zlib` repository. 1182 - Run `zlib2ansi` script. 1183 - Run `git diff -R > patches/freetype-zlib.diff.new`. 1184 - Insert patch description of old diff file, then replace old diff with 1185 new diff file. 1186 11872022-01-09 David Turner <david@freetype.org> 1188 1189 [gzip] Update sources to zlib 1.2.11 1190 1191 This can be tested by building with the Unix development build 1192 1193 make setup devel 1194 make 1195 1196 or by building the freetype-demos programs with 1197 1198 meson setup build -Dfreetype2:zlib=internal 1199 meson compile -C out 1200 1201 and trying to run `ftview` with a `.pcf.gz` font file. 1202 1203 * src/gzip/ftgzip.c, src/gzip/rules.mk: Update for new zlib sources. Also 1204 remove the temporary fix introduced in commit 6a431038 to work around the 1205 fact that the internal sources were too old. 1206 1207 * src/gzip/README.freetype: New file describing the origin of the sources 1208 and how they were modified. 1209 1210 * src/gzip/patches/*: Patch files applied to original sources. 1211 1212 * src/gzip/*: Updated zlib sources with the patch file(s) from 1213 `src/gzip/patches/` applied, followed by a conversion with zlib's 1214 `zlib2ansi` script. 1215 12162022-01-09 David Turner <david@freetype.org> 1217 1218 [meson] Change Zlib configuration option. 1219 1220 * meson_options.txt, meson.build: Change the format of the 'zlib' meson 1221 build configuration option to be a combo with the following choices: 1222 1223 - none: Do not support gzip-compressed streams at all. 1224 1225 - internal: Support gzip-compressed streams using the copy of the gzip 1226 sources under `src/gzip/`; this should only be used during development 1227 to ensure these work properly. 1228 1229 - external: Support gzip-compressed streams using the 'zlib' Meson 1230 subproject, linked as a static library. 1231 1232 - system: Support gzip-compressed streams using a system-installed version 1233 of zlib. 1234 1235 - auto: Support gzip-compressed streams using a system-installed version 1236 of zlib, if available, or using the 'zlib' subproject otherwise. This 1237 is the default. 1238 1239 - disabled: Backward-compatible alias for 'none'. 1240 1241 - enabled: Backward-compatible alias for 'auto'. 1242 12432022-01-09 Werner Lemberg <wl@gnu.org> 1244 1245 [bzip2] Avoid use of uninitialized memory. 1246 1247 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but 1248 `FT_NEW` for setting up `zip` to avoid uninitialized memory access while 1249 handling malformed PCF fonts later on. 1250 1251 Fixes 1252 1253 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800 1254 12552022-01-09 Alexei Podtelezhnikov <apodtele@gmail.com> 1256 1257 [sfnt] Fix off-by-one error. 1258 1259 The 0-base index is equal to the number of previosly parsed entries. 1260 It is an error to adjust it by one to get the number truncated by 1261 a stream error. This is probably inconsequential because valid 1262 entries are correctly accounted for. 1263 1264 * src/sfnt/ttload.c (check_table_dir): Do not adjust the truncated 1265 number of tables. 1266 12672022-01-08 Werner Lemberg <wl@gnu.org> 1268 1269 [sfnt, type42] Correct previous commit. 1270 1271 Really fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773. 1272 1273 * src/sfnt/ttload.c (check_table_dir): Revert change. 1274 1275 * src/type42/t42.parse.c (t42_parse_sfnts): Don't use `FT_QREALLOC` but 1276 `FT_REALLOC` for setting up `ttf_data` to avoid uninitialized memory access 1277 while handling malformed TrueType fonts later on. 1278 12792022-01-07 Werner Lemberg <wl@gnu.org> 1280 1281 * src/sfnt/ttload.c (check_table_dir): Initialize `table`. 1282 1283 Reported as 1284 1285 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773 1286 12872022-01-07 Werner Lemberg <wl@gnu.org> 1288 1289 [sfnt] Avoid 'runtime error: applying zero offset to null pointer'. 1290 1291 * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if 1292 `line` is NULL. 1293 12942022-01-07 Werner Lemberg <wl@gnu.org> 1295 1296 [autofit, pshinter] Use `FT_OFFSET`. 1297 1298 This avoids 1299 1300 ``` 1301 runtime error: applying zero offset to null pointer 1302 ``` 1303 1304 warnings of clang's undefined behaviour sanitizer. 1305 1306 * src/autofit/afcjk.c (af_cjk_hints_link_segments, 1307 af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges, 1308 af_cjk_hint_edges, af_cjk_align_edge_points): Do it. 1309 1310 * src/autofit/afhints.c (af_glyph_hints_align_edge_points, 1311 af_glyph_hints_align_strong_points): Ditto. 1312 1313 * src/autofit/aflatin.c (af_latin_metrics_init_widths, 1314 af_latin_hints_link_segments, af_latin_hints_compute_edges, 1315 af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto. 1316 1317 * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto. 1318 13192022-01-06 Ben Wagner <bungeman@chromium.org> 1320 1321 [truetype] Reset localpoints when varying cvt. 1322 1323 When iterating over the cvt tuples and reading in the points it is necessary 1324 to set all of `localpoints`, `points`, and `point_count` in all cases. The 1325 existing code did not reset `localpoints` to `NULL` when there were no 1326 private point numbers. If the previous tuple did have private point numbers 1327 and set `localpoints` to `ALL_POINTS` this would not be cleared and the 1328 wrong branch would be taken later, leading to possible heap buffer overflow. 1329 1330 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Reset `localpoints` to `NULL` 1331 when it isn't valid. 1332 1333 Fixes: https://crbug.com/1284742 1334 13352022-01-02 Werner Lemberg <wl@gnu.org> 1336 1337 * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable. 1338 1339 This was accidentally removed with commit 93ebcbd0 almost eight years ago. 1340 13412021-12-27 Alexander Borsuk <me@alex.bio> 1342 1343 Fix warnings for CMake Unity builds. 1344 1345 * src/cache/ftcbasic.c (FT_COMPONENT): Undefine macro before redefinition. 1346 * src/smooth/ftgrays.c (TRUNC, FRACT): Ditto. 1347 13482021-12-18 Alexander Borsuk <alexander.borsuk@qnective.com> 1349 1350 Clang-Tidy warning fixes. 1351 1352 * src/base/ftobjs.c (FT_Get_Paint): Operator has equivalent nested operands. 1353 * src/bdf/bdflib.c (_bdf_add_property): Value stored to `fp` is never read. 1354 * src/sdf/ftbsdf.c (bsdf_init_distance_map): Value stored to `pixel` is 1355 never read. 1356 * src/sdf/ftsdf.c (split_sdf_shape): Value stored to `error` is never read. 1357 13582021-12-17 Eli Schwartz <eschwartz@archlinux.org> 1359 1360 * meson.build: Optimize lookup for `python3` program. 1361 1362 The python module's `find_installation` method is intended to provide 1363 routines for compiling and installing python modules into the 1364 `site-packages` directory. It does a couple of slow things, including run 1365 an introspection command to scrape sysconfig info from the detected 1366 interpreter, which are not needed for the sole use case of invoking the 1367 found installation as an executable. 1368 1369 Furthermore, when invoked without the name or path of a python binary, it is 1370 hardcoded to always look for `python3` corresponding to the interpreter 1371 meson itself uses to run. So using `find_installation` did not even allow 1372 detecting `python2` as a fallback. 1373 1374 Instead, switch to a simple `find_program` lookup that finishes as soon as 1375 the program is found. 1376 13772021-12-17 Eli Schwartz <eschwartz@archlinux.org> 1378 1379 * builds/meson/*.py: Fix name of python executable for auxiliary scripts. 1380 1381 The previous change to check the return code of `run_command` invocations 1382 caused the CI to fail. Although most scripts used `python_exe` as the 1383 program command, the script to determine the project version did not. 1384 1385 But, all scripts used `python` as the shebang, and this is not available on 1386 all systems. Particularly Debian does not provide a `python` command, 1387 though `python3` does exist. This meant that formerly the version number 1388 was lacking, and now the build simply fails. 1389 1390 Instead, rely on `python3` since it is guaranteed to exist when running 1391 meson, and `python2` is end of life anyway. 1392 13932021-12-17 Eli Schwartz <eschwartz@archlinux.org> 1394 1395 * meson.build: Check the return value of `run_command`. 1396 1397 By default, errors are not checked and a command that is somehow broken will 1398 just capture incorrect output (likely an empty string). Current development 1399 versions of meson now raise a warning for this implicit behavior, and advise 1400 explicitly setting the `check:` keyword argumend to determine whether a 1401 failing return code should be considered an error. 1402 1403 Since none of the commands in this project are expected to fail, mark them 1404 as required to succeed. 1405 14062021-12-13 Alexei Podtelezhnikov <apodtele@gmail.com> 1407 1408 [truetype] Upstream the hdmx binary search. 1409 1410 * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx 1411 widths. 1412 * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even 1413 though it might never be used by the interpreter. 1414 * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches 1415 in the hdmx table. 1416 14172021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1418 1419 [truetype] Reset the IUP-called flags for each subglyph. 1420 1421 This fixes fall-out from 7809007a5b88b15, where the composite 1422 accents were no longer hinted. 1423 1424 * src/truetype/ttgload.c (ttloader_init): Move the IUP-called flag 1425 initialization from here... 1426 * src/truetype/ttinterp.c (TT_Run_Context): ... to here. 1427 14282021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1429 1430 [truetype] Binary search through the `hdmx` records. 1431 1432 The `hdmx` table is supposed to be sorted by ppem size, which 1433 enables binary search. We also drop the check for the sufficient 1434 length of the record because it is now enforced when the table 1435 is loaded. 1436 1437 * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx` 1438 record pointers sorted by ppem instead of ppem's themselves. 1439 * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records. 1440 (tt_face_get_device_metrics): Implement binary search to retrieve 1441 advances. 1442 14432021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1444 1445 [truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable. 1446 1447 This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY 1448 is specified by FT_Get_Advances and the `hdmx` data are located. 1449 Particularly, the classic v35 interpreter or "verified" ClearType 1450 fonts might see 100x speed up in retrieving the hdmx cache. 1451 1452 * src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut. 1453 14542021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1455 1456 [truetype] Initialize the loader with `hdmx` data. 1457 1458 The `hdmx` matching can be done before the glyph is loaded. 1459 1460 * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field. 1461 * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx` 1462 code from here... 1463 (tt_loader_init): ... to here, before the glyph is loaded. 1464 14652021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1466 1467 [truetype] Relocate subpixel flag setting. 1468 1469 `TT_RunIns` is too busy to deal with subpixel flags. It is better 1470 to set them in `tt_loader_init`, which is executed before each 1471 glyph program. 1472 1473 * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting from 1474 here... 1475 * src/truetype/ttgload.c (tt_loader_init): ... to here. 1476 14772021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1478 1479 [truetype] Limit INSTCTRL appication within specs. 1480 1481 * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects 1482 to the CVT program and local effects to the glyph program. 1483 1484 This also fixes an Infinality buglet. The `ignore_x_mode` should be 1485 locally unset by the glyph program. 1486 14872021-12-09 Ben Wagner <bungeman@chromium.org> 1488 1489 [bdf] Fix use of uninitialized value. 1490 1491 In _bdf_readstream if the data contained no newline then the buffer 1492 would continue to grow and uninitialized data read until either the 1493 uninitialized data contained a newline or the buffer reached its 1494 maxiumum size. The assumption was that the line was always too long and 1495 the buffer had been filled, however this case can also happen when there 1496 is not enough data to fill the buffer. 1497 1498 Correct this by properly setting the cursor to the end of the available 1499 data, which may be different from the end of the buffer. This may still 1500 result in one extra allocation, but only on malformed fonts. 1501 1502 * src/bdf/bdflib.c (_bfd_readstream): Correctly update cursor. Remove 1503 unread set of `avail`. 1504 1505 Bug: https://lists.nongnu.org/archive/html/freetype-devel/2021-12/msg00001.html 1506 15072021-12-07 Alexei Podtelezhnikov <apodtele@gmail.com> 1508 1509 [truetype] Reduce Infinality footprint again. 1510 1511 * src/truetype/ttgload.c (compute_glyph_metrics): Streamline and 1512 prioritize the Infinality checks to use `hdmx`. 1513 15142021-12-07 Cameron Cawley <ccawley2011@gmail.com> 1515 1516 [builds/windows] Guard some non-ancient API. 1517 1518 We can support Windows 98 and NT 4.0 in principle... 1519 1520 * builds/windows/ftdebug.c, builds/windows/ftsystem.c: Check for the 1521 ancient SDK using _WIN32_WINDOWS, _WIN32_WCE, or _WIN32_WINNT. 1522 15232021-12-07 Cameron Cawley <ccawley2011@gmail.com> 1524 1525 * builds/windows/visualc/freetype.vcproj: Add missing file. 1526 15272021-12-02 Werner Lemberg <wl@gnu.org> 1528 1529 * Version 2.11.1 released. 1530 ========================== 1531 1532 Tag sources with `VER-2-11-1'. 1533 1534 * docs/VERSION.TXT: Add entry for version 2.11.1. 1535 * docs/CHANGES, docs/release: Updated. 1536 1537 * README, src/base/ftver.rc, builds/windows/vc2010/index.html, 1538 builds/windows/visualc/index.html, builds/windows/visualce/index.html, 1539 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, 1540 docs/freetype-config.1: s/2.11.0/2.11.1/, s/2110/2111/. 1541 1542 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. 1543 1544 * builds/unix/configure.raw (version_info): Set to 24:1:18. 1545 * CMakeLists.txt (VERSION_PATCH): Set to 1. 1546 1547 * builds/toplevel.mk (version_tag, CHANGELOG_SCRIPT): New variables. 1548 (do-dist): Generate `ChangeLog` file with all commits since last release. 1549 15502021-11-30 Alexei Podtelezhnikov <apodtele@gmail.com> 1551 1552 [builds/windows] Improve debugging. 1553 1554 * builds/windows/ftdebug.c (FT_Message, FT_Panic): Buffer output 1555 and call `OutputDebugStringA` only if `IsDebuggerPresent`. 1556 [_WIN32_WCE] (OutputDebugStringA): Implement the missing API. 1557 15582021-11-29 Seigo Nonaka <nona@google.com> 1559 1560 * src/base/ftobjs.c (FT_Request_Metrics): Fix build warning on Android. 1561 1562 Use casts since `FT_USHORT_MAX` is unsigned short in bionic (libc used in 1563 Android). 1564 15652021-11-28 Alexei Podtelezhnikov <apodtele@gmail.com> 1566 1567 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Minor tweak. 1568 15692021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com> 1570 1571 * src/truetype/ttpload.c (tt_face_load_hdmx): Added comments. 1572 15732021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com> 1574 1575 [truetype] Quietly reject out-of-spec `hdmx` tables. 1576 1577 The `hdmx` table is optional and can be safely rejected without 1578 an error if it does not follow specifications. The record size 1579 must be equal to the number of glyphs + 2 + 32-bit padding. 1580 1581 * src/truetype/ttpload.c (tt_face_load_hdmx): Thoroughly check 1582 the record size and improve tracing. 1583 15842021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com> 1585 1586 [truetype] Partly revert 5b626281. 1587 1588 Fixes #1118. 1589 1590 * src/truetype/ttpload.c (tt_face_load_hdmx): Do not assume that 1591 `record_size` is rounded even though the records are padded. 1592 15932021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com> 1594 1595 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Use transforms. 1596 15972021-11-22 Werner Lemberg <wl@gnu.org> 1598 1599 Update `CHANGES` files, other minor whitespace and documentation issues. 1600 16012021-11-21 Werner Lemberg <wl@gnu.org> 1602 1603 formats.txt: Add info about WOFF and WOFF2. 1604 16052021-11-21 Werner Lemberg <wl@gnu.org> 1606 1607 meson.build: Initialize `common_ldflags`. 1608 16092021-11-21 Lukas Oberhuber <@lukaso> 1610 1611 * meson.build: Fix compatibility version on MacOS. 1612 1613 Fixes #1117. 1614 16152021-11-21 Werner Lemberg <wl@gnu.org> 1616 1617 * src/truetype/ttinterp.c (Ins_MD): Avoid `FT_ABS`. 1618 1619 Reported as 1620 1621 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38562 1622 16232021-11-20 Alexei Podtelezhnikov <apodtele@gmail.com> 1624 1625 * include/freetype/fttypes.h (FT_MAKE_TAG): Remove the same casting. 1626 16272021-11-20 Werner Lemberg <wl@gnu.org> 1628 1629 [gxvalid] Fix minor compilation warning. 1630 1631 * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup): Declare 1632 as static. 1633 16342021-11-20 Werner Lemberg <wl@gnu.org> 1635 1636 [smooth] Fix stand-alone compilation. 1637 1638 * src/smooth/ftgrays.c (FT_Trace_Enable, FT_Trace_Disable)[STANDALONE_]: 1639 Define. 1640 16412021-11-20 Werner Lemberg <wl@gnu.org> 1642 1643 Avoid undefined left-shifts. 1644 1645 We really have to use double casts to avoid issues with C's and C++'s 1646 signedness propagation rules in implicit casts. 1647 1648 Reported as 1649 1650 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41178 1651 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41182 1652 1653 * include/freetype/config/public-macros.h (FT_STATIC_CAST, 1654 FT_REINTERPRET_CAST): Modify macro to take two arguments. 1655 Update all callers. 1656 (FT_STATIC_BYTE_CAST): New macro. 1657 1658 * include/freetype/freetype.h (FT_ENC_TAG): Use `FT_STATIC_BYTE_CAST`. 1659 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto. 1660 * include/freetype/fttypes.h (FT_MAKE_TAG): Ditto. 1661 Use `FT_Tag` for casting. 1662 1663 * src/ftraster/ftmisc.h (FT_MAKE_TAG): Removed, no longer needed. 1664 (FT_STATIC_BYTE_CAST): New macro. 1665 1666 * src/smooth/ftgrays.c (FT_STATIC_CAST): Replace with... 1667 (FT_STATIC_BYTE_CAST): ... this. 1668 16692021-11-18 Werner Lemberg <wl@gnu.org> 1670 1671 Provide C++ versions for public macros with casts. 1672 1673 Many FreeType clients use C++. However `g++ -Wold-style-cast` warns for 1674 macros with C-style casts even for system header files; this also affects 1675 directories included with `-isystem`. While this could be seen as a problem 1676 with g++, the problem is more a philosophical one: Over the time, C and C++ 1677 diverged more and more, and some features of C are no longer the 'right' 1678 solution in C++. 1679 1680 * include/freetype/config/public-macros.h (FT_STATIC_CAST, 1681 FT_REINTERPRET_CAST): New macros. 1682 1683 * include/freetype/freetype.h (FT_ENC_TAG, FT_LOAD_TARGET_, 1684 FT_LOAD_TARGET_MODE): Use `FT_STATIC_CAST`. 1685 Correctly handle negative 'signed char' input. 1686 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto. 1687 * include/freetype/fttypes.h (FT_MAKE_TAG, FT_BOOL): Ditto. 1688 * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): Use 1689 `FT_REINTERPRET_CAST`. 1690 1691 * src/smooth/ftgrays.c (FT_STATIC_CAST)[STANDALONE_]: New macro. 1692 [!STANDALONE]: Include `FT_CONFIG_CONFIG_H`. 1693 1694 Fixes #1116. 1695 16962021-11-16 Werner Lemberg <wl@gnu.org> 1697 1698 Fix clang++ warnings. 1699 1700 * src/*: Initialize some variables to NULL. 1701 17022021-11-16 Werner Lemberg <wl@gnu.org> 1703 1704 [truetype] Updates for the forthcoming OpenType 1.9 standard (2/2). 1705 1706 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): 1707 s/shortDeltaCount/wordDeltaCount/ (as done in the specification, too). 1708 Recognize new format and reject it for now. 1709 17102021-11-16 Werner Lemberg <wl@gnu.org> 1711 1712 [truetype] Updates for the forthcoming OpenType 1.9 standard (1/2). 1713 1714 This is in preparation for implementing `DeltaSetIndexMap` format 1, which 1715 is used by `COLR` v1 tables, and which allows 32bit indices. 1716 1717 https://docs.microsoft.com/en-us/typography/opentype/otspec190/delta/otvarcommonformats_delta.html 1718 1719 * src/truetype/ttgxvar.h (GX_DeltaSetIdxMapRec): Change type of `mapCount` 1720 to `FT_ULong`. 1721 1722 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping): Add argument 1723 for passing the table size; update caller. 1724 Implement new format. 1725 17262021-11-14 Werner Lemberg <wl@gnu.org> 1727 1728 Fix clang warnings. 1729 1730 * src/gxvalid/gxvcmmn.h (GXV_SET_ERR_IF_PARANOID): Use 'do' block. 1731 * src/gxvalid/gxvmod.c (GXV_TABLE_LOAD, GXV_TABLE_VALIDATE): Ditto. 1732 1733 * src/smooth/ftgrays.c (gray_convert_glyph): Add cast. 1734 1735 * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Remove cast. 1736 * src/type1/t1load.c (read_binay_data): Use `FT_ULong` for `size` parameter. 1737 (parse_subrs, parse_charstrings, parse_dict): Ditto; also add some casts. 1738 17392021-11-13 Dominik Röttsches <drott@chromium.org> 1740 1741 [sfnt] Avoid undefined shifts in `COLR` v1 paint parsing 1742 1743 * src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Tighten shift 1744 behavior by using multiplication, mostly using macros from ftcalc.h. 1745 1746 Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1269168 1747 17482021-11-13 Alexei Podtelezhnikov <apodtele@gmail.com> 1749 1750 [builds/windows] Improve `DlgCopy` target. 1751 1752 Fixes #1113. 1753 1754 * builds/windows/vc2010/freetype.vcxproj: Run `DlgCopy` conditionally 1755 and decouple it from `Build`. 1756 17572021-11-12 Alexei Podtelezhnikov <apodtele@gmail.com> 1758 1759 Explicitly define `FT_MSB` for Clang. 1760 1761 * include/freetype/internal/ftcalc.h [__clang__] (FT_MSB): Updated. 1762 17632021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1764 1765 * src/truetype/ttgxvar.c (ft_var_to_normalized): Edge optimization. 1766 17672021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com> 1768 1769 Additional `FT_MSB` macro definitions. 1770 1771 Better macros for Windoes CE and ARM in general, based on !109 1772 from metarutaiga. 1773 1774 * include/freetype/internal/ftcalc.h [_MSC_VER] (FT_MSB): Updated. 1775 17762021-11-09 Alexei Podtelezhnikov <apodtele@gmail.com> 1777 1778 [build/windows] Remove logging from default debug configurations. 1779 1780 DLG is rather costly for performance and should be used judiciously. 1781 This removes it from the default configurations but gives an example 1782 how to enable it using the `UserDefines` property. 1783 1784 * builds/windows/vc2010/freetype.vcxproj: Hide FT_DEBUG_LOGGING. 1785 17862021-11-08 Werner Lemberg <wl@gnu.org> 1787 1788 * src/sfnt/sfobjs.c (sfnt_open_font): Fix typo. 1789 17902021-11-08 Werner Lemberg <wl@gnu.org> 1791 1792 * src/gxvalid.*, src/otvalid.*: Fix `-Wformat` warnings. 1793 17942021-11-08 Werner Lemberg <wl@gnu.org> 1795 1796 [pshinter] Fix C++ compilation. 1797 1798 * src/pshinter/pshalgo.c (psh_compute_dir): Fix type of `result`. 1799 (psh_hint_table_find_strong_points): Add cast. 1800 18012021-11-08 Werner Lemberg <wl@gnu.org> 1802 1803 [sfnt] Reduce footprint if WOFF and WOFF2 support is not needed. 1804 1805 Based on a patch from metarutaiga (MR !106). The gist of this commit is 1806 that it doesn't make sense to support WOFF without compression (which would 1807 be only possible in WOFF 1.0 anyway). 1808 1809 * src/sfnt/sfobjs.c (sfnt_open_font): Guard WOFF code with 1810 `FT_CONFIG_OPTION_USE_ZLIB` block. 1811 Guard WOFF2 code with `FT_CONFIG_OPTION_USE_BROTLI` block. 1812 1813 * src/sfnt/sfwoff.c, src/sfnt/sfwoff.h: Guard files with 1814 `FT_CONFIG_OPTION_USE_ZLIB` blocks, not parts of the code. 1815 1816 * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h, src/sfnt/woff2tags.c, 1817 src/sfnt/woff2tags.h: Guard files with `FT_CONFIG_OPTION_USE_BROTLI` blocks, 1818 not parts of the code. 1819 1820 Fixes #1111. 1821 18222021-11-08 Werner Lemberg <wl@gnu.org> 1823 1824 [truetype] Make trickyness checks depend on TT_USE_BYTECODE_INTERPRETER. 1825 1826 Based on a patch from metarutaiga (MR !106). 1827 1828 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag, 1829 tt_check_trickyness_family, tt_synth_sfnt_checksum, tt_get_sfnt_checksum, 1830 tt_check_trickyness_sfnt_ids, tt_check_trickyness): Put functions into a 1831 `TT_USE_BYTECODE_INTERPRETER` block. 1832 (tt_face_init): Put trickyness checks into a `TT_USE_BYTECODE_INTERPRETER` 1833 block. 1834 1835 Fixes #1111. 1836 18372021-11-08 Alexei Podtelezhnikov <apodtele@gmail.com> 1838 1839 * src/sfnt/ttload.c (tt_face_load_gasp): Fix a type mismatch warning. 1840 18412021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 1842 1843 [dlg] Define DLG_STATIC explicitly. 1844 1845 DLG_STATIC is intended to disable Windows DLL linking attributes. 1846 It does not hurt to define it explicitly when we wrap DLG code. 1847 This fixes tons of LNK4286 and C4273 warnings from MSVC if we 1848 forget to define DLG_STATIC as a compiler option. 1849 1850 * builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option. 1851 * src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC. 1852 * include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto. 1853 18542021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 1855 1856 [dlg] Lighten up the inclusions. 1857 1858 The DLG wrapper needs to know if FT_DEBUG_LOGGING is defined in 1859 `ftoption.h`. It does not need entire FreeType. 1860 1861 * src/dlg/dlgwrap.c: Include FT_CONFIG_OPTIONS_H directly. 1862 18632021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com> 1864 1865 [truetype] Avoid some memory zeroing in variations. 1866 1867 * src/truetype/ttgxvar.c (ft_var_readpackeddeltas, ft_var_load_avar, 1868 ft_var_load_item_variation_store, ft_var_load_gvar): Use FT_QNEW_ARRAY 1869 if memory immediately initialized or discarded otherwise. 1870 18712021-11-05 Jany Belluz <jany.belluz@daltonmaag.com> 1872 1873 [truetype] Fix handling of packed deltas in Variation Fonts. 1874 1875 * src/truetype/ttgxvar (ft_var_readpackeddeltas): Don't expect the number of 1876 bytes used to encode the deltas to be higher than the number of encoded 1877 values. The specification allows a very compact encoding; for example, a 1878 list of 200 zeros can be encoded with just a couple of bytes. 1879 1880 We now count the consumed bytes to make sure to not read more than expected. 1881 18822021-11-04 Jany Belluz <jany.belluz@daltonmaag.com> 1883 1884 [truetype] Fix CVAR handling of tuples for all points. 1885 1886 * src/truetype/ttgxvar (tt_face_vary_cvt): Function 1887 `ft_var_readpackedpoints`, when it returns `ALL_POINTS`, also sets 1888 `point_count` to value 0. However, the CVAR code was incorrectly expecting 1889 that `point_count` would be set to match the length of the CVT table. 1890 18912021-11-04 Jany Belluz <jany.belluz@daltonmaag.com> 1892 1893 * src/truetype/ttgxvar.c: Fix typos in macros that guard CVAR code. 1894 18952021-11-04 Alexei Podtelezhnikov <apodtele@gmail.com> 1896 1897 * docs/INSTALL: Mention Meson and MSBuild more prominently. 1898 18992021-11-03 Gabor Kertesz <gabor.kertesz@linaro.org> 1900 1901 [libpng] Update Meson wrap for win-arm64 1902 1903 1.6.37-5 released patches for win-arm64 to successfully build 1904 libpng with Meson: 1905 https://github.com/mesonbuild/wrapdb/pull/205 1906 https://github.com/mesonbuild/wrapdb/pull/216 1907 1908 Updated by the following command: 1909 meson wrap update libpng 1910 1911 Tested on win-arm64 and x64. 1912 19132021-11-03 Dominik Röttsches <drott@chromium.org> 1914 1915 [sfnt] Clarify `COLR` v1 FT_Paint* format representations 1916 1917 * include/freetype/ftcolor.h (FT_PaintLinearGradient, 1918 FT_PaintRadialGradient, FT_PaintSweepGradient, FT_PaintTransform, 1919 FT_PaintTranslate, FT_PaintScale, FT_PaintRotate, FT_PaintSkew): Clarify 1920 16.16 fixed point representation of struct fields. 1921 * src/sfnt/ttcolr.c (read_paint): Shift coordinates for 1922 FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient 1923 accordingly. 1924 1925 Fixes: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1110 1926 19272021-11-03 Alexei Podtelezhnikov <apodtele@gmail.com> 1928 1929 [builds/windows] Let MSBuild handle DLG copy. 1930 1931 * builds/windows/vc2010/freetype.vcxproj: Specify DlgCopy target. 1932 * builds/windows/vc2010/script.bat: Deleted. 1933 19342021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com> 1935 1936 * src/truetype/ttgload.c (load_truetype_glyph): Fix MSVC warning C4312. 1937 19382021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com> 1939 1940 [builds/windows] Separate MSVC linker and librarian. 1941 1942 MSVC uses LIB for static and LINK for dynamic libraries. They are 1943 related but the former has much smaller set of options. 1944 1945 * builds/windows/vc2010/freetype.vcxproj: Updated. 1946 19472021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com> 1948 1949 [builds/windows] Revise MSVC linking optimizations. 1950 1951 * builds/windows/vc2010/freetype.vcxproj: Optimize DLL linking only. 1952 * builds/windows/visualc/freetype.dsp: Ditto. 1953 * builds/windows/visualc/freetype.vcproj: Ditto. 1954 19552021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com> 1956 1957 [woff] Optimize table tagging. 1958 1959 * include/freetype/internal/wofftypes.h (WOFF_TableRec): Use 1960 32-bit tag. 1961 * src/sfnt/sfwoff.c (woff_open_font): Use 32-bit tag. 1962 19632021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com> 1964 1965 [woff2] Optimize table tagging. 1966 1967 Fixes #1107. 1968 1969 * include/freetype/internal/wofftypes.h (WOFF2_TableRec): Use 1970 32-bit tag. 1971 * src/sfnt/sfwoff2.c (compare_tags, find_table, woff2_open_font): 1972 Use 32-bit tag. 1973 * src/sfnt/woff2tags.[ch] (woff2_known_tags): Use static storage and 1974 return 32-bit tag. 1975 19762021-10-26 Werner Lemberg <wl@gnu.org> 1977 1978 Formatting. 1979 19802021-10-26 Ben Wagner <bungeman@chromium.org> 1981 1982 [mm] Tolerate missing Blend dictionary entries 1983 1984 In a Multiple Master font, the Blend dictionary must contain valid 1985 Private, FontInfo, and FontBBox. The current code will error if any of 1986 these are present and invalid, but will not error and will provide 1987 uninitialized data if the Blend dictionary exists but does not contain 1988 one of these entries. This change reverts to the older behavior of 1989 treating any missing entries as containing all zero data and not 1990 returning an error. 1991 1992 In the future it may be best to keep track of when these are actually 1993 initialized and error if they are not. 1994 1995 * src/type1/t1load.c (t1_allocate_blend): Zero initiailize. 1996 19972021-10-26 Alexei Podtelezhnikov <apodtele@gmail.com> 1998 1999 [builds/windows] Add MSVC linker optimazations. 2000 2001 We continue to build static libraries with statically linked C run- 2002 time and add options to optimize references. 2003 2004 * builds/windows/vc2010/freetype.vcxproj: Sort entries, add options. 2005 20062021-10-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2007 2008 * builds/windows/vc2010/freetype.vcxproj: Use MachineARM64. 2009 20102021-10-22 Alexei Podtelezhnikov <apodtele@gmail.com> 2011 2012 [builds/windows] Prioritize x64. 2013 2014 * builds/windows/vc2010/freetype.sln: Sort entries. 2015 20162021-10-22 Gabor Kertesz <gabor.kertesz@linaro.org> 2017 2018 [builds/windows] Add ARM64 platform. 2019 2020 * builds/windows/vc2010/freetype.sln: Updated 2021 * builds/windows/vc2010/freetype.vcxproj: Updated. 2022 * builds/windows/vc2010/freetype.vcxproj.filters: Minor fix. 2023 20242021-10-21 Ben Wagner <bungeman@chromium.org> 2025 2026 [mm] Delay setting blend weight and design position. 2027 2028 Previously the `blend->weight_vector`, `blend->default_weight_vector`, 2029 and `blend->design_pos` were set early to allocated but uninitialized 2030 memory under the assumption that the memory would eventually be 2031 initialized. However, it is possible that some of the required 2032 keywords may not actually be present, leaving the memory uninitialized. 2033 This is different from a present but invalid table, which would produce 2034 an error. 2035 2036 Reported as 2037 https://bugs.chromium.org/p/chromium/issues/detail?id=1261762 2038 2039 * src/type1/t1load.c (t1_allocate_blend): Remove early allocation and 2040 initialization. 2041 (parse_blend_design_positions, parse_weight_vector): Parse into local 2042 and assign to blend if valid. 2043 (T1_Open_Face): Check that if a blend exists that it has the weight 2044 vector and design positions. 2045 20462021-10-21 Ben Wagner <bungeman@chromium.org> 2047 2048 [cff] Commit vstore data and regions on allocation. 2049 2050 The vstore->regionCount and vstore->dataCount were read directly 2051 from the data. However, vstore->varRegionList and vstore->varData 2052 would still contain uninitialized entries with uninitialized 2053 pointers in the event of an error, leading to issues when attempting 2054 to clean up. 2055 2056 Reportd as 2057 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40104 2058 2059 * src/cff/cffload.c (cff_vstore_load): Read the region and data counts 2060 into locals and update the vstore counts immediately after each entry 2061 becomes free-able. 2062 20632021-10-20 Ben Wagner <bungeman@chromium.org> 2064 2065 [sfnt] Delay setting gasp ranges and count until computed. 2066 2067 Previously, the gasp.numRanges was set and gasp.gaspRanges was 2068 allocated and assigned before a possible early exit if the frame could 2069 not be entered. It is also possible that the gaspRanges allocation 2070 could fail but the numRanges still be set to non-zero. In such cases 2071 an error would be returned, but the face would have a gasp in an 2072 inconsistent state which may still be accessed. 2073 2074 Reported as 2075 https://bugs.chromium.org/p/chromium/issues/detail?id=1261450 2076 2077 * src/sfnt/ttload.c (tt_face_load_gasp): Delay setting gasp.numRanges 2078 and gasp.gaspRanges until after the ranges are initialized. 2079 20802021-10-20 Ben Wagner <bungeman@chromium.org> 2081 2082 [sfnt] Delay setting names and langTags until computed. 2083 2084 Previously, the table->names and table->langTags fields were created 2085 pointing to uninitialized memory and an early exit could happen if the 2086 frame could not be entered. The caller would then be unable to properly 2087 dispose of the memory as the string fields had not been initialized. 2088 2089 Reported as 2090 https://bugs.chromium.org/p/chromium/issues/detail?id=1261343 2091 2092 * src/sfnt/ttload.c (tt_face_load_name): delay setting table->langTags 2093 and table->names until after the memory they will point to is fully 2094 initialized. 2095 20962021-10-20 Alexei Podtelezhnikov <apodtele@gmail.com> 2097 2098 * tests/issue-1063/main.c: s/PATH_MAX/FILENAME_MAX/. 2099 2100 Closes !97 for Windows by using a standard macro. 2101 21022021-10-19 Werner Lemberg <wl@gnu.org> 2103 2104 [bdf, cid, pfr, winfonts] Improve rejection of other font formats. 2105 2106 This is mainly for better diagnostics of malformed fonts. 2107 2108 * src/bdf/bdflib.c (_bfd_readstream): Stop font format testing if the first 2109 input line is too long or doesn't end with `\r` or `\n`. 2110 2111 * src/cid/cidparse.c (cid_parser_new): Don't handle too short input as an 2112 error but as an unknown format. 2113 2114 * src/pfr/pfrobjs.c (pfr_face_init): Ditto. 2115 2116 * src/winfonts/winfnt.c (fnt_font_load, fnt_face_get_dll_font): Ditto. 2117 21182021-10-19 Alexei Podtelezhnikov <apodtele@gmail.com> 2119 2120 [pcf] Zero out the allocated properties. 2121 2122 Fallout reported as 2123 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40033 2124 2125 * src/pcf/pcfread.c (pcf_get_properties): Use FT_NEW_ARRAY and zero 2126 out `properties` in case of failure. 2127 21282021-10-18 Werner Lemberg <wl@gnu.org> 2129 2130 configure: Use string comparison for directory inodes. 2131 2132 Inode values might be larger than integers supported by the shell. 2133 2134 Fixes #1105. 2135 21362021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2137 2138 * src/sfnt/ttload.c (tt_face_load_name): NULL-initialize langTag. 2139 2140 Another attempt to fix fallout reported as 2141 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40024 2142 21432021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2144 2145 [bdf] Fix up user properties. 2146 2147 Fallout reported as 2148 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40027 2149 2150 * src/bdf/bdflib.c (_bdf_add_property): Cosmetic NULL. 2151 (bdf_create_property): Limit allocations to customary signed 2152 FT_Long and NULL-initialize unused storage. 2153 (bdf_free_font): Do not free unused storage. 2154 21552021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2156 2157 * src/sfnt/ttload.c (tt_face_load_name): Accounting fix. 2158 2159 Fallout reported as 2160 https://crbug.com/40024 2161 21622021-10-16 Ben Wagner <bungeman@chromium.org> 2163 2164 Fix typos in memory macros. 2165 2166 FT_QNEW_ARRAY and FT_QRENEW_ARRAY were using the non-Q 2167 FT_MEM_NEW_ARRAY and FT_MEM_RENEW_ARRAY. Change these to use the Q 2168 versions. Also fix the one issue discovered in tt_face_load_name 2169 where table->names is created with FT_QNEW_ARRAY but the extra 2170 string member is not initialized to NULL. 2171 2172 * include/freetype/internal/ftmemory.h (FT_Q(RE)NEW_ARRAY): 2173 Use FT_MEM_Q(RE)NEW_ARRAY as needed. 2174 2175 * src/sfnt/ttload.c (tt_face_load_name): Initialize `entry->string`. 2176 21772021-10-15 Ben Wagner <bungeman@chromium.org> 2178 2179 [truetype] Reload context after re-executing `prep`. 2180 2181 When a different hinting mode from the current is selected, the `prep` table 2182 must be re-executed with the new mode. After this happens the context must 2183 be re-loaded in preparation for the glyph program to be run. 2184 2185 Fixes #1104. 2186 2187 * truetype/ttgload.c (tt_loader_init): Add call to `TT_Load_Context`. 2188 21892021-10-15 Werner Lemberg <wl@gnu.org> 2190 2191 [truetype] Minor documentation improvements. 2192 21932021-10-14 Anurag Thakur <anuthadev@gmail.com> 2194 2195 Add clang build to linux CI 2196 21972021-10-12 Anurag Thakur <anuthadev@gmail.com> 2198 2199 CI: Add macOS CI, including a clang build 2200 22012021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2202 2203 * src/cid/cidload.c (parse_fd_array): Protect against trancation. 2204 22052021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2206 2207 [type1] Revert to signed size for binary data. 2208 2209 Recently introduced and reported as 2210 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39838 2211 2212 * src/type1/t1load.c (read_binary_data): Reject negative size. 2213 (parse_subrs, parse_charstrings): Use customary signed size. 2214 22152021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com> 2216 2217 [psaux] Signedness revisions. 2218 2219 Unsigned indexes are easier to check. 2220 2221 * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Updated. 2222 * src/psaux/psintrp.c (cf2_interpT2CharString): Ditto. 2223 * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. 2224 * src/type1/t1load.c (read_binary_data): Ditto. 2225 22262021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com> 2227 2228 [cid] Signedness revisions. 2229 2230 Unsigned checks are simpler. 2231 2232 * include/freetype/t1tables.h (CID_FaceInfoRec): Change to unsignd 2233 `num_dicts`. 2234 * src/cid/cidparse.h (CID_Parser): Change to unsigned `num_dict`. 2235 2236 * src/cid/cidgload.c (cid_load_glyph): Updated. 2237 * src/cid/cidload.c (cid_load_keyword, parse_fd_array, 2238 parse_expansion_factor, parse_font_name, cid_read_subrs, 2239 cid_face_open): Updated. 2240 * src/cid/cidobjs.c (cid_face_done): Updated. 2241 * src/cid/cidparse.c (cid_parser_new): Updated. 2242 22432021-10-09 Alexei Podtelezhnikov <apodtele@gmail.com> 2244 2245 * src/cid/cidload.c (cid_face_open): Streamline CIDCount check. 2246 22472021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2248 2249 * src/cid/cidload.c (cid_face_open): Streamline SubrCount check. 2250 22512021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2252 2253 * src/cid/cidgload.c (cid_load_glyph): Fortify incremental loading. 2254 22552021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2256 2257 Signedness revisions. 2258 2259 This eliminates explicit casting by switching to unsigned fields. 2260 The revisions mostly impact the handling of CID fonts. 2261 2262 * include/freetype/fttypes.h (FT_Data): Change to unsigned `length`. 2263 * include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`. 2264 (CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`. 2265 * include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for 2266 `byte_len`. 2267 2268 * src/cid/cidgload.c (cid_load_glyph): Updated. 2269 * src/cid/cidload.h (cid_get_offset): Update argument. 2270 * src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open): 2271 Updated. 2272 * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): 2273 Updated. 2274 * src/psaux/psft.c (cf2_getT1SeacComponent): Updated. 2275 * src/truetype/ttgload.c (TT_Process_Composite_Glyph, 2276 load_truetype_glyph): Updated. 2277 22782021-10-07 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> 2279 2280 meson.build (gen_docs): Use `current_source_dir` instead of `source_root`. 2281 2282 These two are not equal when FreeType is used as a subproject, such as in 2283 `freetype-demos`. In that case, `source_root` points at the root project, 2284 causing the docs build to fail. 2285 22862021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 2287 2288 * src/smooth/ftgrays.c (FT_DIV_MOD): Limit the ARM workaround. 2289 22902021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 2291 2292 [builds/unix, builds/vms] Standardize `mmap` failure. 2293 2294 * builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED. 2295 * builds/vms/ftsystem.c (FT_Stream_Open): Ditto. 2296 2297 This should cover https://savannah.nongnu.org/patch/?5909 as well. 2298 22992021-10-05 Hugh McMaster <hugh.mcmaster@outlook.com> 2300 2301 autogen.sh: Only copy submodules if building from a git branch. 2302 2303 `autogen.sh` fails if building from a standard source tarball. Firstly, git 2304 expects to be called in a git repository, then `copy_submodule_files` 2305 blindly attempts to copy files. 2306 2307 Debian, Ubuntu, Linux Mint, and other derivatives all run `autogen.sh` 2308 before compiling to regenerate build files. 2309 2310 This patch ensures that various git commands are only called and 'dlg' files 2311 are only copied if `autogen.sh` is called from a git repository. 2312 23132021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 2314 2315 * include/freetype/internal/ftgloadr.h: Add missing header. 2316 2317 Noticed by Jouk Jansen. 2318 23192021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com> 2320 2321 [pshinter] Additional clean-ups. 2322 2323 * src/pshinter/pshalgo.h (psh_hint_table_find_strong_points): Streamline code. 2324 * src/pshinter/pshalgo.h (PSH_Glyph): Remove unused fields. 2325 23262021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com> 2327 2328 [pshinter] More convenient direction definition. 2329 2330 It is easier to check directions using flags than integer values. 2331 2332 * src/pshinter/pshalgo.h (PSH_Dir): Redefine directions. 2333 (PSH_PointRec): Use them as an enum type. 2334 2335 * src/pshinter/pshalgo.c (psh_compute_dir): Modify return type. 2336 (psh_glyph_init, psh_hint_table_find_strong_points, 2337 psh_glyph_find_blue_points): Update users. 2338 23392021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com> 2340 2341 [pshinter] Remove unnecessary check. 2342 2343 * src/pshinter/pshalgo.c (psh_hint_table_find_strong_points): Do not 2344 check if direction is defined before checking how. 2345 23462021-10-02 AnuthaDev <anuthadev@gmail.com> 2347 2348 CI: Hardcode meson version to fix build failure on windows 2349 23502021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com> 2351 2352 Additional `FT_MSB` macro definitions. 2353 2354 * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins 2355 and intrinsics. 2356 23572021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com> 2358 2359 * src/autofit/afhints.c (af_glyph_hints_reload): Decrease casting. 2360 23612021-09-30 Alexei Podtelezhnikov <apodtele@gmail.com> 2362 2363 * src/tools/apinames.c: Facilitate OpenVMS linker options. 2364 23652021-09-29 Alexei Podtelezhnikov <apodtele@gmail.com> 2366 2367 * src/winfonts/winfnt.c (FNT_Face_Init): Correct reallocation. 2368 23692021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 2370 2371 [builds/unix] Do not use autoconf SIZEOF. 2372 2373 * builds/unix/ftconfig.h.in [FT_USE_AUTOCONF_SIZEOF_TYPES]: Removed. 2374 * builds/unix/configure.raw: Remove AC_CHECK_SIZEOF and update. 2375 2376 After this commit, autoconf builds will fully rely on <limits.h> 2377 rather than falling back on it if AC_CHECK_SIZEOF failed for some 2378 reason. There is a risk that misconfigured cross-compilation might 2379 have wrong headers. Note that Meson and CMake builds always relied on 2380 <limits.h> for sizes and availability of integer types. 2381 23822021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 2383 2384 Propagate sign when reading OFF3. 2385 2386 Signed 24-bit values are extremely rare. FreeType only reads them in 2387 PFR fonts with bitmap strikes conditionally. They have not been seen 2388 in the known fonts. That is why this bug could never be discovered. 2389 `FT_FRAME_OFF3` propagates sign correctly. 2390 2391 * include/freetype/internal/ftstream.h (FT_PEEK_OFF3, FT_PEEK_OFF3_LE): 2392 Propagate sign into 32-bit value. 2393 (FT_GET_OFF3, FT_READ_OFF3): Needed fixing but removed as unused. 2394 23952021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com> 2396 2397 [bdf] Simplify comment collection or lack thereof. 2398 2399 BDF comments are neither actually collected nor retrieved. There is 2400 no need to be fancy with delimiters. 2401 2402 * src/bdf/bdflib.c (_add_bdf_comment): Delimit comments with zeros... 2403 (bdf_load_font): ...and do not null-terminate comments additionally. 2404 (_bdf_parse_glyphs): Check if comments are kept, which they are not. 2405 (_bdf_parse_start): Minor clean up. 2406 24072021-09-24 Alexei Podtelezhnikov <apodtele@gmail.com> 2408 2409 Use NULL for pointers only. 2410 2411 * src/bdf/bdflib.c (*): Code changes. 2412 * include/freetype/freetype.h: Comments only. 2413 * src/cff/cffload.c, src/cff/cffobjs.c: Ditto. 2414 * src/winfonts/winfnt.c: Ditto. 2415 24162021-09-23 Werner Lemberg <wl@gnu.org> 2417 2418 Minor documentation fixes and improvements. 2419 24202021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2421 2422 Reference `fopen` in the docs. 2423 24242021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2425 2426 [bdf, pcf] Minor optimization. 2427 2428 * src/pcf/pcfread.c (pcf_load_font): Do not call `FT_MulDiv` for a 2429 small job. 2430 * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto. 2431 * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a comment. 2432 24332021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com> 2434 2435 [base] Initialize stream memory earlier. 2436 2437 With Windows memory management tracking heap, it is important to use 2438 it during the stream opening fallback. In Unix, the argument is 2439 unused, but it is better to set it correctly. 2440 2441 * src/base/ftobjs.c (FT_Stream_New): Set memory before calling 2442 `FT_Stream_Open`. 2443 * builds/windows/ftsystem.c, builds/unix/ftsystem.c (FT_Stream_Open, 2444 ft_close_stream_by_free): Call `ft_alloc` and `ft_free` with proper 2445 memory argumment. 2446 24472021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com> 2448 2449 [builds/windows] Revert back to `CreateFileA` only. 2450 2451 Calling `CreateFileW` without making sure that the patname is really 2452 `wchar_t` is a bad idea and can lead to unpredictable overreads. For 2453 Windows CE, we impelemnt the missing API. 2454 2455 Fixes #1098 and !76 again. 2456 2457 * builds/windows/ftsystem.c (FT_Stream_Open): Call `CreateFileA`. 2458 [_WIN32_WCE] (CreateFileA, FileSizeEx): Implement missing interfaces. 2459 24602021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com> 2461 2462 * src/bdf/bdflib.c (_bdf_parse_{start,glyphs}): Use appropriate scanner. 2463 24642021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com> 2465 2466 Minor. 2467 24682021-09-20 Alexei Podtelezhnikov <apodtele@gmail.com> 2469 2470 * src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW. 2471 24722021-09-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2473 2474 [cache] Minor clean-ups. 2475 2476 * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Remove parantheses. 2477 * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto. 2478 (FTC_Cache_RemoveFaceID): Remove unnecessary variable. 2479 24802021-09-17 Alexei Podtelezhnikov <apodtele@gmail.com> 2481 2482 [builds/windows] Try both wide and narrow `CreateFile` 2483 2484 Windows handles wchar_t* UTF-16 and char* ANSI (presently UTF-8) 2485 filenames using alternative -A and -W API. We'll try them both 2486 when opening a file. This means that you should not worry about 2487 about conversions. 2488 2489 Fixes #1098 and !76. 2490 2491 * builds/windows/ftsystem.c (FT_Stream_Open): Call alternative 2492 `CreateFile` in the case of failure. 2493 24942021-09-17 Edwin Steiner <edwin.steiner@gmail.com> 2495 2496 [cff] Explicitly set StandardEncoding or ExpertEncoding offsets. 2497 2498 Fixes #1097. 2499 2500 * src/cff/cffload.c (cff_encoding_load): Set special offset values. 2501 25022021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com> 2503 2504 [cache] Miscellaneous clean-ups. 2505 2506 * src/cache/ftccache.c (ftc_get_top_node_for_hash, FTC_Cache_Clear): 2507 Remove barely used variables. 2508 (ftc_cache_add): Adjust casting. 2509 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Remove casting. 2510 * src/cache/ftcsbits.c (ftc_snode_load): Remove casting. 2511 25122021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com> 2513 2514 * src/cff/cffload.c (cff_fd_select_get): Remove casting. 2515 25162021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com> 2517 2518 * src/pcf/pcfread.c (pcf_read_TOC): Remove casting. 2519 25202021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2521 2522 Minor type adjustments. 2523 2524 * src/cff/cffobjs.c (cff_face_init): Reduce casting. 2525 * src/truetype/ttobjs.c (tt_size_ready_bytecode): Ditto. 2526 * src/type1/t1load.c (T1_Set_MM_Design): Ditto. 2527 25282021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2529 2530 Replace boolean allocation macros with MEM ones. 2531 2532 * src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro. 2533 * src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto. 2534 * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto. 2535 * src/cache/ftccache.c (ftc_cache_init): Ditto 2536 * src/gzip/ftgzip.c (ft_gzip_alloc): Ditto. 2537 * src/psnames/psmodule.c (ps_unicodes_init): Ditto. 2538 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. 2539 * src/sfnt/ttload.c (tt_face_load_name): Ditto. 2540 25412021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com> 2542 2543 [cache] Revert to some zeroing. 2544 2545 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Zero 2546 `buckets` again to fix some crashes. 2547 25482021-09-14 Alexei Podtelezhnikov <apodtele@gmail.com> 2549 2550 * src/pshinter/pshrec.c (ps_mask_table_merge_all): Tweak loops. 2551 2552 Fixes fallout from 731d0b685685 reported as 2553 2554 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38685 2555 25562021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2557 2558 [cff, pshinter] Clean up unsigned counters. 2559 2560 Loops with unsigned decrement can be reliably stopped when the counter 2561 wraps around after reaching zero. 2562 2563 * src/cff/cffload.c (cff_charset_compute_cids): Use unsigned counter. 2564 * src/pshinter/pshalgo.c (psh_hint_table_activate_mask): Ditto. 2565 * src/pshinter/pshrec.c (ps_mask_table_merge): Ditto. 2566 25672021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2568 2569 [bdf, psnames, sfnt] Avoid some memory zeroing. 2570 2571 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro. 2572 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. 2573 * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero. 2574 25752021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2576 2577 * src/base/ftobjs.c (FT_CMap_New): Revert to zeroing. 2578 2579 Fixes fallout from c1fa7aa2bc96, reported as 2580 2581 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38641 2582 25832021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2584 2585 [truetype] Clean up `exec` initialization. 2586 2587 * src/truetype/ttinterp.c (Init_Context): Absorbed into... 2588 (TT_New_Context): ... this function. 2589 25902021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2591 2592 [truetype] Avoid some memory zeroing. 2593 2594 * src/truetype/ttgload.c (load_truetype_glyph): Use Q-macro. 2595 * src/truetype/ttinterp.c (Update_Max): Ditto. 2596 * src/truetype/ttpload.c (src/truetype/ttpload.c): Ditto. 2597 25982021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2599 2600 [base] Avoid some memory zeroing. 2601 2602 * src/base/ftobjs.c (FT_New_Size, FT_CMap_New, FT_CMap_Done, 2603 ft_open_face_internal, ft_open_face_internal): Use Q-macros. 2604 26052021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com> 2606 2607 [cache, psaux] Remove zeros. 2608 2609 * src/cache/ftcmru.c (FTC_MruList_New): Remove initialization. 2610 * src/psaux/psstack.c (cf2_stack_init): Ditto. 2611 26122021-09-12 Alexei Podtelezhnikov <apodtele@gmail.com> 2613 2614 [cache] Avoid some memory zeroing. 2615 2616 * src/cache/ftcmru.c (FTC_MruList_New): Use Q-macro. 2617 * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Ditto. 2618 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Ditto. 2619 26202021-09-11 Alexei Podtelezhnikov <apodtele@gmail.com> 2621 2622 * src/cache/ftcmanag.c (FTC_Manager_New): Add missing zero. 2623 2624 Fixes fall out from a7b199d081e7. 2625 26262021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com> 2627 2628 [truetype] Tweak `hdmx` checking. 2629 2630 Fixes #1096. 2631 2632 * src/truetype/ttpload.c (tt_face_load_hdmx): Account for padding. 2633 26342021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com> 2635 2636 [truetype] Tweak `loca` clamping. 2637 2638 Fixes #1095. 2639 2640 * src/truetype/ttpload.c (tt_face_load_loca): Fix up clamping. 2641 * include/freetype/internal/tttypes.h (TT_Face): Correct docs. 2642 26432021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2644 2645 Fortify memory debugging (cont'd). 2646 2647 * src/base/ftdbgmem.c (FT_DumpMemory): Check for active debugger. 2648 (ft_mem_table_destroy): Move `FT_DumpMemory` call from here... 2649 (ft_mem_debug_done): ... to here. 2650 26512021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com> 2652 2653 Fortify memory debugging. 2654 2655 These changes are neccessary to properly recover `memory->user` that 2656 holds the Windows heap handle now. 2657 2658 * src/base/ftdbgmem.c (ft_mem_debug_init): Handle all table allocations, 2659 initializations, and sizing instead of... 2660 (ft_mem_table_new): ... this function removed. 2661 (ft_mem_debug_done): Better check for the active debugger and free the 2662 debugger table here instead of... 2663 (ft_mem_table_destroy): ... here. 2664 26652021-09-08 Werner Lemberg <wl@gnu.org> 2666 2667 src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): Set to 600. 2668 2669 This allows C99 compilation on Solaris. 2670 2671 Problem reported by Mojca Miklavec. 2672 26732021-09-07 Alexei Podtelezhnikov <apodtele@gmail.com> 2674 2675 [builds/windows] Use native memory allocation API. 2676 2677 * builds/windows/ftsystem.c (ft_alloc, ft_realloc, ft_free): 2678 Wrap HeapAlloc, HeapReAlloc, and HeapFree. 2679 (FT_New_Memory): Set the heap handle. 2680 26812021-09-07 Werner Lemberg <wl@gnu.org> 2682 2683 [dlg] Synchronize with upstream. 2684 2685 * src/dlg/dlgwrap.c (_XOPEN_SOURCE): Set to 600. 2686 2687 Fixes #1093. 2688 26892021-09-04 Alexei Podtelezhnikov <apodtele@gmail.com> 2690 2691 Cosmetic zeros. 2692 26932021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 2694 2695 * src/bdf/bdflib.c (_bdf_parse_start): Keep parser memory. 2696 26972021-09-03 Werner Lemberg <wl@gnu.org> 2698 2699 autogen.sh: Make it work with old Solaris 10 shell. 2700 27012021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 2702 2703 [smooth, raster, sdf] Clean up initialization calls. 2704 2705 * src/raster/ftraster.c (ft_black_init): Removed. 2706 (ft_black_new): Clean up. 2707 * src/sdf/ftbsdf.c (bsdf_raster_new): Ditto. 2708 * src/sdf/ftsdf.c (sdf_raster_new): Ditto. 2709 * src/smooth/ftgrays.c (gray_raster_new): Ditto. 2710 27112021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 2712 2713 * src/cache/ftcmanag.c (FTC_Manager_New): Avoid some zeroing. 2714 27152021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 2716 2717 * src/bdf/bdflib.c (bdf_load_font): Remove memory shuffling. 2718 27192021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com> 2720 2721 Cosmetic zeros. 2722 27232021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> 2724 2725 [base] Clean up stream reading. 2726 2727 * src/base/ftstream.c (FT_Stream_ReadUShort, FT_Stream_ReadUOffset, 2728 FT_Stream_ReadULong and their LE variants): Remove unnecessary 2729 initialization and slightly refactor. 2730 (FT_Stream_GetByte, FT_Stream_ReadByte): Rename to return unsigned 2731 value and align with sister functions. 2732 2733 * include/freetype/internal/ftstream.h (FT_Stream_GetByte, 2734 FT_Stream_ReadByte): Update prototypes and caller macros. 2735 27362021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com> 2737 2738 s/0/NULL/ where appropriate. 2739 27402021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com> 2741 2742 * builds/windows/ftsystem.c (FT_Stream_Open): Fix double-close. 2743 27442021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com> 2745 2746 [smooth] Reduce shift in multiply-shift optimization. 2747 2748 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): Reduce shift. 2749 2750 Smaller shifts that keep the division operands of FT_UDIVPREP within 2751 32 bits result in slightly faster divisions, which is noticeable in 2752 the overall performance. The loss of precision is tolerable until the 2753 divisors (the components dx and dy) approach 32 - PIXEL_BITS. With 2754 PIXEL_BITS = 8, this corresponds to 65,000 pixels or the bitmap size 2755 that we refuse to render anyway. 2756 2757 Using `ftbench -p -s60 -t5 -bc timesi.ttf`, 2758 2759 Before: 8.52 us/op 2760 After: 8.32 us/op 2761 27622021-08-28 Werner Lemberg <wl@gnu.org> 2763 2764 [truetype] Fix compilation if !TT_CONFIG_OPTION_BYTECODE_INTERPRETER. 2765 2766 * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): Compile function 2767 conditionally. 2768 (tt_face_vary_cvt) [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Add code. 2769 2770 Fixes #1091. 2771 27722021-08-27 Alexei Podtelezhnikov <apodtele@gmail.com> 2773 2774 [builds/windows] Revise SSE2 settings. 2775 2776 * builds/windows/vc2010/freetype.vcxproj [x64]: Remove explicit SSE2. 2777 * builds/windows/visualc/freetype.vcproj [Win32]: Add explicit SSE2. 2778 27792021-08-27 Ben Wagner <bungeman@chromium.org> 2780 2781 [smooth] Detect SSE2 with MSVC for x86 2782 2783 MSVC does not set `__SSE2__`. Instead one must check whether `_M_IX86_FP` is 2784 defined and greater than or equal to 2. 2785 2786 * src/smooth/ftgrays.c (FT_SSE2): New macro. 2787 Use it where appropriate. 2788 27892021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2790 2791 Expand comment (cont'd). 2792 27932021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com> 2794 2795 Expand comment. 2796 27972021-08-24 Alexei Podtelezhnikov <apodtele@gmail.com> 2798 2799 * src/smooth/ftgrays.c (gray_render_conic): Refactor redundancy. 2800 28012021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2802 2803 [truetype] Fix for the family name shorter than 8 characters. 2804 2805 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): 2806 If the family name to be checked is shorter than 8 characters, 2807 do not check its syntax. 2808 28092021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2810 2811 [truetype] Simplify `trick_names'. 2812 2813 * src/truetype/ttobjs.c (tt_check_trickyness_family): For the case 2814 that the beginning part of a long tricky family name is already 2815 registered as another tricky family name, no need to double-check 2816 the longer one. Such long tricky family names are removed from 2817 the `trick_names'. 2818 28192021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2820 2821 [truetype] Add 2 tricky font names. 2822 2823 Additional fix for the issue #1087. 2824 2825 * src/truetype/ttobjs.c (tt_check_trickyness_family): Add 2 tricky 2826 font names reported in #1087. 2827 28282021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2829 2830 [truetype] New function to skip the randomization tag. 2831 2832 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag): 2833 New function to skip the randomization tag in the names of the 2834 fonts embedded in a PDF. It is used by tt_check_trickyness_family(), 2835 to keep from mistaking "DLC" in the randomization tag as a 2836 tricky font name. See discussion in: 2837 2838 https://lists.nongnu.org/archive/html/freetype-devel/2021-02/msg00002.html 2839 2840 For technical detail about the randomization tag, please find 2841 PDF Reference 5.5.3 "Font Subsets". Thanks to Justyna Wawrzynska 2842 for pointing out the issue caused by the randomization tag. 2843 28442021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2845 2846 [truetype] Add checksums for 2 tricky fonts. 2847 2848 Thanks to Ting717 for providing sample PDF. Fixes #1087. 2849 2850 * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Add 2851 checksums for 2 tricky fonts `DFHei-Bd-WIN-HK-BF' and 2852 `DFMing-Md-WIN-HK-BF'. 2853 28542021-08-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2855 2856 Whitespace formatting. 2857 28582021-08-22 Alexei Podtelezhnikov <apodtele@gmail.com> 2859 2860 Decorate const arguments. 2861 2862 * src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it. 2863 * include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap): 2864 Do it. 2865 28662021-08-21 Alexei Podtelezhnikov <apodtele@gmail.com> 2867 2868 [smooth] Clean up the null cell usage. 2869 2870 Put the null cell at the end of the pool and store it explicitly so that 2871 we can use it as both the limit and the dumpster. 2872 2873 * src/smooth/ftgrays.c (gray_TWorker): Store the last `cell_null` and 2874 remove unnecesary fields. 2875 (NULL_CELL_PTR, CELL_IS_NULL): Remove in favor of explicit `cell_null`. 2876 (gray_dump_cells, gray_set_cell, gray_sweep{,_direct}): Update callers. 2877 (gray_convert_glyph_inner): Trace remaining cells (oh well). 2878 (gray_convert_glyph): Set up `cell_null` and slightly improve the pool 2879 management. 2880 28812021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 2882 2883 [base] Restore quiet no-op rendering of bitmap glyphs. 2884 2885 Fixes #1076. 2886 2887 * src/base/ftobjs.c (FT_Render_Glyph_Internal): Discard an error when 2888 rendering a bitmap glyph. 2889 28902021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 2891 2892 [smooth] Fortify 64-bit algorithm. 2893 2894 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): s/long/FT_Int64/ and 2895 s/unsigned long/FT_UInt64/. 2896 (gray_render_line): Adjust a critical variable type. 2897 28982021-08-20 Carlo Bramini <carlo.bramix@libero.it> 2899 2900 * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows. 2901 29022021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com> 2903 2904 Determine `long long` availability based on its size. 2905 2906 MSVC, for example, used `long long` even without full C99 support. 2907 2908 * include/freetype/config/ftstdlib.h: Check if `long long` limits are 2909 defined in <limits.h>. 2910 * include/freetype/config/integer-types.h: Check `long long` size and 2911 use it to typedef FT_Int64. 2912 29132021-08-19 Dominik Röttsches <drott@chromium.org> 2914 2915 [sfnt] Fix format expectation for `COLR` v1 ClipList 2916 2917 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Change ClipList 2918 format expectation to 1 instead of 0 to make it compliant with the 2919 latest spec. 2920 29212021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com> 2922 2923 Readily use `long long` as a 64-bit type in C99 mode. 2924 2925 * include/freetype/config/integer-types.h (FT_INT64): 2926 FT_CONFIG_OPTION_FORCE_INT64 is no longer required to use `long long`. 2927 29282021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com> 2929 2930 Use FT_INT64 instead of FT_LONG64. 2931 2932 * include/freetype/config/integer-types.h: Remove synonymous FT_LONG64. 2933 * include/freetype/internal/ftcalc.h: s/FT_LONG64/FT_INT64/. 2934 * src/base/ftcalc.c: Ditto. 2935 * src/base/fttrigon.c: Ditto. 2936 * src/smooth/ftgrays.c: Ditto. 2937 29382021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2939 2940 [builds/windows] Do not set CharacterSet for VC++. 2941 2942 * builds/windows/vc2010/freetype.vcxproj: s/Unicode/NotSet/. 2943 * builds/windows/visualc/freetype.vcproj: s/"1"/"0"/. 2944 29452021-08-18 Werner Lemberg <wl@gnu.org> 2946 2947 * src/sdf/ftsdf.c (get_control_box): Fix compiler warning. 2948 29492021-08-18 Werner Lemberg <wl@gnu.org> 2950 2951 [base] Fix ppem size overflow. 2952 2953 Fixes #1086. 2954 2955 * src/base/ftobjs.c (FT_Request_Metrics): Add return value. 2956 Check whether ppem values fit into unsigned short values. 2957 (FT_Request_Size): Updated. 2958 2959 * include/freetype/internal/ftobjs.h: Updated. 2960 2961 * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c 2962 (cid_size_request), src/truetype/ttdriver.c (tt_size_request), 2963 src/type1/t1objs.c (T1_Size_Request): Updated. 2964 29652021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2966 2967 * builds/windows/ftsystem.c (FT_Stream_Open): Cast to remove warning. 2968 29692021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com> 2970 2971 * builds/windows/ftsystem.c (FT_Stream_Open): Support UNICODE compilation. 2972 29732021-08-09 Werner Lemberg <wl@gnu.org> 2974 2975 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Minor fix. 2976 29772021-08-09 Dominik Röttsches <drott@chromium.org> 2978 2979 [sfnt] Add missing blend mode 'plus' to 'COLR' v1. 2980 2981 * include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode 2982 'plus' after it was added to the spec. 2983 29842021-08-08 Werner Lemberg <wl@gnu.org> 2985 2986 include/freetype/freetype.h (FT_Encoding): Improve documentation. 2987 2988 Based on a suggestion by Antony Lee <anntzer.lee@gmail.com>. 2989 29902021-08-07 Werner Lemberg <wl@gnu.org> 2991 2992 [smooth] Avoid integer overflow. 2993 2994 Reported as 2995 2996 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36243 2997 2998 * src/smooth/ftgrays.c(ADD_LONG, SUB_LONG, MUL_LONG, NEG_LONG) 2999 [STANDALONE_]: Removed, unused. 3000 (ADD_INT) [STANDALONE_]: New macro. 3001 (FT_INTEGRATE): Use ADD_INT. 3002 30032021-08-07 Dominik Röttsches <drott@chromium.org> 3004 3005 [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table. 3006 3007 The optional 'COLR' v1 glyph-specific clip box helps upstream graphics 3008 libraries allocate a sufficiently large bitmap for a glyph without having to 3009 traverse the glyph graph for that. See 3010 3011 https://github.com/googlefonts/colr-gradients-spec/issues/251 3012 3013 for background on the introduction of this specification change. 3014 3015 * include/freetype/ftcolor.h (FT_ClipBox): New structure. 3016 (FT_Get_Color_Glyph_ClipBox): New function declaration. 3017 3018 * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_ClipBox_Func): 3019 New function type. 3020 (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Use it. 3021 3022 * src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API 3023 with SFNT implementation. 3024 3025 * src/sfnt/sfdriver.c (sfnt_interface): Updated. 3026 * src/sfnt/ttcolr.c (Colr): New field `clip_list`. 3027 (tt_face_load_colr): Parse global clip list offset. 3028 (tt_face_get_color_glyph_clipbox): New function to find the clip box for a 3029 glyph id from the clip list array. 3030 * src/sfnt/ttcolr.h: Updated. 3031 30322021-08-06 Werner Lemberg <wl@gnu.org> 3033 3034 [smooth] Fix left shifts of negative numbers. 3035 3036 Reported as 3037 3038 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36241 3039 3040 * src/smooth/ftgrays.c (LEFT_SHIFT): New macro. 3041 (gray_render_conic) [BEZIER_USE_DDA]: Use it. 3042 30432021-08-02 Werner Lemberg <wl@gnu.org> 3044 3045 * meson.build: Fix zlib support. 3046 3047 This commit synchronizes zlib support with both autotools and cmake: If no 3048 external zlib is found (or intentionally disabled on the command line), use 3049 the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without 3050 modifying `FT_CONFIG_OPTION_USE_ZLIB`. 3051 3052 Also improve summary output. 3053 3054 Problem reported by Moazin. 3055 30562021-08-02 Anuj Verma <anujv@iitbhilai.ac.in> 3057 3058 [sdf] Fix out-of-range-access. 3059 3060 * src/sdf/ftbsdf.c (first_pass, second_pass): Fix range during forward pass. 3061 Otherwise the index goes out of range for the last column. 3062 3063 Fixes issue #1077. 3064 30652021-08-02 Anuj Verma <anujv@iitbhilai.ac.in> 3066 3067 Fix invalid memory access in `bsdf` rasterizer. 3068 3069 Do not generate SDF from bitmap if the `FT_GLYPH_OWN_BITMAP` flag is not 3070 set. In some cases the bitmap buffer is freed but still points to a valid 3071 address; to handle those cases check the flag before accessing the memory. 3072 3073 * src/sdf/ftsdfrend.c (ft_bsdf_render): Handle the above case. 3074 Also, return an error message if the bitmap's rows/pitch is invalid, 3075 otherwise `slot->buffer` might be assigned to some invalid memory location. 3076 (ft_sdf_render): Same as above. 3077 Plus, move the outline back to original state after rasterization and not if 3078 any error occurs. 3079 30802021-07-29 Heiko Becker <heirecka@exherbo.org> 3081 3082 * meson.build: Honor `--includedir` instead of hard-coding 'include'. 3083 30842021-07-29 Werner Lemberg <wl@gnu.org> 3085 3086 src/sfnt/ttcolr.c: Minor formatting. 3087 30882021-07-29 Dominik Röttsches <drott@chromium.org> 3089 3090 [sfnt] 'COLR' v1 PaintSweepGradient spec update 3091 3092 * src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other 3093 spec changes and now has the angles specified as F2DOT14, reflect 3094 that in the implementation. 3095 * include/freetype/ftcolor.h (FT_PaintSweepGradient): Update 3096 documentation. 3097 30982021-07-29 Dominik Röttsches <drott@chromium.org> 3099 3100 [sfnt] Retrieve affine matrix from offset in 'COLR' v1 parsing. 3101 3102 * src/sfnt/ttcolr.c (read_paint): Implement spec change where 3103 affine transform matrix is now referenced by offset instead of 3104 being placed inline in the PaintTransform table. 3105 31062021-07-29 Dominik Röttsches <drott@chromium.org> 3107 3108 [sfnt] 'COLR' v1 PaintSkew related spec updates 3109 3110 * src/sfnt/ttcolr.c (read_paint): Implement spec changes around 3111 PaintSkew, PaintSkewAroundCenter. Update parsing to read shorter 3112 values as changed in the spec. 3113 * include/freetype/ftcolor.h (FT_PaintSkew): Update documentation. 3114 31152021-07-29 Dominik Röttsches <drott@chromium.org> 3116 3117 [sfnt] PaintRotate/PaintRotateAroundCenter spec updates 3118 3119 * src/sfnt/ttcolr.c (read_paint): Implement spec change where 3120 PaintRotate and PaintRotateAroundCenter were split for a more 3121 compact format definition. Update parsing to read shorter values 3122 as changed in the spec. 3123 * include/freetype/ftcolor.h (FT_PaintRotate): Update documentation. 3124 31252021-07-29 Dominik Röttsches <drott@chromium.org> 3126 3127 [sfnt] 'COLR' v1 PaintTranslate and PaintScale precision 3128 3129 * src/sfnt/ttcolr.c (read_paint): Implement spec changes in 3130 PaintTranslate and PaintScale and friends. Update parsing to read 3131 new shorter values. 3132 31332021-07-29 AnuthaDev <anuthadev@gmail.com> 3134 3135 README.git: Add Code of Conduct. 3136 31372021-07-25 Werner Lemberg <wl@gnu.org> 3138 3139 ChangeLog housekeeping. 3140 3141 Archive old `ChangeLog` file. 3142 3143 We no longer write ChangeLog entries manually; instead, the file will be 3144 created from commit messages (which should be formatted in GNU's ChangeLog 3145 style) by a call to 3146 3147 gitlog-to-changelog --format='%B%n' 3148 3149 or something similar (this script is part of the 'gnulib' repository). 3150 31512021-07-24 Werner Lemberg <wl@gnu.org> 3152 3153 Fix some `cppcheck` warnings. 3154 3155 * src/bzip2/ftbzip2.c (ft_bzip2_file_skip_output), src/gzip/ftgzip.c 3156 (ft_gzip_file_skip_output): Reduce scope of `delta`. 3157 3158 * src/psaux/psintrp.c, src/psaux/psintrp.h (cf2_interpT2CharString): Add 3159 `const` to `buf` parameter. 3160 3161 * src/raster/ftraster.c (DelOld): Add `const` to `profile` parameter. 3162 (Vertical_Sweep_Span): Reduce scope of `target`. 3163 (FT_Outline_Get_CBox): Reduce scope of `xMin`, `xMax`, `yMin`, `yMax`. 3164 3165 * src/smooth/ftgrays.c (gray_render_conic): Reduce scope of `split`. 3166 (gray_sweep, gray_sweep_direct): Reduce scope of `area`. 3167 3168 * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Reduce scope of 3169 `temp`. 3170 31712021-07-24 AnuthaDev <anuthadev@gmail.com> 3172 3173 * .gitlab-ci.yml: Fixed cmake build, using correct options. 3174 31752021-07-24 AnuthaDev <anuthadev@gmail.com> 3176 3177 * CMakeLists.txt: Make `cmake` handle disabled dependencies correctly. 3178 3179 Include 'CMakeDependentOption'. 3180 3181 Replace `FT_WITH_XXX` options with `FT_DISABLE_XXX` and `FT_REQUIRE_XXX` 3182 pairs. Update option logic accordingly. 3183 3184 Fixes #1066. 3185 31862021-07-24 Ben Wagner <bungeman@chromium.org> 3187 3188 [autofit] Split `afwrtsys.h`. 3189 3190 The header file `afwrtsys.h` has two distinct functions: to include the 3191 required writing system headers and also to generate code for each writing 3192 system. At each current use site only one or the other is used, with 3193 various macro trickery selecting one or the other. Split this header into 3194 `afws-decl.h` for the required writing system declarations and `afws-iter.h` 3195 for iterating over the writing systems to generate code. 3196 3197 The motivation for this change is that the Visual C++ compiler treats the 3198 standard include guard idiom like `#pragma once` 'if no non-comment code or 3199 preprocessor directive comes before or after the standard form of the 3200 idiom'. It appears to check this after macro expansion, so if 3201 `WRITING_SYSTEM` expands to empty the bottom of `afwrtsys.h` is empty and 3202 looks like the standard include guard idiom which is treated like `#pragma 3203 once`, so subsequent inclusion of `afwrtsys.h` is elided. 3204 3205 Fixes #1075. 3206 3207 * src/autofit/afglobal.c (af_writing_system_classes), src/autofit/aftypes.h 3208 (AF_WritingSystem), src/autofit/rules.mk (AUTOF_DRV_H): Updated. 3209 3210 * src/autofit/afwrtsys.h: Split into... 3211 * src/autofit/afws-decl.h, src/autofit/afws-iter.h: New files. 3212