Bug 1690340 - Part 1: Hide all the panel tools in the developer tools menu. r=jdescottes
[gecko.git] / modules / freetype2 / ChangeLog
blob42f7c34ba8ceefe52a43bb65db98e8eb6582853e
1 2020-10-20  Werner Lemberg  <wl@gnu.org>
3         * Version 2.10.4 released.
4         ==========================
7         Tag sources with `VER-2-10-4'.
9         * docs/VERSION.TXT: Add entry for version 2.10.4.
10         * docs/CHANGES: Updated.
12         * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
13         builds/windows/visualc/index.html,
14         builds/windows/visualce/index.html,
15         builds/wince/vc2005-ce/index.html,
16         builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
17         s/2.10.3/2.10.4/, s/2103/2104/.
19         * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
21         * builds/unix/configure.raw (version_info): Set to 23:4:17.
22         * CMakeLists.txt (VERSION_PATCH): Set to 4.
24 2020-10-19  Werner Lemberg  <wl@gnu.org>
26         [sfnt] Fix heap buffer overflow (#59308).
28         This is CVE-2020-15999.
30         * src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier.
32 2020-10-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
34         * src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++.
36 2020-10-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
38         * src/sfnt/sfwoff2.c (Read255UShort): Tweak types to please VC++.
40 2020-10-10  Werner Lemberg  <wl@gnu.org>
42         * Version 2.10.3 released.
43         ==========================
46         Tag sources with `VER-2-10-3'.
48         * docs/VERSION.TXT: Add entry for version 2.10.3.
50         * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
51         builds/windows/visualc/index.html,
52         builds/windows/visualce/index.html,
53         builds/wince/vc2005-ce/index.html,
54         builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
55         s/2.10.2/2.10.3/, s/2102/2103/.
57         * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
59         * builds/unix/configure.raw (version_info): Set to 23:3:17.
60         * CMakeLists.txt (VERSION_PATCH): Set to 3.
62 2020-09-25  Werner Lemberg  <wl@gnu.org>
64         [autofit] Synchronize with ttfautohint.
66         This corresponds to the following commits in the ttfautohint git
67         repository:
69           bb6842bd3bd437b7b4a7921b0376c860f5e73d18  Typo, formatting.
70           d5c91ddb1cb310257a3dfe9a8e20e1fc51335faa  Add Medefaidrin script.
72         * src/autofit/afblue.dat: Add blue zone data for Medefaidrin.
73         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
75         * src/autofit/afscript.h: Add Medefaidrin standard characters.
77         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Medefaidrin
78         data.
80 2020-09-25  Werner Lemberg  <wl@gnu.org>
82         Move `scripts/make_distribution_archives.py` to `src/tools`.
84         * scr/tools/scripts/make_distribution_archives.py: (_TOP_DIR,
85         _SCRIPT_DIR): Updated to new location.
86         (main): s/shutils.copyfile/shutils.copy/ to preserve file
87         permissions.
88         (main): Prefix source file paths with `git_dir` while copying files
89         to allow calls of the script from other places than the top-level
90         directory.
92 2020-09-24  Werner Lemberg  <wl@gnu.org>
94         * src/cff/cffgload.c (cff_slot_load): Scale `vertBearingY`.
96         Towards the end of the the function there is a call to
97         `FT_Outline_Get_CBox` that retrieves the glyph bbox in scaled units.
98         That sets `horiBearing{X,Y}` and `vertBearingX` but `vertBearingY`
99         is left alone, and is not scaled.
101         Patch from Eric Muller <emuller@amazon.com>.
103 2020-09-24  Werner Lemberg  <wl@gnu.org>
105         * src/base/ftobjs.c (FT_Load_Glyph): Trace glyph metrics.
107 2020-09-22  Werner Lemberg  <wl@gnu.org>
109         [meson] Move auxiliary scripts to `builds/meson`.
111         Suggested by Alexei.
113         * scripts/*.py: Move meson scripts to...
114         * builds/meson/*.py: ... this new location.
116         * meson.build: Updated.
118 2020-09-21  David Turner  <david@freetype.org>
120         Add python script for building tarballs.
122         * scripts/make_distribution_archives.py: New file.
124         This standalone Python script should be equivalent to running `make
125         dist` with the Make-based build system, with the following minor
126         differences:
128         - Since `make distclean` doesn't always clean up `objs/` properly,
129           `make dist` archives may contain some stale binaries like
130           `objs/.libs/libfreetype.so.6` or others.
132         - `config.guess` and `config.sub` are not updated unless option
133           `--gnu-config-dir=DIR` is used to specify the location of these
134           files.
136         - Some bits of the auto-generated reference documentation may
137           appear in slightly different order, probably due to issues related
138           to mkdocs and docwriter.
140         As an example, the call
142           scripts/make_distribution_archives.py /tmp/freetype2-dist
144         creates the following files under `/tmp/freetype2-dist`:
146           freetype-<version>.tar.gz
147           freetype-<version>.tar.xz
148           ft<winversion>.zip
150 2020-09-21  Werner Lemberg  <wl@gnu.org>
152         * scripts/extract_freetype_version.py: Fix regex typos.
154 2020-09-21  David Turner  <david@freetype.org>
156         Add Meson build project file.
158         Example usage:
160           # Configure Meson build in directory `build-meson` to generate
161           # release binaries comparable to to the ones from the
162           # autotools/make build system.
163           meson setup build-meson \
164                 --prefix=/usr/local \
165                 --buildtype=debugoptimized \
166                 --strip \
167                 -Db_ndebug=true
169           # After configuring the Meson build with the above command,
170           # compile and install to `/usr/local/`; this includes a pkg-config
171           # file.
172           ninja -C build-meson install
174           # Alternatively, compile and install to `/tmp/aa/usr/local/...`
175           # for packaging.
176           DESTDIR=/tmp/aa ninja -C build-meson install
178           # Generate documentation under `build-meson/docs`.
179           ninja -C build-meson docs
181         Library size comparison for stripped `libfreetype.so` generated by
182         all three build systems:
184           - Default build (autotools + libtool): 712 KiB
185           - CMake build (RelWithDebInfo):        712 KiB
186           - Meson build:                         712 KiB
189         * meson.build: New top-level Meson build file for the library.
191         * meson_options.txt: New file.  It holds user-selectable options for
192         the build, which can be printed with `meson configure`, and selected
193         at `meson setup` or `meson --reconfigure` time with
194         `-D<option>=<value>`.
196         * scripts/parse_modules_cfg.py: A script invoked by `meson.build` to
197         parse `modules.cfg` and extract important information out of it
198         (i.e., the list of modules).
200         * scripts/process_ftoption_h.py: New script invoked by `meson.build`
201         to process the original `ftoption.h` file.  It enables or disables
202         configuration macro variables based on the available dependencies.
203         This is similar to what other build systems are using (i.e., Meson's
204         `configure_file()` command is not used here).
206         * scripts/extract_freetype_version.py: New script invoked by
207         `meson.build` to extract the FreeType version number from
208         `<freetype/freetype.h>`.
210         * scripts/extract_libtool_version.py: New script invoked by
211         `meson.build` to extract the libtool `revision_info` data from
212         `builds/unix/configure.raw`, and to generate the corresponding
213         shared library suffix.
215         * scripts/generate_reference_docs.py: New script invoked by
216         `meson.build` to generate the FreeType 2 reference documentation
217         (using the `docwriter` and `mkdocs` packages, which must be already
218         installed).
220 2020-09-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
222         [raster] Improve the second pass (#58373).
224         Besides dropout control the second horizontal sweep is supposed to
225         clean up straight horizontal edges that are mishandled by the first
226         vertical sweep when a line passes through pixel centers.  This line
227         would present as perfectly aligned span edges in the second sweep.
229         * src/raster/ftraster.c (Horizontal_Sweep_Span): Replace the old
230         implementation with a better one focusing on aligned span edges only.
232 2020-09-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
234         [raster] Tune SMART macro (#58352).
236         Windows seems to perform smart dropout control at 26.6 precision.
237         To mimick Windows independent of increased precision, we need to tweak
238         the macro so that some close calls break down rather than up.
240         * src/raster/ftraster.c (SMART): Tweak the macro.
242 2020-09-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
244         [raster] Introduce SMART macro.
246         * src/raster/ftraster.c (SMART): New macro for smart dropout rounding.
247         (Verstical_Sweep_Drop, Horizontal_Sweep_Drop): Use it.
249 2020-09-03  Boris Dalstein  <dalboris@gmail.com>
251         [build] Make CMake install basic version information.
253         * CMakeLists.txt: Do it.
255 2020-09-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
257         [truetype] Reduce Infinality footprint (cont'd).
259         * src/truetype/ttinterp.c (Ins_DELTAP): Shrink variable scope.
260         (Ins_SHPIX, Ins_MIRP): Revise if-logic.
262 2020-09-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
264         [truetype] Reduce Infinality footprint.
266         * src/truetype/ttinterp.c (Ins_SHPIX, Ins_MSIRP, Ins_MIAP, Ins_MDRP,
267         Ins_MIRP): Shrink variable scopes and consolidate ifdefs.
269 2020-09-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
271         [truetype] Refactor compensation color.
273         * src/truetype/ttinterp.h (TT_Round_Func): Change the last argument.
274         * src/truetype/ttinterp.c (Ins_ROUND, Ins_NROUND, Ins_MDAP, Ins_MIAP,
275         Ins_MDRP, Ins_MIRP): Move compensation retrieval from here...
276         (Round_*): ... to here.
277         * src/truetype/ttobjs.c (tt_size_init_bytecode): Reserve zero
278         compensation at color index 3.
280 2020-08-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
282         [smooth] Don't set target in direct mode.
284         * src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Remove assignment.
285         (ft_smooth_raster_lcd) [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Ditto.
287 2020-08-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
289         * src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Limit width.
291         Segmentation fault reported as
293           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24729
295 2020-08-22  Werner Lemberg  <wl@gnu.org>
297         * src/truetype/ttgload.c (TT_Get_VMetrics): Add tracing message.
299 2020-08-05  Alexei Podtelezhnikov  <apodtele@gmail.com>
301         [truetype] Retain OVERLAP_SIMPLE and OVERLAP_COMPOUND.
303         For glyphs with OVERLAP_SIMPLE or OVERLAP_COMPOUND, set
304         FT_OUTLINE_OVERLAP to render them with direct oversampling, which
305         mitigates artifacts (see 3bb512bc9f62).
307         * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Redefine to rhyme
308         with OVERLAP_SIMPLE.
309         * src/base/ftgloadr.c (FT_GlyphLoader_Rewind): Reset outline flags.
310         * src/truetype/ttgload.c
311         (TT_Load_Simple_Glyph): Retain OVERLAP_SIMPLE.
312         (load_truetype_glyph): Retain OVERLAP_COMPOUND.
314 2020-08-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
316         * src/truetype/ttgload.c (TT_Load_Glyph): More tracing.
318 2020-07-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
320         Hide internal functions with SunPro.
322         * include/freetype/internal/compiler-macros.h
323         (FT_INTERNAL_FUNCTION_ATTRIBUTE) <__SUNPRO_C>: Define as __hidden.
325 2020-07-28  Anuj Verma  <anujv@iitbhilai.ac.in>
327         Fix static compilation with Visual C.
329         * include/freetype/internal/compiler-macros.h
330         (FT_INTERNAL_FUNCTION_ATTRIBUTE) <_WIN32>: Define as empty.
332 2020-07-28  Priyesh Kumar  <priyeshkkumar@gmail.com>
334         Fix `-Wformat' compiler warnings.
336         * src/*: Fix format specifiers.
338         * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
340 2020-07-25  Werner Lemberg  <wl@gnu.org>
342         Fix `-Wformat' compiler warnings.
344         Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>
346         * src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
347         to tracing macro.
349         * src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
350         Ditto.
352         * src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
353         Reformulate message.
355         * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.
357         * src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
358         Trace table offset, too.
360         * src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
362 2020-07-23  Werner Lemberg  <wl@gnu.org>
364         * src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning.
366         Reported by Hin-Tak.
368 2020-07-12  Werner Lemberg  <wl@gnu.org>
370         * builds/unix/configure.raw: Fix inclusion of `ftoption.h'.
372 2020-07-07  Werner Lemberg  <wl@gnu.org>
374         Fix clang warnings.
376         * include/freetype/internal/autohint.h
377         (FT_DECLARE_AUTOHINTER_INTERFACE): New macro.
378         * src/autofit/afmodule.h: Use it to declare
379         `af_autofitter_interface'.
381         * include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro.
382         * src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and
383         `ft_outline_glyph_class'.
385         * src/base/ftglyph.c: Include `ftbase.h'.
387         * src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'.
389         * src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'.
391         * src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'.
392         * src/psaux/psauxmod.h: Declare `afm_parser_funcs',
393         `t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'.
395         * src/pshinter/pshmod.c: Include `pshmod.h'.
397         * src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign
398         conversion.
399         (compute_ULong_sum): Fix return type.
400         Fix implicit sign conversion.
401         (store_points): Fix type of `last_flag', `repeat_count', and `flag'.
402         Use casts to avoid warnings.
403         (reconstruct_glyf): Fix implicit sign conversion.
404         Use cast to avoid warning.
405         (get_x_mins): Fix implicit sign conversion.
406         * src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'.
407         * src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to
408         declare cmap classes.
410         * src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast.
412         * src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
414 2020-07-07  David Turner  <david@freetype.org>
416         [build] Really fix multi and C++ builds.
418         The following builds were still failing due to previous changes:
420           make multi
421           make multi CC="c++"
422           make CC="c++"
424         This patch fixes the issues, which were missing includes to get the
425         right macro definitions in multi-build mode.
427         Also, `FT_UNUSED' is actually used by third-party code, so move it
428         back to `public-macros.h' to avoid breaking it.
430         * include/freetype/config/public-macros.h (FT_EXPORT): Remove
431         special definition for C++.
432         (FT_UNUSED): Define here instead of...
433         * include/freetype/config/compiler-macros.h: ... here.
434         (FT_FUNCTION_DECLARATION): Remove special definition for C++.
435         (FT_LOCAL_ARRAY_DEF): Fix definition.
437         * src/cache/ftccback.h, src/lzw/ftzopen.h, src/gxvalid/gxvmort.h,
438         src/gxvalid/gxvmorx.h: Add `FT_BEGIN_HEADER' and `FT_END_HEADER'.
440 2020-07-06  David Turner  <david@freetype.org>
442         [build] Fix multi and C++ builds.
444         The following builds were failing due to previous changes:
446           make multi
447           make multi CC="c++"
449         * include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'.
451         * include/freetype/config/ftheader.h (FT_BEGIN_HEADER,
452         FT_END_HEADER): Protect against redefinition.
454         * src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h,
455         src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h,
456         src/sfnt/woff2tags.h: Include `compiler-macros.h'.
458         * src/sfnt/woff2tags.c: Include `woff2tags.h'.
460 2020-07-06  Werner Lemberg  <wl@gnu.org>
462         [psaux] Improve `t1_decoder_parse_metrics' (#58646).
464         * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy
465         corresponding code from old engine's `t1_decoder_parse_charstrings'
466         function to handle `op_callsubr' and `op_return'.
468 2020-07-05  David Turner  <david@freetype.org>
470         [build] Improve visibility support of library function names.
472         * include/freetype/config/public-macros.h
473         (FT_PUBLIC_FUNCTION_ATTRIBUTE): New macro to tag functions as
474         public (and thus exportable).
475         (FT_EXPORT): Use it.
477         * include/freetype/config/compiler-macros.h
478         (FT_INTERNAL_FUNCTION_ATTRIBUTE): New macro to tag functions as
479         internal to the library (and thus hidden).  Note that on ELF
480         systems, all internal functions have hidden visibility, which avoids
481         the need to enforce this when invoking the compiler (e.g., with an
482         option like `-fvisibility=hidden').
484         (FT_FUNCTION_DECLARATION, FT_FUNCTION_DEFINITION): New base macros
485         to deal with C and C++ linkage issues at the same time.
487         (FT_LOCAL, FT_LOCAL_DEF, FT_LOCAL_ARRAY, FT_LOCAL_ARRAY_DEF,
488         FT_BASE, FT_BASE_DEF, FT_EXPORT_VAR, FT_BASE_CALLBACK,
489         FT_BASE_CALLBACK_DEF): Redefined using new macros.
491 2020-07-05  David Turner  <david@freetype.org>
493         [build] Split off more stuff from `ftconfig.h'.
495         * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
496         include/freetype/config/ftconfig.h: Split off macro definitions
497         required by the FreeType API headers to...
498         * include/freetype/config/public-macros.h: ...this new file.
500         * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
501         include/freetype/config/ftconfig.h: Split off macro definitions used
502         by the library but not to be exposed to clients to...
503         * include/freetype/config/compiler-macros.h: ...this new file.
505         * include/freetype/internal/*.h, src/raster/ftraster.h: Include
506         `compiler-macros.h' where needed.
508 2020-07-05  David Turner  <david@freetype.org>
510         [build] Move mac support code to `mac-support.h'.
512         * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
513         include/freetype/config/ftconfig.h: Split off mac-specific stuff
514         to...
515         * include/freetype/config/mac-support.h: ...this new file.
517         * CMakeLists.txt, builds/unix/configure.raw: Remove `/undef ->
518         #undef' string replacement; the affected code is no longer part of
519         the `ftconfig.h' template.
521 2020-07-05  David Turner  <david@freetype.org>
523         [build] Put integer type definitions into `integer-types.h'.
525         Refactor some of the `ftconfig.h' headers and template to move the
526         definition of the FreeType integer types (e.g., `FT_Int16') to a
527         common header file `freetype/config/integer-types.h'.
529         * builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
530         include/freetype/config/ftconfig.h: Split off integer type
531         definition stuff to...
532         * include/freetype/config/integer-types.h: ...this new file.
534         * builds/unix/ftconfig.h.in: Control the definition of
535         `FT_SIZEOF_INT' and `FT_SIZEOF_LONG' with macro
536         `FT_USE_AUTOCONF_SIZEOF_TYPES'.  If these are not defined, auto
537         detection happens in `integer-types.h' as usual based on `INTXX_MAX'
538         values.  Otherwise the autoconf-detected values are used.
540         * builds/unix/configure.raw (CPPFLAGS): Don't include path to
541         `config' directory.  Instead, ...
542         (FT_CONFIG_STANDARD_LIBRARY_H): Use complete path.
544 2020-07-05  David Turner  <david@freetype.org>
546         [build] Rename `build/unix/ftconfig.in' to `ftconfig.h.in'.
548         Since we are no longer limited to 8.3 file names, it is simpler to
549         follow the usual conventions for template files.
551         * builds/unix/ftconfig.in: Renamed to...
552         * builds/unix/ftconfig.h.in: ...this.
554         * CMakeLists.txt, builds/unix/configure.raw: Updated.
556 2020-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
558         [smooth] Introduce direct oversampling for overlaps.
560         This implements oversampling to mitigate artifacts in pixels partially
561         covered by overlapping contours.  It turns out that the 4x4
562         oversampling is sufficient but, at least, quadruples the rendering
563         time.  The outline has to set FT_OUTLINE_OVERLAP to use this method.
565         * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): New flag.
566         * src/smooth/ftsmooth.c (ft_smooth_render): Check it to...
567         (ft_smooth_raster_overlap): ... inflate outline and set up direct
568         rendering for oversampling with...
569         (ft_smooth_overlap_spans): ... new span function that integrates them.
571 2020-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
573         [smooth] Use direct rendering mode in Harmony.
575         Instead of rendering 3 bitmaps side by side and reshuffling, we use
576         direct rendering to deliver the bitmaps on each third byte.
578         * src/smooth/ftsmooth.c (ft_smooth_raster_lcd)
579         [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Set up direct mode with...
580         (ft_smooth_lcd_spans): ... new span function.
582 2020-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
584         [smooth] Separate LCD paths from gray rendering.
586         This makes `ft_smooth_render' a lot smaller and easier to follow. It
587         also cleanly separates Harmony and ClearType-style LCD rendering
588         algorithms. Now I only wish to move LCD filtering and geometry from
589         FT_Library to FT_Renderer.
591         * src/smooth/ftsmooth.c (ft_smooth_render): Move LCD code from here...
592         (ft_smooth_raster_lcd, ft_smooth_raster_lcdv): ... to here.
593         [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Reorganize #ifdef's.
595 2020-06-20  Sebastian Rasmussen  <sebras@gmail.com>
597         [cff] Fix handling of `style_name == NULL' (#58630).
599         * src/cff/cffobjs.c (cff_face_init): If a call to `cff_strcpy' fails
600         by returning NULL in `cff_face_init', `remove_style' is still
601         called.  This means that the NULL pointer is dereferenced, causing a
602         crash.
604 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
606         [cff] Fix another two memory leaks (#58629).
608         * src/cff/cffobjs.c (cff_size_init): If a call to `funcs->create'
609         fails to allocate one of the `internal->subfont' variables, make
610         sure to free `internal->topfont' and any successfully allocated
611         subfonts.
613 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
615         [psaux] Fix memory leak (#58626).
617         * src/psaux/psstack.c (cf2_stack_init): If `cf2_stack_init' fails to
618         allocate the stack, return error early.
620 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
622         [base] Fix memory leak (#58624).
624         * src/base/ftobjs.c (FT_New_Size): Avoid trying to free
625         `size->internal' unless `size' has been allocated.  This mistake
626         appeared in the fix for issue #58611.
628 2020-06-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
630         [base] Rework d1180b5f9598 until further notice.
632         * src/base/ftoutln.c (FT_Outline_Get_Orientation): Reject large
633         outlines.
635 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
637         [cff, cid] Fix segfaults in case of error (#58621).
639         * src/cff/cffobjs.c (cff_slot_done), src/cid/cidobjs.c
640         (cid_slot_done): If `ft_glyphslot_init' fails to allocate
641         `internal', then the class' `done_slot' callback (called by
642         `ft_glyphslot_done') must not dereference the pointer to `internal'.
644 2020-06-19  Werner Lemberg  <wl@gnu.org>
646         [base] Fix UBSAN error.
648         Reported as
650           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23166
652         * src/base/ftoutln.c (FT_Outline_Get_Orientation): Avoid values
653         larger than 32 bits.
655 2020-06-19  Werner Lemberg  <wl@gnu.org>
657         [woff2] Fix segfault.
659         Reported as
661           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23402
663         * src/sfnt/sfwoff2.c (get_x_mins): Check whether `loca' table
664         exists.
666 2020-06-19  Stephen McDowell  <svenevs.dev@gmail.com>
668         [sfnt] Support Intel compilers.
670         * src/sfnt/pngshim.c (premultiply_data): Intel compilers do not
671         currently support `__builtin_shuffle'.
673 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
675         [base] Fix memory leak (#58611).
677         * src/base/ftobjs.c (FT_New_Size): When the call to `clazz->init_size'
678         fails, make sure to free `size->internal'.
680 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
682         [cff] Fix memory leak (#58610).
684         * src/cff/cffobjs.c (cff_size_init): When the call to
685         `funcs->create' fails, make sure to free `internal'.
687 2020-06-19  Werner Lemberg  <wl@gnu.org>
689         * src/cff/cffload.c (cff_index_get_pointers): Rename `t' to `tbl'.
691 2020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
693         [cff] Free table upon error allocating other data (#58609).
695         * src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails
696         to allocate, make sure to free the table.  Do the same for both
697         allocations if there is a later error.
699 2020-06-13  Werner Lemberg  <wl@gnu.org>
701         Remove redundant inclusion of `ft2build.h'.
703         * */*: Remove `#include <ft2build.h>' where possible.
705         * include/freetype/freetype.h: Remove cpp error about missing
706         inclusion of `ft2build.h'.
708 2020-06-08  David Turner  <david@freetype.org>
710         Make macros for header file names optional.
712         We no longer have to take care of the 8.3 file name limit; this
713         allows us (a) to introduce longer, meaningful file names, and (b) to
714         avoid macro names in `#include' lines altogether since some
715         compilers (most notably Visual C++) doesn't support this properly.
717         */*: Replace
719            #include FOO_H
721         with
723            #include <freetype/foo.h>
725         or something similar.  Also update the documentation.
727 2020-06-02  Werner Lemberg  <wl@gnu.org>
729         * src/sfnt/ttcmap.c (tt_face_build_cmaps): Trace number of cmaps.
731 2020-05-18  David Turner  <david@freetype.org>
733         Remove obsolete HAVE_STDINT_H probing macro.
735         This macro was updated by the unix configure script and the
736         `CMakeLists.txt' one, but is never used in the source tree (nor is
737         <stdint.h> included anywhere).
739         * CMakeLists.txt, builds/unix/ftconfig.in: Don't handle
740         `HAVE_STDINT_H'.
742 2020-05-18  David Turner  <david@freetype.org>
744         Remove Jamfile files from the tree.
746         These have not been used in a very, very long time, so better remove
747         them.  A corresponding patch will be submitted to the
748         `freetype2-demos' repository.
750         * src/Jamfile, src/*/Jamfile, Jamrules: Delete.
752 2020-05-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
754         [smooth] Turn on LCD filtering during FreeType initialization.
756         * src/smooth/ftsmooth.c (ft_smooth_init): Enable LCD filtering.
758         * include/freetype/ftlcdfil.h: Document it, remove patent warnings.
759         * include/freetype/freetype.h (FT_Render_Mode): Updated.
760         * include/freetype/config/ftoption.h, devel/ftoption.h
761         [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Do not mention patents.
763 2020-05-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
765         [smooth] Stop using dedicated LCD modules and classes.
767         The LCD modules were never truly independent. They mostly served as
768         a way to disable patented LCD rendering, which is no longer necessary.
769         The `smooth' module now handles LCD modes as well.
771         * src/smooth/ftsmooth.c (ft_smooth_lcd_renderer_class.
772         ft_smooth_lcdv_renderer_class): Deleted.
773         (ft_render_smooth): Reworked from `ft_render_smooth_generic'.
774         * src/smooth/ftsmooth.h: Remove dedicated LCD classes.
775         * src/smooth/module.mk: Remove dedicated LCD modules.
776         * include/freetype/config/ftmodule.h: Ditto.
777         * builds/amiga/include/config/ftmodule.h: Ditto.
778         * include/freetype/ftmodapi.h: Do not mention LCD modules.
780 2020-05-09  Werner Lemberg  <wl@gnu.org>
782         * Version 2.10.2 released.
783         ==========================
786         Tag sources with `VER-2-10-2'.
788         * docs/VERSION.TXT: Add entry for version 2.10.2.
790         * README, Jamfile (RefDoc), src/base/ftver.rc,
791         builds/windows/vc2010/index.html, builds/windows/visualc/index.html,
792         builds/windows/visualce/index.html,
793         builds/wince/vc2005-ce/index.html,
794         builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
795         s/2.10.1/2.10.2/, s/2101/2102/.
797         * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
799         * builds/unix/configure.raw (version_info): Set to 23:2:17.
800         * CMakeLists.txt (VERSION_PATCH): Set to 2.
802         * docs/CHANGES: Updated.
804 2020-05-08  Jakub Alba  <jalba@vewd.com>
806         * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#58319).
808         The font that exceeds the old limit is Icono Regular, version
809         1.00000.
811 2020-05-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
813         * builds/freetype.mk: Refactor for readability.
815 2020-05-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
817         [builds] Clean up Windows CE project files.
819         Remove version from filenames that caused a lot of polution in the
820         release process. Use VERSIONINFO resource instead.
822         * builds/wince/vc2005-ce/freetype.vcproj,
823         builds/wince/vc2008-ce/freetype.vcproj,
824         builds/windows/visualce/freetype.vcproj,
825         builds/windows/visualce/freetype.dsp: s/2101//g, but add `ftver.rc'.
826         * builds/wince/vc2008-ce/index.html,
827         builds/wince/vc2005-ce/index.html,
828         builds/windows/visualce/index.html: s/2101//g.
830 2020-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
832         * devel/ft2build.h: Override FT_CONFIG_MODULES_H here as well.
834 2020-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
836         [builds/unix] Consolidate marco overrides (for the demos to see them).
838         * builds/unix/unix-cc.in (FT_CONFIG_MODULES_H, FT_CONFIG_OPTIONS_H):
839         Override them here...
840         * builds/freetype.mk: ... instead of here.
842 2020-04-08  Werner Lemberg  <wl@gnu.org>
844         Allow setting `CC' in Unix build (#58051).
846         * builds/unix/unix-cc.in (CC): Use `override'.  The command line
847           value of `CC' (if any) is stored already in `CCraw'.
849 2020-04-04  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
851         [woff2] Return if single stream operation fails.
853         * src/sfnt/sfwoff2.c (get_x_mins): Do it.
855         * src/sfnt/woff2tags.c: Remove unused include.
857 2020-03-22  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
859         [docs] Fix building docs if `srcdir' != `builddir'.
861         `docs/reference/*' was moved one directory up in commit 237fed6.
863         * builds/unix/unix-def.in (PIP): Remove variable.
865         * configure: Create `docs' directory and copy assets from
866         `docs/markdown'.
868         * docs/README: Output directory is `reference'.
870 2020-03-21  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
872         [docwriter] Drop support for Python < 3.5.
874         Python versions < 3.5 have reached end-of-life and as such, no
875         security or bug fixes will be provided for those versions.  See
877           https://devguide.python.org/#status-of-python-branches
878         
879         for more information.
881         * Jamfile (RefDoc): Add `site' parameter.
883         * builds/detect.mk (std_setup): Update Python version requirement.
885         * builds/freetype.mk (refdoc-venv): Use pip as `python -m pip'.
887         * builds/unix/ax_compare_version.m4,
888         builds/unix/ax_prog_python_version.m4: Macros to detect Python
889         version.  New files.
891         * builds/unix/configure.raw: Check for Python >= 3.5 and remove
892         check for `pip'.
894         * docs/CHANGES, docs/INSTALL.GNU, docs/README: Updated.
896 2020-03-02  Moazin Khatti  <moazinkhatri@gmail.com>
898         [gzip] Support `gzip' encoded header conditionally.
900         In order to support `gzip' encoded header the call to
901         `inflateInit2' was modified in commit 6a92b1fadde26477a9179.
902         However, this code breaks with the outdated internal version
903         of zlib.  This is a temporary fix to conditionally support
904         `gzip' encoded header whenever a system installation of zlib
905         is being used.
907         Problem report in
909           https://lists.nongnu.org/archive/html/freetype-devel/2020-02/msg00023.html
911         * src/gzip/ftgzip.c (FT_Gzip_Uncompress): Change the the call to
912         `inflateInit2' depending on whether the system installation is
913         being used or the internal copy.
915 2020-02-29  Ben Wagner  <bungeman@google.com>
917         [truetype] Fix state of `FT_Face' for buggy `gvar' tables (#57923).
919         By resetting the blend as implemented with this commit fonts with
920         invalid `gvar' tables may keep calling into `ft_var_load_gvar' from
921         `tt_set_mm_blend' and failing, but the font was invalid anyway and
922         we want to keep seeing the failure in `tt_set_mm_blend'.
924         * src/truetype/ttgxvar.c (ft_var_load_gvar): Calculate length of
925         offset array once.
926         Allocate arrays after `FT_FRAME_ENTER' (extra check before
927         allocating and avoid needing to free array later if error entering
928         frame).
929         Always call `FT_FRAME_EXIT'.
930         Consistently set counts immediately after array initialized.
931         Reset the blend (particularly `blend->glyphoffsets') on failure.
933 2020-03-01  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
935         [docs] Update docwriter stylesheet.
937         This change is required to support docwriter 1.2.1.
939         See
941           https://github.com/freetype/docwriter/issues/36
943         for more information.
945         * docs/markdown/stylesheets/extra.css:
946         (.md-typeset code) -> (.md-typeset pre>code)
947         (pre) -> (pre>code)
948         (p, .md-typeset p, h4): Remove commented styles.
949         (table.index): Remove unused styles.
951 2020-02-28  Ben Wagner  <bungeman@google.com>
953         [truetype] Add better checks for loading `gvar' table (#57905).
955         * src/truetype/ttgxvar.c (ft_var_load_gvar): Delay settings of any
956         `blend->xxxcount' values until the corresponding data has been
957         checked.
958         Also do some sanitizing to avoid a too early exit.
960         (TT_Vary_Apply_Glyph_Deltas): Improve tracing message.
962 2020-02-27  Werner Lemberg  <wl@gnu.org>
964         Make `FT_HAS_*' and `FT_IS_*' really return true (#57906).
966         * include/freetype/freetype.h (FT_HAS_*, FT_IS_*): Implement it.
968 2020-02-25  Dominik Röttsches  <drott@chromium.org>
970         Fix for CFF space glyph regression (#57541).
972         * src/psaux/psft.c (cf2_decoder_parse_substrings): Replace early-out
973           with FT_OFFSET.
975 2020-02-22  Werner Lemberg  <wl@gnu.org>
977         [woff2] Fix font table access.
979         Reported as
981           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20778
983         * src/sfnt/sfwoff2.c (get_x_mins): Explicitly check for presence of
984         `head' table, which might not have been processed yet.
986 2020-02-21  Werner Lemberg  <wl@gnu.org>
988         [psaux] Make `t1_decoder_parse_metrics' handle `op_div' (#57519).
990         * src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy
991         corresponding code from old engine's `t1_decoder_parse_charstrings'
992         function.
994 2020-02-19  Nikolaus Waxweiler  <nikolaus.waxweiler@daltonmaag.com>
996         [autofit] Add support for Hanifi Rohingya script.
998         * src/autofit/afblue.dat: Add blue zone data for Hanifi Rohingya.
999         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1001         * src/autofit/afscript.h: Add Hanifi Rohingya standard character.
1003         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Hanifi
1004           Rohingya data.
1006 2020-02-19  Werner Lemberg  <wl@gnu.org>
1008         Require HarfBuzz 1.8.
1010         * builds/unix/configure.raw, CMakeLists.txt: Request HarfBuzz 1.8.0
1011         or newer.
1013         We are going to add auto-hinter support for Hanifi Rohingya, which
1014         was introduced in Unicode 11.0.
1016 2020-02-12  Werner Lemberg  <wl@gnu.org>
1018         * src/sfnt/ttcmap.c (tt_face_build_cmaps): Ignore version (#57708).
1020 2020-02-04  Werner Lemberg  <wl@gnu.org>
1022         * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#57732).
1024         The font that exceeds the old limit is Constantine, version 1.001.
1026 2020-01-04  Werner Lemberg  <wl@gnu.org>
1028         [base] Fix `FREETYPE_PROPERTIES=type1:hinting-engine=adobe`.
1030         * src/base/ftpsprop.c (ps_property_set) [hinting-engine]: Avoid an
1031         incorrect return value that caused a warning.  The function did the
1032         right thing, though.
1034 2020-01-03  Werner Lemberg  <wl@gnu.org>
1036         [woff2] Fix memory leaks and a runtime warning.
1038         Reported as
1040           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19773
1041           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18101
1043         * src/sfnt/sfwoff2.c (compute_ULong_sum): Add missing cast.
1044         (reconstruct_hmtx): Add missing deallocation calls.
1046 2020-01-02  Dominik Röttsches  <drott@chromium.org>
1048         [truetype] Fix UBSan warning on offset to nullptr (#57501).
1050         * src/truetype/ttinterp.c (Ins_CALL): Fail if `exc->FDefs' is null.
1052 2019-12-31  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1054         [woff2] Allow bitmap-only fonts (#57394).
1056         * src/sfnt/sfwoff2.c (reconstruct_font): Fix test for `glyf' and
1057         `loca' tables.
1059 2019-12-21  Hugh McMaster  <hugh.mcmaster@outlook.com>
1061         [docs] (2/2) Fix generation of API documentation (#56745).
1063         Creating the API Reference in the (new) `reference' sub-directory is
1064         consistent with other documentation sub-topics, such as `design',
1065         `glyphs' and `tutorial'.
1067         This patch fixes broken hyperlinks in the documentation pointing to
1068         and from the API Reference.  It also allows web assets to load from
1069         their relative paths.
1071         * builds/freetype.mk (DOC_DIR): Adjust.
1072         (refdoc, refdoc-venv): Add `--site' argument.
1074         * builds/toplevel.mk (do-dist): Updated.
1076 2019-12-21  Hugh McMaster  <hugh.mcmaster@outlook.com>
1078         [docs] (1/2) Move static web assets (#56745).
1080         * docs/reference/*: Move ...
1081         * docs: ... one directory up.
1083 2019-12-21  Dominik Röttsches  <drott@chromium.org>
1085         Fix more UBSan warnings on adding offset to nullptr (#57432).
1087         * src/truetype/ttinterp.c (Ins_LOOPCALL), src/psaux/psft.c
1088         (cf2_initLocalRegionBuffer): Use `FT_OFFSET'.
1090 2019-12-16  Werner Lemberg  <wl@gnu.org>
1092         [truetype] Fix UBSan warnings on adding offsets to nullptr.
1094         Reported as
1096           https://bugs.chromium.org/p/chromium/issues/detail?id=1032152
1098         * src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Use `FT_OFFSET'.
1100 2019-12-14  Werner Lemberg  <wl@gnu.org>
1102         [truetype] Fix integer overflow.
1104         Reported as
1106           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19305
1108         * src/truetype/ttinterp.c (Ins_MIRP): Use `ADD_LONG'.
1110 2019-12-13  Werner Lemberg  <wl@gnu.org>
1112         Another bunch of UBSan warnings on adding offsets to nullptr.
1114         Reported as
1116           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19427
1117           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19433
1118           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19441
1119           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19451
1120           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19452
1121           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19457
1123         * src/autofit/aflatin.c (af_latin_hints_compute_segments,
1124         af_latin_hints_compute_edges): Use `FT_OFFSET'.
1126         * src/base/ftstream.c (FT_Stream_EnterFrame): Use `FT_OFFSET'.
1128         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Exit early
1129         if there is no charstring.
1131         * src/psaux/psobjs.c (t1_decrypt): Use `FT_OFFSET'.
1133         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Exit early for
1134         zero bitmap dimensions.
1136 2019-12-09  Dominik Röttsches  <drott@chromium.org>
1138         Fix more UBSan warnings on adding offset to nullptr (#57384).
1140         * src/smooth/ftsmooth.c (ft_smooth_render_generic),
1141         src/psaux/psobjs.c (ps_table_add): Use `FT_OFFSET'.
1143 2019-12-05  Werner Lemberg  <wl@gnu.org>
1145         * src/truetype/ttinterp.c (TT_RunIns): Use `FT_OFFSET'.
1147         Reported as
1149           https://bugs.chromium.org/p/chromium/issues/detail?id=1030614
1151 2019-12-03  Werner Lemberg  <wl@gnu.org>
1153         More nullptr offset UBSan warnings (#57331, #57347).
1155         * src/autofit/afcjk.c (af_cjk_hints_compute_segments),
1156         src/psaux/psft.c (cf2_getSeacComponent), src/truetype/ttinterp.c
1157         (Ins_UNKNOWN): Use `FT_OFFSET'.
1159 2019-11-29  Dominik Röttsches  <drott@chromium.org>
1161         Avoid more nullptr offset UBSan warnings (#57316).
1163         * src/base/ftoutln.c (FT_Outline_Transform): Bail on empty points.
1164         * src/cff/cffload.c (cff_subfont_load): Use `FT_OFFSET'.
1165         * src/psaux/psft.c (cf2_decoder_parse_substrings): Early out if
1166         `charstring_base' or `charstring_len' are null.
1167         * src/sfnt/ttload.c (tt_face_load_name): Use `FT_OFFSET'.
1169 2019-11-23  John Stracke  <jstracke@Google.com>
1171         [base] Really fix #57194.
1173         Apply accidentally missed second part of patch.
1175         * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Call
1176         `FT_GlyphLoader_CreateExtra'.
1178 2019-11-23  Werner Lemberg  <wl@gnu.org>
1180         [truetype] Avoid sanitizer warning (#57289).
1182         * src/truetype/ttpload.c (tt_face_get_device_metrics): Use
1183         `FT_OFFSET'.
1185 2019-11-23  Armin Hasitzka  <prince.cherusker@gmail.com>
1187         [truetype] Fix integer overflow (#57287).
1189         * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
1191 2019-11-23  Ben Wagner  <bungeman@google.com>
1193         [sfnt] Avoid sanitizer warning (#57286).
1195         * src/sfnt/ttcmap.c (tt_face_build_cmaps): Avoid possible `NULL +
1196         offset' computation.
1197         Tag `table' as `const'.
1199 2019-11-23  John Stracke  <jstracke@Google.com>
1200             Werner Lemberg  <wl@gnu.org>
1202         [base] Fix `NULL + offset' sanitizer warnings (#57194).
1204         * src/base/ftgloadr.c (FT_GlyphLoader_Adjust_Points,
1205         FT_GlyphLoader_Adjust_Subglyphs): Use `FT_OFFSET'.
1206         (FT_GlyphLoader_CreateExtra): Add short cut if some values are zero.
1208 2019-11-23  Werner Lemberg  <wl@gnu.org>
1210         * include/freetype/internal/ftmemory.h (FT_OFFSET): New macro.
1212         Use this for `base + offset' pointer calculations where `base' can
1213         be NULL (triggering a sanitizer warning even if the resulting
1214         pointer gets never dereferenced since it is undefined behaviour
1215         in C).
1217         Suggested by Ben Wagner.
1219 2019-11-23  Ben Wagner  <bungeman@google.com>
1221         [sfnt] Ensure OTTO fonts have tables (#57285).
1223         * src/sfnt/ttload.c (tt_face_load_font_dir): Add test.
1225 2019-11-23  Behdad Esfahbod  <behdad@behdad.org>
1227         Minor fixes for recent compilers.
1229         * src/gzip/infutil.h (inflate_mask): Add `const'.
1231         * src/autofit/aflatin2.c: Include `ft2build.h'.
1233 2019-11-07  Nikolaus Waxweiler  <madigens@gmail.com>
1235         * CMakeLists.txt: Minor additions to the notes, compile
1236           builds/unix/ftsystem.c instead of src/base/ftsystem.c on UNIX.
1238         The latter change is based on the code proposed by rim in #55235.
1240 2019-10-25  Werner Lemberg  <wl@gnu.org>
1242         * src/sfnt/sfwoff2.c (woff2_open_font): Check `num_fonts' for TTCs.
1244         Reported as
1246           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18494
1248 2019-10-22  Werner Lemberg  <wl@gnu.org>
1250         * src/sfnt/sfwoff2.c (woff2_open_font): Avoid undefined shift.
1252         Also improve tracing.
1254         Reported as
1256           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18390
1258 2019-10-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
1260         * src/sfnt/pngshim.c (premultiply_data): Optimize for __SSE__ only.
1262 2019-10-10  Werner Lemberg  <wl@gnu.org>
1264         * src/sfnt/sfwoff2.c (reconstruct_glyf): Check `triplet_size'.
1266         Reported as
1268           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18108
1270 2019-10-09  John Tytgat  <John.Tytgat@esko.com>
1272         [cff] Fix FT_FACE_FLAG_GLYPH_NAMES for CFF2 based fonts (#57023).
1274         * src/cff/cffobjs.c (cff_face_init): Don't set
1275         FT_FACE_FLAG_GLYPH_NAMES for CFF2 based fonts.
1277 2019-10-08  Werner Lemberg  <wl@gnu.org>
1279         [woff2] Fix SFNT table checks.
1281         Also reduce number of SFNT table lookups.
1283         Reported as
1285           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18065
1287         * include/freetype/internal/wofftypes.h (WOFF2_InfoRec): Add fields
1288         `glyf_table', `loca_table', and `head_table'.
1290         * src/sfnt/sfwoff2.c (reconstruct_glyf): Update signature.
1291         Use table pointers in `info' parameter.
1292         (get_x_mins): Check `maxp_table'
1293         Use table pointers in `info' parameter.
1294         (reconstruct_font):  Use and set table pointers in `info' parameter.
1295         Fix check for `glyf' and `loca' tables.
1296         Update call to `reconstruct_glyf'.
1297         (woff2_open_font): Updated.
1299 2019-10-06  Werner Lemberg  <wl@gnu.org>
1301         * src/sfnt/sfwoff2.c (reconstruct_glyf): Fix reallocation.
1303         Reported as
1305           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18046
1307 2019-10-06  Werner Lemberg  <wl@gnu.org>
1309         Improve memory debugging.
1311         * include/freetype/internal/ftmemory.h (FT_MEM_FREE): Use
1312         `FT_DEBUG_INNER' to set source code file name and line.
1314         * src/base/ftdbgmem.c (ft_mem_table_remove): Better formatting of
1315         tracing message.
1317 2019-10-03  Werner Lemberg  <wl@gnu.org>
1319         * src/sfnt/sfwoff2 (reconstruct_font): Fix reallocation.
1321         Reported as
1323           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17966
1325 2019-10-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1327         * src/base/ftstroke.c (ft_stroker_inside): Speed up.
1329 2019-10-01  Werner Lemberg  <wl@gnu.org>
1331         * src/sfnt/sfwoff2 (woff2_open_font): Initialize `woff2.ttc_fonts'.
1333         Reported as
1335           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17804
1337 2019-09-30  Werner Lemberg  <wl@gnu.org>
1339         * src/sfnt/sfwoff2.c (reconstruct_font): Fix memory leak.
1341         Reported as
1343           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17812
1345 2019-09-30  Werner Lemberg  <wl@gnu.org>
1347         [woff2] Reject fonts without `head' table.
1349         Also fix memory deallocation in case of error.
1351         `head' problem reported as
1353           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17820
1355         * src/sfnt/sfwoff2.c (reconstruct_glyf): Don't use `stream_close'.
1356         Abort if `head_table' is NULL.
1357         Don't free `transformed_buf' in case of error.
1358         (woff2_open_font): Don't set `uncompressed_buf' to NULL.
1360 2019-09-29  Werner Lemberg  <wl@gnu.org>
1362         [woff2] Fix compiler warnings.
1364         Problem reported by Alexei.
1366         * src/sfnt/sfwoff2.c (reconstruct_glyf): Initialize `x_min'.
1367         (reconstruct_font): Initialize `num_hmetrics'.
1368         (woff2_open_font): Initialize `info'.
1370 2019-09-28  Werner Lemberg  <wl@gnu.org>
1372         * src/sfnt/sfwoff2.c (woff2_open_font): Fix sanity check.
1374         Correct thinkos in patch from 2019-09-01.
1376 2019-09-28  Werner Lemberg  <wl@gnu.org>
1378         [woff2] Fix memory leaks.
1380         One of them reported as
1382           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17766
1384         * src/sfnt/sfwoff2.c (woff2_open_font): Free `info->x_mins' and
1385         `woff2->ttc_fonts'.
1387         (reconstruct_glyf): Initialize `info->x_mins'.
1389 2019-09-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
1391         * src/base/ftstroke.c (ft_stroker_cap): Speed up caps.
1393 2019-09-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
1395         * src/base/ftstroke.c (ft_stroker_outside): Speed up clipped miter.
1396         * include/freetype/ftstroke.h: Wordsmith miter docs.
1398 2019-09-25  Werner Lemberg  <wl@gnu.org>
1400         * src/sfnt/sfwoff2.c (woff2_open_font): Check (sum of) table sizes.
1402         Reported as
1404           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17684
1406 2019-09-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1408         * src/base/ftstroke.c (ft_stroke_border_arcto): Speed up calculations.
1410 2019-09-20  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1412         [woff2] Fix memory leaks.
1414         Reported as
1416           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16896
1418         * src/sfnt/sfwoff2.c (woff2_open_font): Fix error handling.
1419         Free `uncompressed_buf'.
1420         (reconstruct_font): Free `transformed_buf'.
1422 2019-09-17  Werner Lemberg  <wl@gnu.org>
1424         * src/otvalid/otvcommon.c (otv_Coverage_get_last): Guard `count'.
1426         Problem reported by Marc Schönefeld <marc.schoenefeld@gmx.org>.
1428 2019-09-17  Werner Lemberg  <wl@gnu.org>
1430         * src/sfnt/sfwoff2.c (woff2_open_font): Check table index.
1432         Reported as
1434           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17100
1436 2019-09-15  Avi Halachmi (:avih)  <avihpit@yahoo.com>
1438         [cmake] Don't fail if brotli is missing (#56894).
1440         The libs which cmake controls are commented out at
1442           include/freetype/config/ftoption.h
1444         and cmake un-comment each enabled library, but the brotli option was
1445         not commented out, therefore `FT_CONFIG_OPTION_USE_BROTLI' remained
1446         defined even if brotli was missing/disabled/etc.
1448         Comment it such that cmake can control it, which means leaving it
1449         undefined if brotli is missing.
1451         * include/freetype/config/ftoption.h: Fix typo.
1453 2019-09-05  Werner Lemberg  <wl@gnu.org>
1455         [cmake] Add brotli support.
1457         * CMakeLists.txt (FT_WITH_BROTLI): New option.
1459         * builds/cmake/FindBrotliDec.cmake: New file.
1461 2019-09-05  Werner Lemberg  <wl@gnu.org>
1463         Fix handling of `AF_CONFIG_OPTION_INDIC'.
1465         * devel/ftoption.h, include/freetype/config/ftoption.h:
1466         `AF_CONFIG_OPTION_INDIC' needs `AF_CONFIG_OPTION_CJK'.
1468 2019-09-05  Werner Lemberg  <wl@gnu.org>
1470         CMakeLists.txt: Fix generation of DLL related stuff (#56852).
1472         Extract `version_info' variable from `builds/unix/configure.raw' and
1473         use the data to correctly set `LIBRARY_VERSION' and
1474         `LIBRARY_SOVERSION'.
1476         Also use the data to set `ft_version' field in `freetype2.pc'.
1477         Also fix the needed minimum version of HarfBuzz in `freetype2.pc'.
1479 2019-09-03  Werner Lemberg  <wl@gnu.org>
1481         * src/sfnt/sfwoff2.c (compute_ULong_sum): Fix undefined shift.
1483         Reported as
1485           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16933
1487 2019-09-01  Werner Lemberg  <wl@gnu.org>
1489         * src/sfnt/sfwoff2.c (woff2_open_font): Add sanity check.
1491         Don't trust `totalSfntSize' unconditionally.
1493         Reported as
1495           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16893
1497 2019-08-27  Dominik Röttsches  <drott@chromium.org>
1499         [woff2] Don't use `FT_UInt64' (#56815).
1501         * src/sfnt/sfwoff2.c (woff2_open_font): Use `FT_UInt32' for
1502         `file_offset'.  This fixes builds on platforms where `FT_LONG64' is
1503         not defined while still being sufficient to store a file offset.
1505 2019-08-27  Werner Lemberg  <wl@gnu.org>
1507         [truetype] Prevent crash in `TT_Set_Named_Instance' (#56813).
1509         * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Fix error
1510         handling.
1512 2019-08-27  Werner Lemberg  <wl@gnu.org>
1514         [woff2] Fix compiler warnings.
1516         * src/sfnt/sfwoff2.c (read_num_hmetrics): Remove unused argument
1517         `table_len'.
1518         Update caller.
1519         (triplet_decode, compute_bbox, store_loca, reconstruct_glyf): Make
1520         `i' variable unsigned.
1521         (reconstruct_glyph): Remove condition which is always false.
1522         (reconstruct_html): Removed unused argument `transformed_size'.
1523         Update caller.
1525         * src/sfnt/woff2tags.c (woff2_known_tags): Remove condition which is
1526         always false.
1528 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1530         [woff2] Check whether known tag is in array bounds.
1532         If table tag is not 0x3f, we expect a value between 0 and 62.  If
1533         this is not the case, exit with errors.
1535         * src/sfnt/sfwoff2/c: Check whether table tag makes sense.
1537         * src/sfnt/woff2tags.c: Return 0 if tag is out of bounds.
1539 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1541         * src/sfnt/sfwoff2.c: Improve trace comments.
1543         Adjust tracing levels for comments, and more formatting.
1545 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1547         [woff2] Support `hmtx' reconstruction when `glyf' is untransformed.
1549         `reconstruct_hmtx' requires `info->x_mins' and `info->num_glyphs' to
1550         reconstruct the hmtx table.  In case glyf is not transformed, we
1551         call `get_x_mins' which does the necessary work.
1553         * src/sfnt/sfwoff2.c (get_x_mins): New function.
1554         (reconstruct_font): Call get_x_mins.
1556 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1558         [sfnt] Support `face->num_faces' for WOFF2 fonts.
1560         Set correct value of `face->num_faces' for WOFF2 fonts.  This is
1561         being handled separately because we only load the tables for the
1562         requested font face in `woff2_open_font' and create a single-face
1563         sfnt stream.
1565         The full discussion is at:
1567           https://lists.gnu.org/archive/html/freetype-devel/2019-08/msg00000.html
1569         * src/sfnt/sfobjs.c (sfnt_open_font): Add parameter
1570         `woff2_num_faces'.
1571         (sfnt_init_face): Introduce variable `woff2_num_faces', and change
1572         `face->root.num_faces' if `woff2_num_faces' is set.
1574         * src/sfnt/sfwoff2.c (woff2_open_font): Validate requested face
1575         index and handle negative face indices.
1577         * src/sfnt/sfwoff2.h (woff2_open_font): Add parameter `num_faces' to
1578         declaration.
1580 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1582         [woff2] Improve memory and error handling.
1584         Free up memory after use, and improve error handling.
1586         * src/sfnt/sfwoff2.c (reconstruct_font, woff2_open_font): Implement
1587         changes.
1589 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1591         [woff2] Avoid too many calls to `FT_REALLOC'.
1593         We do this by using `totalSfntSize' as an initial reference, and
1594         extending the buffer when required.  This reduces rendering time
1595         considerably.
1597         * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add
1598         `totalSfntSize', rename `total_sfnt_size' to `actual_sfnt_size'.
1600         * src/sfnt/sfwoff2.c (write_buf): Add parameter `dst_size' to keep
1601         track of and update total size of stream.
1603         (WRITE_SFNT_BUF, WRITE_SFNT_BUF_AT): Modify macros accordingly.
1605         (pad4, store_loca, reconstruct_glyf, reconstruct_hmtx,
1606         reconstruct_font): Update parameters to accept `sfnt_size'.
1608         (woff2_open_font): Add variable `sfnt_size'.  Use WOFF2 header field
1609         `totalSfntSize' as initial reference (if value makes sense) and
1610         allocate `totalSfntSize' bytes for the sfnt stream.  `write_buf'
1611         handles reallocation if and when required.  Also resize the stream
1612         to `actual_sfnt_size' after reconstruction.
1614 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1616         [woff2] Reconstruct `loca', `hmtx', and swap out stream.
1618         Add necessary functions to reconstruct loca and hmtx tables (the two
1619         remaining tables that can have a transform).  `woff2_open_font' is
1620         now capable of loading a woff2 font face.  This code may still need
1621         more refining and better memory management.
1623         * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add total
1624         (final) size of sfnt stream.
1626         (WOFF2_InfoRec): Add header checksum value.
1628         * src/sfnt/sfobjs.c (sfnt_open_font): Change `face_instance_index'
1629         parameter to its pointer so its value can be modified by
1630         `woff2_open_font'.
1632         * src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF_AT): New macro to write into
1633         sfnt buffer at given position.
1635         (write_buf): Add parameter `extend_buf' which allows caller to
1636         specify whether buffer should be reallocated before copying data.
1638         (WRITE_SFNT_BUF): Updated.
1640         (pad4, store_loca, reconstruct_htmx): New functions.
1642         (reconstruct_glyf): Calculate loca values and store them.
1644         (reconstruct_font): Call `reconstruct_hmtx', write table record
1645         entries, and calculate table checksums.  Also calculate font
1646         checksum and update `checksumAdjustment' entry in head table.
1648         (woff2_open_font): Open stream for sfnt buffer, swap out input
1649         stream and return.
1651         * src/sfnt/sfwoff2.h (woff2_open_font): Modify parameter to accept
1652         pointer to `face_index'.
1654 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1656         [woff2] Reconstruct transformed `glyf' table.
1658         Reconstruct `glyf' table if it is transformed in the uncompressed
1659         table stream.  Also add necessary structures, macros and functions.
1661         * include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
1662         WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
1663         (WOFF2_TableRec): s/OrigLength/dst_length/.
1665         * src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
1666         `FT_SET_ERROR' to set implicit `error' variable.
1668         (WRITE_SHORT): New macro.
1670         (N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
1671         COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
1672         refer to substreams of the transformed `glyf' tables.
1674         (Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
1675         macros.
1677         (with_sign, safe_int_addition): New functions to add sign to values
1678         based on a flag and perform safe addition respectively.
1680         (triplet_decode): Decode variable-length (flag, xCoordinate,
1681         yCoordinate) triplet for a simple glyph.   See
1683           https://www.w3.org/TR/WOFF2/#triplet_decoding
1685         (store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
1686         New functions.
1688         (reconstruct_font): Call `reconstruct_glyf'.
1690         * src/sfnt/sfwoff2.h: Add required constants.
1692         * src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
1694 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1696         [woff2] Copy un-transformed tables to sfnt stream.
1698         Copy un-transformed tables to the sfnt stream.
1700         * src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF): New macro.
1701         (write_buf): New function.  Extend memory of `dst' buffer and copy
1702         bytes from `src'.
1703         (compute_ULong_sum): New function.  Calculate checksum of table.
1704         (reconstruct_font): Change `FT_Byte* sfnt' to `FT_Byte**
1705         sfnt_bytes'.  This has been done because we reallocate memory to
1706         `sfnt' multiple times, which may change the pointer value of `sfnt'.
1707         This new pointer must be propogated back to the caller.  Same reason
1708         for using a double pointer in `write_buf'.
1710         * src/sfnt/woff2tags.h (WOFF2_DEFAULT_MAX_SIZE): New macro used for
1711         overflow checking.
1713 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1715         [woff2] Create stream for uncompressed buffer.
1717         Uncompressed buffer is now an `FT_Stream'.
1719         Perform basic checks and start iterating over tables.
1721         * src/sfnt/sfwoff2.c (stream_close, find_table, read_num_hmetrics):
1722         New functions.
1723         (reconstruct_font): Modify parameters and iterate over tables.
1724         (woff2_open_font): Updated.
1726 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1728         [woff2] Handle TTCs and start reconstructing font.
1730         We `handle' TTCs by modifying the `indices' array to point to only
1731         those tables that are part of the requested `face_index'.
1733         Set and use `num_tables' in `WOFF2_TtcFont'.
1735         * src/sfnt/sfwoff2.c (reconstruct_font): New function.
1736         (woff2_open_font): Start reconstruction of font.
1738 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1740         [woff2] Get known tags from function.
1742         Change `KnownTags' to a function (`woff2_known_tags').  This avoids
1743         introducing a global constant array.  This function returns the
1744         specified index without *any* checks.  The caller must ensure that
1745         `index' is within array limits.
1747         * src/sfnt/sfwoff2.c (woff2_open_font): Change `KnownTags[...]'
1748         notation to `woff2_known_tags( ...  )'.
1750         * src/sfnt/woff2tags.c: Perform changes.
1752         * src/sfnt/woff2tags.h: Update definitions.
1754 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1756         [woff2] Minor.
1758         * src/sfnt/sfwoff2.c (woff2_uncompress): Add error message
1759         (woff2_open_font): Free `uncompressed_buf'.
1761 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1763         [woff2] Uncompress Brotli streams and `face_index' support.
1765         WOFF2 compressed stream is now uncompressed if Brotli is available.
1766         This data is stored in a separate buffer (uncompressed_buf) because
1767         it does not contain direct table data.  Certain tables have
1768         transformations applied to them, and they must be reconstructed
1769         before we can write those tables to the SFNT stream.
1771         `face_index' is now being passed as a parameter to
1772         `woff2_open_font'.
1774         * src/sfnt/sfobjs.c (sfnt_open_font): Add parameter
1775         `face_instance_index'.
1777         * src/sfnt/sfwoff2.c (woff2_uncompress): New function.
1778         (woff2_open_font): Call `woff2_uncompress'.
1779         (compute_first_table_offset): Fix return type.
1781         * src/sfnt/sfwoff2.h (woff2_open_font): Modify declaration.
1783 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1785         * builds/unix/configure.raw: Change argument name to `brotli'.
1787 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1789         Add Brotli dependency and required checks.
1791         Brotli is required for decompressing WOFF2 font directory streams.
1792         The library is thus being added as an optional dependency for
1793         FreeType.
1795         * builds/unix/configure.raw: Add checks for `libbrotlidec'.
1796         (REQUIRES_PRIVATE, LIBS_PRIVATE, LIBSSTATIC_CONFIG): Updated.
1798         * devel/ftoption.h, include/freetype/config/ftoption.h
1799         (FT_CONFIG_OPTION_USE_BROTLI): New macro.
1801 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1803         [woff2] Write SFNT Offset table.
1805         * src/sfnt/sfwoff2.c (WRITE_USHORT, WRITE_ULONG): New macros.
1806         (compare_tags): New function.
1807         (woff2_open_font): Implement it.
1809 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1811         * src/sfnt/sfwoff2.c: #undef macros.
1813 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1815         [woff2] Read table and collection directory.
1817         * include/freetype/internal/wofftypes.h (WOFF2_TtcFontRec): New
1818         structure.
1819         (WOFF2_HeaderRec): Add more fields.
1821         * src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128, ROUND4): New
1822         macros.
1823         (Read255UShort, CollectionHeaderSize, compute_first_table_offset):
1824         New functions.
1825         (ReadBase128): Use `FT_READ_BYTE'.
1826         (woff2_open_font): Add functionality to read table directory and
1827         collection directory (if present).
1829 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1831         [sfnt] Include `woff2tags.c' for building.
1833         * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `woff2tags.c'.
1835         * src/sfnt/sfnt.c: Include `woff2tags.c'.
1837 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1839         [sfnt] Add WOFF2 constants.
1841         Add constants required for WOFF2, and known table tags as defined in
1842         the specification.  See
1844           https://www.w3.org/TR/WOFF2/#table_dir_format
1846         for details.
1848         * src/sfnt/woff2tags.c, src/sfnt/woff2tags.h: New files.
1850 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1852         [sfnt] Read WOFF 2 header.
1854         Check for WOFF2 tag, call `woff2_open_font', and implement it to read
1855         header according to specification.
1857         * include/freetype/internal/fttrace.h: Add `sfwoff2.c'.
1859         * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `sfwoff2.c'.
1861         * src/sfnt/sfnt.c: Include `sfwoff2.c'.
1863         * src/sfnt/sfobjs.c (sfnt_open_font): Check for `wOF2' tag and call
1864         `woff2_open_font'.
1866         * src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h: New files.
1868 2019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1870         Add structures for WOFF2.
1872         Add structures and macro for WOFF 2 header and table directory.
1874         * include/freetype/internal/wofftypes.h (WOFF2_HeaderRec,
1875         WOFF2_TableRec_): New structures.
1877         * include/freetype/tttags.h (TTAG_wOF2): New macro.
1879 2019-08-26  Werner Lemberg  <wl@gnu.org>
1881         * src/psaux/cffdecode.c (cff_operator_seac): Fix numeric overflow.
1883         Reported as
1885           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16470
1887 2019-08-26  Werner Lemberg  <wl@gnu.org>
1889         [type1] Fix `FT_Get_Var_Axis_Flags' (#56804).
1891         * src/type1/t1load.c (T1_Get_MM_Var): Allocate space for axis flags.
1892         Also remove redundant assignment.
1894 2019-07-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
1896         * src/base/ftbbox.c (cubic_peak): Sanitize left shift (#56586).
1898 2019-07-22  Weiyi Wu  <w1w2y3@gmail.com>
1900         * src/cid/cidload.c (cid_hex_to_binary): Fix typo (#56653).
1902 2019-07-12  Werner Lemberg  <wl@gnu.org>
1904         [sfnt, winfonts] Avoid memory leaks in case of error (#56587).
1906         * src/sfnt/sfwoff.c (woff_open_font): Call `FT_FRAME_EXIT' in case
1907         of error.
1909         * src/winfonts/winfnt.c (fnt_face_get_dll_font): Ditto.
1911 2019-07-12  Ben Wagner  <bungeman@google.com>
1913         Properly handle phantom points for variation fonts (#56601).
1915         * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Scale phantom
1916         points if HVAR and/or VVAR is present.
1918 2019-07-04  Werner Lemberg  <wl@gnu.org>
1920         [psaux] (2/2) Handle fonts that use SEAC for ligatures (#56580).
1922         The same as previous commit but for the old engine.
1924         * src/psaux/t1decode.c (t1operator_seac): Implement it.
1926 2019-07-04  Chris Liddell <chris.liddell@artifex.com>
1928         [psaux] (1/2) Handle fonts that use SEAC for ligatures (#56580).
1930         As originally intended, a Type 1 SEAC charstring would be used for
1931         an accented glyph (like `acaron' or `uumlaut'), where the advance
1932         width of the SEAC glyph is the same as that of the `base' glyph
1933         (like `a' or `u').  In this case it is not uncommon for the SEAC
1934         glyph to not use an (H)SBW opcode of its own but to rely on the
1935         value from the base glyph.
1937         However, out-of-spec fonts also use SEAC glyphs for ligatures (like
1938         `oe' or `fi'), and in those cases the overall advance width is
1939         greater than that of the `base' glyph.  For this reason we have to
1940         allow that the SEAC glyph can have an (H)SBW value of its own, and
1941         if it has, retain this value, rather than the one from the base
1942         glyph.
1944         * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escSEAC>:
1945         Implement it.
1947 2019-07-01  Werner Lemberg  <wl@gnu.org>
1949         * Version 2.10.1 released.
1950         ==========================
1953         Tag sources with `VER-2-10-1'.
1955         * docs/VERSION.TXT: Add entry for version 2.10.1.
1957         * README, Jamfile (RefDoc), src/base/ftver.rc,
1958         builds/windows/vc2010/freetype.vcxproj,
1959         builds/windows/vc2010/index.html,
1960         builds/windows/visualc/freetype.dsp,
1961         builds/windows/visualc/freetype.vcproj,
1962         builds/windows/visualc/index.html,
1963         builds/windows/visualce/freetype.dsp,
1964         builds/windows/visualce/freetype.vcproj,
1965         builds/windows/visualce/index.html,
1966         builds/wince/vc2005-ce/freetype.vcproj,
1967         builds/wince/vc2005-ce/index.html,
1968         builds/wince/vc2008-ce/freetype.vcproj,
1969         builds/wince/vc2008-ce/index.html: s/2.10.0/2.10.1/, s/2100/2101/.
1971         * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
1973         * builds/unix/configure.raw (version_info): Set to 23:1:17.
1974         * CMakeLists.txt (VERSION_PATCH): Set to 1.
1976         * include/freetype/fterrors.h (FT_Error_String): Fix C++ compilation.
1978 2019-06-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
1980         * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Fix inequality.
1982         Reported by Armin Hasitzka.
1984 2019-06-16  Werner Lemberg  <wl@gnu.org>
1986         * src/tools/apinames.c: Formatting, minor edits.
1988 2019-06-16  Werner Lemberg  <wl@gnu.org>
1990         [autofit] Disable hinting if no blue zones are available (#56450).
1992         * src/autofit/afglobal.c (af_face_global_get_metrics): Start again
1993         (with dummy hinter module) if no blue zones are present.
1995         * src/autofit/aflatin.c (af_latin_metrics_init_blues): Change
1996         signature to return error code.
1997         If no blue zones are found, update `glyph_styles' array to hold
1998         AF_STYLE_NONE_DFLT instead of the current style.
1999         (af_latin_metrics_init): Return internal error code if no blue zones
2000         are found.
2002 2019-06-16  Werner Lemberg  <wl@gnu.org>
2004         Towards better VMS support.
2006         More to come.
2008         * builds/vms/LIBS.OPT_IA64, builds/vms/_LINK.OPT_IA64,
2009         builds/vms/vmslib.dat: New files provided by Jouk Jansen
2010         <joukj@hrem.nano.tudelft.nl>.
2012         * builds/vms/ftconfig.h: Update, also from Jouk.
2014 2019-06-13  Werner Lemberg  <wl@gnu.org>
2016         * src/autofit/aflatin.c (af_latin_metrics_init_widths): Minor.
2018 2019-06-13  Alexei Podtelezhnikov  <apodtele@gmail.com>
2020         [smooth] Restore the span buffering for direct mode only.
2022         The buffer size FT_MAX_GRAY_SPANS is set to 10 spans, which should be
2023         enough to cover the entire scanline for simple glyphs in most cases:
2024         each slightly slanted edge needs up to two spans, plus a filling span
2025         in-between.  This is not new, we used to do it before cb4388783cecc.
2027         * src/smooth/ftgrays.c (gray_TWorker): Add `spans' and `num_spans'.
2028         (gray_hline, gray_sweep): Implement the span buffering.
2029         (gray_raster_render): Use negative `num_spans' to avoid the direct
2030         mode.
2032 2019-06-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
2034         * include/freetype/ftmodapi.h (FT_DebugHook_Func): Return error.
2036         Fix a warning by adding a return value as in `TT_RunIns',
2037         which should not be a compatibility issue.
2039 2019-06-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
2041         * src/truetype/ttobjs.c (tt_check_trickyness_family): Add `const'.
2043 2019-06-11  Moazin Khatti  <moazinkhatri@gmail.com>
2045         [gzip] Add support for `gzip' encoded header.
2047         * src/gzip/ftgzip.c (FT_Gzip_Uncompress): Modify the the call to
2048         `inflateInit2' to enable support for `gzip' encoded headers.
2050 2019-06-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
2052         [type1,type42] Use `const' for string literals.
2054         * include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated.
2055         * include/freetype/internal/t1types.h (T1_EncodingRec): Updated.
2056         * src/psaux/psobjs.[ch] (ps_table_add): Updated.
2057         * src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated.
2058         * src/type42/t42objs.c (T42_Open_Face): Updated.
2059         * src/type42/t42parse.c (t42_parse_encoding): Updated.
2061         * src/cff/cffobjs.c (cff_face_init): Minor.
2063 2019-06-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
2065         [bdf,pcf] Use `const' for string literals.
2067         * src/bdf/bdf.h (bdf_property_t): Updated `name'.
2068         * src/bdf/bdflib.c (_bdf_list_split,bdf_create_property,
2069         _bdf_add_property,_bdf_ato*): Updated.
2070         * src/bdf/bdfdrivr.c (bdf_interpret_style): Updated.
2071         * src/pcf/pcfread.c (pcf_intrpret_style): Ditto.
2073 2019-06-07  Philip Race  <philip.race@oracle.com>
2075         * src/base/ftinit.c (FT_Set_Default_Properties): Fix crash.
2077         Terminate loop at end of environment.
2079 2019-05-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
2081         Solidify VC2005 builds.
2083         * include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Explicitly
2084         declare `_BitScanReverse' intrinsic.
2085         * builds/windows/visualc/freetype.vcproj [Debug]: Disable intrinsics.
2087 2019-05-30  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
2089         [sfnt] Separate WOFF sources and headers.
2091         Move WOFF sources and headers to separate files.
2093         * include/freetype/internal/wofftypes.h, src/sfnt/sfwoff.c,
2094         src/sfnt/sfwoff.h: New files.
2096         * include/freetype/internal/fttrace.h: Register `sfwoff.c'.
2098         * include/freetype/internal/internal.h: Define
2099         FT_INTERNAL_WOFF_TYPES_H.
2101         * include/freetype/internal/sfnt.h: Include FT_INTERNAL_WOFF_TYPES_H.
2103         * include/freetype/internal/tttypes.h: Move out WOFF structures.
2105         * src/sfnt/rules.mk: Add `sfwoff.c'.
2107         * src/sfnt/sfnt.c: Include `sfwoff.c'.
2109         * src/sfnt/sfobjs.c: Include `sfwoff.h', move out WOFF sources.
2111 2019-05-30  Werner Lemberg  <wl@gnu.org>
2113         [base] Fix `make multi'.
2115         Reported by Nikhil.
2117         * src/base/fterrors.c: Include FT_INTERNAL_DEBUG_H.
2119 2019-05-29  Ben Wagner  <bungeman@google.com>
2121         [truetype] Fix copy-and-paste error (#56409).
2123         * src/truetype/ttgload.c (load_truetype_glyph): Use correct indices
2124         into `unrounded' array for phantom points.
2126 2019-05-29  Werner Lemberg  <wl@gnu.org>
2128         [truetype] Fix 32bit builds (#56404).
2130         Patch suggested by Ben Wagner <bungeman@google.com>.
2132         * src/truetype/ttgxvar.c (FT_fixedToInt, FT_fixedToFdot6): Remove
2133         harmful cast to unsigned type.
2135 2019-05-26  Ben Wagner  <bungeman@google.com>
2137         * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Improve accuracy.
2139 2019-05-23  Werner Lemberg  <wl@gnu.org>
2141         [truetype] Draw glyphs without deltas in variation font (#56374).
2143         * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Always fill
2144         `unrounded' array.
2146 2019-05-21  Werner Lemberg  <wl@gnu.org>
2148         * src/truetype/ttinterp.c (opcode_name): Improve mnemonics.
2150 2019-05-16  Werner Lemberg  <wl@gnu.org>
2152         [truetype] Actually scale varied CVT values.
2154         Up to now, only the unscaled CVT values were varied; in other words,
2155         the `CVAR' data was never used for bytecode hinting.
2157         * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): New auxiliary
2158         function.
2159         (tt_face_vary_cvt): Use it to trigger rescaling of CVT values.
2161 2019-05-16  Werner Lemberg  <wl@gnu.org>
2163         [truetype] Use 26.6 format for storing unscaled CVT values.
2165         If `CVAR' data is applied to variation fonts, fractional values are
2166         possible.
2168         * include/freetype/internal/tttypes.h (TT_FaceRec): Change type of
2169         `cvt' from `FT_Short' to `FT_Int32'.
2171         * src/truetype/ttgxvar.c (FT_fdot6ToFixed): New macro.
2172         (tt_face_vary_cvt): Use it to update code to 26.6 format.
2174         * src/truetype/ttobjs.c (tt_size_run_prep): Update code to 26.6
2175         format.
2177         * src/truetype/ttpload.c (tt_face_load_cvt): Stora data in 26.6
2178         format.
2180 2019-05-16  Werner Lemberg  <wl@gnu.org>
2182         * src/truetype/ttgload.c (load_truetype_glyph): Init `unrounded'.
2184         This fixes linear advance width values for spacing glyphs.  Bug
2185         introduced 2019-05-09.
2187 2019-05-16  Werner Lemberg  <wl@gnu.org>
2189         [truetype] Avoid code duplication.
2191         * src/truetype/ttobjs.c (tt_size_run_prep): Scale CVT values in this
2192         function.
2193         (tt_size_ready_bytecode): Updated.
2194         * src/truetype/ttgload.c (tt_loader_init): Updated.
2196 2019-05-13  Jouk Jansen  <joukj@hrem.nano.tudelft.nl>
2198         * vms_make.com: Updated.  Handle `bzip2' directory, too.
2200 2019-05-13  Werner Lemberg  <wl@gnu.org>
2202         * src/psaux/psfont.c (cf2_font_setup): Fix compiler warning.
2204 2019-05-12  Werner Lemberg  <wl@gnu.org>
2206         [truetype] Doh.  Fix last commit to make it work.
2208         Very embarassing :-)
2210         Reported as
2212           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14701
2213           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14705
2214           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14710
2216         * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): Move up and add
2217         argument; update all callers.
2218         (TT_Process_Simple_Glyph): Use it.  The `unrounded' array is active
2219         for variation fonts only, thus also enclose related code with
2220         `#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT ...  #endif' where
2221         necessary.
2222         Revert commit a113e5d from 2019-05-09, and don't use `extra_points2'
2223         but allocate a temporary array.
2224         Speed up the scaling of the `unrounded' array.
2226         * src/truetype/ttgxvar.c (FT_fixedToInt, FT_FixedToFdot6): Fix type
2227         conversions and rounding.  The unsigned type must have more or equal
2228         bits to the signed type.
2230 2019-05-09  Werner Lemberg  <wl@gnu.org>
2232         [truetype] Increase precision of font variation (#54371).
2234         This patch makes FreeType use font units in 26.6 format internally
2235         instead of integers.
2237         * src/truetype/ttgxvar.c (FT_fixedToFdot6): New macro.
2238         (TT_Vary_Apply_Glyph_Deltas): Add argument to output unrounded font
2239         coordinates.
2240         * src/truetype/ttgxvar.h: Updated.
2242         * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Use
2243         `extra_points2' array to temporarily hold unrounded point
2244         coordinates; use them to compute scaled coordinates and linear
2245         advance width and height.
2246         (load_truetype_code): Adjust similarly.
2248 2019-05-09  Werner Lemberg  <wl@gnu.org>
2250         * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Minor.
2252 2019-05-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
2254         [smooth] Faster fractions.
2256         * src/smooth/ftgrays.c (SUBPIXELS): Replace with...
2257         (FRACT): A fractional coordinate macro to use in...
2258         (gray_render_line, gray_render_scanline): ... here.
2260 2019-05-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
2262         * src/raster/ftraster.c (Draw_Sweep): Unbreak.
2264 2019-05-05  Alexei Podtelezhnikov  <apodtele@gmail.com>
2266         * src/raster/ftraster.c: Clean-ups.
2268 2019-05-05  Werner Lemberg  <wl@gnu.org>
2270         * src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'.
2272 2019-05-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
2274         * src/smooth/ftgrays.c (gray_render_line): Small shortcut.
2276 2019-05-04  Werner Lemberg  <wl@gnu.org>
2278         Various clang 8.0 static analyzer fixes.
2280         Reported by Sender Ghost <lightside@gmx.com>.
2282         * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Catch a corner
2283         case where `edge->first' could be NULL.
2285         * src/pfr/pfrobjs.c (pfr_slot_load): Remove unnecessary test of
2286         `size'.
2288         * src/raster/ftraster.c (Draw_Sweep): Catch a corner case where
2289         `draw_right' might be NULL.
2291         * src/sfnt/ttmtx.c (tt_face_get_metrics): Fix limit test for
2292         `aadvance'.
2293         Ensure `abearing' always hold a meaningful result.
2295         * src/truetype/ttgload.c (load_truetype_glyph): Ensure `subglyph' is
2296         not NULL before accessing it.
2297         * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Remove unnecessary
2298         test of `namedstyle'.
2300         * src/type42/t42parse.c (t42_parser_done): Ensure
2301         `parser->root.funcs.done' is not NULL before accessing it.
2303 2019-05-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
2305         Miscellaneous macro updates.
2307         * src/base/ftoutln.c (SCALED): Updated.
2308         * src/smooth/ftgrays.c (SCALED): Ditto.
2309         (FLOOR, ROUND, CEILING): Removed.
2310         * src/psaux/psfixed.h (cf2_fracToFixed): Updated.
2312 2019-05-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
2314         Tweak LCD filtering.
2316         * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
2317         Choose direction from bitmap's pixel_mode.
2318         * include/freetype/internal/ftobjs.c (FT_Bitmap_LcdFilterFunc):
2319         Updated.
2320         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Updated.
2322 2019-05-02  Werner Lemberg  <wl@gnu.org>
2324         * vms_make.com: Updated (#56253).
2326         Remove no longer existing directories (`autohint', `otlayout').
2327         Update used base extensions.
2328         Activate `autofit' module.
2329         Add `gxvalid' module.
2330         Update copyright notices.
2332 2019-04-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
2334         [smooth] Simplify cubic Bézier flattening.
2336         The previous implementation is correct but it is too complex.
2337         The revised algorithm is based on the fact that each split moves
2338         the control points closer to the trisection points on the chord.
2339         The corresponding distances are good surrogates for the curve
2340         deviation from the straight line.
2342         This cubic flattening algorithm is somewhat similar to the conic
2343         algorithm based the distance from the control point to the middle of
2344         the chord.  The cubic distances, however, decrease less predictably
2345         but are easy enough to calculate on each step.
2347         The new algorithm produces slightly larger number of splits, which is
2348         compensated by its simplicity.  The overall rendering performance is
2349         improved by 1-2%.  The larger number of splits does not necessarily
2350         result in higher quality, which stays comparable.
2352         * src/smooth/ftgrays.c (gray_render_cubic): Replace the split
2353         condition.
2355 2019-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
2357         [smooth] Bithacks and cosmetics.
2359         * src/smooth/ftgrays.c (gray_record_cell, gray_set_cell, gray_hline,
2360         gray_render_conic, gray_convert_glyph_inner): Updated.
2362 2019-04-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
2364         Optimize Bézier bisections.
2366         This change makes bisections faster by 20-30%. When inlined into
2367         `gray_render_cubic', this makes the function faster by 10% and is
2368         noticeable in the overall rendering performance.
2370         * src/raster/ftraster.c (Split_Conic, Split_Cubic): Use shifts and
2371         refactor.
2372         * src/smooth/ftgrays.c (gray_split_conic, gray_split_cubic): Ditto.
2373         * src/base/ftstroke.c (ft_conic_split, ft_cubic_split): Ditto.
2374         * src/base/ftbbox.c (cubic_peak): Use shifts.
2376 2019-04-23  Werner Lemberg  <wl@gnu.org>
2378         * src/sfnt/ttcmap.c (tt_cmap12_next): Remove dead code.
2380         Found by clang 8.0's static analyzer and reported by Sender Ghost
2381         <lightside@gmx.com>.
2383 2019-04-23  Werner Lemberg  <wl@gnu.org>
2385         [base] Fix thinko in previous commit.
2387         * src/base/ftbitmap.c (FT_Bitmap_Blend): Check final width, not
2388         target pitch.
2390         Problem reported by Sender Ghost <lightside@gmx.com>.
2392 2019-04-22  Werner Lemberg  <wl@gnu.org>
2394         * src/base/ftbitmap.c (FT_Bitmap_Blend): Check target pitch.
2396         Problem reported by Sender Ghost <lightside@gmx.com>.
2398 2019-04-22  Werner Lemberg  <wl@gnu.org>
2400         Fix return value of `FT_Set_Named_Instance' (#56186).
2402         * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Correctly handle
2403         internal return value -1 of `TT_Set_Var_Design'.
2405 2019-04-18  Werner Lemberg  <wl@gnu.org>
2407         [pcf] Fix handling of undefined glyph (#56067).
2409         This commit fixes the changes from 2018-07-21, which broke charmap
2410         iteration.  We now add the default character as a new glyph with
2411         index 0, thus increasing the number of glyphs by one (as before).
2413         * src/pcf/pcfread.c (pcf_get_metrics): Adjust to new artificial
2414         glyph with index 0.
2415         Limit number of elements to 65534.
2416         (pcf_get_bitmaps): Ditto.
2417         Unify two loops into one; this avoids allocation of an intermediate
2418         array.
2419         (pcf_get_encodings): Don't flip indices but copy glyph metrics of
2420         default character to index 0.
2421         Also handle invalid default character.
2423         * docs/CHANGES: Updated.
2425 2019-04-15  Minmin Gong  <gongminmin@msn.com>
2427         * CMakeLists.txt: Avoid rewriting of unchanged configuration files.
2429         Reported as
2431           https://savannah.nongnu.org/patch/index.php?9755
2433 2019-04-15  JDG  <JonathanG@iQmetrix.com>
2435         * src/tools/apinames.c (main): Fix error message.
2437         Reported as
2439           https://savannah.nongnu.org/patch/?9796
2441 2019-04-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
2443         [smooth] Fix segfault in direct mode (#56092).
2445         * src/base/ftoutln.c (FT_Outline_Render): Set missing clip_box for
2446         direct mode.
2447         * src/smooth/ftgrays.c (gray_raster_render): Use it.
2449 2019-04-06  Werner Lemberg  <wl@gnu.org>
2451         * src/sfnt/ttcmap.c (tt_get_glyph_name): Pacify compiler (#56061).
2453         This is for Visual Studio 2019 on ARM.
2455 2019-04-06  Werner Lemberg  <wl@gnu.org>
2457         For distribution, replace `.tar.bz2' with `.tar.xz' bundles.
2459         * builds/toplevel.mk (build): Do it.
2461         * README, docs/CHANGES, docs/release: Updated.
2463 2019-04-06  Antony Lee  <anntzer.lee@gmail.com>
2465         Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'.
2467         * include/freetype/freetype.h (FT_Get_Name_Index),
2468         include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc),
2469         include/freetype/internal/services/svgldict.h
2470         (FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index),
2471         src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c
2472         (sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index),
2473         src/type42/t42drivr.c (t42_get_name_index): Add `const' to second
2474         argument.
2476 2019-03-31  Armin Hasitzka  <prince.cherusker@gmail.com>
2478         [cff] Fix boundary checks.
2480         642bc7590c701c8cd35a9f60fa899cfa518b17ff introduced dynamically
2481         allocated memory when parsing CFF files with the "old" engine.  Bounds
2482         checks have never been updated, however, leading to pointless
2483         comparisons of pointers in some cases.  This commit presents a
2484         solution for bounds checks in the CFF module with an extended logic
2485         for the "old" engine while staying as concise as possible for the
2486         "new" one.
2488         * src/cff/cffparse.h: Introduce the struct `CFF_T2_StringRec' and
2489         the additional field `t2_strings' within `CFF_ParserRec'.
2491         * src/cff/cffparse.c (cff_parser_within_limits): Move all boundary
2492         checks into this new function and update the rest of `cffparse.c' to
2493         use it.
2495         Reported as
2497           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12137
2499 2019-03-20  Werner Lemberg  <wl@gnu.org>
2501         [autofit] Fix Mongolian blue zone characters.
2503         * src/autofit/afblue.dat: Use U+200D (ZERO-WIDTH JOINER) characters
2504         to get medial forms for some Mongolian characters.
2505         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
2507 2019-03-19  Werner Lemberg  <wl@gnu.org>
2509         [autofit] Add support for Mongolian script.
2511         As a de-facto standard, layouts using this script are constructed
2512         horizontally line by line, then the lines are rotated clockwise for
2513         vertical display.
2515         * src/autofit/afblue.dat: Add blue zone data for Mongolian.
2516         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
2518         * src/autofit/afscript.h: Add Mongolian standard characters.
2520         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Mongolian
2521         data.
2523 2019-03-15  Werner Lemberg  <wl@gnu.org>
2525         * Version 2.10.0 released.
2526         ==========================
2529         Tag sources with `VER-2-10-0'.
2531         * docs/VERSION.TXT: Add entry for version 2.10.0.
2532         * docs/CHANGES: Updated.
2534         * README, Jamfile (RefDoc), src/base/ftver.rc,
2535         builds/windows/vc2010/freetype.vcxproj,
2536         builds/windows/vc2010/index.html,
2537         builds/windows/visualc/freetype.dsp,
2538         builds/windows/visualc/freetype.vcproj,
2539         builds/windows/visualc/index.html,
2540         builds/windows/visualce/freetype.dsp,
2541         builds/windows/visualce/freetype.vcproj,
2542         builds/windows/visualce/index.html,
2543         builds/wince/vc2005-ce/freetype.vcproj,
2544         builds/wince/vc2005-ce/index.html,
2545         builds/wince/vc2008-ce/freetype.vcproj,
2546         builds/wince/vc2008-ce/index.html: s/2.9.1/2.10.0/, s/291/2100/.
2548         * include/freetype/freetype.h (FREETYPE_MINOR): Set to 10.
2549         (FREETYPE_PATCH): Set to 0.
2551         * builds/unix/configure.raw (version_info): Set to 23:0:17.
2552         * CMakeLists.txt (VERSION_MINOR): Set to 10.
2553         (VERSION_PATCH): Set to 0.
2555         * builds/toplevel.mk (version, winversion): Since the minor version
2556         number has two digits now, never omit the patch number.  We would
2557         get ambiguous zip file names otherwise.
2558         (dist): Remove remnants of `docmaker' tool.
2559         (do-dist): Remove unused intermediate files.
2561         * src/cff/cffparse.c (destrict_c2s_item): Guard function with
2562         CFF_CONFIG_OPTION_OLD_ENGINE macro.
2564 2019-03-07  Andrei Alexeyev  <0x416b617269@gmail.com>
2565             Werner Lemberg  <wl@gnu.org>
2567         Fix invalid function pointer casts.
2569         This change should allow Freetype to work on WASM/Emscripten without
2570         needing `-s EMULATE_FUNCTION_POINTER_CASTS=1'.
2572         * src/autofit/afdummy.c (af_dummy_hints_apply): Fix signature.
2574         * src/cid/cidload.c (cid_parse_font_matrix, parse_fd_array,
2575         parse_expansion_factor, parse_font_name): Return `void', not
2576         `FT_Error'.
2578         * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIsDefaultFunc):
2579         Fix signature.
2581 2019-03-05  Werner Lemberg  <wl@gnu.org>
2583         [base] Handle numeric overflow (#55827).
2585         * src/base/ftglyph.c (FT_Glyph_Get_CBox): Use `FT_PIX_CEIL_LONG'.
2587 2019-03-05  Sebastian Rasmussen  <sebras@gmail.com>
2589         [psaux] Fix use of uninitialized memory (#55832).
2591         * src/psaux/psintrp.c (cf2_interpT2CharString): The call to
2592         `cf2_arrstack_setCount' may fail because the allocator ran out of
2593         memory.  When this happens the stack is still written to before the
2594         error condition is checked.  This means that FreeType writes outside
2595         of allocated memory.  This commit moves the error check prior to the
2596         stack assignment, hence the function now properly returns with an
2597         error condition.
2599 2019-02-23  Werner Lemberg  <wl@gnu.org>
2601         * src/base/ftbitmap.c (FT_Bitmap_Blend): No fractional offsets.
2603         The function only provided a framework without an actual
2604         implementation, which this commit removes.
2606 2019-02-23  Werner Lemberg  <wl@gnu.org>
2608         * src/tools/update-copyright-year: Insert `(C)'.
2610 2019-02-21  Armin Hasitzka  <prince.cherusker@gmail.com>
2612         [truetype] Mask numeric overflows.
2614         * src/truetype/ttinterp.c (Move_CVT, Move_CVT_Stretched, Ins_MIRP):
2615         Mask numeric overflows.
2617         Reported as
2619           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11681
2620           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11734
2622 2019-02-21  Armin Hasitzka  <prince.cherusker@gmail.com>
2624         [psaux] Mask numeric overflow.
2626         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Mask numeric
2627         overflow.
2629         Reported as
2631           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13041
2633 2019-02-16  Wink Saville  <wink@saville.com>
2635         * src/autofit/afwarp.h (af_warper_compute): Fix declaration.
2637 2019-02-02  Nikolaus Waxweiler  <madigens@gmail.com>
2639         [truetype] Apply MVAR hasc, hdsc and hlgp metrics to current FT_Face metrics.
2641         Instead of setting typo or win metrics as the new `FT_Face' metrics
2642         indiscriminately, apply only typo deltas to the currently active
2643         `FT_Face' metrics.  This prevents line height differences when the
2644         default outlines were used as the regular face and instances for
2645         everything else, for example.
2647         * src/truetype/ttgxvar.c (tt_apply_mvar): Implement.
2649 2019-02-02  Nikolaus Waxweiler  <madigens@gmail.com>
2651         [sfnt] Use typo metrics if OS/2 fsSelection USE_TYPO_METRICS bit is set.
2653         If the `OS/2' table exists and `fsSelection' bit 7
2654         (USE_TYPO_METRICS) is set, use the `sTypo*' set of values to compute
2655         the `FT_Face's ascender, descender, and height.  Otherwise, fall
2656         back to old behavior.
2658         * src/sfnt/sfobjs.c (sfnt_load_face): Implement.
2660 2019-01-18  John Tytgat  <John.Tytgat@esko.com>
2662         [sfnt] Handle TT fonts having two PostScript font names (#55471).
2664         * src/sfnt/sfdriver.c (sfnt_get_name_id): Prefer English over any
2665         other language found for PostScript font names.
2667 2019-01-08  Chris Liddell <chris.liddell@artifex.com>
2669         [psaux] Fix closepath (#55414).
2671         All of the Type 1 path building is done with code common to the
2672         revised CFF engine, with the exception of closepath, which was still
2673         calling ps_builder_close_contour(), thus previously cached segments
2674         were not always written to the path, and glyph corruption, or even
2675         invalid outlines were possible.
2677         * src/psauc/psinterp.c (cf2_interpT2CharString) <cf2_cmdCLOSEPATH>:
2678         Switch to calling `cf2_glyphpath_closeOpenPath'.
2680 2018-12-29  Werner Lemberg  <wl@gnu.org>
2682         * src/autofit/aflatin2.c: Some fixes from `aflatin.c' (#55310).
2684 2018-12-25  Werner Lemberg  <wl@gnu.org>
2686         * src/psaux/cffdecode.c (cff_operaor_seac): Fix numeric overflow.
2688         Reported as
2690           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11915
2692 2018-12-12  Werner Lemberg  <wl@gnu.org>
2694         [gxvalid] Fix compiler warnings.
2696         * src/gxvalid/gxvjust.c (gxv_just_check_max_gid),
2697         src/gxvalid/gxvmort.c (gxv_mort_coverage_validate): Use `FT_UNUSED'.
2699 2018-12-11  Werner Lemberg  <wl@gnu.org>
2701         * src/truetype/ttgload.c (TT_Hint_Glyph): Remove useless test.
2703         `control_len' only gets its value from `n_ins' (and vice versa),
2704         which is always read as `unsigned short' and thus can't be larger
2705         than 0xFFFF.
2707 2018-12-04  Werner Lemberg  <wl@gnu.org>
2709         [bdf] Ignore data after `ENDFONT'.
2711         Reported as
2713           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10798
2715         * src/bdf/bdflib.c (_bdf_parse_end): New function.
2716         (_bdf_parse_glyphs): Switch to `_bdf_parse_end' after `ENDFONT' has
2717         been encountered.
2719 2018-12-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
2721         * builds/windows/visualc/freetype.dsp: Dust off.
2723 2018-11-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
2725         * builds/windows/vc2010/freetype.vcxproj: Simplify.
2727 2018-11-27  Chris Liddell  <chris.liddell@artifex.com>
2729         [type1,cff] Add FT_{Set,Get}_MM_WeightVector API calls.
2731         For multiple master fonts, common usage (in Postscript) is to modify
2732         the WeightVector of an existing font instance, this addition
2733         supports that use.
2735         * include/freetype/ftmm.h, src/base/ftmm.c (FT_Set_MM_WeightVector,
2736         FT_Get_MM_WeightVector): New API functions.
2738         * include/freetype/internalservices/svmm.h
2739         (FT_Set_MM_WeightVector_Func, FT_Get_MM_WeightVector_Func): New
2740         function types.
2741         (MultiMasters): Add `set_mm_weightvector' and `get_mm_weightvector'
2742         members.
2743         (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
2745         * src/cffcffdrivr.c (cff_set_mm_weightvector,
2746         cff_get_mm_weightvector): New functions.
2747         (cff_service_multi_masters): Register them.
2749         * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
2750         This driver doesn't use the new interface.
2752         * src/type1/t1load.c (T1_Set_MM_WeightVector,
2753         T1_Get_MM_WeightVector): New functions.
2754         * src/type1/t1driver.c (t1_service_multi_masters): Register them.
2755         * src/type1/t1load.h: Updated.
2757 2018-11-27  Ben Wagner  <bungeman@google.com>
2759         [cff] Fix compiler warning (#55105).
2761         * src/cff/cffparse.c (cff_parser_run): Guard label only used if
2762         CFF_CONFIG_OPTION_OLD_ENGINE is active.
2764 2018-11-27  Ben Wagner  <bungeman@google.com>
2766         [truetype] Fix numeric overflow (#55103).
2768         * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
2770 2018-11-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
2772         [builds] Belated DLL support with vc2002-vc2008.
2774         The solution and project files should be automatically upgraded for
2775         the approriate Visual C++ version.
2777         * builds/windows/visualc/freetype.{sln,vcproj}: Major upgrades.
2778         * builds/windows/visualc/index.html: Document the change.
2779         * builds/windows/vc2005, builds/windows/vc2008: Removed as redundant.
2781 2018-11-22  Armin Hasitzka  <prince.cherusker@gmail.com>
2783         * src/cff/cffparse.c: Please the compiler.
2785 2018-11-22  Armin Hasitzka  <prince.cherusker@gmail.com>
2787         [cff] Fix memory overflow.
2789         Reported as
2791           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9869
2792           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10869
2794         * src/cff/cffparse.c (destruct_t2s_item, cff_parser_run): Store
2795         evaluated T2 charstrings in separately allocated memory.
2797 2018-11-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
2799         * builds/windows/{visualc,vc2005,vc2008}/freetype.vcproj: Fix it.
2801 2018-11-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
2803         [smooth] Placeholder only for library-enabled LCD filtering.
2805         * src/smooth/ftsmooth.c (ft_smooth_init): Add disabled
2806         `FT_Library_SetLcdFilter' call.
2808 2018-11-09  Young Xiao  <yangx92@hotmail.com>
2810         [psaux] Add safety guard (#54985).
2812         * src/psaux/psobjs.c (cff_builder_close_contour): Do it.
2814 2018-11-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
2816         * builds/unix/configure.raw: Require `windows.h' for windres.
2818 2018-11-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
2820         [ftstroke] Fix unpredictable failures (#54986).
2822         * src/base/ftstroke.c (ft_sroke_border_lineto): Fix lineto check.
2824 2018-11-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
2826         [ftstroke] Fix unpredictable failures (#54976).
2828         * src/base/ftstroke.c (ft_sroke_border_close): Set the start tags.
2830 2018-11-07  Ben Wagner  <bungeman@google.com>
2832         [truetype] Fix VF check from 2018-09-12 (#54973).
2834         * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Use correct
2835         offsets for estimates.
2837 2018-11-06  Werner Lemberg  <wl@gnu.org>
2839         [pshinter] Fix numeric overflow.
2841         Reported as
2843           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11242
2845         * src/pshinter/pshrec.c (ps_dimension_add_t1stem): Implement it.
2847 2018-11-06  Werner Lemberg  <wl@gnu.org>
2849         [psaux] Fix timeout in old CFF engine.
2851         Reported as
2853           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11260
2855         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
2856         <cff_op_sqrt> [CFF_CONFIG_OPTION_OLD_ENGINE]: Fix potential endless
2857         loop.
2859 2018-11-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
2861         * src/truetype/ttgxvar.c: Use enum definitions.
2863 2018-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
2865         * src/truetype/ttgxvar.c (ft_var_apply_tuple): Adjust condition.
2867 2018-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
2869         * src/truetype/ttgxvar.c (ft_var_apply_tuple): Tracing tweaks.
2871 2018-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
2873         Revert due to specs: [truetype] Speed up variation IUP.
2875 2018-11-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
2877         * src/truetype/ttgxvar.c (ft_var_get_item_delta): Fixed logic.
2879         Reported and tested by Behdad.
2881 2018-11-02  Shailesh Mistry  <shailesh.mistry@hotmail.co.uk>
2883         [autofit] Prevent SEGV.
2885         See
2887           https://bugs.ghostscript.com/show_bug.cgi?id=697545
2889         for more details on how the bug was found.
2891         * src/autofit/afloader.c (af_loader_load_glyph): Propagate error
2892         code.
2894 2018-10-31  Alexei Podtelezhnikov <apodtele@gmail.com>
2896         [truetype] Speed up variation IUP.
2898         * src/truetype/ttgxvar.c (tt_delta_interpolate): Separate trivial
2899         snapping to the same position from true interpolation.
2901 2018-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
2903         * src/type1/t1load.c (t1_set_mm_blend): Optimized.
2905 2018-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
2907         * src/truetype/ttgxvar.c (ft_var_get_item_delta): Optimized.
2909 2018-10-29  Werner Lemberg  <wl@gnu.org>
2911         [base] Fix numeric overflow.
2913         Reported as
2915           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11080
2917         * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use `MUL_LONG'.
2919 2018-10-29  Werner Lemberg  <wl@gnu.org>
2921         [cff] Fix numeric overflow.
2923         Reported as
2925           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10988
2927         * src/cff/cffparse.c (cff_parser_run)
2928         [CFF_CONFIG_OPTION_OLD_ENGINE]: Use `NEG_LONG'.
2930 2018-10-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
2932         [sfnt] Make `head' timestamps unsigned.
2934         It's been more than 2^31 seconds since 1904.
2936         * include/freetype/tttables.h (TT_Header): Change field types.
2937         * src/sfnt/ttload.c (tt_face_load_generic_header): Updated.
2939 2018-10-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
2941         Revert: Align FreeType with standard C memory management.
2943 2018-10-27  Werner Lemberg  <wl@gnu.org>
2945         [psaux] Fix numeric overflow.
2947         Triggered by
2949           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11157
2951         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_blend>
2952         [CFF_CONFIG_OPTION_OLD_ENGINE]: Fix integer overflow.
2954 2018-10-20  Werner Lemberg  <wl@gnu.org>
2956         Avoid endless loop while tracing (#54858).
2958         * src/type1/t1load.c (parse_buildchar): Guard tracing stuff with
2959         FT_DEBUG_LEVEL_TRACE.
2961 2018-10-17  David Demelier  <markand@malikania.fr>
2963         * CMakeLists.txt: Specify `RUNTIME DESTINATION'.
2965         This is needed for DLL builds.
2967 2018-10-07  Werner Lemberg  <wl@gnu.org>
2969         A missing Unicode cmap is not a fatal error.
2971         This is a follow-up to the previous commit.
2973         * src/cff/cffobjs.c (cff_face_init), src/sfnt/sfobjs.c
2974         (sfnt_load_face), src/type1/t1objs.c (T1_Face_Init),
2975         src/type42/t42objs.c (T42_Face_Init): Implement it.
2977 2018-10-07  Werner Lemberg  <wl@gnu.org>
2979         Fix handling of FT_CONFIG_OPTION_ADOBE_GLYPH_LIST (#54794).
2981         * src/cff/cffcmap.c (cff_cmap_unicode_init), src/psaux/t1cmap.c
2982         (t1_cmap_unicode_init), src/sfnt/ttcmap.c (tt_cmap_unicode_init):
2983         Check `unicodes_init' field.
2985 2018-10-03  Werner Lemberg  <wl@gnu.org>
2987         [ftgrays] Fix typo in stand-alone mode (#54771).
2989         * src/smooth/ftgrays.c (FT_THROW) [STANDALONE_ &&
2990         FT_DEBUG_LEVEL_TRACE]: Fix call to `FT_ERR_CAT'.
2992 2018-10-02  Werner Lemberg  <wl@gnu.org>
2994         [psaux] Fix segfault.
2996         Reported as
2998           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10768
3000         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
3001         <cff_op_callothersubr> [CFF_CONFIG_OPTION_OLD_ENGINE]: Check
3002         argument.
3004 2018-10-02  Werner Lemberg  <wl@gnu.org>
3006         [psaux] Fix numeric overflow.
3008         Reported as
3010           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10740
3012         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_roll>
3013         [CFF_CONFIG_OPTION_OLD_ENGINE]: Use NEG_INT.
3015 2018-10-02  Werner Lemberg  <wl@gnu.org>
3017         [pshinter] Handle numeric overflow.
3019         Reported as
3021           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10550
3023         * src/pshinter/pshglob.c (psh_blues_snap_stem): Mask numeric
3024         overflow.
3026 2018-09-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
3028         Align FreeType with standard C memory management.
3030         * include/freetype/ftsystem.h: Include FT_TYPES_H.
3031         (*FT_Alloc_Func, *FT_Realloc_Func): Use size_t for the size arguments.
3032         * src/raster/ftmisc.h: Ditto.
3034         * builds/amiga/src/base/ftsystem.c, builds/unix/ftsystem.c,
3035         * builds/vms/ftsystem.c, src/base/ftsystem.c (ft_alloc, ft_realloc):
3036         Use size_t for the size arguments.
3038         * src/base/ftdbgmem.c (ft_mem_debug_alloc, ft_mem_debug_realloc): Use
3039         FT_Offset, aka size_t, for the size arguments.
3041 2018-09-25  Werner Lemberg  <wl@gnu.org>
3043         Fix handling of `FT_Bool'.
3045         Before this commit we had code like
3047           (FT_Bool)( globals->glyph_styles[gindex] & 0x8000)
3049         Since `FT_Bool' is defined to be an `unsigned char', the code
3050         evaluated to something like
3052           (unsigned char)( 0x8532 & 0x8000)
3054         which in turn expanded to
3056           (unsigned char)( 0x8000)
3058         and finally yielded 0x00 â€“ i.e., false â€“ not as expected.
3060         Problem reported and analyzed by Tony Smith <tony.smith@macro4.com>.
3062         * include/freetype/fttypes.h (FT_BOOL): Add a comparison against
3063         zero so that we always have a Boolean expression.
3065         */*: Replace castings to `FT_Bool' with calls to `FT_BOOL' where
3066         possible.
3068 2018-09-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
3070         [bdf] Speed up charmap access.
3072         This makes FT_Get_Char_Index and FT_Get_Next_Char 4-5 times faster.
3074         * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Help binary search
3075         with continuous prediction.
3077 2018-09-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
3079         * src/base/ftobjs.c (ft_glyphslot_preset_bimap): Another tweak.
3081         This one should be clearer. When the rounded monochrome bbox collapses
3082         we add a pixel that covers most if not all original cbox.
3084 2018-09-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
3086         * src/base/ftobjs.c (ft_glyphslot_preset_bimap): Further tweak.
3088 2018-09-21  Ben Wagner  <bungeman@google.com>
3090         Improve auto-hinter handling of bitmap fonts (#54681).
3092         For bitmap fonts, `FT_Load_Glyph' should either return an error or
3093         not set the format to `FT_GLYPH_FORMAT_OUTLINE'.  However, in this
3094         case `FT_Load_Glyph' calls into the auto-hinter which calls back
3095         into `FT_Load_Glyph' with `FT_LOAD_NO_SCALE' in the flags, which
3096         marks the glyph as `FT_GLYPH_FORMAT_OUTLINE' with an empty path
3097         (even though it doesn't have any path).  It appears that the
3098         auto-hinter should not be called when the face doesn't have
3099         outlines.  The current test for using the auto-hinter in
3100         `FT_Load_Glyph' checks whether the driver supports scalable
3101         outlines, but not if the face supports scalable outlines.
3103         * src/base/ftobjs.c (FT_Load_Glyph): Directly check whether we have
3104         scalable outlines.
3106 2018-09-21  Werner Lemberg  <wl@gnu.org>
3108         [raster] Fix disappearing vertical lines (#54589).
3110         * src/raster/ftraster.c (Vertical_Sweep_Span): Handle special case
3111         where both left and right outline exactly pass pixel centers.
3113 2018-09-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
3115         * src/base/ftobjs.c (ft_glyphslot_preset_bimap): Tiny rounding tweak.
3117         This adds pixels in case a contour goes through the center
3118         and they need to be turned on in the b/w rasterizer.
3120 2018-09-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
3122         [pcf] Replace charmap implementation.
3124         PCF comes with charmap lookup table, aka PCF encodings.  Using it
3125         directly makes FT_Get_Char_Index and FT_Get_Next_Char 4-5 times
3126         faster than the original BDF-like binary searches.
3128         * src/pcf/pcf.h (PCF_EncodingRec): Removed.
3129         (PCF_FaceRec): Remove `nencodings' and `encodings'.
3130         * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Replaced.
3131         * src/pcf/pcfread.c (pcf_get_encodings): Store data differently.
3133 2018-09-20  Werner Lemberg  <wl@gnu.org>
3135         [base] Remove unused function `FT_GlyphLoader_CopyPoints'.
3137         * include/freetype/internal/ftgloadr.h, src/base/ftgloadr.c
3138         (FT_GlyphLoader_CopyPoints): Do it.
3140 2018-09-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
3142         [pcf] Prepare to replace charmap implementation.
3144         * src/pcf/pcf.h (PCF_FaceRec): Updated to include...
3145         (PCF_EncRec): ... this new structure to store charmap geometry.
3147         * src/pcf/pcfread.c (pcf_get_encodings): Store charmap geometry.
3149 2018-09-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
3151         Remove unused fields.
3153         * src/pcf.h (PCF_FaceRec): Remove `charmap' and `charmap_handle'.
3154         * src/bdfdrvr.h (BDF_FaceRec): Ditto.
3155         * src/winfonts/winfnt.h (FNT_FaceRec): Ditto.
3157 2018-09-17  Werner Lemberg  <wl@gnu.org>
3159         [pshinter] Handle numeric overflow.
3161         Reported as
3163           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10396
3165         * src/pshinter/pshglob.c: Include FT_INTERNAL_CALC_H.
3166         (psh_blues_snap_stem): Mask numeric overflow.
3168 2018-09-13  Werner Lemberg  <wl@gnu.org>
3170         [truetype] Some fixes for VF checks.
3172         Reported as
3174           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10317
3176         * src/truetype/ttgxvar.c (ft_var_load_gvar): Properly exit memory
3177         frame if we have invalid glyph variation data offsets.
3178         (tt_face_vary_cvt): Protect against missing `tuplecoords' array.
3179         Fix typo.
3181 2018-09-13  Werner Lemberg  <wl@gnu.org>
3183         * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Fix last commit.
3185 2018-09-13  Werner Lemberg  <wl@gnu.org>
3187         * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Check `result'.
3189         Reported as
3191           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10316
3193 2018-09-12  John Tytgat  <John.Tytgat@esko.com>
3195         [sfnt] Better PS name handling (#54629).
3197         * src/sfnt/sfdriver (IS_WIN, IS_APPLE): Omit language ID checks.
3198         (get_win_string, get_apple_string): Return NULL when the PostScript
3199         font name characters is not according to specification.
3200         (get_win_string): Make trace output work if the high byte if
3201         non-zero.
3202         (sfnt_get_var_ps_name, sfnt_get_ps_name): Previously we preferred
3203         Win PS name (when there is also an Apple PS name); change this into
3204         a fallback to Apple PS name in case the Win PS name is invalid.
3206 2018-09-12  Werner Lemberg  <wl@gnu.org>
3208         [truetype] Improve VF check.
3210         Triggered by
3212           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10255
3214         * src/truetype/ttgxvar.c (ft_var_load_gvar): Use better limit check
3215         for `tupleCount'.
3217 2018-09-12  Werner Lemberg  <wl@gnu.org>
3219         * src/truetype/ttgxvar.c (ft_var_load_gvar): Check `glyphoffsets'.
3221 2018-09-10  Armin Hasitzka  <prince.cherusker@gmail.com>
3223         * src/pshinter/pshrec.c (t2_hints_stems): Mask numeric overflow.
3225         Reported as
3227           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10215
3229 2018-09-09  Ben Wagner  <bungeman@google.com>
3231         * builds/freetype.mk (refdoc-venv): Ensure python version (#54631).
3233 2018-09-07  Werner Lemberg  <wl@gnu.org>
3235         [truetype] Fix assertion failure.
3237         Triggered by
3239           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10212
3241         * src/truetype/ttgload.c (load_truetype_glyph): Reintroduce
3242         `opened_frame' (removed in a change from 2018-08-26) to handle
3243         deallocation of the second frame.
3245 2018-09-05  Werner Lemberg  <wl@gnu.org>
3247         Synchronize `ftdebug.c' files.
3249         * builds/amiga/src/base/ftdebug.c, builds/wince/ftdebug.c,
3250         builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c'.
3252 2018-09-05  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3254         Add documentation guidelines file.
3256         * docs/DOCGUIDE: New file.
3258 2018-09-04  Werner Lemberg  <wl@gnu.org>
3260         * devel/ftoption.h: Synchronize with master `ftoption.h'.
3262 2018-09-03  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3264         [docwriter] Don't break code snippets accross lines.
3266         Reported as
3268           https://lists.nongnu.org/archive/html/freetype-devel/2018-08/msg00124.html
3270         * docs/reference/markdown/stylesheets/extra.css (.md-typeset code):
3271         Add rule `white-space'.
3273 2018-09-03  Werner Lemberg  <wl@gnu.org>
3275         */*: s/PSNames/psnames/.
3277         Only tracing messages are affected.
3279 2018-09-03  Werner Lemberg  <wl@gnu.org>
3281         [sfnt] Fix heap buffer overflow in CPAL handling.
3283         * src/sfnt/ttcpal.c (tt_face_palette_set): Fix boundary test.
3284         (tt_face_load_cpal): Updated.
3286 2018-09-01  Werner Lemberg  <wl@gnu.org>
3288         Remove `FT_Outline_{New,Done}_Internal'.
3290         These public API functions(!) were always undocumented and have
3291         escaped all clean-up efforts until now.
3293         * include/freetype/ftoutln.h (FT_Outline_New_Internal,
3294         FT_Outline_Done_Internal): Removed.
3296         * src/base/ftoutln.h (FT_Outline_New_Internal,
3297         FT_Outline_Done_Internal): Merge into...
3298         (FT_Outline_New, FT_Outline_Done): ... these functions.
3300         * docs/README: Updated.
3302 2018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
3304         * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Check glyph format.
3306 2018-08-31  Armin Hasitzka  <prince.cherusker@gmail.com>
3308         [errors] Refine the macro logic surrounding `FT_Error_String'.
3310         * include/freetype/fterrors.h (FT_INCLUDE_ERR_PROTOS,
3311         FT_ERR_PROTOS_DEFINED): Undefine `FT_INCLUDE_ERR_PROTOS' after
3312         checking it and introduce a new macro that takes proper care of
3313         multiple-inclusion protection.
3315 2018-08-31  Werner Lemberg  <wl@gnu.org>
3317         * src/base/ftdebug.c (FT_Throw): Restore missing `FT_UNUSED' calls.
3319 2018-08-31  Werner Lemberg  <wl@gnu.org>
3321         * src/base/ftdebug.c (FT_Throw): Reduce chattiness.
3323 2018-08-31  Werner Lemberg  <wl@gnu.org>
3325         * src/autofit/afhints.c (af_glyph_hints_reload): Add initialization.
3327 2018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
3329         Consolidate bitmap presetting and size assessment.
3331         * include/freetype/internal/ftobjs.h (ft_glyphslot_preset_bitmap):
3332         Change return type.
3333         * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Return the bitmap
3334         size assessment.
3336         * src/raster/ftrend1.c (ft_raster1_render): Use it to refuse the
3337         rendering of enourmous or far-fetched outlines.
3338         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
3340 2018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
3342         * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Correct mono.
3344 2018-08-30  Armin Hasitzka  <prince.cherusker@gmail.com>
3346         [errors] Introduce a macro to control `FT_Error_String'.
3348         * devel/ftoption.h (FT_CONFIG_OPTION_ERROR_STRINGS),
3349         include/freetype/config/ftoption.h (FT_CONFIG_OPTION_ERROR_STRINGS):
3350         New macro.
3352 2018-08-30  Armin Hasitzka  <prince.cherusker@gmail.com>
3354         [errors] Introduce `FT_Error_String'.
3356         * include/freetype/fterrors.h (FT_Error_String),
3357         src/base/fterrors.c (FT_Error_String): Implement `FT_Error_String'.
3359         * src/base/ftbase.c, src/base/Jamfile (_source),
3360         src/base/rules.mk (BASE_SRC): Add `fterrors.c' to the build logic.
3362         * src/base/ftdebug.c (FT_Throw): Use `FT_Error_String'.
3364 2018-08-30  Werner Lemberg  <wl@gnu.org>
3366         [autofit] Trace `before' and `after' edges of strong points.
3368         * src/autofit/afhints.h (AF_PointRec) [FT_DEBUG_AUTOFIT]: New arrays
3369         `before' and `after'.
3371         * src/autofit/afhints.c (af_get_strong_edge_index): New auxiliary
3372         function.
3373         (af_glyph_hints_dump_points): Trace `before' and `after' edges.
3374         (af_glyph_hints_align_strong_points) [FT_DEBUG_AUTOFIT]: Set
3375         `before' and `after' information.
3377 2018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
3379         [base] Overflow-resistant bitmap presetting.
3381         * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Implement it.
3383 2018-08-29  Armin Hasitzka  <prince.cherusker@gmail.com>
3385         Fix numeric overflows.
3387         * src/pshint/pshalgo.c (psh_hint_align, psh_hint_align_light,
3388         psh_hint_table_find_strong_points): Fix numeric overflows.
3390         Reported as
3392           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10083
3394 2018-08-29  Werner Lemberg  <wl@gnu.org>
3396         [cff] Fix handling of `roll' op in old engine.
3398         Reported as
3400           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10080
3402         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_roll>
3403         [CFF_CONFIG_OPTION_OLD_ENGINE]: Use modulo for loop count, as
3404         documented in the specification.
3406 2018-08-26  Werner Lemberg  <wl@gnu.org>
3408         * src/truetype/ttobjs.c (tt_size_read_bytecode): Trace CVT values.
3410 2018-08-26  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3412         * configure: Copy assets required by docwriter.
3414         Copy directory `docs/reference/markdown' when FreeType is compiled in a
3415         different directory.
3417         Fixes `make refdoc' if builddir != srcdir.
3419         Reported as
3421           https://lists.nongnu.org/archive/html/freetype-devel/2018-08/msg00083.html
3423 2018-08-26  Werner Lemberg  <wl@gnu.org>
3425         * src/pshint/pshalgo.c (psh_hint_overlap): Fix numeric overflow.
3427         Reported as
3429           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10057
3431 2018-08-26  Werner Lemberg  <wl@gnu.org>
3433         Minor tracing adjustments.
3435         * src/base/ftstream.c (FT_Stream_EnterFrame, FT_Stream_ExitFrame):
3436         Trace.
3438         * src/truetype/ttgload.c (TT_Access_Glyph_Frame): Remove tracing.
3440 2018-08-26  Werner Lemberg  <wl@gnu.org>
3442         [truetype] Avoid nested frames.
3444         Triggered by
3446           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10054
3448         * src/truetype/ttgload.c (load_truetype_glyph): Don't use variable
3449         `opened_frame' to trace whether a frame must be closed at the end of
3450         function: This fails because `TT_Vary_Apply_Glyph_Deltas' (which
3451         gets called for space glyphs) uses a frame by itself.  Instead,
3452         close the frame after loading the header, then use another frame for
3453         the remaining part of the glyph later on.
3455         Also avoid calling `tt_get_metrics' twice under some circumstances.
3457 2018-08-26  Werner Lemberg  <wl@gnu.org>
3459         Various minor clean-ups.
3461         * src/base/ftapi.c: Remove.  Unused.
3462         * src/base/Jamfile (_sources): Updated.
3464         * src/base/ftstream.c (FT_Stream_ReleaseFrame): Remove redundant
3465         code.
3467 2018-08-25  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3469         Convert documentation markup to Markdown.
3471         It is the result of a GSoC 2018 project; this separate ChangeLog
3472         commit covers the last four commits
3474           ae5d1a4cec37557f31aec270332cfe886a62f9a0
3475           53c69ce04faed3dcc68ca0f54cb8d703d8babf69
3476           195728d5ba38f34fb2c2c20807c01656f2f59b66
3477           c962db28ea59225f0105c03d907d4a9b71765687
3479         * docs/reference/markdown/images/favico.ico,
3480         docs/reference/markdown/javascripts/extra.js,
3481         docs/reference/markdown/stylesheets/extra.css: New files.
3483         * docs/reference/.gitignore, docs/reference/README: Updated.
3485         * src/tools/docmaker/*: Removed.  It has been replaced with
3486         `docwriter', a python package available at
3488           https://pypi.org/project/docwriter/
3490         * Jamfile: Updated.
3491         * builds/ansi/ansi-def.mk, builds/beos/beos-def.mk,
3492         builds/dos/dos-def.mk, builds/os2/os2-def.mk (BIN),
3493         builds/unix/unixddef.mk, builds/windows/win32-def.mk: New variable.
3495         * builds/unix/configure.raw: Check for `python' and `pip'.
3496         If not present, warn that `make refdoc' will fail.
3497         * builds/unix/unix-def.in (PYTHON, PIP, BIN): New variables.
3499         * builds/freetype.mk (PYTHON, PIP, VENV_NAME, VENV_DIR, ENV_PYTHON,
3500         ENV_PIP): New variables.
3501         (refdoc): Updated.
3502         (refdoc-venv): New target.
3503         (.PHONY): Updated.
3505 2018-08-23  Werner Lemberg  <wl@gnu.org>
3507         Add macros for handling over-/underflowing `FT_Int64' values.
3509         * include/freetype/internal/ftcalc.h (ADD_INT64, SUB_INT64,
3510         MUL_INT64, DIV_INT64) [FT_LONG64]: New macros.
3512         * src/base/ftcalc.c (ft_corner_orientation) [FT_LONG64]: Use
3513         `SUB_INT64' and `MUL_INT64'.
3515         Reported as
3517           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10028
3519 2018-08-22  Werner Lemberg  <wl@gnu.org>
3521         [truetype] Improve legibility of `glyf' parsing.
3523         * src/truetype/ttgload.c (ON_CURVE_POINT, X_SHORT_VECTOR,
3524         Y_SHORT_VECTOR, REPEAT_FLAG, X_POSITIVE, SAME_X, Y_POSITIVE, SAME_Y,
3525         OVERLAP_SIMPLE): New macros.
3526         (TT_Load_Simple_Glyph): Use new macros to make code more readable.
3527         Remove useless adjustment of `outline->tags' elements.
3529 2018-08-21  Werner Lemberg  <wl@gnu.org>
3531         * src/sfnt/ttcpal.c (tt_face_load_cpal): Add missing safety check.
3533         Reported as
3535           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9981
3537 2018-08-18  Werner Lemberg  <wl@gnu.org>
3539         [psaux] Avoid slow PS font parsing in case of error.
3541         Reported as
3543           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9955
3545         * src/psaux/psobjs.c (ps_parser_to_bytes): Set `parser->cursor' even
3546         in case of error to avoid potential re-scanning.
3548 2018-08-18  Werner Lemberg  <wl@gnu.org>
3550         [cff] Fix heap buffer overflow in old engine.
3552         Reported as
3554           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9967
3556         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
3557         <cff_op_blend> [CFF_CONFIG_OPTION_OLD_ENGINE]: `num_designs' must be
3558         non-zero.
3560 2018-08-16  Young Xiao  <yangx92@hotmail.com>
3562         * builds/mac/ftmac.c (parse_fond): Fix buffer overrun.
3564         Reported as bug #54515, duplicate of #43540.
3566 2018-08-16  Werner Lemberg  <wl@gnu.org>
3568         * builds/*/ftsystem.c (FT_COMPONENT): Updated also.
3570 2018-08-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
3572         [bdf] Don't track duplicate encodings.
3574         There is no harm except some umbiguity in broken fonts with duplicate
3575         encodings.
3577         * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove duplicate tracking.
3578         (_bdf_parse_t): Remove large `have' bitfield.
3580 2018-08-15  Werner Lemberg  <wl@gnu.org>
3582         Don't use `trace_' prefix for FT_COMPONENT arguments.
3584         * include/freetype/internal/ftdebug.h (FT_TRACE_COMP,
3585         FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix.
3586         (FT_TRACE): Use `FT_TRACE_COMP'.
3588         */* (FT_COMPONENT): Updated.
3590 2018-08-14  Werner Lemberg  <wl@gnu.org>
3592         Use formatting string in FT_TRACEX calls for non-simple arguments.
3594         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
3595         <cff_op_hstem, cff_op_hintmask, cff_op_hlineto, cff_op_vhcurveto>:
3596         Do it.
3598         * src/psaux/pshints.c (cf2_hintmap_build): Ditto.
3600         * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
3601         cf2_cmdVSTEM, cf2_cmdHLINETO, cf2_cmdRRCURVETO, cf2_cmdCALLSUBR,
3602         cf2_escHSTEM3, cf2_cmdHINTMASK, cf2_cmdHVCURVETO>: Ditto.
3604         * src/truetype/ttinterp.c (TT_RunIns): Ditto.
3606 2018-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
3608         [bdf] Remove unused fields.
3610         * src/bdf/bdf.h (bdf_font_t): Remove `nmod', `umod', and `modified',
3611         which were set but never used.
3612         * src/bdf/bdflib.c (_bdf_parse_{glyphs,properties}, bdf_load_font):
3613         Updated accordingly.
3615 2018-08-14  Werner Lemberg  <wl@gnu.org>
3617         [cff] Fix another segv in old engine.
3619         Reported as
3621           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9872
3623         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
3624         [CFF_CONFIG_OPTION_OLD_ENGINE]: Disallow invalid T1 opcodes in
3625         dictionaries.
3627 2018-08-14  Werner Lemberg  <wl@gnu.org>
3629         [cff] Fix missing error handling.
3631         Reported as
3633           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9865
3635         * src/psaux/cffparse.c (cff_parser_run)
3636         [CFF_CONFIG_OPTION_OLD_ENGINE]: Don't ignore return value of
3637         `parse_charstrings_old'.
3639 2018-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
3641         [bdf] Remove unused overflow storage.
3643         * src/bdf/bdf.h (bdf_glyphlist_t): Remove this type.
3644         (bdf_font_t): Remove `overflow' field.
3645         * src/bdf/bdflib.c (bdf_free_font): Remove `overflow' freeing.
3647 2018-08-14  Werner Lemberg  <wl@gnu.org>
3649         [cff] Fix segv in old engine.
3651         Reported as
3653           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9864
3655         * src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
3656         <cff_op_random> [CFF_CONFIG_OPTION_OLD_ENGINE]: Use top dict's
3657         `random' field directly if parsing dictionaries.
3659 2018-08-13  Alexei Podtelezhnikov  <apodtele@gmail.com>
3661         [bdf] Use unsigned types.
3663         * src/bdf/bdf.h (bdf_glyph_t): Unsign `encoding'.
3664         (bdf_font_t): Unsign `default_char'.
3665         * src/bdf/bdfdrivr.h (BDF_encoding_el): Unsign `enc'.
3667         * src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_glyphs,
3668         _bdf_parse_start): Updated accordingly.
3669         * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Ditto.
3671 2018-08-13  Werner Lemberg  <wl@gnu.org>
3673         * src/type42/t42parse.c (t42_parse_sfnts): One more format check.
3675         Reported as
3677           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9832
3679 2018-08-11  Werner Lemberg  <wl@gnu.org>
3681         * src/base/ftcalc.c (FT_Matrix_Check): Fix integer overflow.
3683         Reported as
3685           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9811
3687 2018-08-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
3689         * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Follow specs.
3691 2018-08-10  Ben Wagner  <bungeman@google.com>
3693         * src/sfnt/sfobjs.c (sfnt_done_face): Fix memory leak (#54435).
3695 2018-08-10  Werner Lemberg  <wl@gnu.org>
3697         * src/base/ftobjs.c (FT_Render_Glyph_Internal): Improve tracing.
3699 2018-08-10  Werner Lemberg  <wl@gnu.org>
3701         Fix clang warnings.
3703         * src/base/ftdebug.c (ft_trace_level_enabled,
3704         ft_trace_level_disabled): Add `static' keyword.
3706 2018-08-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
3708         [raster, smooth] Reinstate bitmap size limits.
3710         This again moves outline and bitmap size checks one level up.
3712         * src/base/ftoutln.c (FT_Outline_Render): Explicitly reject enormous
3713         outlines.
3714         * src/raster/ftrend1.c (ft_raster1_render): Reject enormous bitmaps
3715         and, therefore, outlines that require them.
3716         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
3718         * src/raster/ftraster.c (ft_black_render): Remove outline size checks.
3719         * src/smooth/ftgrays.c (gray_raster_render): Ditto.
3720         [STANDALONE]: Remove `FT_Outline_Get_CBox' copy.
3722 2018-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
3724         [pcf] Revert massive unsigning.
3726 2018-08-08  Werner Lemberg  <wl@gnu.org>
3728         [smooth] Improve tracing.
3730         * src/smooth/ftgrays.c (gray_convert_glyph_inner): Only use tracing
3731         if called the first time.
3732         (gray_convert_glyph): Updated.
3734 2018-08-08  Werner Lemberg  <wl@gnu.org>
3736         Add internal functions `FT_Trace_Disable' and `FT_Trace_Enable'.
3738         It sometimes makes sense to suppress tracing informations, for
3739         example, if it outputs identical messages again and again.
3741         * include/freetype/internal/ftdebug.h: Make `ft_trace_levels' a
3742         pointer.
3743         (FT_Trace_Disable, FT_Trace_Enable): New declarations.
3745         * src/base/ftdebug.c (ft_trace_levels): Rename to...
3746         (ft_trace_levels_enabled): ... this.
3747         (ft_trace_levels_disabled): New array.
3748         (ft_trace_levels): New pointer.
3749         (FT_Trace_Disable, FT_Trace_Enable): Implement.
3750         (ft_debug_init): Updated.
3752 2018-08-08  Werner Lemberg  <wl@gnu.org>
3754         Debugging improvements.
3756         * src/base/ftobjs.c (pixel_modes): Move this array to top level
3757         from ...
3758         (FT_Load_Glyph): ... here.
3759         (FT_Render_Glyph_Internal): Use `width' x `height' in trace message.
3760         Use `pixel_modes'.
3762 2018-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
3764         [pcf] Massive unsigning (part 2).
3766         Treat all size related properties as unsigned values.
3768         * src/pcf/pcf.h (PCF_ParsePropertyRec): Use unsigned `name' and
3769         `value'.
3770         * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font): Updated
3771         parsing code and handling of AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE,
3772         RESOLUTION_X and RESOLUTION_Y.
3774 2018-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
3776         [pcf] Massive unsigning (part 1).
3778         Unofficial specifications hesitate to use unsigned 32-bit integers.
3779         Negative values caused a lot of trouble in the past and it is safer
3780         and easier to treat some properties as unsigned.
3782         * src/pcf/pcf.h (PCF_AccelRec): Use unsigned values for `fontAscent',
3783         `fontDescent', and `maxOverlap'.
3784         * src/pcf/pcfread.c (pcf_load_font, pcf_get_accel): Updated.
3785         * src/pcf/pcfdrivr.c (PCF_Glyph_Load, PCF_Size_Select,
3786         PCF_Size_Request): Updated.
3788 2018-08-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
3790         * src/pcf/pcfread.c (pcf_get_bitmaps): Unsign `offsets' and
3791         `bitmapSizes'.
3793 2018-08-06  Werner Lemberg  <wl@gnu.org>
3795         * devel/ftoption.h: Synchronize with main `ftoption.h'.
3797 2018-08-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
3799         [pcf] Use unsigned types.
3801         * src/pcf/pcf.h (PCF_Encoding): Use unsigned `enc'.
3802         * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Ditto.
3803         * src/pcf/pcfread.c (pcf_get_encodings): Use unsigned types.
3805 2018-08-05  Werner Lemberg  <wl@gnu.org>
3807         * src/truetype/ttgload.c (compute_glyph_metrics): Fix overflow.
3809         Reported as
3811           https://bugs.chromium.org/p/chromium/issues/detail?id=777151
3813 2018-08-04  Werner Lemberg  <wl@gnu.org>
3815         * src/truetype/ttinterp.c (opcode_name): Fix typos.
3817 2018-08-04  Werner Lemberg  <wl@gnu.org>
3819         Fix clang warnings.
3821         * src/base/ftoutln.c (FT_Outline_EmboldenXY): Fix type of
3822         `orientation'.
3824         * src/gxvalid/gxvcommn.c (gx_lookup_value_read): Fix signature.
3826         * src/pcf/pcfread.c (pcf_get_encodings): Fix type of some variables.
3827         Add cast.
3829         * src/type1/t1load.c (parse_weight_vector): Fix cast.
3831 2018-07-31  Werner Lemberg  <wl@gnu.org>
3833         * src/cid/cidtoken.h: Handle `XUID' keyword.
3835 2018-07-31  Werner Lemberg  <wl@gnu.org>
3837         [cid] Trace PostScript dictionaries.
3839         * src/cid/cidload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
3840         (cid_load_keyword, cid_parse_font_matrix, parse_fd_array,
3841         parse_expansion_factor, cid_parse_dict): Add tracing calls.
3842         (parse_font_name): New function to trace `/FontName' keywords in
3843         /FDArray dict.
3844         (cid_field_records): Register `parse_font_name'.
3846 2018-07-30  Werner Lemberg  <wl@gnu.org>
3848         [cff] Fix typo.
3850         Reported as
3852           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9409
3854         * src/cff/cffdrivr.c (cff_get_cid_from_glyph_index): Fix boundary
3855         check.
3857 2018-07-29  Werner Lemberg  <wl@gnu.org>
3859         * src/pcf/pcfread.c (pcf_get_encodings): Another thinko.
3861         Reported as
3863           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9608
3865 2018-07-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
3867         [smooth] Fix Harmony memory management.
3869         Reported as
3871           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9501
3873         * src/smooth/ftgrays.c (ft_smooth_render_generic): Restore buffer
3874         after each rendering in case of failure.
3876 2018-07-28  Werner Lemberg  <wl@gnu.org>
3878         [type1] Avoid segfaults with `FT_Get_PS_Font_Value'.
3880         Reported as
3882           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9610
3884         * src/type1/t1driver.c (t1_ps_get_font_value): Protect against NULL.
3886 2018-07-27  Werner Lemberg  <wl@gnu.org>
3888         [truetype] Make `TT_Set_MM_Blend' idempotent (#54388).
3890         * src/truetype/ttgxvar.c (tt_set_mm_blend): Correctly set
3891         `face->doblend' if the current call to the function yields the same
3892         blend coordinates as the previous call.
3894 2018-07-27  Werner Lemberg  <wl@gnu.org>
3896         [psaux, type1]: More tracing improvements.
3898         * src/psaux/psintrp.c (cf2_interpT2CharString): Trace skipped
3899         outline commands.
3901         * src/psaux/t1decode.c (t1_decoder_parse_charstring): Fix
3902         missing case.
3903         (t1_decoder_parse_metrics): Make tracing output more compact.
3905         * src/type1/t1gload.c (T1_Compute_Max_Advance): Be less verbose.
3906         (T1_Get_Advances): Add tracing.
3908 2018-07-25  Werner Lemberg  <wl@gnu.org>
3910         [psaux, type1] Trace PostScript dictionaries and other things.
3912         The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary
3913         right now.
3915         * src/psaux/psobjs.c (ps_parser_load_field,
3916         ps_parser_load_field_table): Add tracing calls.
3918         * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing
3919         output more compact.
3921         * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add
3922         tracing messages.
3924         * src/type1/t1load.c (parse_blend_axis_types,
3925         parse_blend_design_positions, parse_blend_design_map,
3926         parse_weight_vector, t1_load_keyword, t1_parse_font_matrix,
3927         parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add
3928         tracing calls.
3930         * src/type1/t1objs.c (T1_Face_Init): Add tracing call.
3932         * src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more
3933         verbose.
3935 2018-07-25  Werner Lemberg  <wl@gnu.org>
3937         Fix minor ASAN run-time warnings.
3939         * src/base/ftutil.c (ft_mem_alloc, ft_mem_realloc): Only call
3940         `FT_MEM_ZERO' if we actually have a buffer.
3941         (ft_mem_dup): Only call `ft_memcpy' if we actually have a buffer.
3943 2018-07-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
3945         [build] Fortify dllexport/dllimport attributes (#53969,#54330).
3947         We no longer use predefined _DLL, which can be defined for static
3948         builds too with /MD. We use DLL_EXPORT and DLL_IMPORT instead,
3949         following libtool convention.
3951         * CMakeLists.txt [WIN32], builds/windows/vc2010/freetype.vcxproj:
3952         Define DLL_EXPORT manually.
3954         * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in,
3955         builds/vms/ftconfig.h, builds/windows/vc2010/index.html,
3956         src/base/ftver.rc: /_DLL/d, s/FT2_DLLIMPORT/DLL_IMPORT/.
3958 2018-07-24  Werner Lemberg  <wl@gnu.org>
3960         [type1] Check relationship between number of axes and designs.
3962         For Multiple Masters fonts we don't support intermediate designs;
3963         this implies that
3965           number_of_designs == 2 ^^ number_of_axes
3967         Reported as
3969           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9557
3971         * src/type1/t1load.c (T1_Open_Face): Ensure above constraint.
3972         (T1_Get_MM_Var): Remove now redundant test.
3974 2018-07-24  Hin-Tak Leung  <htl10@users.sourceforge.net>
3976         [truetype] Match ttdebug's naming of instruction mnemonics.
3978         * src/truetype/ttinterp.c: The form used in ttdebug,
3979         "MDRP[G,B,W,?]", etc., is slightly more readable than
3980         "MDRP[00,01,02,03]".
3982 2018-07-24  Werner Lemberg  <wl@gnu.org>
3984         * src/pcf/pcfread.c (pcf_get_encodings): Thinko.
3986         Reported as
3988           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9561
3990 2018-07-22  Werner Lemberg  <wl@gnu.org>
3992         * src/pcf/pcfread.c (pcf_get_encodings): Check index of defaultChar.
3994         Reported as
3996           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9527
3998 2018-07-22  Werner Lemberg  <wl@gnu.org>
4000         * src/pcf/pcfread.c (pcf_load_font): Fix number of glyphs.
4002         This is an oversight of the module change 2018-07-21.
4004         Reported as
4006           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9524
4008 2018-07-22  Werner Lemberg  <wl@gnu.org>
4010         [cid] Sanitize `BlueShift' and `BlueFuzz'.
4012         This code is taken from the type1 module.
4014         Reported as
4016           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9510
4018         * src/cid/cidload.c (parse_fd_array): Set some private dict default
4019         values.
4020         (cid_face_open): Do the sanitizing.
4021         Fix some tracing messages.
4023 2018-07-21  Werner Lemberg  <wl@gnu.org>
4025         [pcf] Fix handling of the undefined glyph.
4027         This change makes the driver use the `defaultChar' property of PCF
4028         files.
4030         * src/pcf/pcf.h (PCF_FaceRec): Change type of `defaultChar' to
4031         unsigned.
4033         * src/pcf/pcfread.c (pcf_get_encodings): Read `defaultChar' as
4034         unsigned.
4035         Validate `defaultChar'.
4036         If `defaultChar' doesn't point to glyph index zero, swap glyphs with
4037         index zero and index `defaultChar' and adjust the encodings
4038         accordingly.
4040         * src/pcf/pcfdrivr.c (pcf_cmap_char_index, pcf_cmap_char_next,
4041         PCF_Glyph_Load): Undo change from 2002-06-16 which always enforced
4042         the first character in the font to be the default character.
4044 2018-07-20  Armin Hasitzka  <prince.cherusker@gmail.com>
4046         Move the legacy fuzz target to the `freetype-testing' repository.
4048         It can now be found at
4050           https://github.com/freetype/freetype2-testing/tree/master/fuzzing/src/legacy
4052         * src/tools/ftfuzzer: Remove this folder and its contents from the
4053         repository.
4055 2018-07-20  Werner Lemberg  <wl@gnu.org>
4057         [cff] Avoid left-shift of negative numbers (#54322).
4059         * src/cff/cffgload.c (cff_slot_load): Use multiplication.
4061 2018-07-17  Werner Lemberg  <wl@gnu.org>
4063         Allow FT_ENCODING_NONE for `FT_Select_Charmap'.
4065         This is a valid encoding tag for BDF, PCF, and Windows FNT, and
4066         there is no reason to disallow it for these formats.
4068         * src/base/ftobjs.c (FT_Select_Charmap): Implement it.
4070 2018-07-17  Werner Lemberg  <wl@gnu.org>
4072         * src/pcf/pcfread.c (pcf_get_encodings): Trace `defaultChar'.
4074 2018-07-16  Armin Hasitzka  <prince.cherusker@gmail.com>
4076         * include/freetype/internal/ftcalc.h: Add macros for handling
4077         harmless over-/underflowing `FT_Int' values.
4079         * src/sfnt/sfdriver.c (fixed2float): Fix negation of
4080         `(int)(-2147483648)'.
4082         Reported as
4084           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9423
4086 2018-07-16  Werner Lemberg  <wl@gnu.org>
4088         * src/truetype/ttgxvar.c (tt_set_mm_blend): Fix off-by-one error.
4090         Reported as
4092           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9412
4094 2018-07-12  Werner Lemberg  <wl@gnu.org>
4096         * src/base/ftoutln.c (FT_Outline_Get_Orientation): Init `cbox'.
4098         Taken from patch #9667, written by Steve Langasek
4099         <vorlon@debian.org>.
4101         This fixes a build failure (most probably a bug in gcc) on ppc64el
4102         when building with -O3.
4104 2018-07-05  Werner Lemberg  <wl@gnu.org>
4106         Fix typo (#54238).
4108         * src/base/ftcolor.c (FT_Palette_Set_Foreground_Color)
4109         [!TT_CONFIG_OPTION_COLOR_LAYERS]: Add return value.
4111 2018-07-05  Werner Lemberg  <wl@gnu.org>
4113         Adjust table size comparisons (#54242).
4115         * src/sfnt/ttcpal.c (tt_face_load_cpal): Implement it.
4117 2018-07-05  Werner Lemberg  <wl@gnu.org>
4119         Fix more 32bit issues (#54208).
4121         * src/cff/cffload.c (cff_blend_build_vector): Convert assertion into
4122         run-time error.
4124         * src/truetype/ttgxvar.c (ft_var_to_normalized): Protect against
4125         numeric overflow.
4127 2018-07-04  Werner Lemberg  <wl@gnu.org>
4129         Fix 32bit build warnings (#54239).
4131         * src/base/ftbitmap.c (FT_Bitmap_Blend): Add casts to avoid signed
4132         vs. unsigned comparisons.
4134         * srb/sfnt/ttcolr.c (tt_face_get_colr_layer): Ditto.
4136 2018-07-02  Jeff Carey  <Jeff.Carey@monotype.com>
4138         * src/psnames/psmodule.c (ps_unicodes_init): Fix alloc debugging.
4140 2018-07-02  Werner Lemberg  <wl@gnu.org>
4142         s/palette_types/palette_flags/.
4144         Suggested by Behdad.
4146 2018-07-02  Werner Lemberg  <wl@gnu.org>
4148         Make `FT_Get_Color_Glyph_Layer' return FT_Bool.
4150         * include/freetype/freetype.h, src/base/ftobjs.c
4151         (FT_Get_Color_Glyph_Layer, FT_Render_Glyph_Internal): Updated.
4153         * include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func),
4154         src/sfnt/ttcolr.h, src/sfnt/ttcolr.c (tt_face_get_colr_layer):
4155         Updated.
4157 2018-07-01  Werner Lemberg  <wl@gnu.org>
4159         * src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Guard SFNT function.
4161         Reported by Behdad.
4163 2018-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
4165         * src/base/fttrigon.c (FT_Tan): Improve accuracy.
4166         (FT_Vector_Rotate): Simplify.
4168 2018-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
4170         * src/base/ftobjs.c (FT_Set_Charmap): Robustify.
4172 2018-06-25  Werner Lemberg  <wl@gnu.org>
4174         [truetype] Fix memory leak.
4176         * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Add initializers.
4177         Fix typo in `goto' destination.
4179         Reported as
4181           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9071
4183 2018-06-25  Werner Lemberg  <wl@gnu.org>
4185         * src/truetype/ttgxvar.c (tt_face_vary_cvt): Add initializers.
4187         Reported as
4189           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9070
4191 2018-06-24  Werner Lemberg  <wl@gnu.org>
4193         [truetype] Increase precision while applying VF deltas.
4195         It turned out that we incorrectly round CVT and glyph point deltas
4196         before accumulation, leading to severe positioning errors if there
4197         are many delta values to sum up.
4199         Problem reported by Akiem Helmling <akiem@underware.nl> and analyzed
4200         by Behdad.
4202         * src/truetype/ttgxvar.c (ft_var_readpackeddelta): Return deltas in
4203         16.16 format.
4204         (tt_face_var_cvt): Collect deltas in `cvt_deltas', which is a 16.16
4205         format array, and add the accumulated values to the CVT at the end
4206         of the function.
4207         (TT_Vary_Apply_Glyph_Deltas): Store data in `points_org' and
4208         `points_out' in 16.16 format.
4209         Collect deltas in `point_deltas_x' and `point_deltas_y', which are
4210         16.16 format arrays, and add the accumulated values to the glyph
4211         coordinates at the end of the function.
4213 2018-06-24  Werner Lemberg  <wl@gnu.org>
4215         New base function `FT_Matrix_Check' (#54019).
4217         * src/base/ftcalc.c (FT_Matrix_Check): New base function to properly
4218         reject degenerate font matrices.
4220         * include/freetype/internal/ftcalc.h: Updated.
4222         * src/cff/cffparse.c (cff_parse_font_matrix), src/cid/cidload.c
4223         (cid_parse_font_matrix), src/type1/t1load.c (t1_parse_font_matrix),
4224         src/type42/t42parse.c (t42_parse_font_matrix): Use
4225         `FT_Matrix_Check'.
4227 2018-06-23  Werner Lemberg  <wl@gnu.org>
4229         Fix typo.
4231         Reported by Behdad.
4233         * src/base/ftcolor.c (FT_Palette_Data_Get)
4234         [!TT_CONFIG_OPTION_COLOR_LAYERS]: s/apalette/apalette_data/.
4236 2018-06-21  Werner Lemberg  <wl@gnu.org>
4238         s/FT_PALETTE_USABLE_WITH_/FT_PALETTE_FOR_/.
4240         * include/freetype/ftcolor.h, include/freetype/internal/sfnt.h,
4241         src/sfnt/ttcolr.c: Do it.
4243 2018-06-19  Werner Lemberg  <wl@gnu.org>
4245         [sfnt] Fix CPAL heap buffer overflow.
4247         Reported as
4249           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8968
4251         * src/sfnt/ttcpal.c (tt_face_load_cpal): Guard CPAL version 1
4252         offsets.
4254 2018-06-19  Werner Lemberg  <wl@gnu.org>
4256         Doh.  Don't use CPAL or COLR data if tables are missing.
4258         Reported by Alexei.
4260         * src/sfnt/ttcolr.c (tt_face_get_colr_layer): Return immediately if
4261         `colr' is NULL.
4263         * src/sfnt/ttcpal.c (tt_face_palette_set): Return immediately, if
4264         `cpal' is NULL.
4266 2018-06-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
4268         [base] Introduce `FT_New_Glyph'.
4270         This function facilitates access to full capabilities of FreeType
4271         rendering engine for custom glyphs. This can be quite useful for
4272         consistent rendering of mathematical and chemical formulas, e.g.
4274           https://bugs.chromium.org/p/chromium/issues/detail?id=757078
4276         * include/freetype/ftglyph.h, src/base/ftglyph.c (FT_New_Glyph): New
4277         function.
4279 2018-06-17  Armin Hasitzka  <prince.cherusker@gmail.com>
4281         [bdf] Fix underflow of an unsigned value.
4283         bdflib.c:1562 could be reached with `font->glyphs_used == 0'.  That
4284         caused an underflow of the unsigned value which results in undefined
4285         behaviour.
4287         * src/bdf/bdflib.c (_bdf_parse_glyphs): Bail out earlier than before
4288         if the `ENCODING' keyword cannot be found.
4290 2018-06-17  Werner Lemberg  <wl@gnu.org>
4292         [base] Add tracing for `FT_Bitmap_Blend'.
4294         * include/freetype/internal/fttrace.h (trace_bitmap): New
4295         enumeration.
4297         * src/base/ftbitmap.c (FT_COMPONENT): Define.
4298         (FT_Bitmap_Blend): Add `FT_TRACE5' calls.
4300 2018-06-17  Werner Lemberg  <wl@gnu.org>
4302         s/trace_bitmap/trace_checksum/.
4304         * include/freetype/internal/fttrace.h: s/bitmap/checksum/.
4306         * src/base/ftobjs.c (FT_COMPONENT): s/trace_bitmap/trace_checksum/.
4307         Adjust code.
4309 2018-06-16  Werner Lemberg  <wl@gnu.org>
4311         [sfnt] Fix color glyph layer loading.
4313         * src/sfnt/ttcolr.c (Colr): Add `table_size' field.
4314         (tt_face_load_colr): Set it.
4315         (tt_face_get_colr_layer): Check pointer limit for layer entries.
4317 2018-06-16  Werner Lemberg  <wl@gnu.org>
4319         [sfnt] Fix color palette loading.
4321         Reported as
4323           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8933
4325         * src/sfnt/ttcpal.c (Cpal): Add `table_size' field.
4326         (tt_face_load_cpal): Set it.
4327         (tt_face_palette_set): Check pointer limit for color entries.
4329 2018-06-16  Werner Lemberg  <wl@gnu.org>
4331         * src/base/ftbitmap.c (FT_Bitmap_Blend): Avoid integer overflow.
4333 2018-06-16  Werner Lemberg  <wl@gnu.org>
4335         Add `FT_Bitmap_Blend' API.
4337         Still missing: Support for negative bitmap pitch and subpixel offset
4338         of source bitmap.
4340         * include/freetype/ftbitmap.h, src/base/ftbitmap.c
4341         (FT_Bitmap_Blend): New function.
4343 2018-06-14  Werner Lemberg  <wl@gnu.org>
4345         Replace `FT_Get_GlyphLayers' with `FT_Get_Color_Glyph_Layer'.
4347         This avoids any additional allocation of COLR related structures in
4348         a glyph slot.
4350         * include/freetype/freetype.h (FT_Glyph_Layer, FT_Glyph_LayerRec,
4351         FT_Get_GlyphLayers): Removed.
4353         * include/freetype/internal/ftobjs.h (FT_Colr_InternalRec): Removed.
4354         (FT_Slot_InternalRec): Remove `color_layers'.
4356         * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func):
4357         Removed.
4358         (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Remove
4359         `load_colr_layer'.
4361         * src/base/ftobjs.c (ft_glyph_slot_done): Updated.
4362         (FT_Render_Glyph_Internal): Use `FT_Get_Color_Glyph_Layer'.
4363         (FT_Get_GlyphLayers): Removed.
4365         * src/sfnt/sfdriver.c (sfnt_interface): Updated.
4367         * src/sfnt/ttcolr.c (tt_face_load_colr_layers): Removed.
4368         * src/sfnt/ttcolr.h: Updated.
4370         * src/truetype/ttgload.c (TT_Load_Glyph): Updated.
4372 2018-06-14  Werner Lemberg  <wl@gnu.org>
4374         Provide iterative API to access `COLR' data.
4376         This solution doesn't store any data in an `FT_GlyphSlot' object.
4378         * include/freetype/freetype.h (FT_LayerIterator): New structure.
4379         (FT_Get_Color_Glyph_Layer): New function.
4381         * include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func): New
4382         function type.
4383         (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it.
4385         * src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Implement it.
4387         * src/sfnt/ttcolr.c (tt_face_get_colr_layer): New function.
4388         * src/sfnt/ttcolr.h: Updated.
4390         * src/sfnt/sfdriver.c (sfnt_interface): Updated.
4392 2018-06-14  Werner Lemberg  <wl@gnu.org>
4394         Add glyph index and glyph load flags to glyph slot.
4396         * include/freetype/freetype.h (FT_GlyphSlotRec): Rename unused
4397         `reserved' field to `glyph_index'.
4399         * include/freetype/internal/ftobjs.h (FT_Slot_InternalRec): Add
4400         `load_flags' field.
4402         * src/base/ftobjs.c (FT_Load_Glyph): Set new fields.
4404 2018-06-14  Werner Lemberg  <wl@gnu.org>
4406         [sfnt] Move `CPAL' stuff into separate files.
4408         * src/sfnt/sfdriver.c: Include `ttcpal.h'.
4409         * src/sfnt/sfnt.c: Include `ttcpal.c'.
4411         * src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: Move CPAL stuff to ...
4412         * src/sfnt/ttcpal.c, src/sfnt/ttcpal.c: ... these new files.
4414         * src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC):
4415         Updated.
4417         * include/freetype/internal/fttrace.h: Add support for `colr' and
4418         `cpal'.
4419         Sort entries.
4421 2018-06-13  Werner Lemberg  <wl@gnu.org>
4423         [sfnt] Separate `CPAL' and `COLR' table handling.
4425         Later on we want to support the `SVG' table also, which needs `CPAL'
4426         (but not `COLR').
4428         * include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_cpal'
4429         and `free_cpal' fields.
4430         (FT_DEFINE_SFNT_INTERFACE): Updated.
4432         * include/freetype/internal/tttypes.h (TT_FaceRec): Replace
4433         `colr_and_cpal' fields with `cpal' and `colr'.
4435         * src/sfnt/sfdriver.c (sfnt_interface): Updated.
4437         * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Updated.
4439         * src/sfnt/ttcolr.c (Colr, Cpal): Add `table' field.
4440         (ColrCpal): Removed.
4441         (tt_face_load_colr): Split off CPAL handling into...
4442         (tt_face_load_cpal): ... this new function.
4443         (tt_face_free_colr): Split off CPAL handling into...
4444         (tt_face_free_cpal): ... this new function.
4445         (tt_face_load_colr_layers, tt_face_palette_set): Updated.
4447         * src/sfnt/ttcolr.h: Updated.
4449         * src/truetype/ttgload.c (TT_Load_Glyph): Updated.
4451 2018-06-12  Werner Lemberg  <wl@gnu.org>
4453         [sfnt] Fix `sizeof' thinko.
4455         * src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_palette_set): Don't
4456         use `sizeof' for computing array limit.
4458 2018-06-12  Werner Lemberg  <wl@gnu.org>
4460         Finish CPAL/COLR support (4/4).
4462         * src/sfnt/ttcolr.c (tt_face_find_color): Removed.
4463         (tt_face_colr_blend_layer): Use `face->palette' instead of calling
4464         `tt_face_find_color'.
4465         Use and set text foreground color.
4467 2018-06-12  Werner Lemberg  <wl@gnu.org>
4469         Finish CPAL/COLR support (3/4).
4471         * src/base/ftcolor.c: Include FT_INTERNAL_SFNT_H.
4472         (FT_Palette_Select, FT_Palette_Set_Foreground_Color): Implement
4473         functions.
4475 2018-06-12  Werner Lemberg  <wl@gnu.org>
4477         Finish CPAL/COLR support (2/4).
4479         * src/sfnt/ttcolr.c (tt_face_palette_set): New function.
4480         (tt_face_load_colr): Allocate `face->palette' and call
4481         `tt_face_palette_set'.
4482         Adjust return error code in case of error.
4484         * src/sfnt/ttcolr.h: Updated.
4486         * include/freetype/internal/sfnt.h (TT_Set_Palette_Func): New
4487         function type.
4488         (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it.
4490         * src/sfnt/sfdriver.c (sfnt_interface), src/sfnt/sfobjs.c
4491         (sfnt_done_face): Updated.
4493 2018-06-12  Werner Lemberg  <wl@gnu.org>
4495         Finish CPAL/COLR support (1/4).
4497         * include/freetype/internal/tttypes.h (TT_FaceRec): New fields
4498         `palette_index', `palette', `have_foreground_color' and
4499         `foreground_color'.
4501 2018-06-12  Werner Lemberg  <wl@gnu.org>
4503         [sfnt] Minor.
4505         * src/sfnt/ttcolr.c (tt_face_load_colr_layers):
4506         s/palette_index/palette_entry_index/ for consistency.
4507         Adjust return error code in case of error.
4509 2018-06-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
4511         [raster] Clean up.
4513         * src/raster/ftraster.c (black_TWorker, SCALED, Set_High_Precision):
4514         Clean up after 5-level gray removal (8dc8635874).
4515         (Vertical_Sweep_Span): Be brief.
4517 2018-06-10  Werner Lemberg  <wl@gnu.org>
4519         [sfnt] Fix compiler warnings.
4521         * src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_load_colr_layers,
4522         tt_face_colr_blend_layer): Add `NULL' initializers.
4524 2018-06-10  Werner Lemberg  <wl@gnu.org>
4526         s/FT_Palette/FT_Palette_Data/, s/palette/palette_data/.
4528         * include/freetype/ftcolor.h, include/freetype/internal/tttypes.h,
4529         src/base/ftcolor.c, src/sfnt/sfobjs.c, src/sfnt/ttcolr.c: Updated.
4531 2018-06-10  Nikolaus Waxweiler  <madigens@gmail.com>
4533         CMakeLists: also accept IOS_PLATFORM=SIMULATOR64
4535         This might be needed to build FreeType for the iOS simulator. See
4536         https://savannah.nongnu.org/bugs/index.php?54048. Patch contributed
4537         by Steve Robinson.
4539         * CMakeLists.txt: Accept IOS_PLATFORM=SIMULATOR64
4541 2018-06-10  Werner Lemberg  <wl@gnu.org>
4543         Implement `FT_Palette_Get'.
4545         * src/base/ftcolor.c: New file.
4547         * src/base/Jamefile (_sources), src/base/rules.mk (BASE_SRC),
4548         src/base/ftbase.c: Add `ftcolor.c'.
4550 2018-06-10  Werner Lemberg  <wl@gnu.org>
4552         * src/sfnt/ttcolr.c (tt_face_load_colr): Improve overflow checks.
4554 2018-06-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
4556         [raster] Deal with pitch sign earlier.
4558         * src/raster/ftraster.c (black_TWorker): Remove unused `traceG',
4559         s/bTarget/bOrigin/.
4560         (Render_Glyph): Set `ras.bOrigin' at the bottom-left corner.
4561         (Vertical_Sweep_Init, {Vertical,Horizontal}_Sweep_{Span,Drop}):
4562         Updated accordingly.
4564 2018-06-09  Werner Lemberg  <wl@gnu.org>
4566         [sfnt] Read `CPAL' version 1 tables.
4568         * include/freetype/internal.tttypes.h: Include FT_COLOR_H.
4569         (TT_FaceRec): Add `palette' field.
4571         * src/sfnt/ttcolr.c: Include FT_COLOR_H.
4572         (Cpal): Remove all data covered by the new `palette' field in
4573         `TT_FaceRec'.
4574         (tt_face_load_colr): Updated.
4575         Read `CPAL' version 1 data.
4576         (tt_face_load_colr_layers, tt_face_find_color): Updated.
4578         * src/sfnt/sfobjs.c (sfnt_done_face): Free glyph color palette data.
4580 2018-06-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
4582         [base] API for Harmony LCD rendering.
4584         This introduces `FT_Library_SetLcdGeometry' for setting up arbitrary
4585         LCD subpixel geometry including non-striped patterns.
4587         * src/base/ftlcdfil.c (FT_Library_SetLcdGeometry): New function.
4588         * include/freetype/ftlcdfil.h: Document it.
4589         * include/freetype/freetype.h: Minor.
4590         * include/freetype/ftchapters.h: Minor.
4592 2018-06-06  Werner Lemberg  <wl@gnu.org>
4594         ftcolor.h: Redesign API.
4596         While going to implement it I noticed that I need access to most of
4597         the `CPAL' elements; I thus plan to add a `cpal' field to
4598         `TT_FaceRec', which makes most of the previously suggested API
4599         functions obsolete because the fields will be directly accessible.
4601 2018-06-06  Parth Wazurkar  <parthwazurkar@gmail.com>
4603         [bdf, pcf] Remove deprecated FT_FACE_FLAG_FAST_GLYPHS flag.
4605         * src/bdf/bdfdrivr.c (BDF_Face_Init): Remove deprecated
4606         FT_FACE_FLAG_FAST_GLYPHS flag.
4608         * src/pcf/pcfread.c (pcf_load_font): Remove deprecated
4609         FT_FACE_FLAG_FAST_GLYPHS flag.
4611 2018-06-06  Werner Lemberg  <wl@gnu.org>
4613         [smooth, raster] Limit bitmap size (#54019).
4615         * src/raster/ftraster.c [STANDALONE] (FT_Outline_Get_CBox): Add
4616         function.
4617         [!STANDALONE]: Include FT_OUTLINE_H.
4618         (ft_black_render): Compute CBox and reject glyphs larger than
4619         0xFFFF x 0xFFFF.
4621         * src/smooth/ftgrays.c (gray_raster_render): Reject glyphs larger
4622         than 0xFFFF x 0xFFFF.
4624 2018-06-03  Armin Hasitzka  <prince.cherusker@gmail.com>
4626         * src/smooth/ftgrays.c (gray_convert_glyph): Remove unused variables.
4628 2018-06-03  Werner Lemberg  <wl@gnu.org>
4630         * src/tools/glnames.py (main): Emit header in `light' comment style.
4632 2018-06-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
4634         [smooth] Attempt to mitigate bug #54019.
4636         The robust rendering of estra large glyphs came with unbearable cost.
4637         The old way of bisecting should fail but fail faster.
4639         * src/smooth/ftgrays.c (gray_convert_glyph): Switch back to bisecting
4640         in y-direction.
4642 2018-06-02  Werner Lemberg  <wl@gnu.org>
4644         * src/truetype/ttinterp.c (Ins_MIRP): Use SUB_LONG; avoid FT_ABS.
4646         Reported as
4648           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8706
4650 2018-06-02  Werner Lemberg  <wl@gnu.org>
4652         * src/autofit/afwarp.h: Use AF_CONFIG_OPTION_USE_WARPER (#54033).
4654 2018-05-31  Werner Lemberg  <wl@gnu.org>
4656         * src/raster/ftraster.c (black_TWorker_): Remove `gTarget' field.
4658         This is no longer used.
4660 2018-05-31  Werner Lemberg  <wl@gnu.org>
4662         [sfnt] Get colors from `CPAL' table in right order (#54015).
4664         * src/sfnt/ttcolr.c (tt_face_find_color): Fix it.
4666 2018-05-30  Werner Lemberg  <wl@gnu.org>
4668         ftcolor.h: Improve API design, fix typos (#54011, #54014).
4670         * include/freetype/ftcolor.h (FT_Palette_Get_Names): Replace with...
4671         (FT_Palette_Get_Name_IDs): ... this function.
4672         (FT_Palette_Get_Entry_Names): Replace with...
4673         (FT_Palette_Get_Entry_Name_IDs): ... this function
4674         s/FT_Palette_Set_Foreground_COlor/FT_Palette_Set_Foreground_Color/.
4676 2018-05-30  Armin Hasitzka  <prince.cherusker@gmail.com>
4678         Beautify a3cfed5e87232c933bdc64f43e8ebebcfd18b41b.
4680         * src/autofit/afloader.c (af_loader_load_glyph): Move the
4681         initialisationand declaration of variables into the if-block.
4683 2018-05-30  Armin Hasitzka  <prince.cherusker@gmail.com>
4685         Fix pointer underflow.
4687         The declaration of `edge2' can be reached with `edge1 == NULL' and
4688         `axis->edges == 0' which results in undefined behaviour.
4690         * src/autofit/afloader.c (af_loader_load_glyph): Initialise `edge2'
4691         after checking `axis->num_edges > 1'.  `edge1 != NULL' can be assumed.
4693 2018-05-30  Werner Lemberg  <wl@gnu.org>
4695         Various minor color fixes.
4697         * include/freetype/config/ftheader.h (FT_COLOR_H): New macro.
4699         * include/freetype/internal/ftobjs.h (FT_Colr_Internal): Change
4700         type of `load_flags' to `FT_Int32'.
4702         * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func): Change
4703         type of `idx' to `FT_UInt'.
4704         (TT_Blend_Colr_Func): Change type of `color_index' to `FT_UInt'.
4706         * src/base/ftobjs.c (FT_Render_Glyph_Internal): Change type of
4707         `load_flags' to `FT_Int32'.
4709         * src/sfnt/ttcolr.c (find_base_glyph_record,
4710         tt_face_load_colr_layers): Change type of `glyph_id' to `FT_UInt'.
4711         (tt_face_find_color, tt_face_colr_blend_layer): Change type of
4712         `color_index' to `FT_UInt'.
4713         Fix signedness and type issues.
4715         * src/sfnt/ttcolr.h: Updated.
4717 2018-05-25  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4719         [docmaker] Fix missing `Defined in (...)' under Windows/Cygwin.
4721         This platform uses backslashes for paths, which docmaker didn't
4722         understand correctly.
4724         * src/tools/docmaker/tohtml.py (HtmlFormatter::blockEnter): Use
4725         `os.path.normpath' to normalize the path for the platform being
4726         used.
4728 2018-05-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
4730         [smooth] Formalize Harmony LCD rendering.
4732         This generalizes magic outline shifts that make Harmony LCD
4733         rendering work in terms of precise two-dimensional RGB subpixel
4734         positions. These coordinates are now set in time of the `smooth'
4735         module initialization and later used to shift a glyph outline for
4736         rendering. FT_RENDER_MODE_LCD and FT_RENDER_MODE_LCD_V use the same
4737         coordinates. The letter, however, rotates them before using.
4738         The LCD bitmap padding is also calculated using these coordinates.
4740         * include/freetype/internal/ftobjs.h (FT_LibraryRec): New array field
4741         `lcd_geometry'.
4742         * src/base/ftlcdfil.c (ft_lcd_padding): Reworked.
4743         * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Updated accordingly.
4745         * src/smooth/ftsmooth.c [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]
4746         (ft_smooth_init): Initialize `lcd_geometry'.
4747         (ft_smooth_render_generic): Formalize outline shifts.
4749 2018-05-22  Werner Lemberg  <wl@gnu.org>
4751         [truetype] Reject elements of composites with invalid glyph indices.
4753         Reported as
4755           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8413
4757         * src/truetype/ttgload.c (TT_Load_Composite_Glyph): Implement it.
4759 2018-05-22  Werner Lemberg  <wl@gnu.org>
4761         * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Trace # of points.
4763 2018-05-20  Werner Lemberg  <wl@gnu.org>
4765         * include/freetype/ftcolor.h: New file.
4767         This is an interface to the `CPAL' OpenType table.  No
4768         implementation yet.
4770 2018-05-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
4772         * include/freetype/internal/ftcalc.h (FT_MSB): Verified `_MSC_VER'.
4774         Actually `_BitScanReverse' is available since VS2005.
4776 2018-05-18  Werner Lemberg  <wl@gnu.org>
4778         * include/freetype/internal/ftcalc.h (FT_MSB): Use `_MSC_VER' value.
4780         Older VC versions don't provide `_BitScanReverse'.  We test for VC
4781         2013.
4783         Reported by John Emmas <john@creativepost.co.uk>.
4785 2018-05-17  Werner Lemberg  <wl@gnu.org>
4787         s/inline/__inline/ for MSVC.
4789         Reported by John Emmas <john@creativepost.co.uk>.
4791         * include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Do it.
4793 2018-05-16  Werner Lemberg  <wl@gnu.org>
4795         Add function `FT_Get_GlyphLayers' to access `COLR' table data.
4797         * include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec): Move this
4798         structure to...
4799         * include/freetype/freetype.h (FT_Glyph_LayerRec): ... this
4800         header file.
4801         (FT_Glyph_Layer): New typedef.
4802         Update code to use it where appropriate.
4804         * src/base/ftobjs.c (FT_Get_GlyphLayers): New function.
4806 2018-05-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
4808         [base] Fix mono bitmap presetting (#53896).
4810         It is rather fundamental to set monochrome bitmap based on rounded
4811         CBox because the b/w rasterizer turns on pixels when their centers are
4812         inside the glyph outline. The dropout control is unpredictable and can
4813         distort narrow glyphs if the bitmap is too wide.
4815         Reported by Chris Liddell.
4817         * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): If BBox boundaries
4818         are too close, adjust them before rounding.
4820 2018-05-15  Werner Lemberg  <wl@gnu.org>
4822         [psaux] Fix compiler warning (#53915).
4824         * src/psaux/psft.c (cf2_freeT1SeacComponent): Do it.
4826 2018-05-15  Werner Lemberg  <wl@gnu.org>
4828         [sfnt] Fix memory leak in handling `COLR' data.
4830         * src/truetype/ttgload.c (TT_Load_Glyph): Free old `layers' array
4831         before reassigning allocated memory.
4832         Only allocate `color_layers' if we don't have one already.
4834 2018-05-15  Werner Lemberg  <wl@gnu.org>
4836         [sfnt] If `COLR' is present, don't assume that all glyphs use it.
4838         * src/sfnt/ttcolr.c (tt_face_load_colr_layers): Return FT_Err_Ok if
4839         current glyph is not a `COLR' base glyph.
4841         * src/truetype/ttgload.c (TT_Load_Glyph): Don't allocate
4842         `color_layers' if there are no color layers.
4844 2018-05-14  Werner Lemberg  <wl@gnu.org>
4846         * src/base/ftobjs.c (FT_Load_Glyph): Fix signature of `pixel_modes'.
4848 2018-05-14  Werner Lemberg  <wl@gnu.org>
4850         Provide dummy functions if `TT_CONFIG_OPTION_SFNT_NAMES' is not set.
4852         * src/base/ftsnames.c [!TT_CONFIG_OPTION_SFNT_NAMES]: Implement it.
4854 2018-05-13  Werner Lemberg  <wl@gnu.org>
4856         * src/base/ftobjs.c (FT_Load_Glyph): Improve tracing.
4858 2018-05-13  Shao Yu Zhang  <shaozhang@fb.com>
4859             Werner Lemberg  <wl@gnu.org>
4861         [sfnt] Preliminary support of colored layer outlines (#44689).
4863         This commit enables OpenType's COLR/CPAL table handling; a typical
4864         application are color emojis that can be scaled to any size.
4866         If the color palette does not exist or is invalid, the rendering
4867         step rasterizes the outline instead.  The current implementation
4868         assumes that the foreground is black.
4870         Enable this by defining option TT_CONFIG_OPTION_COLOR_LAYERS.
4872         There are still some issues with metrics; additionally, an API to
4873         fetch color layers is missing.
4875         * devel/ftoption.h, include/freetype/config/ftoption.h
4876         (TT_CONFIG_OPTION_COLOR_LAYERS): New macro.
4878         * include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec,
4879         FT_Colr_InternalRec): New structures.
4880         (FT_Slot_InternalRec): Add `color_layers' field.
4882         * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func,
4883         TT_Blend_Colr_Func): New function types.
4884         (SFNT_Interface): Add `load_colr', `free_colr', `load_colr_layer',
4885         and `colr_blend' fields.
4887         * include/freetype/internal/tttypes.h (TT_FaceRec): Add
4888         `colr_and_cpal' field.
4890         * include/freetype/internal/tttags. (TTAG_COLR, TTAG_CPAL): New
4891         macros.
4893         * src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: New files.
4895         * src/base/ftobjs.c (ft_glyphslot_done, FT_Render_Glyph_Internal):
4896         Handle glyph color layers.
4898         * src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC): Add
4899         `ttcolr.c'.
4901         * src/sfnt/sfdriver.c: Include `ttcolr.h'.
4902         (PUT_COLOR_LAYERS): New macro.
4903         Update call to `FT_DEFINE_SFNT_INTERFACE'.
4905         * src/sfnt/sfnt.c: Include `ttcolr.c'.
4907         * src/sfnt/sfobjs.c (sfnt_load_face): Load `COLR' and `CPAL' tables.
4908         (sfnt_done_face): Updated.
4910         * src/truetype/ttgload.c (TT_Load_Glyph): Handle color layers.
4912 2018-05-12  Arkady Shapkin  <arkady.shapkin@gmail.com>
4914         Use MS VC++'s _BitScanReverse to calculate MSB (patch #9636).
4916         * include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Implement
4917         it.
4919 2018-05-10  Alan Coopersmith  <alan.coopersmith@oracle.com>
4921         Fix DLL compilation on Solaris.
4923         AC_COMPILE_IFELSE only tries to compile a `*.c' to a `*.o'.  The
4924         Solaris Studio 12.1 through 12.5 compilers see the
4925         `-fvisibility=hidden' flag, but ignore it with a warning of:
4927           cc: Warning: Option -fvisibility=hidden passed to ld,
4928                        if ld is invoked, ignored otherwise
4930         AC_LINK_IFELSE does the compile and then tries to link the result,
4931         at which point the Solaris linker will issue an error:
4933           ld: fatal: option '-fvisibility=hidden' is incompatible with
4934               building a dynamic executable
4936         If we don't use AC_LINK_IFELSE to catch the error, then configure
4937         will fail further tests which attempt to link, such as those testing
4938         dependencies like `libbz2'.
4940         Also, don't try adding `-fvisibility' if we have already added
4941         `-xldscope', just use one of them, since Sun Studio 12 and earlier
4942         compilers only issue a warning, and don't try passing through to the
4943         linker to generate an error, so AC_LINK_IFELSE doesn't catch them.
4945         Tested on Solaris 11.4 beta with compiler versions:
4947           Sun Studio 8 (Sun C 5.5)
4948           Sun Studio 10 (Sun C 5.7)
4949           Sun Studio 11 (Sun C 5.8)
4950           Sun Studio 12 (Sun C 5.9)
4951           Sun Studio 12.1 (Sun C 5.10)
4952           Oracle Solaris Studio 12.2 (Sun C 5.11)
4953           Oracle Solaris Studio 12.3 (Sun C 5.12)
4954           Oracle Solaris Studio 12.4 (Sun C 5.13)
4955           Oracle Developer Studio 12.5 (Sun C 5.14)
4956           Oracle Developer Studio 12.6 (Sun C 5.15)
4957           gcc 5.5.0
4958           gcc 7.3.0
4960         and verified the libfreetype.so.6 generated by each of those
4961         compilers exported the same set of symbols.
4963         * builds/unix/configure.raw: Implement it.
4965 2018-05-08  Werner Lemberg  <wl@gnu.org>
4967         [autofit] Avoid potential SEGV if running out of memory.
4969         Problem reported by Shailesh Mistry <shailesh.mistry@hotmail.co.uk>.
4971         * src/autofit/afshaper.c (af_shaper_buf_create,
4972         af_shaper_buf_destroy) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Don't
4973         allocate and free a four-byte buffer.  Instead, make those functions
4974         no-ops; the calling functions will provide a pointer to a buffer
4975         instead.
4977         * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
4978         af_cjk_metrics_init_blues, af_cjk_metrics_check_digits),
4979         src/autofit/aflatin.c (af_latin_metrics_init_widths,
4980         af_latin_metrics_init_blues, af_latin_metrics_check_digits)
4981         [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Use pointer to local variable for
4982         `shaper_buf'.
4984 2018-05-07  Nikolaus Waxweiler  <madigens@gmail.com>
4986         [cmake] Allow using project as subfolder in other project.
4988         * CMakeLists.txt: Test for CMake build directory being different
4989         from source directory.  Provide other parts of the build system
4990         access the full include directory.
4992 2018-05-07  Werner Lemberg  <wl@gnu.org>
4994         [build] Suppress configure's `nothing to be done' message.
4996         This is due to calling the configure script via `make' (within the
4997         top-level `configure' wrapper script).  The same can happen for all
4998         other secondary make targets that are used to only modify the
4999         primary one, e.g., `make setup devel'.
5001         * builds/dos/detect.mk (emx, turboc, watcom, borlandc, borlandc16),
5002         builds/os2/detect (visualage, watcom, borlandc, devel),
5003         builds/unix/detect.mk (devel, lcc, unix), builds/windows/detect.mk
5004         (visualc, watcom, visualage, lcc, mingw32, bcc32, devel-bcc,
5005         devel-gcc): Use no-op recipe.
5007 2018-05-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
5009         Support symbol visibility features of Sun / Oracle C compilers.
5011         Reported by Kiyoshi Kanazawa:
5012         https://lists.gnu.org/archive/html/freetype-devel/2018-05/msg00008.html
5013         Thanks to the suggestions by Alexei and Alan Coopersmith.
5015         * builds/unix/configure.raw: Check if "-xldscope=hidden" is
5016         accepted, and if so, it is added to CFLAGS.  This is the option
5017         making Sun / Oracle C compilers hide the symbols from global
5018         scope.
5019         * include/freetype/config/ftconfig.h: Use "__global" prefix
5020         for FT_EXPORT() macro, if SunPro C is newer than Sun ONE
5021         Studio 8 (2003).
5022         * builds/unix/ftconfig.in: Ditto.
5023         * builds/vms/ftconfig.h: Ditto.
5025 2018-05-02  Nikolaus Waxweiler  <madigens@gmail.com>
5027         Unbreak CMake Windows installation
5029         * CMakeLists.txt: Generate ftconfig.h on non-UNIX.
5031 2018-05-02  Werner Lemberg  <wl@gnu.org>
5033         Remove FT_CONFIG_OPTION_PIC and related code.
5035         */* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this
5036         preprocessor symbol.
5038         */*: Replace `XXX_GET' macros (which could be either a function in
5039         PIC mode or an array in non-PIC mode) with `xxx' arrays.
5041         * include/freetype/internal/ftpic.h, src/autofit/afpic.c,
5042         src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h,
5043         src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h,
5044         src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c,
5045         src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h,
5046         src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c,
5047         src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h:
5048         Removed.
5051 ----------------------------------------------------------------------------
5053 Copyright (C) 2018-2020 by
5054 David Turner, Robert Wilhelm, and Werner Lemberg.
5056 This file is part of the FreeType project, and may only be used, modified,
5057 and distributed under the terms of the FreeType project license,
5058 LICENSE.TXT.  By continuing to use, modify, or distribute this file you
5059 indicate that you have read the license and understand and accept it
5060 fully.
5063 Local Variables:
5064 version-control: never
5065 coding: utf-8
5066 End: