1 2023-02-09 Werner Lemberg <wl@gnu.org>
3 * Version 2.13 released.
4 ==========================
6 Tag sources with `VER-2-13-0'.
8 * docs/VERSION.TXT: Add entry for version 2.13.
9 * docs/CHANGES: Updated.
11 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
12 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
13 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
14 docs/freetype-config.1: s/2.12.1/2.13/, s/2121/2130/.
16 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 13.
17 (FREETYPE_PATCH): Set to 0.
19 * builds/unix/configure.raw (version_info): Set to 25:0:19.
20 * CMakeLists.txt (VERSION_MINOR): Set to 13.
21 (VERSION_PATCH): Set to 0.
23 2023-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
25 Comment on `FT_GlyphSlot_Slant'.
27 2023-02-08 Werner Lemberg <wl@gnu.org>
29 [autofit] Fix 'multi' compilation.
31 * src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`.
32 Add ANSI boilerplate code for otherwise empty file.
33 * src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`.
34 Use `FT_BEGIN_HEADER` and `FT_END_HEADER`.
35 Decorate with `FT_LOCAL`.
37 * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
39 2023-02-08 Werner Lemberg <wl@gnu.org>
41 Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags.
43 2023-02-08 Werner Lemberg <wl@gnu.org>
45 Fix 'fall-through' warning messages.
47 Modern compilers get more insistent on that...
49 * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Define.
50 * src/*: Use it instead of `/* fall through */` comments.
52 2023-02-08 Werner Lemberg <wl@gnu.org>
54 For debugging, avoid implicit conversion from integer to double.
56 Otherwise we get zillions of clang 15 warnings.
58 * src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
59 src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c,
60 src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c,
61 src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use
62 `double` cast in debugging and tracing macros.
64 2023-02-08 Werner Lemberg <wl@gnu.org>
66 Avoid reserved identifiers that are globally defined.
68 This is mandated by the C99 standard, and clang 15 produces zillions of
71 * devel/ftoption.h, include/freetype/config/ftoption.h,
72 include/freetype/internal/ftmemory.h, src/autofit/afhints.h,
73 src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c,
74 src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c,
75 src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
77 2023-02-08 Werner Lemberg <wl@gnu.org>
79 Fix minor clang and clang++ warnings.
81 2023-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
83 [truetype, type1] Additional variation tags.
86 https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags
88 * src/truetype/ttgxvar.h (TTAG_ital): New tag.
89 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it.
90 * src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'.
92 2023-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
94 * src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant.
95 * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it.
97 2023-02-08 anuj <95867901+anuj99@users.noreply.github.com>
99 [sdf] Use 32-bit integers internally.
101 * src/sdf/ftsdfcommon.h (FT_16D16, FT_26D6): Use 32-bit integers
102 instead of `FT_Fixed` for internal data types. `FT_Fixed` i.e.
103 `signed long` is 64-bit on some architectures.
105 2023-02-07 Werner Lemberg <wl@gnu.org>
107 docs/CHANGES: Updated.
109 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
111 Comment on optional ascender and descender.
113 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
115 * src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender.
117 2023-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
119 * src/type1/t1afm.c (T1_Read_Metrics): Validate ascender and descender.
121 The ascender and descender are optional in the AFM specifications.
122 They could be omitted or even set to zero, e.g., in the current release
123 of URW++ base 35 fonts.
125 2023-02-02 Werner Lemberg <wl@gnu.org>
127 * src/cff/cffgload.c (cff_slot_load): Avoid memory leak.
131 2023-02-01 Werner Lemberg <wl@gnu.org>
133 * src/truetype/ttgxvar.c (tt_var_get_item_delta): Check `face->blend`.
137 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55581
139 2023-02-01 Werner Lemberg <wl@gnu.org>
141 * docs/CHANGES: Add news for 'freetype-demos'.
143 2023-01-30 Werner Lemberg <wl@gnu.org>
145 * subprojects/harfbuzz.wrap, subprojects/libpng.wrap: Updated.
147 2023-01-28 Werner Lemberg <wl@gnu.org>
151 Comment fixes, typos, removing of unnecessary parentheses.
153 2023-01-28 Werner Lemberg <wl@gnu.org>
157 2023-01-27 Behdad Esfahbod <behdad@behdad.org>
159 [ttgxvar] Fix crash in COLRv1.
161 This is a stopgap until issue #1202 is properly fixed.
163 * src/truetype/ttxgvar.c (tt_var_get_item_delta): Check `normalizedcoords`.
165 2023-01-19 Werner Lemberg <wl@gnu.org>
167 The 'COLR' v1 API will no longer be experimental in the next release.
169 2023-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
171 * docs/oldlogs/ChangeLog.210: Typos.
173 2023-01-18 Ben Wagner <bungeman@chromium.org>
177 * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Request module 't1cid',
180 2023-01-18 Ben Wagner <bungeman@chromium.org>
182 [base] Return error if requested driver is not found.
184 In `open_face_from_buffer` it is possible that a driver is requested but
185 FreeType was built without the requested module. Return an error in this
186 case to indicate that the request could not be satisfied, rather than trying
187 all existing driver modules.
189 * src/base/ftobjs.c (open_face_from_buffer): Return `FT_Err_Missing_Module`
190 if a driver is specified but not found.
192 2023-01-18 Dominik Röttsches <drott@chromium.org>
194 [sfnt] Avoid nullptr dereference in reading malformed 'COLR' v1 table.
196 Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1408044.
198 * src/sfnt/ttcolr.c (tt_face_load_colr): When the 'COLR' v1 table header is
199 too small, don't deallocate delta set index map structures.
201 2023-01-17 Werner Lemberg <wl@gnu.org>
203 * src/tools/update-copyright: Allow execution from other repositories.
205 We use this for `freetype-demos`.
207 2023-01-17 Werner Lemberg <wl@gnu.org>
209 Update all copyright notices.
211 2023-01-17 Werner Lemberg <wl@gnu.org>
213 * src/tools/no-copyright: Updated.
215 2023-01-17 Ben Wagner <bungeman@chromium.org>
217 [base] 'close' callback may not use `stream->memory`.
219 The documentation for `FT_StreamRec::memory` states that it 'shouldn't be
220 touched by stream implementations'. This is true even for internal
221 implementations of the 'close' callback, since it is not guaranteed that
222 `memory` will even be set when the 'close' callback occurs.
224 * src/base/ftobjs.c (new_memory_stream): stash current `memory` in
225 `stream->descriptor`.
226 (memory_stream_close): Use it.
228 2023-01-17 Ben Wagner <bungeman@chromium.org>
230 [base] Always close user-provided stream.
232 The `FT_Open_Face` documentation states
234 > If `FT_OPEN_STREAM` is set in `args->flags`, the stream in `args->stream`
235 > is automatically closed before this function returns any error (including
236 > `FT_Err_Invalid_Argument`).
238 However, if the user provides a stream in `args.stream` with
239 `FT_OPEN_STREAM` set and a `close` function, but then for some reason passes
240 NULL for `aface` and a non-negative `face_index`, the error
241 `Invalid_Argument` is returned but the `close` callback will not be called
242 on the user-provided stream. This may cause resource leaks if the caller is
243 depending on the `close` callback to free resources.
245 The difficulty is that a user may fill out a `FT_StreamRec` and pass its
246 address as `args.stream`, but the stream isn't really 'live' until
247 `FT_Stream_New` is called on it (and `memory` is set). In particular, it
248 cannot really be cleaned up properly in `ft_open_face_internal` until the
249 stream pointer has been copied into the `stream` local variable.
251 * src/base/ftobj.c (ft_open_face_internal): Ensure that user-provided
252 `args.stream.close` is called even with early errors.
254 2023-01-17 Ben Wagner <bungeman@chromium.org>
256 [base] Fix leak of internal stream marked external.
258 `open_face_from_buffer` allocates a new `FT_Stream` to pass to
259 `ft_open_face_internal`. Because this is an `FT_OPEN_STREAM`,
260 `ft_open_face_internal` will mark this as an 'external stream', which the
261 caller must free. However, `open_face_from_buffer` cannot directly free it
262 because the stream must last as long as the face. There is currently an
263 attempt at this by clearing the 'external stream' bit after
264 `open_face_from_buffer` returns successfully. However, this is too late as
265 the original stream may have already been closed and the stream on the face
266 may not be the same stream as originally passed.
268 It is tempting to use `FT_OPEN_MEMORY` and let `ft_open_face_internal`
269 create the stream internally. However, with this method there is no means
270 to pass through a 'close' function to the created stream to free the
271 underlying data, which must be owned by the stream.
273 A possibility is to check on success if the stream of the face is the same
274 as the original stream. If it is then unset the external flag. If not,
275 then free the original stream. Unfortunately, while no current
276 implementation does so, it is possible that the face still has the original
277 stream somewhere other than as the `FT_FaceRec::stream`. The stream needs
278 to remain available for the life of the face or until it is closed,
279 whichever comes earlier.
281 The approach taken here is to let the stream own itself. When the stream is
282 closed it will free itself.
284 * src/base/ftobjs.c (memory_stream_close): Free `stream`.
285 (open_face_from_buffer): Simplify error handling, since
286 `ft_open_face_internal` always closes `args.stream` on any error.
288 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54930
290 2023-01-16 Werner Lemberg <wl@gnu.org>
292 sr/*.c: Various minor fixes.
294 * src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after
295 variable declarations.
297 * src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate
300 * src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++
303 * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid
306 * src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning.
308 2023-01-16 Dominik Röttsches <drott@chromium.org>
310 [sfnt] Remove temporary runtime flag for variable 'COLR' v1.
314 * src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr,
315 tt_face_free_colr, get_deltas_for_var_index_base,
316 tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro
317 definition `VARIABLE_COLRV1_ENABLED` and its usage.
319 * src/truetype/ttdriver.c (tt_property_set): Remove parsing of
320 'TEMPORARY-enable-variable-colrv1' property name.
322 * src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1`
325 2023-01-07 Werner Lemberg <wl@gnu.org>
327 * src/autofit/ft-hb.c (_hb_ft_reference_table): Minor integration fixes.
329 2023-01-07 Ben Wagner <bungeman@chromium.org>
331 [truetype] Reset cvt and storage in context load.
333 Currently the cvt and storage are saved and restored in `TT_RunIns`.
334 However, this is too granular as the cvt and storage area should be set to
335 the original cvt and storage area only when setting up the hinting context.
336 This allows for the cvt and storage area to be modified while parsing
337 multiple glyphs, as is the case with composite glyphs.
339 * src/truetype/ttinterp.h (TT_ExecContextRec): Remove `origCvt` and
342 * src/truetype/ttinterp.c (TT_RunIns): Don't save and restore the cvt and
344 (Modify_CVT_Check, Ins_WS): Switch from "if in glyph and using original data
345 do copy on write" to "if in glyph and not using glyph specific data do copy
348 2023-01-06 Matthias Clasen <mclasen@redhat.com>
350 [autofit] Don't depend on 'hb-ft'.
352 The circular dependency is still there, but at least we no longer depend on
353 the HarfBuzz API that is only present if HarfBuzz has been built with
354 FreeType support, making the bootstrapping a bit easier.
356 * src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing
357 `_hb_ft_font_create`, which is more or less a verbatim copy of the
358 corresponding HarfBuzz code from file `hb-ft.cc`.
360 * src/autofit/afglobal.c (af_face_globals_new): Use it.
361 * src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`.
362 * src/autofit/autofit.c: Include `ft-hb.c`.
364 * LICENSE.TXT: Updated.
366 2023-01-06 Ben Wagner <bungeman@chromium.org>
368 [truetype] Keep variation store consistent.
370 `tt_var_load_item_variation_store` fills out a `GX_ItemVarStore`. While it
371 may return an error, the item store must be left in a consistent state so
372 that any use or destruction of the item store can properly use or free the
373 data in it. Before this change the counts from the font data were read
374 directly into the item store before the actual allocation of the arrays to
375 which they referred. There exist many opportunities between the time the
376 counts are read and the arrays are allocated to return early due to invalid
377 data. When this happened the item store claimed to have entires it actually
378 did not, leading to crashes later when it was used.
380 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54449
382 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Read the counts
383 into local variables and store them in the item store only after the related
384 arrays are actually created on the item store.
386 2023-01-05 Ben Wagner <bungeman@chromium.org>
388 [base] Report used stream's external status.
390 In `open_face` the initial stream is set on the face, along with the
391 information about if FreeType is the owner of the stream object itself. The
392 loaders may in the course of their work replace this stream with a new
393 stream (as is the case for 'woff' and 'woff2'), which may have a different
394 ownership than the initial stream object (likely the original stream object
395 is owned by the user and is external, while the new stream object is created
396 internally to FreeType and is internal). When the stream is replaced, the
397 face's flags are updated with the new ownership status.
399 However, `open_face` cannot itself free this stream as its caller
400 `ft_open_face_internal` is responsible for this. In addition, in the case
401 of an error `open_face` cannot return an actual face with the new stream and
402 its ownership status to the caller. As a result, it must pass this
403 information back to the caller as a sort of "failed face" so that the caller
406 `open_face` was already passing back the new stream but was not passing back
407 the stream ownership information. As a result the stream may not have been
410 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54700
412 * src/base/ftobjs.c (open_face): Pass back the ownership information as
414 (ft_open_face_internal): Updated.
416 2023-01-05 Noah Cabral <cnoah1705@gmail.com>
418 fix spelling err in LICENSE.txt
420 2023-01-05 Dominik Röttsches <drott@chromium.org>
422 [sfnt] Fix color stop bounds check calculation at table end.
424 Fixes https://bugs.chromium.org/p/skia/issues/detail?id=14021
426 * src/sfnt/ttcolr.c (VAR_IDX_BASE_SIZE): New macro.
427 (tt_face_get_colorline_stops): Fix off-by-one bounds check calculation, take
428 `VarColorStop` into account, and hopefully make it easier to read.
430 2023-01-05 Alexei Podtelezhnikov <apodtele@gmail.com>
432 * src/base/ftobjs.c (FT_Request_Metrics): Avoid division by zero.
434 The division-by-zero might happen in broken fonts (see #1194).
435 Instead of returning a huge number from FT_DivFix and failing
436 to scale later, we now bail immediately.
438 2022-12-20 Alexei Podtelezhnikov <apodtele@gmail.com>
440 [psaux] Delay the upem validity assertion.
\r
444 * src/psaux/psft.c (cf2_getUnitsPerEm): Remove the upem assert.
\r
445 (cf2_checkTransform): Assert the upem validity after checking the scale.
447 2022-12-14 David Vanderson <david.vanderson@gmail.com>
448 Werner Lemberg <wl@gnu.org>
450 [gzip] Make static compilation not leak global symbols.
452 * src/gzip/ftgzip.c (HAVE_HIDDEN): Do not define; it is no longer needed
453 because everything is static.
454 (HAVE_MEMCPY): Define.
455 (zcalloc, zcfree): Remove no longer needed definitions (because `Z_SOLO` is
458 * src/gzip/patches/freetype-zlib.diff: Regenerated.
462 2022-12-14 Werner Lemberg <wl@gnu.org>
464 * src/gzip/ftzconf.h: Updated to zlib 1.2.13.
466 I forgot to copy that file.
468 2022-12-14 Werner Lemberg <wl@gnu.org>
470 * builds/unix/configure.raw: Don't check for `memcpy` and `memmove`.
472 We expect a C99 compiler, and both functions are part of this standard.
474 2022-12-13 Werner Lemberg <wl@gnu.org>
476 [sdf, sfnt] Handle minor compiler warnings.
478 * src/sdf/ftsdf.c (get_min_distance_conic): Initialize `nearest_point`.
480 * src/sfnt/ttsvg.c (find_doc): Initialize `mid_doc`.
484 2022-12-07 Werner Lemberg <wl@gnu.org>
486 * subprojects/zlib.wrap: Micro-update from upstream.
488 2022-12-06 Jiří Malák <malak.jiri@gmail.com>
490 * include/freetype/internal/ftcalc.h (FT_MSB): Support Open Watcom 2.0.
494 2022-11-23 Luca Bacci <luca.bacci982@gmail.com>
496 * src/base/ftdbgmem.c (ft_mem_source_compare): Add FT_COMPARE_DEF.
500 2022-11-21 Alexei Podtelezhnikov <apodtele@gmail.com>
502 * src/autofit/afloader.c (af_loader_load_glyph): Remove `size` check.
504 This is done by `FT_Load_Glyph`.
506 2022-11-18 Alexei Podtelezhnikov <apodtele@gmail.com>
510 2022-11-16 Johan Matsson <mjunix@ at github>
512 * src/autofit/afloader.c (af_loader_load_glyph): Fix dereference.
514 This must happen after the NULL check.
518 https://github.com/freetype/freetype/pull/2
520 2022-11-15 Alexei Podtelezhnikov <apodtele@gmail.com>
522 * src/pcf/pcfutil.c ({Two,Four}ByteSwap): Use builtins or shifts.
524 We trust glibc which uses shifts or builtins to swap bytes. This
525 must be more efficient.
527 2022-11-14 Werner Lemberg <wl@gnu.org>
529 * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Integer overflow.
533 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50462
535 2022-11-14 Loïc Yhuel <loic.yhuel@softathome.com>
537 [meson] Use generated ftmodule.h
539 ftmodule.h is generated at the root of the build directory, but FT_CONFIG_MODULES_H
540 (freetype/config/ftmodule.h) is used instead.
541 This makes the build fail when disabling modules in modules.cfg.
543 * meson.build (harfbuzz_dep): Add '-DFT_CONFIG_MODULES_H=<ftmodule.h>'.
545 2022-11-14 Loïc Yhuel <loic.yhuel@softathome.com>
547 [meson] Fix generated ftmodule.h
549 The sdf module wasn't recognized, so the generated ftmodule.h had "None_renderer_class".
551 * builds/meson/parse_modules_cfg.py: Handle sdf in RASTER_MODULES.
553 2022-11-12 Dominik Röttsches <drott@chromium.org>
555 Add `TT_CONFIG_OPTION_NO_BORING_EXPANSION` configuration macro.
557 This gives users a possibility to deactivate new features not (yet) in the
560 * include/freetype/config/ftoption.h, devel/ftoption.h
561 (TT_CONFIG_OPTION_NO_BORING_EXPANSION): New macro.
563 * src/truetype/ttgxvar.c (ft_var_load_avar): Use it to disable 'avar'
566 2022-11-12 Behdad Esfahbod <behdad@behdad.org>
568 [truetype] Improve bounds checks for `ItemVariationStore`.
570 * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Move bounds check ...
571 (tt_var_get_item_delta): ... to this function, because it is safer. For
572 example, the 'avar' table 2.0 codepath was not performing a bounds check at
575 2022-11-12 Behdad Esfahbod <behdad@behdad.org>
577 [truetype] In `ItemVariationStore`, value 0xFFFF for `dataCount` is valid.
579 It corresponds to outer indices of 0 to 0xFFFE.
581 * src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Remove invalid
584 2022-11-11 Alexei Podtelezhnikov <apodtele@gmail.com>
586 [pcf] Improve CMap efficiency and readability.
588 * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Check and walk
589 the encoding array indexes.
591 2022-11-10 Sam James <sam@gentoo.org>
593 Fix `-Wstrict-prototypes`.
595 * builds/unix/configure.raw: Fix `-Wstrict-prototypes`.
596 Clang 16 warns on these and they will be dropped in C23.
598 * builds/unix/freetype2.m4: Ditto.
600 2022-11-09 Ben Wagner <bungeman@chromium.org>
602 [truetype] Check avar_segment before access
604 * src/truetype/ttgxvar.c (tt_done_blend): check `avar_segment` before
605 accessing to free its `correspondence`.
609 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53062
611 2022-11-09 Ben Wagner <bungeman@chromium.org>
613 [truetype] Restore behavior of ft_var_load_hvvar
615 * src/truetype/ttgcvar.c (ft_var_load_hvvar): restore previous behavior
617 In a previous change [0] the behavior of `ft_var_load_hvvar` was changed
618 to not load the item variation store if it was at offset 0, but not
619 return an error when this happened. This broke any users, like
620 `tt_hvadvance_adjust`, that rely on successful completion of
621 `ft_var_load_hvvar` to imply that returned table's `itemStore` had been
622 initialized. This lead such users to dereference NULL.
624 This change appears to have been unintentional and unrelated to the
625 actual avar2 changes. As a result, fix these NULL dereferences by
626 restoring the code to always attempt to initialize the `itemStore`.
628 [0] ae4eb996 "[truetype] Add support for `avar` table 2.0 format."
632 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53061
634 2022-11-08 Werner Lemberg <wl@gnu.org>
636 docs/CHANGES: Updated.
638 2022-11-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
640 [build] use AC_CHECK_PROG() macro for libpng-config detection
642 * builds/unix/configure.raw: use AC_CHECK_PROG() instead of `which` to find `libpng-config`.
644 2022-11-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
646 [build] fix for make multi
648 Fix "make multi" by MR !223
650 * include/freetype/internal/services/svmm.h: include ftmm.h to define FT_Get_MM_Func.
651 * src/truetype/ttgxvar.h: include ftmmtypes.h to use GX_AVarTable properly.
652 * src/base/ftmac.c: include ftdebug.h to use FT_THROW() properly.
654 2022-11-08 Alexei Podtelezhnikov <apodtele@gmail.com>
656 * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Accelerate the search.
658 This is mostly for consistency because PFR fonts with bitmap strikes
659 do not seem to exist.
661 2022-11-06 Alexei Podtelezhnikov <apodtele@gmail.com>
663 [bdf, pfr, psnames] Accelarate charmap searches.
665 The binary searches within charmaps can be accelerated because they
666 often contain dense continuous blocks of character codes. Within such
667 blocks, you can predict matches based on misses. This method has been
668 deployed in `bdf` since 0f122fef34; we only refactor it there. We now
669 use it in `pfr` and `psnames`, which speeds up the unicode charmap
670 access by about 50% in PFR and Type 1 fonts.
672 * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Refactor.
673 * src/pfr/pfrcmap.c (pfr_cmap_char_{index,next}): Predict `mid` based
674 on the mismatch distance.
675 * src/psnames/psmodule.c (ps_unicodes_char_{index,next}): Ditto.
677 2022-11-04 Behdad Esfahbod <behdad@behdad.org>
679 [truetype] Add support for `avar` table 2.0 format.
683 https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2.md
685 for the specification.
687 Currently, this is implemented only in most recent OS versions on Apple
688 platforms and in the HarfBuzz library, but it is expected to be added to the
689 OpenType standard soon.
691 * src/truetype/ttgxvar.h (GX_AVarTableRec): New structure.
692 (GX_BlendRec): Use it to replace `avar_segment` with `avar_table`.
694 * src/truetype/ttgxvar.c (ft_var_load_avar): Load new table version.
695 (ft_var_to_normalized, tt_done_blend): Extend for new format.
696 (ft_var_load_hvvar, ft_var_to_design): Updated.
698 2022-10-24 Werner Lemberg <wl@gnu.org>
700 Replace '1/64th' (and similar entries) with '1/64' in docs and comments.
702 2022-10-24 Ivan Panchenko <ivanpan3@gmail.com>
704 * include/freetype/*: Fix documentation typos.
706 2022-10-21 Alexei Podtelezhnikov <apodtele@gmail.com>
708 * src/truetype/ttgload.c: Cosmetic changes.
710 2022-10-21 Alexei Podtelezhnikov <apodtele@gmail.com>
712 [cff, truetype] Simplify SVG metrics scaling.
714 Use pre-calculated scaling factors. Also, the advance widths used
715 to be rounded, which was incorrect.
717 * src/cff/cffgload.c (cff_slot_load): Use `x_scale` and `y_scale`.
718 * src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
720 2022-10-20 Werner Lemberg <wl@gnu.org>
722 * subprojects/zlib.wrap: Update to zlib version 1.2.13.
724 2022-10-18 Dominik Röttsches <drott@chromium.org>
726 [sfnt] Additional bounds checks for `COLR` v1 table handling.
728 * src/sfnt/ttcolr.c (read_paint): Add `colr` argument, necessary for...
729 ... another use of `ENSURE_READ_BYTES`.
731 (tt_face_get_paint_layers): Ensure that the 4-byte paint table
734 This is a follow-up to !124 and issue
735 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404
737 2022-10-18 Werner Lemberg <wl@gnu.org>
739 [gzip] Update sources to zlib 1.2.13.
741 2022-10-18 Alexei Podtelezhnikov <apodtele@gmail.com>
743 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Simplify calculations.
745 2022-10-18 Werner Lemberg <wl@gnu.org>
749 2022-10-18 Dominik Röttsches <drott@chromium.org>
751 [sfnt] Guard individual `COLR` v1 paint field reads.
753 * src/sfnt/ttcolr.c (ENSURE_READ_BYTES): New macro.
754 (read_paint): Use it – after the start pointer `p` has been checked for
755 whether it allows reading the format byte, each successive paint table field
756 read need to be bounds-checked before reading further values.
760 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404
762 2022-10-17 Xiang Xiao <xiaoxiang@xiaomi.com>
764 * builds/toplevel.mk: Prefix all paths with `$(TOP_DIR)/`.
766 This is useful for builds that are not started from the root directory.
768 2022-10-17 Liu Kunpeng(柳鲲鹏) <liukunpeng@ts-it.cn>
770 * src/base/ftsynth.c (FT_GlyphSlot_Slant): New API with custom slant.
771 * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Declare it.
773 2022-10-15 Alexei Podtelezhnikov <apodtele@gmail.com>
775 Note the lack of floating-point data types.
777 2022-10-10 Werner Lemberg <wl@gnu.org>
779 [cff] Remove `FT_CONFIG_OPTION_NO_GLYPH_NAMES`.
781 This ancient option stayed completely undocumented. Given that the 'cff'
782 driver requires the 'psnames' module, it makes no sense today to have this
785 * src/cff/cffdrivr.c (cff_services), src/cff/cffobjs.c (cff_face_init):
786 Remove corresponding conditional code.
788 2022-10-10 Werner Lemberg <wl@gnu.org>
790 Synchronize `ftoption.h` flavours.
792 2022-10-10 Werner Lemberg <wl@gnu.org>
794 Minor comment changes.
796 2022-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
798 Improve FT_Get_Name_Index docs and place it next to FT_Get_Glyph_Name.
800 2022-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
802 [autofit] Reset the face charmap directly.
804 There is no need to validate the original charmap in `FT_Set_Charmap`.
805 It can be reset directly.
807 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
808 Use direct assignment.
809 * src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto.
811 2022-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
813 * src/type1/t1afm.c (T1_Read_PFM): Set charmaps directly.
815 As with the previous commit, we can avoid the validation checks
816 of `FT_Set_Charmap` and set it directly when choosing from the
819 2022-10-03 Alexei Podtelezhnikov <apodtele@gmail.com>
821 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`.
\r
823 Set charmap aggressively without all validations of `FT_Set_Charmap`
\r
824 because we take it from the available array and only temporarily.
\r
825 Even CMap Format 14 will gracefully return 0.
827 2022-10-03 Alexei Podtelezhnikov <apodtele@gmail.com>
829 * src/cache/ftcbasic.c (ftc_basic_family_get_count): Remove redundancy.
831 2022-09-30 Werner Lemberg <wl@gnu.org>
833 * src/psaux/pshints.c (cf2_hintmap_insertHint): Fix midpoint computation.
835 Replace '(start + end) / 2' with 'start + (end - start) / 2' to avoid
840 2022-09-30 Werner Lemberg <wl@gnu.org>
842 * src/psaux/pshints.c (cf2_hintmap_build): Improve debugging output.
844 2022-09-29 mlugg <mlugg@mlugg.co.uk>
846 [truetype] Fix undefined pointer arithmetic.
848 * src/truetype/ttgxvar.c (tt_var_get_item_delta, ft_var_load_mvar): Use
851 2022-09-29 Alexei Podtelezhnikov <apodtele@gmail.com>
853 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Use lighter FT_DivFix.
855 2022-09-29 Ali Chraghi <alichraghi@pm.me>
857 [base] FT_Attach_Stream: Make `parameters` argument constant.
859 2022-09-29 Azamat Hackimov <azamat.hackimov@gmail.com>
861 * src/tools/*.py: Migrate to Python 3.
863 Fixes #1185, closes !205. Formatting changes according to PEP8.
865 2022-09-27 Dominik Röttsches <drott@chromium.org>
867 [sfnt] Guard access in 'COLR' table when requesting child table pointer.
869 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Tighten
870 pointer bounds checks.
871 (get_child_table_pointer): Check whether incoming pointer `p` lies within
876 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51816
878 2022-09-27 Ben Wagner <bungeman@chromium.org>
880 [sfnt] Add SVG document bounds checking.
882 Add a check that the document content is actually contained within the
883 `SVG ` table. Without this check a malformed font may claim arbitrary
884 memory as its document content.
886 * src/sfnt/ttsvg.c (tt_face_load_svg): Take `numEntries` into account when
887 testing 'documentRecord' extents.
888 (find_doc): Rename `stream` to `document_records` for clarity.
889 (tt_face_load_svg_doc): Split `doc` from `doc_list` pointer for clarity.
890 Test that the document content is contained within the table.
891 Ensure minimum length of document before testing for gzip format.
895 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51812
897 2022-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
899 [base] Clean up the bitmap flow control.
901 * src/base/ftbitmap.c (FT_Bitmap_Copy): Flip the copy if its pitch
902 is trully opposite, zero is not a positive value.
903 (FT_Bitmap_Convert): Set negative pitch as needed, accept negative
906 2022-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
908 [base] Discard and recreate bitmaps for copying and converting.
\r
910 Reusing target bitmaps for copying and converting is permitted. It is,
\r
911 however, pointless to preserve their content before overwriting. Free-
\r
912 malloc might be faster than realloc.
\r
914 * src/base/ftbitmap.c (FT_Bitmap_Copy, FT_Bitmap_Convert): Free
\r
915 an old buffer and create a new one.
917 2022-09-16 Dominik Röttsches <drott@chromium.org>
919 Reject 'COLR' table if version is 1 but header too small.
921 * src/sfnt/ttcolr.c (tt_face_load_colr): If the version is determined to
922 be 1, then the table size has to be at least the size of the v1 header.
923 Also, for peeking the number of base glyphs and entries in the layer list,
924 ensure that the table is sufficiently long.
926 Fixes #1179. Original patch by Sergey Temnikov.
928 2022-09-15 Werner Lemberg <wl@gnu.org>
930 * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix format 1 handling.
934 2022-09-06 Dominik Röttsches <drott@chromium.org>
936 [truetype] Reject 'fvar' loading when `num_instances` is too small.
938 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Reject retrieving master when
939 'fvar' values locally do not match with sanitized values from initialization
940 at `sfnt_init_face` time.
944 https://bugs.chromium.org/p/chromium/issues/detail?id=1360295
946 2022-09-05 Dominik Röttsches <drott@chromium.org>
948 [sfnt] Handle variable `COLR` v1 fonts without delta set index map
952 * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Set outer index to
953 0 and inner index to the delta index when retrieving deltas if the
954 `COLR` table has no delta set index map.
956 2022-09-05 Dominik Röttsches <drott@chromium.org>
958 [sfnt] Pointer sanity checks before reading layer info in 'COLR' v0
960 * src/sfnt/ttcolr.c (tt_face_get_colr_layer): Check that the pointer to
961 read from is within the 'COLR' table.
965 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50633
967 2022-09-05 Werner Lemberg <wl@gnu.org>
971 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Avoid
974 2022-09-05 Dominik Röttsches <drott@chromium.org>
976 [sfnt] Don't require 'gvar' table to support variation fonts.
980 * src/sfnt/sfobjs.c (sfnt_load_face): Tag font as Multiple Masters font if
981 `fvar` is present; do not require other tables to be present.
983 * src/truetype/ttgxvar.c (tt_set_mm_blend): Allow for a missing 'gvar' table
984 when setting variation coordinates. However, if a 'gvar' table is actually
985 present, do perform a sanity check and fail on malformedness.
986 (TT_Get_MM_Var): Don't assume 'fvar' needs 'gvar' or 'CFF2 tables in all
987 cases, which is an overly tight check.
989 2022-08-27 Alexei Podtelezhnikov <apodtele@gmail.com>
991 * src/base/ftver.rc: Explicitly use UTF-16.
993 Fixes #1177 to avoid mistranslation and other problems.
995 2022-08-26 Dominik Röttsches <drott@chromium.org>
997 [sfnt] Avoid undefined shifts in `COLR` v1 color line retrieval
999 * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): Disambiguate shift
1000 behavior by using multiplication using macros from ftcalc.h.
1002 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50573
1004 2022-08-21 Sean Farrell <sean.farrell@rioki.org>
1006 CMakeLists.txt (FT_ENABLE_ERROR_STRINGS): New configuration option.
1008 This option uncomments FreeType configuration macro
1009 `FT_CONFIG_OPTION_ERROR_STRINGS` to make function `FT_Error_String` return
1010 meaningful error strings.
1012 This option is off by default.
1014 2022-08-21 Chris Liddell <chris.liddell@artifex.com>
1016 [base, type1] Better handling of out-of-memory situations.
1018 This follows similar code in `cff_slot_done`.
1020 * src/base/ftobjs.c (ft_glyphslot_done), src/type1/t1objs.c
1021 (T1_GlyphSlot_Done): Check `internal` pointer.
1023 The Type1 problems was reported as
1025 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50057.
1027 2022-08-06 Tim-Philipp Müller <tim@centricular.com>
1029 ci: bump windows image and use newer runner and vs2019
1031 The old 1809 runner will be decommissioned at some point.
1033 2022-08-04 @udoudou <>
1035 * src/cache/ftcmanag.c (FTC_Manager_New): Initialize `cur_weight`.
1039 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1041 * src/sfnt/ttload.c: Trace formatting updates.
1043 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1045 * src/psaux/psobjs.c (ps_table_release): Remove redundant casting.
1047 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1049 * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Reduce casting.
1051 2022-08-02 Alexei Podtelezhnikov <apodtele@gmail.com>
1053 [cache] Remove some casts, clean up tracing.
1055 * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup):
1056 Clean up tracing types.
1057 * src/cache/ftccache.c (ftc_node_destroy): Ditto.
1058 * src/cache/ftcmanag.c (FTC_Manager_Check): Ditto.
1059 (FTC_Manager_Check, FTC_Node_Unref): Remove a cast.
1060 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
1062 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com>
1064 [autofit] Updated to reduce casting (cont'd).
1066 * src/autofit/afmodule.h (AF_ModuleRec): Change `default_script` type.
1067 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
1069 * src/autofit/afmodule.c (af_property_{set,get}): Updated accordingly.
1071 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com>
1073 [autofit] Updated to reduce casting.
1075 * src/autofit/afglobal.h (AF_FaceGlobalsRec): Change `glyph_count` type.
1076 * src/autofit/afglobal.c (af_face_globals_compute_style_coverage,
1077 af_face_globals_get_metrics, af_face_globals_is_digit,
1078 af_face_globals_new): Changed local types and updated accordingly.
1079 * src/autofit/aflatin.c (af_latin_metrics_init_blues): Ditto.
1081 2022-08-01 Alexei Podtelezhnikov <apodtele@gmail.com>
1083 [psaux] Remove unused structure field.
1085 * include/freetype/internal/psaux.h (PS_TableRec): Remove `num_elems`.
1086 * src/psaux/psobjs.c (ps_table_new): Remoove its initialization.
1088 2022-07-30 Dominik Röttsches <drott@chromium.org>
1090 [sfnt] Implement VarClipBox.
1092 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Depending on the
1093 format, read `var_index_base`, then retrieve and apply scaled deltas.
1095 2022-07-30 Dominik Röttsches <drott@chromium.org>
1097 [sfnt] Fix typo in clip box computation.
1099 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Use appropriate
1100 scale factor for `yMin` and `yMax`.
1102 2022-07-30 Alexei Podtelezhnikov <apodtele@gmail.com>
1104 [autofit] Use unsigned accounting for hints.
1106 * src/autofit/afhints.h (AF_AxisHintsRec): Use unsigned types.
1108 * src/autofit/afhints.c (af_axis_hints_new_{segment,edge},
1109 af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset):
1110 Updated accordingly.
1111 * src/autofit/aflatin.c (af_cjk_hints_compute_edges): Ditto.
1112 * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Ditto.
1114 2022-07-30 Alexei Podtelezhnikov <apodtele@gmail.com>
1116 * src/autofit/afhints.h: Remove dead code.
1118 2022-07-29 Werner Lemberg <wl@gnu.org>
1120 * src/base/ftglyph.c (FT_Get_Glyph): Set `*aglyph` to NULL in case of error.
1122 2022-07-29 Werner Lemberg <wl@gnu.org>
1124 Fix compilation if `TT_CONFIG_OPTION_GX_VAR_SUPPORT` is not set.
1126 * src/sfnt/ttcolr.c: Protect relevant code with
1127 `TT_CONFIG_OPTION_GX_VAR_SUPPORT`.
1129 2022-07-29 Werner Lemberg <wl@gnu.org>
1131 Fix clang14 compiler warnings.
1133 * include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE):
1136 * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean
1138 (tt_face_get_colorline_stops): Fix type of `var_index_base`.
1140 2022-07-26 Alexei Podtelezhnikov <apodtele@gmail.com>
1142 [pfr] Fortify the kerning code.
1144 Any array index must be strictly less then the array size. Therefore,
1145 we must reject indexes that are equal to the array size. Alternatively,
1146 we should move the bounds check before the index decrement but that
1149 In addition, it is ok to decrement zero (.notdef) and get UINT_MAX,
1150 which is then automatically rejected in the bounds check.
1152 * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix the bounds checking.
1154 2022-07-26 Werner Lemberg <wl@gnu.org>
1156 [pfr] Add some safety guards.
1158 * src/pfr/pfrload.c (pfr_phy_font_load): Check resolutions and number of
1163 2022-07-26 Werner Lemberg <wl@gnu.org>
1165 * src/pfr/*.c: Trivial improvements and formatting.
1167 2022-07-24 Werner Lemberg <wl@gnu.org>
1169 * configure: s/egrep/grep -E/
1171 `egrep` is deprecated.
1173 2022-07-23 Ben Wagner <bungeman@chromium.org>
1175 [base] Build outlines in amortized constant time.
1177 When resizing the loader's points and contours, resize them to at least 1.5
1178 times their current size. The code currently only reserves as much space as
1179 is currently required, leading to O(n^2) runtime when adding points one at a
1182 This change does not attempt to ever shrink the loader's point and contour
1183 storage since this was not attempted previously either. The 1.5 multiple
1184 was chosen as a trade-off between potentially unused space and the runtime.
1186 * src/base/ftgloader.c (FT_GlyphLoader_CheckPoints): Implement it.
1190 2022-07-09 Dominik Röttsches <drott@chromium.org>
1192 [sfnt] Support variable 'COLR' v1 `PaintVarSkew*`.
1194 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values
1195 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW`,
1196 `FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER`, and
1197 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER`.
1198 (read_paint): Handle new enumeration values.
1200 2022-07-09 Dominik Röttsches <drott@chromium.org>
1202 [sfnt] Support variable 'COLR' v1 `PaintVarRotate*`.
1204 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration values
1205 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE` and
1206 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER`.
1207 (read_paint): Handle new enumeration values.
1209 2022-07-09 Dominik Röttsches <drott@chromium.org>
1211 [sfnt] Support 'COLR' v1 variable `PaintVarScale*`.
1213 * src/sfnt/ttcolr.c: (FT_PaintFormatInternal): New enumeration values
1214 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE`,
1215 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER`,
1216 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM`, and
1217 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER`.
1218 (read_paint): Handle new enumeration values.
1220 2022-07-09 Dominik Röttsches <drott@chromium.org>
1222 [sfnt] Support for 'COLR' v1 variable translate.
1224 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration value
1225 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE`.
1226 (read_paint): Handle new enumeration value.
1228 2022-07-09 Dominik Röttsches <drott@chromium.org>
1230 [sfnt] Support for 'COLR' v1 variable transforms.
1232 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration value
1233 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM`.
1234 (read_paint): Handle new enumeration value.
1236 2022-07-09 Dominik Röttsches <drott@chromium.org>
1238 [sfnt] Deltas for 'COLR' v1 gradient coordinates.
1240 * src/sfnt/ttcolr.c (read_paint) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Read and
1241 apply deltas to radial, linear, and sweep gradient coordinates such as 'p0',
1242 'p1', 'p2', 'center', 'radii', and 'angles'.
1244 2022-07-08 Dominik Röttsches <drott@chromium.org>
1246 [sfnt] Support variable 'COLR' v1 color lines.
1248 * include/freetype/ftcolor.h (FT_ColorStopIterator): Add field
1249 `read_variable` to indicate whether a variation index base should be read.
1251 * src/sfnt/ttcolr.c: (FT_PaintFormat_Internal): New enumerations
1252 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT`
1253 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT`, and
1254 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT`.
1255 (read_color_line): New parameter `read_variable`; update callers.
1256 (read_paint): Handle new enumerations.
1258 2022-07-07 Dominik Röttsches <drott@chromium.org>
1260 [sfnt] Apply variation deltas to `PaintVarSolid`.
1262 * src/sfnt/ttcolr.c (FT_PaintFormat_Internal_): New enumeration
1263 `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID`.
1265 (get_deltas_for_var_index_base) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New
1266 function to retrieve an array of delta values, which will be used for most
1267 of 'COLR' v1 variation formats (in follow-up commits).
1269 (read_paint): Add `face` parameter; update caller.
1270 Handle `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID`.
1272 2022-07-07 Dominik Röttsches <drott@chromium.org>
1274 [sfnt] Check safety of cast to `TT_Driver` before accessing member.
1276 * src/sfnt/ttcolr.c (VARIABLE_COLRV1_ENABLED): Access
1277 `enable_variable_colrv1` only if driver class matches.
1279 2022-07-06 Stephen Holdaway <stecman@gmail.com>
1281 doc: Clarify description of `FT_Stream_IoFunc`.
1283 The existing documentation comments on `FT_Stream_IoFunc` hinted at the dual
1284 seek/read behavior required for custom stream implementations to work, but
1285 it didn't explicitly explain it. Without looking at the internals of
1286 FreeType, it was easy for someone to assume their implementation should
1287 handle both seek and read operations all the time. If this is done, you get
1288 a variety of errors, but mostly just `Unknown_File_Format` (error code
1291 2022-07-04 Dominik Röttsches <drott@chromium.org>
1293 [sfnt] Load variation store for 'COLR' v1.
1295 * src/sfnt/ttcolr.c: Include `ttobjs.h` temporarily.
1296 (VARIABLE_COLRV1_ENABLED): New temporary macro to detect whether variable
1298 (Colr): New fields `var_store` and `delta_set_idx_map`.
1299 (tt_face_load_colr, tt_face_free_colr) [VARIABLE_COLRV1_ENABLED]: Load and
1300 free variation store data using the functions from the Multiple Masters
1303 2022-07-03 Chris Liddell <chris.liddell@artifex.com>
1305 [base] Improve error handling in `FT_GlyphLoader_CheckPoints`.
1307 If `FT_GlyphLoader_CreateExtra` returns an error (and a couple of other
1308 places), `FT_GlyphLoader_CheckPoints` would propagate the error immediately,
1309 rather than cleaning up the partially set up `FT_GlyphLoader`. As a
1310 consequence, a subsequent attempt to create a glyph could result in a crash.
1312 * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Ensure all the error
1313 conditions exits are consistent, eventually calling `FT_GlyphLoader_Reset`.
1315 2022-07-03 Thomas Sondergaard <thomas@sondergaard.cc>
1317 CMakeLists.txt: Provide both 'freetype' and 'Freetype::Freetype' targets.
1319 FreeType can be located by consuming projects that use
1320 `find_package(Freetype)` either via the old `MODULE` path (which uses
1321 `FindFreetype.cmake` supplied by CMake), or via the new `CONFIG` path (which
1322 uses `freetype-config.cmake` as supplied by this project). Up to this point
1323 the CMake module has supplied the target `Freetype::Freetype` and the config
1324 file provided by this project the target `freetype`. Now we supply both
1325 `freetype` and `Freetype::Freetype` so that consuming projects can always
1326 use the target `Freetype::Freetype` regardless of what path was taken by
1327 `find_package(Freetype)`.
1331 2022-07-02 Werner Lemberg <wl@gnu.org>
1333 include/freetype/ftmm.h: Improve documentation.
1335 2022-07-01 Dominik Röttsches <drott@chromium.org>
1337 [base] Round values in `FT_MulAdd_Fix`.
1339 This avoids regressing Blink layout tests and makes `FT_MulAdd_Fix` delta
1340 retrieval implementation consistent with the previous implementation, which
1341 used `FT_fixedToInt` and included rounding.
1343 * src/base/ftcalc.c (FT_MulAdd_Fix): Implement it.
1344 Also fix remaining `temp` initialization compilation issue.
1348 2022-07-01 Werner Lemberg <wl@gnu.org>
1352 2022-06-30 Dominik Röttsches <drott@chromium.org>
1354 Fix initialisation of temp variable in new FT_MulAddFix
1356 src/truetype/ttgxvar.c (FT_MulAddFix): Initialise `temp`.
1358 2022-06-29 Dominik Röttsches <drott@chromium.org>
1360 [truetype] Perform variation store delta computation with 64-bit precision.
1362 * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Make type
1364 * include/freetype/internal/services/svmm.h
1365 (FT_Var_Get_Item_Delta_Func): Change return type to `FT_ItemVarDelta`
1366 * truetype/ttgxvar.h (tt_var_get_item_delta): Change return type to
1368 * truetype/ttgxvar.c (tt_var_get_item_delta): Store scalars and deltas
1369 to intermediate array, perform computation using new method
1372 2022-06-29 Dominik Röttsches <drott@chromium.org>
1374 New function `FT_MulAddFix` to compute the sum of fixed-point products.
1376 This function, based on the code of `FT_MulFix`, uses 64-bit precision
1377 internally for intermediate computations.
1379 * include/freetype/internal/ftcalc.h, base/ftcalc.c (FT_MulAddFix):
1382 2022-06-22 Werner Lemberg <wl@gnu.org>
1384 CMakeLists.txt: Move inclusion of `FindPkgConfig` down.
1386 It must come after `CMAKE_TOOLCHAIN_FILE`.
1390 2022-06-22 Dominik Röttsches <drott@chromium.org>
1392 [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14
1394 2022-06-21 Alexei Podtelezhnikov <apodtele@gmail.com>
1396 * docs/CHANGES: Announce impending Infinality removal.
1398 2022-06-21 Alexei Podtelezhnikov <apodtele@gmail.com>
1400 * ttgload.c (TT_Process_Composite_Glyph): Fix a signedness warning.
1402 2022-06-21 Werner Lemberg <wl@gnu.org>
1404 s/fixed point/fixed-point/
1406 2022-06-21 Werner Lemberg <wl@gnu.org>
1408 .gitlab-ci.yml: Correctly upgrade `meson`.
1410 2022-06-21 Dominik Röttsches <drott@chromium.org>
1412 Proposal: Feature control for variable COLRv1
1414 * include/freetype/ftdriver.h (variable-color-v1 property): Add documentation
1415 for variable-colr-v1 property.
1416 * src/truetype/ttdriver.c (tt_property_set): Ingest variable-control property
1417 when called, set to enable_variable_colrv1 driver flag.
1418 * src/truetype/ttobjs.h (TT_DriverRec): Add enable_variable_colrv1 flag.
1420 2022-06-21 Xavier Claessens <xavier.claessens@collabora.com>
1422 [meson] Disable FreeType in HarfBuzz fallback.
1424 This avoids cyclic subproject configuration when the 'harfbuzz' feature is
1425 enabled, or `--wrap-mode=forcefallback` is used, but HarfBuzz is built as a
1426 subproject. HarfBuzz does the same and disables HarfBuzz support when
1427 configuring FreeType as a subproject.
1429 * meson.build (harfbuzz_dep): Implement it.
1431 * subprojects/harfbuzz.wrap: New file.
1433 * .gitlab-ci.yml [windows meson]: Use latest version of the meson 0.59
1434 series, which has a necessary bug fix to make CI work.
1436 2022-06-19 Alexei Podtelezhnikov <apodtele@gmail.com>
1438 [truetype] Clean up phantom point accounting.
1440 This formalizes that the phantom points appended in the outline
1441 do not increase its point count, nor are they tagged or included
1442 in any additional contours. Only their coordinates are stored.
1443 They are counted in the glyph zone, however.
1445 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Infer `n_points`
1446 from the outline size plus four phantom points.
1447 * src/truetype/ttgxvar.h (TT_Vary_Apply_Glyph_Deltas): Remove this
1449 * src/truetype/ttgload.c (tt_prepare_zone): Add phantom four.
1450 (TT_Process_Simple_Glyph, load_truetype_glyph): Update all callers.
1452 2022-06-19 Alexei Podtelezhnikov <apodtele@gmail.com>
1454 [truetype/GX] Clean up phantom point adjustment.
1456 This moves phantom point and advance variation adjustment next to
1457 calculations. The logic stays the same, HVAR and VVAR take priority.
1459 * src/truetype/ttgload.c (load_truetype_glyph): Move it from here...
1460 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): ... to here
1461 and check for HVAR and VVAR presence outside the main loop.
1463 2022-06-18 Ben Wagner <bungeman@chromium.org>
1465 [stream] Fix reading s32 when long is s64
1467 `FT_READ_LONG`, `FT_GET_LONG`, and related macros did not return
1468 negative values when `long` is more than 32 bits. `FT_Stream_ReadULong`
1469 would read four bytes into the LSB of an `FT_ULong` and return that.
1470 Since this can never set the MSb of the `FT_ULong` when `FT_ULong` is
1471 more than 32 bits the cast to `FT_Long` never resulted in a negative
1474 Fix this by modifying `FT_Stream_Read*` to return a type of the same
1475 size as the bytes it is reading and changing the `FT_READ_*` and
1476 `FT_GET_*` macros to cast to the same type returned by `FT_Stream_Read*`
1477 but with the correctly signed type (instead of casting to what is
1478 assumed to be the type of `var` which will happen automatically anyway).
1480 There exist a few cases like with the `OFF3` variants where there isn't
1481 generally a type with the correct size. `FT_PEEK_OFF3` works around this
1482 loading the bytes into the three most significant bits and then doing a
1483 signed shift down. `FT_NEXT_OFF3` also already worked correctly by
1484 casting this signed value to another signed type. `FT_Stream_GetUOffset`
1485 works correctly but one must be careful not to attempt to cast the
1486 returned value to a signed type. Fortunately there is only
1487 `FT_GET_UOFF3` and no `FT_GET_OFF3`.
1489 All of these cases are handled correctly when reading values through
1490 `FT_Stream_ReadFields` since it generically computes the signed value
1491 through an `FT_Int32`. This change is essentially doing the same for
1494 * include/freetype/internal/ftstream.h (FT_NEXT_*, FT_GET_*, FT_READ*):
1495 Update macros and return types to use fixed size types for fixed size
1498 * src/base/ftstream.c (FT_StreamGet*, FT_StreamRead*): Dito.
1502 2022-06-17 Alexei Podtelezhnikov <apodtele@gmail.com>
1504 [truetype/GX] Fix an old typo.
1506 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Vertical
1507 advance is measured along y-coordinate.
1509 2022-06-16 Alexei Podtelezhnikov <apodtele@gmail.com>
1511 [truetype/GX] Clean up advance adjustment (Brrr).
\r
1513 * src/truetype/ttgload.c (load_truetype_glyph): Remove remaining code.
1515 2022-06-16 Ben Wagner <bungeman@chromium.org>
1517 [type1] Directly search for eexec in private dict
1519 This code originally just searched for `eexec`. This was later modified
1520 to check that the `eexec` found is valid (not in a string or comment).
1521 This was done by searching for `eexec` as before and then, for each
1522 `eexec` found, searching from the beginning using the correct parsing to
1523 see if the `eexec` was still found. If the private dictionary is large
1524 and contains many copies of `eexec` which are not valid, the initial
1525 part of the private dictionary is scanned once for each, potentially
1526 leading to n^2 parsing time.
1528 Instead of finding an initial `eexec` and then re-parsing to discover if
1529 it is valid, drop the initial search for `eexec` and just parse to find
1530 a valid `eexec`. This is strictly faster since the validation must
1531 happen anyway and avoids restarting from the beginning each time an
1532 `eexec` is found in the data.
1534 * src/type1/t1parse.c (T1_Get_Private_Dict): avoid n^2 parsing
1536 Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1328883
1538 2022-06-16 Alexei Podtelezhnikov <apodtele@gmail.com>
1540 [truetype/GX] Clean up advance adjustment.
1542 * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph):
1543 Move the advance adjustment from here...
1544 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): ... to here and
1546 * src/truetype/ttgxvar.h (TT_Vary_Apply_Glyph_Deltas): Update prototype
1547 with fewer arguments.
1549 2022-06-14 Ben Wagner <bungeman@chromium.org>
1551 [gzip] Handle inflate returning Z_NEED_DICT
1553 When `inflate` returns `Z_NEED_DICT` this is currently not reported as
1554 an error and callers may assume that the decompression succeeded when it
1555 did not. In particular, a compressed table in a woff file may not
1556 actually be decompressed and written as expected, leaving the backing
1557 memory for the expanded table uninitialized.
1559 * src/gzlip/ftgzip.c (FT_Gzip_Uncompress): treat `Z_NEED_DICT` as
1560 indicating invalid data since there is no means to provide a dictionary.
1562 Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1335712
1564 2022-06-13 Ben Wagner <bungeman@chromium.org>
1566 [woff] Don't allocate table entries until needed
1568 * src/sfnt/sfwoff.c (woff_open_font): delay allocating space for the
1569 table entries until they are actually written out with the data.
1571 2022-06-12 Alexei Podtelezhnikov <apodtele@gmail.com>
1573 * src/sfnt/sfwoff2.c (woff2_open_font): Partial revert.
1575 Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47981.
1577 2022-06-12 Alexei Podtelezhnikov <apodtele@gmail.com>
1579 * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Cosmetic macro change.
1581 2022-06-11 Alexei Podtelezhnikov <apodtele@gmail.com>
1583 [woff, woff2] Avoid buffer zeroing.
1585 * src/sfnt/sfwoff.c (woff_open_font): Use Q-macros.
1586 * src/sfnt/sfwoff2.c: Ditto.
1587 (reconstruct_font): Allocate table_entry on stack.
1589 2022-06-10 Alexei Podtelezhnikov <apodtele@gmail.com>
1591 [smooth] Fix GCC LTO crashes on Windows.
1593 Fixes #1164 by using a volatile variable around `setjmp`. It is hard to
1594 say how this fixes crashes related to certain link-time optimizations.
1595 This does not decrease the rendering performance.
1597 * src/smooth/ftgrays.c (gray_convert_glyph_inner): Use volatile `error`.
1599 2022-06-09 bruvzg <@bruvzg>
1601 * src/smooth/ftgrays.c [FT_STATIC_RASTER]: Fix compilation.
1603 2022-06-06 Ben Wagner <bungeman@chromium.org>
1605 [svg] Set linear advances when loading SVG glyphs
1607 * include/freetype/freetype.h (FT_GlyphSlotRec_): update doc
1608 * src/cff/cffgload.c (cff_slot_load): do it
1609 * src/truetype/ttgload.c (TT_Load_Glyph): do it
1613 2022-06-01 Ben Wagner <bungeman@chromium.org>
1615 [svg] Clear correct flags for doc ownership
1617 This issue was discovered with an SVG based font with some documents
1618 compressed and other uncompressed. After loading the first compressed
1619 document the ownership flag on the glyph slot was set to true but never
1620 set to false. As a result after loading a compressed document a glyph
1621 from an uncompressed document would load fine, but when this glyph slot
1622 was cleared it would try to free its document resulting in a wild free.
1624 * src/base/ftobjs.c (ft_glyphslot_clear): clear correct flags
1628 2022-06-01 Alexei Podtelezhnikov <apodtele@gmail.com>
1630 [docs] Correct favicon.
1632 2022-06-01 Alexei Podtelezhnikov <apodtele@gmail.com>
1634 [docs] Use hinted favicon.
1636 2022-05-27 Alexei Podtelezhnikov <apodtele@gmail.com>
1638 [docs] Update favicon.
1640 2022-05-25 Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org>
1642 * src/sfnt/ttmtx.c (tt_face_get_metrics): Apply variations unconditionally.
1644 This causes a speed-up of approx. 20% for getting advance widths.
1646 2022-05-23 Dominik Röttsches <drott@chromium.org>
1648 [truetype] Support reading 32bit/16bit VarStore deltas
1650 * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Define type
1651 to be used for delta arrays, upgrade to FT_long.
1652 * src/truetype/ttgxvar.c: Adhere to long_words bit and read either
1653 Short/Byte pairs or Long/Short pairs, as defined by spec. For better
1654 readability, define macro for repetitive read code.
1656 2022-05-20 Dominik Röttsches <drott@chromium.org>
1658 [truetype] Handle 0xFFFF special value inside delta retrieval function
1660 * truetype/ttgxvar.c (tt_hvadvance_adjust, tt_apply_mvar,
1661 tt_var_get_item_delta): Remove special 0xFFFF handling in favor of less
1662 redundant handling inside the tt_var_get_item_delta function, as it is
1663 equivalent to returning a 0 delta. Avoids code-duplication checking for
1664 special value 0xFFFF.
1666 2022-05-19 Dominik Röttsches <drott@chromium.org>
1668 [truetype, snft] Add service methods for `DeltaSetIdxMap` and `VarStore`.
1670 This will be needed for 'COLR' v1 variation support.
1672 * src/truetype/ttgxvar.h (GX_ItemVarData, GX_AxisCoords, GX_VarRegion,
1673 GX_VarItemStore, GX_DeltaSetIdxMap): Move structures to...
1674 * include/freetype/internal/ftmmtypes.h: ... this new file.
1676 * include/freetype/internal/service/svmm.h (MultiMasters): Include
1678 (FT_Var_Load_Delta_Set_Idx_Map_Func, FT_Var_Load_Item_Var_Store_Func,
1679 FT_Var_Get_Item_Delta_Func, FT_Var_Done_Item_Var_Store_Func,
1680 FT_Var_Done_Delta_Set_Idx_Map_Func): New function typedefs.
1681 (MultiMasters): Add them.
1682 (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
1684 * src/cff/cffdrivr.c (cff_load_item_variation_store,
1685 cff_load_delta_set_index_mapping, cff_get_item_delta,
1686 cff_done_item_variation_store, cff_done_delta_set_index_map): New wrapper
1687 methods calling into mm service.
1688 (cff_service_multi_masters): Updated.
1690 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store,
1691 ft_var_load_delta_set_index_mapping, ft_var_get_item_delta,
1692 ft_var_done_item_variation_store, ft_var_done_delta_set_index_map): Renamed
1694 (tt_var_load_item_variation_store, tt_var_load_delta_set_index_mapping,
1695 tt_var_get_item_delta, tt_var_done_item_variation_store,
1696 tt_var_done_delta_set_index_map): ... this for consistency.
1697 Mark them as non-static.
1698 * src/truetype/ttgxvar.h: Add corresponding prototypes.
1700 * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
1702 * src/type1/t1driver.c (t1_service_multi_masters): Updated.
1704 2022-05-19 Dominik Röttsches <drott@chromium.org>
1706 [truetype] Move deallocation of `DeltaSetIdxMap` into own function.
1708 This is a preparation for handling `DeltaSetIdxMap` and `VarStore` as a
1711 * src/truetype/ttgxvar.c (ft_var_done_delta_set_index_map): New function.
1712 (tt_done_blend): Use it.
1714 2022-05-18 Werner Lemberg <wl@gnu.org>
1716 * builds/toplevel.mk (do-dist): Don't remove meson wrap files.
1720 2022-05-18 Werner Lemberg <wl@gnu.org>
1722 * subprojects/zlib.wrap: Update to zlib version 1.2.12.
1724 2022-05-18 Werner Lemberg <wl@gnu.org>
1726 REAMDE: Mention that gitlab's 'download' button doesn't work.
1728 This is because the `git archive` command doesn't preserve submodules.
1730 Note that currently there is no support for disabling the 'download' button
1731 in gitlab (https://gitlab.com/gitlab-org/gitlab/-/issues/17032).
1735 2022-05-11 Werner Lemberg <wl@gnu.org>
1737 [truetype] Handle inner/outer index values 0xFFFF/0xFFFF.
1739 This was introduced in OpenType 1.8.4.
1741 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping,
1742 tt_hvadvance_adjust, ft_var_load_mvar, tt_apply_mvar): Handle special
1743 inner/outer index values.
1744 (ft_var_load_item_variation_store): Add test.
1748 2022-05-01 Werner Lemberg <wl@gnu.org>
1750 * Version 2.12.1 released.
1751 ==========================
1753 Tag sources with `VER-2-12-1'.
1755 * docs/VERSION.TXT: Add entry for version 2.12.1.
1756 * docs/CHANGES, docs/release: Updated.
1758 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
1759 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
1760 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
1761 docs/freetype-config.1: s/2.12.0/2.12.1/, s/2120/2121/.
1763 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
1765 * builds/unix/configure.raw (version_info): Set to 24:3:18.
1766 * CMakeLists.txt (VERSION_PATCH): Set to 1.
1768 2022-04-30 Anuj Verma <anuj@posteo.net>
1770 [sdf] Do not throw errors for invisible glyphs.
1772 * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Return `FT_Err_Ok` if
1773 width or height is zero, since some glyphs do not generate visible bitmaps.
1777 2022-04-30 Werner Lemberg <wl@gnu.org>
1779 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_COLOR` for SVG fonts.
1783 2022-04-27 Brendan Shanks <bshanks@codeweavers.com>
1785 autogen.sh: Fix building when freetype is itself a git submodule.
1787 There are situations where .git is not a directory, like when
1788 freetype is a submodule in another repository.
1790 2022-04-26 Alexei Podtelezhnikov <apodtele@gmail.com>
1792 [builds/windows] Simplify non-desktop UWP check.
1794 Fixes mingw compilation described in !159.
1796 * builds/windows/ftsystem.c: Do not use WINAPI_FAMILY_PARTITION macro.
1798 2022-04-25 Alexei Podtelezhnikov <apodtele@gmail.com>
1800 [truetype] Reset IUP flags in `TT_RunIns`.
1802 Fixes #1148 by moving the flag initialization back, partly reverting
1803 7809007a and fd03dcc1. Initializing these flags elsewhere skips 'cvt'.
1805 * src/truetype/ttinterp.c (TT_RunIns): Initialize the IUP flag here...
1806 (TT_Run_Context): ... instead of here.
1808 2022-04-24 Xavier Claessens <xavier.claessens@collabora.com>
1810 [meson] Remove `default_library=both` from `default_options`.
1812 It is inconsistent with what all other Meson projects do.
1814 It also prevents static linking to FreeType when it is a subproject because
1815 `default_options` in a subproject takes precedence on values set on the main
1816 project. For example, building 'GStreamer' with `-Ddefault_library=static`
1817 would still dynamically link on FreeType unless the user also sets
1818 `-Dfreetype2:default_library=static`.
1820 * meson.build: Updated.
1822 * .gitlab-ci.yml: Retain `both` option for testing.
1824 2022-04-19 Werner Lemberg <wl@gnu.org>
1826 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Integer overflow.
1830 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46792
1832 2022-04-16 Georg Brandl <georg@python.org>
1834 * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]: Fix segfault.
1836 This can happen if the function is called with `size` being `NULL`.
1840 2022-04-14 Steve Lhomme <robux4@ycbcr.xyz>
1842 .gitlab-ci.yml: Add a Universal Windows build target
1844 It's compiled for Windows 10 and up, ensuring UNICODE is set (default for UWP)
1845 and selecting the proper WINAPI_FAMILY (WINAPI_FAMILY_APP).
1847 Do not try to run the UWP exe in the Docker as it doesn't work.
1849 2022-04-04 Ben Wagner <bungeman@chromium.org>
1851 [sfnt] Correct FT_ColorStopIterator documentation.
1853 * include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not
1854 set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and
1855 `num_color_stops` are set by `FT_Get_Paint`. `p` and
1856 `current_color_stop` are updated by `FT_Get_Colorline_Stops`.
1858 2022-04-01 Werner Lemberg <wl@gnu.org>
1860 * builds/unix/configure.raw: Add option `--with-librsvg`.
1862 Since 'librsvg' is written in Rust, this option allows distributions to
1863 avoid a dependency on the entire Rust toolchain to provide the FreeType demo
1866 Suggested by Lars Wendler in !156.
1868 2022-04-01 Werner Lemberg <wl@gnu.org>
1870 * src/sfnt/sfwoff.c (reconstruct_glyf): Fix gcc 10 warning.
1872 2022-04-01 Werner Lemberg <wl@gnu.org>
1874 [gzip] Update sources to zlib 1.2.12.
1876 2022-04-01 Eric Jing <@CPUcontrol>
1878 CMakeLists.txt: Fix `Info.plist` path.
1880 When building a framework using CMake with `add_subdirectory`, CMake must be
1881 able to find `freetype-Info.plist` when configuring the framework
1886 2022-04-01 Werner Lemberg <wl@gnu.org>
1890 2022-04-01 Ben Wagner <bungeman@chromium.org>
1892 [truetype] Use SUB_LONG for component offset.
1894 * src/truetype/ttgload.c (TT_Process_Composite_Component): do it.
1896 Bug: https://crbug.com/1309429
1898 2022-03-31 Werner Lemberg <wl@gnu.org>
1900 CMakeList.txt: Update code to handle recent changes for `freetype.pc`.
1904 2022-03-31 Werner Lemberg <wl@gnu.org>
1906 CMakeLists.txt: s/PKG_CONFIG/PKGCONFIG/, s/REQUIRED_/REQUIRES_/.
1908 2022-03-31 Werner Lemberg <wl@gnu.org>
1910 * Version 2.12.0 released.
1911 ==========================
1913 Tag sources with `VER-2-12-0'.
1915 * docs/VERSION.TXT: Add entry for version 2.12.0.
1916 * docs/CHANGES, docs/release: Updated.
1918 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
1919 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
1920 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
1921 docs/freetype-config.1: s/2.11.1/2.12.0/, s/2111/2120/.
1923 * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12.
1924 (FREETYPE_PATCH): Set to 0.
1926 * builds/unix/configure.raw (version_info): Set to 24:2:18.
1927 * CMakeLists.txt (VERSION_MINOR): Set to 12.
1928 (VERSION_PATCH): Set to 0.
1930 * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits
1931 since version 2.11.0 (when we stopped creating this file manually).
1933 2022-03-31 Werner Lemberg <wl@gnu.org>
1935 Fix clang++ warnings.
1937 * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c
1938 (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new),
1939 src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW),
1940 src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c
1941 (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize
1942 variables used for allocation.
1944 * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of
1945 `max_splits` to FT_UInt.
1946 (sdf_generate_bounding_box): Add cast.
1948 2022-03-30 Werner Lemberg <wl@gnu.org>
1952 2022-03-30 Werner Lemberg <wl@gnu.org>
1954 [builds] Fix creation of `freetype2.pc` for static-only builds.
1956 We have to help `pkg-config` since it can't recognize that there is no
1957 shared library installed.
1959 Note that meson already does exactly the same.
1961 * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to...
1962 (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them
1963 depending on `$enable_shared`.
1964 (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables.
1966 * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated
1969 2022-03-25 Werner Lemberg <wl@gnu.org>
1971 Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`.
1973 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY,
1974 FT_HAS_SBIX_OVERLAY): New macro.
1976 * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`.
1977 Remove obsolete tracing message.
1979 2022-03-25 Werner Lemberg <wl@gnu.org>
1981 Add `FT_PARAM_TAG_IGNORE_SBIX`.
1983 This is another bit to handle 'sbix' tables as described in the OpenType
1986 * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro.
1988 * src/sfnt/sfobjc.c (is_apple_sbix): Rename to...
1989 (has_sbix): ... this.
1990 Check for more sbit tables.
1991 Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`.
1992 Only call sbit table loader if an sbit table is present.
1994 2022-03-25 Werner Lemberg <wl@gnu.org>
1996 [truetype] Fix 'sbix' table handling.
1998 * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of
1999 'metrics->horiBearingY'.
2000 Set vertical metrics.
2002 * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`.
2003 Handle metrics of fonts with 'sbix' table.
2005 * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply
2006 bbox offset and bearing values of the corresponding glyph in the 'glyf'
2007 table if it exists and has a contour.
2009 * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table.
2013 2022-03-25 Werner Lemberg <wl@gnu.org>
2015 Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`.
2017 Fonts with 'sbix' tables need special handling by the application.
2019 * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros.
2021 * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix'
2024 2022-03-25 Werner Lemberg <wl@gnu.org>
2026 * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public.
2028 2022-03-24 Carlo Bramini <carlo.bramix@libero.it>
2030 [builds/windows] Fix WCE support.
2032 * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by
2035 2022-03-24 Steve Lhomme <robux4@ycbcr.xyz>
2037 [build/windows] Improve UWP support.
2039 * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA.
2041 2022-03-21 Werner Lemberg <wl@gnu.org>
2043 * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table.
2047 2022-03-20 Ben Wagner <bungeman@chromium.org>
2049 [woff2] Support overlap flag for simple glyphs.
2051 In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag
2052 to be retained through the woff2 format [0].
2054 [0] https://www.w3.org/TR/WOFF2/#glyf_table_format
2056 * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag.
2058 * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and
2059 overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's
2060 flag if the overlap bit is set.
2062 2022-03-19 Werner Lemberg <wl@gnu.org>
2064 [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`.
2066 * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro.
2067 (cff_slot_load): Use it.
2069 2022-03-19 Werner Lemberg <wl@gnu.org>
2071 * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`.
2075 2022-03-19 Werner Lemberg <wl@gnu.org>
2077 * src/base/ftobjs.c (ft_open_face_internal): Thinko.
2079 2022-03-19 Ben Wagner <bungeman@chromium.org>
2081 [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3.
2083 * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
2085 2022-03-19 Werner Lemberg <wl@gnu.org>
2087 * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`.
2089 We must ensure that the cast to `FT_Int` doesn't change the sign.
2093 2022-03-17 Werner Lemberg <wl@gnu.org>
2095 [sfnt] Avoid invalid face index.
2099 * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font):
2100 Check `face_index` before decrementing.
2102 2022-03-07 Werner Lemberg <wl@gnu.org>
2104 Documentation, whitespace.
2106 2022-03-05 Anuj Verma <anuj@womp.xyz>
2108 [sdf] Fix corner checks and improve performance.
2110 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if
2111 two distances (for different curves) are very close.
2113 (sdf_conic_to): Check whether the conic curve can be treated as a line
2114 (which happens if the control point coincides with any end point).
2116 2022-03-05 Anuj Verma <anuj@womp.xyz>
2118 [sdf] Implement deviation-based splitting for Bezier curves.
2120 * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure
2121 out the deviation of Bezier curves and stop splitting if the curve is flat
2124 * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro.
2126 2022-03-05 Anuj Verma <anuj@womp.xyz>
2128 * include/freetype/freetype.h: Improve SDF documentation.
2130 2022-03-03 Ben Wagner <bungeman@chromium.org>
2132 [sfnt] Fix bounds check in SVG.
2134 The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not
2135 protected by parentheses. As a result, the expression
2136 `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to
2137 `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected
2138 `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect
2139 bounds check which may lead to reading past the end of the `SVG ` table.
2141 * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in
2144 Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179
2146 2022-02-23 Ben Wagner <bungeman@chromium.org>
2148 [psaux] Full bounds check for OtherSubr 19.
2150 It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is
2151 NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with
2152 `blend->num_designs` set to 2, and the user supplied `idx` to be large (for
2153 example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds
2154 check overflows in a well defined manner, allowing for an invalid call to
2157 In addition, it is possible to call OtherSubr 19 with
2158 `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying
2159 that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes
2160 the bounds check (it is logically always fine to copy nothing starting at
2161 index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed
2162 by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is
2163 undefined behavior (even if `count` is zero).
2165 * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that
2166 `blend->num_designs` can be copied to `decoder->buildchar[idx]`.
2167 Also avoid passing NULL to `ft_memcpy`.
2169 Bug: https://crbug.com/1299259
2171 2022-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
2173 [cmake] Drop the support of CMake 2.x.
2175 * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer.
2177 The issue #1059 reports the difficulty to support both of
2178 CMake 2.x and newer one by single CMakeLists.txt without
2179 the inflation of cmake_policy() workarounds.
2181 For better maintainability, the support of CMake 2.x is
2184 2022-02-19 Werner Lemberg <wl@gnu.org>
2186 * src/bdf/README: Updated.
2188 2022-02-19 Werner Lemberg <wl@gnu.org>
2190 * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|.
2192 2022-02-19 Werner Lemberg <wl@gnu.org>
2194 src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.
2196 A kerning table can be handled by binary search if it has equal entries.
2200 2022-02-17 Steve Lhomme <robux4@ycbcr.xyz>
2201 Alexei Podtelezhnikov <apodtele@gmail.com>
2203 [builds/windows] Add support for legacy UWP builds.
2205 * builds/windows/ftsystem.c: Add neccessary macro substitutions to
2206 enable strict UWP builds.
2210 2022-02-16 Werner Lemberg <wl@gnu.org>
2212 ftmm.h: Minor documentation improvement.
2214 2022-02-13 Alexei Podtelezhnikov <apodtele@gmail.com>
2216 [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value.
2218 Before the change, the hinting engine frequently confused horizontal
2219 stem and serif hints making some stems too thin and some serifs too
2220 thick. The value was tuned using serif fonts from the URW+ base 35
2223 * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/.
2225 2022-02-12 Werner Lemberg <wl@gnu.org>
2227 t1tables.h: Documentation improvements.
2229 2022-02-12 Werner Lemberg <wl@gnu.org>
2231 t1tables.h: Whitespace.
2233 2022-02-11 Werner Lemberg <wl@gnu.org>
2235 [type42] Fix `FT_Get_PS_Font_Private` for this format.
2237 Since Type42 fonts don't have a 'Private' dictionary, the return value
2238 should be `FT_Err_Invalid_Argument`.
2240 * src/type42/t42drivr.c (t42_ps_get_font_private): Removed.
2241 (t42_service_ps_info): Updated.
2243 2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
2245 [pshinter] Clear reused mask.
\r
2247 In PS hinter, memory allocations persist until the module is done.
\r
2248 Therefore, we have to clear reused masks.
\r
2250 * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask.
2252 2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
2254 [pshinter] Use unsigned indices.
\r
2256 This reduces casting and eliminates some checks.
\r
2258 * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge,
\r
2259 ps_dimension_add_t1stem, ps_hints_t1stem3): Updated.
\r
2260 (ps_dimension_add_counter): Updated, unnecessary checks removed.
\r
2262 2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
2264 [pshinter] Fix mask merging.
2266 We forgot to update the number of bits when merging a larger mask
2267 into a smaller one. This fix might have rendering effects.
2269 * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number
2270 of bits from a larger mask. There is no need to zero unused bits,
2271 already zeroed during allocation.
2272 (ps_mask_clear_bit): Removed.
2273 (ps_mask_ensure): Minor.
2275 2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
2277 [pshinter] Revise the hint table handling.
\r
2279 * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size
\r
2280 check; avoid array zeroing because it is fully initialized when used.
\r
2281 (ps_hint_table_alloc): Fix off-by-one comparison and remove another
\r
2282 zeroing of the array elements.
\r
2284 2022-02-06 Werner Lemberg <wl@gnu.org>
2286 Various minor doc fixes.
2288 2022-02-06 Alexei Podtelezhnikov <apodtele@gmail.com>
2290 [builds/windows] Add SVG to to project files.
2292 * builds/windows/vc2010/freetype.vcxproj: Updated.
2293 * builds/windows/vc2010/freetype.vcxproj.filters: Updated.
2294 * builds/windows/visualc/freetype.vcproj: Updated.
2296 2022-02-03 Alexei Podtelezhnikov <apodtele@gmail.com>
2298 * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources.
2300 2022-02-02 Eric Jing <@CPUcontrol>
2302 [cmake] Fix build on MacOS.
2304 * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building
2305 of a framework on MacOS.
2307 * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier
2312 2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com>
2314 [psaux] Revise `PS_Table` handling.
2316 The old impleemntation was not using `FT_REALLOC`, buing too careful
2317 with the offset rebasing. It shoudl be safe to rely on the base
2320 * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine
2322 (ps_table_realloc): ... this function based on `FT_REALLOC`.
2323 (ps_table_done): Simplified.
2324 (ps_table_add): Updated.
2326 2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com>
2328 * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing.
2330 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
2332 [cache] Partially revert 9870b6c07e2c.
\r
2334 Fix crashes reported by Werner.
\r
2336 * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again.
2338 2022-01-31 Werner Lemberg <wl@gnu.org>
2340 freetype.h: Minor documentation improvement.
2342 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
2344 [cache] Fix fallouts from edd4fedc5427.
2348 * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph.
2349 * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit.
2351 2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
2353 Clean-up - do not doubt FT_FREE.
2355 * src/base/ftobjs.c (memory_stream_close): Do not reassign zero
2357 * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto.
2358 * src/sfnt/sfwoff2.c (stream_close): Ditto.
2359 * src/psaux/psobjs.c (ps_parser_load_field): Ditto.
2360 * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend,
2361 tt_set_mm_blend): Ditto.
2363 2022-01-30 Werner Lemberg <wl@gnu.org>
2365 * CMakeLists.txt: Include 'FindPkgConfig' module.
2367 Older cmake versions don't provide `pkg_check_modules` by default.
2371 2022-01-30 Alexei Podtelezhnikov <apodtele@gmail.com>
2373 * src/psaux/psobjs.c (ps_parser_load_field): Reduce `string` scope.
2375 2022-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
2377 [cmake] Check the availability of `bzip2.pc'.
2379 (CMakeLists.txt): Check the availability of `bzip2.pc'.
2381 * If `bzip2.pc' is available, Requires.private should include
2382 bzip2, but Libs.private should not include -lbz2.
2384 * If `bzip2.pc' is unavailable, Requires.private cannot include
2385 bzip2, but Libs.private should include -lbz2.
2389 2022-01-28 Werner Lemberg <wl@gnu.org>
2391 * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer.
2393 Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`.
2395 2022-01-28 Alexei Podtelezhnikov <apodtele@gmail.com>
2399 * src/base/ftrfork.c (raccess_make_file_name): Do not set error.
2400 * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto.
2401 * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error.
2402 * src/psaux/psobjs.c (ps_table_done): Ditto.
2403 * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto.
2405 2022-01-27 Ben Wagner <bungeman@chromium.org>
2407 Document `FT_Outline_Decompose` degenerate segments.
2409 `FT_Outline_Decompose` does not filter out and can return degenerate
2410 segments in an outline. This can be surprising when attemping to
2411 stroke such an outline. Clarify the existing documentation on this
2412 matter to cover all forms of degeneracy (without specifying exactly
2413 how they will be reported), why they might arise, and better explain in
2414 what cases they may be an issue.
2416 * include/freetype/ftoutlin.h (FT_Outline_Decompose): update
2421 2022-01-27 Anuj Verma <anujv@posteo.net>
2423 Fix sdf computation while `USE_SQUARED_DISTANCES`.
2425 Function `map_fixed_to_sdf` expects spread to be absolute
2428 * src/sdf/ftbsdf.c (finalize_sdf): Pass absolute spread
2429 while `map_fixed_to_sdf`.
2431 * src/sdf/ftsdf.c (sdf_generate_bounding_box): Ditto.
2433 2022-01-27 Tapish Ojha <tapishojha2000@gmail.com>
2435 [sfnt] Improve sRGB constants.
2437 * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly
2438 more precise values.
2442 2022-01-27 Werner Lemberg <wl@gnu.org>
2444 docs/release: Updated.
2446 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
2448 * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY.
2450 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
2452 * src/sdf/ftsdf.c (sdf_*_new): Use standard macro.
2454 2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
2456 [pcf] Delay encoding allocation and avoid its zeroing.
2458 * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY.
2460 2022-01-25 Werner Lemberg <wl@gnu.org>
2464 2022-01-25 Werner Lemberg <wl@gnu.org>
2466 freetype.h: More updates to `FT_LOAD_COLOR` description.
2468 2022-01-25 Werner Lemberg <wl@gnu.org>
2470 * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`.
2472 This helps in decoupling library support from `pkg-config` for other
2475 2022-01-25 Werner Lemberg <wl@gnu.org>
2477 Update documentation for `FT_LOAD_COLOR`.
2479 2022-01-24 Ben Wagner <bungeman@chromium.org>
2481 [pshinter] Ensure all point flags are initialized.
2483 Only off curve point flags were fully initialized.
2485 * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags.
2487 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930
2489 2022-01-24 Werner Lemberg <wl@gnu.org>
2493 2022-01-23 Werner Lemberg <wl@gnu.org>
2495 * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.
2497 2022-01-23 Werner Lemberg <wl@gnu.org>
2501 2022-01-23 Werner Lemberg <wl@gnu.org>
2503 More documentation on handling OT-SVG.
2505 2022-01-23 Werner Lemberg <wl@gnu.org>
2507 * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency.
2509 2022-01-22 Werner Lemberg <wl@gnu.org>
2511 [sfnt] Reject malformed SVG tables.
2513 * src/sfnt/ttsvg.c (SVG_TABLE_HEADER_SIZE, SVG_DOCUMENT_RECORD_SIZE,
2514 SVG_DOCUMENT_LIST_MINIMUM_SIZE, SVG_MINIMUM_SIZE): New macros.
2515 (tt_face_load_svg): Check offsets.
2516 Check table and record sizes.
2520 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43918
2522 2022-01-22 Alexei Podtelezhnikov <apodtele@gmail.com>
2524 * src/psaux/psobjs.c (ps_table_new): Revert to zeroing.
2526 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
2528 [psaux, type1, type42] Avoid annecessary zeroing.
2530 * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY.
2531 * src/type1/t1load.c (parse_encoding): Ditto.
2532 * src/type42/t42parse.c (t42_parse_encoding): Ditto.
2534 2022-01-20 Werner Lemberg <wl@gnu.org>
2536 [builds/unix] Handle 'librsvg' for demo programs.
2538 * builds/unix/configure.raw: Check for 'librsvg'.
2539 (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on...
2540 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
2542 * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by...
2543 (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
2545 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
2547 Add 'svg' module for OT-SVG rendering.
2549 * CMakeLists.txt (BASE_SRCS): Add svg module file.
2550 * meson.build (ft2_public_headers): Add `otsvg.h`.
2552 * modules.cfg (RASTER_MODULES): Add `svg` module.
2554 * builds/meson/parse_modules_cfg.py: Add svg module.
2556 * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`.
2557 * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and
2558 `Missing_SVG_Hooks` error codes.
2559 * include/freetype/internal/fttrace.h: Add tracing for `otsvg`.
2560 * include/freetype/internal/svginterface.h: New file. It adds an interface
2561 to enable the presetting hook from the `base` module.
2562 * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func,
2563 SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering.
2564 (SVG_RendererHooks): New structure to access them.
2566 * src/base/ftobjs.c: Include `svginterface.h`.
2567 (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG
2569 (ft_add_renderer): Updated.
2571 * src/svg/*: New files.
2573 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
2575 Add `FT_Glyph` support for OT-SVG glyphs.
2577 * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure.
2579 * src/base/ftglyph.c: Include `otsvg.h`.
2580 (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy,
2581 ft_svg_glyph_transform, ft_svg_glyph_prepare): New function.
2582 (ft_svg_glyph_class): New class.
2583 (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs.
2584 * src/base/ftglyph.h: Updated.
2586 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
2588 [truetype, cff] Add code to load SVG document.
2590 * src/cff/cffgload.c (cff_slot_load): Add code to load SVG doc.
2591 * src/truetype/ttgload.c (TT_Load_Glyph): Add code to load SVG doc.
2593 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
2595 Add code to load OT-SVG glyph documents.
2597 * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro.
2598 * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros.
2599 (FT_LOAD_SVG_ONLY): New internal macro.
2600 * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value
2601 `FT_GLYPH_FORMAT_SVG`.
2602 * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro.
2603 * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`.
2604 * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New
2606 * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for
2608 * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the
2609 SVG document and other necessary information of an OT-SVG glyph in a glyph
2611 * include/freetype/tttags.h (TTAG_SVG): New macro.
2613 * src/base/ftobjs.c: Include `otsvg.h`.
2614 (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other`
2615 if the SVG table exists.
2616 (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed
2618 (ft_glyphslot_done): Free the document data if it is a GZIP compressed
2620 (FT_Load_Glyph): Don't auto-hint SVG documents.
2622 * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for
2623 FT_GLYPH_FORMAT_SVG.
2625 * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`.
2626 * src/sfnt/sfdriver.c: Include `ttsvg.h`.
2627 (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and
2628 `tt_face_load_svg_doc`.
2629 * src/sfnt/sfnt.c: Include `ttsvg.c`.
2630 * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and
2631 free data of the the SVG table.
2632 * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`,
2633 `tt_face_free_svg` and `tt_face_load_svg_doc`.
2634 * src/sfnt/ttsvg.h: Declarations of the SVG functions in
2637 2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
2639 Add flag `FT_CONFIG_OPTION_SVG`.
2641 This flag is going to be used to conditionally compile support for OT-SVG
2642 glyphs. FreeType will do the parsing and rely on external hooks for
2643 rendering of OT-SVG glyphs.
2645 * devel/ftoption.h, include/freetype/config/ftoption.h
2646 (FT_CONFIG_OPTION_SVG): New flag.
2648 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
2650 [pshinter] Avoid unnecessary zeroing.
\r
2652 * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init,
\r
2653 psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY.
2655 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
2657 * include/freetype/freetype.h: Clarify `FT_Size` life cycle.
2659 2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
2661 [base] Undefined scale means no scale.
2663 It might be surprising that FreeType does not have default ppem and
2664 the size has to be set explicitly or face undefined behavior with
2665 undefined variables and errors. This offers an alternative to
2666 missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined
2667 behavior is bettr than undefined one.
2669 This is alternative to !132 and discussed in
2670 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708
2672 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale.
2673 * include/freetype/freetype.h: Document it.
2675 2022-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
2677 * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.
2679 Everything in AF_FaceGlobals is initialized except metrics. Those
2680 are zeroed here and initialized on demand later.
2682 2022-01-16 Alexei Podtelezhnikov <apodtele@gmail.com>
2684 [bdf,type1] Avoid unnecessary hash zeroing.
2686 * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`.
2687 * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`.
2689 2022-01-16 Ozkan Sezer <sezeroz@gmail.com>
2691 Add Watcom C/C++ calling.
2693 In the unlikely case the source is built with OpenWatcom's -ec?
2694 switches to enforce a calling convention, the qsort() compare
2695 function must still be set to __watcall.
2697 * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF):
2700 2022-01-15 Ben Wagner <bungeman@chromium.org>
2702 [pshinter] Avoid accessing uninitialized zone.
2704 The `normal_top.count` may be 0, implying no `normal_top.zones` exist.
2705 The code must not access these (non-existent) `normal_top.zones`.
2707 * src/pshinter/pshalgo.c (ps_hints_apply): Do not assume that
2708 `normal_top.zones[0]` is initialized. Test `normal_top.count`
2709 before using `normal_top.zones[0]`. Do not rescale if there are no
2712 Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43675
2714 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
2716 [cache] Avoid unnecessary zeroing.
2718 * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`.
2719 * src/cache/ftcimage.c (FTC_INode_New): Ditto.
2720 * src/cache/ftcsbits.c (FTC_SNode_New): Ditto.
2722 2022-01-15 Ozkan Sezer <sezeroz@gmail.com>
2724 Add Watcom C/C++ support.
2726 * include/freetype/config/integer-types.h: Make sure `long long` is
2727 used then available.
2728 * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
2730 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
2732 * src/sdf/ftbsdf.c (ED): s/near/prox/.
2734 This works around the Watcom C definition of `near` as restricted
2737 2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
2739 * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten.
2741 This works around Watcom C library using __watcall.
2743 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
2745 * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing.
2747 This large allocation is followed by careful initialization. Whatever
2748 is missed should be initialized manually.
2750 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
2752 * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing.
2754 2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
2756 * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment.
2758 2022-01-13 Alexei Podtelezhnikov <apodtele@gmail.com>
2760 * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing.
2762 2022-01-13 Ben Wagner <bungeman@chromium.org>
2764 [bzip2] Reset bzip stream on any error.
2766 According to the bzip documentation it is undefined what will happen if
2767 `BZ2_bzDecompress` is called on a `bz_stream` it has previously returned an
2768 error against. If `BZ2_bzDecompress` returns anything other than `BZ_OK`
2769 the only valid next action is `BZ2_bzDecompressEnd`.
2773 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564
2775 * src/bzip2/ftbzip2.c (FT_BZip2FileRec_): Add `reset` to track the need to
2777 (ft_bzip2_file_init): Initialize `reset` to 0.
2778 (ft_bzip2_file_reset): Set `reset` to 0 after resetting.
2779 (ft_bzip2_file_fill_output): Set `reset` to 1 when `BZ2_bzDecompress`
2780 returns anything other than `BZ_OK`.
2782 2022-01-12 Werner Lemberg <wl@gnu.org>
2784 .gitlab-ci.yml: Minor comment cleanups.
2786 2022-01-12 Azamat H. Hackimov <azamat.hackimov@gmail.com>
2788 .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA.
2790 Fetch current list of valid CAs from Windows Update and manually import them
2791 to trusted datastore. This action is required to make downloads work from
2792 sites that need recent Let's Encrypt ISRG Root X1 certificate.
2794 2022-01-11 Ben Wagner <bungeman@chromium.org>
2796 Revert "[bzip2] Avoid use of uninitialized memory."
2798 This reverts commit d276bcb7f0c02c20d3585b2e5626702df6d140a6.
2800 The original commit did avoid the use of uninitialized memory. However,
2801 it appears that the original commit is no longer required. The
2802 underlying issue was resolved by a change in freetype2-testing "Build
2803 bzip2 correctly." [0]. Prior to [0] bzip2 was built without msan, so
2804 bzip2 writes were not tracked or considered initialized. Clearing
2805 `buffer` in the original commit allowed msan to see the `buffer` content
2806 initialized once in FreeType code, but msan saw no writes into buffer
2807 from bzip2. With bzip2 now built with msan, the bzip2 writes are
2808 properly instrumented and msan sees the bzip2 writes into the buffer. As
2809 a result the original commit can be safely reverted to allow for better
2810 detection of other uninitialized data scenarios.
2812 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Revert to using `FT_QNEW`.
2814 [0] https://github.com/freetype/freetype2-testing/commit/3c052a837a3c960709227a0d6ddd256e87b88853
2816 2022-01-11 Ben Wagner <bungeman@chromium.org>
2818 [type42] Track how much type42 ttf data is available.
2820 Currently `T42_Open_Face` eagerly allocates 12 bytes for the ttf header
2821 data which it expects `t42_parse_sfnts` to fill out from /sfnts data.
2822 However, there is no guarantee that `t42_parse_sfnts` will actually be
2823 called while parsing the type42 data as the /sfnts array may be missing
2824 or very short. This is also confusing behavior as it means
2825 `T42_Open_Face` is tightly coupled to the implementation of the very
2826 distant `t42_parse_sfnts` code which requires at least 12 bytes to
2827 already be reserved in `face->ttf_data`.
2829 `t42_parse_sfnts` itself eagerly updates `face->ttf_size` to track how
2830 much space is reserved for ttf data instead of traking how much data has
2831 actually been written into `face->ttf_data`. It will also act strangely
2832 in the presense of multiple /sfnts arrays.
2834 * src/type42/t42objs.c (T42_Open_Face): ensure `ttf_data` is initialized
2835 to NULL. Free `ttf_data` on error.
2837 * src/type42/t42parse.c (t42_parse_sfnts): delay setting `ttf_size` and
2838 set it to the actual number of bytes read. Ensure `ttf_data` is freed
2839 if there are multiple /sfnts arrays or there are any errors.
2841 2022-01-11 Dominik Röttsches <drott@chromium.org>
2843 [sfnt] Fix limit checks for `COLR` v1 ClipBoxes
2845 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Fix off-by-one in
2848 2022-01-11 Werner Lemberg <wl@gnu.org>
2850 Update all copyright notices.
2852 2022-01-11 Werner Lemberg <wl@gnu.org>
2854 * src/sfnt/ttcolr.c (read_paint): Fix undefined left-shift operation.
2858 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43151
2860 2022-01-11 Werner Lemberg <wl@gnu.org>
2862 * src/type42/t42objs.c (T42_Open_Face): Avoid use of uninitialized memory.
2866 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43508
2868 2022-01-11 Werner Lemberg <wl@gnu.org>
2870 .gitlab-ci.yml: Fix typo in previous commit.
2872 2022-01-11 Werner Lemberg <wl@gnu.org>
2874 .gitlab-ci.yml: Update Windows image.
2876 The old image produced errors like
2879 Downloading zlib patch from
2880 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
2881 A fallback URL could be specified using patch_fallback_url key in the wrap file
2882 WrapDB connection failed to
2883 https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
2885 <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
2886 failed: certificate has expired (_ssl.c:1122)>
2889 2022-01-11 Werner Lemberg <wl@gnu.org>
2891 * subprojects/zlib.wrap: Update from upstream.
2893 2022-01-10 Werner Lemberg <wl@gnu.org>
2895 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Add limit checks.
2899 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40716
2901 2022-01-10 Werner Lemberg <wl@gnu.org>
2903 [zlib] Don't typedef `ptrdiff_t`.
2905 While using zlib in 'solo' mode (via the `Z_SOLO` macro), we actually
2906 include some standard header files, making the typedef fail on systems where
2907 the native `ptrdiff_t` type differs.
2911 * src/zlib/zutil.h: Comment out definition; it doesn't work on Windows.
2913 * src/zlib/patches/freetype-zlib.diff: Updated.
2915 2022-01-10 Werner Lemberg <wl@gnu.org>
2917 [zlib] Some organizational changes.
2919 We now first apply zlib's `zlib2ansi` script, then FreeType's patch file.
2921 * src/gzip/README.freetype: Updated.
2923 * patches/0001-zlib-Fix-zlib-sources-to-compile-for-FreeType.patch: Renamed
2925 * patches/freetype-zlib.diff: This.
2926 Clean up description, then regenerate it as follows:
2928 - Copy unmodified files from `zlib` repository.
2929 - Run `zlib2ansi` script.
2930 - Run `git diff -R > patches/freetype-zlib.diff.new`.
2931 - Insert patch description of old diff file, then replace old diff with
2934 2022-01-09 David Turner <david@freetype.org>
2936 [gzip] Update sources to zlib 1.2.11
2938 This can be tested by building with the Unix development build
2943 or by building the freetype-demos programs with
2945 meson setup build -Dfreetype2:zlib=internal
2946 meson compile -C out
2948 and trying to run `ftview` with a `.pcf.gz` font file.
2950 * src/gzip/ftgzip.c, src/gzip/rules.mk: Update for new zlib sources. Also
2951 remove the temporary fix introduced in commit 6a431038 to work around the
2952 fact that the internal sources were too old.
2954 * src/gzip/README.freetype: New file describing the origin of the sources
2955 and how they were modified.
2957 * src/gzip/patches/*: Patch files applied to original sources.
2959 * src/gzip/*: Updated zlib sources with the patch file(s) from
2960 `src/gzip/patches/` applied, followed by a conversion with zlib's
2963 2022-01-09 David Turner <david@freetype.org>
2965 [meson] Change Zlib configuration option.
2967 * meson_options.txt, meson.build: Change the format of the 'zlib' meson
2968 build configuration option to be a combo with the following choices:
2970 - none: Do not support gzip-compressed streams at all.
2972 - internal: Support gzip-compressed streams using the copy of the gzip
2973 sources under `src/gzip/`; this should only be used during development
2974 to ensure these work properly.
2976 - external: Support gzip-compressed streams using the 'zlib' Meson
2977 subproject, linked as a static library.
2979 - system: Support gzip-compressed streams using a system-installed version
2982 - auto: Support gzip-compressed streams using a system-installed version
2983 of zlib, if available, or using the 'zlib' subproject otherwise. This
2986 - disabled: Backward-compatible alias for 'none'.
2988 - enabled: Backward-compatible alias for 'auto'.
2990 2022-01-09 Werner Lemberg <wl@gnu.org>
2992 [bzip2] Avoid use of uninitialized memory.
2994 * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but
2995 `FT_NEW` for setting up `zip` to avoid uninitialized memory access while
2996 handling malformed PCF fonts later on.
3000 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800
3002 2022-01-09 Alexei Podtelezhnikov <apodtele@gmail.com>
3004 [sfnt] Fix off-by-one error.
3006 The 0-base index is equal to the number of previosly parsed entries.
3007 It is an error to adjust it by one to get the number truncated by
3008 a stream error. This is probably inconsequential because valid
3009 entries are correctly accounted for.
3011 * src/sfnt/ttload.c (check_table_dir): Do not adjust the truncated
3014 2022-01-08 Werner Lemberg <wl@gnu.org>
3016 [sfnt, type42] Correct previous commit.
3018 Really fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773.
3020 * src/sfnt/ttload.c (check_table_dir): Revert change.
3022 * src/type42/t42.parse.c (t42_parse_sfnts): Don't use `FT_QREALLOC` but
3023 `FT_REALLOC` for setting up `ttf_data` to avoid uninitialized memory access
3024 while handling malformed TrueType fonts later on.
3026 2022-01-07 Werner Lemberg <wl@gnu.org>
3028 * src/sfnt/ttload.c (check_table_dir): Initialize `table`.
3032 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773
3034 2022-01-07 Werner Lemberg <wl@gnu.org>
3036 [sfnt] Avoid 'runtime error: applying zero offset to null pointer'.
3038 * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if
3041 2022-01-07 Werner Lemberg <wl@gnu.org>
3043 [autofit, pshinter] Use `FT_OFFSET`.
3048 runtime error: applying zero offset to null pointer
3051 warnings of clang's undefined behaviour sanitizer.
3053 * src/autofit/afcjk.c (af_cjk_hints_link_segments,
3054 af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges,
3055 af_cjk_hint_edges, af_cjk_align_edge_points): Do it.
3057 * src/autofit/afhints.c (af_glyph_hints_align_edge_points,
3058 af_glyph_hints_align_strong_points): Ditto.
3060 * src/autofit/aflatin.c (af_latin_metrics_init_widths,
3061 af_latin_hints_link_segments, af_latin_hints_compute_edges,
3062 af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto.
3064 * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto.
3066 2022-01-06 Ben Wagner <bungeman@chromium.org>
3068 [truetype] Reset localpoints when varying cvt.
3070 When iterating over the cvt tuples and reading in the points it is necessary
3071 to set all of `localpoints`, `points`, and `point_count` in all cases. The
3072 existing code did not reset `localpoints` to `NULL` when there were no
3073 private point numbers. If the previous tuple did have private point numbers
3074 and set `localpoints` to `ALL_POINTS` this would not be cleared and the
3075 wrong branch would be taken later, leading to possible heap buffer overflow.
3077 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Reset `localpoints` to `NULL`
3078 when it isn't valid.
3080 Fixes: https://crbug.com/1284742
3082 2022-01-02 Werner Lemberg <wl@gnu.org>
3084 * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable.
3086 This was accidentally removed with commit 93ebcbd0 almost eight years ago.
3088 2021-12-27 Alexander Borsuk <me@alex.bio>
3090 Fix warnings for CMake Unity builds.
3092 * src/cache/ftcbasic.c (FT_COMPONENT): Undefine macro before redefinition.
3093 * src/smooth/ftgrays.c (TRUNC, FRACT): Ditto.
3095 2021-12-18 Alexander Borsuk <alexander.borsuk@qnective.com>
3097 Clang-Tidy warning fixes.
3099 * src/base/ftobjs.c (FT_Get_Paint): Operator has equivalent nested operands.
3100 * src/bdf/bdflib.c (_bdf_add_property): Value stored to `fp` is never read.
3101 * src/sdf/ftbsdf.c (bsdf_init_distance_map): Value stored to `pixel` is
3103 * src/sdf/ftsdf.c (split_sdf_shape): Value stored to `error` is never read.
3105 2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
3107 * meson.build: Optimize lookup for `python3` program.
3109 The python module's `find_installation` method is intended to provide
3110 routines for compiling and installing python modules into the
3111 `site-packages` directory. It does a couple of slow things, including run
3112 an introspection command to scrape sysconfig info from the detected
3113 interpreter, which are not needed for the sole use case of invoking the
3114 found installation as an executable.
3116 Furthermore, when invoked without the name or path of a python binary, it is
3117 hardcoded to always look for `python3` corresponding to the interpreter
3118 meson itself uses to run. So using `find_installation` did not even allow
3119 detecting `python2` as a fallback.
3121 Instead, switch to a simple `find_program` lookup that finishes as soon as
3122 the program is found.
3124 2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
3126 * builds/meson/*.py: Fix name of python executable for auxiliary scripts.
3128 The previous change to check the return code of `run_command` invocations
3129 caused the CI to fail. Although most scripts used `python_exe` as the
3130 program command, the script to determine the project version did not.
3132 But, all scripts used `python` as the shebang, and this is not available on
3133 all systems. Particularly Debian does not provide a `python` command,
3134 though `python3` does exist. This meant that formerly the version number
3135 was lacking, and now the build simply fails.
3137 Instead, rely on `python3` since it is guaranteed to exist when running
3138 meson, and `python2` is end of life anyway.
3140 2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
3142 * meson.build: Check the return value of `run_command`.
3144 By default, errors are not checked and a command that is somehow broken will
3145 just capture incorrect output (likely an empty string). Current development
3146 versions of meson now raise a warning for this implicit behavior, and advise
3147 explicitly setting the `check:` keyword argumend to determine whether a
3148 failing return code should be considered an error.
3150 Since none of the commands in this project are expected to fail, mark them
3151 as required to succeed.
3153 2021-12-13 Alexei Podtelezhnikov <apodtele@gmail.com>
3155 [truetype] Upstream the hdmx binary search.
3157 * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx
3159 * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even
3160 though it might never be used by the interpreter.
3161 * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches
3164 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3166 [truetype] Reset the IUP-called flags for each subglyph.
3168 This fixes fall-out from 7809007a5b88b15, where the composite
3169 accents were no longer hinted.
3171 * src/truetype/ttgload.c (ttloader_init): Move the IUP-called flag
3172 initialization from here...
3173 * src/truetype/ttinterp.c (TT_Run_Context): ... to here.
3175 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3177 [truetype] Binary search through the `hdmx` records.
3179 The `hdmx` table is supposed to be sorted by ppem size, which
3180 enables binary search. We also drop the check for the sufficient
3181 length of the record because it is now enforced when the table
3184 * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx`
3185 record pointers sorted by ppem instead of ppem's themselves.
3186 * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records.
3187 (tt_face_get_device_metrics): Implement binary search to retrieve
3190 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3192 [truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable.
3194 This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY
3195 is specified by FT_Get_Advances and the `hdmx` data are located.
3196 Particularly, the classic v35 interpreter or "verified" ClearType
3197 fonts might see 100x speed up in retrieving the hdmx cache.
3199 * src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut.
3201 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3203 [truetype] Initialize the loader with `hdmx` data.
3205 The `hdmx` matching can be done before the glyph is loaded.
3207 * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field.
3208 * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx`
3210 (tt_loader_init): ... to here, before the glyph is loaded.
3212 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3214 [truetype] Relocate subpixel flag setting.
3216 `TT_RunIns` is too busy to deal with subpixel flags. It is better
3217 to set them in `tt_loader_init`, which is executed before each
3220 * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting from
3222 * src/truetype/ttgload.c (tt_loader_init): ... to here.
3224 2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3226 [truetype] Limit INSTCTRL appication within specs.
3228 * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects
3229 to the CVT program and local effects to the glyph program.
3231 This also fixes an Infinality buglet. The `ignore_x_mode` should be
3232 locally unset by the glyph program.
3234 2021-12-09 Ben Wagner <bungeman@chromium.org>
3236 [bdf] Fix use of uninitialized value.
3238 In _bdf_readstream if the data contained no newline then the buffer
3239 would continue to grow and uninitialized data read until either the
3240 uninitialized data contained a newline or the buffer reached its
3241 maxiumum size. The assumption was that the line was always too long and
3242 the buffer had been filled, however this case can also happen when there
3243 is not enough data to fill the buffer.
3245 Correct this by properly setting the cursor to the end of the available
3246 data, which may be different from the end of the buffer. This may still
3247 result in one extra allocation, but only on malformed fonts.
3249 * src/bdf/bdflib.c (_bfd_readstream): Correctly update cursor. Remove
3250 unread set of `avail`.
3252 Bug: https://lists.nongnu.org/archive/html/freetype-devel/2021-12/msg00001.html
3254 2021-12-07 Alexei Podtelezhnikov <apodtele@gmail.com>
3256 [truetype] Reduce Infinality footprint again.
3258 * src/truetype/ttgload.c (compute_glyph_metrics): Streamline and
3259 prioritize the Infinality checks to use `hdmx`.
3261 2021-12-07 Cameron Cawley <ccawley2011@gmail.com>
3263 [builds/windows] Guard some non-ancient API.
3265 We can support Windows 98 and NT 4.0 in principle...
3267 * builds/windows/ftdebug.c, builds/windows/ftsystem.c: Check for the
3268 ancient SDK using _WIN32_WINDOWS, _WIN32_WCE, or _WIN32_WINNT.
3270 2021-12-07 Cameron Cawley <ccawley2011@gmail.com>
3272 * builds/windows/visualc/freetype.vcproj: Add missing file.
3274 2021-12-02 Werner Lemberg <wl@gnu.org>
3276 * Version 2.11.1 released.
3277 ==========================
3279 Tag sources with `VER-2-11-1'.
3281 * docs/VERSION.TXT: Add entry for version 2.11.1.
3282 * docs/CHANGES, docs/release: Updated.
3284 * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
3285 builds/windows/visualc/index.html, builds/windows/visualce/index.html,
3286 builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
3287 docs/freetype-config.1: s/2.11.0/2.11.1/, s/2110/2111/.
3289 * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
3291 * builds/unix/configure.raw (version_info): Set to 24:1:18.
3292 * CMakeLists.txt (VERSION_PATCH): Set to 1.
3294 * builds/toplevel.mk (version_tag, CHANGELOG_SCRIPT): New variables.
3295 (do-dist): Generate `ChangeLog` file with all commits since last release.
3297 2021-11-30 Alexei Podtelezhnikov <apodtele@gmail.com>
3299 [builds/windows] Improve debugging.
3301 * builds/windows/ftdebug.c (FT_Message, FT_Panic): Buffer output
3302 and call `OutputDebugStringA` only if `IsDebuggerPresent`.
3303 [_WIN32_WCE] (OutputDebugStringA): Implement the missing API.
3305 2021-11-29 Seigo Nonaka <nona@google.com>
3307 * src/base/ftobjs.c (FT_Request_Metrics): Fix build warning on Android.
3309 Use casts since `FT_USHORT_MAX` is unsigned short in bionic (libc used in
3312 2021-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
3314 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Minor tweak.
3316 2021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com>
3318 * src/truetype/ttpload.c (tt_face_load_hdmx): Added comments.
3320 2021-11-26 Alexei Podtelezhnikov <apodtele@gmail.com>
3322 [truetype] Quietly reject out-of-spec `hdmx` tables.
3324 The `hdmx` table is optional and can be safely rejected without
3325 an error if it does not follow specifications. The record size
3326 must be equal to the number of glyphs + 2 + 32-bit padding.
3328 * src/truetype/ttpload.c (tt_face_load_hdmx): Thoroughly check
3329 the record size and improve tracing.
3331 2021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com>
3333 [truetype] Partly revert 5b626281.
3337 * src/truetype/ttpload.c (tt_face_load_hdmx): Do not assume that
3338 `record_size` is rounded even though the records are padded.
3340 2021-11-23 Alexei Podtelezhnikov <apodtele@gmail.com>
3342 * builds/windows/vc2010/freetype.vcxproj (DlgCopy): Use transforms.
3344 2021-11-22 Werner Lemberg <wl@gnu.org>
3346 Update `CHANGES` files, other minor whitespace and documentation issues.
3348 2021-11-21 Werner Lemberg <wl@gnu.org>
3350 formats.txt: Add info about WOFF and WOFF2.
3352 2021-11-21 Werner Lemberg <wl@gnu.org>
3354 meson.build: Initialize `common_ldflags`.
3356 2021-11-21 Lukas Oberhuber <@lukaso>
3358 * meson.build: Fix compatibility version on MacOS.
3362 2021-11-21 Werner Lemberg <wl@gnu.org>
3364 * src/truetype/ttinterp.c (Ins_MD): Avoid `FT_ABS`.
3368 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38562
3370 2021-11-20 Alexei Podtelezhnikov <apodtele@gmail.com>
3372 * include/freetype/fttypes.h (FT_MAKE_TAG): Remove the same casting.
3374 2021-11-20 Werner Lemberg <wl@gnu.org>
3376 [gxvalid] Fix minor compilation warning.
3378 * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup): Declare
3381 2021-11-20 Werner Lemberg <wl@gnu.org>
3383 [smooth] Fix stand-alone compilation.
3385 * src/smooth/ftgrays.c (FT_Trace_Enable, FT_Trace_Disable)[STANDALONE_]:
3388 2021-11-20 Werner Lemberg <wl@gnu.org>
3390 Avoid undefined left-shifts.
3392 We really have to use double casts to avoid issues with C's and C++'s
3393 signedness propagation rules in implicit casts.
3397 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41178
3398 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=41182
3400 * include/freetype/config/public-macros.h (FT_STATIC_CAST,
3401 FT_REINTERPRET_CAST): Modify macro to take two arguments.
3403 (FT_STATIC_BYTE_CAST): New macro.
3405 * include/freetype/freetype.h (FT_ENC_TAG): Use `FT_STATIC_BYTE_CAST`.
3406 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto.
3407 * include/freetype/fttypes.h (FT_MAKE_TAG): Ditto.
3408 Use `FT_Tag` for casting.
3410 * src/ftraster/ftmisc.h (FT_MAKE_TAG): Removed, no longer needed.
3411 (FT_STATIC_BYTE_CAST): New macro.
3413 * src/smooth/ftgrays.c (FT_STATIC_CAST): Replace with...
3414 (FT_STATIC_BYTE_CAST): ... this.
3416 2021-11-18 Werner Lemberg <wl@gnu.org>
3418 Provide C++ versions for public macros with casts.
3420 Many FreeType clients use C++. However `g++ -Wold-style-cast` warns for
3421 macros with C-style casts even for system header files; this also affects
3422 directories included with `-isystem`. While this could be seen as a problem
3423 with g++, the problem is more a philosophical one: Over the time, C and C++
3424 diverged more and more, and some features of C are no longer the 'right'
3427 * include/freetype/config/public-macros.h (FT_STATIC_CAST,
3428 FT_REINTERPRET_CAST): New macros.
3430 * include/freetype/freetype.h (FT_ENC_TAG, FT_LOAD_TARGET_,
3431 FT_LOAD_TARGET_MODE): Use `FT_STATIC_CAST`.
3432 Correctly handle negative 'signed char' input.
3433 * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto.
3434 * include/freetype/fttypes.h (FT_MAKE_TAG, FT_BOOL): Ditto.
3435 * include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): Use
3436 `FT_REINTERPRET_CAST`.
3438 * src/smooth/ftgrays.c (FT_STATIC_CAST)[STANDALONE_]: New macro.
3439 [!STANDALONE]: Include `FT_CONFIG_CONFIG_H`.
3443 2021-11-16 Werner Lemberg <wl@gnu.org>
3445 Fix clang++ warnings.
3447 * src/*: Initialize some variables to NULL.
3449 2021-11-16 Werner Lemberg <wl@gnu.org>
3451 [truetype] Updates for the forthcoming OpenType 1.9 standard (2/2).
3453 * src/truetype/ttgxvar.c (ft_var_load_item_variation_store):
3454 s/shortDeltaCount/wordDeltaCount/ (as done in the specification, too).
3455 Recognize new format and reject it for now.
3457 2021-11-16 Werner Lemberg <wl@gnu.org>
3459 [truetype] Updates for the forthcoming OpenType 1.9 standard (1/2).
3461 This is in preparation for implementing `DeltaSetIndexMap` format 1, which
3462 is used by `COLR` v1 tables, and which allows 32bit indices.
3464 https://docs.microsoft.com/en-us/typography/opentype/otspec190/delta/otvarcommonformats_delta.html
3466 * src/truetype/ttgxvar.h (GX_DeltaSetIdxMapRec): Change type of `mapCount`
3469 * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping): Add argument
3470 for passing the table size; update caller.
3471 Implement new format.
3473 2021-11-14 Werner Lemberg <wl@gnu.org>
3477 * src/gxvalid/gxvcmmn.h (GXV_SET_ERR_IF_PARANOID): Use 'do' block.
3478 * src/gxvalid/gxvmod.c (GXV_TABLE_LOAD, GXV_TABLE_VALIDATE): Ditto.
3480 * src/smooth/ftgrays.c (gray_convert_glyph): Add cast.
3482 * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Remove cast.
3483 * src/type1/t1load.c (read_binay_data): Use `FT_ULong` for `size` parameter.
3484 (parse_subrs, parse_charstrings, parse_dict): Ditto; also add some casts.
3486 2021-11-13 Dominik Röttsches <drott@chromium.org>
3488 [sfnt] Avoid undefined shifts in `COLR` v1 paint parsing
3490 * src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Tighten shift
3491 behavior by using multiplication, mostly using macros from ftcalc.h.
3493 Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1269168
3495 2021-11-13 Alexei Podtelezhnikov <apodtele@gmail.com>
3497 [builds/windows] Improve `DlgCopy` target.
3501 * builds/windows/vc2010/freetype.vcxproj: Run `DlgCopy` conditionally
3502 and decouple it from `Build`.
3504 2021-11-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3506 Explicitly define `FT_MSB` for Clang.
3508 * include/freetype/internal/ftcalc.h [__clang__] (FT_MSB): Updated.
3510 2021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com>
3512 * src/truetype/ttgxvar.c (ft_var_to_normalized): Edge optimization.
3514 2021-11-10 Alexei Podtelezhnikov <apodtele@gmail.com>
3516 Additional `FT_MSB` macro definitions.
3518 Better macros for Windoes CE and ARM in general, based on !109
3521 * include/freetype/internal/ftcalc.h [_MSC_VER] (FT_MSB): Updated.
3523 2021-11-09 Alexei Podtelezhnikov <apodtele@gmail.com>
3525 [build/windows] Remove logging from default debug configurations.
3527 DLG is rather costly for performance and should be used judiciously.
3528 This removes it from the default configurations but gives an example
3529 how to enable it using the `UserDefines` property.
3531 * builds/windows/vc2010/freetype.vcxproj: Hide FT_DEBUG_LOGGING.
3533 2021-11-08 Werner Lemberg <wl@gnu.org>
3535 * src/sfnt/sfobjs.c (sfnt_open_font): Fix typo.
3537 2021-11-08 Werner Lemberg <wl@gnu.org>
3539 * src/gxvalid.*, src/otvalid.*: Fix `-Wformat` warnings.
3541 2021-11-08 Werner Lemberg <wl@gnu.org>
3543 [pshinter] Fix C++ compilation.
3545 * src/pshinter/pshalgo.c (psh_compute_dir): Fix type of `result`.
3546 (psh_hint_table_find_strong_points): Add cast.
3548 2021-11-08 Werner Lemberg <wl@gnu.org>
3550 [sfnt] Reduce footprint if WOFF and WOFF2 support is not needed.
3552 Based on a patch from metarutaiga (MR !106). The gist of this commit is
3553 that it doesn't make sense to support WOFF without compression (which would
3554 be only possible in WOFF 1.0 anyway).
3556 * src/sfnt/sfobjs.c (sfnt_open_font): Guard WOFF code with
3557 `FT_CONFIG_OPTION_USE_ZLIB` block.
3558 Guard WOFF2 code with `FT_CONFIG_OPTION_USE_BROTLI` block.
3560 * src/sfnt/sfwoff.c, src/sfnt/sfwoff.h: Guard files with
3561 `FT_CONFIG_OPTION_USE_ZLIB` blocks, not parts of the code.
3563 * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h, src/sfnt/woff2tags.c,
3564 src/sfnt/woff2tags.h: Guard files with `FT_CONFIG_OPTION_USE_BROTLI` blocks,
3565 not parts of the code.
3569 2021-11-08 Werner Lemberg <wl@gnu.org>
3571 [truetype] Make trickyness checks depend on TT_USE_BYTECODE_INTERPRETER.
3573 Based on a patch from metarutaiga (MR !106).
3575 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag,
3576 tt_check_trickyness_family, tt_synth_sfnt_checksum, tt_get_sfnt_checksum,
3577 tt_check_trickyness_sfnt_ids, tt_check_trickyness): Put functions into a
3578 `TT_USE_BYTECODE_INTERPRETER` block.
3579 (tt_face_init): Put trickyness checks into a `TT_USE_BYTECODE_INTERPRETER`
3584 2021-11-08 Alexei Podtelezhnikov <apodtele@gmail.com>
3586 * src/sfnt/ttload.c (tt_face_load_gasp): Fix a type mismatch warning.
3588 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com>
3590 [dlg] Define DLG_STATIC explicitly.
3592 DLG_STATIC is intended to disable Windows DLL linking attributes.
3593 It does not hurt to define it explicitly when we wrap DLG code.
3594 This fixes tons of LNK4286 and C4273 warnings from MSVC if we
3595 forget to define DLG_STATIC as a compiler option.
3597 * builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option.
3598 * src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC.
3599 * include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto.
3601 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com>
3603 [dlg] Lighten up the inclusions.
3605 The DLG wrapper needs to know if FT_DEBUG_LOGGING is defined in
3606 `ftoption.h`. It does not need entire FreeType.
3608 * src/dlg/dlgwrap.c: Include FT_CONFIG_OPTIONS_H directly.
3610 2021-11-07 Alexei Podtelezhnikov <apodtele@gmail.com>
3612 [truetype] Avoid some memory zeroing in variations.
3614 * src/truetype/ttgxvar.c (ft_var_readpackeddeltas, ft_var_load_avar,
3615 ft_var_load_item_variation_store, ft_var_load_gvar): Use FT_QNEW_ARRAY
3616 if memory immediately initialized or discarded otherwise.
3618 2021-11-05 Jany Belluz <jany.belluz@daltonmaag.com>
3620 [truetype] Fix handling of packed deltas in Variation Fonts.
3622 * src/truetype/ttgxvar (ft_var_readpackeddeltas): Don't expect the number of
3623 bytes used to encode the deltas to be higher than the number of encoded
3624 values. The specification allows a very compact encoding; for example, a
3625 list of 200 zeros can be encoded with just a couple of bytes.
3627 We now count the consumed bytes to make sure to not read more than expected.
3629 2021-11-04 Jany Belluz <jany.belluz@daltonmaag.com>
3631 [truetype] Fix CVAR handling of tuples for all points.
3633 * src/truetype/ttgxvar (tt_face_vary_cvt): Function
3634 `ft_var_readpackedpoints`, when it returns `ALL_POINTS`, also sets
3635 `point_count` to value 0. However, the CVAR code was incorrectly expecting
3636 that `point_count` would be set to match the length of the CVT table.
3638 2021-11-04 Jany Belluz <jany.belluz@daltonmaag.com>
3640 * src/truetype/ttgxvar.c: Fix typos in macros that guard CVAR code.
3642 2021-11-04 Alexei Podtelezhnikov <apodtele@gmail.com>
3644 * docs/INSTALL: Mention Meson and MSBuild more prominently.
3646 2021-11-03 Gabor Kertesz <gabor.kertesz@linaro.org>
3648 [libpng] Update Meson wrap for win-arm64
3650 1.6.37-5 released patches for win-arm64 to successfully build
3652 https://github.com/mesonbuild/wrapdb/pull/205
3653 https://github.com/mesonbuild/wrapdb/pull/216
3655 Updated by the following command:
3656 meson wrap update libpng
3658 Tested on win-arm64 and x64.
3660 2021-11-03 Dominik Röttsches <drott@chromium.org>
3662 [sfnt] Clarify `COLR` v1 FT_Paint* format representations
3664 * include/freetype/ftcolor.h (FT_PaintLinearGradient,
3665 FT_PaintRadialGradient, FT_PaintSweepGradient, FT_PaintTransform,
3666 FT_PaintTranslate, FT_PaintScale, FT_PaintRotate, FT_PaintSkew): Clarify
3667 16.16 fixed point representation of struct fields.
3668 * src/sfnt/ttcolr.c (read_paint): Shift coordinates for
3669 FT_PaintLinearGradient, FT_PaintRadialGradient, FT_PaintSweepGradient
3672 Fixes: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1110
3674 2021-11-03 Alexei Podtelezhnikov <apodtele@gmail.com>
3676 [builds/windows] Let MSBuild handle DLG copy.
3678 * builds/windows/vc2010/freetype.vcxproj: Specify DlgCopy target.
3679 * builds/windows/vc2010/script.bat: Deleted.
3681 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
3683 * src/truetype/ttgload.c (load_truetype_glyph): Fix MSVC warning C4312.
3685 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
3687 [builds/windows] Separate MSVC linker and librarian.
3689 MSVC uses LIB for static and LINK for dynamic libraries. They are
3690 related but the former has much smaller set of options.
3692 * builds/windows/vc2010/freetype.vcxproj: Updated.
3694 2021-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
3696 [builds/windows] Revise MSVC linking optimizations.
3698 * builds/windows/vc2010/freetype.vcxproj: Optimize DLL linking only.
3699 * builds/windows/visualc/freetype.dsp: Ditto.
3700 * builds/windows/visualc/freetype.vcproj: Ditto.
3702 2021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com>
3704 [woff] Optimize table tagging.
3706 * include/freetype/internal/wofftypes.h (WOFF_TableRec): Use
3708 * src/sfnt/sfwoff.c (woff_open_font): Use 32-bit tag.
3710 2021-10-28 Alexei Podtelezhnikov <apodtele@gmail.com>
3712 [woff2] Optimize table tagging.
3716 * include/freetype/internal/wofftypes.h (WOFF2_TableRec): Use
3718 * src/sfnt/sfwoff2.c (compare_tags, find_table, woff2_open_font):
3720 * src/sfnt/woff2tags.[ch] (woff2_known_tags): Use static storage and
3723 2021-10-26 Werner Lemberg <wl@gnu.org>
3727 2021-10-26 Ben Wagner <bungeman@chromium.org>
3729 [mm] Tolerate missing Blend dictionary entries
3731 In a Multiple Master font, the Blend dictionary must contain valid
3732 Private, FontInfo, and FontBBox. The current code will error if any of
3733 these are present and invalid, but will not error and will provide
3734 uninitialized data if the Blend dictionary exists but does not contain
3735 one of these entries. This change reverts to the older behavior of
3736 treating any missing entries as containing all zero data and not
3739 In the future it may be best to keep track of when these are actually
3740 initialized and error if they are not.
3742 * src/type1/t1load.c (t1_allocate_blend): Zero initiailize.
3744 2021-10-26 Alexei Podtelezhnikov <apodtele@gmail.com>
3746 [builds/windows] Add MSVC linker optimazations.
3748 We continue to build static libraries with statically linked C run-
3749 time and add options to optimize references.
3751 * builds/windows/vc2010/freetype.vcxproj: Sort entries, add options.
3753 2021-10-23 Alexei Podtelezhnikov <apodtele@gmail.com>
3755 * builds/windows/vc2010/freetype.vcxproj: Use MachineARM64.
3757 2021-10-22 Alexei Podtelezhnikov <apodtele@gmail.com>
3759 [builds/windows] Prioritize x64.
3761 * builds/windows/vc2010/freetype.sln: Sort entries.
3763 2021-10-22 Gabor Kertesz <gabor.kertesz@linaro.org>
3765 [builds/windows] Add ARM64 platform.
3767 * builds/windows/vc2010/freetype.sln: Updated
3768 * builds/windows/vc2010/freetype.vcxproj: Updated.
3769 * builds/windows/vc2010/freetype.vcxproj.filters: Minor fix.
3771 2021-10-21 Ben Wagner <bungeman@chromium.org>
3773 [mm] Delay setting blend weight and design position.
3775 Previously the `blend->weight_vector`, `blend->default_weight_vector`,
3776 and `blend->design_pos` were set early to allocated but uninitialized
3777 memory under the assumption that the memory would eventually be
3778 initialized. However, it is possible that some of the required
3779 keywords may not actually be present, leaving the memory uninitialized.
3780 This is different from a present but invalid table, which would produce
3784 https://bugs.chromium.org/p/chromium/issues/detail?id=1261762
3786 * src/type1/t1load.c (t1_allocate_blend): Remove early allocation and
3788 (parse_blend_design_positions, parse_weight_vector): Parse into local
3789 and assign to blend if valid.
3790 (T1_Open_Face): Check that if a blend exists that it has the weight
3791 vector and design positions.
3793 2021-10-21 Ben Wagner <bungeman@chromium.org>
3795 [cff] Commit vstore data and regions on allocation.
3797 The vstore->regionCount and vstore->dataCount were read directly
3798 from the data. However, vstore->varRegionList and vstore->varData
3799 would still contain uninitialized entries with uninitialized
3800 pointers in the event of an error, leading to issues when attempting
3804 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40104
3806 * src/cff/cffload.c (cff_vstore_load): Read the region and data counts
3807 into locals and update the vstore counts immediately after each entry
3810 2021-10-20 Ben Wagner <bungeman@chromium.org>
3812 [sfnt] Delay setting gasp ranges and count until computed.
3814 Previously, the gasp.numRanges was set and gasp.gaspRanges was
3815 allocated and assigned before a possible early exit if the frame could
3816 not be entered. It is also possible that the gaspRanges allocation
3817 could fail but the numRanges still be set to non-zero. In such cases
3818 an error would be returned, but the face would have a gasp in an
3819 inconsistent state which may still be accessed.
3822 https://bugs.chromium.org/p/chromium/issues/detail?id=1261450
3824 * src/sfnt/ttload.c (tt_face_load_gasp): Delay setting gasp.numRanges
3825 and gasp.gaspRanges until after the ranges are initialized.
3827 2021-10-20 Ben Wagner <bungeman@chromium.org>
3829 [sfnt] Delay setting names and langTags until computed.
3831 Previously, the table->names and table->langTags fields were created
3832 pointing to uninitialized memory and an early exit could happen if the
3833 frame could not be entered. The caller would then be unable to properly
3834 dispose of the memory as the string fields had not been initialized.
3837 https://bugs.chromium.org/p/chromium/issues/detail?id=1261343
3839 * src/sfnt/ttload.c (tt_face_load_name): delay setting table->langTags
3840 and table->names until after the memory they will point to is fully
3843 2021-10-20 Alexei Podtelezhnikov <apodtele@gmail.com>
3845 * tests/issue-1063/main.c: s/PATH_MAX/FILENAME_MAX/.
3847 Closes !97 for Windows by using a standard macro.
3849 2021-10-19 Werner Lemberg <wl@gnu.org>
3851 [bdf, cid, pfr, winfonts] Improve rejection of other font formats.
3853 This is mainly for better diagnostics of malformed fonts.
3855 * src/bdf/bdflib.c (_bfd_readstream): Stop font format testing if the first
3856 input line is too long or doesn't end with `\r` or `\n`.
3858 * src/cid/cidparse.c (cid_parser_new): Don't handle too short input as an
3859 error but as an unknown format.
3861 * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
3863 * src/winfonts/winfnt.c (fnt_font_load, fnt_face_get_dll_font): Ditto.
3865 2021-10-19 Alexei Podtelezhnikov <apodtele@gmail.com>
3867 [pcf] Zero out the allocated properties.
3870 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40033
3872 * src/pcf/pcfread.c (pcf_get_properties): Use FT_NEW_ARRAY and zero
3873 out `properties` in case of failure.
3875 2021-10-18 Werner Lemberg <wl@gnu.org>
3877 configure: Use string comparison for directory inodes.
3879 Inode values might be larger than integers supported by the shell.
3883 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com>
3885 * src/sfnt/ttload.c (tt_face_load_name): NULL-initialize langTag.
3887 Another attempt to fix fallout reported as
3888 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40024
3890 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com>
3892 [bdf] Fix up user properties.
3895 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40027
3897 * src/bdf/bdflib.c (_bdf_add_property): Cosmetic NULL.
3898 (bdf_create_property): Limit allocations to customary signed
3899 FT_Long and NULL-initialize unused storage.
3900 (bdf_free_font): Do not free unused storage.
3902 2021-10-17 Alexei Podtelezhnikov <apodtele@gmail.com>
3904 * src/sfnt/ttload.c (tt_face_load_name): Accounting fix.
3907 https://crbug.com/40024
3909 2021-10-16 Ben Wagner <bungeman@chromium.org>
3911 Fix typos in memory macros.
3913 FT_QNEW_ARRAY and FT_QRENEW_ARRAY were using the non-Q
3914 FT_MEM_NEW_ARRAY and FT_MEM_RENEW_ARRAY. Change these to use the Q
3915 versions. Also fix the one issue discovered in tt_face_load_name
3916 where table->names is created with FT_QNEW_ARRAY but the extra
3917 string member is not initialized to NULL.
3919 * include/freetype/internal/ftmemory.h (FT_Q(RE)NEW_ARRAY):
3920 Use FT_MEM_Q(RE)NEW_ARRAY as needed.
3922 * src/sfnt/ttload.c (tt_face_load_name): Initialize `entry->string`.
3924 2021-10-15 Ben Wagner <bungeman@chromium.org>
3926 [truetype] Reload context after re-executing `prep`.
3928 When a different hinting mode from the current is selected, the `prep` table
3929 must be re-executed with the new mode. After this happens the context must
3930 be re-loaded in preparation for the glyph program to be run.
3934 * truetype/ttgload.c (tt_loader_init): Add call to `TT_Load_Context`.
3936 2021-10-15 Werner Lemberg <wl@gnu.org>
3938 [truetype] Minor documentation improvements.
3940 2021-10-14 Anurag Thakur <anuthadev@gmail.com>
3942 Add clang build to linux CI
3944 2021-10-12 Anurag Thakur <anuthadev@gmail.com>
3946 CI: Add macOS CI, including a clang build
3948 2021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3950 * src/cid/cidload.c (parse_fd_array): Protect against trancation.
3952 2021-10-12 Alexei Podtelezhnikov <apodtele@gmail.com>
3954 [type1] Revert to signed size for binary data.
3956 Recently introduced and reported as
3957 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39838
3959 * src/type1/t1load.c (read_binary_data): Reject negative size.
3960 (parse_subrs, parse_charstrings): Use customary signed size.
3962 2021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com>
3964 [psaux] Signedness revisions.
3966 Unsigned indexes are easier to check.
3968 * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Updated.
3969 * src/psaux/psintrp.c (cf2_interpT2CharString): Ditto.
3970 * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
3971 * src/type1/t1load.c (read_binary_data): Ditto.
3973 2021-10-11 Alexei Podtelezhnikov <apodtele@gmail.com>
3975 [cid] Signedness revisions.
3977 Unsigned checks are simpler.
3979 * include/freetype/t1tables.h (CID_FaceInfoRec): Change to unsignd
3981 * src/cid/cidparse.h (CID_Parser): Change to unsigned `num_dict`.
3983 * src/cid/cidgload.c (cid_load_glyph): Updated.
3984 * src/cid/cidload.c (cid_load_keyword, parse_fd_array,
3985 parse_expansion_factor, parse_font_name, cid_read_subrs,
3986 cid_face_open): Updated.
3987 * src/cid/cidobjs.c (cid_face_done): Updated.
3988 * src/cid/cidparse.c (cid_parser_new): Updated.
3990 2021-10-09 Alexei Podtelezhnikov <apodtele@gmail.com>
3992 * src/cid/cidload.c (cid_face_open): Streamline CIDCount check.
3994 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
3996 * src/cid/cidload.c (cid_face_open): Streamline SubrCount check.
3998 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
4000 * src/cid/cidgload.c (cid_load_glyph): Fortify incremental loading.
4002 2021-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
4004 Signedness revisions.
4006 This eliminates explicit casting by switching to unsigned fields.
4007 The revisions mostly impact the handling of CID fonts.
4009 * include/freetype/fttypes.h (FT_Data): Change to unsigned `length`.
4010 * include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`.
4011 (CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`.
4012 * include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for
4015 * src/cid/cidgload.c (cid_load_glyph): Updated.
4016 * src/cid/cidload.h (cid_get_offset): Update argument.
4017 * src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open):
4019 * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data):
4021 * src/psaux/psft.c (cf2_getT1SeacComponent): Updated.
4022 * src/truetype/ttgload.c (TT_Process_Composite_Glyph,
4023 load_truetype_glyph): Updated.
4025 2021-10-07 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
4027 meson.build (gen_docs): Use `current_source_dir` instead of `source_root`.
4029 These two are not equal when FreeType is used as a subproject, such as in
4030 `freetype-demos`. In that case, `source_root` points at the root project,
4031 causing the docs build to fail.
4033 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
4035 * src/smooth/ftgrays.c (FT_DIV_MOD): Limit the ARM workaround.
4037 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
4039 [builds/unix, builds/vms] Standardize `mmap` failure.
4041 * builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED.
4042 * builds/vms/ftsystem.c (FT_Stream_Open): Ditto.
4044 This should cover https://savannah.nongnu.org/patch/?5909 as well.
4046 2021-10-05 Hugh McMaster <hugh.mcmaster@outlook.com>
4048 autogen.sh: Only copy submodules if building from a git branch.
4050 `autogen.sh` fails if building from a standard source tarball. Firstly, git
4051 expects to be called in a git repository, then `copy_submodule_files`
4052 blindly attempts to copy files.
4054 Debian, Ubuntu, Linux Mint, and other derivatives all run `autogen.sh`
4055 before compiling to regenerate build files.
4057 This patch ensures that various git commands are only called and 'dlg' files
4058 are only copied if `autogen.sh` is called from a git repository.
4060 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
4062 * include/freetype/internal/ftgloadr.h: Add missing header.
4064 Noticed by Jouk Jansen.
4066 2021-10-05 Alexei Podtelezhnikov <apodtele@gmail.com>
4068 [pshinter] Additional clean-ups.
4070 * src/pshinter/pshalgo.h (psh_hint_table_find_strong_points): Streamline code.
4071 * src/pshinter/pshalgo.h (PSH_Glyph): Remove unused fields.
4073 2021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
4075 [pshinter] More convenient direction definition.
4077 It is easier to check directions using flags than integer values.
4079 * src/pshinter/pshalgo.h (PSH_Dir): Redefine directions.
4080 (PSH_PointRec): Use them as an enum type.
4082 * src/pshinter/pshalgo.c (psh_compute_dir): Modify return type.
4083 (psh_glyph_init, psh_hint_table_find_strong_points,
4084 psh_glyph_find_blue_points): Update users.
4086 2021-10-04 Alexei Podtelezhnikov <apodtele@gmail.com>
4088 [pshinter] Remove unnecessary check.
4090 * src/pshinter/pshalgo.c (psh_hint_table_find_strong_points): Do not
4091 check if direction is defined before checking how.
4093 2021-10-02 AnuthaDev <anuthadev@gmail.com>
4095 CI: Hardcode meson version to fix build failure on windows
4097 2021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
4099 Additional `FT_MSB` macro definitions.
4101 * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins
4104 2021-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
4106 * src/autofit/afhints.c (af_glyph_hints_reload): Decrease casting.
4108 2021-09-30 Alexei Podtelezhnikov <apodtele@gmail.com>
4110 * src/tools/apinames.c: Facilitate OpenVMS linker options.
4112 2021-09-29 Alexei Podtelezhnikov <apodtele@gmail.com>
4114 * src/winfonts/winfnt.c (FNT_Face_Init): Correct reallocation.
4116 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
4118 [builds/unix] Do not use autoconf SIZEOF.
4120 * builds/unix/ftconfig.h.in [FT_USE_AUTOCONF_SIZEOF_TYPES]: Removed.
4121 * builds/unix/configure.raw: Remove AC_CHECK_SIZEOF and update.
4123 After this commit, autoconf builds will fully rely on <limits.h>
4124 rather than falling back on it if AC_CHECK_SIZEOF failed for some
4125 reason. There is a risk that misconfigured cross-compilation might
4126 have wrong headers. Note that Meson and CMake builds always relied on
4127 <limits.h> for sizes and availability of integer types.
4129 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
4131 Propagate sign when reading OFF3.
4133 Signed 24-bit values are extremely rare. FreeType only reads them in
4134 PFR fonts with bitmap strikes conditionally. They have not been seen
4135 in the known fonts. That is why this bug could never be discovered.
4136 `FT_FRAME_OFF3` propagates sign correctly.
4138 * include/freetype/internal/ftstream.h (FT_PEEK_OFF3, FT_PEEK_OFF3_LE):
4139 Propagate sign into 32-bit value.
4140 (FT_GET_OFF3, FT_READ_OFF3): Needed fixing but removed as unused.
4142 2021-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
4144 [bdf] Simplify comment collection or lack thereof.
4146 BDF comments are neither actually collected nor retrieved. There is
4147 no need to be fancy with delimiters.
4149 * src/bdf/bdflib.c (_add_bdf_comment): Delimit comments with zeros...
4150 (bdf_load_font): ...and do not null-terminate comments additionally.
4151 (_bdf_parse_glyphs): Check if comments are kept, which they are not.
4152 (_bdf_parse_start): Minor clean up.
4154 2021-09-24 Alexei Podtelezhnikov <apodtele@gmail.com>
4156 Use NULL for pointers only.
4158 * src/bdf/bdflib.c (*): Code changes.
4159 * include/freetype/freetype.h: Comments only.
4160 * src/cff/cffload.c, src/cff/cffobjs.c: Ditto.
4161 * src/winfonts/winfnt.c: Ditto.
4163 2021-09-23 Werner Lemberg <wl@gnu.org>
4165 Minor documentation fixes and improvements.
4167 2021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
4169 Reference `fopen` in the docs.
4171 2021-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
4173 [bdf, pcf] Minor optimization.
4175 * src/pcf/pcfread.c (pcf_load_font): Do not call `FT_MulDiv` for a
4177 * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto.
4178 * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a comment.
4180 2021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
4182 [base] Initialize stream memory earlier.
4184 With Windows memory management tracking heap, it is important to use
4185 it during the stream opening fallback. In Unix, the argument is
4186 unused, but it is better to set it correctly.
4188 * src/base/ftobjs.c (FT_Stream_New): Set memory before calling
4190 * builds/windows/ftsystem.c, builds/unix/ftsystem.c (FT_Stream_Open,
4191 ft_close_stream_by_free): Call `ft_alloc` and `ft_free` with proper
4194 2021-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
4196 [builds/windows] Revert back to `CreateFileA` only.
4198 Calling `CreateFileW` without making sure that the patname is really
4199 `wchar_t` is a bad idea and can lead to unpredictable overreads. For
4200 Windows CE, we impelemnt the missing API.
4202 Fixes #1098 and !76 again.
4204 * builds/windows/ftsystem.c (FT_Stream_Open): Call `CreateFileA`.
4205 [_WIN32_WCE] (CreateFileA, FileSizeEx): Implement missing interfaces.
4207 2021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com>
4209 * src/bdf/bdflib.c (_bdf_parse_{start,glyphs}): Use appropriate scanner.
4211 2021-09-21 Alexei Podtelezhnikov <apodtele@gmail.com>
4215 2021-09-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4217 * src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW.
4219 2021-09-18 Alexei Podtelezhnikov <apodtele@gmail.com>
4221 [cache] Minor clean-ups.
4223 * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Remove parantheses.
4224 * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto.
4225 (FTC_Cache_RemoveFaceID): Remove unnecessary variable.
4227 2021-09-17 Alexei Podtelezhnikov <apodtele@gmail.com>
4229 [builds/windows] Try both wide and narrow `CreateFile`
4231 Windows handles wchar_t* UTF-16 and char* ANSI (presently UTF-8)
4232 filenames using alternative -A and -W API. We'll try them both
4233 when opening a file. This means that you should not worry about
4236 Fixes #1098 and !76.
4238 * builds/windows/ftsystem.c (FT_Stream_Open): Call alternative
4239 `CreateFile` in the case of failure.
4241 2021-09-17 Edwin Steiner <edwin.steiner@gmail.com>
4243 [cff] Explicitly set StandardEncoding or ExpertEncoding offsets.
4247 * src/cff/cffload.c (cff_encoding_load): Set special offset values.
4249 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com>
4251 [cache] Miscellaneous clean-ups.
4253 * src/cache/ftccache.c (ftc_get_top_node_for_hash, FTC_Cache_Clear):
4254 Remove barely used variables.
4255 (ftc_cache_add): Adjust casting.
4256 * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Remove casting.
4257 * src/cache/ftcsbits.c (ftc_snode_load): Remove casting.
4259 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com>
4261 * src/cff/cffload.c (cff_fd_select_get): Remove casting.
4263 2021-09-16 Alexei Podtelezhnikov <apodtele@gmail.com>
4265 * src/pcf/pcfread.c (pcf_read_TOC): Remove casting.
4267 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
4269 Minor type adjustments.
4271 * src/cff/cffobjs.c (cff_face_init): Reduce casting.
4272 * src/truetype/ttobjs.c (tt_size_ready_bytecode): Ditto.
4273 * src/type1/t1load.c (T1_Set_MM_Design): Ditto.
4275 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
4277 Replace boolean allocation macros with MEM ones.
4279 * src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro.
4280 * src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto.
4281 * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto.
4282 * src/cache/ftccache.c (ftc_cache_init): Ditto
4283 * src/gzip/ftgzip.c (ft_gzip_alloc): Ditto.
4284 * src/psnames/psmodule.c (ps_unicodes_init): Ditto.
4285 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto.
4286 * src/sfnt/ttload.c (tt_face_load_name): Ditto.
4288 2021-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
4290 [cache] Revert to some zeroing.
4292 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Zero
4293 `buckets` again to fix some crashes.
4295 2021-09-14 Alexei Podtelezhnikov <apodtele@gmail.com>
4297 * src/pshinter/pshrec.c (ps_mask_table_merge_all): Tweak loops.
4299 Fixes fallout from 731d0b685685 reported as
4301 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38685
4303 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4305 [cff, pshinter] Clean up unsigned counters.
4307 Loops with unsigned decrement can be reliably stopped when the counter
4308 wraps around after reaching zero.
4310 * src/cff/cffload.c (cff_charset_compute_cids): Use unsigned counter.
4311 * src/pshinter/pshalgo.c (psh_hint_table_activate_mask): Ditto.
4312 * src/pshinter/pshrec.c (ps_mask_table_merge): Ditto.
4314 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4316 [bdf, psnames, sfnt] Avoid some memory zeroing.
4318 * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro.
4319 * src/sfnt/sfobjs.c (sfnt_load_face): Ditto.
4320 * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero.
4322 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4324 * src/base/ftobjs.c (FT_CMap_New): Revert to zeroing.
4326 Fixes fallout from c1fa7aa2bc96, reported as
4328 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38641
4330 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4332 [truetype] Clean up `exec` initialization.
4334 * src/truetype/ttinterp.c (Init_Context): Absorbed into...
4335 (TT_New_Context): ... this function.
4337 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4339 [truetype] Avoid some memory zeroing.
4341 * src/truetype/ttgload.c (load_truetype_glyph): Use Q-macro.
4342 * src/truetype/ttinterp.c (Update_Max): Ditto.
4343 * src/truetype/ttpload.c (src/truetype/ttpload.c): Ditto.
4345 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4347 [base] Avoid some memory zeroing.
4349 * src/base/ftobjs.c (FT_New_Size, FT_CMap_New, FT_CMap_Done,
4350 ft_open_face_internal, ft_open_face_internal): Use Q-macros.
4352 2021-09-13 Alexei Podtelezhnikov <apodtele@gmail.com>
4354 [cache, psaux] Remove zeros.
4356 * src/cache/ftcmru.c (FTC_MruList_New): Remove initialization.
4357 * src/psaux/psstack.c (cf2_stack_init): Ditto.
4359 2021-09-12 Alexei Podtelezhnikov <apodtele@gmail.com>
4361 [cache] Avoid some memory zeroing.
4363 * src/cache/ftcmru.c (FTC_MruList_New): Use Q-macro.
4364 * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Ditto.
4365 * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Ditto.
4367 2021-09-11 Alexei Podtelezhnikov <apodtele@gmail.com>
4369 * src/cache/ftcmanag.c (FTC_Manager_New): Add missing zero.
4371 Fixes fall out from a7b199d081e7.
4373 2021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com>
4375 [truetype] Tweak `hdmx` checking.
4379 * src/truetype/ttpload.c (tt_face_load_hdmx): Account for padding.
4381 2021-09-10 Alexei Podtelezhnikov <apodtele@gmail.com>
4383 [truetype] Tweak `loca` clamping.
4387 * src/truetype/ttpload.c (tt_face_load_loca): Fix up clamping.
4388 * include/freetype/internal/tttypes.h (TT_Face): Correct docs.
4390 2021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com>
4392 Fortify memory debugging (cont'd).
4394 * src/base/ftdbgmem.c (FT_DumpMemory): Check for active debugger.
4395 (ft_mem_table_destroy): Move `FT_DumpMemory` call from here...
4396 (ft_mem_debug_done): ... to here.
4398 2021-09-08 Alexei Podtelezhnikov <apodtele@gmail.com>
4400 Fortify memory debugging.
4402 These changes are neccessary to properly recover `memory->user` that
4403 holds the Windows heap handle now.
4405 * src/base/ftdbgmem.c (ft_mem_debug_init): Handle all table allocations,
4406 initializations, and sizing instead of...
4407 (ft_mem_table_new): ... this function removed.
4408 (ft_mem_debug_done): Better check for the active debugger and free the
4409 debugger table here instead of...
4410 (ft_mem_table_destroy): ... here.
4412 2021-09-08 Werner Lemberg <wl@gnu.org>
4414 src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): Set to 600.
4416 This allows C99 compilation on Solaris.
4418 Problem reported by Mojca Miklavec.
4420 2021-09-07 Alexei Podtelezhnikov <apodtele@gmail.com>
4422 [builds/windows] Use native memory allocation API.
4424 * builds/windows/ftsystem.c (ft_alloc, ft_realloc, ft_free):
4425 Wrap HeapAlloc, HeapReAlloc, and HeapFree.
4426 (FT_New_Memory): Set the heap handle.
4428 2021-09-07 Werner Lemberg <wl@gnu.org>
4430 [dlg] Synchronize with upstream.
4432 * src/dlg/dlgwrap.c (_XOPEN_SOURCE): Set to 600.
4436 2021-09-04 Alexei Podtelezhnikov <apodtele@gmail.com>
4440 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
4442 * src/bdf/bdflib.c (_bdf_parse_start): Keep parser memory.
4444 2021-09-03 Werner Lemberg <wl@gnu.org>
4446 autogen.sh: Make it work with old Solaris 10 shell.
4448 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
4450 [smooth, raster, sdf] Clean up initialization calls.
4452 * src/raster/ftraster.c (ft_black_init): Removed.
4453 (ft_black_new): Clean up.
4454 * src/sdf/ftbsdf.c (bsdf_raster_new): Ditto.
4455 * src/sdf/ftsdf.c (sdf_raster_new): Ditto.
4456 * src/smooth/ftgrays.c (gray_raster_new): Ditto.
4458 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
4460 * src/cache/ftcmanag.c (FTC_Manager_New): Avoid some zeroing.
4462 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
4464 * src/bdf/bdflib.c (bdf_load_font): Remove memory shuffling.
4466 2021-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
4470 2021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com>
4472 [base] Clean up stream reading.
4474 * src/base/ftstream.c (FT_Stream_ReadUShort, FT_Stream_ReadUOffset,
4475 FT_Stream_ReadULong and their LE variants): Remove unnecessary
4476 initialization and slightly refactor.
4477 (FT_Stream_GetByte, FT_Stream_ReadByte): Rename to return unsigned
4478 value and align with sister functions.
4480 * include/freetype/internal/ftstream.h (FT_Stream_GetByte,
4481 FT_Stream_ReadByte): Update prototypes and caller macros.
4483 2021-09-02 Alexei Podtelezhnikov <apodtele@gmail.com>
4485 s/0/NULL/ where appropriate.
4487 2021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com>
4489 * builds/windows/ftsystem.c (FT_Stream_Open): Fix double-close.
4491 2021-08-30 Alexei Podtelezhnikov <apodtele@gmail.com>
4493 [smooth] Reduce shift in multiply-shift optimization.
4495 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): Reduce shift.
4497 Smaller shifts that keep the division operands of FT_UDIVPREP within
4498 32 bits result in slightly faster divisions, which is noticeable in
4499 the overall performance. The loss of precision is tolerable until the
4500 divisors (the components dx and dy) approach 32 - PIXEL_BITS. With
4501 PIXEL_BITS = 8, this corresponds to 65,000 pixels or the bitmap size
4502 that we refuse to render anyway.
4504 Using `ftbench -p -s60 -t5 -bc timesi.ttf`,
4509 2021-08-28 Werner Lemberg <wl@gnu.org>
4511 [truetype] Fix compilation if !TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
4513 * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): Compile function
4515 (tt_face_vary_cvt) [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Add code.
4519 2021-08-27 Alexei Podtelezhnikov <apodtele@gmail.com>
4521 [builds/windows] Revise SSE2 settings.
4523 * builds/windows/vc2010/freetype.vcxproj [x64]: Remove explicit SSE2.
4524 * builds/windows/visualc/freetype.vcproj [Win32]: Add explicit SSE2.
4526 2021-08-27 Ben Wagner <bungeman@chromium.org>
4528 [smooth] Detect SSE2 with MSVC for x86
4530 MSVC does not set `__SSE2__`. Instead one must check whether `_M_IX86_FP` is
4531 defined and greater than or equal to 2.
4533 * src/smooth/ftgrays.c (FT_SSE2): New macro.
4534 Use it where appropriate.
4536 2021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4538 Expand comment (cont'd).
4540 2021-08-26 Alexei Podtelezhnikov <apodtele@gmail.com>
4544 2021-08-24 Alexei Podtelezhnikov <apodtele@gmail.com>
4546 * src/smooth/ftgrays.c (gray_render_conic): Refactor redundancy.
4548 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
4550 [truetype] Fix for the family name shorter than 8 characters.
4552 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag):
4553 If the family name to be checked is shorter than 8 characters,
4554 do not check its syntax.
4556 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
4558 [truetype] Simplify `trick_names'.
4560 * src/truetype/ttobjs.c (tt_check_trickyness_family): For the case
4561 that the beginning part of a long tricky family name is already
4562 registered as another tricky family name, no need to double-check
4563 the longer one. Such long tricky family names are removed from
4566 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
4568 [truetype] Add 2 tricky font names.
4570 Additional fix for the issue #1087.
4572 * src/truetype/ttobjs.c (tt_check_trickyness_family): Add 2 tricky
4573 font names reported in #1087.
4575 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
4577 [truetype] New function to skip the randomization tag.
4579 * src/truetype/ttobjs.c (tt_skip_pdffont_random_tag):
4580 New function to skip the randomization tag in the names of the
4581 fonts embedded in a PDF. It is used by tt_check_trickyness_family(),
4582 to keep from mistaking "DLC" in the randomization tag as a
4583 tricky font name. See discussion in:
4585 https://lists.nongnu.org/archive/html/freetype-devel/2021-02/msg00002.html
4587 For technical detail about the randomization tag, please find
4588 PDF Reference 5.5.3 "Font Subsets". Thanks to Justyna Wawrzynska
4589 for pointing out the issue caused by the randomization tag.
4591 2021-08-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
4593 [truetype] Add checksums for 2 tricky fonts.
4595 Thanks to Ting717 for providing sample PDF. Fixes #1087.
4597 * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Add
4598 checksums for 2 tricky fonts `DFHei-Bd-WIN-HK-BF' and
4599 `DFMing-Md-WIN-HK-BF'.
4601 2021-08-23 Alexei Podtelezhnikov <apodtele@gmail.com>
4603 Whitespace formatting.
4605 2021-08-22 Alexei Podtelezhnikov <apodtele@gmail.com>
4607 Decorate const arguments.
4609 * src/base/ftglyph.c (FT_Glyph_Transform, FT_Glyph_To_Bitmap): Do it.
4610 * include/freetype/ftglyph.h (FT_Glyph_Transform, FT_Glyph_To_Bitmap):
4613 2021-08-21 Alexei Podtelezhnikov <apodtele@gmail.com>
4615 [smooth] Clean up the null cell usage.
4617 Put the null cell at the end of the pool and store it explicitly so that
4618 we can use it as both the limit and the dumpster.
4620 * src/smooth/ftgrays.c (gray_TWorker): Store the last `cell_null` and
4621 remove unnecesary fields.
4622 (NULL_CELL_PTR, CELL_IS_NULL): Remove in favor of explicit `cell_null`.
4623 (gray_dump_cells, gray_set_cell, gray_sweep{,_direct}): Update callers.
4624 (gray_convert_glyph_inner): Trace remaining cells (oh well).
4625 (gray_convert_glyph): Set up `cell_null` and slightly improve the pool
4628 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4630 [base] Restore quiet no-op rendering of bitmap glyphs.
4634 * src/base/ftobjs.c (FT_Render_Glyph_Internal): Discard an error when
4635 rendering a bitmap glyph.
4637 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4639 [smooth] Fortify 64-bit algorithm.
4641 * src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): s/long/FT_Int64/ and
4642 s/unsigned long/FT_UInt64/.
4643 (gray_render_line): Adjust a critical variable type.
4645 2021-08-20 Carlo Bramini <carlo.bramix@libero.it>
4647 * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows.
4649 2021-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
4651 Determine `long long` availability based on its size.
4653 MSVC, for example, used `long long` even without full C99 support.
4655 * include/freetype/config/ftstdlib.h: Check if `long long` limits are
4656 defined in <limits.h>.
4657 * include/freetype/config/integer-types.h: Check `long long` size and
4658 use it to typedef FT_Int64.
4660 2021-08-19 Dominik Röttsches <drott@chromium.org>
4662 [sfnt] Fix format expectation for `COLR` v1 ClipList
4664 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Change ClipList
4665 format expectation to 1 instead of 0 to make it compliant with the
4668 2021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
4670 Readily use `long long` as a 64-bit type in C99 mode.
4672 * include/freetype/config/integer-types.h (FT_INT64):
4673 FT_CONFIG_OPTION_FORCE_INT64 is no longer required to use `long long`.
4675 2021-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
4677 Use FT_INT64 instead of FT_LONG64.
4679 * include/freetype/config/integer-types.h: Remove synonymous FT_LONG64.
4680 * include/freetype/internal/ftcalc.h: s/FT_LONG64/FT_INT64/.
4681 * src/base/ftcalc.c: Ditto.
4682 * src/base/fttrigon.c: Ditto.
4683 * src/smooth/ftgrays.c: Ditto.
4685 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
4687 [builds/windows] Do not set CharacterSet for VC++.
4689 * builds/windows/vc2010/freetype.vcxproj: s/Unicode/NotSet/.
4690 * builds/windows/visualc/freetype.vcproj: s/"1"/"0"/.
4692 2021-08-18 Werner Lemberg <wl@gnu.org>
4694 * src/sdf/ftsdf.c (get_control_box): Fix compiler warning.
4696 2021-08-18 Werner Lemberg <wl@gnu.org>
4698 [base] Fix ppem size overflow.
4702 * src/base/ftobjs.c (FT_Request_Metrics): Add return value.
4703 Check whether ppem values fit into unsigned short values.
4704 (FT_Request_Size): Updated.
4706 * include/freetype/internal/ftobjs.h: Updated.
4708 * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c
4709 (cid_size_request), src/truetype/ttdriver.c (tt_size_request),
4710 src/type1/t1objs.c (T1_Size_Request): Updated.
4712 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
4714 * builds/windows/ftsystem.c (FT_Stream_Open): Cast to remove warning.
4716 2021-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
4718 * builds/windows/ftsystem.c (FT_Stream_Open): Support UNICODE compilation.
4720 2021-08-09 Werner Lemberg <wl@gnu.org>
4722 * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Minor fix.
4724 2021-08-09 Dominik Röttsches <drott@chromium.org>
4726 [sfnt] Add missing blend mode 'plus' to 'COLR' v1.
4728 * include/freetype/ftcolor.h (FT_Composite_Mode): Add missing blend mode
4729 'plus' after it was added to the spec.
4731 2021-08-08 Werner Lemberg <wl@gnu.org>
4733 include/freetype/freetype.h (FT_Encoding): Improve documentation.
4735 Based on a suggestion by Antony Lee <anntzer.lee@gmail.com>.
4737 2021-08-07 Werner Lemberg <wl@gnu.org>
4739 [smooth] Avoid integer overflow.
4743 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36243
4745 * src/smooth/ftgrays.c(ADD_LONG, SUB_LONG, MUL_LONG, NEG_LONG)
4746 [STANDALONE_]: Removed, unused.
4747 (ADD_INT) [STANDALONE_]: New macro.
4748 (FT_INTEGRATE): Use ADD_INT.
4750 2021-08-07 Dominik Röttsches <drott@chromium.org>
4752 [sfnt] Add API for retrieving a 'COLR' v1 'ClipBox' table.
4754 The optional 'COLR' v1 glyph-specific clip box helps upstream graphics
4755 libraries allocate a sufficiently large bitmap for a glyph without having to
4756 traverse the glyph graph for that. See
4758 https://github.com/googlefonts/colr-gradients-spec/issues/251
4760 for background on the introduction of this specification change.
4762 * include/freetype/ftcolor.h (FT_ClipBox): New structure.
4763 (FT_Get_Color_Glyph_ClipBox): New function declaration.
4765 * include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_ClipBox_Func):
4767 (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Use it.
4769 * src/base/ftobjs.c (FT_Get_Color_Glyph_ClipBox): New function to link API
4770 with SFNT implementation.
4772 * src/sfnt/sfdriver.c (sfnt_interface): Updated.
4773 * src/sfnt/ttcolr.c (Colr): New field `clip_list`.
4774 (tt_face_load_colr): Parse global clip list offset.
4775 (tt_face_get_color_glyph_clipbox): New function to find the clip box for a
4776 glyph id from the clip list array.
4777 * src/sfnt/ttcolr.h: Updated.
4779 2021-08-06 Werner Lemberg <wl@gnu.org>
4781 [smooth] Fix left shifts of negative numbers.
4785 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36241
4787 * src/smooth/ftgrays.c (LEFT_SHIFT): New macro.
4788 (gray_render_conic) [BEZIER_USE_DDA]: Use it.
4790 2021-08-02 Werner Lemberg <wl@gnu.org>
4792 * meson.build: Fix zlib support.
4794 This commit synchronizes zlib support with both autotools and cmake: If no
4795 external zlib is found (or intentionally disabled on the command line), use
4796 the internal zlib by undefining `FT_CONFIG_OPTION_SYSTEM_ZLIB` without
4797 modifying `FT_CONFIG_OPTION_USE_ZLIB`.
4799 Also improve summary output.
4801 Problem reported by Moazin.
4803 2021-08-02 Anuj Verma <anujv@iitbhilai.ac.in>
4805 [sdf] Fix out-of-range-access.
4807 * src/sdf/ftbsdf.c (first_pass, second_pass): Fix range during forward pass.
4808 Otherwise the index goes out of range for the last column.
4812 2021-08-02 Anuj Verma <anujv@iitbhilai.ac.in>
4814 Fix invalid memory access in `bsdf` rasterizer.
4816 Do not generate SDF from bitmap if the `FT_GLYPH_OWN_BITMAP` flag is not
4817 set. In some cases the bitmap buffer is freed but still points to a valid
4818 address; to handle those cases check the flag before accessing the memory.
4820 * src/sdf/ftsdfrend.c (ft_bsdf_render): Handle the above case.
4821 Also, return an error message if the bitmap's rows/pitch is invalid,
4822 otherwise `slot->buffer` might be assigned to some invalid memory location.
4823 (ft_sdf_render): Same as above.
4824 Plus, move the outline back to original state after rasterization and not if
4827 2021-07-29 Heiko Becker <heirecka@exherbo.org>
4829 * meson.build: Honor `--includedir` instead of hard-coding 'include'.
4831 2021-07-29 Werner Lemberg <wl@gnu.org>
4833 src/sfnt/ttcolr.c: Minor formatting.
4835 2021-07-29 Dominik Röttsches <drott@chromium.org>
4837 [sfnt] 'COLR' v1 PaintSweepGradient spec update
4839 * src/sfnt/ttcolr.c (read_paint): PaintSweepGradient follows other
4840 spec changes and now has the angles specified as F2DOT14, reflect
4841 that in the implementation.
4842 * include/freetype/ftcolor.h (FT_PaintSweepGradient): Update
4845 2021-07-29 Dominik Röttsches <drott@chromium.org>
4847 [sfnt] Retrieve affine matrix from offset in 'COLR' v1 parsing.
4849 * src/sfnt/ttcolr.c (read_paint): Implement spec change where
4850 affine transform matrix is now referenced by offset instead of
4851 being placed inline in the PaintTransform table.
4853 2021-07-29 Dominik Röttsches <drott@chromium.org>
4855 [sfnt] 'COLR' v1 PaintSkew related spec updates
4857 * src/sfnt/ttcolr.c (read_paint): Implement spec changes around
4858 PaintSkew, PaintSkewAroundCenter. Update parsing to read shorter
4859 values as changed in the spec.
4860 * include/freetype/ftcolor.h (FT_PaintSkew): Update documentation.
4862 2021-07-29 Dominik Röttsches <drott@chromium.org>
4864 [sfnt] PaintRotate/PaintRotateAroundCenter spec updates
4866 * src/sfnt/ttcolr.c (read_paint): Implement spec change where
4867 PaintRotate and PaintRotateAroundCenter were split for a more
4868 compact format definition. Update parsing to read shorter values
4869 as changed in the spec.
4870 * include/freetype/ftcolor.h (FT_PaintRotate): Update documentation.
4872 2021-07-29 Dominik Röttsches <drott@chromium.org>
4874 [sfnt] 'COLR' v1 PaintTranslate and PaintScale precision
4876 * src/sfnt/ttcolr.c (read_paint): Implement spec changes in
4877 PaintTranslate and PaintScale and friends. Update parsing to read
4880 2021-07-29 AnuthaDev <anuthadev@gmail.com>
4882 README.git: Add Code of Conduct.
4884 2021-07-25 Werner Lemberg <wl@gnu.org>
4886 ChangeLog housekeeping.
4888 Archive old `ChangeLog` file.
4890 We no longer write ChangeLog entries manually; instead, the file will be
4891 created from commit messages (which should be formatted in GNU's ChangeLog
4894 gitlog-to-changelog --format='%B%n'
4896 or something similar (this script is part of the 'gnulib' repository).
4898 2021-07-24 Werner Lemberg <wl@gnu.org>
4900 Fix some `cppcheck` warnings.
4902 * src/bzip2/ftbzip2.c (ft_bzip2_file_skip_output), src/gzip/ftgzip.c
4903 (ft_gzip_file_skip_output): Reduce scope of `delta`.
4905 * src/psaux/psintrp.c, src/psaux/psintrp.h (cf2_interpT2CharString): Add
4906 `const` to `buf` parameter.
4908 * src/raster/ftraster.c (DelOld): Add `const` to `profile` parameter.
4909 (Vertical_Sweep_Span): Reduce scope of `target`.
4910 (FT_Outline_Get_CBox): Reduce scope of `xMin`, `xMax`, `yMin`, `yMax`.
4912 * src/smooth/ftgrays.c (gray_render_conic): Reduce scope of `split`.
4913 (gray_sweep, gray_sweep_direct): Reduce scope of `area`.
4915 * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Reduce scope of
4918 2021-07-24 AnuthaDev <anuthadev@gmail.com>
4920 * .gitlab-ci.yml: Fixed cmake build, using correct options.
4922 2021-07-24 AnuthaDev <anuthadev@gmail.com>
4924 * CMakeLists.txt: Make `cmake` handle disabled dependencies correctly.
4926 Include 'CMakeDependentOption'.
4928 Replace `FT_WITH_XXX` options with `FT_DISABLE_XXX` and `FT_REQUIRE_XXX`
4929 pairs. Update option logic accordingly.
4933 2021-07-24 Ben Wagner <bungeman@chromium.org>
4935 [autofit] Split `afwrtsys.h`.
4937 The header file `afwrtsys.h` has two distinct functions: to include the
4938 required writing system headers and also to generate code for each writing
4939 system. At each current use site only one or the other is used, with
4940 various macro trickery selecting one or the other. Split this header into
4941 `afws-decl.h` for the required writing system declarations and `afws-iter.h`
4942 for iterating over the writing systems to generate code.
4944 The motivation for this change is that the Visual C++ compiler treats the
4945 standard include guard idiom like `#pragma once` 'if no non-comment code or
4946 preprocessor directive comes before or after the standard form of the
4947 idiom'. It appears to check this after macro expansion, so if
4948 `WRITING_SYSTEM` expands to empty the bottom of `afwrtsys.h` is empty and
4949 looks like the standard include guard idiom which is treated like `#pragma
4950 once`, so subsequent inclusion of `afwrtsys.h` is elided.
4954 * src/autofit/afglobal.c (af_writing_system_classes), src/autofit/aftypes.h
4955 (AF_WritingSystem), src/autofit/rules.mk (AUTOF_DRV_H): Updated.
4957 * src/autofit/afwrtsys.h: Split into...
4958 * src/autofit/afws-decl.h, src/autofit/afws-iter.h: New files.