1 2023-08-25 Werner Lemberg <wl@gnu.org>
3 * Version 2.13.2 released.
4 ==========================
6 Tag sources with `VER-2-13-2'.
8 * docs/VERSION.TXT: Add entry for version 2.13.2.
9 * docs/CHANGES: Updated.
10 * docs/release, docs/README, builds/macs/README: Updated.
12 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
13 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
14 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
15 docs/freetype-config.1: s/2.13.1/2.13.2/, s/2131/2132/.
17 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
19 * builds/unix/configure.raw (version_info): Set to 26:1:20.
20 * CMakeLists.txt (VERSION_PATCH): Set to 2.
22 2023-08-25 Alexei Podtelezhnikov <apodtele@gmail.com>
24 * src/base/ftcalc.c (FT_MulAddFix): Simplify 32-bit rounding.
26 2023-08-25 Werner Lemberg <wl@gnu.org>
30 * src/cffload.c (cff_blend_doBlend): Fix type of `sum`.
31 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Fix type of
34 2023-08-24 Werner Lemberg <wl@gnu.org>
36 * subprojects/*.wrap: Updated.
38 2023-08-24 Hugh McMaster <hugh.mcmaster@outlook.com>
40 builds/unix/configure.raw: Use variable to specify minimum Python version.
42 2023-08-24 Alexei Podtelezhnikov <apodtele@gmail.com>
44 * builds/toplevel.mk: Simplify version extraction.
46 2023-08-22 Alexei Podtelezhnikov <apodtele@gmail.com>
48 [base] Improve the matrix degeneracy check.
52 * src/base/ftcalc.c (FT_Matrix_Check): To avoid overflow, scale by shifting.
53 * include/freetype/internal/ftcalc.h (FT_Matrix_Check): Update description.
55 2023-08-22 Werner Lemberg <wl@gnu.org>
57 builds/toplevel.mk: Don't use `\#` in functions.
59 The behaviour changed in GNU make 4.3, where `#` (without the backslash)
60 would be necessary. Using a variable instead the code works with both older
61 and newer GNU make versions.
65 2023-08-19 Hugh McMaster <hugh.mcmaster@outlook.com>
67 builds/freetype.mk: Invoke `mkdocs` as a Python module
69 FreeType's `refdoc` target currently allows users to override the
70 default Python path, which is useful for testing and development.
72 In contrast, `mkdocs` is invoked via the default Python path.
74 Invoking `mkdocs` via Python's module syntax allows for greater
75 flexibility, although there is no change for the default use case.
77 2023-08-17 Ben Wagner <bungeman@chromium.org>
79 [base] Avoid UB with memcpy
81 `FT_NEW_ARRAY(p, 0)` sets `p` to `NULL`. `FT_Stream_ReadAt` with a
82 memory based stream uses `FT_MEM_COPY` which is `memcpy` which specifies
83 that it is undefined behavior for either the `src` or `dst` to be
84 `NULL`. Instead of forcing all callers work around calling
85 `FT_Stream_Read` when `buffer == NULL && count == 0` do the check in
86 `FT_StreamRead`. This allows any call with `count == 0` to succesfully
87 read zero bytes without UB.
89 * src/base/ftstream.c (FT_Stream_ReadAt): skip `FT_MEM_COPY` when
90 `count == 0`. (FT_Stream_TryRead): ditto
94 2023-08-12 Werner Lemberg <wl@gnu.org>
96 Fix warnings in tracing messages for 32bit compilation.
98 Since we now require C99, use `%td` for `ptrdiff_t` and `%zu` for `size_t`.
100 2023-08-04 Ben Wagner <bungeman@chromium.org>
102 Avoid overflow in COLR bounds checks.
104 The values read into `base_glyphs_offset_v1` and `layer_offset_v1` may
105 be in the range 0xFFFFFFFD-0xFFFFFFFF. On systems where `unsigned long`
106 is 32 bits adding 4 to such values will wrap and pass bounds checks but
107 accessing values at such offsets will be out of bounds.
109 On the other hand `table_size` has already been tested to be at least
110 `COLRV1_HEADER_SIZE` (34) so it is safe to subtract 4 from it.
112 * src/sfnt/ttcolr.c (tt_face_load_colr): subtract 4 from `table_size`
113 instead of adding 4 to font data offsets in bounds checks
115 Fixes: https://crbug.com/1469348
117 2023-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
119 * src/base/ftobjs.c (open_face_from_buffer): Silence `maybe-uninitialized`.
121 We never call this function without a `driver_name` (#1245).
123 2023-07-29 Alexei Podtelezhnikov <apodtele@gmail.com>
125 [truetype] Reduce v40 footprint.
127 * src/truetype/ttgload.c (TT_HInt_Glyph, tt_loader_set_pp,
128 tt_loader_init): Refactor code.
130 2023-07-27 Alexei Podtelezhnikov <apodtele@gmail.com>
132 [truetype] Remove Infinality for good (remaining bits).
134 * src/truetype/ttobjs.h: Remove remaining fields.
135 * src/truetype/ttinterp.c: Do not initialize them.
136 * include/freetype/internal/tttypes.h: Remove descriptions.
138 2023-07-27 Alexei Podtelezhnikov <apodtele@gmail.com>
140 [truetype] Remove Infinality for good.
142 Remove everything `#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY`,
143 which was undefined for a while now.
145 * include/freetype/internal/tttypes.h: Ditto.
146 * src/truetype/truetype.c: Ditto.
147 * src/truetype/ttdriver.c: Ditto.
148 * src/truetype/ttgload.c: Ditto.
149 * src/truetype/ttinterp.c: Ditto.
150 * src/truetype/ttinterp.h: Ditto.
151 * src/truetype/ttobjs.c: Ditto.
152 * src/truetype/ttsubpix.[ch]: Remove files.
153 * src/truetype/rules.mk: Don't mention "ttsubpix.c".
155 2023-07-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
157 * vms_make.com: Provide separate library compiled with C++.
159 Some types on OpenVMS x86_64 (for example, `long') have different sizes
160 depending on whether compiled with either C or C++. In particular,
161 X-Windows applications crash if linked with the C++ version.
163 This patch makes `vms_make.com` create a second version of the FreeType
164 library compiled with C++ if OpenVMS is running on the x86_64 platform.
166 2023-07-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
168 * vms_make.com: Fix typos.
170 2023-07-21 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
172 * src/smooth/ftgrays.c (FT_SSE2): Fix definition for VMS.
174 2023-07-19 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
176 vms_make.com: Make use of additional libraries optional.
178 Check whether `.olb` files are present.
180 Also check for the HarfBuzz library.
182 2023-07-19 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
184 vms_make.com: Add `/warn=noinfo` to `CFLAGS`.
186 This reduces enormously the informationals while compiling on x86_64 (i.e.,
187 which `.h` file is inluded form where).
189 2023-07-18 Ben Wagner <bungeman@chromium.org>
191 [woff2] Clean up on large brotli expansion
193 * src/sfnt/sfwoff2.c (woff2_open_font): set error and goto cleanup
195 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60711
197 2023-07-16 Werner Lemberg <wl@gnu.org>
199 [woff2] Avoid allocation bomb.
201 This is a fix for commit 85167dbd5, reported as
203 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60615
205 * src/sfnt/sfwoff2.c (MAX_SFNT_SIZE): New macro.
206 (woff2_open_font): Use it to limit the maximum size of an uncompressed WOFF2
209 2023-07-14 Werner Lemberg <wl@gnu.org>
211 [cff] Fix compiler warning.
213 * src/cff/cffparse.c, src/cff/cffparse.h: Make `cff_parse_fixed` a local
216 2023-07-14 Ben Wagner <bungeman@chromium.org>
218 [woff2] Remove sfnt size guess check
220 In WOFF the `totalSfntSize` must be correct, however in WOFF2 this value
221 is now just a hint and a conforming implementation must not reject
222 otherwise valid data if the `totalSfntSize` turns out not to be exact.
224 * src/sfnt/sfwoff2.c (woff2_open_font): remove check that uncompressed
225 woff2 data would fit in the sfnt size guess.
229 2023-07-14 Skef Iterum <github@skef.org>
231 [cff] Make blend operator work with floats in private dicts.
233 The CFF2 blend operator takes N default values and corresponding
234 sets of deltas and pushes N values specific to a designspace
235 location. CFF has a floating point numeric type and the FreeType
236 blending code was not converting those into its internal 16.16
241 * src/cff/cffparse.c (do_fixed): Handle floating point numbers.
242 Also fix scaling overflow check for integer-to-fixed conversion.
244 * src/cff/cffload.c (cff_blend_doBlend): Updated.
246 2023-07-08 Hin-Tak Leung <htl10@users.sourceforge.net>
248 * src/truetype/ttgload.c (TT_Hint_Glyph): More mostly cosmetic update.
250 This is a follow-up to commit 49c74ac02, which creates a new local variable
251 "exec = loader->exec", and shortening a lot of "loader->exec". This commit
252 does two more such changes missed in that first commit.
254 2023-07-06 Hugh McMaster <hugh.mcmaster@outlook.com>
256 [gzip] Don't compile internal zlib development files when using system zlib.
258 `src/gzip/rules.mk` compiles the internal zlib sources even when using the
259 zlib development files provided by a host system. If the internal zlib
260 development files are not present, FreeType fails to build from source.
262 This patch ensures the internal zlib development files are only
263 prerequisites when not using zlib development files on a host system.
265 * src/gzip/rules.mk (GZIP_DRV_SRCS): Define conditionally.
267 2023-06-24 Werner Lemberg <wl@gnu.org>
269 * Version 2.13.1 released.
270 ==========================
272 Tag sources with `VER-2-13-1'.
274 * docs/VERSION.TXT: Add entry for version 2.13.1.
275 * docs/CHANGES: Updated.
276 * docs/release, docs/README, builds/macs/README: Updated.
278 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
279 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
280 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
281 docs/freetype-config.1: s/2.13.0/2.13/1/, s/2130/2131/.
283 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
285 * builds/unix/configure.raw (version_info): Set to 26:0:20.
286 * CMakeLists.txt (VERSION_PATCH): Set to 1.
288 * subprojects/libpng.wrap, subprojects/zlib.wrap, subprojects/dlg: Updated.
290 2023-06-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
294 2023-06-09 Werner Lemberg <wl@gnu.org>
296 [sdf] Correct handling of empty glyphs.
298 This is a refinement of commit 7b3ebb9.
300 * src/sdf/ftsdfrend.c (ft_sdf_render): Goto 'Exit' instead of directly
302 (fd_bsdf_render): Ditto, also taking care of setting `FT_GLYPH_OWN_BITMAP`
305 2023-06-05 Ben Wagner <bungeman@chromium.org>
307 Mark FT_Renderer_Class::raster_class as pointer to const
309 The `FT_DEFINE_RASTER_FUNCS` macro declares a `const FT_Raster_Funcs`.
310 The address of the definition is taken and assigned to
311 `FT_Renderer_Class::raster_class` which is currently `FT_Raster_Funcs*`.
312 Until recently the `const` was cast away and with the removal of the
313 cast there are now warnings about dropping this `const`. Instead of
314 adding back the casts, make `FT_Renderer_Class::raster_class` a pointer
315 to const, as is done with pointers in other interfaces.
317 * include/freetype/ftrender.h (FT_Renderer_Class_): mark `raster_class`
320 2023-06-03 Ben Wagner <bungeman@chromium.org>
322 Fix some `FT_Fixed` vs. `FT_Long` confusion.
324 `FT_Fixed` and `FT_Long` are both typedef'ed to be `signed long`. However,
325 `FT_Fixed` implies that the lower 16 bits are being used to express
326 fractional values and so these two types should not be confused.
328 * include/freetype/internal/services/svmm.h (FT_Set_MM_Blend_Func): Use
329 `FT_Fixed` for `coords`. Users are passing `FT_Fixed` and implementations
330 are taking `FT_Fixed`.
331 (FT_Get_MM_Blend_Func): Ditto.
333 * src/autofit/afcjk.c (af_cjk_metrics_check_digits): Use `FT_Long` for
334 `advance` and `old_advance`. `advance`'s address is passed as `FT_Long*` to
335 `af_shaper_get_elem`, which writes the advance in em units (not fixed). The
336 exact value is not important here as it is only compared to check whether it
339 * src/autofit/aflatin.c (af_latin_metrics_check_digits): Ditto.
341 2023-06-03 Ben Wagner <bungeman@chromium.org>
343 */*: Remove many function pointer casts.
345 In C it is undefined behavior to call a function through a function pointer
346 of a different type. This is now detected by the Control Flow Integrity
347 Sanitizer. All known issues have already been fixed. Prevent any
348 accidental re-introduction by removing function pointer casts when defining
349 services. The services will call the service functions through the function
350 pointers on the service. As a result the functions must have the same type
351 so there should be no need to cast. Removing the casts allows compilers to
352 warn about assignment to an incompatible function pointer type.
354 2023-06-03 Werner Lemberg <wl@gnu.org>
358 2023-05-23 Werner Lemberg <wl@gnu.org>
360 Replace `sprintf` with `snprintf`.
364 * include/freetype/config/ftstdlib.h (ft_sprintf): Replace with...
365 (ft_snprintf): This new macro.
367 * src/autofit/afhints.c (af_print_idx): Add argument to pass the buffer
369 (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
370 af_glyph_hints_dump_edges): Updated.
372 * src/bdf/bdflib.c (BUFSIZE): New macro.
373 (bdf_parse_properties_, bdf_parse_start_): Use `ft_snprintf`.
375 * src/tools/ftrandom/ftrandom.c (do_test): Use `snprintf`.
377 2023-05-23 Werner Lemberg <wl@gnu.org>
379 docs/DEBUG: Formatting.
381 2023-05-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
383 [doc] Type1 GX (sfnt-wrapped Type1) is not supported.
385 * docs/formats.txt: Clarify the reference of Type1 GX,
386 and state that this format is not supported. This
387 is because the content `TYP1' table is not exactly same
388 with the Type1 font format specification; no eexec
389 encryption is used. For detail and concrete examples,
392 https://gitlab.freedesktop.org/freetype/freetype/-/issues/1231
394 2023-05-19 Craig White <gerzytet@gmail.com>
396 Add missing end quote of a string in the example code of FT_Trace_Set_Level
398 2023-05-19 Seigo Nonaka <nona@google.com>
400 [truetype] Reduce heap allocation of `deltaSet` variation data.
402 `deltaSet` is an array of packed integers that can be 32 bits, 16 bits, or
403 8 bits. Before this change, these values were unpacked to 32-bit integers.
404 However, this can cause big heap allocations, e.g., around 500 KByte for
405 'NotoSansCJK'. To reduce this amount, store the packed integers and unpack
406 them just before passing to the calculation. At calculation time, due to
407 the variable length of region indices, temporary heap allocations are
408 necessary. This heap allocation is not negligible and visible in `ftbench`
409 results. So, use stack-allocated arrays for short array calculations.
413 * include/freetype/internal/ftmmtypes.h (GX_ItemVarDataRec): New fields
414 `wordDeltaCount` and `longWords`.
416 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Load packed
418 (tt_var_get_item_delta): Unpack data before applying.
420 2023-05-17 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
422 vms_make.com: Create shared executable for x86 version of OpenVMS.
424 2023-05-15 Werner Lemberg <wl@gnu.org>
426 Add new load flag `FT_LOAD_NO_SVG`.
428 Modern color fonts often contain both an 'SVG' and 'COLR' table. FreeType
429 always preferred 'SVG' over 'COLR' (this was a design decision), however,
430 this might not be the right choice for the user. The new flags makes
431 FreeType ignore the 'SVG' table while loading a glyph.
435 * include/freetype/freetype.h (FT_LOAD_NO_SVG): New macro.
437 * src/base/ftobjs.c (FT_Load_Glyph), src/cff/cffgload.c (cff_slot_load),
438 src/truetype/ttgload.c (TT_Load_Glyph): Use it.
440 2023-05-13 Werner Lemberg <wl@gnu.org>
444 2023-05-13 Alexei Podtelezhnikov <apodtele@gmail.com>
446 [cache] Merge functions.
448 * src/cache/ftccache.c (FTC_Cache_Init): Merge into...
449 (ftc_cache_done): ... this function, with unnecessary checks removed.
451 2023-05-13 Alexei Podtelezhnikov <apodtele@gmail.com>
453 [cache] Minor casting and cosmetic updates.
455 * src/cache/ftcglyph.c (ftc_gcache_{init,done}): Remove casting.
456 (FTC_GCache_Lookup): Cosmetic variable renaming.
457 * src/cache/ftcsbits.c (ftc_snode_compare): Formatting.
459 2023-05-12 Werner Lemberg <wl@gnu.org>
461 * include/freetype/ftcache.h: Typo, punctuation.
463 2023-05-12 Alexei Podtelezhnikov <apodtele@gmail.com>
465 * include/freetype/ftcache.h: Formatted and updated.
467 2023-05-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
469 * include/freetype/internal/t1types.h: Fix the indentation.
471 2023-05-11 Alexei Podtelezhnikov <apodtele@gmail.com>
473 [cache] Revise the dynamic hash table accounting.
475 Instead of counting entries relative to the middle of the hash table,
476 this switches to the absolute counter with the full index range mask.
477 As a result, some calculations become a bit simpler. The cache resizing
478 logic stays largely the same.
480 * src/cache/ftccache.h (FTC_NODE_TOP_FOR_HASH): Revised with new counter.
481 * src/cache/ftccache.c (ftc_get_top_node_for_hash): Ditto.
482 (ftc_cache_resize): Simplify reallocations and stop their zeroing.
483 (ftc_cache_init): Stop over-allocating but keep zeroing initially.
484 (FTC_Cache_Clear, FTC_Cache_RemoveFaceID): Updated accordingly.
486 2023-05-11 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
488 [t1cid] Set FT_FACE_FLAG_CID_KEYED.
490 * cidobjs.c (cid_face_init): Set FT_FACE_FLAG_CID_KEYED.
492 * cidriver.c (cid_get_is_cid): Comment about the case that
493 is_cid cannot guarantee the glyph collection specification.
495 2023-05-09 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
497 * src/smooth/ftgrays.c (FT_SSE2): Don't define for VMS.
499 2023-05-08 Werner Lemberg <wl@gnu.org>
501 * src/cff/cffdrivr.c (cff_glyph_load): Fix guard for `size`.
503 This was forgotten to change in commit 2b54eba36b (in May 2004).
507 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58739
509 2023-05-08 Werner Lemberg <wl@gnu.org>
511 Minor compiler warning fixes.
513 * src/autofit/afcjk.c (af_cjk_get_standard_widths), src/autofit/aflatin.c
514 (af_latin_get_standard_widths): Use `FT_CALLBACK_DEF`.
516 * src/cff/cffparse.c (cff_parser_run): Initialize and fix allocation of `q`.
518 2023-05-08 Werner Lemberg <wl@gnu.org>
520 * src/psaux/t1cmap.c: Signature fixes.
522 2023-05-08 Werner Lemberg <wl@gnu.org>
524 * src/bzip2/ftbzip2.c: Signature fixes.
526 2023-05-08 Werner Lemberg <wl@gnu.org>
528 [cache] Signature fixes.
530 * src/cache/ftcglyph.c, src/cache/ftcglyph.h (FTC_GNode_Compare): Remove
531 redundant function. It is equivalent to `ftc_gnode_compare` and becomes
532 completely meaningless with fixed signatures.
535 * src/cache/ftcsbits.c, src/cache/ftcsbits.h (FTC_SNode_Compare): Remove
536 redundant function. It is equivalent to `ftc_snode_compare` and becomes
537 completely meaningless with fixed signatures.
540 2023-05-07 Werner Lemberg <wl@gnu.org>
542 [sdf] Signature fixes.
544 2023-05-07 Werner Lemberg <wl@gnu.org>
546 * src/svg/ftsvg.c: Signature fixes.
548 2023-05-07 Werner Lemberg <wl@gnu.org>
550 [raster] Signature fixes.
552 2023-05-07 Werner Lemberg <wl@gnu.org>
554 [smooth] Signature fixes.
556 2023-05-07 Werner Lemberg <wl@gnu.org>
558 [pshinter] Signature fixes.
560 * src/pshinter/pshrec.c (t1_hints_close, t1_hints_apply): New wrapper
562 (t1_hints_funcs_init): Use them.
563 (t2_hints_close, t2_hints_apply): New wrapper functions.
564 (t2_hints_funcs_init): Use them.
566 2023-05-07 Werner Lemberg <wl@gnu.org>
568 [autofit] Signature fixes.
570 2023-05-07 Werner Lemberg <wl@gnu.org>
572 * src/sfnt/ttcmap: Signature fixes.
574 2023-05-07 Werner Lemberg <wl@gnu.org>
576 * src/pcf/pcfdrivr.c: Signature fix.
578 2023-05-07 Werner Lemberg <wl@gnu.org>
580 * src/winfonts/winfnt.c: Signature fixes.
582 2023-05-07 Werner Lemberg <wl@gnu.org>
584 * src/type42/t42parse.c: Signature fixes.
586 2023-05-07 Werner Lemberg <wl@gnu.org>
588 [pfr] Signature fixes.
590 2023-05-07 Werner Lemberg <wl@gnu.org>
592 * src/cid/cidload.c: Signature fixes.
594 2023-05-07 Werner Lemberg <wl@gnu.org>
596 * src/cff/cffcmap.c: Signature fixes.
598 2023-05-07 Werner Lemberg <wl@gnu.org>
600 * src/type1/t1load.c: Signature fixes.
602 2023-05-07 Werner Lemberg <wl@gnu.org>
604 [truetype] Signature fixes.
606 2023-05-07 Werner Lemberg <wl@gnu.org>
608 [base] Signature fixes.
610 2023-05-07 Werner Lemberg <wl@gnu.org>
612 * src/type42/t42drivr.c: Clean up interface.
614 Ensure that all driver functions use the signature of the service or driver.
615 This avoids pointer mismatches, which are technically undefined behaviour.
616 Recent compilers are more picky in catching them as part of Control Flow
619 2023-05-07 Werner Lemberg <wl@gnu.org>
621 * src/type1/*: Clean up interface.
623 Ensure that all driver functions use the signature of the service or driver.
624 This avoids pointer mismatches, which are technically undefined behaviour.
625 Recent compilers are more picky in catching them as part of Control Flow
628 2023-05-07 Werner Lemberg <wl@gnu.org>
630 * src/truetype/*: Clean up interface.
632 Ensure that all driver functions use the signature of the service or driver.
633 This avoids pointer mismatches, which are technically undefined behaviour.
634 Recent compilers are more picky in catching them as part of Control Flow
637 2023-05-07 Werner Lemberg <wl@gnu.org>
639 * src/sfnt/sfdriver.c, src/sfnt/ttbdf.c: Clean up interface.
641 Ensure that all driver functions use the signature of the service or driver.
642 This avoids pointer mismatches, which are technically undefined behaviour.
643 Recent compilers are more picky in catching them as part of Control Flow
646 * src/sfnt/sfdriver.c (sfnt_load_table): New wrapper function.
647 (sfnt_service_sfnt_table): Use it.
649 2023-05-07 Werner Lemberg <wl@gnu.org>
651 * src/psnames/psmodule.c: Use `FT_CALLBACK_DEF`.
653 2023-05-07 Werner Lemberg <wl@gnu.org>
655 * src/pfr/pfrdrivr.c: face -> pfrface, pfrface -> face.
657 2023-05-07 Werner Lemberg <wl@gnu.org>
659 * src/pcf/pcfdrivr.c: Clean up interface.
661 Ensure that all driver functions use the signature of the service or driver.
662 This avoids pointer mismatches, which are technically undefined behaviour.
663 Recent compilers are more picky in catching them as part of Control Flow
666 2023-05-07 Werner Lemberg <wl@gnu.org>
668 * src/cid/cidriver.c: Clean up interface.
670 Ensure that all driver functions use the signature of the service or driver.
671 This avoids pointer mismatches, which are technically undefined behaviour.
672 Recent compilers are more picky in catching them as part of Control Flow
675 2023-05-07 Werner Lemberg <wl@gnu.org>
677 * src/bdf/bdfdrivr.c: Clean up interface.
679 Ensure that all driver functions use the signature of the service or driver.
680 This avoids pointer mismatches, which are technically undefined behaviour.
681 Recent compilers are more picky in catching them as part of Control Flow
684 2023-05-07 Werner Lemberg <wl@gnu.org>
686 * src/cff/*: Clean up interface.
688 Ensure that all driver functions use the signature of the service or driver.
689 This avoids pointer mismatches, which are technically undefined behaviour.
690 Recent compilers are more picky in catching them as part of Control Flow
693 2023-05-06 Werner Lemberg <wl@gnu.org>
695 [truetype] Fix style name handling for variation fonts.
697 * include/freetype/internal/tttypes.h (TT_FaceRec): New field
698 `non_var_style_name`.
700 * src/sfnt/sfobjs.c (sfnt_load_face): Initialize `non_var_style_name`.
701 (sfnt_done_face): Free `non_var_style_name`.
703 * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Restore non-VF style name
704 if switching back to non-VF mode.
706 2023-05-06 Werner Lemberg <wl@gnu.org>
708 [truetype] Fix PostScript name handling for variation fonts.
710 A variation font's PostScript name of a named instance is usually different
711 from the PostScript name of an unnamed instance. However, if a change
712 between a named instance and an unnamed instance with exactly the same
713 design axis values happened, it was possible that the PostScript name wasn't
716 This commit reorganizes the code to handle this issue within the top-level
717 API functions, using a new service to trigger recomputation of the
720 * include/freetype/internal/services/svmm.h (FT_Construct_PS_Name_Func): New
722 (FT_Service_MultiMasters): New field `construct_ps_name`.
723 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
725 * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
726 FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Call
727 `mm->construct_ps_name` to handle `postscript_name`.
728 (FT_Set_Named_Instance): Call `mm->construct_ps_name` to handle
731 * src/cff/cffdrivr.c (cff_construct_ps_name): New function.
732 (cff_service_multi_masters): Updated.
734 * src/truetype/ttgxvar.c (tt_set_mm_blend): Don't handle `postscript_name`.
735 (TT_Set_MM_Blend): Simplify.
736 (TT_Set_Named_Instance): Return -1 if axis values haven't changed.
737 Don't set `face_index`.
738 (tt_construct_ps_name): New function.
740 * src/truetype/ttgxvar.h: Updated.
742 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
744 * src/type1/t1driver.c (t1_service_multi_masters): Updated.
746 * src/type1/t1load.c (T1_Set_MM_Blend): Simplify.
748 2023-05-06 Werner Lemberg <wl@gnu.org>
750 * include/freetype/internal/services/svmm.h: Minor changes.
752 2023-05-06 Werner Lemberg <wl@gnu.org>
754 [truetype] Fix deactivation of variation font handling.
756 According to the documentation, the functions `FT_Set_Named_Instance`,
757 `FT_Set_MM_Design_Coordinates`, `FT_Set_Var_Design_Coordinates`, and
758 `FT_Set_Var_Blend_Coordinates` can unset the `FT_FACE_FLAG_VARIATION` flag.
759 (The same is true for `FT_Set_MM_WeightVector` but this information was
760 accidentally omitted from the documentation.)
762 However, if a call of these functions didn't change the axis values this
763 could fail because internal shortcuts exited too early.
765 This commit reorganizes the code to handle `FT_FACE_FLAG_VARIATION` in the
766 top-level API functions, also taking care of the issue at hand.
768 * src/base/ftmm.c (FT_Set_MM_Design_Coordinates, FT_Set_MM_WeightVector,
769 FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
770 FT_Set_Var_Blend_Coordinates): Handle `FT_FACE_FLAG_VARIATION`.
772 * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design,
773 TT_Set_Named_Instance) Don't handle `FT_FACE_FLAG_VARIATION`.
775 * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_WeightVector,
776 T1_Set_MM_Design): Ditto.
778 * src/cff/cffobjs.c (cff_face_init): Use `FT_Set_Named_Instance` instead of
781 * src/truetype/ttobjs.c (tt_face_init): Ditto.
783 2023-05-06 Werner Lemberg <wl@gnu.org>
785 s/set_instance/set_named_instance/
787 * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func): Renamed
789 (FT_Set_Named_Instance_Func): ...this.
790 (FT_Service_MultiMasters): Rename `set_instance` to `set_named_instance`.
791 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
793 * src/base/ftmm.c (FT_Set_Named_Instance): Updated.
795 * src/cff/cffdrivr.c (cff_set_instance): Renamed to...
796 (cff_set_named_instance): ...this.
797 (cff_service_multi_masters): Updated.
798 * src/cff/cffobjs.c (cff_face_init): Updated.
800 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
802 * src/type1/t1driver.c (t1_service_multi_masters): Updated.
804 2023-05-06 Werner Lemberg <wl@gnu.org>
806 New Variation Font function `FT_Get_Default_Named_Instance`.
808 * include/freetype/ftmm.h, src/base/ftmm.c (FT_Get_Default_Named_Instance):
811 * include/freetype/internal/services/svmm.h
812 (FT_Get_Default_Named_Instance_Func): New typedef.
813 (FT_Service_MultiMasters): New field `get_default_named_instance`.
814 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
816 * include/freetype/internal/tttypes.h (TT_Face): New field
817 `var_default_named_instance`.
819 * src/sfnt/sfobjc.s (sfnt_init_face): Initialize
820 `var_default_named_instance`.
822 * src/cff/cffdrivr.c (cff_get_default_named_instance): New function.
823 (cff_service_multi_masters): Updated.
825 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize
826 `var_default_named_instance`.
827 (TT_Get_Default_Named_Instance): New function.
828 * src/truetype/ttgxvar.h: Updated.
829 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
831 * src/type1/t1driver.c (t1_service_multi_masters): Updated.
833 * docs/CHANGES: Updated.
835 2023-05-06 Werner Lemberg <wl@gnu.org>
837 [cid] Improve tracing messages; formatting.
839 2023-05-04 Alexei Podtelezhnikov <apodtele@gmail.com>
841 * src/cache/ftccache.c (ftc_node_hash_unlink): Minor.
843 2023-05-04 Alexei Podtelezhnikov <apodtele@gmail.com>
845 * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Purge backwards.
847 2023-05-04 Alexei Podtelezhnikov <apodtele@gmail.com>
849 [cache] Revise list cleansing.
851 * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Use one loop to
853 * src/cache/ftcmanag.c (FTC_Manager_Compress, FTC_Manager_FlushN):
856 2023-05-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
858 [t1cid] Improve cid_get_cid_from_glyph_index().
860 Update cid_get_cid_from_glyph_index() to
861 return an error and CID=0 in the case that
862 the specified glyph index points to an invalid
865 cidgload.h (cid_compute_fd_and_offsets):
866 Declare new helper function to set the
867 fd_select and 2 offsets to access the glyph
870 cidgload.c (cid_compute_fd_and_offsets):
871 Move the part loading fd_select and 2 offsets
872 from cid_load_glyph() to here. If the loaded
873 parameters are broken, return the Invalid_Offset
874 error. This function does not load the glyph
875 data, only fills these parameters.
877 (cid_load_glyph): Use new helper function in above.
879 cidriver.c (cid_get_cid_from_glyph_index):
880 Check whether the requested glyph index points
881 to a valid entry, by calling cid_compute_fd_and_offsets().
882 If it is valid, fill the cid by the glyph
883 index (=CID). If it is invalid, return an
884 error and fill the cid by 0.
886 2023-04-30 Werner Lemberg <wl@gnu.org>
888 API documentation: Re-organize chapters and sections
890 * Split the very long 'Base Interface' section into smaller sections.
891 * Split the 'Core API' chapter into two chapters.
892 * Remove single enumeration values from `@order` fields since they have no
895 2023-04-29 Alexei Podtelezhnikov <apodtele@gmail.com>
897 * src/sfnt/pngshim.c (Load_SBit_Png): Remove FALL_THROUGH warning.
899 2023-04-28 Werner Lemberg <wl@gnu.org>
901 * src/sfnt/ttload.c (tt_face_load_font_dir): Add another guard.
903 Reject 'OTTO' fonts with no valid tables.
905 2023-04-28 Werner Lemberg <wl@gnu.org>
907 * src/cff/cffdrivr/c (cff_get_ps_name): Avoid unnecessary crash.
909 The situation can happen if `FT_New_Face` (or one of its siblings) is called
910 with a negative index to get the number of contained faces, followed
911 immediately by a call to `FT_Get_Postscript_Name`. While this is not a valid
912 use of the FreeType library there is no need for a crash.
916 2023-04-28 Werner Lemberg <wl@gnu.org>
918 * src/cff/cffdrivr.c (cff_ps_get_font_info): Reject 'CFF2' format.
920 2023-04-28 Werner Lemberg <wl@gnu.org>
922 * src/cid/cidgload.c (cid_load_glyph): Fix compiler warnings.
924 2023-04-28 Werner Lemberg <wl@gnu.org>
926 Minor documentation updates.
928 2023-04-27 Werner Lemberg <wl@gnu.org>
930 * src/ttgxvar.c: Minor changes.
932 (TT_Get_MM_Var): Improve tracing messages.
933 (tt_set_mm_blend): Minor speed-up.
935 2023-04-27 Werner Lemberg <wl@gnu.org>
939 2023-04-27 Alexei Podtelezhnikov <apodtele@gmail.com>
941 [bdf] Clean up the atom property parsing.
943 * src/bdflib.c (bdf_is_atom_): Refactor code with fewer checks.
944 (bdf_list_join_): Return NULL.
945 (bdf_add_comment_): Use const argument.
946 (bdf_get_property): Ditto, ditto, make the function static.
947 * src/bdf.h (bdf_get_property): Remove prototype.
949 2023-04-25 Werner Lemberg <wl@gnu.org>
951 Improve/add source comments and documentation.
953 2023-04-25 Werner Lemberg <wl@gnu.org>
955 [sfnt] Fix handling of PS names for Variation Fonts.
957 * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Continue
958 construction of string if an invalid character is encountered.
962 2023-04-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
964 [t1cid] Change the trace messages of the charstrings retrieval errors.
966 The t1cid driver catches 3 types of errors in
967 the charstrings retrieval;
968 A) The invalid FD number, there are 2 subtypes;
969 A-1) FD number is the maximum number fitting to FDBytes.
970 A-2) FD number is greater than num_dicts.
971 B) Declared length is overrunning.
972 C) Declared length is invalid (its end is before its head).
974 Considering that some widely distributed fonts
975 (e.g., "CJKV" book by O'Reilly) have A-1 errors
976 in the unimplemented glyphs, the trace level for
977 A-1 is calmed to level 1.
979 The errors A-2, B, and C would be irregular;
980 their trace levels are kept at level 0, but
981 the updated trace messages include the CID number.
983 2023-04-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
985 [truetype] Fix `make multi'.
987 * src/truetype/ttgxvar.c: Include freetype/internal/services/svmetric.h
988 for the FT_Service_MetricsVariations type definition.
990 2023-04-19 Ben Wagner <bungeman@chromium.org>
992 [services] FT_Size_Reset_Func to return FT_Error
994 The `MetricsVariations` `FT_Size_Reset_Func` is currently defined to
995 return `void`, but the implementations return `FT_Error`. Even though
996 the pointers passed will be the same at runtime, calling a function
997 through a pointer of a different type from the original function pointer
998 type is undefined behavior. This may be caught at runtime by Control
999 Flow Integrity with something like clang's `cfi-icall`.
1001 Issue: https://crbug.com/1433651
1003 * include/freetype/internal/services/svmetric.h (FT_Size_Reset_Func):
1004 return `FT_Error` instead of `void`.
1006 2023-04-17 Ben Wagner <bungeman@chromum.org>
1008 [truetype] tt_size_reset_height to take FT_Size
1010 The `MetricsVariations` `FT_Size_Reset_Func` is defined to take an
1011 `FT_Size`. Because `tt_size_reset_height` is to be used as such a
1012 function, it must also take an `FT_Size` instead of a `TT_Size`. Even
1013 though the pointers passed will be the same at runtime, calling a
1014 function through a pointer of a different type from the original
1015 function pointer type is undefined behavior. This may be caught at
1016 runtime by Control Flow Integrity with something like clang's
1019 Issue: https://crbug.com/1433651
1021 * src/truetype/ttobjs.h (tt_size_reset_height): take `FT_Size`
1023 * src/truetype/ttobjs.c (tt_size_reset_height): take `FT_Size` and
1024 update documentation
1026 2023-04-13 Werner Lemberg <wl@gnu.org>
1028 * src/truetype/ttinterp.c: Remove outdated comments.
1030 2023-04-11 Ben Wagner <bungeman@chromium.org>
1032 [sfnt, truetype] Add `size_reset` to `MetricsVariations`.
1034 This is a generalization of commit
1037 commit e6699596af5c5d6f0ae0ea06e19df87dce088df8
1038 Author: Werner Lemberg <wl@gnu.org>
1039 Date: Thu Feb 2 11:38:04 2017 +0100
1041 [truetype] Fix MVAR post-action handling.
1044 It is also possible for plain `CFF ` style fonts to contain an `fvar` and
1045 `MVAR` table and use `cff_metrics_adjust`. `tt_size_reset` should only be
1046 called with `TT_Size` and never with `CFF_Size`.
1048 Allow the "metrics-variations" service to specify the correct function (if
1049 any) to reset `FT_Size`s after adjusting metrics.
1051 * src/truetype/ttobjs.c (tt_size_reset): Split off some functionality
1053 (tt_size_reset_height): ... this new function.
1055 * src/truetype/ttdriver.c (tt_service_metrics_variations): Add
1057 (tt_size_select, tt_size_request): Updated.
1059 * src/truetype/ttobjs.h: Updated.
1061 * include/freetype/internal/services/svmetric.h (MetricsVariations): Add
1063 (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Updated.
1065 * include/freetype/internal/tttypes.h (TT_FaceRec_): Rename `var` to
1066 `tt_var` and add `face_var`.
1068 * src/cff/cffdrivr.c (cff_service_metrics_variations): Add `size_reset`.
1069 (cff_hadvance_adjust, cff_metrics_adjust): Updated.
1071 * src/cff/cffobjs.c (cff_face_init): Use `face_var`.
1073 * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `face_var`.
1075 * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `tt_var`.
1077 * src/truetype/ttgxvar.c (tt_size_reset_iterator): Renamed to...
1078 (ft_size_reset_iterator): ... this new function.
1080 (tt_apply_mvar): Pass `size_reset` to `ft_size_reset_iterator`.
1084 2023-04-10 Alexei Podtelezhnikov <apodtele@gmail.com>
1086 * src/cff/cffcmap.c (cff_cmap_encoding_char_next): Abbreviate.
1088 2023-04-10 Alexei Podtelezhnikov <apodtele@gmail.com>
1090 Align `char_next` return types.
1092 This is mostly cosmetic because FT_UInt and FT_UInt32 are likely identical.
1094 * src/sfnt/ttcmap.c, src/cff/cffcmap.c, src/psaux/t1cmap.c,
1095 src/psnames/psmodule.c, include/freetype/internal/service/svpcsmap.h,
1096 src/pfr/pfrcmap.c, src/winfonts/winfnt.c (*_char_next): return FT_UInt.
1098 2023-04-09 Alexei Podtelezhnikov <apodtele@gmail.com>
1100 [sfnt] Clean up CMAP{4,12,13} handling.
1102 This moves the charcode overflow checks upstream and turns some
1103 while-loops into the do-while ones to avoid the uninitialized warnings.
1104 This should slightly reduce the number of checks and jumps.
1106 * src/sfnt/ttcmap.c (tt_cmap{4,12,13}_next,
1107 tt_cmap{4.12.13}_char_map_linear): Remove the charcode overflow check.
1108 (tt_cmap{4,12,13}_char_map_binary): Ditto and use do-while.
1109 (tt_cmap{12,13}_char_next): Add the overflow check.
1111 2023-04-03 Alexei Podtelezhnikov <apodtele@gmail.com>
1113 * src/sfnt/ttpost.c (load_format_25): Do not abort frame reading.
1115 2023-04-03 Alexei Podtelezhnikov <apodtele@gmail.com>
1117 * src/sfnt/ttpost.c (load_format_*): Streamline frame reading.
1119 2023-04-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1121 * src/sfnt/ttpost.c: Formatting and comments.
1123 2023-04-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1125 [sfnt] Consolidate POST version 2.0 and 2.5 (pt 2).
1127 * src/sfnt/ttpost.c (load_format_20, load_format_25): Update arguments
1128 and move shared calls and checks upstream to...
1129 (load_post_names): ... this function.
1130 (tt_face_free_ps_names, tt_face_get_ps_name): Updated.
1132 2023-04-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1134 [sfnt] Consolidate POST version 2.0 and 2.5 (pt 1).
1136 The deprecated POST version 2.5 can be handled using the data
1137 structures of version 2.0. The goal is to reduce the footprint.
1139 * include/freetype/internal/tttypes.h (TT_Post_Names): Absorb and...
1140 (TT_Post_20, TT_Post_25): ... remove these structures.
1141 src/sfnt/ttpost.c (load_post_names, tt_face_get_ps_name,
1142 tt_face_free_ps_names, load_format_20): Updated accordingly.
1143 (load_format_25): ditto and convert offsets to glyph indices.
1145 2023-04-01 Alexei Podtelezhnikov <apodtele@gmail.com>
1147 [sfnt] Miscellaneous POST clean-ups.
1149 * src/sfnt/ttpost.c (load_format_20): Decrease casts.
1150 (load_format_25): Check the table length and impose a theoretical
1151 glyph number limit usable with 8-bit offset. Decrease casts.
1152 (load_post_names): Pass the mapping data length without 2 bytes.
1154 2023-03-30 Alexei Podtelezhnikov <apodtele@gmail.com>
1156 * src/sfnt/ttpost.c (load_format_20): Simplify comutations.
1158 2023-03-29 Alexei Podtelezhnikov <apodtele@gmail.com>
1160 [sfnt] Streamline POST format 2.0 handing (cont'd).
1162 * src/sfnt/ttpost.c (load_format_20): Co-allocate the string data and
1163 their pointers, which makes it easier to handle and free them.
1164 (tt_face_free_ps_names): Updated.
1165 * include/freetype/internal/tttypes.h (TT_Post_20): Update type.
1167 2023-03-20 Alexei Podtelezhnikov <apodtele@gmail.com>
1169 [cff] Simplify `t2_strings` management in the old engine.
1171 * src/cff/cffparse.c (cff_parser_run): Allocate the charstring buffers
1172 and the list nodes together so that they can be freed at once.
1173 (finalize_t2_strings): Removed as no longer needed.
1174 (cff_parser_done): Updated.
1176 2023-03-19 Alexei Podtelezhnikov <apodtele@gmail.com>
1178 [cff] Rework the stream limit checks.
1180 The old stream limit checks, before 6986ddac1ece, were good but
1181 pointless for the crafted t2_strings. Checking limits there is
1182 not necessary as they are created to hold all data. By using two
1183 conditions, we can detect the actual crossing of the stream boundary
1184 as appropriate for the stream pointer only. The t2_strings parsing
1185 will not be triggering these checks.
1187 * src/cff/cffparse.c (cff_parser_within_limits): Removed.
1188 (cff_parse_real, cff_parse_integer): Redesign the stream limit check.
1189 (cff_parse_num, do fixed, cff_parse_fixed_dynamic): Update callers.
1191 2023-03-18 Alexei Podtelezhnikov <apodtele@gmail.com>
1193 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use for-loop.
1195 Even though we never call `TT_Load_Simple_Glyph` with zero contours,
1196 out of abundance of precaution, let's handle this case properly.
1198 2023-03-18 Alexei Podtelezhnikov <apodtele@gmail.com>
1200 [truetype] Clean up zeroing and local variables.
1202 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Avoid zeroing.
1203 (load_truetype_glyph): Avoid zeroing and clean local variables.
1205 2023-03-16 Werner Lemberg <wl@gnu.org>
1207 * include/freetype/ftsystem.h (FT_Stream_IoFunc): Improve documentation.
1211 2023-03-16 Alexei Podtelezhnikov <apodtele@gmail.com>
1213 * src/base/ftsynth.c (FT_GlyphSlot_AdjustWeight): New API.
1215 2023-03-16 Alexei Podtelezhnikov <apodtele@gmail.com>
1217 [truetype] Clean up glyph loading.
1219 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Clean space checking.
1220 (TT_Hint_Glyph): Don't copy the outline structure.
1221 (TT_Process_Simple_Glyph): Cosmetic update.
1223 2023-03-15 Alexei Podtelezhnikov <apodtele@gmail.com>
1225 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Clean up.
1227 2023-03-13 Werner Lemberg <wl@gnu.org>
1229 builds/vms/apinames_vms.bash: Fix `unzip` artifact
1231 The problem occured when unpacking a zip file created on OpenVMS on Linux.
1232 While OpenVMS knows many different file formats, Unix only knows stream-LF
1233 and binary. In principle `zip` on Linux should have translated the file to
1234 stream-LF but failed to do so. That caused the file to incorrectly contain
1235 only one line with control-characters.
1237 2023-03-11 Alexei Podtelezhnikov <apodtele@gmail.com>
1239 [truetype] Fix recent fallout in memory management.
1241 * src/truetype/ttgload.c (TT_Process_Composite_Glyph,
1242 TT_Load_Simple_Glyph): Clean up old instructions regardless of
1243 new ones, postpone setting `control_len` and `control_data` until...
1244 (TT_Load_Glyph): ... the exit from this function.
1246 2023-03-10 Jouk Jansen <joukj@hrem.nano.tudelft.nl>
1248 Update VMS installation support.
1250 2023-03-10 Alexei Podtelezhnikov <apodtele@gmail.com>
1252 * src/truetype/ttgload.c (TT_Hint_Glyph): Mostly cosmetic update.
1254 The number of instructions is now taken from the executed context.
1255 Technically, this means that `control_len` and `control_data`
1256 values are no longer _used_ internally but only expose them.
1258 2023-03-08 Werner Lemberg <wl@gnu.org>
1260 apinames.c: Add comment.
1262 2023-03-07 Werner Lemberg <wl@gnu.org>
1264 [gzip] File `infback.c` is not needed.
1266 * src/gzip/infback.c: Remove.
1267 * src/gzip/rules.mk (GZIP_DRV_SRCS): Updated.
1269 2023-03-07 Werner Lemberg <wl@gnu.org>
1271 [apinames] Fix VMS handling of overly long function names.
1273 Based on ideas from Jouk Jansen <joukj@hrem.nano.tudelft.nl>.
1275 * src/tools/vms_shorten_symbol.c: New file, taken from
1277 https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/vms_shorten_symbol.c
1279 with some minor edits to allow compilation with C++ and being included in
1280 another source code file.
1282 * src/tools/apinames.c: Include `vms_shorten_symbol.c`.
1283 (PROGRAM_VERSION): Set to '0.5'.
1284 (names_dump) [OUTPUT_VMS_OPT]: Call `vms_shorten_symbol` to get unique function
1285 identifiers not longer than 31 characters.
1287 2023-03-07 Werner Lemberg <wl@gnu.org>
1289 * src/tools/apinames.c (panic): Accept variable number of arguments.
1291 2023-03-07 Alexei Podtelezhnikov <apodtele@gmail.com>
1293 * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix leak too.
1295 2023-03-07 Alexei Podtelezhnikov <apodtele@gmail.com>
1297 * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Triage memory leak.
1299 This leak has been introduced in the previous commit and immediately
1301 https://chromium-review.googlesource.com/c/chromium/src/+/4313202
1303 2023-03-06 Alexei Podtelezhnikov <apodtele@gmail.com>
1305 [truetype] Simplify memory management.
1307 Instead of using `Update_Max`, switch to regular FreeType memory
1308 allocation macros, stop pre-allocating the glyph instruction arrays.
1310 * src/truetype/ttgload.c (TT_Load_Simple_Glyph,
1311 TT_Process_Composite_Glyph): Switch to regular memory allocation.
1312 * src/truetype/ttinterp.c (Update_Max): Removed.
1313 (TT_Load_Context): Reallocate stack and free old instructions.
1314 (Modify_CVT_Check, Ins_WS): Switch to regular memory allocation.
1315 * src/truetype/ttinterp.h (Update_Max): Removed.
1317 2023-03-06 David PROVENT <dprovent@annecy-elec.local>
1319 Added information about the zlib version update in the changelog
1321 2023-03-06 Alexei Podtelezhnikov <apodtele@gmail.com>
1323 Fix a couple of MSVC warnings.
1325 * src/base/ftcalc.c (FT_MulAddFix): Add cast.
1326 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Ditto.
1328 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com>
1330 * builds/windows/vc2010/freetype.vcxproj: Suppress C4267 on _WIN64.
1332 This usually comes from `strlen` returning 64-bit `size_t`, which
1333 we often assign to 32-bit `FT_ULong` on Windows-64 (LLP64).
1335 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com>
1337 * src/cff/cffparse.c (cff_parser_run): Thinko.
1339 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com>
1341 [cff] Clean up CharString number encoding.
1343 * src/cff/cffparser.c (cff_parser_run): Work with signed numbers.
1345 2023-03-05 Alexei Podtelezhnikov <apodtele@gmail.com>
1347 * src/cff/cffparse.c (cff_parser_run): Fix variable type.
1349 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1351 [cff] Clean up memory management in the old engine.
1353 * src/cff/cffparse.c (finalize_t2_strings): Fix NULL-dereferencing
1354 in the out-of-memory situation, use `FT_FREE`.
1355 (cff_parser_run): Use FreeType memory allocation macros and avoid
1356 uninitialized pointers.
1358 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1360 * src/cff/cffobjs.c (cff_size_init): Synonymous change.
1362 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1364 * src/sfnt/sfobjs.c (sfnt_load_face): Shorten de-referencing.
1366 2023-03-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1368 [pfr] Shorten de-referencing.
1370 * src/pfr/pfrobjs.c (pfr_face_done, pfr_face_init): Use closer `memory`.
1371 * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove `loader`.
1373 2023-03-03 Alexei Podtelezhnikov <apodtele@gmail.com>
1375 * src/cff/cffobjs.c (cff_size_get_globals_funcs): Shorten de-referencing.
1377 2023-03-03 Alexei Podtelezhnikov <apodtele@gmail.com>
1379 [cff,cid,type1] Shorten de-referencing.
1381 * src/cff/cffobjs.c (cff_clot_init): Use immediate library reference.
1382 * src/cid/cidobjs.c (cid_slot_init): Ditto.
1383 * src/type1/t1objs.c (T1_GlyphSlot_Init): Ditto.
1385 2023-03-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1387 * configure: Use `sed` instead of `grep`.
1389 This is more portable and consistent with `autogen.sh`.
1391 2023-03-02 Ben Wagner <bungeman@chromium.org>
1393 Avoid strtol on non-null-terminated data.
1395 Technically, `strtol` can only be used with C strings terminated with
1396 `\0`. CID data is not generally null-terminated and often does not
1397 contain a `\0` if it is hex-encoded. AddressSanitizer with `ASAN_OPTIONS`
1398 containing `strict_string_checks=1` verifies this by using an adversarial
1399 `strtol` that always reads to the terminating `\0`.
1401 To avoid undefined behavior from `strtol` in `cid_parser_new`, use the
1402 parser to parse the tokens instead of attempting to parse them ad-hoc.
1403 This will internally use `PS_Conv_Strtol` to parse the integer, which
1404 respects the parser's limits and directly implements the PostScript
1405 parsing rules for integers.
1407 * src/cid/cidparse.c (cid_parser_new): Use the parser to parse the
1410 Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1420329
1412 2023-03-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1414 * src/cff/cffload.c (cff_subfont_load): Synonymous update.
1416 2023-03-01 ubawurinna <ubawurinna-6079@yopmail.com>
1418 * src/gzip/README.freetype: Update version.
1420 2023-03-01 ubawurinna <you@example.com>
1422 [gzip] Fix static linking.
1424 Without this patch, static linking with MS Visual Studio causes linking
1427 * src/gzip/ftgzip.c: Set `ZEXPORT` to nothing and `ZEXTERN` to static for
1430 2023-03-01 Werner Lemberg <wl@gnu.org>
1432 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update.
1436 https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00200.html
1438 2023-02-28 Alexei Podtelezhnikov <apodtele@gmail.com>
1440 [truetype] Treat 38 as 40 without Infinality.
1442 * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Reinstate.
1443 * src/truetype/ttdriver.c (tt_property_set): Fallback from 38 to 40.
1445 2023-02-26 Werner Lemberg <wl@gnu.org>
1447 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update.
1451 https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00159.html
1453 2023-02-26 Werner Lemberg <wl@gnu.org>
1455 * src/*: Replace leading underscores with trailing ones in dummy variables.
1457 This is to avoid clang warnings.
1459 2023-02-26 Karl Berry <karl@freefriends.org>
1461 * configure: Don't hardcode `grep -E`.
1463 TeXLive still supports Solaris 5.10, where the system's `grep` doesn't
1464 accept the `-E` option. We thus introduce an `EGREP` variable that is set
1465 to either `grep -E` or `-egrep`.
1467 2023-02-26 Alexei Podtelezhnikov <apodtele@gmail.com>
1469 * src/cff/cffload.c (cff_encoding_load): Optimize array zeroing.
1471 This is unnecessary for predefined standard and expert encodings.
1472 Even for custom encodings the arrays might be already zeroed when
1473 CFF_FontRec is created but we keep it just in case.
1475 2023-02-25 Alexei Podtelezhnikov <apodtele@gmail.com>
1477 * src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing.
1479 2023-02-25 Tamir Duberstein <tamird@google.com>
1481 * src/base/ftsystem.c (ft_ansi_stream_io): Avoid undefined behaviour.
1482 Also short-circuit on `offset` to avoid checking `count` a second time when
1483 `ft_ansi_stream_io` is used for reading.
1487 If an argument to a function has an invalid value (such as a value outside
1488 the domain of the function, or a pointer outside the address space of the
1489 program, or a null pointer, or apointer to non-modifiable storage when the
1490 corresponding parameter is not const-qualified) or a type (after
1491 promotion) not expected by a function with variable number of arguments,
1492 the behavior is undefined. If a function argument is described as being
1493 an array, the pointer actually passed to the function shall have a value
1494 such that all address computations and accesses to objects (that would be
1495 valid if the pointer did point to the first element of such an array) are
1498 Per IEEE Std 1003.1:
1500 size_t fread(void *restrict ptr, size_t size, size_t nitems,
1501 FILE *restrict stream);
1503 The `fread` function shall read into the array pointed to by `ptr` up to
1504 `nitems` elements whose size is specified by `size` in bytes, from the
1505 stream pointed to by `stream`.
1507 Since the first argument to `fread` is described as being an array, its
1508 behavior is undefined when that argument is a null pointer.
1510 Per the documentation on `ft_ansi_stream_io`:
1512 If `count' is zero (this is, the function is used for seeking), a non-zero
1513 return value indicates an error.
1515 Thus the intent is clear, and the call to `fread` can be skipped, avoiding
1516 undefined behaviour.
1518 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com>
1520 [raster] Clean up contour indexing.
1522 * src/raster/ftraster.c (Decompose_Curve, Convert_Glyph): Use consistent
1523 index types (Int) and compact iterations.
1525 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com>
1527 [autofit] Clean up contour indexing.
1529 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Refactor.
1530 * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Ditto.
1532 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com>
1534 * src/base/ftoutln.c (FT_Outline_Check): Fix C4701 warning.
1536 2023-02-21 Alexei Podtelezhnikov <apodtele@gmail.com>
1538 * src/sdf/ftsdf.c (get_min_distance_cubic): Fix C4701, typos.
1540 2023-02-20 Alexei Podtelezhnikov <apodtele@gmail.com>
1542 * src/base/ftstroke.c (FT_Stroker_ParseOutline): Clean up contour indexing.
1544 2023-02-20 Alexei Podtelezhnikov <apodtele@gmail.com>
1546 [base] Clean up contour indexing.
1548 * src/base/ftoutln.c (FT_Outline_Reverse, FT_Outline_EmboldenXY,
1549 FT_Outline_Get_Orientation): Set the first and last indexes together.
1550 (FT_Outline_Decompose): Ditto and check them more stringently.
1551 * src/smooth/ftgrays.c (FT_Outline_Decompose)[STANDALONE_]: Ditto.
1553 2023-02-20 Alexei Podtelezhnikov <apodtele@gmail.com>
1555 * src/base/ftoutln.c (FT_Outline_Check): Update error code, clean up.
1557 2023-02-17 Alexei Podtelezhnikov <apodtele@gmail.com>
1559 [truetype] Hide Infinality.
1561 Remove Infinality as an option before its complete extraction.
1563 * include/freetype/ftoption.h: Remove the Infinality option.
1564 * devel/ftoption.h: Ditto.
1565 * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Is 40 now.
1567 2023-02-17 Alex Ringlein <aringlein@figma.com>
1569 * src/base/ftoutln.c (FT_Outline_Reverse): Anchor first contour points.
1571 A cubic contour has to always start from an on-point. Therefore, we
1572 should not swap the first with the last point, which might be off, and
1573 obtain an invalid contour. This does not matter for conic contours.
1574 If anything, it also saves one swap there. Fixes #1207.
1576 2023-02-16 Werner Lemberg <wl@gnu.org>
1578 Documentation improvement for `FT_Bitmap`.
1582 2023-02-10 Alexei Podtelezhnikov <apodtele@gmail.com>
1584 [type1/MM] Round design coordinates.
1586 The design coordinates for MM fonts were not rounded. For example,
1587 `FT_Get_Var_Design_Coordinates` returned values with fractional part.
1589 * src/type1/t1load.c (mm_axis_unmap): Refactor with rounding.
1591 * include/freetype/ftmm.h (FT_Var_Axis, FT_Set_Var_Design_Coordinates,
1592 FT_Get_Var_Design_Coordinates): Reword documentation.
1594 2023-02-09 Jan Alexander Steffens (heftig) <heftig@archlinux.org>
1596 * builds/meson/parse_modules_cfg.py: Handle `gxvalid` and `otvalid`.
1598 These need a name mapping similar to what was done for other modules,
1599 or linking will fail.
1601 2023-02-09 Werner Lemberg <wl@gnu.org>
1603 * build/toplevel.mk (do_dist): Fix typo.
1605 2023-02-09 Werner Lemberg <wl@gnu.org>
1607 * Version 2.13 released.
1608 ==========================
1610 Tag sources with `VER-2-13-0'.
1612 * docs/VERSION.TXT: Add entry for version 2.13.
1613 * docs/CHANGES: Updated.
1615 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
1616 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
1617 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
1618 docs/freetype-config.1: s/2.12.1/2.13/, s/2121/2130/.
1620 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 13.
1621 (FREETYPE_PATCH): Set to 0.
1623 * builds/unix/configure.raw (version_info): Set to 25:0:19.
1624 * CMakeLists.txt (VERSION_MINOR): Set to 13.
1625 (VERSION_PATCH): Set to 0.
1627 2023-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
1629 Comment on `FT_GlyphSlot_Slant'.
1631 2023-02-08 Werner Lemberg <wl@gnu.org>
1633 [autofit] Fix 'multi' compilation.
1635 * src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`.
1636 Add ANSI boilerplate code for otherwise empty file.
1637 * src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`.
1638 Use `FT_BEGIN_HEADER` and `FT_END_HEADER`.
1639 Decorate with `FT_LOCAL`.
1641 * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
1643 2023-02-08 Werner Lemberg <wl@gnu.org>
1645 Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags.
1647 2023-02-08 Werner Lemberg <wl@gnu.org>
1649 Fix 'fall-through' warning messages.
1651 Modern compilers get more insistent on that...
1653 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Define.
1654 * src/*: Use it instead of `/* fall through */` comments.
1656 2023-02-08 Werner Lemberg <wl@gnu.org>
1658 For debugging, avoid implicit conversion from integer to double.
1660 Otherwise we get zillions of clang 15 warnings.
1662 * src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
1663 src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c,
1664 src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c,
1665 src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use
1666 `double` cast in debugging and tracing macros.
1668 2023-02-08 Werner Lemberg <wl@gnu.org>
1670 Avoid reserved identifiers that are globally defined.
1672 This is mandated by the C99 standard, and clang 15 produces zillions of
1675 * devel/ftoption.h, include/freetype/config/ftoption.h,
1676 include/freetype/internal/ftmemory.h, src/autofit/afhints.h,
1677 src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c,
1678 src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c,
1679 src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
1681 2023-02-08 Werner Lemberg <wl@gnu.org>
1683 Fix minor clang and clang++ warnings.
1685 2023-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
1687 [truetype, type1] Additional variation tags.
1690 https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags
1692 * src/truetype/ttgxvar.h (TTAG_ital): New tag.
1693 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it.
1694 * src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'.
1696 2023-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
1698 * src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant.
1699 * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it.
1701 2023-02-08 anuj <95867901+anuj99@users.noreply.github.com>
1703 [sdf] Use 32-bit integers internally.
1705 * src/sdf/ftsdfcommon.h (FT_16D16, FT_26D6): Use 32-bit integers
1706 instead of `FT_Fixed` for internal data types. `FT_Fixed` i.e.
1707 `signed long` is 64-bit on some architectures.
1709 2023-02-07 Werner Lemberg <wl@gnu.org>
1711 docs/CHANGES: Updated.
1713 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1715 Comment on optional ascender and descender.
1717 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1719 * src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender.
1721 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
1723 * src/type1/t1afm.c (T1_Read_Metrics): Validate ascender and descender.
1725 The ascender and descender are optional in the AFM specifications.
1726 They could be omitted or even set to zero, e.g., in the current release
1727 of URW++ base 35 fonts.
1729 2023-02-02 Werner Lemberg <wl@gnu.org>
1731 * src/cff/cffgload.c (cff_slot_load): Avoid memory leak.
1735 2023-02-01 Werner Lemberg <wl@gnu.org>
1737 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Check `face->blend`.
1741 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55581
1743 2023-02-01 Werner Lemberg <wl@gnu.org>
1745 * docs/CHANGES: Add news for 'freetype-demos'.
1747 2023-01-30 Werner Lemberg <wl@gnu.org>
1749 * subprojects/harfbuzz.wrap, subprojects/libpng.wrap: Updated.
1751 2023-01-28 Werner Lemberg <wl@gnu.org>
1755 Comment fixes, typos, removing of unnecessary parentheses.
1757 2023-01-28 Werner Lemberg <wl@gnu.org>
1761 2023-01-27 Behdad Esfahbod <behdad@behdad.org>
1763 [ttgxvar] Fix crash in COLRv1.
1765 This is a stopgap until issue #1202 is properly fixed.
1767 * src/truetype/ttxgvar.c (tt_var_get_item_delta): Check `normalizedcoords`.
1769 2023-01-19 Werner Lemberg <wl@gnu.org>
1771 The 'COLR' v1 API will no longer be experimental in the next release.
1773 2023-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
1775 * docs/oldlogs/ChangeLog.210: Typos.
1777 2023-01-18 Ben Wagner <bungeman@chromium.org>
1781 * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Request module 't1cid',
1784 2023-01-18 Ben Wagner <bungeman@chromium.org>
1786 [base] Return error if requested driver is not found.
1788 In `open_face_from_buffer` it is possible that a driver is requested but
1789 FreeType was built without the requested module. Return an error in this
1790 case to indicate that the request could not be satisfied, rather than trying
1791 all existing driver modules.
1793 * src/base/ftobjs.c (open_face_from_buffer): Return `FT_Err_Missing_Module`
1794 if a driver is specified but not found.
1796 2023-01-18 Dominik Röttsches <drott@chromium.org>
1798 [sfnt] Avoid nullptr dereference in reading malformed 'COLR' v1 table.
1800 Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1408044.
1802 * src/sfnt/ttcolr.c (tt_face_load_colr): When the 'COLR' v1 table header is
1803 too small, don't deallocate delta set index map structures.
1805 2023-01-17 Werner Lemberg <wl@gnu.org>
1807 * src/tools/update-copyright: Allow execution from other repositories.
1809 We use this for `freetype-demos`.
1811 2023-01-17 Werner Lemberg <wl@gnu.org>
1813 Update all copyright notices.
1815 2023-01-17 Werner Lemberg <wl@gnu.org>
1817 * src/tools/no-copyright: Updated.
1819 2023-01-17 Ben Wagner <bungeman@chromium.org>
1821 [base] 'close' callback may not use `stream->memory`.
1823 The documentation for `FT_StreamRec::memory` states that it 'shouldn't be
1824 touched by stream implementations'. This is true even for internal
1825 implementations of the 'close' callback, since it is not guaranteed that
1826 `memory` will even be set when the 'close' callback occurs.
1828 * src/base/ftobjs.c (new_memory_stream): stash current `memory` in
1829 `stream->descriptor`.
1830 (memory_stream_close): Use it.
1832 2023-01-17 Ben Wagner <bungeman@chromium.org>
1834 [base] Always close user-provided stream.
1836 The `FT_Open_Face` documentation states
1838 > If `FT_OPEN_STREAM` is set in `args->flags`, the stream in `args->stream`
1839 > is automatically closed before this function returns any error (including
1840 > `FT_Err_Invalid_Argument`).
1842 However, if the user provides a stream in `args.stream` with
1843 `FT_OPEN_STREAM` set and a `close` function, but then for some reason passes
1844 NULL for `aface` and a non-negative `face_index`, the error
1845 `Invalid_Argument` is returned but the `close` callback will not be called
1846 on the user-provided stream. This may cause resource leaks if the caller is
1847 depending on the `close` callback to free resources.
1849 The difficulty is that a user may fill out a `FT_StreamRec` and pass its
1850 address as `args.stream`, but the stream isn't really 'live' until
1851 `FT_Stream_New` is called on it (and `memory` is set). In particular, it
1852 cannot really be cleaned up properly in `ft_open_face_internal` until the
1853 stream pointer has been copied into the `stream` local variable.
1855 * src/base/ftobj.c (ft_open_face_internal): Ensure that user-provided
1856 `args.stream.close` is called even with early errors.
1858 2023-01-17 Ben Wagner <bungeman@chromium.org>
1860 [base] Fix leak of internal stream marked external.
1862 `open_face_from_buffer` allocates a new `FT_Stream` to pass to
1863 `ft_open_face_internal`. Because this is an `FT_OPEN_STREAM`,
1864 `ft_open_face_internal` will mark this as an 'external stream', which the
1865 caller must free. However, `open_face_from_buffer` cannot directly free it
1866 because the stream must last as long as the face. There is currently an
1867 attempt at this by clearing the 'external stream' bit after
1868 `open_face_from_buffer` returns successfully. However, this is too late as
1869 the original stream may have already been closed and the stream on the face
1870 may not be the same stream as originally passed.
1872 It is tempting to use `FT_OPEN_MEMORY` and let `ft_open_face_internal`
1873 create the stream internally. However, with this method there is no means
1874 to pass through a 'close' function to the created stream to free the
1875 underlying data, which must be owned by the stream.
1877 A possibility is to check on success if the stream of the face is the same
1878 as the original stream. If it is then unset the external flag. If not,
1879 then free the original stream. Unfortunately, while no current
1880 implementation does so, it is possible that the face still has the original
1881 stream somewhere other than as the `FT_FaceRec::stream`. The stream needs
1882 to remain available for the life of the face or until it is closed,
1883 whichever comes earlier.
1885 The approach taken here is to let the stream own itself. When the stream is
1886 closed it will free itself.
1888 * src/base/ftobjs.c (memory_stream_close): Free `stream`.
1889 (open_face_from_buffer): Simplify error handling, since
1890 `ft_open_face_internal` always closes `args.stream` on any error.
1892 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54930
1894 2023-01-16 Werner Lemberg <wl@gnu.org>
1896 sr/*.c: Various minor fixes.
1898 * src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after
1899 variable declarations.
1901 * src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate
1904 * src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++
1907 * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid
1910 * src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning.
1912 2023-01-16 Dominik Röttsches <drott@chromium.org>
1914 [sfnt] Remove temporary runtime flag for variable 'COLR' v1.
1918 * src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr,
1919 tt_face_free_colr, get_deltas_for_var_index_base,
1920 tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro
1921 definition `VARIABLE_COLRV1_ENABLED` and its usage.
1923 * src/truetype/ttdriver.c (tt_property_set): Remove parsing of
1924 'TEMPORARY-enable-variable-colrv1' property name.
1926 * src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1`
1929 2023-01-07 Werner Lemberg <wl@gnu.org>
1931 * src/autofit/ft-hb.c (_hb_ft_reference_table): Minor integration fixes.
1933 2023-01-07 Ben Wagner <bungeman@chromium.org>
1935 [truetype] Reset cvt and storage in context load.
1937 Currently the cvt and storage are saved and restored in `TT_RunIns`.
1938 However, this is too granular as the cvt and storage area should be set to
1939 the original cvt and storage area only when setting up the hinting context.
1940 This allows for the cvt and storage area to be modified while parsing
1941 multiple glyphs, as is the case with composite glyphs.
1943 * src/truetype/ttinterp.h (TT_ExecContextRec): Remove `origCvt` and
1946 * src/truetype/ttinterp.c (TT_RunIns): Don't save and restore the cvt and
1948 (Modify_CVT_Check, Ins_WS): Switch from "if in glyph and using original data
1949 do copy on write" to "if in glyph and not using glyph specific data do copy
1952 2023-01-06 Matthias Clasen <mclasen@redhat.com>
1954 [autofit] Don't depend on 'hb-ft'.
1956 The circular dependency is still there, but at least we no longer depend on
1957 the HarfBuzz API that is only present if HarfBuzz has been built with
1958 FreeType support, making the bootstrapping a bit easier.
1960 * src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing
1961 `_hb_ft_font_create`, which is more or less a verbatim copy of the
1962 corresponding HarfBuzz code from file `hb-ft.cc`.
1964 * src/autofit/afglobal.c (af_face_globals_new): Use it.
1965 * src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`.
1966 * src/autofit/autofit.c: Include `ft-hb.c`.
1968 * LICENSE.TXT: Updated.
1970 2023-01-06 Ben Wagner <bungeman@chromium.org>
1972 [truetype] Keep variation store consistent.
1974 `tt_var_load_item_variation_store` fills out a `GX_ItemVarStore`. While it
1975 may return an error, the item store must be left in a consistent state so
1976 that any use or destruction of the item store can properly use or free the
1977 data in it. Before this change the counts from the font data were read
1978 directly into the item store before the actual allocation of the arrays to
1979 which they referred. There exist many opportunities between the time the
1980 counts are read and the arrays are allocated to return early due to invalid
1981 data. When this happened the item store claimed to have entires it actually
1982 did not, leading to crashes later when it was used.
1984 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54449
1986 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Read the counts
1987 into local variables and store them in the item store only after the related
1988 arrays are actually created on the item store.
1990 2023-01-05 Ben Wagner <bungeman@chromium.org>
1992 [base] Report used stream's external status.
1994 In `open_face` the initial stream is set on the face, along with the
1995 information about if FreeType is the owner of the stream object itself. The
1996 loaders may in the course of their work replace this stream with a new
1997 stream (as is the case for 'woff' and 'woff2'), which may have a different
1998 ownership than the initial stream object (likely the original stream object
1999 is owned by the user and is external, while the new stream object is created
2000 internally to FreeType and is internal). When the stream is replaced, the
2001 face's flags are updated with the new ownership status.
2003 However, `open_face` cannot itself free this stream as its caller
2004 `ft_open_face_internal` is responsible for this. In addition, in the case
2005 of an error `open_face` cannot return an actual face with the new stream and
2006 its ownership status to the caller. As a result, it must pass this
2007 information back to the caller as a sort of "failed face" so that the caller
2010 `open_face` was already passing back the new stream but was not passing back
2011 the stream ownership information. As a result the stream may not have been
2014 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54700
2016 * src/base/ftobjs.c (open_face): Pass back the ownership information as
2018 (ft_open_face_internal): Updated.
2020 2023-01-05 Noah Cabral <cnoah1705@gmail.com>
2022 fix spelling err in LICENSE.txt
2024 2023-01-05 Dominik Röttsches <drott@chromium.org>
2026 [sfnt] Fix color stop bounds check calculation at table end.
2028 Fixes https://bugs.chromium.org/p/skia/issues/detail?id=14021
2030 * src/sfnt/ttcolr.c (VAR_IDX_BASE_SIZE): New macro.
2031 (tt_face_get_colorline_stops): Fix off-by-one bounds check calculation, take
2032 `VarColorStop` into account, and hopefully make it easier to read.
2034 2023-01-05 Alexei Podtelezhnikov <apodtele@gmail.com>
2036 * src/base/ftobjs.c (FT_Request_Metrics): Avoid division by zero.
2038 The division-by-zero might happen in broken fonts (see #1194).
2039 Instead of returning a huge number from FT_DivFix and failing
2040 to scale later, we now bail immediately.
2042 2022-12-20 Alexei Podtelezhnikov <apodtele@gmail.com>
2044 [psaux] Delay the upem validity assertion.
\r
2048 * src/psaux/psft.c (cf2_getUnitsPerEm): Remove the upem assert.
\r
2049 (cf2_checkTransform): Assert the upem validity after checking the scale.
2051 2022-12-14 David Vanderson <david.vanderson@gmail.com>
2052 Werner Lemberg <wl@gnu.org>
2054 [gzip] Make static compilation not leak global symbols.
2056 * src/gzip/ftgzip.c (HAVE_HIDDEN): Do not define; it is no longer needed
2057 because everything is static.
2058 (HAVE_MEMCPY): Define.
2059 (zcalloc, zcfree): Remove no longer needed definitions (because `Z_SOLO` is
2062 * src/gzip/patches/freetype-zlib.diff: Regenerated.
2066 2022-12-14 Werner Lemberg <wl@gnu.org>
2068 * src/gzip/ftzconf.h: Updated to zlib 1.2.13.
2070 I forgot to copy that file.
2072 2022-12-14 Werner Lemberg <wl@gnu.org>
2074 * builds/unix/configure.raw: Don't check for `memcpy` and `memmove`.
2076 We expect a C99 compiler, and both functions are part of this standard.
2078 2022-12-13 Werner Lemberg <wl@gnu.org>
2080 [sdf, sfnt] Handle minor compiler warnings.
2082 * src/sdf/ftsdf.c (get_min_distance_conic): Initialize `nearest_point`.
2084 * src/sfnt/ttsvg.c (find_doc): Initialize `mid_doc`.
2088 2022-12-07 Werner Lemberg <wl@gnu.org>
2090 * subprojects/zlib.wrap: Micro-update from upstream.
2092 2022-12-06 Jiří Malák <malak.jiri@gmail.com>
2094 * include/freetype/internal/ftcalc.h (FT_MSB): Support Open Watcom 2.0.
2098 2022-11-23 Luca Bacci <luca.bacci982@gmail.com>
2100 * src/base/ftdbgmem.c (ft_mem_source_compare): Add FT_COMPARE_DEF.
2104 2022-11-21 Alexei Podtelezhnikov <apodtele@gmail.com>
2106 * src/autofit/afloader.c (af_loader_load_glyph): Remove `size` check.
2108 This is done by `FT_Load_Glyph`.
2110 2022-11-18 Alexei Podtelezhnikov <apodtele@gmail.com>
2114 2022-11-16 Johan Matsson <mjunix@ at github>
2116 * src/autofit/afloader.c (af_loader_load_glyph): Fix dereference.
2118 This must happen after the NULL check.
2122 https://github.com/freetype/freetype/pull/2
2124 2022-11-15 Alexei Podtelezhnikov <apodtele@gmail.com>
2126 * src/pcf/pcfutil.c ({Two,Four}ByteSwap): Use builtins or shifts.
2128 We trust glibc which uses shifts or builtins to swap bytes. This
2129 must be more efficient.
2131 2022-11-14 Werner Lemberg <wl@gnu.org>
2133 * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Integer overflow.
2137 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50462
2139 2022-11-14 Loïc Yhuel <loic.yhuel@softathome.com>
2141 [meson] Use generated ftmodule.h
2143 ftmodule.h is generated at the root of the build directory, but FT_CONFIG_MODULES_H
2144 (freetype/config/ftmodule.h) is used instead.
2145 This makes the build fail when disabling modules in modules.cfg.
2147 * meson.build (harfbuzz_dep): Add '-DFT_CONFIG_MODULES_H=<ftmodule.h>'.
2149 2022-11-14 Loïc Yhuel <loic.yhuel@softathome.com>
2151 [meson] Fix generated ftmodule.h
2153 The sdf module wasn't recognized, so the generated ftmodule.h had "None_renderer_class".
2155 * builds/meson/parse_modules_cfg.py: Handle sdf in RASTER_MODULES.
2157 2022-11-12 Dominik Röttsches <drott@chromium.org>
2159 Add `TT_CONFIG_OPTION_NO_BORING_EXPANSION` configuration macro.
2161 This gives users a possibility to deactivate new features not (yet) in the
2164 * include/freetype/config/ftoption.h, devel/ftoption.h
2165 (TT_CONFIG_OPTION_NO_BORING_EXPANSION): New macro.
2167 * src/truetype/ttgxvar.c (ft_var_load_avar): Use it to disable 'avar'
2168 version 2.0 support.
2170 2022-11-12 Behdad Esfahbod <behdad@behdad.org>
2172 [truetype] Improve bounds checks for `ItemVariationStore`.
2174 * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Move bounds check ...
2175 (tt_var_get_item_delta): ... to this function, because it is safer. For
2176 example, the 'avar' table 2.0 codepath was not performing a bounds check at
2179 2022-11-12 Behdad Esfahbod <behdad@behdad.org>
2181 [truetype] In `ItemVariationStore`, value 0xFFFF for `dataCount` is valid.
2183 It corresponds to outer indices of 0 to 0xFFFE.
2185 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Remove invalid
2188 2022-11-11 Alexei Podtelezhnikov <apodtele@gmail.com>
2190 [pcf] Improve CMap efficiency and readability.
2192 * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Check and walk
2193 the encoding array indexes.
2195 2022-11-10 Sam James <sam@gentoo.org>
2197 Fix `-Wstrict-prototypes`.
2199 * builds/unix/configure.raw: Fix `-Wstrict-prototypes`.
2200 Clang 16 warns on these and they will be dropped in C23.
2202 * builds/unix/freetype2.m4: Ditto.
2204 2022-11-09 Ben Wagner <bungeman@chromium.org>
2206 [truetype] Check avar_segment before access
2208 * src/truetype/ttgxvar.c (tt_done_blend): check `avar_segment` before
2209 accessing to free its `correspondence`.
2213 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53062
2215 2022-11-09 Ben Wagner <bungeman@chromium.org>
2217 [truetype] Restore behavior of ft_var_load_hvvar
2219 * src/truetype/ttgcvar.c (ft_var_load_hvvar): restore previous behavior
2221 In a previous change [0] the behavior of `ft_var_load_hvvar` was changed
2222 to not load the item variation store if it was at offset 0, but not
2223 return an error when this happened. This broke any users, like
2224 `tt_hvadvance_adjust`, that rely on successful completion of
2225 `ft_var_load_hvvar` to imply that returned table's `itemStore` had been
2226 initialized. This lead such users to dereference NULL.
2228 This change appears to have been unintentional and unrelated to the
2229 actual avar2 changes. As a result, fix these NULL dereferences by
2230 restoring the code to always attempt to initialize the `itemStore`.
2232 [0] ae4eb996 "[truetype] Add support for `avar` table 2.0 format."
2236 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53061
2238 2022-11-08 Werner Lemberg <wl@gnu.org>
2240 docs/CHANGES: Updated.
2242 2022-11-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
2244 [build] use AC_CHECK_PROG() macro for libpng-config detection
2246 * builds/unix/configure.raw: use AC_CHECK_PROG() instead of `which` to find `libpng-config`.
2248 2022-11-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
2250 [build] fix for make multi
2252 Fix "make multi" by MR !223
2254 * include/freetype/internal/services/svmm.h: include ftmm.h to define FT_Get_MM_Func.
2255 * src/truetype/ttgxvar.h: include ftmmtypes.h to use GX_AVarTable properly.
2256 * src/base/ftmac.c: include ftdebug.h to use FT_THROW() properly.
2258 2022-11-08 Alexei Podtelezhnikov <apodtele@gmail.com>
2260 * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Accelerate the search.
2262 This is mostly for consistency because PFR fonts with bitmap strikes
2263 do not seem to exist.
2265 2022-11-06 Alexei Podtelezhnikov <apodtele@gmail.com>
2267 [bdf, pfr, psnames] Accelarate charmap searches.
2269 The binary searches within charmaps can be accelerated because they
2270 often contain dense continuous blocks of character codes. Within such
2271 blocks, you can predict matches based on misses. This method has been
2272 deployed in `bdf` since 0f122fef34; we only refactor it there. We now
2273 use it in `pfr` and `psnames`, which speeds up the unicode charmap
2274 access by about 50% in PFR and Type 1 fonts.
2276 * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Refactor.
2277 * src/pfr/pfrcmap.c (pfr_cmap_char_{index,next}): Predict `mid` based
2278 on the mismatch distance.
2279 * src/psnames/psmodule.c (ps_unicodes_char_{index,next}): Ditto.
2281 2022-11-04 Behdad Esfahbod <behdad@behdad.org>
2283 [truetype] Add support for `avar` table 2.0 format.
2287 https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2.md
2289 for the specification.
2291 Currently, this is implemented only in most recent OS versions on Apple
2292 platforms and in the HarfBuzz library, but it is expected to be added to the
2293 OpenType standard soon.
2295 * src/truetype/ttgxvar.h (GX_AVarTableRec): New structure.
2296 (GX_BlendRec): Use it to replace `avar_segment` with `avar_table`.
2298 * src/truetype/ttgxvar.c (ft_var_load_avar): Load new table version.
2299 (ft_var_to_normalized, tt_done_blend): Extend for new format.
2300 (ft_var_load_hvvar, ft_var_to_design): Updated.
2302 2022-10-24 Werner Lemberg <wl@gnu.org>
2304 Replace '1/64th' (and similar entries) with '1/64' in docs and comments.
2306 2022-10-24 Ivan Panchenko <ivanpan3@gmail.com>
2308 * include/freetype/*: Fix documentation typos.
2310 2022-10-21 Alexei Podtelezhnikov <apodtele@gmail.com>
2312 * src/truetype/ttgload.c: Cosmetic changes.
2314 2022-10-21 Alexei Podtelezhnikov <apodtele@gmail.com>
2316 [cff, truetype] Simplify SVG metrics scaling.
2318 Use pre-calculated scaling factors. Also, the advance widths used
2319 to be rounded, which was incorrect.
2321 * src/cff/cffgload.c (cff_slot_load): Use `x_scale` and `y_scale`.
2322 * src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
2324 2022-10-20 Werner Lemberg <wl@gnu.org>
2326 * subprojects/zlib.wrap: Update to zlib version 1.2.13.
2328 2022-10-18 Dominik Röttsches <drott@chromium.org>
2330 [sfnt] Additional bounds checks for `COLR` v1 table handling.
2332 * src/sfnt/ttcolr.c (read_paint): Add `colr` argument, necessary for...
2333 ... another use of `ENSURE_READ_BYTES`.
2335 (tt_face_get_paint_layers): Ensure that the 4-byte paint table
2338 This is a follow-up to !124 and issue
2339 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404
2341 2022-10-18 Werner Lemberg <wl@gnu.org>
2343 [gzip] Update sources to zlib 1.2.13.
2345 2022-10-18 Alexei Podtelezhnikov <apodtele@gmail.com>
2347 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Simplify calculations.
2349 2022-10-18 Werner Lemberg <wl@gnu.org>
2353 2022-10-18 Dominik Röttsches <drott@chromium.org>
2355 [sfnt] Guard individual `COLR` v1 paint field reads.
2357 * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): New macro.
2358 (read_paint): Use it – after the start pointer `p` has been checked for
2359 whether it allows reading the format byte, each successive paint table field
2360 read need to be bounds-checked before reading further values.
2364 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404
2366 2022-10-17 Xiang Xiao <xiaoxiang@xiaomi.com>
2368 * builds/toplevel.mk: Prefix all paths with `$(TOP_DIR)/`.
2370 This is useful for builds that are not started from the root directory.
2372 2022-10-17 Liu Kunpeng(柳鲲鹏) <liukunpeng@ts-it.cn>
2374 * src/base/ftsynth.c (FT_GlyphSlot_Slant): New API with custom slant.
2375 * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Declare it.
2377 2022-10-15 Alexei Podtelezhnikov <apodtele@gmail.com>
2379 Note the lack of floating-point data types.
2381 2022-10-10 Werner Lemberg <wl@gnu.org>
2383 [cff] Remove `FT_CONFIG_OPTION_NO_GLYPH_NAMES`.
2385 This ancient option stayed completely undocumented. Given that the 'cff'
2386 driver requires the 'psnames' module, it makes no sense today to have this
2389 * src/cff/cffdrivr.c (cff_services), src/cff/cffobjs.c (cff_face_init):
2390 Remove corresponding conditional code.
2392 2022-10-10 Werner Lemberg <wl@gnu.org>
2394 Synchronize `ftoption.h` flavours.
2396 2022-10-10 Werner Lemberg <wl@gnu.org>
2398 Minor comment changes.
2400 2022-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
2402 Improve FT_Get_Name_Index docs and place it next to FT_Get_Glyph_Name.
2404 2022-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
2406 [autofit] Reset the face charmap directly.
2408 There is no need to validate the original charmap in `FT_Set_Charmap`.
2409 It can be reset directly.
2411 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
2412 Use direct assignment.
2413 * src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto.
2415 2022-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
2417 * src/type1/t1afm.c (T1_Read_PFM): Set charmaps directly.
2419 As with the previous commit, we can avoid the validation checks
2420 of `FT_Set_Charmap` and set it directly when choosing from the
2423 2022-10-03 Alexei Podtelezhnikov <apodtele@gmail.com>
2425 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`.
\r
2427 Set charmap aggressively without all validations of `FT_Set_Charmap`
\r
2428 because we take it from the available array and only temporarily.
\r
2429 Even CMap Format 14 will gracefully return 0.
2431 2022-10-03 Alexei Podtelezhnikov <apodtele@gmail.com>
2433 * src/cache/ftcbasic.c (ftc_basic_family_get_count): Remove redundancy.
2435 2022-09-30 Werner Lemberg <wl@gnu.org>
2437 * src/psaux/pshints.c (cf2_hintmap_insertHint): Fix midpoint computation.
2439 Replace '(start + end) / 2' with 'start + (end - start) / 2' to avoid
2444 2022-09-30 Werner Lemberg <wl@gnu.org>
2446 * src/psaux/pshints.c (cf2_hintmap_build): Improve debugging output.
2448 2022-09-29 mlugg <mlugg@mlugg.co.uk>
2450 [truetype] Fix undefined pointer arithmetic.
2452 * src/truetype/ttgxvar.c (tt_var_get_item_delta, ft_var_load_mvar): Use
2455 2022-09-29 Alexei Podtelezhnikov <apodtele@gmail.com>
2457 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Use lighter FT_DivFix.
2459 2022-09-29 Ali Chraghi <alichraghi@pm.me>
2461 [base] FT_Attach_Stream: Make `parameters` argument constant.
2463 2022-09-29 Azamat Hackimov <azamat.hackimov@gmail.com>
2465 * src/tools/*.py: Migrate to Python 3.
2467 Fixes #1185, closes !205. Formatting changes according to PEP8.
2469 2022-09-27 Dominik Röttsches <drott@chromium.org>
2471 [sfnt] Guard access in 'COLR' table when requesting child table pointer.
2473 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Tighten
2474 pointer bounds checks.
2475 (get_child_table_pointer): Check whether incoming pointer `p` lies within
2480 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51816
2482 2022-09-27 Ben Wagner <bungeman@chromium.org>
2484 [sfnt] Add SVG document bounds checking.
2486 Add a check that the document content is actually contained within the
2487 `SVG ` table. Without this check a malformed font may claim arbitrary
2488 memory as its document content.
2490 * src/sfnt/ttsvg.c (tt_face_load_svg): Take `numEntries` into account when
2491 testing 'documentRecord' extents.
2492 (find_doc): Rename `stream` to `document_records` for clarity.
2493 (tt_face_load_svg_doc): Split `doc` from `doc_list` pointer for clarity.
2494 Test that the document content is contained within the table.
2495 Ensure minimum length of document before testing for gzip format.
2499 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51812
2501 2022-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
2503 [base] Clean up the bitmap flow control.
2505 * src/base/ftbitmap.c (FT_Bitmap_Copy): Flip the copy if its pitch
2506 is trully opposite, zero is not a positive value.
2507 (FT_Bitmap_Convert): Set negative pitch as needed, accept negative
2510 2022-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
2512 [base] Discard and recreate bitmaps for copying and converting.
\r
2514 Reusing target bitmaps for copying and converting is permitted. It is,
\r
2515 however, pointless to preserve their content before overwriting. Free-
\r
2516 malloc might be faster than realloc.
\r
2518 * src/base/ftbitmap.c (FT_Bitmap_Copy, FT_Bitmap_Convert): Free
\r
2519 an old buffer and create a new one.
2521 2022-09-16 Dominik Röttsches <drott@chromium.org>
2523 Reject 'COLR' table if version is 1 but header too small.
2525 * src/sfnt/ttcolr.c (tt_face_load_colr): If the version is determined to
2526 be 1, then the table size has to be at least the size of the v1 header.
2527 Also, for peeking the number of base glyphs and entries in the layer list,
2528 ensure that the table is sufficiently long.
2530 Fixes #1179. Original patch by Sergey Temnikov.
2532 2022-09-15 Werner Lemberg <wl@gnu.org>
2534 * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix format 1 handling.
2538 2022-09-06 Dominik Röttsches <drott@chromium.org>
2540 [truetype] Reject 'fvar' loading when `num_instances` is too small.
2542 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Reject retrieving master when
2543 'fvar' values locally do not match with sanitized values from initialization
2544 at `sfnt_init_face` time.
2548 https://bugs.chromium.org/p/chromium/issues/detail?id=1360295
2550 2022-09-05 Dominik Röttsches <drott@chromium.org>
2552 [sfnt] Handle variable `COLR` v1 fonts without delta set index map
2556 * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Set outer index to
2557 0 and inner index to the delta index when retrieving deltas if the
2558 `COLR` table has no delta set index map.
2560 2022-09-05 Dominik Röttsches <drott@chromium.org>
2562 [sfnt] Pointer sanity checks before reading layer info in 'COLR' v0
2564 * src/sfnt/ttcolr.c (tt_face_get_colr_layer): Check that the pointer to
2565 read from is within the 'COLR' table.
2569 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50633
2571 2022-09-05 Werner Lemberg <wl@gnu.org>
2573 [autofit] Minor fix.
2575 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Avoid
2578 2022-09-05 Dominik Röttsches <drott@chromium.org>
2580 [sfnt] Don't require 'gvar' table to support variation fonts.
2584 * src/sfnt/sfobjs.c (sfnt_load_face): Tag font as Multiple Masters font if
2585 `fvar` is present; do not require other tables to be present.
2587 * src/truetype/ttgxvar.c (tt_set_mm_blend): Allow for a missing 'gvar' table
2588 when setting variation coordinates. However, if a 'gvar' table is actually
2589 present, do perform a sanity check and fail on malformedness.
2590 (TT_Get_MM_Var): Don't assume 'fvar' needs 'gvar' or 'CFF2 tables in all
2591 cases, which is an overly tight check.
2593 2022-08-27 Alexei Podtelezhnikov <apodtele@gmail.com>
2595 * src/base/ftver.rc: Explicitly use UTF-16.
2597 Fixes #1177 to avoid mistranslation and other problems.
2599 2022-08-26 Dominik Röttsches <drott@chromium.org>
2601 [sfnt] Avoid undefined shifts in `COLR` v1 color line retrieval
2603 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): Disambiguate shift
2604 behavior by using multiplication using macros from ftcalc.h.
2606 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50573
2608 2022-08-21 Sean Farrell <sean.farrell@rioki.org>
2610 CMakeLists.txt (FT_ENABLE_ERROR_STRINGS): New configuration option.
2612 This option uncomments FreeType configuration macro
2613 `FT_CONFIG_OPTION_ERROR_STRINGS` to make function `FT_Error_String` return
2614 meaningful error strings.
2616 This option is off by default.
2618 2022-08-21 Chris Liddell <chris.liddell@artifex.com>
2620 [base, type1] Better handling of out-of-memory situations.
2622 This follows similar code in `cff_slot_done`.
2624 * src/base/ftobjs.c (ft_glyphslot_done), src/type1/t1objs.c
2625 (T1_GlyphSlot_Done): Check `internal` pointer.
2627 The Type1 problems was reported as
2629 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50057.
2631 2022-08-06 Tim-Philipp Müller <tim@centricular.com>
2633 ci: bump windows image and use newer runner and vs2019
2635 The old 1809 runner will be decommissioned at some point.
2637 2022-08-04 @udoudou <>
2639 * src/cache/ftcmanag.c (FTC_Manager_New): Initialize `cur_weight`.
2643 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
2645 * src/sfnt/ttload.c: Trace formatting updates.
2647 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
2649 * src/psaux/psobjs.c (ps_table_release): Remove redundant casting.
2651 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
2653 * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Reduce casting.
2655 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
2657 [cache] Remove some casts, clean up tracing.
2659 * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup):
2660 Clean up tracing types.
2661 * src/cache/ftccache.c (ftc_node_destroy): Ditto.
2662 * src/cache/ftcmanag.c (FTC_Manager_Check): Ditto.
2663 (FTC_Manager_Check, FTC_Node_Unref): Remove a cast.
2664 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
2666 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com>
2668 [autofit] Updated to reduce casting (cont'd).
2670 * src/autofit/afmodule.h (AF_ModuleRec): Change `default_script` type.
2671 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
2673 * src/autofit/afmodule.c (af_property_{set,get}): Updated accordingly.
2675 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com>
2677 [autofit] Updated to reduce casting.
2679 * src/autofit/afglobal.h (AF_FaceGlobalsRec): Change `glyph_count` type.
2680 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage,
2681 af_face_globals_get_metrics, af_face_globals_is_digit,
2682 af_face_globals_new): Changed local types and updated accordingly.
2683 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Ditto.
2685 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com>
2687 [psaux] Remove unused structure field.
2689 * include/freetype/internal/psaux.h (PS_TableRec): Remove `num_elems`.
2690 * src/psaux/psobjs.c (ps_table_new): Remoove its initialization.
2692 2022-07-30 Dominik Röttsches <drott@chromium.org>
2694 [sfnt] Implement VarClipBox.
2696 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Depending on the
2697 format, read `var_index_base`, then retrieve and apply scaled deltas.
2699 2022-07-30 Dominik Röttsches <drott@chromium.org>
2701 [sfnt] Fix typo in clip box computation.
2703 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Use appropriate
2704 scale factor for `yMin` and `yMax`.
2706 2022-07-30 Alexei Podtelezhnikov <apodtele@gmail.com>
2708 [autofit] Use unsigned accounting for hints.
2710 * src/autofit/afhints.h (AF_AxisHintsRec): Use unsigned types.
2712 * src/autofit/afhints.c (af_axis_hints_new_{segment,edge},
2713 af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset):
2714 Updated accordingly.
2715 * src/autofit/aflatin.c (af_cjk_hints_compute_edges): Ditto.
2716 * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Ditto.
2718 2022-07-30 Alexei Podtelezhnikov <apodtele@gmail.com>
2720 * src/autofit/afhints.h: Remove dead code.
2722 2022-07-29 Werner Lemberg <wl@gnu.org>
2724 * src/base/ftglyph.c (FT_Get_Glyph): Set `*aglyph` to NULL in case of error.
2726 2022-07-29 Werner Lemberg <wl@gnu.org>
2728 Fix compilation if `TT_CONFIG_OPTION_GX_VAR_SUPPORT` is not set.
2730 * src/sfnt/ttcolr.c: Protect relevant code with
2731 `TT_CONFIG_OPTION_GX_VAR_SUPPORT`.
2733 2022-07-29 Werner Lemberg <wl@gnu.org>
2735 Fix clang14 compiler warnings.
2737 * include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE):
2740 * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean
2742 (tt_face_get_colorline_stops): Fix type of `var_index_base`.
2744 2022-07-26 Alexei Podtelezhnikov <apodtele@gmail.com>
2746 [pfr] Fortify the kerning code.
2748 Any array index must be strictly less then the array size. Therefore,
2749 we must reject indexes that are equal to the array size. Alternatively,
2750 we should move the bounds check before the index decrement but that
2753 In addition, it is ok to decrement zero (.notdef) and get UINT_MAX,
2754 which is then automatically rejected in the bounds check.
2756 * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix the bounds checking.
2758 2022-07-26 Werner Lemberg <wl@gnu.org>
2760 [pfr] Add some safety guards.
2762 * src/pfr/pfrload.c (pfr_phy_font_load): Check resolutions and number of
2767 2022-07-26 Werner Lemberg <wl@gnu.org>
2769 * src/pfr/*.c: Trivial improvements and formatting.
2771 2022-07-24 Werner Lemberg <wl@gnu.org>
2773 * configure: s/egrep/grep -E/
2775 `egrep` is deprecated.
2777 2022-07-23 Ben Wagner <bungeman@chromium.org>
2779 [base] Build outlines in amortized constant time.
2781 When resizing the loader's points and contours, resize them to at least 1.5
2782 times their current size. The code currently only reserves as much space as
2783 is currently required, leading to O(n^2) runtime when adding points one at a
2786 This change does not attempt to ever shrink the loader's point and contour
2787 storage since this was not attempted previously either. The 1.5 multiple
2788 was chosen as a trade-off between potentially unused space and the runtime.
2790 * src/base/ftgloader.c (FT_GlyphLoader_CheckPoints): Implement it.
2794 2022-07-09 Dominik Röttsches <drott@chromium.org>
2796 [sfnt] Support variable 'COLR' v1 `PaintVarSkew*`.
2798 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values
2799 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW`,
2800 `FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER`, and
2801 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER`.
2802 (read_paint): Handle new enumeration values.
2804 2022-07-09 Dominik Röttsches <drott@chromium.org>
2806 [sfnt] Support variable 'COLR' v1 `PaintVarRotate*`.
2808 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values
2809 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE` and
2810 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER`.
2811 (read_paint): Handle new enumeration values.
2813 2022-07-09 Dominik Röttsches <drott@chromium.org>
2815 [sfnt] Support 'COLR' v1 variable `PaintVarScale*`.
2817 * src/sfnt/ttcolr.c: (FT_PaintFormatInternal): New enumeration values
2818 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE`,
2819 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER`,
2820 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM`, and
2821 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER`.
2822 (read_paint): Handle new enumeration values.
2824 2022-07-09 Dominik Röttsches <drott@chromium.org>
2826 [sfnt] Support for 'COLR' v1 variable translate.
2828 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration value
2829 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE`.
2830 (read_paint): Handle new enumeration value.
2832 2022-07-09 Dominik Röttsches <drott@chromium.org>
2834 [sfnt] Support for 'COLR' v1 variable transforms.
2836 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration value
2837 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM`.
2838 (read_paint): Handle new enumeration value.
2840 2022-07-09 Dominik Röttsches <drott@chromium.org>
2842 [sfnt] Deltas for 'COLR' v1 gradient coordinates.
2844 * src/sfnt/ttcolr.c (read_paint) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Read and
2845 apply deltas to radial, linear, and sweep gradient coordinates such as 'p0',
2846 'p1', 'p2', 'center', 'radii', and 'angles'.
2848 2022-07-08 Dominik Röttsches <drott@chromium.org>
2850 [sfnt] Support variable 'COLR' v1 color lines.
2852 * include/freetype/ftcolor.h (FT_ColorStopIterator): Add field
2853 `read_variable` to indicate whether a variation index base should be read.
2855 * src/sfnt/ttcolr.c: (FT_PaintFormat_Internal): New enumerations
2856 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT`
2857 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT`, and
2858 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT`.
2859 (read_color_line): New parameter `read_variable`; update callers.
2860 (read_paint): Handle new enumerations.
2862 2022-07-07 Dominik Röttsches <drott@chromium.org>
2864 [sfnt] Apply variation deltas to `PaintVarSolid`.
2866 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal_): New enumeration
2867 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID`.
2869 (get_deltas_for_var_index_base) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New
2870 function to retrieve an array of delta values, which will be used for most
2871 of 'COLR' v1 variation formats (in follow-up commits).
2873 (read_paint): Add `face` parameter; update caller.
2874 Handle `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID`.
2876 2022-07-07 Dominik Röttsches <drott@chromium.org>
2878 [sfnt] Check safety of cast to `TT_Driver` before accessing member.
2880 * src/sfnt/ttcolr.c (VARIABLE_COLRV1_ENABLED): Access
2881 `enable_variable_colrv1` only if driver class matches.
2883 2022-07-06 Stephen Holdaway <stecman@gmail.com>
2885 doc: Clarify description of `FT_Stream_IoFunc`.
2887 The existing documentation comments on `FT_Stream_IoFunc` hinted at the dual
2888 seek/read behavior required for custom stream implementations to work, but
2889 it didn't explicitly explain it. Without looking at the internals of
2890 FreeType, it was easy for someone to assume their implementation should
2891 handle both seek and read operations all the time. If this is done, you get
2892 a variety of errors, but mostly just `Unknown_File_Format` (error code
2895 2022-07-04 Dominik Röttsches <drott@chromium.org>
2897 [sfnt] Load variation store for 'COLR' v1.
2899 * src/sfnt/ttcolr.c: Include `ttobjs.h` temporarily.
2900 (VARIABLE_COLRV1_ENABLED): New temporary macro to detect whether variable
2902 (Colr): New fields `var_store` and `delta_set_idx_map`.
2903 (tt_face_load_colr, tt_face_free_colr) [VARIABLE_COLRV1_ENABLED]: Load and
2904 free variation store data using the functions from the Multiple Masters
2907 2022-07-03 Chris Liddell <chris.liddell@artifex.com>
2909 [base] Improve error handling in `FT_GlyphLoader_CheckPoints`.
2911 If `FT_GlyphLoader_CreateExtra` returns an error (and a couple of other
2912 places), `FT_GlyphLoader_CheckPoints` would propagate the error immediately,
2913 rather than cleaning up the partially set up `FT_GlyphLoader`. As a
2914 consequence, a subsequent attempt to create a glyph could result in a crash.
2916 * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Ensure all the error
2917 conditions exits are consistent, eventually calling `FT_GlyphLoader_Reset`.
2919 2022-07-03 Thomas Sondergaard <thomas@sondergaard.cc>
2921 CMakeLists.txt: Provide both 'freetype' and 'Freetype::Freetype' targets.
2923 FreeType can be located by consuming projects that use
2924 `find_package(Freetype)` either via the old `MODULE` path (which uses
2925 `FindFreetype.cmake` supplied by CMake), or via the new `CONFIG` path (which
2926 uses `freetype-config.cmake` as supplied by this project). Up to this point
2927 the CMake module has supplied the target `Freetype::Freetype` and the config
2928 file provided by this project the target `freetype`. Now we supply both
2929 `freetype` and `Freetype::Freetype` so that consuming projects can always
2930 use the target `Freetype::Freetype` regardless of what path was taken by
2931 `find_package(Freetype)`.
2935 2022-07-02 Werner Lemberg <wl@gnu.org>
2937 include/freetype/ftmm.h: Improve documentation.
2939 2022-07-01 Dominik Röttsches <drott@chromium.org>
2941 [base] Round values in `FT_MulAdd_Fix`.
2943 This avoids regressing Blink layout tests and makes `FT_MulAdd_Fix` delta
2944 retrieval implementation consistent with the previous implementation, which
2945 used `FT_fixedToInt` and included rounding.
2947 * src/base/ftcalc.c (FT_MulAdd_Fix): Implement it.
2948 Also fix remaining `temp` initialization compilation issue.
2952 2022-07-01 Werner Lemberg <wl@gnu.org>
2956 2022-06-30 Dominik Röttsches <drott@chromium.org>
2958 Fix initialisation of temp variable in new FT_MulAddFix
2960 src/truetype/ttgxvar.c (FT_MulAddFix): Initialise `temp`.
2962 2022-06-29 Dominik Röttsches <drott@chromium.org>
2964 [truetype] Perform variation store delta computation with 64-bit precision.
2966 * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Make type
2968 * include/freetype/internal/services/svmm.h
2969 (FT_Var_Get_Item_Delta_Func): Change return type to `FT_ItemVarDelta`
2970 * truetype/ttgxvar.h (tt_var_get_item_delta): Change return type to
2972 * truetype/ttgxvar.c (tt_var_get_item_delta): Store scalars and deltas
2973 to intermediate array, perform computation using new method
2976 2022-06-29 Dominik Röttsches <drott@chromium.org>
2978 New function `FT_MulAddFix` to compute the sum of fixed-point products.
2980 This function, based on the code of `FT_MulFix`, uses 64-bit precision
2981 internally for intermediate computations.
2983 * include/freetype/internal/ftcalc.h, base/ftcalc.c (FT_MulAddFix):
2986 2022-06-22 Werner Lemberg <wl@gnu.org>
2988 CMakeLists.txt: Move inclusion of `FindPkgConfig` down.
2990 It must come after `CMAKE_TOOLCHAIN_FILE`.
2994 2022-06-22 Dominik Röttsches <drott@chromium.org>
2996 [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14
2998 2022-06-21 Alexei Podtelezhnikov <apodtele@gmail.com>
3000 * docs/CHANGES: Announce impending Infinality removal.
3002 2022-06-21 Alexei Podtelezhnikov <apodtele@gmail.com>
3004 * ttgload.c (TT_Process_Composite_Glyph): Fix a signedness warning.
3006 2022-06-21 Werner Lemberg <wl@gnu.org>
3008 s/fixed point/fixed-point/
3010 2022-06-21 Werner Lemberg <wl@gnu.org>
3012 .gitlab-ci.yml: Correctly upgrade `meson`.
3014 2022-06-21 Dominik Röttsches <drott@chromium.org>
3016 Proposal: Feature control for variable COLRv1
3018 * include/freetype/ftdriver.h (variable-color-v1 property): Add documentation
3019 for variable-colr-v1 property.
3020 * src/truetype/ttdriver.c (tt_property_set): Ingest variable-control property
3021 when called, set to enable_variable_colrv1 driver flag.
3022 * src/truetype/ttobjs.h (TT_DriverRec): Add enable_variable_colrv1 flag.
3024 2022-06-21 Xavier Claessens <xavier.claessens@collabora.com>
3026 [meson] Disable FreeType in HarfBuzz fallback.
3028 This avoids cyclic subproject configuration when the 'harfbuzz' feature is
3029 enabled, or `--wrap-mode=forcefallback` is used, but HarfBuzz is built as a
3030 subproject. HarfBuzz does the same and disables HarfBuzz support when
3031 configuring FreeType as a subproject.
3033 * meson.build (harfbuzz_dep): Implement it.
3035 * subprojects/harfbuzz.wrap: New file.
3037 * .gitlab-ci.yml [windows meson]: Use latest version of the meson 0.59
3038 series, which has a necessary bug fix to make CI work.
3040 2022-06-19 Alexei Podtelezhnikov <apodtele@gmail.com>
3042 [truetype] Clean up phantom point accounting.
3044 This formalizes that the phantom points appended in the outline
3045 do not increase its point count, nor are they tagged or included
3046 in any additional contours. Only their coordinates are stored.
3047 They are counted in the glyph zone, however.
3049 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Infer `n_points`
3050 from the outline size plus four phantom points.
3051 * src/truetype/ttgxvar.h (TT_Vary_Apply_Glyph_Deltas): Remove this
3053 * src/truetype/ttgload.c (tt_prepare_zone): Add phantom four.
3054 (TT_Process_Simple_Glyph, load_truetype_glyph): Update all callers.
3056 2022-06-19 Alexei Podtelezhnikov <apodtele@gmail.com>
3058 [truetype/GX] Clean up phantom point adjustment.
3060 This moves phantom point and advance variation adjustment next to
3061 calculations. The logic stays the same, HVAR and VVAR take priority.
3063 * src/truetype/ttgload.c (load_truetype_glyph): Move it from here...
3064 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): ... to here
3065 and check for HVAR and VVAR presence outside the main loop.
3067 2022-06-18 Ben Wagner <bungeman@chromium.org>
3069 [stream] Fix reading s32 when long is s64
3071 `FT_READ_LONG`, `FT_GET_LONG`, and related macros did not return
3072 negative values when `long` is more than 32 bits. `FT_Stream_ReadULong`
3073 would read four bytes into the LSB of an `FT_ULong` and return that.
3074 Since this can never set the MSb of the `FT_ULong` when `FT_ULong` is
3075 more than 32 bits the cast to `FT_Long` never resulted in a negative
3078 Fix this by modifying `FT_Stream_Read*` to return a type of the same
3079 size as the bytes it is reading and changing the `FT_READ_*` and
3080 `FT_GET_*` macros to cast to the same type returned by `FT_Stream_Read*`
3081 but with the correctly signed type (instead of casting to what is
3082 assumed to be the type of `var` which will happen automatically anyway).
3084 There exist a few cases like with the `OFF3` variants where there isn't
3085 generally a type with the correct size. `FT_PEEK_OFF3` works around this
3086 loading the bytes into the three most significant bits and then doing a
3087 signed shift down. `FT_NEXT_OFF3` also already worked correctly by
3088 casting this signed value to another signed type. `FT_Stream_GetUOffset`
3089 works correctly but one must be careful not to attempt to cast the
3090 returned value to a signed type. Fortunately there is only
3091 `FT_GET_UOFF3` and no `FT_GET_OFF3`.
3093 All of these cases are handled correctly when reading values through
3094 `FT_Stream_ReadFields` since it generically computes the signed value
3095 through an `FT_Int32`. This change is essentially doing the same for
3098 * include/freetype/internal/ftstream.h (FT_NEXT_*, FT_GET_*, FT_READ*):
3099 Update macros and return types to use fixed size types for fixed size
3102 * src/base/ftstream.c (FT_StreamGet*, FT_StreamRead*): Dito.
3106 2022-06-17 Alexei Podtelezhnikov <apodtele@gmail.com>
3108 [truetype/GX] Fix an old typo.
3110 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Vertical
3111 advance is measured along y-coordinate.
3113 2022-06-16 Alexei Podtelezhnikov <apodtele@gmail.com>
3115 [truetype/GX] Clean up advance adjustment (Brrr).
\r
3117 * src/truetype/ttgload.c (load_truetype_glyph): Remove remaining code.
3119 2022-06-16 Ben Wagner <bungeman@chromium.org>
3121 [type1] Directly search for eexec in private dict
3123 This code originally just searched for `eexec`. This was later modified
3124 to check that the `eexec` found is valid (not in a string or comment).
3125 This was done by searching for `eexec` as before and then, for each
3126 `eexec` found, searching from the beginning using the correct parsing to
3127 see if the `eexec` was still found. If the private dictionary is large
3128 and contains many copies of `eexec` which are not valid, the initial
3129 part of the private dictionary is scanned once for each, potentially
3130 leading to n^2 parsing time.
3132 Instead of finding an initial `eexec` and then re-parsing to discover if
3133 it is valid, drop the initial search for `eexec` and just parse to find
3134 a valid `eexec`. This is strictly faster since the validation must
3135 happen anyway and avoids restarting from the beginning each time an
3136 `eexec` is found in the data.
3138 * src/type1/t1parse.c (T1_Get_Private_Dict): avoid n^2 parsing
3140 Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1328883
3142 2022-06-16 Alexei Podtelezhnikov <apodtele@gmail.com>
3144 [truetype/GX] Clean up advance adjustment.
3146 * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph):
3147 Move the advance adjustment from here...
3148 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): ... to here and
3150 * src/truetype/ttgxvar.h (TT_Vary_Apply_Glyph_Deltas): Update prototype
3151 with fewer arguments.
3153 2022-06-14 Ben Wagner <bungeman@chromium.org>
3155 [gzip] Handle inflate returning Z_NEED_DICT
3157 When `inflate` returns `Z_NEED_DICT` this is currently not reported as
3158 an error and callers may assume that the decompression succeeded when it
3159 did not. In particular, a compressed table in a woff file may not
3160 actually be decompressed and written as expected, leaving the backing
3161 memory for the expanded table uninitialized.
3163 * src/gzlip/ftgzip.c (FT_Gzip_Uncompress): treat `Z_NEED_DICT` as
3164 indicating invalid data since there is no means to provide a dictionary.
3166 Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335712
3168 2022-06-13 Ben Wagner <bungeman@chromium.org>
3170 [woff] Don't allocate table entries until needed
3172 * src/sfnt/sfwoff.c (woff_open_font): delay allocating space for the
3173 table entries until they are actually written out with the data.
3175 2022-06-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3177 * src/sfnt/sfwoff2.c (woff2_open_font): Partial revert.
3179 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47981.
3181 2022-06-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3183 * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Cosmetic macro change.
3185 2022-06-11 Alexei Podtelezhnikov <apodtele@gmail.com>
3187 [woff, woff2] Avoid buffer zeroing.
3189 * src/sfnt/sfwoff.c (woff_open_font): Use Q-macros.
3190 * src/sfnt/sfwoff2.c: Ditto.
3191 (reconstruct_font): Allocate table_entry on stack.
3193 2022-06-10 Alexei Podtelezhnikov <apodtele@gmail.com>
3195 [smooth] Fix GCC LTO crashes on Windows.
3197 Fixes #1164 by using a volatile variable around `setjmp`. It is hard to
3198 say how this fixes crashes related to certain link-time optimizations.
3199 This does not decrease the rendering performance.
3201 * src/smooth/ftgrays.c (gray_convert_glyph_inner): Use volatile `error`.
3203 2022-06-09 bruvzg <@bruvzg>
3205 * src/smooth/ftgrays.c [FT_STATIC_RASTER]: Fix compilation.
3207 2022-06-06 Ben Wagner <bungeman@chromium.org>
3209 [svg] Set linear advances when loading SVG glyphs
3211 * include/freetype/freetype.h (FT_GlyphSlotRec_): update doc
3212 * src/cff/cffgload.c (cff_slot_load): do it
3213 * src/truetype/ttgload.c (TT_Load_Glyph): do it
3217 2022-06-01 Ben Wagner <bungeman@chromium.org>
3219 [svg] Clear correct flags for doc ownership
3221 This issue was discovered with an SVG based font with some documents
3222 compressed and other uncompressed. After loading the first compressed
3223 document the ownership flag on the glyph slot was set to true but never
3224 set to false. As a result after loading a compressed document a glyph
3225 from an uncompressed document would load fine, but when this glyph slot
3226 was cleared it would try to free its document resulting in a wild free.
3228 * src/base/ftobjs.c (ft_glyphslot_clear): clear correct flags
3232 2022-06-01 Alexei Podtelezhnikov <apodtele@gmail.com>
3234 [docs] Correct favicon.
3236 2022-06-01 Alexei Podtelezhnikov <apodtele@gmail.com>
3238 [docs] Use hinted favicon.
3240 2022-05-27 Alexei Podtelezhnikov <apodtele@gmail.com>
3242 [docs] Update favicon.
3244 2022-05-25 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org>
3246 * src/sfnt/ttmtx.c (tt_face_get_metrics): Apply variations unconditionally.
3248 This causes a speed-up of approx. 20% for getting advance widths.
3250 2022-05-23 Dominik Röttsches <drott@chromium.org>
3252 [truetype] Support reading 32bit/16bit VarStore deltas
3254 * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Define type
3255 to be used for delta arrays, upgrade to FT_long.
3256 * src/truetype/ttgxvar.c: Adhere to long_words bit and read either
3257 Short/Byte pairs or Long/Short pairs, as defined by spec. For better
3258 readability, define macro for repetitive read code.
3260 2022-05-20 Dominik Röttsches <drott@chromium.org>
3262 [truetype] Handle 0xFFFF special value inside delta retrieval function
3264 * truetype/ttgxvar.c (tt_hvadvance_adjust, tt_apply_mvar,
3265 tt_var_get_item_delta): Remove special 0xFFFF handling in favor of less
3266 redundant handling inside the tt_var_get_item_delta function, as it is
3267 equivalent to returning a 0 delta. Avoids code-duplication checking for
3268 special value 0xFFFF.
3270 2022-05-19 Dominik Röttsches <drott@chromium.org>
3272 [truetype, snft] Add service methods for `DeltaSetIdxMap` and `VarStore`.
3274 This will be needed for 'COLR' v1 variation support.
3276 * src/truetype/ttgxvar.h (GX_ItemVarData, GX_AxisCoords, GX_VarRegion,
3277 GX_VarItemStore, GX_DeltaSetIdxMap): Move structures to...
3278 * include/freetype/internal/ftmmtypes.h: ... this new file.
3280 * include/freetype/internal/service/svmm.h (MultiMasters): Include
3282 (FT_Var_Load_Delta_Set_Idx_Map_Func, FT_Var_Load_Item_Var_Store_Func,
3283 FT_Var_Get_Item_Delta_Func, FT_Var_Done_Item_Var_Store_Func,
3284 FT_Var_Done_Delta_Set_Idx_Map_Func): New function typedefs.
3285 (MultiMasters): Add them.
3286 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
3288 * src/cff/cffdrivr.c (cff_load_item_variation_store,
3289 cff_load_delta_set_index_mapping, cff_get_item_delta,
3290 cff_done_item_variation_store, cff_done_delta_set_index_map): New wrapper
3291 methods calling into mm service.
3292 (cff_service_multi_masters): Updated.
3294 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store,
3295 ft_var_load_delta_set_index_mapping, ft_var_get_item_delta,
3296 ft_var_done_item_variation_store, ft_var_done_delta_set_index_map): Renamed
3298 (tt_var_load_item_variation_store, tt_var_load_delta_set_index_mapping,
3299 tt_var_get_item_delta, tt_var_done_item_variation_store,
3300 tt_var_done_delta_set_index_map): ... this for consistency.
3301 Mark them as non-static.
3302 * src/truetype/ttgxvar.h: Add corresponding prototypes.
3304 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
3306 * src/type1/t1driver.c (t1_service_multi_masters): Updated.
3308 2022-05-19 Dominik Röttsches <drott@chromium.org>
3310 [truetype] Move deallocation of `DeltaSetIdxMap` into own function.
3312 This is a preparation for handling `DeltaSetIdxMap` and `VarStore` as a
3315 * src/truetype/ttgxvar.c (ft_var_done_delta_set_index_map): New function.
3316 (tt_done_blend): Use it.
3318 2022-05-18 Werner Lemberg <wl@gnu.org>
3320 * builds/toplevel.mk (do-dist): Don't remove meson wrap files.
3324 2022-05-18 Werner Lemberg <wl@gnu.org>
3326 * subprojects/zlib.wrap: Update to zlib version 1.2.12.
3328 2022-05-18 Werner Lemberg <wl@gnu.org>
3330 REAMDE: Mention that gitlab's 'download' button doesn't work.
3332 This is because the `git archive` command doesn't preserve submodules.
3334 Note that currently there is no support for disabling the 'download' button
3335 in gitlab (https://gitlab.com/gitlab-org/gitlab/-/issues/17032).
3339 2022-05-11 Werner Lemberg <wl@gnu.org>
3341 [truetype] Handle inner/outer index values 0xFFFF/0xFFFF.
3343 This was introduced in OpenType 1.8.4.
3345 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping,
3346 tt_hvadvance_adjust, ft_var_load_mvar, tt_apply_mvar): Handle special
3347 inner/outer index values.
3348 (ft_var_load_item_variation_store): Add test.
3352 2022-05-01 Werner Lemberg <wl@gnu.org>
3354 * Version 2.12.1 released.
3355 ==========================
3357 Tag sources with `VER-2-12-1'.
3359 * docs/VERSION.TXT: Add entry for version 2.12.1.
3360 * docs/CHANGES, docs/release: Updated.
3362 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
3363 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
3364 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
3365 docs/freetype-config.1: s/2.12.0/2.12.1/, s/2120/2121/.
3367 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
3369 * builds/unix/configure.raw (version_info): Set to 24:3:18.
3370 * CMakeLists.txt (VERSION_PATCH): Set to 1.
3372 2022-04-30 Anuj Verma <anuj@posteo.net>
3374 [sdf] Do not throw errors for invisible glyphs.
3376 * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Return `FT_Err_Ok` if
3377 width or height is zero, since some glyphs do not generate visible bitmaps.
3381 2022-04-30 Werner Lemberg <wl@gnu.org>
3383 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_COLOR` for SVG fonts.
3387 2022-04-27 Brendan Shanks <bshanks@codeweavers.com>
3389 autogen.sh: Fix building when freetype is itself a git submodule.
3391 There are situations where .git is not a directory, like when
3392 freetype is a submodule in another repository.
3394 2022-04-26 Alexei Podtelezhnikov <apodtele@gmail.com>
3396 [builds/windows] Simplify non-desktop UWP check.
3398 Fixes mingw compilation described in !159.
3400 * builds/windows/ftsystem.c: Do not use WINAPI_FAMILY_PARTITION macro.
3402 2022-04-25 Alexei Podtelezhnikov <apodtele@gmail.com>
3404 [truetype] Reset IUP flags in `TT_RunIns`.
3406 Fixes #1148 by moving the flag initialization back, partly reverting
3407 7809007a and fd03dcc1. Initializing these flags elsewhere skips 'cvt'.
3409 * src/truetype/ttinterp.c (TT_RunIns): Initialize the IUP flag here...
3410 (TT_Run_Context): ... instead of here.
3412 2022-04-24 Xavier Claessens <xavier.claessens@collabora.com>
3414 [meson] Remove `default_library=both` from `default_options`.
3416 It is inconsistent with what all other Meson projects do.
3418 It also prevents static linking to FreeType when it is a subproject because
3419 `default_options` in a subproject takes precedence on values set on the main
3420 project. For example, building 'GStreamer' with `-Ddefault_library=static`
3421 would still dynamically link on FreeType unless the user also sets
3422 `-Dfreetype2:default_library=static`.
3424 * meson.build: Updated.
3426 * .gitlab-ci.yml: Retain `both` option for testing.
3428 2022-04-19 Werner Lemberg <wl@gnu.org>
3430 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Integer overflow.
3434 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46792
3436 2022-04-16 Georg Brandl <georg@python.org>
3438 * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]: Fix segfault.
3440 This can happen if the function is called with `size` being `NULL`.
3444 2022-04-14 Steve Lhomme <robux4@ycbcr.xyz>
3446 .gitlab-ci.yml: Add a Universal Windows build target
3448 It's compiled for Windows 10 and up, ensuring UNICODE is set (default for UWP)
3449 and selecting the proper WINAPI_FAMILY (WINAPI_FAMILY_APP).
3451 Do not try to run the UWP exe in the Docker as it doesn't work.
3453 2022-04-04 Ben Wagner <bungeman@chromium.org>
3455 [sfnt] Correct FT_ColorStopIterator documentation.
3457 * include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not
3458 set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and
3459 `num_color_stops` are set by `FT_Get_Paint`. `p` and
3460 `current_color_stop` are updated by `FT_Get_Colorline_Stops`.
3462 2022-04-01 Werner Lemberg <wl@gnu.org>
3464 * builds/unix/configure.raw: Add option `--with-librsvg`.
3466 Since 'librsvg' is written in Rust, this option allows distributions to
3467 avoid a dependency on the entire Rust toolchain to provide the FreeType demo
3470 Suggested by Lars Wendler in !156.
3472 2022-04-01 Werner Lemberg <wl@gnu.org>
3474 * src/sfnt/sfwoff.c (reconstruct_glyf): Fix gcc 10 warning.
3476 2022-04-01 Werner Lemberg <wl@gnu.org>
3478 [gzip] Update sources to zlib 1.2.12.
3480 2022-04-01 Eric Jing <@CPUcontrol>
3482 CMakeLists.txt: Fix `Info.plist` path.
3484 When building a framework using CMake with `add_subdirectory`, CMake must be
3485 able to find `freetype-Info.plist` when configuring the framework
3490 2022-04-01 Werner Lemberg <wl@gnu.org>
3494 2022-04-01 Ben Wagner <bungeman@chromium.org>
3496 [truetype] Use SUB_LONG for component offset.
3498 * src/truetype/ttgload.c (TT_Process_Composite_Component): do it.
3500 Bug: https://crbug.com/1309429
3502 2022-03-31 Werner Lemberg <wl@gnu.org>
3504 CMakeList.txt: Update code to handle recent changes for `freetype.pc`.
3508 2022-03-31 Werner Lemberg <wl@gnu.org>
3510 CMakeLists.txt: s/PKG_CONFIG/PKGCONFIG/, s/REQUIRED_/REQUIRES_/.
3512 2022-03-31 Werner Lemberg <wl@gnu.org>
3514 * Version 2.12.0 released.
3515 ==========================
3517 Tag sources with `VER-2-12-0'.
3519 * docs/VERSION.TXT: Add entry for version 2.12.0.
3520 * docs/CHANGES, docs/release: Updated.
3522 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
3523 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
3524 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
3525 docs/freetype-config.1: s/2.11.1/2.12.0/, s/2111/2120/.
3527 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12.
3528 (FREETYPE_PATCH): Set to 0.
3530 * builds/unix/configure.raw (version_info): Set to 24:2:18.
3531 * CMakeLists.txt (VERSION_MINOR): Set to 12.
3532 (VERSION_PATCH): Set to 0.
3534 * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits
3535 since version 2.11.0 (when we stopped creating this file manually).
3537 2022-03-31 Werner Lemberg <wl@gnu.org>
3539 Fix clang++ warnings.
3541 * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c
3542 (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new),
3543 src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW),
3544 src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c
3545 (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize
3546 variables used for allocation.
3548 * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of
3549 `max_splits` to FT_UInt.
3550 (sdf_generate_bounding_box): Add cast.
3552 2022-03-30 Werner Lemberg <wl@gnu.org>
3556 2022-03-30 Werner Lemberg <wl@gnu.org>
3558 [builds] Fix creation of `freetype2.pc` for static-only builds.
3560 We have to help `pkg-config` since it can't recognize that there is no
3561 shared library installed.
3563 Note that meson already does exactly the same.
3565 * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to...
3566 (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them
3567 depending on `$enable_shared`.
3568 (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables.
3570 * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated
3573 2022-03-25 Werner Lemberg <wl@gnu.org>
3575 Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`.
3577 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY,
3578 FT_HAS_SBIX_OVERLAY): New macro.
3580 * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`.
3581 Remove obsolete tracing message.
3583 2022-03-25 Werner Lemberg <wl@gnu.org>
3585 Add `FT_PARAM_TAG_IGNORE_SBIX`.
3587 This is another bit to handle 'sbix' tables as described in the OpenType
3590 * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro.
3592 * src/sfnt/sfobjc.c (is_apple_sbix): Rename to...
3593 (has_sbix): ... this.
3594 Check for more sbit tables.
3595 Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`.
3596 Only call sbit table loader if an sbit table is present.
3598 2022-03-25 Werner Lemberg <wl@gnu.org>
3600 [truetype] Fix 'sbix' table handling.
3602 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of
3603 'metrics->horiBearingY'.
3604 Set vertical metrics.
3606 * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`.
3607 Handle metrics of fonts with 'sbix' table.
3609 * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply
3610 bbox offset and bearing values of the corresponding glyph in the 'glyf'
3611 table if it exists and has a contour.
3613 * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table.
3617 2022-03-25 Werner Lemberg <wl@gnu.org>
3619 Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`.
3621 Fonts with 'sbix' tables need special handling by the application.
3623 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros.
3625 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix'
3628 2022-03-25 Werner Lemberg <wl@gnu.org>
3630 * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public.
3632 2022-03-24 Carlo Bramini <carlo.bramix@libero.it>
3634 [builds/windows] Fix WCE support.
3636 * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by
3639 2022-03-24 Steve Lhomme <robux4@ycbcr.xyz>
3641 [build/windows] Improve UWP support.
3643 * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA.
3645 2022-03-21 Werner Lemberg <wl@gnu.org>
3647 * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table.
3651 2022-03-20 Ben Wagner <bungeman@chromium.org>
3653 [woff2] Support overlap flag for simple glyphs.
3655 In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag
3656 to be retained through the woff2 format [0].
3658 [0] https://www.w3.org/TR/WOFF2/#glyf_table_format
3660 * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag.
3662 * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and
3663 overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's
3664 flag if the overlap bit is set.
3666 2022-03-19 Werner Lemberg <wl@gnu.org>
3668 [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`.
3670 * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro.
3671 (cff_slot_load): Use it.
3673 2022-03-19 Werner Lemberg <wl@gnu.org>
3675 * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`.
3679 2022-03-19 Werner Lemberg <wl@gnu.org>
3681 * src/base/ftobjs.c (ft_open_face_internal): Thinko.
3683 2022-03-19 Ben Wagner <bungeman@chromium.org>
3685 [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3.
3687 * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
3689 2022-03-19 Werner Lemberg <wl@gnu.org>
3691 * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`.
3693 We must ensure that the cast to `FT_Int` doesn't change the sign.
3697 2022-03-17 Werner Lemberg <wl@gnu.org>
3699 [sfnt] Avoid invalid face index.
3703 * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font):
3704 Check `face_index` before decrementing.
3706 2022-03-07 Werner Lemberg <wl@gnu.org>
3708 Documentation, whitespace.
3710 2022-03-05 Anuj Verma <anuj@womp.xyz>
3712 [sdf] Fix corner checks and improve performance.
3714 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if
3715 two distances (for different curves) are very close.
3717 (sdf_conic_to): Check whether the conic curve can be treated as a line
3718 (which happens if the control point coincides with any end point).
3720 2022-03-05 Anuj Verma <anuj@womp.xyz>
3722 [sdf] Implement deviation-based splitting for Bezier curves.
3724 * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure
3725 out the deviation of Bezier curves and stop splitting if the curve is flat
3728 * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro.
3730 2022-03-05 Anuj Verma <anuj@womp.xyz>
3732 * include/freetype/freetype.h: Improve SDF documentation.
3734 2022-03-03 Ben Wagner <bungeman@chromium.org>
3736 [sfnt] Fix bounds check in SVG.
3738 The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not
3739 protected by parentheses. As a result, the expression
3740 `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to
3741 `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected
3742 `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect
3743 bounds check which may lead to reading past the end of the `SVG ` table.
3745 * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in
3748 Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179
3750 2022-02-23 Ben Wagner <bungeman@chromium.org>
3752 [psaux] Full bounds check for OtherSubr 19.
3754 It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is
3755 NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with
3756 `blend->num_designs` set to 2, and the user supplied `idx` to be large (for
3757 example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds
3758 check overflows in a well defined manner, allowing for an invalid call to
3761 In addition, it is possible to call OtherSubr 19 with
3762 `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying
3763 that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes
3764 the bounds check (it is logically always fine to copy nothing starting at
3765 index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed
3766 by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is
3767 undefined behavior (even if `count` is zero).
3769 * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that
3770 `blend->num_designs` can be copied to `decoder->buildchar[idx]`.
3771 Also avoid passing NULL to `ft_memcpy`.
3773 Bug: https://crbug.com/1299259
3775 2022-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
3777 [cmake] Drop the support of CMake 2.x.
3779 * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer.
3781 The issue #1059 reports the difficulty to support both of
3782 CMake 2.x and newer one by single CMakeLists.txt without
3783 the inflation of cmake_policy() workarounds.
3785 For better maintainability, the support of CMake 2.x is
3788 2022-02-19 Werner Lemberg <wl@gnu.org>
3790 * src/bdf/README: Updated.
3792 2022-02-19 Werner Lemberg <wl@gnu.org>
3794 * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|.
3796 2022-02-19 Werner Lemberg <wl@gnu.org>
3798 src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.
3800 A kerning table can be handled by binary search if it has equal entries.
3804 2022-02-17 Steve Lhomme <robux4@ycbcr.xyz>
3805 Alexei Podtelezhnikov <apodtele@gmail.com>
3807 [builds/windows] Add support for legacy UWP builds.
3809 * builds/windows/ftsystem.c: Add neccessary macro substitutions to
3810 enable strict UWP builds.
3814 2022-02-16 Werner Lemberg <wl@gnu.org>
3816 ftmm.h: Minor documentation improvement.
3818 2022-02-13 Alexei Podtelezhnikov <apodtele@gmail.com>
3820 [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value.
3822 Before the change, the hinting engine frequently confused horizontal
3823 stem and serif hints making some stems too thin and some serifs too
3824 thick. The value was tuned using serif fonts from the URW+ base 35
3827 * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/.
3829 2022-02-12 Werner Lemberg <wl@gnu.org>
3831 t1tables.h: Documentation improvements.
3833 2022-02-12 Werner Lemberg <wl@gnu.org>
3835 t1tables.h: Whitespace.
3837 2022-02-11 Werner Lemberg <wl@gnu.org>
3839 [type42] Fix `FT_Get_PS_Font_Private` for this format.
3841 Since Type42 fonts don't have a 'Private' dictionary, the return value
3842 should be `FT_Err_Invalid_Argument`.
3844 * src/type42/t42drivr.c (t42_ps_get_font_private): Removed.
3845 (t42_service_ps_info): Updated.
3847 2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
3849 [pshinter] Clear reused mask.
\r
3851 In PS hinter, memory allocations persist until the module is done.
\r
3852 Therefore, we have to clear reused masks.
\r
3854 * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask.
3856 2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
3858 [pshinter] Use unsigned indices.
\r
3860 This reduces casting and eliminates some checks.
\r
3862 * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge,
\r
3863 ps_dimension_add_t1stem, ps_hints_t1stem3): Updated.
\r
3864 (ps_dimension_add_counter): Updated, unnecessary checks removed.
\r
3866 2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
3868 [pshinter] Fix mask merging.
3870 We forgot to update the number of bits when merging a larger mask
3871 into a smaller one. This fix might have rendering effects.
3873 * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number
3874 of bits from a larger mask. There is no need to zero unused bits,
3875 already zeroed during allocation.
3876 (ps_mask_clear_bit): Removed.
3877 (ps_mask_ensure): Minor.
3879 2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
3881 [pshinter] Revise the hint table handling.
\r
3883 * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size
\r
3884 check; avoid array zeroing because it is fully initialized when used.
\r
3885 (ps_hint_table_alloc): Fix off-by-one comparison and remove another
\r
3886 zeroing of the array elements.
\r
3888 2022-02-06 Werner Lemberg <wl@gnu.org>
3890 Various minor doc fixes.
3892 2022-02-06 Alexei Podtelezhnikov <apodtele@gmail.com>
3894 [builds/windows] Add SVG to to project files.
3896 * builds/windows/vc2010/freetype.vcxproj: Updated.
3897 * builds/windows/vc2010/freetype.vcxproj.filters: Updated.
3898 * builds/windows/visualc/freetype.vcproj: Updated.
3900 2022-02-03 Alexei Podtelezhnikov <apodtele@gmail.com>
3902 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources.
3904 2022-02-02 Eric Jing <@CPUcontrol>
3906 [cmake] Fix build on MacOS.
3908 * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building
3909 of a framework on MacOS.
3911 * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier
3916 2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com>
3918 [psaux] Revise `PS_Table` handling.
3920 The old impleemntation was not using `FT_REALLOC`, buing too careful
3921 with the offset rebasing. It shoudl be safe to rely on the base
3924 * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine
3926 (ps_table_realloc): ... this function based on `FT_REALLOC`.
3927 (ps_table_done): Simplified.
3928 (ps_table_add): Updated.
3930 2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com>
3932 * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing.
3934 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
3936 [cache] Partially revert 9870b6c07e2c.
\r
3938 Fix crashes reported by Werner.
\r
3940 * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again.
3942 2022-01-31 Werner Lemberg <wl@gnu.org>
3944 freetype.h: Minor documentation improvement.
3946 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
3948 [cache] Fix fallouts from edd4fedc5427.
3952 * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph.
3953 * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit.
3955 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
3957 Clean-up - do not doubt FT_FREE.
3959 * src/base/ftobjs.c (memory_stream_close): Do not reassign zero
3961 * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto.
3962 * src/sfnt/sfwoff2.c (stream_close): Ditto.
3963 * src/psaux/psobjs.c (ps_parser_load_field): Ditto.
3964 * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend,
3965 tt_set_mm_blend): Ditto.
3967 2022-01-30 Werner Lemberg <wl@gnu.org>
3969 * CMakeLists.txt: Include 'FindPkgConfig' module.
3971 Older cmake versions don't provide `pkg_check_modules` by default.
3975 2022-01-30 Alexei Podtelezhnikov <apodtele@gmail.com>
3977 * src/psaux/psobjs.c (ps_parser_load_field): Reduce `string` scope.
3979 2022-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
3981 [cmake] Check the availability of `bzip2.pc'.
3983 (CMakeLists.txt): Check the availability of `bzip2.pc'.
3985 * If `bzip2.pc' is available, Requires.private should include
3986 bzip2, but Libs.private should not include -lbz2.
3988 * If `bzip2.pc' is unavailable, Requires.private cannot include
3989 bzip2, but Libs.private should include -lbz2.
3993 2022-01-28 Werner Lemberg <wl@gnu.org>
3995 * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer.
3997 Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`.
3999 2022-01-28 Alexei Podtelezhnikov <apodtele@gmail.com>
4003 * src/base/ftrfork.c (raccess_make_file_name): Do not set error.
4004 * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto.
4005 * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error.
4006 * src/psaux/psobjs.c (ps_table_done): Ditto.
4007 * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto.
4009 2022-01-27 Ben Wagner <bungeman@chromium.org>
4011 Document `FT_Outline_Decompose` degenerate segments.
4013 `FT_Outline_Decompose` does not filter out and can return degenerate
4014 segments in an outline. This can be surprising when attemping to
4015 stroke such an outline. Clarify the existing documentation on this
4016 matter to cover all forms of degeneracy (without specifying exactly
4017 how they will be reported), why they might arise, and better explain in
4018 what cases they may be an issue.
4020 * include/freetype/ftoutlin.h (FT_Outline_Decompose): update
4025 2022-01-27 Anuj Verma <anujv@posteo.net>
4027 Fix sdf computation while `USE_SQUARED_DISTANCES`.
4029 Function `map_fixed_to_sdf` expects spread to be absolute
4032 * src/sdf/ftbsdf.c (finalize_sdf): Pass absolute spread
4033 while `map_fixed_to_sdf`.
4035 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Ditto.
4037 2022-01-27 Tapish Ojha <tapishojha2000@gmail.com>
4039 [sfnt] Improve sRGB constants.
4041 * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly
4042 more precise values.
4046 2022-01-27 Werner Lemberg <wl@gnu.org>
4048 docs/release: Updated.
4050 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4052 * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY.
4054 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4056 * src/sdf/ftsdf.c (sdf_*_new): Use standard macro.
4058 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4060 [pcf] Delay encoding allocation and avoid its zeroing.
4062 * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY.
4064 2022-01-25 Werner Lemberg <wl@gnu.org>
4068 2022-01-25 Werner Lemberg <wl@gnu.org>
4070 freetype.h: More updates to `FT_LOAD_COLOR` description.
4072 2022-01-25 Werner Lemberg <wl@gnu.org>
4074 * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`.
4076 This helps in decoupling library support from `pkg-config` for other
4079 2022-01-25 Werner Lemberg <wl@gnu.org>
4081 Update documentation for `FT_LOAD_COLOR`.
4083 2022-01-24 Ben Wagner <bungeman@chromium.org>
4085 [pshinter] Ensure all point flags are initialized.
4087 Only off curve point flags were fully initialized.
4089 * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags.
4091 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930
4093 2022-01-24 Werner Lemberg <wl@gnu.org>
4097 2022-01-23 Werner Lemberg <wl@gnu.org>
4099 * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.
4101 2022-01-23 Werner Lemberg <wl@gnu.org>
4105 2022-01-23 Werner Lemberg <wl@gnu.org>
4107 More documentation on handling OT-SVG.
4109 2022-01-23 Werner Lemberg <wl@gnu.org>
4111 * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency.
4113 2022-01-22 Werner Lemberg <wl@gnu.org>
4115 [sfnt] Reject malformed SVG tables.
4117 * src/sfnt/ttsvg.c (SVG_TABLE_HEADER_SIZE, SVG_DOCUMENT_RECORD_SIZE,
4118 SVG_DOCUMENT_LIST_MINIMUM_SIZE, SVG_MINIMUM_SIZE): New macros.
4119 (tt_face_load_svg): Check offsets.
4120 Check table and record sizes.
4124 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43918
4126 2022-01-22 Alexei Podtelezhnikov <apodtele@gmail.com>
4128 * src/psaux/psobjs.c (ps_table_new): Revert to zeroing.
4130 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4132 [psaux, type1, type42] Avoid annecessary zeroing.
4134 * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY.
4135 * src/type1/t1load.c (parse_encoding): Ditto.
4136 * src/type42/t42parse.c (t42_parse_encoding): Ditto.
4138 2022-01-20 Werner Lemberg <wl@gnu.org>
4140 [builds/unix] Handle 'librsvg' for demo programs.
4142 * builds/unix/configure.raw: Check for 'librsvg'.
4143 (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on...
4144 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
4146 * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by...
4147 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
4149 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
4151 Add 'svg' module for OT-SVG rendering.
4153 * CMakeLists.txt (BASE_SRCS): Add svg module file.
4154 * meson.build (ft2_public_headers): Add `otsvg.h`.
4156 * modules.cfg (RASTER_MODULES): Add `svg` module.
4158 * builds/meson/parse_modules_cfg.py: Add svg module.
4160 * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`.
4161 * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and
4162 `Missing_SVG_Hooks` error codes.
4163 * include/freetype/internal/fttrace.h: Add tracing for `otsvg`.
4164 * include/freetype/internal/svginterface.h: New file. It adds an interface
4165 to enable the presetting hook from the `base` module.
4166 * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func,
4167 SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering.
4168 (SVG_RendererHooks): New structure to access them.
4170 * src/base/ftobjs.c: Include `svginterface.h`.
4171 (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG
4173 (ft_add_renderer): Updated.
4175 * src/svg/*: New files.
4177 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
4179 Add `FT_Glyph` support for OT-SVG glyphs.
4181 * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure.
4183 * src/base/ftglyph.c: Include `otsvg.h`.
4184 (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy,
4185 ft_svg_glyph_transform, ft_svg_glyph_prepare): New function.
4186 (ft_svg_glyph_class): New class.
4187 (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs.
4188 * src/base/ftglyph.h: Updated.
4190 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
4192 [truetype, cff] Add code to load SVG document.
4194 * src/cff/cffgload.c (cff_slot_load): Add code to load SVG doc.
4195 * src/truetype/ttgload.c (TT_Load_Glyph): Add code to load SVG doc.
4197 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
4199 Add code to load OT-SVG glyph documents.
4201 * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro.
4202 * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros.
4203 (FT_LOAD_SVG_ONLY): New internal macro.
4204 * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value
4205 `FT_GLYPH_FORMAT_SVG`.
4206 * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro.
4207 * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`.
4208 * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New
4210 * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for
4212 * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the
4213 SVG document and other necessary information of an OT-SVG glyph in a glyph
4215 * include/freetype/tttags.h (TTAG_SVG): New macro.
4217 * src/base/ftobjs.c: Include `otsvg.h`.
4218 (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other`
4219 if the SVG table exists.
4220 (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed
4222 (ft_glyphslot_done): Free the document data if it is a GZIP compressed
4224 (FT_Load_Glyph): Don't auto-hint SVG documents.
4226 * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for
4227 FT_GLYPH_FORMAT_SVG.
4229 * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`.
4230 * src/sfnt/sfdriver.c: Include `ttsvg.h`.
4231 (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and
4232 `tt_face_load_svg_doc`.
4233 * src/sfnt/sfnt.c: Include `ttsvg.c`.
4234 * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and
4235 free data of the the SVG table.
4236 * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`,
4237 `tt_face_free_svg` and `tt_face_load_svg_doc`.
4238 * src/sfnt/ttsvg.h: Declarations of the SVG functions in
4241 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
4243 Add flag `FT_CONFIG_OPTION_SVG`.
4245 This flag is going to be used to conditionally compile support for OT-SVG
4246 glyphs. FreeType will do the parsing and rely on external hooks for
4247 rendering of OT-SVG glyphs.
4249 * devel/ftoption.h, include/freetype/config/ftoption.h
4250 (FT_CONFIG_OPTION_SVG): New flag.
4252 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4254 [pshinter] Avoid unnecessary zeroing.
\r
4256 * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init,
\r
4257 psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY.
4259 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4261 * include/freetype/freetype.h: Clarify `FT_Size` life cycle.
4263 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4265 [base] Undefined scale means no scale.
4267 It might be surprising that FreeType does not have default ppem and
4268 the size has to be set explicitly or face undefined behavior with
4269 undefined variables and errors. This offers an alternative to
4270 missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined
4271 behavior is bettr than undefined one.
4273 This is alternative to !132 and discussed in
4274 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708
4276 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale.
4277 * include/freetype/freetype.h: Document it.
4279 2022-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
4281 * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.
4283 Everything in AF_FaceGlobals is initialized except metrics. Those
4284 are zeroed here and initialized on demand later.
4286 2022-01-16 Alexei Podtelezhnikov <apodtele@gmail.com>
4288 [bdf,type1] Avoid unnecessary hash zeroing.
4290 * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`.
4291 * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`.
4293 2022-01-16 Ozkan Sezer <sezeroz@gmail.com>
4295 Add Watcom C/C++ calling.
4297 In the unlikely case the source is built with OpenWatcom's -ec?
4298 switches to enforce a calling convention, the qsort() compare
4299 function must still be set to __watcall.
4301 * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF):
4304 2022-01-15 Ben Wagner <bungeman@chromium.org>
4306 [pshinter] Avoid accessing uninitialized zone.
4308 The `normal_top.count` may be 0, implying no `normal_top.zones` exist.
4309 The code must not access these (non-existent) `normal_top.zones`.
4311 * src/pshinter/pshalgo.c (ps_hints_apply): Do not assume that
4312 `normal_top.zones[0]` is initialized. Test `normal_top.count`
4313 before using `normal_top.zones[0]`. Do not rescale if there are no
4316 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43675
4318 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
4320 [cache] Avoid unnecessary zeroing.
4322 * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`.
4323 * src/cache/ftcimage.c (FTC_INode_New): Ditto.
4324 * src/cache/ftcsbits.c (FTC_SNode_New): Ditto.
4326 2022-01-15 Ozkan Sezer <sezeroz@gmail.com>
4328 Add Watcom C/C++ support.
4330 * include/freetype/config/integer-types.h: Make sure `long long` is
4331 used then available.
4332 * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
4334 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
4336 * src/sdf/ftbsdf.c (ED): s/near/prox/.
4338 This works around the Watcom C definition of `near` as restricted
4341 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
4343 * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten.
4345 This works around Watcom C library using __watcall.
4347 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
4349 * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing.
4351 This large allocation is followed by careful initialization. Whatever
4352 is missed should be initialized manually.
4354 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
4356 * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing.
4358 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
4360 * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment.
4362 2022-01-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4364 * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing.
4366 2022-01-13 Ben Wagner <bungeman@chromium.org>
4368 [bzip2] Reset bzip stream on any error.
4370 According to the bzip documentation it is undefined what will happen if
4371 `BZ2_bzDecompress` is called on a `bz_stream` it has previously returned an
4372 error against. If `BZ2_bzDecompress` returns anything other than `BZ_OK`
4373 the only valid next action is `BZ2_bzDecompressEnd`.
4377 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564
4379 * src/bzip2/ftbzip2.c (FT_BZip2FileRec_): Add `reset` to track the need to
4381 (ft_bzip2_file_init): Initialize `reset` to 0.
4382 (ft_bzip2_file_reset): Set `reset` to 0 after resetting.
4383 (ft_bzip2_file_fill_output): Set `reset` to 1 when `BZ2_bzDecompress`
4384 returns anything other than `BZ_OK`.
4386 2022-01-12 Werner Lemberg <wl@gnu.org>
4388 .gitlab-ci.yml: Minor comment cleanups.
4390 2022-01-12 Azamat H. Hackimov <azamat.hackimov@gmail.com>
4392 .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA.
4394 Fetch current list of valid CAs from Windows Update and manually import them
4395 to trusted datastore. This action is required to make downloads work from
4396 sites that need recent Let's Encrypt ISRG Root X1 certificate.
4398 2022-01-11 Ben Wagner <bungeman@chromium.org>
4400 Revert "[bzip2] Avoid use of uninitialized memory."
4402 This reverts commit d276bcb7f0c02c20d3585b2e5626702df6d140a6.
4404 The original commit did avoid the use of uninitialized memory. However,
4405 it appears that the original commit is no longer required. The
4406 underlying issue was resolved by a change in freetype2-testing "Build
4407 bzip2 correctly." [0]. Prior to [0] bzip2 was built without msan, so
4408 bzip2 writes were not tracked or considered initialized. Clearing
4409 `buffer` in the original commit allowed msan to see the `buffer` content
4410 initialized once in FreeType code, but msan saw no writes into buffer
4411 from bzip2. With bzip2 now built with msan, the bzip2 writes are
4412 properly instrumented and msan sees the bzip2 writes into the buffer. As
4413 a result the original commit can be safely reverted to allow for better
4414 detection of other uninitialized data scenarios.
4416 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Revert to using `FT_QNEW`.
4418 [0] https://github.com/freetype/freetype2-testing/commit/3c052a837a3c960709227a0d6ddd256e87b88853
4420 2022-01-11 Ben Wagner <bungeman@chromium.org>
4422 [type42] Track how much type42 ttf data is available.
4424 Currently `T42_Open_Face` eagerly allocates 12 bytes for the ttf header
4425 data which it expects `t42_parse_sfnts` to fill out from /sfnts data.
4426 However, there is no guarantee that `t42_parse_sfnts` will actually be
4427 called while parsing the type42 data as the /sfnts array may be missing
4428 or very short. This is also confusing behavior as it means
4429 `T42_Open_Face` is tightly coupled to the implementation of the very
4430 distant `t42_parse_sfnts` code which requires at least 12 bytes to
4431 already be reserved in `face->ttf_data`.
4433 `t42_parse_sfnts` itself eagerly updates `face->ttf_size` to track how
4434 much space is reserved for ttf data instead of traking how much data has
4435 actually been written into `face->ttf_data`. It will also act strangely
4436 in the presense of multiple /sfnts arrays.
4438 * src/type42/t42objs.c (T42_Open_Face): ensure `ttf_data` is initialized
4439 to NULL. Free `ttf_data` on error.
4441 * src/type42/t42parse.c (t42_parse_sfnts): delay setting `ttf_size` and
4442 set it to the actual number of bytes read. Ensure `ttf_data` is freed
4443 if there are multiple /sfnts arrays or there are any errors.
4445 2022-01-11 Dominik Röttsches <drott@chromium.org>
4447 [sfnt] Fix limit checks for `COLR` v1 ClipBoxes
4449 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Fix off-by-one in
4452 2022-01-11 Werner Lemberg <wl@gnu.org>
4454 Update all copyright notices.
4456 2022-01-11 Werner Lemberg <wl@gnu.org>
4458 * src/sfnt/ttcolr.c (read_paint): Fix undefined left-shift operation.
4462 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43151
4464 2022-01-11 Werner Lemberg <wl@gnu.org>
4466 * src/type42/t42objs.c (T42_Open_Face): Avoid use of uninitialized memory.
4470 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43508
4472 2022-01-11 Werner Lemberg <wl@gnu.org>
4474 .gitlab-ci.yml: Fix typo in previous commit.
4476 2022-01-11 Werner Lemberg <wl@gnu.org>
4478 .gitlab-ci.yml: Update Windows image.
4480 The old image produced errors like
4483 Downloading zlib patch from
4484 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
4485 A fallback URL could be specified using patch_fallback_url key in the wrap file
4486 WrapDB connection failed to
4487 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
4489 <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
4490 failed: certificate has expired (_ssl.c:1122)>
4493 2022-01-11 Werner Lemberg <wl@gnu.org>
4495 * subprojects/zlib.wrap: Update from upstream.
4497 2022-01-10 Werner Lemberg <wl@gnu.org>
4499 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Add limit checks.
4503 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40716
4505 2022-01-10 Werner Lemberg <wl@gnu.org>
4507 [zlib] Don't typedef `ptrdiff_t`.
4509 While using zlib in 'solo' mode (via the `Z_SOLO` macro), we actually
4510 include some standard header files, making the typedef fail on systems where
4511 the native `ptrdiff_t` type differs.
4515 * src/zlib/zutil.h: Comment out definition; it doesn't work on Windows.
4517 * src/zlib/patches/freetype-zlib.diff: Updated.
4519 2022-01-10 Werner Lemberg <wl@gnu.org>
4521 [zlib] Some organizational changes.
4523 We now first apply zlib's `zlib2ansi` script, then FreeType's patch file.
4525 * src/gzip/README.freetype: Updated.
4527 * patches/0001-zlib-Fix-zlib-sources-to-compile-for-FreeType.patch: Renamed
4529 * patches/freetype-zlib.diff: This.
4530 Clean up description, then regenerate it as follows:
4532 - Copy unmodified files from `zlib` repository.
4533 - Run `zlib2ansi` script.
4534 - Run `git diff -R > patches/freetype-zlib.diff.new`.
4535 - Insert patch description of old diff file, then replace old diff with
4538 2022-01-09 David Turner <david@freetype.org>
4540 [gzip] Update sources to zlib 1.2.11
4542 This can be tested by building with the Unix development build
4547 or by building the freetype-demos programs with
4549 meson setup build -Dfreetype2:zlib=internal
4550 meson compile -C out
4552 and trying to run `ftview` with a `.pcf.gz` font file.
4554 * src/gzip/ftgzip.c, src/gzip/rules.mk: Update for new zlib sources. Also
4555 remove the temporary fix introduced in commit 6a431038 to work around the
4556 fact that the internal sources were too old.
4558 * src/gzip/README.freetype: New file describing the origin of the sources
4559 and how they were modified.
4561 * src/gzip/patches/*: Patch files applied to original sources.
4563 * src/gzip/*: Updated zlib sources with the patch file(s) from
4564 `src/gzip/patches/` applied, followed by a conversion with zlib's
4567 2022-01-09 David Turner <david@freetype.org>
4569 [meson] Change Zlib configuration option.
4571 * meson_options.txt, meson.build: Change the format of the 'zlib' meson
4572 build configuration option to be a combo with the following choices:
4574 - none: Do not support gzip-compressed streams at all.
4576 - internal: Support gzip-compressed streams using the copy of the gzip
4577 sources under `src/gzip/`; this should only be used during development
4578 to ensure these work properly.
4580 - external: Support gzip-compressed streams using the 'zlib' Meson
4581 subproject, linked as a static library.
4583 - system: Support gzip-compressed streams using a system-installed version
4586 - auto: Support gzip-compressed streams using a system-installed version
4587 of zlib, if available, or using the 'zlib' subproject otherwise. This
4590 - disabled: Backward-compatible alias for 'none'.
4592 - enabled: Backward-compatible alias for 'auto'.
4594 2022-01-09 Werner Lemberg <wl@gnu.org>
4596 [bzip2] Avoid use of uninitialized memory.
4598 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but
4599 `FT_NEW` for setting up `zip` to avoid uninitialized memory access while
4600 handling malformed PCF fonts later on.
4604 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800
4606 2022-01-09 Alexei Podtelezhnikov <apodtele@gmail.com>
4608 [sfnt] Fix off-by-one error.
4610 The 0-base index is equal to the number of previosly parsed entries.
4611 It is an error to adjust it by one to get the number truncated by
4612 a stream error. This is probably inconsequential because valid
4613 entries are correctly accounted for.
4615 * src/sfnt/ttload.c (check_table_dir): Do not adjust the truncated
4618 2022-01-08 Werner Lemberg <wl@gnu.org>
4620 [sfnt, type42] Correct previous commit.
4622 Really fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773.
4624 * src/sfnt/ttload.c (check_table_dir): Revert change.
4626 * src/type42/t42.parse.c (t42_parse_sfnts): Don't use `FT_QREALLOC` but
4627 `FT_REALLOC` for setting up `ttf_data` to avoid uninitialized memory access
4628 while handling malformed TrueType fonts later on.
4630 2022-01-07 Werner Lemberg <wl@gnu.org>
4632 * src/sfnt/ttload.c (check_table_dir): Initialize `table`.
4636 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773
4638 2022-01-07 Werner Lemberg <wl@gnu.org>
4640 [sfnt] Avoid 'runtime error: applying zero offset to null pointer'.
4642 * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if
4645 2022-01-07 Werner Lemberg <wl@gnu.org>
4647 [autofit, pshinter] Use `FT_OFFSET`.
4652 runtime error: applying zero offset to null pointer
4655 warnings of clang's undefined behaviour sanitizer.
4657 * src/autofit/afcjk.c (af_cjk_hints_link_segments,
4658 af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges,
4659 af_cjk_hint_edges, af_cjk_align_edge_points): Do it.
4661 * src/autofit/afhints.c (af_glyph_hints_align_edge_points,
4662 af_glyph_hints_align_strong_points): Ditto.
4664 * src/autofit/aflatin.c (af_latin_metrics_init_widths,
4665 af_latin_hints_link_segments, af_latin_hints_compute_edges,
4666 af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto.
4668 * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto.
4670 2022-01-06 Ben Wagner <bungeman@chromium.org>
4672 [truetype] Reset localpoints when varying cvt.
4674 When iterating over the cvt tuples and reading in the points it is necessary
4675 to set all of `localpoints`, `points`, and `point_count` in all cases. The
4676 existing code did not reset `localpoints` to `NULL` when there were no
4677 private point numbers. If the previous tuple did have private point numbers
4678 and set `localpoints` to `ALL_POINTS` this would not be cleared and the
4679 wrong branch would be taken later, leading to possible heap buffer overflow.
4681 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Reset `localpoints` to `NULL`
4682 when it isn't valid.
4684 Fixes: https://crbug.com/1284742
4686 2022-01-02 Werner Lemberg <wl@gnu.org>
4688 * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable.
4690 This was accidentally removed with commit 93ebcbd0 almost eight years ago.
4692 2021-12-27 Alexander Borsuk <me@alex.bio>
4694 Fix warnings for CMake Unity builds.
4696 * src/cache/ftcbasic.c (FT_COMPONENT): Undefine macro before redefinition.
4697 * src/smooth/ftgrays.c (TRUNC, FRACT): Ditto.
4699 2021-12-18 Alexander Borsuk <alexander.borsuk@qnective.com>
4701 Clang-Tidy warning fixes.
4703 * src/base/ftobjs.c (FT_Get_Paint): Operator has equivalent nested operands.
4704 * src/bdf/bdflib.c (_bdf_add_property): Value stored to `fp` is never read.
4705 * src/sdf/ftbsdf.c (bsdf_init_distance_map): Value stored to `pixel` is
4707 * src/sdf/ftsdf.c (split_sdf_shape): Value stored to `error` is never read.
4709 2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
4711 * meson.build: Optimize lookup for `python3` program.
4713 The python module's `find_installation` method is intended to provide
4714 routines for compiling and installing python modules into the
4715 `site-packages` directory. It does a couple of slow things, including run
4716 an introspection command to scrape sysconfig info from the detected
4717 interpreter, which are not needed for the sole use case of invoking the
4718 found installation as an executable.
4720 Furthermore, when invoked without the name or path of a python binary, it is
4721 hardcoded to always look for `python3` corresponding to the interpreter
4722 meson itself uses to run. So using `find_installation` did not even allow
4723 detecting `python2` as a fallback.
4725 Instead, switch to a simple `find_program` lookup that finishes as soon as
4726 the program is found.
4728 2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
4730 * builds/meson/*.py: Fix name of python executable for auxiliary scripts.
4732 The previous change to check the return code of `run_command` invocations
4733 caused the CI to fail. Although most scripts used `python_exe` as the
4734 program command, the script to determine the project version did not.
4736 But, all scripts used `python` as the shebang, and this is not available on
4737 all systems. Particularly Debian does not provide a `python` command,
4738 though `python3` does exist. This meant that formerly the version number
4739 was lacking, and now the build simply fails.
4741 Instead, rely on `python3` since it is guaranteed to exist when running
4742 meson, and `python2` is end of life anyway.
4744 2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
4746 * meson.build: Check the return value of `run_command`.
4748 By default, errors are not checked and a command that is somehow broken will
4749 just capture incorrect output (likely an empty string). Current development
4750 versions of meson now raise a warning for this implicit behavior, and advise
4751 explicitly setting the `check:` keyword argumend to determine whether a
4752 failing return code should be considered an error.
4754 Since none of the commands in this project are expected to fail, mark them
4755 as required to succeed.
4757 2021-12-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4759 [truetype] Upstream the hdmx binary search.
4761 * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx
4763 * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even
4764 though it might never be used by the interpreter.
4765 * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches
4768 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4770 [truetype] Reset the IUP-called flags for each subglyph.
4772 This fixes fall-out from 7809007a5b88b15, where the composite
4773 accents were no longer hinted.
4775 * src/truetype/ttgload.c (ttloader_init): Move the IUP-called flag
4776 initialization from here...
4777 * src/truetype/ttinterp.c (TT_Run_Context): ... to here.
4779 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4781 [truetype] Binary search through the `hdmx` records.
4783 The `hdmx` table is supposed to be sorted by ppem size, which
4784 enables binary search. We also drop the check for the sufficient
4785 length of the record because it is now enforced when the table
4788 * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx`
4789 record pointers sorted by ppem instead of ppem's themselves.
4790 * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records.
4791 (tt_face_get_device_metrics): Implement binary search to retrieve
4794 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4796 [truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable.
4798 This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY
4799 is specified by FT_Get_Advances and the `hdmx` data are located.
4800 Particularly, the classic v35 interpreter or "verified" ClearType
4801 fonts might see 100x speed up in retrieving the hdmx cache.
4803 * src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut.
4805 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4807 [truetype] Initialize the loader with `hdmx` data.
4809 The `hdmx` matching can be done before the glyph is loaded.
4811 * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field.
4812 * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx`
4814 (tt_loader_init): ... to here, before the glyph is loaded.
4816 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4818 [truetype] Relocate subpixel flag setting.
4820 `TT_RunIns` is too busy to deal with subpixel flags. It is better
4821 to set them in `tt_loader_init`, which is executed before each
4824 * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting from
4826 * src/truetype/ttgload.c (tt_loader_init): ... to here.
4828 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4830 [truetype] Limit INSTCTRL appication within specs.
4832 * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects
4833 to the CVT program and local effects to the glyph program.
4835 This also fixes an Infinality buglet. The `ignore_x_mode` should be
4836 locally unset by the glyph program.
4838 2021-12-09 Ben Wagner <bungeman@chromium.org>
4840 [bdf] Fix use of uninitialized value.
4842 In _bdf_readstream if the data contained no newline then the buffer
4843 would continue to grow and uninitialized data read until either the
4844 uninitialized data contained a newline or the buffer reached its
4845 maxiumum size. The assumption was that the line was always too long and
4846 the buffer had been filled, however this case can also happen when there
4847 is not enough data to fill the buffer.
4849 Correct this by properly setting the cursor to the end of the available
4850 data, which may be different from the end of the buffer. This may still
4851 result in one extra allocation, but only on malformed fonts.
4853 * src/bdf/bdflib.c (_bfd_readstream): Correctly update cursor. Remove
4854 unread set of `avail`.
4856 Bug: https://lists.nongnu.org/archive/html/freetype-devel/2021-12/msg00001.html
4858 2021-12-07 Alexei Podtelezhnikov <apodtele@gmail.com>
4860 [truetype] Reduce Infinality footprint again.
4862 * src/truetype/ttgload.c (compute_glyph_metrics): Streamline and
4863 prioritize the Infinality checks to use `hdmx`.
4865 2021-12-07 Cameron Cawley <ccawley2011@gmail.com>
4867 [builds/windows] Guard some non-ancient API.
4869 We can support Windows 98 and NT 4.0 in principle...
4871 * builds/windows/ftdebug.c, builds/windows/ftsystem.c: Check for the
4872 ancient SDK using _WIN32_WINDOWS, _WIN32_WCE, or _WIN32_WINNT.
4874 2021-12-07 Cameron Cawley <ccawley2011@gmail.com>
4876 * builds/windows/visualc/freetype.vcproj: Add missing file.
4878 2021-12-02 Werner Lemberg <wl@gnu.org>
4880 * Version 2.11.1 released.
4881 ==========================
4883 Tag sources with `VER-2-11-1'.
4885 * docs/VERSION.TXT: Add entry for version 2.11.1.
4886 * docs/CHANGES, docs/release: Updated.
4888 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
4889 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
4890 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
4891 docs/freetype-config.1: s/2.11.0/2.11.1/, s/2110/2111/.
4893 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
4895 * builds/unix/configure.raw (version_info): Set to 24:1:18.
4896 * CMakeLists.txt (VERSION_PATCH): Set to 1.
4898 * builds/toplevel.mk (version_tag, CHANGELOG_SCRIPT): New variables.
4899 (do-dist): Generate `ChangeLog` file with all commits since last release.
4901 2021-11-30 Alexei Podtelezhnikov <apodtele@gmail.com>
4903 [builds/windows] Improve debugging.
4905 * builds/windows/ftdebug.c (FT_Message, FT_Panic): Buffer output
4906 and call `OutputDebugStringA` only if `IsDebuggerPresent`.
4907 [_WIN32_WCE] (OutputDebugStringA): Implement the missing API.
4909 2021-11-29 Seigo Nonaka <nona@google.com>
4911 * src/base/ftobjs.c (FT_Request_Metrics): Fix build warning on Android.
4913 Use casts since `FT_USHORT_MAX` is unsigned short in bionic (libc used in
4916 2021-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
4918 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Minor tweak.
4920 2021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4922 * src/truetype/ttpload.c (tt_face_load_hdmx): Added comments.
4924 2021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4926 [truetype] Quietly reject out-of-spec `hdmx` tables.
4928 The `hdmx` table is optional and can be safely rejected without
4929 an error if it does not follow specifications. The record size
4930 must be equal to the number of glyphs + 2 + 32-bit padding.
4932 * src/truetype/ttpload.c (tt_face_load_hdmx): Thoroughly check
4933 the record size and improve tracing.
4935 2021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com>
4937 [truetype] Partly revert 5b626281.
4941 * src/truetype/ttpload.c (tt_face_load_hdmx): Do not assume that
4942 `record_size` is rounded even though the records are padded.
4944 2021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com>
4946 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Use transforms.
4948 2021-11-22 Werner Lemberg <wl@gnu.org>
4950 Update `CHANGES` files, other minor whitespace and documentation issues.
4952 2021-11-21 Werner Lemberg <wl@gnu.org>
4954 formats.txt: Add info about WOFF and WOFF2.
4956 2021-11-21 Werner Lemberg <wl@gnu.org>
4958 meson.build: Initialize `common_ldflags`.
4960 2021-11-21 Lukas Oberhuber <@lukaso>
4962 * meson.build: Fix compatibility version on MacOS.
4966 2021-11-21 Werner Lemberg <wl@gnu.org>
4968 * src/truetype/ttinterp.c (Ins_MD): Avoid `FT_ABS`.
4972 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38562
4974 2021-11-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4976 * include/freetype/fttypes.h (FT_MAKE_TAG): Remove the same casting.
4978 2021-11-20 Werner Lemberg <wl@gnu.org>
4980 [gxvalid] Fix minor compilation warning.
4982 * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup): Declare
4985 2021-11-20 Werner Lemberg <wl@gnu.org>
4987 [smooth] Fix stand-alone compilation.
4989 * src/smooth/ftgrays.c (FT_Trace_Enable, FT_Trace_Disable)[STANDALONE_]:
4992 2021-11-20 Werner Lemberg <wl@gnu.org>
4994 Avoid undefined left-shifts.
4996 We really have to use double casts to avoid issues with C's and C++'s
4997 signedness propagation rules in implicit casts.
5001 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41178
5002 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41182
5004 * include/freetype/config/public-macros.h (FT_STATIC_CAST,
5005 FT_REINTERPRET_CAST): Modify macro to take two arguments.
5007 (FT_STATIC_BYTE_CAST): New macro.
5009 * include/freetype/freetype.h (FT_ENC_TAG): Use `FT_STATIC_BYTE_CAST`.
5010 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto.
5011 * include/freetype/fttypes.h (FT_MAKE_TAG): Ditto.
5012 Use `FT_Tag` for casting.
5014 * src/ftraster/ftmisc.h (FT_MAKE_TAG): Removed, no longer needed.
5015 (FT_STATIC_BYTE_CAST): New macro.
5017 * src/smooth/ftgrays.c (FT_STATIC_CAST): Replace with...
5018 (FT_STATIC_BYTE_CAST): ... this.
5020 2021-11-18 Werner Lemberg <wl@gnu.org>
5022 Provide C++ versions for public macros with casts.
5024 Many FreeType clients use C++. However `g++ -Wold-style-cast` warns for
5025 macros with C-style casts even for system header files; this also affects
5026 directories included with `-isystem`. While this could be seen as a problem
5027 with g++, the problem is more a philosophical one: Over the time, C and C++
5028 diverged more and more, and some features of C are no longer the 'right'
5031 * include/freetype/config/public-macros.h (FT_STATIC_CAST,
5032 FT_REINTERPRET_CAST): New macros.
5034 * include/freetype/freetype.h (FT_ENC_TAG, FT_LOAD_TARGET_,
5035 FT_LOAD_TARGET_MODE): Use `FT_STATIC_CAST`.
5036 Correctly handle negative 'signed char' input.
5037 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto.
5038 * include/freetype/fttypes.h (FT_MAKE_TAG, FT_BOOL): Ditto.
5039 * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): Use
5040 `FT_REINTERPRET_CAST`.
5042 * src/smooth/ftgrays.c (FT_STATIC_CAST)[STANDALONE_]: New macro.
5043 [!STANDALONE]: Include `FT_CONFIG_CONFIG_H`.
5047 2021-11-16 Werner Lemberg <wl@gnu.org>
5049 Fix clang++ warnings.
5051 * src/*: Initialize some variables to NULL.
5053 2021-11-16 Werner Lemberg <wl@gnu.org>
5055 [truetype] Updates for the forthcoming OpenType 1.9 standard (2/2).
5057 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store):
5058 s/shortDeltaCount/wordDeltaCount/ (as done in the specification, too).
5059 Recognize new format and reject it for now.
5061 2021-11-16 Werner Lemberg <wl@gnu.org>
5063 [truetype] Updates for the forthcoming OpenType 1.9 standard (1/2).
5065 This is in preparation for implementing `DeltaSetIndexMap` format 1, which
5066 is used by `COLR` v1 tables, and which allows 32bit indices.
5068 https://docs.microsoft.com/en-us/typography/opentype/otspec190/delta/otvarcommonformats_delta.html
5070 * src/truetype/ttgxvar.h (GX_DeltaSetIdxMapRec): Change type of `mapCount`
5073 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping): Add argument
5074 for passing the table size; update caller.
5075 Implement new format.
5077 2021-11-14 Werner Lemberg <wl@gnu.org>
5081 * src/gxvalid/gxvcmmn.h (GXV_SET_ERR_IF_PARANOID): Use 'do' block.
5082 * src/gxvalid/gxvmod.c (GXV_TABLE_LOAD, GXV_TABLE_VALIDATE): Ditto.
5084 * src/smooth/ftgrays.c (gray_convert_glyph): Add cast.
5086 * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Remove cast.
5087 * src/type1/t1load.c (read_binay_data): Use `FT_ULong` for `size` parameter.
5088 (parse_subrs, parse_charstrings, parse_dict): Ditto; also add some casts.
5090 2021-11-13 Dominik Röttsches <drott@chromium.org>
5092 [sfnt] Avoid undefined shifts in `COLR` v1 paint parsing
5094 * src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Tighten shift
5095 behavior by using multiplication, mostly using macros from ftcalc.h.
5097 Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1269168
5099 2021-11-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5101 [builds/windows] Improve `DlgCopy` target.
5105 * builds/windows/vc2010/freetype.vcxproj: Run `DlgCopy` conditionally
5106 and decouple it from `Build`.
5108 2021-11-12 Alexei Podtelezhnikov <apodtele@gmail.com>
5110 Explicitly define `FT_MSB` for Clang.
5112 * include/freetype/internal/ftcalc.h [__clang__] (FT_MSB): Updated.
5114 2021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com>
5116 * src/truetype/ttgxvar.c (ft_var_to_normalized): Edge optimization.
5118 2021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com>
5120 Additional `FT_MSB` macro definitions.
5122 Better macros for Windoes CE and ARM in general, based on !109
5125 * include/freetype/internal/ftcalc.h [_MSC_VER] (FT_MSB): Updated.
5127 2021-11-09 Alexei Podtelezhnikov <apodtele@gmail.com>
5129 [build/windows] Remove logging from default debug configurations.
5131 DLG is rather costly for performance and should be used judiciously.
5132 This removes it from the default configurations but gives an example
5133 how to enable it using the `UserDefines` property.
5135 * builds/windows/vc2010/freetype.vcxproj: Hide FT_DEBUG_LOGGING.
5137 2021-11-08 Werner Lemberg <wl@gnu.org>
5139 * src/sfnt/sfobjs.c (sfnt_open_font): Fix typo.
5141 2021-11-08 Werner Lemberg <wl@gnu.org>
5143 * src/gxvalid.*, src/otvalid.*: Fix `-Wformat` warnings.
5145 2021-11-08 Werner Lemberg <wl@gnu.org>
5147 [pshinter] Fix C++ compilation.
5149 * src/pshinter/pshalgo.c (psh_compute_dir): Fix type of `result`.
5150 (psh_hint_table_find_strong_points): Add cast.
5152 2021-11-08 Werner Lemberg <wl@gnu.org>
5154 [sfnt] Reduce footprint if WOFF and WOFF2 support is not needed.
5156 Based on a patch from metarutaiga (MR !106). The gist of this commit is
5157 that it doesn't make sense to support WOFF without compression (which would
5158 be only possible in WOFF 1.0 anyway).
5160 * src/sfnt/sfobjs.c (sfnt_open_font): Guard WOFF code with
5161 `FT_CONFIG_OPTION_USE_ZLIB` block.
5162 Guard WOFF2 code with `FT_CONFIG_OPTION_USE_BROTLI` block.
5164 * src/sfnt/sfwoff.c, src/sfnt/sfwoff.h: Guard files with
5165 `FT_CONFIG_OPTION_USE_ZLIB` blocks, not parts of the code.
5167 * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h, src/sfnt/woff2tags.c,
5168 src/sfnt/woff2tags.h: Guard files with `FT_CONFIG_OPTION_USE_BROTLI` blocks,
5169 not parts of the code.
5173 2021-11-08 Werner Lemberg <wl@gnu.org>
5175 [truetype] Make trickyness checks depend on TT_USE_BYTECODE_INTERPRETER.
5177 Based on a patch from metarutaiga (MR !106).
5179 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag,
5180 tt_check_trickyness_family, tt_synth_sfnt_checksum, tt_get_sfnt_checksum,
5181 tt_check_trickyness_sfnt_ids, tt_check_trickyness): Put functions into a
5182 `TT_USE_BYTECODE_INTERPRETER` block.
5183 (tt_face_init): Put trickyness checks into a `TT_USE_BYTECODE_INTERPRETER`
5188 2021-11-08 Alexei Podtelezhnikov <apodtele@gmail.com>
5190 * src/sfnt/ttload.c (tt_face_load_gasp): Fix a type mismatch warning.
5192 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com>
5194 [dlg] Define DLG_STATIC explicitly.
5196 DLG_STATIC is intended to disable Windows DLL linking attributes.
5197 It does not hurt to define it explicitly when we wrap DLG code.
5198 This fixes tons of LNK4286 and C4273 warnings from MSVC if we
5199 forget to define DLG_STATIC as a compiler option.
5201 * builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option.
5202 * src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC.
5203 * include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto.
5205 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com>
5207 [dlg] Lighten up the inclusions.
5209 The DLG wrapper needs to know if FT_DEBUG_LOGGING is defined in
5210 `ftoption.h`. It does not need entire FreeType.
5212 * src/dlg/dlgwrap.c: Include FT_CONFIG_OPTIONS_H directly.
5214 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com>
5216 [truetype] Avoid some memory zeroing in variations.
5218 * src/truetype/ttgxvar.c (ft_var_readpackeddeltas, ft_var_load_avar,
5219 ft_var_load_item_variation_store, ft_var_load_gvar): Use FT_QNEW_ARRAY
5220 if memory immediately initialized or discarded otherwise.
5222 2021-11-05 Jany Belluz <jany.belluz@daltonmaag.com>
5224 [truetype] Fix handling of packed deltas in Variation Fonts.
5226 * src/truetype/ttgxvar (ft_var_readpackeddeltas): Don't expect the number of
5227 bytes used to encode the deltas to be higher than the number of encoded
5228 values. The specification allows a very compact encoding; for example, a
5229 list of 200 zeros can be encoded with just a couple of bytes.
5231 We now count the consumed bytes to make sure to not read more than expected.
5233 2021-11-04 Jany Belluz <jany.belluz@daltonmaag.com>
5235 [truetype] Fix CVAR handling of tuples for all points.
5237 * src/truetype/ttgxvar (tt_face_vary_cvt): Function
5238 `ft_var_readpackedpoints`, when it returns `ALL_POINTS`, also sets
5239 `point_count` to value 0. However, the CVAR code was incorrectly expecting
5240 that `point_count` would be set to match the length of the CVT table.
5242 2021-11-04 Jany Belluz <jany.belluz@daltonmaag.com>
5244 * src/truetype/ttgxvar.c: Fix typos in macros that guard CVAR code.
5246 2021-11-04 Alexei Podtelezhnikov <apodtele@gmail.com>
5248 * docs/INSTALL: Mention Meson and MSBuild more prominently.
5250 2021-11-03 Gabor Kertesz <gabor.kertesz@linaro.org>
5252 [libpng] Update Meson wrap for win-arm64
5254 1.6.37-5 released patches for win-arm64 to successfully build
5256 https://github.com/mesonbuild/wrapdb/pull/205
5257 https://github.com/mesonbuild/wrapdb/pull/216
5259 Updated by the following command:
5260 meson wrap update libpng
5262 Tested on win-arm64 and x64.
5264 2021-11-03 Dominik Röttsches <drott@chromium.org>
5266 [sfnt] Clarify `COLR` v1 FT_Paint* format representations
5268 * include/freetype/ftcolor.h (FT_PaintLinearGradient,
5269 FT_PaintRadialGradient, FT_PaintSweepGradient, FT_PaintTransform,
5270 FT_PaintTranslate, FT_PaintScale, FT_PaintRotate, FT_PaintSkew): Clarify
5271 16.16 fixed point representation of struct fields.
5272 * src/sfnt/ttcolr.c (read_paint): Shift coordinates for
5273 FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient
5276 Fixes: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1110
5278 2021-11-03 Alexei Podtelezhnikov <apodtele@gmail.com>
5280 [builds/windows] Let MSBuild handle DLG copy.
5282 * builds/windows/vc2010/freetype.vcxproj: Specify DlgCopy target.
5283 * builds/windows/vc2010/script.bat: Deleted.
5285 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
5287 * src/truetype/ttgload.c (load_truetype_glyph): Fix MSVC warning C4312.
5289 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
5291 [builds/windows] Separate MSVC linker and librarian.
5293 MSVC uses LIB for static and LINK for dynamic libraries. They are
5294 related but the former has much smaller set of options.
5296 * builds/windows/vc2010/freetype.vcxproj: Updated.
5298 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
5300 [builds/windows] Revise MSVC linking optimizations.
5302 * builds/windows/vc2010/freetype.vcxproj: Optimize DLL linking only.
5303 * builds/windows/visualc/freetype.dsp: Ditto.
5304 * builds/windows/visualc/freetype.vcproj: Ditto.
5306 2021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com>
5308 [woff] Optimize table tagging.
5310 * include/freetype/internal/wofftypes.h (WOFF_TableRec): Use
5312 * src/sfnt/sfwoff.c (woff_open_font): Use 32-bit tag.
5314 2021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com>
5316 [woff2] Optimize table tagging.
5320 * include/freetype/internal/wofftypes.h (WOFF2_TableRec): Use
5322 * src/sfnt/sfwoff2.c (compare_tags, find_table, woff2_open_font):
5324 * src/sfnt/woff2tags.[ch] (woff2_known_tags): Use static storage and
5327 2021-10-26 Werner Lemberg <wl@gnu.org>
5331 2021-10-26 Ben Wagner <bungeman@chromium.org>
5333 [mm] Tolerate missing Blend dictionary entries
5335 In a Multiple Master font, the Blend dictionary must contain valid
5336 Private, FontInfo, and FontBBox. The current code will error if any of
5337 these are present and invalid, but will not error and will provide
5338 uninitialized data if the Blend dictionary exists but does not contain
5339 one of these entries. This change reverts to the older behavior of
5340 treating any missing entries as containing all zero data and not
5343 In the future it may be best to keep track of when these are actually
5344 initialized and error if they are not.
5346 * src/type1/t1load.c (t1_allocate_blend): Zero initiailize.
5348 2021-10-26 Alexei Podtelezhnikov <apodtele@gmail.com>
5350 [builds/windows] Add MSVC linker optimazations.
5352 We continue to build static libraries with statically linked C run-
5353 time and add options to optimize references.
5355 * builds/windows/vc2010/freetype.vcxproj: Sort entries, add options.
5357 2021-10-23 Alexei Podtelezhnikov <apodtele@gmail.com>
5359 * builds/windows/vc2010/freetype.vcxproj: Use MachineARM64.
5361 2021-10-22 Alexei Podtelezhnikov <apodtele@gmail.com>
5363 [builds/windows] Prioritize x64.
5365 * builds/windows/vc2010/freetype.sln: Sort entries.
5367 2021-10-22 Gabor Kertesz <gabor.kertesz@linaro.org>
5369 [builds/windows] Add ARM64 platform.
5371 * builds/windows/vc2010/freetype.sln: Updated
5372 * builds/windows/vc2010/freetype.vcxproj: Updated.
5373 * builds/windows/vc2010/freetype.vcxproj.filters: Minor fix.
5375 2021-10-21 Ben Wagner <bungeman@chromium.org>
5377 [mm] Delay setting blend weight and design position.
5379 Previously the `blend->weight_vector`, `blend->default_weight_vector`,
5380 and `blend->design_pos` were set early to allocated but uninitialized
5381 memory under the assumption that the memory would eventually be
5382 initialized. However, it is possible that some of the required
5383 keywords may not actually be present, leaving the memory uninitialized.
5384 This is different from a present but invalid table, which would produce
5388 https://bugs.chromium.org/p/chromium/issues/detail?id=1261762
5390 * src/type1/t1load.c (t1_allocate_blend): Remove early allocation and
5392 (parse_blend_design_positions, parse_weight_vector): Parse into local
5393 and assign to blend if valid.
5394 (T1_Open_Face): Check that if a blend exists that it has the weight
5395 vector and design positions.
5397 2021-10-21 Ben Wagner <bungeman@chromium.org>
5399 [cff] Commit vstore data and regions on allocation.
5401 The vstore->regionCount and vstore->dataCount were read directly
5402 from the data. However, vstore->varRegionList and vstore->varData
5403 would still contain uninitialized entries with uninitialized
5404 pointers in the event of an error, leading to issues when attempting
5408 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40104
5410 * src/cff/cffload.c (cff_vstore_load): Read the region and data counts
5411 into locals and update the vstore counts immediately after each entry
5414 2021-10-20 Ben Wagner <bungeman@chromium.org>
5416 [sfnt] Delay setting gasp ranges and count until computed.
5418 Previously, the gasp.numRanges was set and gasp.gaspRanges was
5419 allocated and assigned before a possible early exit if the frame could
5420 not be entered. It is also possible that the gaspRanges allocation
5421 could fail but the numRanges still be set to non-zero. In such cases
5422 an error would be returned, but the face would have a gasp in an
5423 inconsistent state which may still be accessed.
5426 https://bugs.chromium.org/p/chromium/issues/detail?id=1261450
5428 * src/sfnt/ttload.c (tt_face_load_gasp): Delay setting gasp.numRanges
5429 and gasp.gaspRanges until after the ranges are initialized.
5431 2021-10-20 Ben Wagner <bungeman@chromium.org>
5433 [sfnt] Delay setting names and langTags until computed.
5435 Previously, the table->names and table->langTags fields were created
5436 pointing to uninitialized memory and an early exit could happen if the
5437 frame could not be entered. The caller would then be unable to properly
5438 dispose of the memory as the string fields had not been initialized.
5441 https://bugs.chromium.org/p/chromium/issues/detail?id=1261343
5443 * src/sfnt/ttload.c (tt_face_load_name): delay setting table->langTags
5444 and table->names until after the memory they will point to is fully
5447 2021-10-20 Alexei Podtelezhnikov <apodtele@gmail.com>
5449 * tests/issue-1063/main.c: s/PATH_MAX/FILENAME_MAX/.
5451 Closes !97 for Windows by using a standard macro.
5453 2021-10-19 Werner Lemberg <wl@gnu.org>
5455 [bdf, cid, pfr, winfonts] Improve rejection of other font formats.
5457 This is mainly for better diagnostics of malformed fonts.
5459 * src/bdf/bdflib.c (_bfd_readstream): Stop font format testing if the first
5460 input line is too long or doesn't end with `\r` or `\n`.
5462 * src/cid/cidparse.c (cid_parser_new): Don't handle too short input as an
5463 error but as an unknown format.
5465 * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
5467 * src/winfonts/winfnt.c (fnt_font_load, fnt_face_get_dll_font): Ditto.
5469 2021-10-19 Alexei Podtelezhnikov <apodtele@gmail.com>
5471 [pcf] Zero out the allocated properties.
5474 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40033
5476 * src/pcf/pcfread.c (pcf_get_properties): Use FT_NEW_ARRAY and zero
5477 out `properties` in case of failure.
5479 2021-10-18 Werner Lemberg <wl@gnu.org>
5481 configure: Use string comparison for directory inodes.
5483 Inode values might be larger than integers supported by the shell.
5487 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com>
5489 * src/sfnt/ttload.c (tt_face_load_name): NULL-initialize langTag.
5491 Another attempt to fix fallout reported as
5492 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40024
5494 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com>
5496 [bdf] Fix up user properties.
5499 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40027
5501 * src/bdf/bdflib.c (_bdf_add_property): Cosmetic NULL.
5502 (bdf_create_property): Limit allocations to customary signed
5503 FT_Long and NULL-initialize unused storage.
5504 (bdf_free_font): Do not free unused storage.
5506 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com>
5508 * src/sfnt/ttload.c (tt_face_load_name): Accounting fix.
5511 https://crbug.com/40024
5513 2021-10-16 Ben Wagner <bungeman@chromium.org>
5515 Fix typos in memory macros.
5517 FT_QNEW_ARRAY and FT_QRENEW_ARRAY were using the non-Q
5518 FT_MEM_NEW_ARRAY and FT_MEM_RENEW_ARRAY. Change these to use the Q
5519 versions. Also fix the one issue discovered in tt_face_load_name
5520 where table->names is created with FT_QNEW_ARRAY but the extra
5521 string member is not initialized to NULL.
5523 * include/freetype/internal/ftmemory.h (FT_Q(RE)NEW_ARRAY):
5524 Use FT_MEM_Q(RE)NEW_ARRAY as needed.
5526 * src/sfnt/ttload.c (tt_face_load_name): Initialize `entry->string`.
5528 2021-10-15 Ben Wagner <bungeman@chromium.org>
5530 [truetype] Reload context after re-executing `prep`.
5532 When a different hinting mode from the current is selected, the `prep` table
5533 must be re-executed with the new mode. After this happens the context must
5534 be re-loaded in preparation for the glyph program to be run.
5538 * truetype/ttgload.c (tt_loader_init): Add call to `TT_Load_Context`.
5540 2021-10-15 Werner Lemberg <wl@gnu.org>
5542 [truetype] Minor documentation improvements.
5544 2021-10-14 Anurag Thakur <anuthadev@gmail.com>
5546 Add clang build to linux CI
5548 2021-10-12 Anurag Thakur <anuthadev@gmail.com>
5550 CI: Add macOS CI, including a clang build
5552 2021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com>
5554 * src/cid/cidload.c (parse_fd_array): Protect against trancation.
5556 2021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com>
5558 [type1] Revert to signed size for binary data.
5560 Recently introduced and reported as
5561 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39838
5563 * src/type1/t1load.c (read_binary_data): Reject negative size.
5564 (parse_subrs, parse_charstrings): Use customary signed size.
5566 2021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com>
5568 [psaux] Signedness revisions.
5570 Unsigned indexes are easier to check.
5572 * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Updated.
5573 * src/psaux/psintrp.c (cf2_interpT2CharString): Ditto.
5574 * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
5575 * src/type1/t1load.c (read_binary_data): Ditto.
5577 2021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com>
5579 [cid] Signedness revisions.
5581 Unsigned checks are simpler.
5583 * include/freetype/t1tables.h (CID_FaceInfoRec): Change to unsignd
5585 * src/cid/cidparse.h (CID_Parser): Change to unsigned `num_dict`.
5587 * src/cid/cidgload.c (cid_load_glyph): Updated.
5588 * src/cid/cidload.c (cid_load_keyword, parse_fd_array,
5589 parse_expansion_factor, parse_font_name, cid_read_subrs,
5590 cid_face_open): Updated.
5591 * src/cid/cidobjs.c (cid_face_done): Updated.
5592 * src/cid/cidparse.c (cid_parser_new): Updated.
5594 2021-10-09 Alexei Podtelezhnikov <apodtele@gmail.com>
5596 * src/cid/cidload.c (cid_face_open): Streamline CIDCount check.
5598 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
5600 * src/cid/cidload.c (cid_face_open): Streamline SubrCount check.
5602 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
5604 * src/cid/cidgload.c (cid_load_glyph): Fortify incremental loading.
5606 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
5608 Signedness revisions.
5610 This eliminates explicit casting by switching to unsigned fields.
5611 The revisions mostly impact the handling of CID fonts.
5613 * include/freetype/fttypes.h (FT_Data): Change to unsigned `length`.
5614 * include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`.
5615 (CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`.
5616 * include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for
5619 * src/cid/cidgload.c (cid_load_glyph): Updated.
5620 * src/cid/cidload.h (cid_get_offset): Update argument.
5621 * src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open):
5623 * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data):
5625 * src/psaux/psft.c (cf2_getT1SeacComponent): Updated.
5626 * src/truetype/ttgload.c (TT_Process_Composite_Glyph,
5627 load_truetype_glyph): Updated.
5629 2021-10-07 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
5631 meson.build (gen_docs): Use `current_source_dir` instead of `source_root`.
5633 These two are not equal when FreeType is used as a subproject, such as in
5634 `freetype-demos`. In that case, `source_root` points at the root project,
5635 causing the docs build to fail.
5637 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
5639 * src/smooth/ftgrays.c (FT_DIV_MOD): Limit the ARM workaround.
5641 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
5643 [builds/unix, builds/vms] Standardize `mmap` failure.
5645 * builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED.
5646 * builds/vms/ftsystem.c (FT_Stream_Open): Ditto.
5648 This should cover https://savannah.nongnu.org/patch/?5909 as well.
5650 2021-10-05 Hugh McMaster <hugh.mcmaster@outlook.com>
5652 autogen.sh: Only copy submodules if building from a git branch.
5654 `autogen.sh` fails if building from a standard source tarball. Firstly, git
5655 expects to be called in a git repository, then `copy_submodule_files`
5656 blindly attempts to copy files.
5658 Debian, Ubuntu, Linux Mint, and other derivatives all run `autogen.sh`
5659 before compiling to regenerate build files.
5661 This patch ensures that various git commands are only called and 'dlg' files
5662 are only copied if `autogen.sh` is called from a git repository.
5664 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
5666 * include/freetype/internal/ftgloadr.h: Add missing header.
5668 Noticed by Jouk Jansen.
5670 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
5672 [pshinter] Additional clean-ups.
5674 * src/pshinter/pshalgo.h (psh_hint_table_find_strong_points): Streamline code.
5675 * src/pshinter/pshalgo.h (PSH_Glyph): Remove unused fields.
5677 2021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
5679 [pshinter] More convenient direction definition.
5681 It is easier to check directions using flags than integer values.
5683 * src/pshinter/pshalgo.h (PSH_Dir): Redefine directions.
5684 (PSH_PointRec): Use them as an enum type.
5686 * src/pshinter/pshalgo.c (psh_compute_dir): Modify return type.
5687 (psh_glyph_init, psh_hint_table_find_strong_points,
5688 psh_glyph_find_blue_points): Update users.
5690 2021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
5692 [pshinter] Remove unnecessary check.
5694 * src/pshinter/pshalgo.c (psh_hint_table_find_strong_points): Do not
5695 check if direction is defined before checking how.
5697 2021-10-02 AnuthaDev <anuthadev@gmail.com>
5699 CI: Hardcode meson version to fix build failure on windows
5701 2021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
5703 Additional `FT_MSB` macro definitions.
5705 * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins
5708 2021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
5710 * src/autofit/afhints.c (af_glyph_hints_reload): Decrease casting.
5712 2021-09-30 Alexei Podtelezhnikov <apodtele@gmail.com>
5714 * src/tools/apinames.c: Facilitate OpenVMS linker options.
5716 2021-09-29 Alexei Podtelezhnikov <apodtele@gmail.com>
5718 * src/winfonts/winfnt.c (FNT_Face_Init): Correct reallocation.
5720 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
5722 [builds/unix] Do not use autoconf SIZEOF.
5724 * builds/unix/ftconfig.h.in [FT_USE_AUTOCONF_SIZEOF_TYPES]: Removed.
5725 * builds/unix/configure.raw: Remove AC_CHECK_SIZEOF and update.
5727 After this commit, autoconf builds will fully rely on <limits.h>
5728 rather than falling back on it if AC_CHECK_SIZEOF failed for some
5729 reason. There is a risk that misconfigured cross-compilation might
5730 have wrong headers. Note that Meson and CMake builds always relied on
5731 <limits.h> for sizes and availability of integer types.
5733 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
5735 Propagate sign when reading OFF3.
5737 Signed 24-bit values are extremely rare. FreeType only reads them in
5738 PFR fonts with bitmap strikes conditionally. They have not been seen
5739 in the known fonts. That is why this bug could never be discovered.
5740 `FT_FRAME_OFF3` propagates sign correctly.
5742 * include/freetype/internal/ftstream.h (FT_PEEK_OFF3, FT_PEEK_OFF3_LE):
5743 Propagate sign into 32-bit value.
5744 (FT_GET_OFF3, FT_READ_OFF3): Needed fixing but removed as unused.
5746 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
5748 [bdf] Simplify comment collection or lack thereof.
5750 BDF comments are neither actually collected nor retrieved. There is
5751 no need to be fancy with delimiters.
5753 * src/bdf/bdflib.c (_add_bdf_comment): Delimit comments with zeros...
5754 (bdf_load_font): ...and do not null-terminate comments additionally.
5755 (_bdf_parse_glyphs): Check if comments are kept, which they are not.
5756 (_bdf_parse_start): Minor clean up.
5758 2021-09-24 Alexei Podtelezhnikov <apodtele@gmail.com>
5760 Use NULL for pointers only.
5762 * src/bdf/bdflib.c (*): Code changes.
5763 * include/freetype/freetype.h: Comments only.
5764 * src/cff/cffload.c, src/cff/cffobjs.c: Ditto.
5765 * src/winfonts/winfnt.c: Ditto.
5767 2021-09-23 Werner Lemberg <wl@gnu.org>
5769 Minor documentation fixes and improvements.
5771 2021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
5773 Reference `fopen` in the docs.
5775 2021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
5777 [bdf, pcf] Minor optimization.
5779 * src/pcf/pcfread.c (pcf_load_font): Do not call `FT_MulDiv` for a
5781 * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto.
5782 * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a comment.
5784 2021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
5786 [base] Initialize stream memory earlier.
5788 With Windows memory management tracking heap, it is important to use
5789 it during the stream opening fallback. In Unix, the argument is
5790 unused, but it is better to set it correctly.
5792 * src/base/ftobjs.c (FT_Stream_New): Set memory before calling
5794 * builds/windows/ftsystem.c, builds/unix/ftsystem.c (FT_Stream_Open,
5795 ft_close_stream_by_free): Call `ft_alloc` and `ft_free` with proper
5798 2021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
5800 [builds/windows] Revert back to `CreateFileA` only.
5802 Calling `CreateFileW` without making sure that the patname is really
5803 `wchar_t` is a bad idea and can lead to unpredictable overreads. For
5804 Windows CE, we impelemnt the missing API.
5806 Fixes #1098 and !76 again.
5808 * builds/windows/ftsystem.c (FT_Stream_Open): Call `CreateFileA`.
5809 [_WIN32_WCE] (CreateFileA, FileSizeEx): Implement missing interfaces.
5811 2021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com>
5813 * src/bdf/bdflib.c (_bdf_parse_{start,glyphs}): Use appropriate scanner.
5815 2021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com>
5819 2021-09-20 Alexei Podtelezhnikov <apodtele@gmail.com>
5821 * src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW.
5823 2021-09-18 Alexei Podtelezhnikov <apodtele@gmail.com>
5825 [cache] Minor clean-ups.
5827 * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Remove parantheses.
5828 * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto.
5829 (FTC_Cache_RemoveFaceID): Remove unnecessary variable.
5831 2021-09-17 Alexei Podtelezhnikov <apodtele@gmail.com>
5833 [builds/windows] Try both wide and narrow `CreateFile`
5835 Windows handles wchar_t* UTF-16 and char* ANSI (presently UTF-8)
5836 filenames using alternative -A and -W API. We'll try them both
5837 when opening a file. This means that you should not worry about
5840 Fixes #1098 and !76.
5842 * builds/windows/ftsystem.c (FT_Stream_Open): Call alternative
5843 `CreateFile` in the case of failure.
5845 2021-09-17 Edwin Steiner <edwin.steiner@gmail.com>
5847 [cff] Explicitly set StandardEncoding or ExpertEncoding offsets.
5851 * src/cff/cffload.c (cff_encoding_load): Set special offset values.
5853 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com>
5855 [cache] Miscellaneous clean-ups.
5857 * src/cache/ftccache.c (ftc_get_top_node_for_hash, FTC_Cache_Clear):
5858 Remove barely used variables.
5859 (ftc_cache_add): Adjust casting.
5860 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Remove casting.
5861 * src/cache/ftcsbits.c (ftc_snode_load): Remove casting.
5863 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com>
5865 * src/cff/cffload.c (cff_fd_select_get): Remove casting.
5867 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com>
5869 * src/pcf/pcfread.c (pcf_read_TOC): Remove casting.
5871 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
5873 Minor type adjustments.
5875 * src/cff/cffobjs.c (cff_face_init): Reduce casting.
5876 * src/truetype/ttobjs.c (tt_size_ready_bytecode): Ditto.
5877 * src/type1/t1load.c (T1_Set_MM_Design): Ditto.
5879 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
5881 Replace boolean allocation macros with MEM ones.
5883 * src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro.
5884 * src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto.
5885 * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto.
5886 * src/cache/ftccache.c (ftc_cache_init): Ditto
5887 * src/gzip/ftgzip.c (ft_gzip_alloc): Ditto.
5888 * src/psnames/psmodule.c (ps_unicodes_init): Ditto.
5889 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto.
5890 * src/sfnt/ttload.c (tt_face_load_name): Ditto.
5892 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
5894 [cache] Revert to some zeroing.
5896 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Zero
5897 `buckets` again to fix some crashes.
5899 2021-09-14 Alexei Podtelezhnikov <apodtele@gmail.com>
5901 * src/pshinter/pshrec.c (ps_mask_table_merge_all): Tweak loops.
5903 Fixes fallout from 731d0b685685 reported as
5905 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38685
5907 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5909 [cff, pshinter] Clean up unsigned counters.
5911 Loops with unsigned decrement can be reliably stopped when the counter
5912 wraps around after reaching zero.
5914 * src/cff/cffload.c (cff_charset_compute_cids): Use unsigned counter.
5915 * src/pshinter/pshalgo.c (psh_hint_table_activate_mask): Ditto.
5916 * src/pshinter/pshrec.c (ps_mask_table_merge): Ditto.
5918 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5920 [bdf, psnames, sfnt] Avoid some memory zeroing.
5922 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro.
5923 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto.
5924 * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero.
5926 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5928 * src/base/ftobjs.c (FT_CMap_New): Revert to zeroing.
5930 Fixes fallout from c1fa7aa2bc96, reported as
5932 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38641
5934 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5936 [truetype] Clean up `exec` initialization.
5938 * src/truetype/ttinterp.c (Init_Context): Absorbed into...
5939 (TT_New_Context): ... this function.
5941 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5943 [truetype] Avoid some memory zeroing.
5945 * src/truetype/ttgload.c (load_truetype_glyph): Use Q-macro.
5946 * src/truetype/ttinterp.c (Update_Max): Ditto.
5947 * src/truetype/ttpload.c (src/truetype/ttpload.c): Ditto.
5949 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5951 [base] Avoid some memory zeroing.
5953 * src/base/ftobjs.c (FT_New_Size, FT_CMap_New, FT_CMap_Done,
5954 ft_open_face_internal, ft_open_face_internal): Use Q-macros.
5956 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
5958 [cache, psaux] Remove zeros.
5960 * src/cache/ftcmru.c (FTC_MruList_New): Remove initialization.
5961 * src/psaux/psstack.c (cf2_stack_init): Ditto.
5963 2021-09-12 Alexei Podtelezhnikov <apodtele@gmail.com>
5965 [cache] Avoid some memory zeroing.
5967 * src/cache/ftcmru.c (FTC_MruList_New): Use Q-macro.
5968 * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Ditto.
5969 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Ditto.
5971 2021-09-11 Alexei Podtelezhnikov <apodtele@gmail.com>
5973 * src/cache/ftcmanag.c (FTC_Manager_New): Add missing zero.
5975 Fixes fall out from a7b199d081e7.
5977 2021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com>
5979 [truetype] Tweak `hdmx` checking.
5983 * src/truetype/ttpload.c (tt_face_load_hdmx): Account for padding.
5985 2021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com>
5987 [truetype] Tweak `loca` clamping.
5991 * src/truetype/ttpload.c (tt_face_load_loca): Fix up clamping.
5992 * include/freetype/internal/tttypes.h (TT_Face): Correct docs.
5994 2021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com>
5996 Fortify memory debugging (cont'd).
5998 * src/base/ftdbgmem.c (FT_DumpMemory): Check for active debugger.
5999 (ft_mem_table_destroy): Move `FT_DumpMemory` call from here...
6000 (ft_mem_debug_done): ... to here.
6002 2021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com>
6004 Fortify memory debugging.
6006 These changes are neccessary to properly recover `memory->user` that
6007 holds the Windows heap handle now.
6009 * src/base/ftdbgmem.c (ft_mem_debug_init): Handle all table allocations,
6010 initializations, and sizing instead of...
6011 (ft_mem_table_new): ... this function removed.
6012 (ft_mem_debug_done): Better check for the active debugger and free the
6013 debugger table here instead of...
6014 (ft_mem_table_destroy): ... here.
6016 2021-09-08 Werner Lemberg <wl@gnu.org>
6018 src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): Set to 600.
6020 This allows C99 compilation on Solaris.
6022 Problem reported by Mojca Miklavec.
6024 2021-09-07 Alexei Podtelezhnikov <apodtele@gmail.com>
6026 [builds/windows] Use native memory allocation API.
6028 * builds/windows/ftsystem.c (ft_alloc, ft_realloc, ft_free):
6029 Wrap HeapAlloc, HeapReAlloc, and HeapFree.
6030 (FT_New_Memory): Set the heap handle.
6032 2021-09-07 Werner Lemberg <wl@gnu.org>
6034 [dlg] Synchronize with upstream.
6036 * src/dlg/dlgwrap.c (_XOPEN_SOURCE): Set to 600.
6040 2021-09-04 Alexei Podtelezhnikov <apodtele@gmail.com>
6044 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
6046 * src/bdf/bdflib.c (_bdf_parse_start): Keep parser memory.
6048 2021-09-03 Werner Lemberg <wl@gnu.org>
6050 autogen.sh: Make it work with old Solaris 10 shell.
6052 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
6054 [smooth, raster, sdf] Clean up initialization calls.
6056 * src/raster/ftraster.c (ft_black_init): Removed.
6057 (ft_black_new): Clean up.
6058 * src/sdf/ftbsdf.c (bsdf_raster_new): Ditto.
6059 * src/sdf/ftsdf.c (sdf_raster_new): Ditto.
6060 * src/smooth/ftgrays.c (gray_raster_new): Ditto.
6062 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
6064 * src/cache/ftcmanag.c (FTC_Manager_New): Avoid some zeroing.
6066 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
6068 * src/bdf/bdflib.c (bdf_load_font): Remove memory shuffling.
6070 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
6074 2021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com>
6076 [base] Clean up stream reading.
6078 * src/base/ftstream.c (FT_Stream_ReadUShort, FT_Stream_ReadUOffset,
6079 FT_Stream_ReadULong and their LE variants): Remove unnecessary
6080 initialization and slightly refactor.
6081 (FT_Stream_GetByte, FT_Stream_ReadByte): Rename to return unsigned
6082 value and align with sister functions.
6084 * include/freetype/internal/ftstream.h (FT_Stream_GetByte,
6085 FT_Stream_ReadByte): Update prototypes and caller macros.
6087 2021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com>
6089 s/0/NULL/ where appropriate.
6091 2021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com>
6093 * builds/windows/ftsystem.c (FT_Stream_Open): Fix double-close.
6095 2021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com>
6097 [smooth] Reduce shift in multiply-shift optimization.
6099 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): Reduce shift.
6101 Smaller shifts that keep the division operands of FT_UDIVPREP within
6102 32 bits result in slightly faster divisions, which is noticeable in
6103 the overall performance. The loss of precision is tolerable until the
6104 divisors (the components dx and dy) approach 32 - PIXEL_BITS. With
6105 PIXEL_BITS = 8, this corresponds to 65,000 pixels or the bitmap size
6106 that we refuse to render anyway.
6108 Using `ftbench -p -s60 -t5 -bc timesi.ttf`,
6113 2021-08-28 Werner Lemberg <wl@gnu.org>
6115 [truetype] Fix compilation if !TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
6117 * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): Compile function
6119 (tt_face_vary_cvt) [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Add code.
6123 2021-08-27 Alexei Podtelezhnikov <apodtele@gmail.com>
6125 [builds/windows] Revise SSE2 settings.
6127 * builds/windows/vc2010/freetype.vcxproj [x64]: Remove explicit SSE2.
6128 * builds/windows/visualc/freetype.vcproj [Win32]: Add explicit SSE2.
6130 2021-08-27 Ben Wagner <bungeman@chromium.org>
6132 [smooth] Detect SSE2 with MSVC for x86
6134 MSVC does not set `__SSE2__`. Instead one must check whether `_M_IX86_FP` is
6135 defined and greater than or equal to 2.
6137 * src/smooth/ftgrays.c (FT_SSE2): New macro.
6138 Use it where appropriate.
6140 2021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com>
6142 Expand comment (cont'd).
6144 2021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com>
6148 2021-08-24 Alexei Podtelezhnikov <apodtele@gmail.com>
6150 * src/smooth/ftgrays.c (gray_render_conic): Refactor redundancy.
6152 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
6154 [truetype] Fix for the family name shorter than 8 characters.
6156 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag):
6157 If the family name to be checked is shorter than 8 characters,
6158 do not check its syntax.
6160 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
6162 [truetype] Simplify `trick_names'.
6164 * src/truetype/ttobjs.c (tt_check_trickyness_family): For the case
6165 that the beginning part of a long tricky family name is already
6166 registered as another tricky family name, no need to double-check
6167 the longer one. Such long tricky family names are removed from
6170 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
6172 [truetype] Add 2 tricky font names.
6174 Additional fix for the issue #1087.
6176 * src/truetype/ttobjs.c (tt_check_trickyness_family): Add 2 tricky
6177 font names reported in #1087.
6179 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
6181 [truetype] New function to skip the randomization tag.
6183 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag):
6184 New function to skip the randomization tag in the names of the
6185 fonts embedded in a PDF. It is used by tt_check_trickyness_family(),
6186 to keep from mistaking "DLC" in the randomization tag as a
6187 tricky font name. See discussion in:
6189 https://lists.nongnu.org/archive/html/freetype-devel/2021-02/msg00002.html
6191 For technical detail about the randomization tag, please find
6192 PDF Reference 5.5.3 "Font Subsets". Thanks to Justyna Wawrzynska
6193 for pointing out the issue caused by the randomization tag.
6195 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
6197 [truetype] Add checksums for 2 tricky fonts.
6199 Thanks to Ting717 for providing sample PDF. Fixes #1087.
6201 * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Add
6202 checksums for 2 tricky fonts `DFHei-Bd-WIN-HK-BF' and
6203 `DFMing-Md-WIN-HK-BF'.
6205 2021-08-23 Alexei Podtelezhnikov <apodtele@gmail.com>
6207 Whitespace formatting.
6209 2021-08-22 Alexei Podtelezhnikov <apodtele@gmail.com>
6211 Decorate const arguments.
6213 * src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it.
6214 * include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap):
6217 2021-08-21 Alexei Podtelezhnikov <apodtele@gmail.com>
6219 [smooth] Clean up the null cell usage.
6221 Put the null cell at the end of the pool and store it explicitly so that
6222 we can use it as both the limit and the dumpster.
6224 * src/smooth/ftgrays.c (gray_TWorker): Store the last `cell_null` and
6225 remove unnecesary fields.
6226 (NULL_CELL_PTR, CELL_IS_NULL): Remove in favor of explicit `cell_null`.
6227 (gray_dump_cells, gray_set_cell, gray_sweep{,_direct}): Update callers.
6228 (gray_convert_glyph_inner): Trace remaining cells (oh well).
6229 (gray_convert_glyph): Set up `cell_null` and slightly improve the pool
6232 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
6234 [base] Restore quiet no-op rendering of bitmap glyphs.
6238 * src/base/ftobjs.c (FT_Render_Glyph_Internal): Discard an error when
6239 rendering a bitmap glyph.
6241 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
6243 [smooth] Fortify 64-bit algorithm.
6245 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): s/long/FT_Int64/ and
6246 s/unsigned long/FT_UInt64/.
6247 (gray_render_line): Adjust a critical variable type.
6249 2021-08-20 Carlo Bramini <carlo.bramix@libero.it>
6251 * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.
6253 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
6255 Determine `long long` availability based on its size.
6257 MSVC, for example, used `long long` even without full C99 support.
6259 * include/freetype/config/ftstdlib.h: Check if `long long` limits are
6260 defined in <limits.h>.
6261 * include/freetype/config/integer-types.h: Check `long long` size and
6262 use it to typedef FT_Int64.
6264 2021-08-19 Dominik Röttsches <drott@chromium.org>
6266 [sfnt] Fix format expectation for `COLR` v1 ClipList
6268 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Change ClipList
6269 format expectation to 1 instead of 0 to make it compliant with the
6272 2021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
6274 Readily use `long long` as a 64-bit type in C99 mode.
6276 * include/freetype/config/integer-types.h (FT_INT64):
6277 FT_CONFIG_OPTION_FORCE_INT64 is no longer required to use `long long`.
6279 2021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
6281 Use FT_INT64 instead of FT_LONG64.
6283 * include/freetype/config/integer-types.h: Remove synonymous FT_LONG64.
6284 * include/freetype/internal/ftcalc.h: s/FT_LONG64/FT_INT64/.
6285 * src/base/ftcalc.c: Ditto.
6286 * src/base/fttrigon.c: Ditto.
6287 * src/smooth/ftgrays.c: Ditto.
6289 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
6291 [builds/windows] Do not set CharacterSet for VC++.
6293 * builds/windows/vc2010/freetype.vcxproj: s/Unicode/NotSet/.
6294 * builds/windows/visualc/freetype.vcproj: s/"1"/"0"/.
6296 2021-08-18 Werner Lemberg <wl@gnu.org>
6298 * src/sdf/ftsdf.c (get_control_box): Fix compiler warning.
6300 2021-08-18 Werner Lemberg <wl@gnu.org>
6302 [base] Fix ppem size overflow.
6306 * src/base/ftobjs.c (FT_Request_Metrics): Add return value.
6307 Check whether ppem values fit into unsigned short values.
6308 (FT_Request_Size): Updated.
6310 * include/freetype/internal/ftobjs.h: Updated.
6312 * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c
6313 (cid_size_request), src/truetype/ttdriver.c (tt_size_request),
6314 src/type1/t1objs.c (T1_Size_Request): Updated.
6316 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
6318 * builds/windows/ftsystem.c (FT_Stream_Open): Cast to remove warning.
6320 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
6322 * builds/windows/ftsystem.c (FT_Stream_Open): Support UNICODE compilation.
6324 2021-08-09 Werner Lemberg <wl@gnu.org>
6326 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Minor fix.
6328 2021-08-09 Dominik Röttsches <drott@chromium.org>
6330 [sfnt] Add missing blend mode 'plus' to 'COLR' v1.
6332 * include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode
6333 'plus' after it was added to the spec.
6335 2021-08-08 Werner Lemberg <wl@gnu.org>
6337 include/freetype/freetype.h (FT_Encoding): Improve documentation.
6339 Based on a suggestion by Antony Lee <anntzer.lee@gmail.com>.
6341 2021-08-07 Werner Lemberg <wl@gnu.org>
6343 [smooth] Avoid integer overflow.
6347 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36243
6349 * src/smooth/ftgrays.c(ADD_LONG, SUB_LONG, MUL_LONG, NEG_LONG)
6350 [STANDALONE_]: Removed, unused.
6351 (ADD_INT) [STANDALONE_]: New macro.
6352 (FT_INTEGRATE): Use ADD_INT.
6354 2021-08-07 Dominik Röttsches <drott@chromium.org>
6356 [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table.
6358 The optional 'COLR' v1 glyph-specific clip box helps upstream graphics
6359 libraries allocate a sufficiently large bitmap for a glyph without having to
6360 traverse the glyph graph for that. See
6362 https://github.com/googlefonts/colr-gradients-spec/issues/251
6364 for background on the introduction of this specification change.
6366 * include/freetype/ftcolor.h (FT_ClipBox): New structure.
6367 (FT_Get_Color_Glyph_ClipBox): New function declaration.
6369 * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_ClipBox_Func):
6371 (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Use it.
6373 * src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API
6374 with SFNT implementation.
6376 * src/sfnt/sfdriver.c (sfnt_interface): Updated.
6377 * src/sfnt/ttcolr.c (Colr): New field `clip_list`.
6378 (tt_face_load_colr): Parse global clip list offset.
6379 (tt_face_get_color_glyph_clipbox): New function to find the clip box for a
6380 glyph id from the clip list array.
6381 * src/sfnt/ttcolr.h: Updated.
6383 2021-08-06 Werner Lemberg <wl@gnu.org>
6385 [smooth] Fix left shifts of negative numbers.
6389 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36241
6391 * src/smooth/ftgrays.c (LEFT_SHIFT): New macro.
6392 (gray_render_conic) [BEZIER_USE_DDA]: Use it.
6394 2021-08-02 Werner Lemberg <wl@gnu.org>
6396 * meson.build: Fix zlib support.
6398 This commit synchronizes zlib support with both autotools and cmake: If no
6399 external zlib is found (or intentionally disabled on the command line), use
6400 the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without
6401 modifying `FT_CONFIG_OPTION_USE_ZLIB`.
6403 Also improve summary output.
6405 Problem reported by Moazin.
6407 2021-08-02 Anuj Verma <anujv@iitbhilai.ac.in>
6409 [sdf] Fix out-of-range-access.
6411 * src/sdf/ftbsdf.c (first_pass, second_pass): Fix range during forward pass.
6412 Otherwise the index goes out of range for the last column.
6416 2021-08-02 Anuj Verma <anujv@iitbhilai.ac.in>
6418 Fix invalid memory access in `bsdf` rasterizer.
6420 Do not generate SDF from bitmap if the `FT_GLYPH_OWN_BITMAP` flag is not
6421 set. In some cases the bitmap buffer is freed but still points to a valid
6422 address; to handle those cases check the flag before accessing the memory.
6424 * src/sdf/ftsdfrend.c (ft_bsdf_render): Handle the above case.
6425 Also, return an error message if the bitmap's rows/pitch is invalid,
6426 otherwise `slot->buffer` might be assigned to some invalid memory location.
6427 (ft_sdf_render): Same as above.
6428 Plus, move the outline back to original state after rasterization and not if
6431 2021-07-29 Heiko Becker <heirecka@exherbo.org>
6433 * meson.build: Honor `--includedir` instead of hard-coding 'include'.
6435 2021-07-29 Werner Lemberg <wl@gnu.org>
6437 src/sfnt/ttcolr.c: Minor formatting.
6439 2021-07-29 Dominik Röttsches <drott@chromium.org>
6441 [sfnt] 'COLR' v1 PaintSweepGradient spec update
6443 * src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other
6444 spec changes and now has the angles specified as F2DOT14, reflect
6445 that in the implementation.
6446 * include/freetype/ftcolor.h (FT_PaintSweepGradient): Update
6449 2021-07-29 Dominik Röttsches <drott@chromium.org>
6451 [sfnt] Retrieve affine matrix from offset in 'COLR' v1 parsing.
6453 * src/sfnt/ttcolr.c (read_paint): Implement spec change where
6454 affine transform matrix is now referenced by offset instead of
6455 being placed inline in the PaintTransform table.
6457 2021-07-29 Dominik Röttsches <drott@chromium.org>
6459 [sfnt] 'COLR' v1 PaintSkew related spec updates
6461 * src/sfnt/ttcolr.c (read_paint): Implement spec changes around
6462 PaintSkew, PaintSkewAroundCenter. Update parsing to read shorter
6463 values as changed in the spec.
6464 * include/freetype/ftcolor.h (FT_PaintSkew): Update documentation.
6466 2021-07-29 Dominik Röttsches <drott@chromium.org>
6468 [sfnt] PaintRotate/PaintRotateAroundCenter spec updates
6470 * src/sfnt/ttcolr.c (read_paint): Implement spec change where
6471 PaintRotate and PaintRotateAroundCenter were split for a more
6472 compact format definition. Update parsing to read shorter values
6473 as changed in the spec.
6474 * include/freetype/ftcolor.h (FT_PaintRotate): Update documentation.
6476 2021-07-29 Dominik Röttsches <drott@chromium.org>
6478 [sfnt] 'COLR' v1 PaintTranslate and PaintScale precision
6480 * src/sfnt/ttcolr.c (read_paint): Implement spec changes in
6481 PaintTranslate and PaintScale and friends. Update parsing to read
6484 2021-07-29 AnuthaDev <anuthadev@gmail.com>
6486 README.git: Add Code of Conduct.
6488 2021-07-25 Werner Lemberg <wl@gnu.org>
6490 ChangeLog housekeeping.
6492 Archive old `ChangeLog` file.
6494 We no longer write ChangeLog entries manually; instead, the file will be
6495 created from commit messages (which should be formatted in GNU's ChangeLog
6498 gitlog-to-changelog --format='%B%n'
6500 or something similar (this script is part of the 'gnulib' repository).
6502 2021-07-24 Werner Lemberg <wl@gnu.org>
6504 Fix some `cppcheck` warnings.
6506 * src/bzip2/ftbzip2.c (ft_bzip2_file_skip_output), src/gzip/ftgzip.c
6507 (ft_gzip_file_skip_output): Reduce scope of `delta`.
6509 * src/psaux/psintrp.c, src/psaux/psintrp.h (cf2_interpT2CharString): Add
6510 `const` to `buf` parameter.
6512 * src/raster/ftraster.c (DelOld): Add `const` to `profile` parameter.
6513 (Vertical_Sweep_Span): Reduce scope of `target`.
6514 (FT_Outline_Get_CBox): Reduce scope of `xMin`, `xMax`, `yMin`, `yMax`.
6516 * src/smooth/ftgrays.c (gray_render_conic): Reduce scope of `split`.
6517 (gray_sweep, gray_sweep_direct): Reduce scope of `area`.
6519 * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Reduce scope of
6522 2021-07-24 AnuthaDev <anuthadev@gmail.com>
6524 * .gitlab-ci.yml: Fixed cmake build, using correct options.
6526 2021-07-24 AnuthaDev <anuthadev@gmail.com>
6528 * CMakeLists.txt: Make `cmake` handle disabled dependencies correctly.
6530 Include 'CMakeDependentOption'.
6532 Replace `FT_WITH_XXX` options with `FT_DISABLE_XXX` and `FT_REQUIRE_XXX`
6533 pairs. Update option logic accordingly.
6537 2021-07-24 Ben Wagner <bungeman@chromium.org>
6539 [autofit] Split `afwrtsys.h`.
6541 The header file `afwrtsys.h` has two distinct functions: to include the
6542 required writing system headers and also to generate code for each writing
6543 system. At each current use site only one or the other is used, with
6544 various macro trickery selecting one or the other. Split this header into
6545 `afws-decl.h` for the required writing system declarations and `afws-iter.h`
6546 for iterating over the writing systems to generate code.
6548 The motivation for this change is that the Visual C++ compiler treats the
6549 standard include guard idiom like `#pragma once` 'if no non-comment code or
6550 preprocessor directive comes before or after the standard form of the
6551 idiom'. It appears to check this after macro expansion, so if
6552 `WRITING_SYSTEM` expands to empty the bottom of `afwrtsys.h` is empty and
6553 looks like the standard include guard idiom which is treated like `#pragma
6554 once`, so subsequent inclusion of `afwrtsys.h` is elided.
6558 * src/autofit/afglobal.c (af_writing_system_classes), src/autofit/aftypes.h
6559 (AF_WritingSystem), src/autofit/rules.mk (AUTOF_DRV_H): Updated.
6561 * src/autofit/afwrtsys.h: Split into...
6562 * src/autofit/afws-decl.h, src/autofit/afws-iter.h: New files.