12021-07-18  Werner Lemberg  <wl@gnu.org>
2
3	* Version 2.11.0 released.
4	==========================
5
6
7	Tag sources with `VER-2-11-0'.
8
9	* docs/VERSION.TXT: Add entry for version 2.11.0.
10	* docs/CHANGES: Updated.
11
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.4/2.11.0/, s/2104/2110/.
18
19	* include/freetype/freetype.h (FREETYPE_MINOR): Set to 11.
20	(FREETYPE_PATCH): Set to 0.
21
22	* builds/unix/configure.raw (version_info): Set to 24:0:18.
23	* CMakeLists.txt (VERSION_MINOR): Set to 11.
24	(VERSION_PATCH): Set to 0.
25
26	* builds/toplevel.mk (dist): Ignore more git-related files.
27
282021-07-17  David Turner  <david@freetype.org>
29
30	* src/smooth/ftgrays.c: Fix compilation if `FT_LONG64` is undefined.
31
32	The code assumed that if `__SSE2__` is defined, then 64-bit integer
33	types are available.  This is not the case apparently for certain
34	multilib compiler targets like 'x86_32.x86' used by Gentoo.
35
36	This patch fixes the issue by disabling the special code path when
37	64-bit integer types are not available.
38
39	Fixes #1071.
40
412021-07-16  Alex Richardson  <Alexander.Richardson@cl.cam.ac.uk>
42
43	[tests] Allow arbitrary build directories.
44
45	* tests/issue-1063/main.c (main): I am building with a build
46	directory that is not directly inside the source tree, so the path
47	`../tests/data/As.I.Lay.Dying.ttf` does not resolve to the test
48	input file.  This change passes the test data directory as an
49	environment variable to allow arbitrary build directories.
50
51	* tests/meson.build: Updated.
52
532021-07-16  Alex Richardson  <Alexander.Richardson@cl.cam.ac.uk>
54
55	* tests/issue-1063/main.c (main): Fix uninitialized variable.
56
57	I tried running `meson test` but the test just crashed and gdb
58	reported that the face argument to `FT_Get_Char_Index` was nonsense.
59	With this change the test prints 'Could not open file: ' as it
60	should.
61
622021-07-16  Werner Lemberg  <wl@gnu.org>
63
64	[smooth] Minor fixes.
65
66	* src/smooth/ftgrays.c (gray_render_conic): Move variable and
67	structure declarations to beginning of function.  Inspite of C99
68	compliance we still do this for the sake of backward compatibility.
69	This also avoids a shadowing declaration of `count`.
70	(gray_convert_glyph_inner): Fix typo.
71
722021-07-15  Ben Wagner  <bungeman@chromium.org>
73
74	* src/smooth/ftgrays.c: Guard inclusion of `emmintrin.h`.
75
76	Guard inclusion of `emmintrin.h` with `#ifdef __SSE2__`.  The gcc
77	version of this header, `xmmintrin.h`, and `mmintrin.h` check that
78	the appropriate defines are set before defining anything (are
79	internally guarded).  However, the clang versions of these includes
80	are not internally guarded.  As a result of this, externally guard
81	the inclusion of these headers.
82
832021-07-15  David Turner  <david@freetype.org>
84
85	[smooth] Implement Bézier quadratic arc flattening with DDA.
86
87	Benchmarking shows that this provides a very slighty performance
88	boost when rendering fonts with lots of quadratic Bézier arcs,
89	compared to the recursive arc splitting, but only when SSE2 is
90	available, or on 64-bit CPUs.
91
92	On a 2017 Core i5-7300U CPU on Linux/x86_64:
93
94	  ftbench -p -s10 -t5 -cb DroidSansFallbackFull.ttf
95
96	  Before: 4.033 us/op  (best of 5 runs for all numbers)
97	  After:  3.876 us/op
98
99	  ftbench -p -s60 -t5 -cb DroidSansFallbackFull.ttf
100
101	  Before: 13.467 us/op
102	  After:  13.385 us/op
103
104	* src/smooth/ftgrays.c (gray_render_conic): New implementation
105	based on DDA and optionally SSE2.
106
1072021-07-15  David Turner  <david@freetype.org>
108
109	[smooth] Minor speedup to smooth rasterizer.
110
111	This speeds up the smooth rasterizer by avoiding conditional
112	branches in the hot path.
113
114	- Define a fixed 'null cell', which will be pointed to whenever the
115	  current cell is outside of the current target region.  This avoids
116	  a `ras.cell != NULL` check in the `FT_INTEGRATE` macro.
117
118	- Also use the null cell as a sentinel at the end of all `ycells`
119	  linked-lists, by setting its x coordinate to `INT_MAX`.  This
120	  avoids a `if (!cell)` check in `gray_set_cell` as well.
121
122	- Slightly change the worker struct fields to perform a little less
123	  operations during rendering.
124
125	Example results (on a 2013 Corei5-3337U CPU)
126
127	  out/ftbench -p -s10 -t5 -bc DroidSansFallbackFull.ttf
128
129	  Before: 5.472 us/op
130	  After:  5.275 us/op
131
132	  out/ftbench -p -s60 -t5 -bc DroidSansFallbackFull.ttf
133
134	  Before: 17.988 us/op
135	  After:  17.389 us/op
136
137	* src/smooth/ftgrays.c (grat_TWorker): Replace `num_cells` field with
138	`cell_free` and `cell_limit`.
139	(NULL_CELL_PTR, CELL_MAX_X_VALUE, CELL_IS_NULL): New macros.
140	(gray_dump_cells, gray_set_cell, gray_sweep, gray_sweep_direct,
141	gray_convert_glyph_inner, gray_convert_glyph): Updated.
142
1432021-07-15  David Turner  <david@freetype.org>
144
145	[tests] Rewrite download script in Python3.
146
147	This commit replaces the bash script with a Python script that does
148	the same work, plus avoiding to download anything if the files are
149	already installed with the right content.
150
151	We now use the first 8 bytes of each file's sha256 hash for the
152	digest.
153
154	* tests/scripts/download-test-fonts.sh: Removed.
155	* tests/scripts/download-test-fonts.py: New script.
156	* tests/README.md: Updated.
157
1582021-07-15  Alex Richardson  <Alexander.Richardson@cl.cam.ac.uk>
159
160	Support architectures where `long` is smaller than pointers.
161
162	I am currently trying to compile FreeType for CHERI-extended ISAs
163	(CHERI-RISC-V and Arm's Morello), but I am getting compiler warnings
164	from the `FT_UINT_TO_POINTER` macro.  When compiling with the CHERI
165	Clang compiler, not using `uinptr_t` for casts between integers an
166	pointers results in the following `-Werror` build failures:
167
168	```
169	In file included from .../src/truetype/truetype.c:22:
170	  .../src/truetype/ttgload.c:1925:22: error:
171	    cast from provenance-free integer type to pointer type will
172	    give pointer that can not be dereferenced
173	    [-Werror,-Wcheri-capability-misuse]
174	  node->data = FT_UINT_TO_POINTER( glyph_index );
175	               ^
176	  .../include/freetype/internal/compiler-macros.h:79:34: note:
177	    expanded from macro 'FT_UINT_TO_POINTER'
178	```
179
180	* include/freetype/internal/compiler-macros.h (FT_UINT_TO_POINTER):
181	The ISO C standard compliant fix for this would be to use
182	`uintptr_t` from `stdint.h`, but I am not sure if this is supported
183	by the minimum compiler version.  Therefore, use the
184	compiler-defined `__UINTPTR_TYPE__` macro (supported in GCC 4.6+ and
185	Clang since about 3.0) before checking for `_WIN64` and falling back
186	to `unsigned long`.
187
1882021-07-13  Oleg Oshmyan  <chortos@inbox.lv>
189
190	[base] Fix `FT_Open_Face`'s handling of user-supplied streams.
191
192	This was already true (though undocumented) most of the time, but
193	not if `FT_NEW` inside `FT_Stream_New` failed or if the
194	`FT_OPEN_XXX` flags were bad.
195
196	Normally, `FT_Open_Face` calls `FT_Stream_New`, which returns the
197	user-supplied stream unchanged, and in case of any subsequent error
198	in `FT_Open_Face`, the stream is closed via `FT_Stream_Free`.
199
200	Up to now, however, `FT_Stream_New` allocates a new stream even if
201	it is already given one by the user.  If this allocation fails, the
202	user-supplied stream is not returned to `FT_Open_Face` and never
203	closed.  Moreover, the user cannot detect this situation: all they
204	see is that `FT_Open_Face` returns `FT_Err_Out_Of_Memory`, but that
205	can also happen after a different allocation fails within the main
206	body of `FT_Open_Face`, when the user's stream has already been
207	closed by `FT_Open_Face`.  It is plausible that the user stream's
208	`close` method frees memory allocated for the stream object itself,
209	so the user cannot defensively free it upon `FT_Open_Face` failure
210	lest it ends up doubly freed.  All in all, this ends up leaking the
211	memory/resources used by user's stream.
212
213	Furthermore, `FT_Stream_New` simply returns an error if the
214	`FT_OPEN_XXX` flags are unsupported, which can mean either an
215	invalid combination of flags or a perfectly innocent
216	`FT_OPEN_STREAM` on a FreeType build that lacks stream support.
217	With this patch, the user-supplied stream is closed even in these
218	cases, so the user can be sure that if `FT_Open_Face` failed, the
219	stream is definitely closed.
220
221	* src/base/ftobjs.c (FT_Stream_New): Don't allocate a buffer
222	unnecessarily.
223	Move error-handling code to make the control flow more obvious.
224	Close user-supplied stream if the flags are unsupported.
225	`FT_Stream_Open` always sets `pathname.pointer`, so remove the
226	redundant (re)assignment.  None of the `FT_Stream_Open...` functions
227	uses `stream->memory`, so keep just one assignment at the end,
228	shared among all possible control flow paths.
229	('Unsupported flags' that may need a stream closure can be either an
230	invalid combination of multiple `FT_OPEN_XXX` mode flags or a clean
231	`FT_OPEN_STREAM` flag on a FreeType build that lacks stream
232	support.)
233
2342021-07-13  Oleg Oshmyan  <chortos@inbox.lv>
235
236	[base] Reject combinations of incompatible `FT_OPEN_XXX` flags.
237
238	The three modes are mutually exclusive, and the documentation of the
239	`FT_OPEN_XXX` constants notes this.  However, there was no check to
240	validate this in the code, and the documentation on `FT_Open_Args`
241	claimed that the corresponding bits were checked in a well-defined
242	order, implying it was valid (if useless) to specify more than one.
243	Ironically, this documented order did not agree with the actual
244	code, so it could not be relied upon; hopefully, nobody did this and
245	nobody will be hurt by the new validation.
246
247	Even if multiple mode bits were allowed, they could cause memory
248	leaks: if both `FT_OPEN_STREAM` and `stream` are set along with
249	either `FT_OPEN_MEMORY` or `FT_OPEN_PATHNAME`, then `FT_Stream_New`
250	allocated a new stream but `FT_Open_Face` marked it as an 'external'
251	stream, so the stream object was never released.
252
253	* src/base/ftobjs.c (FT_Stream_New): Reject incompatible
254	`FT_OPEN_XXX` flags.
255
2562021-07-12  Alex Richardson  <Alexander.Richardson@cl.cam.ac.uk>
257
258	* meson.build: Fix build for other UNIX systems (e.g., FreeBSD).
259
260	Without this change the build of `unix/ftsystem.c` fails because the
261	`ftconfig.h` header that defines macros such as `HAVE_UNISTD_H` and
262	`HAVE_FCNTL_H` is only being generated for Linux, macOS, and Cygwin
263	systems:
264
265	```
266	.../builds/unix/ftsystem.c:258:32: error:
267	    use of undeclared identifier 'O_RDONLY'
268	file = open( filepathname, O_RDONLY );
269	```
270
271	Instead of hardcoding a list of operating systems for this check,
272	update the logic that decides whether to build the file and set a
273	boolean flag that can be checked instead.
274
2752021-07-12  Werner Lemberg  <wl@gnu.org>
276
277	[autofit] More clean-ups.
278
279	* src/autofit/afhints.h (AF_GlyphHintsRec): Remove the no longer
280	needed fields `xmin_delta` and `xmax_delta`.
281
282	* src/autofit/afhints.c (af_glyph_hints_reload),
283	src/autofit/afloader.c (af_loader_load_glyph): Updated.
284
2852021-07-12  Werner Lemberg  <wl@gnu.org>
286
287	Small clean-ups for the last few commits.
288
289	* include/freetype/fttrace.h (afwarp): Removed.
290
2912021-07-12  David Turner  <david@freetype.org>
292
293	Remove obsolete `AF_Angle` type and related sources.
294
295	* src/autofit/afangles.c: File removed.  Functions related to
296	sorting moved to...
297	* src/autofit/afhints.c (af_sort_pos, af_sort_and_quantize_widths):
298	This file.
299	* src/autofit/afangles.h: File removed.
300	* src/autofit/aftypes.h: Updated.
301	* src/autofit/autofit.c: Updated.
302
303	* src/autofit/rules.mk (AUTOF_DRV_SRC): Updated.
304
3052021-07-12  David Turner  <david@freetype.org>
306
307	Remove experimental auto-hinting 'warp' mode.
308
309	This feature was always experimental, and probably never worked
310	properly.  This patch completely removes it from the source code,
311	except for a documentation block describing it for historical
312	purposes.
313
314	* devel/ftoption.h, include/freetype/config/ftoption.h: Remove
315	`AF_CONFIG_OPTION_USE_WARPER`.
316
317	* include/freetype/ftdriver.h: Document 'warping' property as
318	obsolete.
319
320	* src/autofit/afwarp.c, src/autofit/afwarp.h: Files removed.
321	* src/autofit/*: Remove any code related to warp mode.
322
3232021-07-12  David Turner  <david@freetype.org>
324
325	Remove experimental 'Latin2' writing system (`FT_OPTION_AUTOFIT2`).
326
327	This code has always been experimental and was never compiled anyway
328	(`FT_OPTION_AUTOFIT2` does not appear in `ftoption.h` or even any of
329	our build files).
330
331	* include/freetype/internal/fttrace.h (aflatin2): Removed.
332	* src/autofit/aflatin2.h, src/autofit/aflatin2.c: Files removed.
333	* src/autofit/afloader.c: Remove undocumented hook to activate
334	Latin2 system.
335	* src/autofit/afstyles.h: Remove `ltn2_dflt` style definition.
336	* src/autofit/afwrtsys.h: Remove `LATIN2` writing system definition.
337	* src/autofit/autofit.c: Updated.
338
3392021-07-05  Werner Lemberg  <wl@gnu.org>
340
341	* src/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix argument.
342
343	Reported by Hin-Tak.
344
3452021-07-03  Werner Lemberg  <wl@gnu.org>
346
347	* meson_options.txt: Sort alphabetically; no final full stops.
348
3492021-07-01  Ben Wagner  <bungeman@chromium.org>
350
351	* src/truetype/ttgxvar.c (tt_set_mm_blend): Test `coords`.
352
353	It is undefined behavior to pass `NULL` to `memcpy`.  `coords' is
354	passed to `memcpy` but `TT_Get_MM_Blend` and `TT_Get_Var_Design`
355	explictly call `tt_set_mm_blend` with `coords` as `NULL`.  In
356	addition, `TT_Set_MM_Blend` has a similar possible issue.
357
3582021-06-30  Dominik Röttsches  <drott@chromium.org>
359
360	[sfnt] Support PaintScale in 'COLR' v1 parsing.
361
362	* include/freetype/ftcolor.h (FT_PaintFormat): Renumber values, add
363	`FT_COLR_PAINTFORMAT_SCALE`.
364	(FT_PaintScale): New structure to represent 'PaintScale*' tables.
365	(FT_COLR_Paint): Updated.
366
367	* src/sfnt/ttcolr.c (FT_PaintFormat_Internal): New enumeration.
368	(read_paint): Parse 'PaintScale' and friends.
369
3702021-06-30  Dominik Röttsches  <drott@chromium.org>
371
372	[sfnt] Handle fonts without layer list in 'COLR' v1.
373
374	'COLR' v1 fonts do not necessarily need to have a layer list; for
375	this reason, 'fontTools' recently started generating fonts in a way
376	that drops the layer list if there are no layers in it.  This
377	results in the layer list offset becoming zero, which FreeType
378	treated as an invalid table.  Fix that and handle the case for layer
379	list offset being 0.  This slightly changes how we need to calculate
380	the starting offset for paints.
381
382	* src/sfnt/ttcolr.c (tt_face_load_colr): Handle case of layer list
383	offset being zero without outright rejecting table.
384
3852021-06-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
386
387	* src/raster/ftraster.c (Render_Single_Pass): Simplify `band_stack'.
388
3892021-06-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
390
391	[raster] Do not skip the second pass without dropout control.
392
393	The second pass also fixes horizontal lines through the pixel centers.
394
395	* src/raster/ftraster.c (black_TWorker): Do not use `second_pass'.
396	(Render_Glyph): Skip the second pass only with the appropriate flag.
397
3982021-06-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
399
400	[raster] Handle sub-band stack locally.
401
402	* src/raster/ftraster.c (black_TWorker): Move `band_stack' from here..
403	(Render_Single_Pass): ... to here and accept limit arguments.
404	(Render_Glyph): Updated.
405
4062021-06-25  Anurag Thakur  <anuthadev@gmail.com>
407
408	[CI] Introduce linux CI and refactor job names.
409
410	* .gitlab-ci.yml: Added jobs for building freetype on linux.
411
4122021-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
413
414	[raster] Handle Bézier stack locally.
415
416	* src/raster/ftraster.c (black_TWorker): Move `arcs' from here...
417	(Conic_To, Cubic_To): ... to here to tighten their scope.
418	(Bezier_Up, Bezier_Down): ... Take the current `arc' argument.
419
4202021-06-28  Dominik Röttsches  <drott@chromium.org>
421
422	[sfnt] Improve paint limit checks
423
424	Paint tables can appear before the `base_glyphs_v1` offset if the
425	font is produced with the layer list before the base glyph list.  In
426	this case paint tables can occur after the layer list but before the
427	base glyph list.  Checks in the 'COLR' v1 code were rejecting fonts
428	with this layout.  Improve these checks by calculating a minimum
429	offset after which paint tables can occur and use that in safety
430	checks.
431
432	* src/sfnt/ttcolr.c (Colr, tt_face_load_colr): Declare
433	`paint_start_v1` and calculate that as the minimum of the end of
434	layer list and base glyph list.
435	(get_child_table_pointer, read_paint, tt_face_get_paint_layers):
436	Use that in safety checks.
437
4382021-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
439
440	[raster] Clean up vertical sweep.
441
442	* src/raster/ftraster.c (black_TWorker): Replace the current line
443	offset with the pointer and drop the increment.
444	(Function_Sweep_Init): Take values as arguments instead of pointers.
445	(Vertical_Sweep_*, Horizontal_Sweep_Init, Draw_Sweep): Updated.
446
4472021-06-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
448
449	[raster] Make `band_top' local variable.
450
451	* src/raster/ftraster.c (black_TWorker): Move `band_top' from here...
452	(Render_Single_Pass): ... to here, and refactor.
453	(Render_Glyph): Updated.
454
4552021-06-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
456
457	[raster] Adjust sub-band bisecting limits.
458
459	We can bisect a band until it is just a single scan line.  This might
460	be slow and cause time-outs but if we need to impose limits it should
461	be elsewhere.
462
463	* src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding.
464
4652021-06-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
466
467	* src/raster/ftraster.c (Render_Single_Pass): Remove dead code.
468
4692021-06-25  Werner Lemberg  <wl@gnu.org>
470
471	[base] Add trace level to logging output.
472
473	Some practical debugging work has shown that displaying level X of
474	an `FT_TRACEX` macro in the output of `FT2_DEBUG="...  -v"` would be
475	very helpful to find out which trace level should be selected.  As
476	an example, we now get output like
477
478	```
479	[ttobjs:2]    TTF driver
480	[ttobjs:2]      SFNT driver
481	[sfobjs:2]      not a font using the SFNT container format
482	[t1objs:2]    Type 1 driver
483	[stream:7]    FT_Stream_EnterFrame: 14 bytes
484	```
485
486	* include/freetype/internal/ftdebug.h (FT_LOGGING_TAGX): New macro.
487	(FT_LOG): Use it to add the trace level to the logging tag.
488
489	* include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH):
490	Adjust.
491
492	* docs/DEBUG: Updated.
493
4942021-06-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
495
496	[smooth, raster] Fix up and align error codes.
497
498	FT_Render_Glyph picked up FAILURE or 1 returned from the raster
499	function, which became a confusing error code. Instead, return
500	Raster_Overflow in the unlikely event that banding does not help or
501	another meaningful error.
502
503	* src/smooth/ftgrays.c (gray_convert_glyph_inner, gray_convert_glyph):
504	Use Raster_Overflow when the rendering pool is exhausted and return it
505	if banding does not help.
506	(gray_raster_render): Use Smooth_Err_Ok.
507
508	* src/raster/ftraster.c (Render_Single_Pass): Return Raster_Overflow
509	if banding does not help or another error code.
510
5112021-06-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
512
513	[smooth, raster] Remove synonymous error macros.
514
515	* src/smooth/ftgays.c [STANDALONE_]: s/ErrRaster_/Smooth_Err_/.
516	(gray_convert_glyph_inner): Updated accordingly.
517
518	* src/raster/ftraster.c [STANDALONE_]: Do not abbreviate error macros.
519	(New_Profile, End_Profile, Insert_Y_Turn, Line_Up, Bezier_Up,
520	Decompose_Curve, Draw_Sweep, Render_Single_Pass, ft_black_render):
521	Updated accordingly.
522
5232021-06-22  Dominik Röttsches  <drott@chromium.org>
524
525	[sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/.
526
527	* include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat,
528	FT_COLR_Paint): Do it to make it harmonize with other names such as
529	'PaintTranslate'.
530
531	* src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto.
532
5332021-06-22  Dominik Röttsches  <drott@chromium.org>
534
535	Move 'COLR' API to `ftcolor.h`.
536
537	* include/freetype/freetype.h: Cut section layer managament
538	containing 'COLR' v0 and v1 API and move it to `ftcolor.h` as
539	requested by Werner on freetype-devel.
540	* include/freetype/ftcolor.h: Paste that section.
541
5422021-06-19  Werner Lemberg  <david@freetype.org>
543
544	[truetype] Fix integer overflow.
545
546	Reported as
547
548	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35312
549
550	* src/truetype/ttinterp.c (Ins_JMPR): Use `ADD_LONG`.
551
5522021-06-19  Werner Lemberg  <david@freetype.org>
553
554	[autofit] Prevent hinting if there are too many segments.
555
556	This speeds up handling of broken glyphs.
557
558	Reported as
559
560	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35309
561
562	* src/autofit/aflatin.c (af_latin_hints_compute_segments): Implement
563	it.
564
5652021-06-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
566
567	* src/sdf/ftsdfrend.c (ft_(b)sdf_render): Do not FT_ERROR routinely.
568
5692021-06-16  David Turner  <david@freetype.org>
570
571	[autofit] Fix return value of `FT_Load_Glyph`.
572
573	* src/autofit/afglobal.c (af_face_globals_get_metrics): The issue is
574	that `style_metrics_init` sometimes returns -1 without clearing
575	`error`.  While looping to `Again`, the next operation is
576	successful, but -1 is still returned by the function.  The fix is to
577	set `error` to 0 appropriately.
578
579	Fixes #1063.
580
5812021-06-15  David Turner  <david@freetype.org>
582
583	[meson] Add first regression test to FreeType.
584
585	* tests/README.md: New file that explains how to build and run the
586	tests with the Meson build.
587
588	* tests/scripts/download-test-fonts.sh: New bash script to download
589	test font files to the `tests/data` folder.
590
591	* meson.build, meson_options.txt: Add 'tests' option to enable
592	building and running the test programs (disabled by default).
593
594	* tests/meson.build: New file.
595
596	* tests/issue-1063/main.c: Simple regression test to exhibit issue
597	1063.
598
599	* .gitignore: Ignore the content of the `tests/data` folder for
600	now.
601
6022021-06-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
603
604	[type42] Fix new memory leak.
605
606	We need to inverse inheritance of FT_GlyphSlot_Internal so that we
607	have a chance to free the rendered bitmap from the parent slot.
608
609	* src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts
610	of the child `ttslot' and replace it with the parent structure.
611	(T42_GlyphSlot_Done): Updated accordingly.
612
6132021-06-12  Werner Lemberg  <wl@gnu.org>
614
615	[psaux] Fix another assertion.
616
617	* src/psaux/psintrp.c (cf2_interpT2CharString)
618	<cf2_escCALLOTHERSUBR>: Convert assertion into error, since the
619	problem can happen with invalid user input.
620
621	Test case is file
622
623	  fuzzing/corpora/legacy/oss-fuzz/5754332360212480-unknown-read
624
625	in the `freetype2-testing` repository.
626
6272021-06-12  Werner Lemberg  <wl@gnu.org>
628
629	[psaux] Fix assertions.
630
631	* src/psaux/pshints.c (cf2_hintmap_adjustHints): Check for overflow
632	before emitting an assertion error.
633
634	Test case is file
635
636	 fuzzing/corpora/legacy/oss-fuzz/4594115297673216-integer-overflow
637
638	in the `freetype2-testing` repository.
639
6402021-06-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
641
642	* src/truetype/ttinterp.c (TT_RunIns): Optimize tracing.
643
6442021-06-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
645
646	[sdf] Fix SDF positioning.
647
648	* src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Add padding to
649	`bitmap_top' and `bitmap_left'.
650
651	* sdf/sdf/ftsdf.c (sdf_generate_with_overlaps): Fix VC++ warning.
652
6532021-06-08  Werner Lemberg  <wl@gnu.org>
654
655	Fix 'devel' build for 'COLR' v1.
656
657	* devel/ftoption.h: Synchronize with
658	  `include/freetype/config/ftoption.h`.
659
6602021-06-08  Werner Lemberg  <wl@gnu.org>
661
662	[sfnt] Sanitize cmap4 table better.
663
664	Fixes #1062.
665
666	* src/sfnt/ttcmap.c (tt_cmap4_validate): Handle a too-small value of
667	`length` gracefully.
668
6692021-06-08  Dominik Röttsches  <drott@chromium.org>
670
671	[sfnt] Pointer validity check when reading 'COLR' v1 layers
672
673	* src/sfnt/ttcolr.c (tt_face_get_paint_layers): In addition to the
674	existing sanity checks, ensure that the pointer to the layer to be
675	read is within the 'COLR' v1 table.
676
6772021-06-08  Werner Lemberg  <wl@gnu.org>
678
679	* src/sdf/ftsdfcommon.c: Fix inclusion of header files.
680
6812021-06-08  Werner Lemberg  <wl@gnu.org>
682
683	[sdf] Make `make multi` work.
684
685	* src/sdf/ftsdf.c: Include `ftbitmap.h`.
686
687	* src/sdf/ftsdfcommon.h: Move function bodies to `ftsdfcommon.c`.
688	Include `ftobjs.h` to get definitions of `FT_LOCAL` and friends.
689
690	* src/sdf/ftsdfcommon.c: New file.
691
692	* src/sdf/rules.mk, src/sdf/sdf.c: Updated.
693
6942021-06-08  Anuj Verma  <anujv@iitbhilai.ac.in>
695
696	[sdf] Use 8 bits for final SDF output instead of 16bits.
697
698	Since 8-bits is enough to represent SDF data we no longer require
699	16-bits for this purpose.  Also, we now normalize the output data
700	to use the entire 8-bit range efficiently.  For example: if we use
701	3.5 format with a spread of 1 we basically only use the starting
702	5-bits.  By normalizing we can use the entire 8-bit range.
703
704	* include/freetype/freetype.h (FT_Render_Mode): Updated description
705	for `FT_RENDER_MODE_SDF` regarding this change.
706
707	* include/freetype/ftimage.h (FT_Pixel_Mode): Removed
708	`FT_PIXEL_MODE_GRAY16` since no longer required.
709
710	* include/freetype/fttypes.h (FT_F6Dot10): Removed since no longer
711	required.
712
713	* src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Allocate 8-bit
714	bitmap instead of 16-bit buffer.
715
716	* src/sdf/ftsdfcommon.h (map_fixed_to_sdf): Added function to convert
717	16.16 distance value to our desired format.
718
719	* src/sdf/ftsdf.c (sdf_generate_with_overlaps,
720	sdf_generate_bounding_box): Use the new `map_fixed_to_sdf` function
721	and also use 8-bit output buffer.
722
723	* src/sdf/ftbsdf.c (finalize_sdf): Output to a 8-bit buffer instead
724	of 16-bit buffer.
725
7262021-06-02  Ben Wagner  <bungeman@chromium.org>
727	    Werner Lemberg  <wl@gnu.org>
728
729	[sfnt] Fix fallout from 2021-05-29 change.
730
731	* src/sfnt/ttcolr.c (find_base_glyph_record,
732	find_base_glyph_v1_record): Adjust binary search.
733
734	Needs to be updated with change to unsigned.
735
7362021-06-02  Werner Lemberg  <wl@gnu.org>
737
738	* src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix tracing.
739
740	Problem reported by Alexei.
741
7422021-06-02  Werner Lemberg  <wl@gnu.org>
743
744	[psaux] Fix MSVC compiler warnings.
745
746	* src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs):
747	Add cast.
748
7492021-05-29  Werner Lemberg  <wl@gnu.org>
750
751	Fix compilation errors and (some) warnings for clang++.
752
753	* src/autofit/afmodule.c (AF_GlyphHintsRec): Make it static.
754
755	* src/cache/ftcache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c
756	(ftc_snode_compare): Remove semicolon.
757
758	* src/cff/cffparse.c (cff_parser_run): Add `break` statement.
759
760	* src/cid/cidload.c (cid_hex_to_binary): Add cast.
761
762	* src/sdf/ftbsdf.c (CHECK_NEIGHBOR): Use `do {} while(0)` loop.
763	(bsdf_init_distance_map, finalize_sdf, bsdf_raster_render): Add
764	casts.
765	* src/sdf/ftsdf.c (sdf_generate_bounding_box,
766	sdf_generate_with_overlaps): Ditto.
767	* src/sdf/ftsdfcommon.h (square_root): Ditto.
768	* src/sdf/ftsdfrend.c (sdf_property_get, ft_sdf_render,
769	ft_bsdf_render): Ditto.
770
771	* src/sfnt/ttcolr.c (find_base_glyph_record,
772	find_base_glyph_v1_record): Fix variable signedness.
773	(read_color_line): Add cast.
774	(read_paint): Add casts.
775	Fix signedness issue.
776	(tt_face_get_colorline_stops) Fix signedness issues.
777
778	* src/sfnt/ttpost.c (load_format_20): Add casts.
779
780	* src/truetype/ttsubpix.c (TWEAK_RULES, TWEAK_RULES_EXCEPTIONS):
781	Remove final semicolons.
782
7832021-05-29  Werner Lemberg  <wl@gnu.org>
784
785	[build] Allow overriding of `ANSIFLAGS` for GNU make build.
786
787	* builds/*: Implement it.
788
7892021-05-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
790
791	[type42] Fix auto-hinting.
792
793	The autohinter could not access the base (unscaled) outline in the
794	child TrueType glyph slot. We now share the internal parts between
795	the parent and child glyph slots. Fixes #1057.
796
797	* src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts
798	of `T42_GlyphSlot' and replace it with the child TrueType structure.
799	(T42_GlyphSlot_Done): Updated accordingly.
800
8012021-05-25  Werner Lemberg  <wl@gnu.org>
802
803	[psaux] Guard and trace AFM kern data allocation.
804
805	Reported as
806
807	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31543
808
809	* include/freetype/internal/fttrace.h: Add 'afmparse' trace
810	component.
811
812	* src/psaux/afmparse.c (FT_COMPONENT): Define.
813	(afm_parse_track_kern, afm_parse_kern_pairs): Protect against
814	allocations bombs.
815	Add tracing.
816	(afm_parse_kern_data): Don't allow multiple kern data sections.
817
8182021-05-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
819
820	* meson.build (ft2_public_headers): Add missing `ftcid.h'.
821
822	Fixes #1058.
823
8242021-05-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
825
826	[type42] Avoid some memory zeroing.
827
828	* src/type42/t42objs.c (T42_Open_Face): Tweak allocation macro.
829	* src/type42/t42parse.c (t42_parse_sfnts): Ditto.
830
8312021-05-19  Nikolaus Waxweiler  <madigens@gmail.com>
832
833	[CMake] Update dependency finders.
834
835	1. Fixes CMake using any found HarfBuzz version lower than the minimum
836	required. This is based on HALX99's merge request at
837	https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/31
838	2. Update FindHarfBuzz.cmake from
839	https://github.com/WebKit/WebKit/blob/1ce32454/Source/cmake/FindHarfBuzz.cmake
840	and guard post-CMake-3.1 features to keep the minimum version unchanged
841	3. Update FindBrotliDec.cmake to stop the warnings, based on what
842	https://github.com/google/woff2/blob/a0d0ed7d/cmake/FindBrotliDec.cmake
843	is doing
844
845	* CMakeLists.txt, builds/cmake/FindHarfBuzz.cmake: Implement 1 and 2.
846	* builds/cmake/FindBrotliDec.cmake: Implement 3.
847
8482021-05-19  Ben Wagner  <bungeman@chromium.org>
849
850	[gzip] Use exact type for `ft_gzip_alloc` and `ft_gzip_free`.
851
852	While a function pointer may be cast to another function pointer
853	type, it is required to cast the function pointer back to the
854	original function pointer type before calling it.  If a parameter is
855	a pointer the exact pointer type is required.  Using a pointer to a
856	different underlying type is technically undefined behavior.  The
857	wrapper functions `ft_gzip_alloc` and `ft_gzip_free` took
858	`FT_Memory` (a `FT_MemoryRec_*`) instead of `voidpf` (`void*`), so
859	when gzip calls these callbacks through `alloc_func` or `free_func`
860	it invokes undefined behavior.  On most platforms this works out as
861	expected, but newer undefined behavior detectors and targets like
862	wasm can detect this and will produce an error.
863
864	* src/gzip/ftgzip.c (ft_gzip_alloc, ft_gzip_free): Update signatures
865	to exactly match `alloc_func` and `free_func`, respectively.
866	Internally, cast the `void*` opaque pointer to `FT_Memory`.
867
8682021-05-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
869
870	Prioritize the anti-aliasing renderer module.
871
872	* modules.cfg: Reorder the renderers.
873	* include/freetype/config/ftmodule.h: Ditto.
874
8752021-05-16  Alexei Podtelezhnikov  <apodtele@gmail.com>
876
877	[sfnt] Additional guards on the POST table.
878
879	Fixes timeout (#1055) analyzed by Ben Wagner, reported as
880
881	  https://crbug.com/1194092
882
883	* src/sfnt/ttload.c (tt_face_load_post): Check POST format.
884	* src/sfnt/sfobjs.c (sfnt_load_face): Synthesize the missing unicode
885	charmap only if the glyph names exist.
886	* src/psnames/psmodule.c (ps_unicode_value): Short cut ".notdef" and
887	".null".
888
8892021-05-13  Daniel McArdle  <dmcardle@chromium.org>
890
891	[psaux] Use doubling allocation strategy for CF2_ArrStack.
892
893	Fixes timeout reported as
894
895	  https://crbug.com/1206181
896
897	* src/psaux/psarrst.c (cf2_arrstack_{push,init}): Implement it.
898	* src/psaux/psarrst.h (CF2_ArrStackiRec): Drop `chunk'.
899
9002021-05-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
901
902	* src/smooth/ftgrays.c (FT_MAX_GRAY_SPANS): Increase from 10 to 16.
903
904	Ten was barely enough for two slanted stems. Sixteen can actually fit
905	a bit more complicated scanlines.
906
9072021-05-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
908
909	* src/smooth/ftgrays.c (FT_GRAY_SET): Adjust for better code.
910
9112021-05-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
912
913	[smooth] Faster bitmap sweeping.
914
915	Selecting the fill rule or checking the direct mode each time we call
916	`gray_hline' is sub-optimal.  This effectively splits the direct mode
917	into a separate code path while inlining `gray_hline' and saving 5-7%
918	of rendering time.
919
920	* src/smooth/ftgrays.c (gray_hline): Eliminated in favor of...
921	(FT_FILL_RULE, FT_GRAY_SET): ... these new macros...
922	(gray_sweep): ... inlined here.
923	(gray_sweep_direct): New function that handles the direct span buffer.
924	(gray_TWorker): Remove the span buffer.
925	(gray_raster_render, gray_convert_glyph): Updated.
926
9272021-05-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
928
929	* src/smooth/ftgrays.c (gray_hline): Simplify even-odd computations.
930
931	It is too bad the even-odd rule is not used much.
932
9332021-05-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
934
935	[type1] Avoid MM memory zeroing.
936
937	* src/type1/t1load.c (t1_allocate_blend, parse_blend_design_map):
938	Tweak allocation macros.
939	* src/type1/t1objs.c (T1_Face_Done): Minor.
940
9412021-05-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
942
943	* src/bdf/bdflib.c (_bdf_list_ensure): Tweak allocation macro.
944
9452021-05-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
946
947	* src/psaux/psobjs.c (ps_parser_load_field): Tweak allocation macro.
948
9492021-05-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
950
951	* src/sfnt/sfobjs.c (sfnt_load_face): Tweak allocation macro.
952
9532021-05-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
954
955	* src/cid/cidload.c (cid_read_subrs): Tweak allocation macro.
956
9572021-05-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
958
959	* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Tweak allocation.
960
9612021-05-05  Alexei Podtelezhnikov  <apodtele@gmail.com>
962
963	[cff,psaux] Avoid memory zeroing (contd.).
964
965	* src/cff/cffload.c (cff_blend_doBlend, cff_blend_build_vector): Tweak
966	allocation macros.
967	* src/psaux/psarrst.c (cf2_arrstack_setNumElements): Ditto.
968	* src/psaux/psstack.c (cf2_stack_init): Ditto.
969
9702021-05-04  Ben Wagner  <bungeman@chromium.org>
971
972	* src/cid/cidload.c (cid_hex_to_binary): Improve return value.
973
974	Add argument to return the actual number of bytes that were decoded.
975	The actual number of bytes decoded can be quite variable depending
976	on the number of ignored 'whitespace' bytes or early termination
977	with `>`.
978	(cid_face_open): Updated to use this calculated value.  This avoids
979	trusting `parser->binary_length` is always be correct and reading
980	uninitialized bits if fewer are actually decoded.
981
982	First reported as
983
984	  https://crbug.com/1203240
985
9862021-05-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
987
988	[sfnt] Streamline POST format 2.0 handing.
989
990	To reduce memory allocations, we read an entire Pascal-string buffer
991	and convert it to a C-string buffer.  We also reject tables with
992	Postscript glyph names exceeding 63 bytes.
993
994	* src/sfnt/ttpost.c (load_format20): Implement it.
995	(load_post_names): Check the minimal POST table size.
996	(load_format25, tt_face_free_ps_names): Updated accordingly.
997
9982021-05-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
999
1000	[bdf,pcf] Avoid memory zeroing (contd.).
1001
1002	* src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment,
1003	_bdf_add_property, bdf_load_font): Tweak allocation macros.
1004	* src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto.
1005
10062021-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1007
1008	* src/cid/cidload.c (cid_read_subrs): Tweak allocaton macro.
1009
10102021-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1011
1012	[sfnt] Avoid some memory zeroing.
1013
1014	* src/sfnt/sfobjs.c (sfnt_open_font, sfnt_init_face,
1015	tt_name_ascii_from_{utf16,other}): Tweak allocaton macros.
1016	* src/sfnt/ttload.c (tt_face_load_name): Ditto.
1017
10182021-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1019
1020	* src/sfnt/ttpost.c (load_format_{20,25}): Tweak allocaton macros.
1021
10222021-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1023
1024	* src/sfnt/pngshim.c (Load_SBit_Png): Tweak allocaton macro.
1025
10262021-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1027
1028	[truetype] Avoid some memory zeroing.
1029
1030	* src/truetype/ttinterp.c (Init_Context): Tweak allocation macro.
1031	* src/truetype/ttpload.c (tt_face_load_cvt): Ditto.
1032
10332021-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
1034
1035	[woff2] Avoid some memory zeroing.
1036
1037	* src/sfnt/sfwoff2.c (store_loca, woff2_open_font): Tweak macros.
1038
10392021-04-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
1040
1041	* src/gzip/ftgzip.c (ft_gzip_alloc): Zero out memory again.
1042
10432021-04-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
1044
1045	[lzw] Preserve decompression stack when relocating to heap.
1046
1047	* src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Copy stack when
1048	relocating to heap.
1049
10502021-04-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
1051
1052	* src/cid/cidgload.c (cid_load_glyph): Restore the glyph_length check.
1053
10542021-04-27  Werner Lemberg  <wl@gnu.org>
1055
1056	* src/psmodule.c (ps_unicodes_init): Ignore empty glyph names.
1057
1058	Reported as
1059
1060	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33637
1061
10622021-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
1063
1064	* src/sfnt/sfobjs.c (sfnt_init_face): Revert macro change.
1065
10662021-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
1067
1068	[cff] Avoid some memory zeroing.
1069
1070	* src/cff/cffparse.c (cff_parser_init): Tweak memory macro.
1071	* src/cff/cffload.c (cff_index_load_offsets, cff_index_get_pointers,
1072	cff_charset_load, cff_vstore_load): Ditto.
1073
10742021-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
1075
1076	[pfr] Avoid some memory zeroing.
1077
1078	* src/pfr/pfrobjs.c (pfr_face_init) : Tweak memory macro.
1079	* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps,
1080	pfr_phy_font_load): Ditto.
1081
10822021-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
1083
1084	* src/winfonts/winfnt.c (FNT_Face_Init): Tweak memory macro.
1085
10862021-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
1087
1088	[psaux,psnames] Avoid some memory zeroing.
1089
1090	* src/psaux/psstack.c (cf2_stack_init): Tweak memory macro.
1091	* src/psnames/psmodule.c (ps_unicodes_init): Ditto.
1092
10932021-04-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
1094
1095	[base] Avoid some memory zeroing.
1096
1097	* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Use FT_QNEW_ARRAY.
1098	* src/base/ftsnames.c (FT_Get_Sfnt_{Name,LangTag}): Ditto.
1099
11002021-04-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
1101
1102	[bdf,pcf] Avoid some memory zeroing.
1103
1104	* src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties, pcf_load_font):
1105	Tweak memory macros.
1106	* src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto.
1107	* src/bdf/bdflib.c (_bdf_readstreami, bdf_create_property,
1108	_bdf_parse_glyphs, _bdf_parse_start): Ditto.
1109	(_bdf_add_property): Do not handle zero size.
1110
11112021-04-25  Issam E. Maghni  <issam.e.maghni@mailbox.org>
1112
1113	* builds/meson/process_ftoption_h.py: Add LF at EOF.
1114
1115	This fixes
1116
1117	  .../ftoption.h:1030:10: error:
1118	    no newline at end of file [-Werror,-Wnewline-eof]
1119
1120	for the generated `ftoption.h` file.
1121
11222021-04-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
1123
1124	* src/cff/cffload.c (cff_index_get_pointers): s/FT_QALLOC/FT_ALLOC/.
1125
11262021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1127
1128	* src/base/ftobjs.c (Mac_Read_POST_Resource): s/FT_ALLOC/FT_QALLOC/.
1129	* builds/mac/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
1130
11312021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1132
1133	* src/sdf/ftsdf.c (sdf_{edge,contour,shape}_new): Use FT_QALLOC.
1134
11352021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1136
1137	[sfnt] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1138
1139	* src/sfnt/sfdriver.c (get_win_string, get_apple_string,
1140	sfnt_get_var_ps_name): Do not zero out the buffer.
1141	* src/sfnt/sfobjs.c (sfnt_init_face): Ditto.
1142	* src/sfnt/sfwoff.c (woff_open_font): Ditto.
1143	* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
1144
11452021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1146
1147	[cff,type1,type42] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1148
1149	* src/cff/cffload.c (cff_index_get_pointers, cff_index_get_name):
1150	Do not zero out the buffer.
1151	* src/cff/cffdrivr.c (cff_ps_get_font_info): Ditto.
1152	* src/type1/t1load.c (parse_subrs, parse_charstrings,
1153	parse_blend_axis_types): Ditto.
1154	* src/type1/t1parse.c (T1_New_Parser, T1_Get_Private_Dict): Ditto.
1155	* src/type42/t42parse.c (t42_parser_init): Ditto.
1156
11572021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1158
1159	[cid] s/FT_ALLOC/FT_QALLOC/ and clean up.
1160
1161	* src/cid/cidgload.c (cid_load_glyph): Do not zero out the buffer.
1162	* src/cid/cidload.c (cid_face_open, cid_read_subrs): Ditto.
1163
11642021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1165
1166	[pfr] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1167
1168	* src/pfr/pfrload.c (pfr_extra_item_load_font_id, pfr_aux_name_load):
1169	Do not zero out the buffer.
1170
11712021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1172
1173	[bzip2,gzip] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1174
1175	* src/bzip2/ftbzip2.c (ft_bzip2_alloc): Do not zero out the buffer.
1176	* src/gzip/ftgzip.c (ft_gzip_alloc, FT_Stream_OpenGzip): Ditto.
1177
11782021-04-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
1179
1180	[pcf,bdf,winfonts] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1181
1182	* src/pcf/pcfread.c (pcf_interpret_style): Do not zero out the buffer.
1183	* src/bdf/bdfdrivr.c (bdf_interpret_style): Ditto.
1184	* src/winfonts/winfnt.c (FNT_Face_Init, FNT_Load_Glyph): Ditto.
1185
11862021-04-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
1187
1188	[cache] Optimize SBit copying.
1189
1190	* src/cache/ftcsbits.c (ftc_snode_load): Do not initialize the buffer.
1191	(ftc_sbit_copy_bitmap): Accept zero size, s/FT_ALLOC/FT_QALLOC/.
1192
11932021-04-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
1194
1195	[gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1196
1197	* src/gxvalid/gxvmod.c (gxv_load_table): Do not zero out the buffer.
1198	* src/otvalid/otvmod.c (otv_load_table): Ditto.
1199
12002021-04-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
1201
1202	[psaux] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1203
1204	* src/psaux/psobjs.c (ps_table_done, ps_parser_load_field): Do not
1205	zero out the buffer.
1206
12072021-04-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
1208
1209	[base] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
1210
1211	* src/base/ftobjs.c (open_face_PS_from_sfnt_stream,
1212	Mac_Read_sfnt_Resource): Do not zero out the buffer.
1213	* src/base/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
1214	* src/base/ftrfork.c (raccess_make_file_name,
1215	raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Ditto.
1216
12172021-04-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
1218
1219	[cache] Restore SBit copying for unowned (BDF) bitmaps.
1220
1221	* src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Restore.
1222	(ftc_snode_load): Check ownership and copy unowned bitmaps.
1223
12242021-04-19  Dominik Röttsches  <drott@chromium.org>
1225
1226	[sfnt] Return in 'COLR' v1 when layer pointer outside table
1227
1228	* src/sfnt/ttcolr.c (tt_face_get_paint_layers): Add missing return
1229	when paint pointer outside table.
1230	(read_paint): Add missing return when paint pointer outside table.
1231
12322021-04-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
1233
1234	[cache] Switch to lazy SBit setting.
1235
1236	* src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Removed.
1237	(ftc_snode_load): Take the bitmap ownership instead of copying.
1238
12392021-04-16  Daniel Welty  <@danielwelty>
1240
1241	* src/cache/ftcsbits.c (ftc_snode_load): Properly handle short pitch.
1242
12432021-04-16  Werner Lemberg  <wl@gnu.org>
1244
1245	* builds/unix/freetype2.m4: Fix help string formatting.
1246
1247	The indented `dnl` macros inserted unwanted horizontal space.
1248
1249	Problem reported by Ozkan Sezer <sezeroz@gmail.com>.
1250
12512021-04-16  Dominik Röttsches  <drott@chromium.org>
1252
1253	[sfnt] Safeguard 'COLR' v1 layer extraction
1254
1255	* src/sfnt/ttcolr.c (tt_face_get_paint_layers): Do not output
1256	layer pointer to iterator if it is outside the 'COLR' table.
1257	(read_paint): Do not attempt to read layers that are outside the
1258	table.
1259
12602021-04-02  Ben Wagner  <bungeman@chromium.org>
1261
1262	[base] Complete `ft_glyphslot_clear`.
1263
1264	* src/base/ftobjs.c (ft_glyphslot_clear): This function is intended
1265	to reset all the values of a glyph slot.  However, it was not
1266	resetting the values of the advances and `glyph_index`.  Reset the
1267	advances and `glyph_index` to zero.
1268
12692021-04-02  Ben Wagner  <bungeman@chromium.org>
1270
1271	[truetype] Prevent glyph program state from persisting.
1272
1273	`FDEF` instructions are specified as allowed only in 'prep' or
1274	'fpgm'.  FreeType has attempted to prevent their use in the glyph
1275	program, but they were still allowed in glyph programs if defined in
1276	a function defined in 'prep' or 'fpgm' and called from the glyph
1277	program.
1278
1279	Similarly, `IDEF` instructions are specified not to be able to
1280	modify any existing instruction.  FreeType has attempted to prevent
1281	their use in the glyph program, but they can still be used like
1282	`FDEF`.
1283
1284	This change stores the initial bytecode range type and disallows the
1285	use of `FDEF` and `IDEF` while running the glyph program.
1286
1287	Most other state is copied from the `TT_Size` into the execution
1288	context.  However, it is possible for a glyph program to use `WS` to
1289	write to the storage area or `WCVTP`, `WCVTF`, and `DELTAC[123]` to
1290	write to the control value table.
1291
1292	Allowing any change to the global state from the glyph program is
1293	problematic as the outlines of any given glyph may change based on
1294	the order the glyphs are loaded or even how many times they are
1295	loaded.  There exist fonts that write to the storage area or the
1296	control value table in the glyph program, so their use should not be
1297	an error.
1298
1299	Possible solutions to using these in the glyph program are
1300
1301	  * ignore the writes;
1302	  * value-level copy on write, discard modified values when finished;
1303	  * array-level copy on write, discard the copy when finished;
1304	  * array-level copy up-front.
1305
1306	Ignoring the writes may break otherwise good uses.  A full copy
1307	up-front was implemented, but was quite heavy as even well behaved
1308	fonts required a full copy and the memory management that goes along
1309	with it.  Value-level copy on write could use less memory but
1310	requires a great deal more record keeping and complexity.  This
1311	change implements array-level copy on write.  If any attempt is made
1312	to write to the control value table or the storage area when the
1313	initial bytecode range was in a glyph program, the relevant array
1314	will be copied to a designated storage area and the copy used for
1315	the rest of the glyph program's execution.
1316
1317	* src/truetype/ttinterp.h (TT_ExecContextRec): New fields
1318	`iniRange`, `glyfCvtSize`, `glyfCvt`, `origCvt`, `glyfStoreSize`,
1319	`glyfStorage`, and `origStorage`.
1320
1321	* src/truetype/ttinterp.c (Modify_CVT_Check): New function to handle
1322	`exc->glyfCvt`.
1323	(Write_CVT, Write_CVT_Stretched, Move_CVT, Move_CVT_Stretched): Use
1324	it.
1325	(Ins_WS): Handle `exc->glyfStorage`.
1326	(Ins_FDEF, Ins_IDEF): Updated.
1327	(TT_RunIns): Updated.
1328	(TT_Done_Context): Free 'glyf' CVT working and storage area.
1329	(TT_Load_Context): Fix/add casts.
1330
1331	* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix cast.
1332
13332021-03-30  Dominik Röttsches  <drott@chromium.org>
1334
1335	[sfnt] Check validity of pointer location of `read_color_line`.
1336
1337	* src/sfnt/ttcolr.c (get_child_table_pointer): New function to fetch
1338	child table pointer early for all paint formats that compute a child
1339	table pointer.
1340	(read_color_line, read_paint): Updated.
1341	(tt_face_get_colorline_stops): Check `colr->table`.
1342
13432021-03-28  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
1344
1345	[docs] Update docwriter stylesheet for 1.3.1.
1346
1347	This change is required to support docwriter 1.3.1.
1348
1349	See
1350
1351	  https://gitlab.freedesktop.org/freetype/docwriter/-/merge_requests/101
1352
1353	for more information.
1354
1355	* docs/markdown/stylesheets/extra.css:
1356	(.wy-nav-content, .md-sidebar--secondary): Remove.
1357
13582021-03-16  Alexei Podtelezhnikov  <apodtele@gmail.com>
1359
1360	* src/sfnt/pngshim.c (Load_SBit_Png): Free `rows` once later.
1361
13622021-03-16  Ben Wagner  <bungeman@google.com>
1363
1364	[sfnt] Fix memory leak in png loading.
1365
1366	Reported as
1367
1368	  https://bugs.chromium.org/p/chromium/issues/detail?id=1182552
1369
1370	Memory is allocated and the pointer assigned to `rows` inside a
1371	'setjmp' scope.  This memory must be freed outside the 'setjmp'
1372	scope after a 'longjmp'.  Since `rows` is a local and modified
1373	inside the 'setjmp' scope it must be marked volatile or it will have
1374	an indeterminate value after the 'longjmp'.
1375
1376	* src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak of `rows`.
1377
13782021-03-16  Christopher Degawa  <ccom@randomderp.com>
1379
1380	* CMakeLists.txt: Don't limit generation of 'pkg-config' file to UNIX.
1381
1382	mingw-w64 uses the 'pkg-config' files but does not set UNIX.
1383
13842021-03-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
1385
1386	* src/smooth/ftgrays.c (gray_set_cell): Refactor to fix VC++ warning.
1387
13882021-03-13  Werner Lemberg  <wl@gnu.org>
1389
1390	Handle various VC++ compiler warnings.
1391
1392	Fixes #1039.
1393
1394	* src/base/ftstroke.c (ft_stroker_inside, ft_stroker_outside):
1395	Initialize `sigma`.
1396
1397	* src/sdf/ftsdf.c (sdf_generate_with_overlaps): Exit immediately if
1398	function arguments are invalid.
1399	* src/sdf/ftsdfrend.c (sdf_property_set) <"overlaps">: Fix cast.
1400
1401	* src/sfnt/sfwoff2.c (woff2_decompress)
1402	[!FT_CONFIG_OPTION_USE_BROTLI]: Use `FT_UNUSED`.
1403
1404	* src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `fvar_head`.
1405
14062021-03-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
1407
1408	[smooth] Reduce copying during integration phase.
1409
1410	We now record `cover' and `area' directly into the linked list. This
1411	makes rendering faster by 10% or even more at larger sizes.
1412
1413	* src/smooth/ftgrays.c (FT_INTEGRATE): Write directly.
1414	(gray_TWorker): Add direct cell reference and remove unused fields.
1415	(gray_set_cell): Consolidate the linked list management and pointers.
1416	(gray_convert_glyph, gray_convert_glyph_inner): Updated.
1417
14182021-03-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
1419
1420	* src/smooth/ftgrays.c (FT_INTEGRATE): New convenience macro.
1421	(gray_render_line, gray_render_scanline): Use it.
1422
14232021-03-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
1424
1425	* src/smooth/ftgrays.c (gray_render_line): Rearrange conditionals.
1426
1427	These produce faster or more optimizable code.
1428
14292021-03-08  Tim-Philipp Müller  <tim@centricular.com>
1430
1431	[meson] Fix 'mmap' handling on Windows.
1432
1433	* meson.build (ft2_sources): Always use `windows/ftsystem.c` on
1434	Windows unless mmap has been disabled.
1435
1436	  https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/5#note_829289
1437
14382021-03-07  Tim-Philipp Müller  <tim@centricular.com>
1439
1440	[ci] Add basic support for Meson builds with MSVC on Windows.
1441
1442	This adds meson jobs for VS2017 (x86 and x86_64).
1443
1444	* .gitlab-ci.yml: New file.
1445
14462021-03-07  Tim-Philipp Müller  <tim@centricular.com>
1447
1448	[meson] Add subproject fallbacks for 'libpng' and 'zlib'.
1449
1450	* subprojects/libpng.wrap, subprojects/zlib.wrap: New files.
1451
1452	* meson.build: Updated.
1453
14542021-03-07  Xavier Claessens  <xavier.claessens@collabora.com>
1455
1456	[meson] Make it work with Windows.
1457
1458	* meson.build: Do not process `ftconfig.h` when not using
1459	`ftconfig.h.in`.
1460
1461	Fixes #1029.
1462
14632021-02-25  Werner Lemberg  <wl@gnu.org>
1464
1465	[woff2] Fix memory leak.
1466
1467	Reported as
1468
1469	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28148
1470
1471	* src/sfnt/sfwoff2.c (woff2_open_font): Reject fonts that have
1472	multiple tables with the same tag.  While not explicitly forbidden
1473	in the OpenType specification, it is implicitly forbidden by
1474	describing a binary search algorithm for tables that only works
1475	reliably if table tags are unique.
1476
14772021-02-22  Werner Lemberg  <wl@gnu.org>
1478
1479	* CMakeLists.txt: Update location of `LICENSE.TXT`.
1480
1481	Fixes #1035.
1482
14832021-02-19  Werner Lemberg  <wl@gnu.org>
1484
1485	* builds/unix/ax_pthread.m4: Update from 'autoconf-archive'.
1486
1487	A bunch of fixes were added recently to its git repository.
1488
14892021-02-17  Werner Lemberg  <wl@gnu.org>
1490
1491	[unix] Updates for autoconf 2.71.
1492
1493	This fixes warnings reported by autoupdate.
1494
1495	* builds/unix/ax_pthread.m4: Replace `as_echo` with `AS_ECHO`.
1496
1497	* builds/unix/configure.raw: Remove obsolete `AC_HEADER_STDC`.
1498	Don't escape back quotes in messages for `AC_MSG_WARN`.
1499
15002021-02-16  Werner Lemberg  <wl@gnu.org>
1501
1502	* builds/toplevel.mk: Fix previous commit.
1503
1504	<top_level>: Use `TOP_DIR` in `wildcard` function.
1505	(check_out_submodule, copy_submodule): Move down to come after
1506	definition of `all` rule.
1507	Call `mkdir` conditionally.
1508
15092021-02-16  Werner Lemberg  <wl@gnu.org>
1510
1511	* builds/toplevel.mk: Use rules for handling 'dlg'.
1512
1513	Suggested by Alexei.
1514
1515	(check_out_submodule, copy_submodule): New targets.
1516	<top-level>: Replace calls to `shell` with rules.
1517
15182021-02-16  Werner Lemberg  <wl@gnu.org>
1519
1520	* builds/toplevel.mk: Avoid side effects of `shell`.
1521
1522	We use a dummy variable to catch its output.  Otherwise the `make`
1523	program is going to interpret the return value of `shell`; this can
1524	cause obscure warning or error messages or even be harmful.
1525
15262021-02-16  Werner Lemberg  <wl@gnu.org>
1527
1528	Move 'dlg' submodule to `subprojects` directory.
1529
1530	This is for future changes with Meson, which doesn't allow a
1531	different name for its `subprojects` directory.  Having both a
1532	`submodules` and a `subprojects` directory is confusing.
1533
1534	* .gitmodules, autogen.sh (copy_submodule_files, DLG_INC_DIR,
1535	DLG_SRC_DIR): Updated.
1536
1537	* builds/toplevel.mk (<top-level>, do-dist),
1538	builds/windows/vc2010/script.bat: Updated.
1539
1540	* src/tools/no-copyright: Updated.
1541
15422021-02-16  Dominik Röttsches  <drott@chromium.org>
1543
1544	[sfnt] Update paint format values to support non-variable paints.
1545
1546	* freetype.h (FT_PaintFormat): Update paint format identifiers after
1547	a specification change.  The specification was updated to have
1548	sibling formats, variable and non-variable variants for each.
1549	Reflect that here.
1550
1551	* sfnt/ttcolr.c (read_paint): Remove parsing of variable indices as
1552	the non-variable formats no longer have them.
1553
15542021-02-15  Daniel E  <daniel.engberg.lists@pyret.net>
1555
1556	* CMakeLists.txt: Improve 'bz2' support.
1557
1558	Not all distributions such as FreeBSD provide a `.pc` file for
1559	'(lib)bz2' so follow autotools and add it to `Libs.private` instead.
1560
15612021-02-13  Werner Lemberg  <wl@gnu.org>
1562
1563	* src/tools/update-copyright-year: Fix single-year entry handling.
1564
1565	The fix from 2021-01-17 didn't cover the case where the year to be
1566	updated is identical to the current year.
1567
15682021-02-13  Werner Lemberg  <wl@gnu.org>
1569
1570	Add new function `FT_Get_Transform`.
1571
1572	See
1573
1574	  https://github.com/harfbuzz/harfbuzz/issues/2428
1575
1576	for some reasons to introduce this function.
1577
1578	* include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Transform):
1579	Implement it.
1580
15812021-02-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
1582
1583	Decorate `qsort` callbacks with `cdecl`.
1584
1585	* include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF):
1586	Add new macro.
1587
1588	* src/base/ftrfork.c, src/bdf/bdflib.c, src/gxvalid/gxvcommn.c,
1589	src/psaux/afmparse.c, src/psnames/psmodule.c, src/type1/t1afm.c,
1590	src/sfnt/sfwoff.c, src/sfnt/sfwoff2.c: Update `qsort` callbacks.
1591
1592	Fixes #1026 when compiling FreeType with an unusual calling
1593	convention while the C library function `qsort` still expects
1594	`cdecl`.
1595
15962021-02-10  Dominik Röttsches  <drott@chromium.org>
1597
1598	[sfnt] Implement 'COLR' v1 sweep gradients.
1599
1600	* freetype.h (FT_PaintSweepGradient): Add `FT_PaintSweepGradient` to
1601	represent a 'COLR' v1 sweep gradient.
1602	Update format.
1603	(FT_PaintFormat): Update shifted paint formats.
1604	Sync with spec.
1605	* sfnt/ttcolr.c (read_paint): Logic to parse sweep gradients.
1606	Fix struct access in radial gradient implementation.
1607
16082021-02-09  Dominik Röttsches  <drott@chromium.org>
1609
1610	[sfnt] Provide optional root transform for 'COLR' v1 glyph graph.
1611
1612	* include/freetype/freetype.h (FT_Get_Color_Glyph_Paint):
1613	Additional function argument `root_transform` to control whether
1614	root transform should be returned.
1615	(FT_OpaquePaint): Additional tracking field to denote whether
1616	root transform is to be returned.
1617	* include/freetype/internal/sfnt.h
1618	(TT_Get_Color_Glyph_Paint_Func): Propagate additional argument.
1619	* src/base/ftobjs.c (FT_Get_Color_Glyph_Paint): Ditto.
1620	* src/sfnt/ttcolr.c (tt_face_get_colr_glyph_paint): Return root
1621	transform reflecting the size and tranform configured on
1622	`FT_Face`.
1623	(read_paint): Initialize and track status of insert_root_transform
1624	flag.
1625
16262021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1627
1628	* meson.build: s/freetype2_dep/freetype_dep/.
1629
1630	Many projects (e.g., fontconfig, cairo) hardcode the `freetype_dep`
1631	variable name to use FreeType as subproject because that was the
1632	variable name in Centricular's Meson port of FreeType.  While they
1633	should stop hardcoding that variable name, it does not cost us
1634	anything to keep using that name to ease transition.
1635
16362021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1637
1638	[meson] Fix handling of HarfBuzz library.
1639
1640	* meson.build (harfbuzz_dep): Do not fall back to HarfBuzz by
1641	default.
1642
1643	Otherwise it causes a dependency cycle:
1644
1645	  cairo => fontconfig => freetype2 => harfbuzz => cairo
1646
1647	Meson will still fall back to HarfBuzz subprojects if the `harfbuzz`
1648	option is set to `enabled` instead of `auto` and a
1649	`subprojects/harfbuzz.wrap` file is present.  In that case it is the
1650	responsibility of the main project to set the proper options on each
1651	subproject to break the dependency cycle.
1652
1653	Fixes: #1028.
1654
16552021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1656
1657	[meson] Fix dependency lookup and generate `ftconfig.h`.
1658
1659	- zlib: If not found on the system, meson can build it as a
1660	  subproject.  We thus never use the (outdated) zlib support that
1661	  comes with FreeType.  Doing so has the additional advantage that
1662	  the zlib code can be shared with other projects like GLib if both
1663	  are subprojects of an application.
1664	- harfbuzz: Build as a subproject if not found on the system.
1665	- 'QUESTION: What if the compiler doesn't support `-D` but uses `/D`
1666	  instead as on Windows?'  Answer: Meson translate arguments for us.
1667	- visibility: Replace self-made code with meson-specific solution.
1668
1669	* meson.build (ft2_defines): Rewrite logic to set and handle it.
1670	(process_header_command): New variable, previously called
1671	`ftoption_command`.
1672	(ftoption_command, ftconfig_command): New variables.
1673	(zlib_option): Removed.
1674	(zlib_dep): New variable.
1675	(ft2_deps): Updated.
1676	(harfbuzz_dep): Updated.
1677	(ftconfig_h_in, ftconfig_h): New variables.
1678	(ft2_sources): Updated.
1679	(ft2_lib): Updated, handle visibility.
1680	(summary): Updted.
1681
1682	* meson_options.txt (zlib): Updated.
1683
16842021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1685
1686	* meson.build: Fix resource compilation on Windows.
1687
1688	This is copied from GStreamer's meson port of FreeType.
1689
1690	(ft2_sources): Add both debug and resource file (the latter for
1691	Windows only).
1692	(ft2_debug_src): Removed.
1693
16942021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1695
1696	* meson.build: s/ft2_libtool_version/ft2_pkgconfig_version/.
1697
1698	(freetype2_dep): Use it.
1699
1700	`ft2_libtool_version` would be the shared library version, not the
1701	one we should use in file `freetype2.pc`.
1702
17032021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1704
1705	* meson.build: Use `meson.override_dependency`.
1706
1707	This is a new meson mechanism to avoid other projects to hard-code
1708	the `freetype2_dep` variable name in their build definition.  It
1709	also ensures that meson does not mix system and subproject versions
1710	of FreeType inside of the same project.
1711
1712	Also remove outdated TODO because `declare_dependency` was already
1713	there.
1714
17152021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1716
1717	* meson.build (bzip2_dep): Simplify.
1718
1719	We remove `static:false` from `find_library('bz2')`.
1720
1721	I don't know whether the previous code was a workaround for an old
1722	meson bug, but at least with version >=0.55.0 (which FreeType uses)
1723	it picks the shared library when both are available.
1724
1725	File `freetype2.pc` still contains the full path to file `libbz2.so`
1726	instead of `-lbz2` – that we need to do this is a meson bug even
1727	present in the current version (0.57.0).
1728
17292021-02-09  Xavier Claessens  <xavier.claessens@collabora.com>
1730
1731	* meson.build: Set project version.
1732
17332021-02-04  Werner Lemberg  <wl@gnu.org>
1734
1735	[base] Fix Netpbm tracing message.
1736
1737	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Don't emit Netpbm
1738	warning if there is nothing to output.
1739
17402021-02-04  Werner Lemberg  <wl@gnu.org>
1741
1742	* src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.
1743
1744	This ensures good logging output, with all lines having a proper
1745	prefix (if requested).
1746
1747	This is a continuation of a similar patch from 2020-12-02, which
1748	missed some locations.
1749
17502021-02-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
1751
1752	* builds/unix/configure.raw [mmap]: Restore default path.
1753
1754	Fixes #1023.
1755
17562021-02-03  Werner Lemberg  <wl@gnu.org>
1757
1758	[psaux] Fix integer overflow.
1759
1760	Reported as
1761
1762	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30154
1763
1764	* src/psaux/psblues.c (cf2_blues_capture): Use `SUB_INT32`.
1765
17662021-02-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
1767
1768	* builds/unix/configure.raw [mmap support]: Explicitly handle Windows.
1769
1770	Fixes #1024.
1771
17722021-01-31  Werner Lemberg  <wl@gnu.org>
1773
1774	* builds/unix/configure.raw [mmap support]: Correctly handle Windows.
1775
1776	Fixes #1024.
1777
17782021-01-31  Werner Lemberg  <wl@gnu.org>
1779
1780	* builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`.
1781
17822021-01-31  Werner Lemberg  <wl@gnu.org>
1783
1784	Always provide logging API.
1785
1786	It's easier to have stubs if FT_DEBUG_LOGGING is undefined than to
1787	modify `ftexport.sym` conditionally.
1788
1789	Problem reported by Alexei.
1790
1791	* src/base/ftdebug.c: Include `ftlogging.h`.
1792	(FT_Trace_Set_Level, FT_Trace_Set_Default_Level, FT_Set_Log_Handler,
1793	FT_Set_Default_Log_Handler) [!FT_DEBUG_LOGGING]: Provide stubs.
1794
17952021-01-31  Werner Lemberg  <wl@gnu.org>
1796
1797	* builds/unix/configure.raw: Fix typo.
1798
1799	Bug introduced in Vincent's last commit bb33f03.
1800
1801	Fixes issue #1021.
1802
18032021-01-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
1804
1805	* src/base/ftstroke.c (FT_Stroker_EndSubPath): Ignore tiny gaps.
1806
1807	Fixes bug #1020.
1808
18092021-01-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
1810
1811	[stroker] Minor clean-up.
1812
1813	* src/base/ftstroke.c (FT_Stroker_{ConicTo,CubicTo}): Reset the last
1814	line length.
1815	(FT_Stroker_EndSubPath): Call `ft_stroker_process_corner'.
1816
18172021-01-27  Vincent Torri  <vincent.torri@gmail.com>
1818
1819	* builds/windows/ftsystem.c: Add shared memory support on Windows.
1820
1821	* CMakeLists.txt (BASE_SRCS), builds/unix/configure.raw (FTSYS_SRC),
1822	builds/windows/vc2010/freetype.vcxproj,
1823	builds/windows/visualc/freetype.vcproj, meson.build (ft2_sources):
1824	Add it (conditionally).
1825
18262021-01-23  Werner Lemberg  <wl@gnu.org>
1827
1828	Require HarfBuzz 2.0.0.
1829
1830	This is needed to make commit f1f9705f9 work.
1831
1832	* CMakeLists.txt (HARFBUZZ_MIN_VERSION), builds/unix/configure.raw
1833	(harfbuzz_pkg), meson.build (harfbuzz_dep): Updated.
1834
18352021-01-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
1836
1837	* autogen.sh: Absorb `version.sed'.
1838	* version.sed: Removed.
1839
18402021-01-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
1841
1842	* srd/base/ftlcdfil.c (FT_Library_SetLcdGeometry): Fix return value.
1843
18442021-01-15  Nikolaus Waxweiler  <madigens@gmail.com>
1845
1846	[afshaper] Fix hb_ot_tags_from_script deprecation warning.
1847
1848	* autofit/afshaper.c (af_shaper_get_coverage): Copy the source code
1849	of the function as suggested in
1850	https://github.com/harfbuzz/harfbuzz/issues/2737 and adjust to handle
1851	at most three tags.
1852
18532021-01-17  Werner Lemberg  <wl@gnu.org>
1854
1855	* src/tools/update-copyright-year: Fix single-year entry handling.
1856
18572021-01-16  Alexei Podtelezhnikov  <apodtele@gmail.com>
1858
1859	* builds/unix/unixddef.mk: Remove the second DEVEL_DIR definition.
1860
18612021-01-14  Dominik Röttsches  <drott@chromium.org>
1862
1863	[sfnt] Additional checks for 'colr' table presence.
1864
1865	* sfnt/ttcolr.c (tt_face_get_colr_glyph_paint,
1866	tt_face_get_colorline_stops, tt_face_get_paint): Additional checks
1867	for whether colr table is present.  Prevents crashes when these
1868	methods are called on non-COLR fonts.
1869
18702021-01-13  Dominik Röttsches  <drott@chromium.org>
1871
1872	Add config option to test for 'COLR' v1 support in headers.
1873
1874	* include/freetype/config/ftoption.h (TT_SUPPORT_COLRV1): New macro
1875	so that clients can test whether the FreeType checkout that they are
1876	building against supports the 'COLR' v1 API.  This is intended to be
1877	a temporary solution until 'COLR' v1 support is released in a
1878	FreeType version and such a check can be made by using the version
1879	number instead.
1880
18812020-12-16  Dominik Röttsches  <drott@chromium.org>
1882
1883	[base] Fill 'COLR' v1 API templates to make them work (#59703).
1884
1885	* src/base/ftobjs.c (FT_Get_Color_Glyph_Paint, FT_Get_Paint_Layers,
1886	FT_Get_Paint, FT_Get_Colorline_Stops): Add basic sanity checks,
1887	check for existence of `FT_Face`, check arguments and delegate calls
1888	for the respective 'COLR' v1 API to the SFNT driver.
1889
18902020-12-16  Dominik Röttsches  <drott@chromium.org>
1891
1892	[sfnt] Register 'COLR' v1 API in driver (#59703).
1893
1894	* include/freetype/internal/sfnt.h (TT_Get_Color_Glyph_Paint_Func,
1895	TT_Get_Paint_Layers_Func, TT_Get_Colorline_Stops_Func,
1896	TT_Get_Paint_Func): New function pointer types.
1897	(SFNT_Interface): Add them.
1898	(FT_DEFINE_SFNT_INTERFACE): Updated.
1899
1900	* src/sfnt/sfdriver.c (PUT_COLOR_LAYERS_V1): New macro.
1901	(sfnt_interface): Add new function pointers.
1902
19032020-12-16  Dominik Röttsches  <drott@chromium.org>
1904
1905	[sfnt] Add 'COLR' v1 API to retrieve color layers (#59703).
1906
1907	* src/sfnt/ttcolr.c (tt_face_get_paint_layers): New function to get
1908	the layers of a `PaintColrLayers` table in the font, using an
1909	`FT_LayerIterator` from an `FT_PaintColrLayers` object retrieved via
1910	`tt_face_get_paint`.
1911
1912	* src/sfnt/ttcolr.h: Updated.
1913
19142020-12-16  Dominik Röttsches  <drott@chromium.org>
1915
1916	[sfnt] Add 'COLR' v1 API to iterate color stops (#59703).
1917
1918	* src/sfnt/ttcolr.c (tt_face_get_colorline_stops): New function to
1919	return the current `FT_ColorStop` object from `FT_ColorStopIterator`.
1920	Also increment the iterator.
1921
1922	* src/sfnt/ttcolr.h: Updated.
1923
19242020-12-16  Dominik Röttsches  <drott@chromium.org>
1925
1926	[sfnt] Add API to get actual paint from `FT_OpaquePaint` (#59703).
1927
1928	* src/sfnt/ttcolr.c (tt_face_get_paint): New function to resolve an
1929	`FT_OpaquePaint` paint reference into an `FT_COLR_Paint` object of a
1930	certain format, which contains the detailed information stored in a
1931	paint of the respective format.
1932	(read_paint): New function to provide the format specific parsing
1933	and to populate the data members of each specific `FT_COLR_Paint`
1934	subtype.
1935	(read_color_line): New function to parse retrieved color line
1936	information into an `FT_ColorLine` object, which has information
1937	about the color line extend mode as well as an
1938	`FT_ColorStopIterator` object.
1939
1940	* src/sfnt/ttcolr.h: Updated.
1941
19422020-12-16  Dominik Röttsches  <drott@chromium.org>
1943
1944	[sfnt] Add API to retrieve 'COLR' v1 root paint (#59703).
1945
1946	* src/sfnt/ttcolr.c (BaseGlyphV1Record): New structure.
1947	(tt_face_load_colr): Handle version 1 table header.
1948	(find_base_glyph_v1_record): New auxiliary function.
1949	(tt_face_get_colr_glyph_paint): New function to find the root
1950	`FT_OpaquePaint` object for a given glyph ID.
1951
1952	* src/sfnt/ttcolr.h: Updated.
1953
19542020-12-16  Dominik Röttsches  <drott@chromium.org>
1955
1956	Add new methods required for 'COLR' v1 to public API (#59703).
1957
1958	* include/freetype/freetype.h (FT_Get_Color_Glyph_Paint): New method
1959	for retrieving the root paint object for a color glyph by specifying
1960	a glyph ID.
1961	(FT_Get_Paint_Layers): New method for retrieving the layers of a
1962	`PaintColorGlyph`.
1963	(FT_Get_ColorLine_Stops): New method for retrieving the stops of a
1964	color.
1965	(FT_Get_Paint): New method for resolving an `FT_OpaquePaint` into an
1966	`FT_COLR_Paint` object.
1967
19682020-12-16  Dominik Röttsches  <drott@chromium.org>
1969
1970	Add types required for 'COLR' v1 to public API (#59703).
1971
1972	* include/freetype/freetype.h (FT_PaintFormat, FT_ColorStopIterator,
1973	FT_ColorIndex, FT_ColorStop, FT_PaintExtend, FT_ColorLine,
1974	FT_Affine23, FT_CompositeMode, FT_OpaquePaint, FT_PaintColrLayers,
1975	FT_PaintSolid, FT_PaintLinearGradient, FT_PaintRadialGradient,
1976	FT_PaintGlyph, FT_PaintColrGlyph, FT_PaintTransformed,
1977	FT_PaintTranslate, FT_PaintRotate, FT_PaintSkew, FT_PaintComposite,
1978	FT_COLR_Paint): Adding structs and enum to represent paint format,
1979	color stop information, gradient extend information, structs to
1980	reference paint offsets, and to define transforms and compositions.
1981	Adding a union type to represent the union of the structs,
1982	distinguished by `FT_PaintFormat`.
1983
19842021-01-10  Werner Lemberg  <wl@gnu.org>
1985
1986	* builds/*: s/BUILD_DIR/PLATFORM_DIR/.
1987
1988	The old variable name caused confusion.
1989
19902021-01-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
1991
1992	[builds] Revert `FTMODULE_H' changes.
1993
1994	* builds/toplevel.mk, builds/freetype.mk: Revert changes.
1995
19962021-01-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
1997
1998	[builds/windows] Fix up DLG build with VC++.
1999
2000	* builds/windows/vc2010/script.bat: Copy headers to include/.
2001	* builds/windows/vc2010/freetype.vcxproj: Remove DLG paths.
2002
20032021-01-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
2004
2005	[builds] Relocate `FTMODULE_H'.
2006
2007	* builds/toplevel.mk: Place `FTMODULE_H' in include/.
2008	* builds/freetype.mk: Simplify included path.
2009
20102021-01-07  Werner Lemberg  <wl@gnu.org>
2011
2012	Fix ABI incompatibility.
2013
2014	* include/freetype/ftimage.h (FT_Pixel_Mode): Don't insert
2015	`FT_PIXEL_MODE_GRAY16' but append it.
2016
2017	* src/base/ftobjs.c (pixel_modes): Updated.
2018
20192021-01-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
2020
2021	[dlg] Move the headers to include/dlg to simplify their use.
2022
2023	* autogen.sh, builds/toplevel.mk: Copy headers to include/dlg.
2024	* builds/freetype.mk, builds/windows/vc2010/freetype.vcxproj:
2025	Simplify included path.
2026	* include/freetype/internal/ftdebug.h: Simplify #include.
2027	* src/dlg/rules.mk, .gitignore: Updated.
2028
20292021-01-06  Werner Lemberg  <wl@gnu.org>
2030
2031	* meson.build: Add summary.
2032
2033	Based on a patch from Vincent Torri <vincent.torri@gmail.com>.
2034
20352021-01-06  Torsten Hilbrich  <emacs.nolkaf@hilbrich.tk>
2036
2037	* meson.build: Fix 'png' build option (#59458).
2038
2039	Without this patch, 'png' is always required.
2040
20412021-01-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
2042
2043	[builds/windows] Add SDF to VC2010 project.
2044
2045	* builds/windows/vc2010/freetype.vcxproj: Updated;
2046	AfterBuild conveniences.
2047
20482020-12-26  Werner Lemberg  <wl@gnu.org>
2049
2050	[sdf] Use 'counter-clockwise', not 'anti-clockwise'.
2051
2052	We prefer US nomenclature.
2053
2054	* src/sdf/ftsdf.c (SDF_Contour_Orientation):
2055	s/SDF_ORIENTATION-ACW/SDF_ORIENTATION_CCW/.
2056	Update all users.
2057
20582020-12-26  Werner Lemberg  <wl@gnu.org>
2059
2060	* src/base/ftobjs.c (pixel_modes): Updated.
2061
20622020-12-26  Anuj Verma  <anujv@iitbhilai.ac.in>
2063
2064	[sdf] Remove custom memory tracker.
2065
2066	The internal FreeType memory tracker is sufficient.
2067
2068	* src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER, SDF_MemoryUser,
2069	sdf_alloc, sdf_free, SDF_ALLOC, SDF_FREE,
2070	SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP,
2071	SDF_MEMORY_TRACKER_DONE): Removed.
2072
2073	s/SDF_ALLOC/FT_ALLOC/.
2074	s/SDF_FREE/FT_FREE/.
2075
2076	Other updates.
2077
20782020-12-24  Werner Lemberg  <wl@gnu.org>
2079
2080	[sdf] Fix `make multi`.
2081
2082	* src/sdf/ftsdf.c: Include `ftoutln.h`.
2083
20842020-12-24  Werner Lemberg  <wl@gnu.org>
2085
2086	[sdf] Fix tracing.
2087
2088	* include/freetype/internal.fttrace.h: Add 'bsdf' component.
2089
2090	* src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define.
2091
20922020-08-21  Anuj Verma  <anujv@iitbhilai.ac.in>
2093
2094	[sdf] Add debugging function.
2095
2096	* src/sdf/ftsdf.c (sdf_shape_dump): New function.
2097
20982020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2099
2100	[sdf] Add 'bsdf' renderer to 'sdf' module.
2101
2102	* src/sdf/ftsdfrend.c (ft_bsdf_render): New function.
2103
2104	(ft_bitmap_sdf_renderer_class): New structure.
2105
21062020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2107
2108	[sdf] Add interface functions for the 'bsdf' rasterizer.
2109
2110	* src/sdf/ftsdf.c (bsdf_raster_new, bsdf_raster_reset,
2111	bsdf_raster_set_mode, bsdf_raster_render, bsdf_raster_done): New
2112	functions.
2113
2114	(ft_bitmap_sdf_raster): New variable.
2115
2116	* src/sdf/ftsdf.h: Updated.
2117
21182020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2119
2120	[sdf] Add function to copy SDF data into output bitmap.
2121
2122	* src/sdf/ftbsdf.c (finalize_sdf): New function.
2123
21242020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2125
2126	[sdf] Add '8-point sequential Euclidean distance mapping' algorithm.
2127
2128	* src/sdf/ftbsdf.c (compare_neighbor, first_pass, second_pass,
2129	edt8): New functions.
2130
21312020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2132
2133	[sdf] Add function to copy source bitmap to distance map.
2134
2135	* src/sdf/ftbsdf.c (bsdf_init_distance_map): New function.
2136
21372020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2138
2139	[sdf] Add functions to compute pixel edge distances.
2140
2141	* src/sdf/ftbsdf.c (compute_edge_distance, bsdf_approximate_edge):
2142	New functions.
2143
21442020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2145
2146	[sdf] Add function to find edge pixels in a grid of alpha values.
2147
2148	* src/sdf/ftbsdf.c (bsdf_is_edge): New function.
2149
21502020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2151
2152	[sdf] Add essential structures for the 'bsdf' rasterizer.
2153
2154	* src/sdf/ftbsdf.c (ONE): New macro.
2155	(BSDF_TRaster, ED, BSDF_Worker): New structures.
2156	(zero_ed): New constant.
2157
21582020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2159
2160	[sdf] Add 'sdf' module to non-gnumake build systems.
2161
2162	* include/freetype/config/ftmodule.h: Add both the 'sdf' and 'bsdf'
2163	renderers to the list of modules.
2164
2165	* CMakeLists.txt (BASE_SRCS): Add 'sdf' single-object module.
2166
21672020-08-20  Anuj Verma  <anujv@iitbhilai.ac.in>
2168
2169	[sdf] Added basic overlapping contour support.
2170
2171	* src/sdf/ftsdf.c (sdf_generate_with_overlaps): New function.
2172	(sdf_raster_render): Enable it.
2173
21742020-08-19  Anuj Verma  <anujv@iitbhilai.ac.in>
2175
2176	[sdf] Add build infrastructure.
2177
2178	* src/sdf/module.mk, src/sdf/rules.mk: New files.
2179
2180	* src/sdf/ftsdf.h (ft_sdf_raster): New forward declaration.
2181
2182	* include/freetype/ftmoderr.h (FT_MODERRDEF): Add error definition
2183	for the 'sdf' module.
2184
2185	* include/freetype/internal/fttrace.h (FT_TRACE_DEF): Add trace
2186	definition for the `sdf' module.
2187
2188	* modules.cfg (RASTER_MODULES): Add the `sdf' module to the list of
2189	rasterizers.
2190
21912020-08-19  Anuj Verma  <anujv@iitbhilai.ac.in>
2192
2193	[sdf] Add interface functions for the 'sdf' rasterizer.
2194
2195	* src/sdf/ftsdf.c (sdf_raster_new, sdf_raster_reset,
2196	sdf_raster_set_mode, sdf_raster_render, sdf_raster_done): New
2197	functions.
2198	(ft_sdf_raster): New structure.
2199
22002020-08-19  Anuj Verma  <anujv@iitbhilai.ac.in>
2201
2202	[sdf] Add subdivision and bounding box optimization.
2203
2204	* src/sdf/ftsdf.c (sdf_generate_bounding_box): New function, which
2205	is an optimized version of `sdf_generate`.
2206	(sdf_generate_subdivision): New function.
2207
22082020-08-19  Anuj Verma  <anujv@iitbhilai.ac.in>
2209
2210	[sdf] Add function to generate SDF.
2211
2212	* src/sdf/ftsdf.c (sdf_generate): New function, currently disabled.
2213	This is a proof-of-concept implementation: It doesn't use any
2214	optimization, it simply checks all grid points against all contours.
2215
22162020-08-19  Anuj Verma  <anujv@iitbhilai.ac.in>
2217
2218	[sdf] Add functions to get shortest distance from any edge/contour.
2219
2220	* src/sdf/ftsdf.c (sdf_edge_get_min_distance): New function.
2221	(sdf_contour_get_min_distance): New function, currently disabled.
2222
22232020-08-18  Anuj Verma  <anujv@iitbhilai.ac.in>
2224
2225	[sdf] Add shortest distance finding functions.
2226
2227	* src/sdf/ftsdf.c (get_min_distance_line, get_min_distance_conic,
2228	get_min_distance_cubic): New functions.  Note that
2229	`get_min_distance_conic` comes with two implementations (using an
2230	analytical and an iterative method, to be controlled with the
2231	`USE_NEWTON_FOR_CONIC` macro).
2232
22332020-08-18  Anuj Verma  <anujv@iitbhilai.ac.in>
2234
2235	[sdf] Add function to resolve corner distances.
2236
2237	* src/sdf/ftsdf.c (resolve_corner): New function.
2238
22392020-08-18  Anuj Verma  <anujv@iitbhilai.ac.in>
2240
2241	[sdf] Add essential math functions.
2242
2243	* src/sdf/ftsdf.c (cube_root, arc_cos) [!USE_NEWTON_FOR_CONIC]: New
2244	auxiliary functions.
2245
2246	* src/sdf/ftsdf.c (solve_quadratic_equation, solve_cubic_equation)
2247	[!USE_NEWTON_FOR_CONIC]: New functions.
2248
22492020-08-18  Anuj Verma  <anujv@iitbhilai.ac.in>
2250
2251	[sdf] Add utility functions for contours.
2252
2253	* src/sdf/ftsdf.c (get_control_box, get_contour_orientation): New
2254	functions.
2255	(split_conic, split_cubic, split_sdf_conic, split_sdf_cubic,
2256	split_sdf_shape): New functions.
2257
22582020-08-17  Anuj Verma  <anujv@iitbhilai.ac.in>
2259
2260	[sdf] Add functions to decompose `FT_Outline`.
2261
2262	* src/sdf/ftsdf.c (sdf_move_to, sdf_line_to, sdf_conic_to,
2263	sdf_cubic_to): New auxiliary decomposition functions.
2264	(sdf_compose_funcs): New structure.
2265	(sdf_outline_decompose): New function.
2266
22672020-08-17  Anuj Verma  <anujv@iitbhilai.ac.in>
2268
2269	[sdf] Structs, enums, macros, and functions for 'sdf' rasterizer.
2270
2271	* src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER)
2272	[FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New macros.
2273	(SDF_MemoryUser) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New
2274	struct for memory usage tracing.
2275	(sdf_alloc, sdf_free) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New
2276	functions for memory usage tracing.
2277
2278	(SDF_ALLOC, SDF_FREE): New macros for memory management.
2279	(SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP,
2280	SDF_MEMORY_TRACKER_DONE): New macros to set up memory usage tracing.
2281
2282	(USE_NEWTON_FOR_CONIC, MAX_NEWTON_DIVISIONS, MAX_NEWTON_STEPS,
2283	CORNER_CHECK_EPSILON, CG_DIMEN): New configuration macros for
2284	controlling the process of finding the shortest distance.
2285
2286	(MUL_26D6, VEC_26D6_DOT): New auxiliary macros.
2287
2288	(SDF_TRaster, SDF_Edge, SDF_Contour, SDF_Shape, SDF_Signed_Distance,
2289	SDF_Params): New structs for setting up SDF data.
2290	(SDF_Edge_Type, SDF_Contour_Orientation): New enums for SDF data.
2291
2292	(zero_vector, null_edge, null_contour, null_shape, max_sdf): Useful
2293	constants.
2294
2295	(sdf_edge_new, sdf_edge_done, sdf_contour_new, sdf_contour_done,
2296	sdf_shape_new, sdf_shape_done): New constructors and destructors.
2297
22982020-08-17  Anuj Verma  <anujv@iitbhilai.ac.in>
2299
2300	[sdf] Add raster parameters structure.
2301
2302	* src/sdf/ftsdf.h (SDF_Raster_Params): New structure.
2303
2304	* src/sdf/sdf.c: Include source files in order to make a single
2305	object of the module.
2306
23072020-08-17  Anuj Verma  <anujv@iitbhilai.ac.in>
2308
2309	[sdf] Add 'sdf' renderer.
2310
2311	* src/sdf/ftsdf.c: Add 'sdf' renderer along with its interface
2312	functions.
2313	Also add functions to set and get properties.
2314
23152020-08-17  Anuj Verma  <anujv@iitbhilai.ac.in>
2316
2317	[sdf] Add common elements for 'sdf' and 'bsdf' renderers.
2318
2319	* src/sdf/ftsdfrend.h (SDF_Rendere_Module, ft_sdf_renderer_class,
2320	ft_bitmap_sdf_renderer_class): New structures.
2321
2322	* src/sdf/ftsdfcommon.h (DEFAULT_SPREAD, MIN_SPREAD_MAX_SPREAD,
2323	USE_SQUARED_DISTANCES): New macros.
2324	(FT_INT_26D6, FT_INT_16D16, FT_26D6_16D16): New macros.
2325	(FT_CALL, VECTOR_LENGTH_16D16): New macros.
2326	(FT_26D6_Vec, FT_16D16_Vec, FT_16D16, FT_26D6, FT_6D10, FT_CBox):
2327	New typedefs.
2328	(square_root): New macro.
2329
2330	* src/sdf/ftsdferrs.h: Add module error setup.
2331
23322020-08-16  Anuj Verma  <anujv@iitbhilai.ac.in>
2333
2334	[sdf] Add files for new 'sdf' module.
2335
2336	Here is a breakdown of what the files will contain.
2337
2338	* src/sdf/ftsdfrend.c, src/sdf/ftsdfrend.h: The 'sdf' and 'bsdf'
2339	renderers.
2340
2341	* src/sdf/ftsdf.c, src/sdf/ftsdf.h: The rasterizer for the 'sdf'
2342	renderer.
2343	* src/sdf/ftbsdf.c, src/sdf/ftbsdf.h: The rasterizer for the 'bsdf'
2344	renderer.
2345
2346	* src/sdf/ftsdfcommon.h: Commmon properties and functions for both
2347	rasterizers.
2348	* src/sdf/ftsdferrs.h: Common error defines.
2349
2350	* src/sdf/sdf.c: For building a single object of the entire module.
2351
23522020-08-16  Anuj Verma  <anujv@iitbhilai.ac.in>
2353
2354	[base] Allow renderers of different formats.
2355
2356	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the
2357	glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`.  The forthcoming
2358	'bsdf' renderer will require bitmaps for processing.
2359
2360	* src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove
2361	renderer's glyph format check before adding and removing them.  The
2362	'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`.
2363
23642020-08-16  Anuj Verma  <anujv@iitbhilai.ac.in>
2365
2366	Add data types required for the forthcoming 'sdf' module.
2367
2368	* include/freetype/freetype.h (FT_Render_Mode): Add new render mode
2369	`FT_RENDER_MODE_SDF`, which will be used to generate SDF.
2370
2371	* include/freetype/ftimage.h (FT_Pixel_Mode): Add new pixel mode
2372	`FT_PIXEL_MODE_GRAY16`, which will be the output of the 'sdf'
2373	module.
2374	(FT_RASTER_FLAG_SDF): New raster flag to be used internally by the
2375	'sdf' module.
2376
2377	* include/freetype/fttypes.h (FT_F6Dot10): New data type.
2378
23792020-08-16  Anuj Verma  <anujv@iitbhilai.ac.in>
2380
2381	[base] Allow renderers of different formats.
2382
2383	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Do not return if the
2384	glyph's slot format is `FT_GLYPH_FORMAT_BITMAP`.  The forthcoming
2385	'bsdf' renderer will require bitmaps for processing.
2386
2387	* src/base/ftobjs.c (ft_add_renderer, ft_remove_renderer): Remove
2388	renderer's glyph format check before adding and removing them.  The
2389	'bsdf' renderer will have a format `FT_GLYPH_FORMAT_BITMAP`.
2390
23912020-12-23  Werner Lemberg  <wl@gnu.org>
2392
2393	* builds/windows/detect.mk (COPY): Make it work with `shell`.
2394
2395	Without this patch, we get the error
2396
2397	  builds/toplevel.mk:127: *** missing separator.  Stop.
2398
2399	Reported by Anuj, with a solution from Alexei.
2400
24012020-12-23  Ignacio Casal Quinteiro  <qignacio@amazon.com>
2402
2403	* meson.build (ft2_defines): Fix builds on Windows.
2404
24052020-12-18  Tatsuyuki Ishi  <ishitatsuyuki@gmail.com>
2406
2407	[autofit] Fix double division in stem darkening.
2408
2409	The old code used to divide the darkening amount by em_ratio twice,
2410	leading to unnecessarily bold stems on certain fonts with higher
2411	units per em (e.g. Inter). This patch fixes it.
2412
2413	The return value of af_loader_compute_darkening was also changed to
2414	use 16.16 fixed point to get rid of a redundant truncation operation.
2415	This should slightly improve the precision, although it's still
2416	bottlenecked by the emboldening function, which uses 26.6 fixed point.
2417
2418	* src/autofit/afloader.[ch]
2419	(af_loader_compute_darkening): Return FT_Fixed.
2420	(af_loader_embolden_glyph_in_slot): Revise calculations.
2421
24222020-12-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
2423
2424	* include/freetype/ftmodapi.h (FT_FACE_DRIVER_NAME): New public macro.
2425
2426	The driver name is needed for `FT_Property_Set' and `FT_Property_Get'.
2427
24282020-12-16  Chris Liddell  <chris.liddell@artifex.com>
2429
2430	[truetype] Fix incremental metrics (#59503).
2431
2432	* src/truetype/ttgload.c (tt_get_metrics, load_truetype_glyph):
2433	Previously, the code would populate the phantom points before
2434	calling the `get_glyph_metrics` callback.  For formats like PCL XL
2435	format 1, class 2 downloaded fonts (where metrics are removed from
2436	the TTF header), this causes problems when the hinting program uses
2437	the phantom points (misplaced and distorted glyphs) due to the
2438	metrics being unset (all zeros).
2439	(tt_get_metrics_incr_overrides): Renamed to...
2440	(tt_get_metrics_incremental): ... this.  Updated caller
2441
2442	* include/freetype/ftincrem.h: Update the documentation to make it
2443	clearer that `get_glyph_metrics` is to retrieve metrics from a
2444	non-standard source, but *not* for the purpose of imposing custom
2445	metrics.
2446
24472020-12-14  Werner Lemberg  <wl@gnu.org>
2448
2449	[type42] Pacify static analysis tools (#59682).
2450
2451	* src/type42/t42objs.c (T42_Size_Init, T42_GlyphSlot_Init): Avoid
2452	warnings about uninitialized variables.
2453
24542020-12-07  Werner Lemberg  <wl@gnu.org>
2455
2456	* builds/unix/configure.raw: Don't set `FT_DEBUG_LOGGING`.
2457
2458	All debug options are handled exclusively in `ftoption.h`.
2459
24602020-12-07  Werner Lemberg  <wl@gnu.org>
2461
2462	* src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.
2463
24642020-12-07  Werner Lemberg  <wl@gnu.org>
2465
2466	*/*: s/FT_LOGGING/FT_DEBUG_LOGGING/.
2467
24682020-12-05  Werner Lemberg  <wl@gnu.org>
2469
2470	* builds/toplevel.mk (do-dist): Remove `submodules` directory.
2471
24722020-12-02  Werner Lemberg  <wl@gnu.org>
2473
2474	* src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.
2475
2476	This ensures good logging output, with all lines having a proper
2477	prefix (if requested).
2478
24792020-12-02  Werner Lemberg  <wl@gnu.org>
2480
2481	[base] Don't close 'stderr' after logging.
2482
2483	* src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit):
2484	Fix it.
2485
24862020-12-02  Werner Lemberg  <wl@gnu.org>
2487
2488	* submodules/dlg: Updated to commit 9f0c8b22.
2489
24902020-12-02  Werner Lemberg  <wl@gnu.org>
2491
2492	* src/bdf/bdflib.c: Fix `-Wformat` warning.
2493
24942020-12-02  Werner Lemberg  <wl@gnu.org>
2495
2496	Improve setup for 'dlg' library.
2497
2498	* autogen.sh (copy_submodule_file), builds/toplevel.mk: Redirect
2499	stderr to `/dev/null`.
2500
2501	* builds/toplevel.mk: Move code block to handle 'dlg' stuff into
2502	`check_platform` conditional.
2503	Also fix wildcard expressions for guarding `git submodule` commands.
2504	Also make file copying work with non-Unix platforms (untested).
2505
25062020-12-01  Werner Lemberg  <wl@gnu.org>
2507
2508	[build] Use gcc (and clang) in C99 mode.
2509
2510	Other compilers are unchanged.
2511
2512	* builds/compiler/gcc-dev.mk, builds/compiler/gcc.mk (ANSIFLAGS):
2513	s/-ansi/-std=c99/.
2514
2515	* builds/freetype.mk (FT_CFLAGS): Remove `-std=c99`.
2516
2517	* builds/unix/configure.raw: Handle C99.
2518	Remove no longer needed test for gcc 4.6 and earlier.
2519
25202020-12-01  Werner Lemberg  <wl@gnu.org>
2521
2522	[dlg] Fix compiler warnings.
2523
2524	* src/dlg/dlgwrap.c: Duplicate some feature test macros from
2525	`dlg.c`, which must come first before loading standard headers.  For
2526	example, `freetype.h` loads `stdio.h` if compiled in debug mode.
2527
25282020-12-01  Werner Lemberg  <wl@gnu.org>
2529
2530	* src/type42/t42parse.c: Fix `-Wformat` warnings.
2531
25322020-12-01  Priyesh Kumar  <priyeshkkumar@gmail.com>
2533
2534	[builds/unix] Check for 'pthread' library.
2535
2536	* builds/unix/ax_pthread.m4: New file, taken from 'autoconf-archive'
2537	git repository.
2538
2539	* builds/unix/configure.raw: Check for 'pthread'; also check whether
2540	it works.
2541
25422020-12-01  Werner Lemberg  <wl@gnu.org>
2543
2544	[base] Implement vertical alignment of log printing.
2545
2546	Based on a patch by Priyesh.
2547
2548	* include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH):
2549	New macro.
2550
2551	* src/base/ftdebug.c, builds/windows/ftdebug.c (ft_log_handler):
2552	Print logs after a fixed width to handle different lengths of
2553	`FT_COMPONENT` entries.
2554	Use `ft_strrchr` to check for final newline character.
2555
25562020-11-30  Priyesh Kumar  <priyeshkkumar@gmail.com>
2557
2558	Update logging related documentation.
2559
2560	* docs/DEBUG: Updates related to `FT_LOGGING`.
2561
2562	* README.git: Updates related to logging.
2563
25642020-11-30  Priyesh Kumar  <priyeshkkumar@gmail.com>
2565
2566	* src/*: Fix `-Wformat` warnings.
2567
25682020-11-30  Priyesh Kumar  <priyeshkkumar@gmail.com>
2569
2570	[builds/windows] Changes to build 'dlg' with FreeType on Windows.
2571
2572	We only support Visual C++ 2010 and newer.
2573
2574	* builds/windows/vc2010/script.bat: New windows batch file to copy
2575	necessary 'dlg' files from `submodules/dlg` to `src/dlg`.  This file
2576	is used as a pre-built event in Visual C++.
2577
2578	* builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`.
2579
2580	* builds/windows/vc2010/freetype.vcxproj.filters: Add
2581	`src/dlgwrap.c`.
2582
2583	* builds/windows/vc2010/freetype.vcxproj
2584	(AdditionalIncludeDirectories): Add include files of dlg for 'Debug'
2585	and 'Debug Static' configurations on both 'x64' and 'win32'
2586	platforms.
2587	(PreprocessorDefinitions): Add `FT_LOGGING` for 'Debug' and 'Debug
2588	Static' configurations on both 'x64' and 'win32' platforms.
2589	Add `DLG_STATIC' for 'Debug' configuration on 'x64' and 'win32'
2590	platforms.
2591	(DisableLanguageExtensions): We need to disable the `/Za` option
2592	when building 'dlg' with FreeType as 'dlg' strictly follows the C99
2593	standard.  Visual C++ produces behaves unexpectedly when
2594	compiling a C99 file with `/Za` option enabled.
2595
25962020-11-30  Priyesh Kumar  <priyeshkkumar@gmail.com>
2597
2598	[base] Add public API to change log handling function.
2599
2600	* include/freetype/ftlogging.h (FT_Custom_Log_Handler): New function
2601	typedef to store the custom callback logging function.
2602	(FT_Set_Log_Handler, FT_Set_Default_Log_Handler): New functions to
2603	set and reset custom log handler.
2604
2605	* include/freetype/internal/ftdebug.h (custom_output_handler): New
2606	variable to support a custom callback logging function.
2607	(FT_Logging_Callback): A new function typedef to print log using
2608	custom callback logging function, which is set using
2609	`FT_Set_Log_Handler`.
2610	(FT_Log): Use it.
2611
2612	* src/base/ftdebug.c (FT_Set_Log_Handler,
2613	FT_Set_Default_Log_Handler, FT_Logging_Callback): Add function
2614	definitions.
2615
26162020-11-28  Priyesh Kumar  <priyeshkkumar@gmail.com>
2617
2618	[base] Add public API to change the levels of tracing components.
2619
2620	* include/freetype/ftlogging.h: New header file.
2621
2622	* include/freetype/internal/ftdebug.h [FT_LOGGING]: Include
2623	`ftlogging.h`.
2624
2625	* src/base/ftdebug.c (ft_custom_trace_level): New variable.
2626	(ft_debug_init): Update to support change of levels of tracing
2627	components of FreeType at run-time.
2628	(FT_Trace_Set_Level): New function to change the levels of tracing
2629	components at run-time.
2630	(FT_Trace_Set_Default_Level): New function to reset the levels of
2631	tracing components back to default.
2632
26332020-11-28  Priyesh Kumar  <priyeshkkumar@gmail.com>
2634
2635	[base] Updates to print timestamp and name of `FT_COMPONENT` in logs.
2636
2637	* include/freetype/internal/ftdebug.h (FT_LOGGING_TAG,
2638	FT_LOGGING_TAG_): New macros to resolve the value of `FT_COMPONENT'
2639	into a string.
2640	(ft_add_tag, ft_remove_tag): New functions to add and remove dlg tags.
2641
2642	* src/base/ftdebug.c: Add new variables to control the logging of
2643	timestamp and name of `FT_COMPONENT` along with actual logs.
2644	(ft_add_tag, ft_remove_tag): Add function definitions.
2645	(ft_log_handler): Updates to print timestamp and name of
2646	`FT_COMPONENT`.
2647	(ft_debug_init) [FT_LOGGING]: Users can now control the logging of
2648	timestamp and name of `FT_COMPONENT` by adding tags in the
2649	`FT2_DEBUG` environment variable.
2650
26512020-11-27  Priyesh Kumar  <priyeshkkumar@gmail.com>
2652
2653	[base] Add functions and variables to print logs to a file.
2654
2655	* include/freetype/internal/ftdebug.h: Added dlg's header files.
2656	(FT_LOG): New macro to redirect trace logs to dlg's API's whenever
2657	`FT_LOGGING' is defined.
2658	(ft_logging_init, ft_logging_deinit): New functions to handle
2659	initialization and uninitialization of logging related variables.
2660	(ft_log_handler): New function to handle logs of FreeType.
2661
2662	* src/base/ftdebug.c: Add necessary logging related variables.
2663	(ft_logging_init, ft_logging_deinit, ft_log_handler): Add function
2664	definitions.
2665
2666	* src/base/ftinit.c (FT_Init_FreeType) [FT_LOGGING]: Call
2667	`ft_logging_init`.
2668	(FT_Done_FreeType) [FT_LOGGING]: Call `ft_logging_deinit`.
2669
2670	* src/base/ftobjs.c (FT_New_Library): Call `ft_debug_init` only if
2671	`FT_LOGGING` is not defined.
2672
26732020-11-27  Priyesh Kumar  <priyeshkkumar@gmail.com>
2674
2675	[builds] Necessary changes to make 'dlg' compile.
2676
2677	* autogen.sh (copy_submodule_files): New script to copy all the
2678	necessary source and include files from `submodules/dlg` to
2679	`src/dlg`.
2680
2681	* src/dlg/dlgwrap.c: New wrapper file for `src/dlg.c`.  It enables
2682	the build of 'dlg' if the `FT_LOGGING` macro is defined.
2683
2684	* src/dlg/rules.mk: New sub-Makefile.
2685
2686	* builds/freetype.mk (DLG_DIR): New variable to include the
2687	header files of the 'dlg' library.
2688	(INCLUDES): Add `DLG_DIR`.
2689	(FT_CFLAGS): Add `-std=c99' flag.
2690	Include `src/dlg/rules.mk` file to build 'dlg' library.
2691	(OBJ_S, OBJ_M): Add `DLG_OBJS_M` and `DLG_OBJS_S`.
2692
2693	* builds/toplevel.mk: For builds directly from the git repository
2694	we need to copy files from `submodule/dlg` to `src/dlg`.
2695
2696	* include/freetype/config/ftoption.h, devel/ftoption.h (FT_LOGGING):
2697	New macro to enable or disable the logging facility in FreeType.
2698
26992020-11-27  Priyesh Kumar  <priyeshkkumar@gmail.com>
2700
2701	* .gitmodules: Add 'dlg' library's git repository as submodule.
2702
27032020-12-01  Werner Lemberg  <wl@gnu.org>
2704
2705	* src/tools/chktrcmp.py (trace_use_pat): Update to current use.
2706
27072020-11-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
2708
2709	[cff,cid,type1] Demote old engine for lack of CFF2.
2710
2711	* src/cff/cffobjs.c (cff_driver_init): Always default to Adobe engine.
2712	* src/cid/cidobjs.c (cid_driver_init): Ditto.
2713	* src/type1/t1objs.c (T1_Driver_Init): Ditto.
2714
27152020-11-09  Werner Lemberg  <wl@gnu.org>
2716
2717	* src/type42/t42parse.c (t42_parse_sfnts): More tracing messages.
2718
27192020-11-04  Werner Lemberg  <wl@gnu.org>
2720
2721	* meson.build: Fix .pc file generation.
2722
2723	For backwards compatibility we need the libtool version, not the .so
2724	number.
2725
2726	Reported by Nikolaus.
2727
27282020-10-28  Werner Lemberg  <wl@gnu.org>
2729
2730	[truetype] Minor update to forthcoming OpenType 1.8.4 standard.
2731
2732	* src/truetype/ttgxvar.c (ft_var_load_item_variation_store): Limit
2733	size of `regionCount`.
2734
27352020-10-26  Werner Lemberg  <wl@gnu.org>
2736
2737	* meson.build: Fix 'harfbuzz' and 'brotli' build options (#59347).
2738
2739	Without this patch, 'harfbuzz' and 'brotli' are always required.
2740
2741	Patch submitted anonymously in Savannah bug report.
2742
27432020-10-23  Ben Wagner  <bungeman@google.com>
2744
2745	* src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak (#59322).
2746
2747	The issue is that `rows` is allocated but will not be freed in the
2748	event that the call to `png_read_image` fails and calls `longjmp`.
2749
27502020-10-20  Werner Lemberg  <wl@gnu.org>
2751
2752	* Version 2.10.4 released.
2753	==========================
2754
2755
2756	Tag sources with `VER-2-10-4'.
2757
2758	* docs/VERSION.TXT: Add entry for version 2.10.4.
2759	* docs/CHANGES: Updated.
2760
2761	* README, src/base/ftver.rc, builds/windows/vc2010/index.html,
2762	builds/windows/visualc/index.html,
2763	builds/windows/visualce/index.html,
2764	builds/wince/vc2005-ce/index.html,
2765	builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
2766	s/2.10.3/2.10.4/, s/2103/2104/.
2767
2768	* include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
2769
2770	* builds/unix/configure.raw (version_info): Set to 23:4:17.
2771	* CMakeLists.txt (VERSION_PATCH): Set to 4.
2772
27732020-10-19  Werner Lemberg  <wl@gnu.org>
2774
2775	[sfnt] Fix heap buffer overflow (#59308).
2776
2777	This is CVE-2020-15999.
2778
2779	* src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier.
2780
27812020-10-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
2782
2783	* src/sfnt/tt{colr,cpal}.c: Fix signedness warnings from VC++.
2784
27852020-10-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
2786
2787	* src/sfnt/sfwoff2.c (Read255UShort): Tweak types to please VC++.
2788
27892020-10-10  Werner Lemberg  <wl@gnu.org>
2790
2791	* Version 2.10.3 released.
2792	==========================
2793
2794
2795	Tag sources with `VER-2-10-3'.
2796
2797	* docs/VERSION.TXT: Add entry for version 2.10.3.
2798
2799	* README, src/base/ftver.rc, builds/windows/vc2010/index.html,
2800	builds/windows/visualc/index.html,
2801	builds/windows/visualce/index.html,
2802	builds/wince/vc2005-ce/index.html,
2803	builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
2804	s/2.10.2/2.10.3/, s/2102/2103/.
2805
2806	* include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
2807
2808	* builds/unix/configure.raw (version_info): Set to 23:3:17.
2809	* CMakeLists.txt (VERSION_PATCH): Set to 3.
2810
28112020-09-25  Werner Lemberg  <wl@gnu.org>
2812
2813	[autofit] Synchronize with ttfautohint.
2814
2815	This corresponds to the following commits in the ttfautohint git
2816	repository:
2817
2818	  bb6842bd3bd437b7b4a7921b0376c860f5e73d18  Typo, formatting.
2819	  d5c91ddb1cb310257a3dfe9a8e20e1fc51335faa  Add Medefaidrin script.
2820
2821	* src/autofit/afblue.dat: Add blue zone data for Medefaidrin.
2822	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
2823
2824	* src/autofit/afscript.h: Add Medefaidrin standard characters.
2825
2826	* src/autofit/afranges.c, src/autofit/afstyles.h: Add Medefaidrin
2827	data.
2828
28292020-09-25  Werner Lemberg  <wl@gnu.org>
2830
2831	Move `scripts/make_distribution_archives.py` to `src/tools`.
2832
2833	* scr/tools/scripts/make_distribution_archives.py: (_TOP_DIR,
2834	_SCRIPT_DIR): Updated to new location.
2835	(main): s/shutils.copyfile/shutils.copy/ to preserve file
2836	permissions.
2837	(main): Prefix source file paths with `git_dir` while copying files
2838	to allow calls of the script from other places than the top-level
2839	directory.
2840
28412020-09-24  Werner Lemberg  <wl@gnu.org>
2842
2843	* src/cff/cffgload.c (cff_slot_load): Scale `vertBearingY`.
2844
2845	Towards the end of the the function there is a call to
2846	`FT_Outline_Get_CBox` that retrieves the glyph bbox in scaled units.
2847	That sets `horiBearing{X,Y}` and `vertBearingX` but `vertBearingY`
2848	is left alone, and is not scaled.
2849
2850	Patch from Eric Muller <emuller@amazon.com>.
2851
28522020-09-24  Werner Lemberg  <wl@gnu.org>
2853
2854	* src/base/ftobjs.c (FT_Load_Glyph): Trace glyph metrics.
2855
28562020-09-22  Werner Lemberg  <wl@gnu.org>
2857
2858	[meson] Move auxiliary scripts to `builds/meson`.
2859
2860	Suggested by Alexei.
2861
2862	* scripts/*.py: Move meson scripts to...
2863	* builds/meson/*.py: ... this new location.
2864
2865	* meson.build: Updated.
2866
28672020-09-21  David Turner  <david@freetype.org>
2868
2869	Add python script for building tarballs.
2870
2871	* scripts/make_distribution_archives.py: New file.
2872
2873	This standalone Python script should be equivalent to running `make
2874	dist` with the Make-based build system, with the following minor
2875	differences:
2876
2877	- Since `make distclean` doesn't always clean up `objs/` properly,
2878	  `make dist` archives may contain some stale binaries like
2879	  `objs/.libs/libfreetype.so.6` or others.
2880
2881	- `config.guess` and `config.sub` are not updated unless option
2882	  `--gnu-config-dir=DIR` is used to specify the location of these
2883	  files.
2884
2885	- Some bits of the auto-generated reference documentation may
2886	  appear in slightly different order, probably due to issues related
2887	  to mkdocs and docwriter.
2888
2889	As an example, the call
2890
2891	  scripts/make_distribution_archives.py /tmp/freetype2-dist
2892
2893	creates the following files under `/tmp/freetype2-dist`:
2894
2895	  freetype-<version>.tar.gz
2896	  freetype-<version>.tar.xz
2897	  ft<winversion>.zip
2898
28992020-09-21  Werner Lemberg  <wl@gnu.org>
2900
2901	* scripts/extract_freetype_version.py: Fix regex typos.
2902
29032020-09-21  David Turner  <david@freetype.org>
2904
2905	Add Meson build project file.
2906
2907	Example usage:
2908
2909	  # Configure Meson build in directory `build-meson` to generate
2910	  # release binaries comparable to to the ones from the
2911	  # autotools/make build system.
2912	  meson setup build-meson \
2913	        --prefix=/usr/local \
2914	        --buildtype=debugoptimized \
2915	        --strip \
2916	        -Db_ndebug=true
2917
2918	  # After configuring the Meson build with the above command,
2919	  # compile and install to `/usr/local/`; this includes a pkg-config
2920	  # file.
2921	  ninja -C build-meson install
2922
2923	  # Alternatively, compile and install to `/tmp/aa/usr/local/...`
2924	  # for packaging.
2925	  DESTDIR=/tmp/aa ninja -C build-meson install
2926
2927	  # Generate documentation under `build-meson/docs`.
2928	  ninja -C build-meson docs
2929
2930	Library size comparison for stripped `libfreetype.so` generated by
2931	all three build systems:
2932
2933	  - Default build (autotools + libtool): 712 KiB
2934	  - CMake build (RelWithDebInfo):        712 KiB
2935	  - Meson build:                         712 KiB
2936
2937
2938	* meson.build: New top-level Meson build file for the library.
2939
2940	* meson_options.txt: New file.  It holds user-selectable options for
2941	the build, which can be printed with `meson configure`, and selected
2942	at `meson setup` or `meson --reconfigure` time with
2943	`-D<option>=<value>`.
2944
2945	* scripts/parse_modules_cfg.py: A script invoked by `meson.build` to
2946	parse `modules.cfg` and extract important information out of it
2947	(i.e., the list of modules).
2948
2949	* scripts/process_ftoption_h.py: New script invoked by `meson.build`
2950	to process the original `ftoption.h` file.  It enables or disables
2951	configuration macro variables based on the available dependencies.
2952	This is similar to what other build systems are using (i.e., Meson's
2953	`configure_file()` command is not used here).
2954
2955	* scripts/extract_freetype_version.py: New script invoked by
2956	`meson.build` to extract the FreeType version number from
2957	`<freetype/freetype.h>`.
2958
2959	* scripts/extract_libtool_version.py: New script invoked by
2960	`meson.build` to extract the libtool `revision_info` data from
2961	`builds/unix/configure.raw`, and to generate the corresponding
2962	shared library suffix.
2963
2964	* scripts/generate_reference_docs.py: New script invoked by
2965	`meson.build` to generate the FreeType 2 reference documentation
2966	(using the `docwriter` and `mkdocs` packages, which must be already
2967	installed).
2968
29692020-09-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
2970
2971	[raster] Improve the second pass (#58373).
2972
2973	Besides dropout control the second horizontal sweep is supposed to
2974	clean up straight horizontal edges that are mishandled by the first
2975	vertical sweep when a line passes through pixel centers.  This line
2976	would present as perfectly aligned span edges in the second sweep.
2977
2978	* src/raster/ftraster.c (Horizontal_Sweep_Span): Replace the old
2979	implementation with a better one focusing on aligned span edges only.
2980
29812020-09-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
2982
2983	[raster] Tune SMART macro (#58352).
2984
2985	Windows seems to perform smart dropout control at 26.6 precision.
2986	To mimick Windows independent of increased precision, we need to tweak
2987	the macro so that some close calls break down rather than up.
2988
2989	* src/raster/ftraster.c (SMART): Tweak the macro.
2990
29912020-09-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
2992
2993	[raster] Introduce SMART macro.
2994
2995	* src/raster/ftraster.c (SMART): New macro for smart dropout rounding.
2996	(Verstical_Sweep_Drop, Horizontal_Sweep_Drop): Use it.
2997
29982020-09-03  Boris Dalstein  <dalboris@gmail.com>
2999
3000	[build] Make CMake install basic version information.
3001
3002	* CMakeLists.txt: Do it.
3003
30042020-09-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
3005
3006	[truetype] Reduce Infinality footprint (cont'd).
3007
3008	* src/truetype/ttinterp.c (Ins_DELTAP): Shrink variable scope.
3009	(Ins_SHPIX, Ins_MIRP): Revise if-logic.
3010
30112020-09-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
3012
3013	[truetype] Reduce Infinality footprint.
3014
3015	* src/truetype/ttinterp.c (Ins_SHPIX, Ins_MSIRP, Ins_MIAP, Ins_MDRP,
3016	Ins_MIRP): Shrink variable scopes and consolidate ifdefs.
3017
30182020-09-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
3019
3020	[truetype] Refactor compensation color.
3021
3022	* src/truetype/ttinterp.h (TT_Round_Func): Change the last argument.
3023	* src/truetype/ttinterp.c (Ins_ROUND, Ins_NROUND, Ins_MDAP, Ins_MIAP,
3024	Ins_MDRP, Ins_MIRP): Move compensation retrieval from here...
3025	(Round_*): ... to here.
3026	* src/truetype/ttobjs.c (tt_size_init_bytecode): Reserve zero
3027	compensation at color index 3.
3028
30292020-08-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
3030
3031	[smooth] Don't set target in direct mode.
3032
3033	* src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Remove assignment.
3034	(ft_smooth_raster_lcd) [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Ditto.
3035
30362020-08-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
3037
3038	* src/smooth/ftsmooth.c (ft_smooth_raster_overlap): Limit width.
3039
3040	Segmentation fault reported as
3041
3042	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24729
3043
30442020-08-22  Werner Lemberg  <wl@gnu.org>
3045
3046	* src/truetype/ttgload.c (TT_Get_VMetrics): Add tracing message.
3047
30482020-08-05  Alexei Podtelezhnikov  <apodtele@gmail.com>
3049
3050	[truetype] Retain OVERLAP_SIMPLE and OVERLAP_COMPOUND.
3051
3052	For glyphs with OVERLAP_SIMPLE or OVERLAP_COMPOUND, set
3053	FT_OUTLINE_OVERLAP to render them with direct oversampling, which
3054	mitigates artifacts (see 3bb512bc9f62).
3055
3056	* include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Redefine to rhyme
3057	with OVERLAP_SIMPLE.
3058	* src/base/ftgloadr.c (FT_GlyphLoader_Rewind): Reset outline flags.
3059	* src/truetype/ttgload.c
3060	(TT_Load_Simple_Glyph): Retain OVERLAP_SIMPLE.
3061	(load_truetype_glyph): Retain OVERLAP_COMPOUND.
3062
30632020-08-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
3064
3065	* src/truetype/ttgload.c (TT_Load_Glyph): More tracing.
3066
30672020-07-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
3068
3069	Hide internal functions with SunPro.
3070
3071	* include/freetype/internal/compiler-macros.h
3072	(FT_INTERNAL_FUNCTION_ATTRIBUTE) <__SUNPRO_C>: Define as __hidden.
3073
30742020-07-28  Anuj Verma  <anujv@iitbhilai.ac.in>
3075
3076	Fix static compilation with Visual C.
3077
3078	* include/freetype/internal/compiler-macros.h
3079	(FT_INTERNAL_FUNCTION_ATTRIBUTE) <_WIN32>: Define as empty.
3080
30812020-07-28  Priyesh Kumar  <priyeshkkumar@gmail.com>
3082
3083	Fix `-Wformat' compiler warnings.
3084
3085	* src/*: Fix format specifiers.
3086
3087	* builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
3088
30892020-07-25  Werner Lemberg  <wl@gnu.org>
3090
3091	Fix `-Wformat' compiler warnings.
3092
3093	Problem reported by Priyesh kumar <priyeshkkumar@gmail.com>
3094
3095	* src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments
3096	to tracing macro.
3097
3098	* src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property):
3099	Ditto.
3100
3101	* src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto.
3102	Reformulate message.
3103
3104	* src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto.
3105
3106	* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
3107	Trace table offset, too.
3108
3109	* src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
3110
31112020-07-23  Werner Lemberg  <wl@gnu.org>
3112
3113	* src/sfnt/sfwoff2.c (woff2_decompress): Fix compiler warning.
3114
3115	Reported by Hin-Tak.
3116
31172020-07-12  Werner Lemberg  <wl@gnu.org>
3118
3119	* builds/unix/configure.raw: Fix inclusion of `ftoption.h'.
3120
31212020-07-07  Werner Lemberg  <wl@gnu.org>
3122
3123	Fix clang warnings.
3124
3125	* include/freetype/internal/autohint.h
3126	(FT_DECLARE_AUTOHINTER_INTERFACE): New macro.
3127	* src/autofit/afmodule.h: Use it to declare
3128	`af_autofitter_interface'.
3129
3130	* include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro.
3131	* src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and
3132	`ft_outline_glyph_class'.
3133
3134	* src/base/ftglyph.c: Include `ftbase.h'.
3135
3136	* src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'.
3137
3138	* src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'.
3139
3140	* src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'.
3141	* src/psaux/psauxmod.h: Declare `afm_parser_funcs',
3142	`t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'.
3143
3144	* src/pshinter/pshmod.c: Include `pshmod.h'.
3145
3146	* src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign
3147	conversion.
3148	(compute_ULong_sum): Fix return type.
3149	Fix implicit sign conversion.
3150	(store_points): Fix type of `last_flag', `repeat_count', and `flag'.
3151	Use casts to avoid warnings.
3152	(reconstruct_glyf): Fix implicit sign conversion.
3153	Use cast to avoid warning.
3154	(get_x_mins): Fix implicit sign conversion.
3155	* src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'.
3156	* src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to
3157	declare cmap classes.
3158
3159	* src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast.
3160
3161	* src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
3162
31632020-07-07  David Turner  <david@freetype.org>
3164
3165	[build] Really fix multi and C++ builds.
3166
3167	The following builds were still failing due to previous changes:
3168
3169	  make multi
3170	  make multi CC="c++"
3171	  make CC="c++"
3172
3173	This patch fixes the issues, which were missing includes to get the
3174	right macro definitions in multi-build mode.
3175
3176	Also, `FT_UNUSED' is actually used by third-party code, so move it
3177	back to `public-macros.h' to avoid breaking it.
3178
3179	* include/freetype/config/public-macros.h (FT_EXPORT): Remove
3180	special definition for C++.
3181	(FT_UNUSED): Define here instead of...
3182	* include/freetype/config/compiler-macros.h: ... here.
3183	(FT_FUNCTION_DECLARATION): Remove special definition for C++.
3184	(FT_LOCAL_ARRAY_DEF): Fix definition.
3185
3186	* src/cache/ftccback.h, src/lzw/ftzopen.h, src/gxvalid/gxvmort.h,
3187	src/gxvalid/gxvmorx.h: Add `FT_BEGIN_HEADER' and `FT_END_HEADER'.
3188
31892020-07-06  David Turner  <david@freetype.org>
3190
3191	[build] Fix multi and C++ builds.
3192
3193	The following builds were failing due to previous changes:
3194
3195	  make multi
3196	  make multi CC="c++"
3197
3198	* include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'.
3199
3200	* include/freetype/config/ftheader.h (FT_BEGIN_HEADER,
3201	FT_END_HEADER): Protect against redefinition.
3202
3203	* src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h,
3204	src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h,
3205	src/sfnt/woff2tags.h: Include `compiler-macros.h'.
3206
3207	* src/sfnt/woff2tags.c: Include `woff2tags.h'.
3208
32092020-07-06  Werner Lemberg  <wl@gnu.org>
3210
3211	[psaux] Improve `t1_decoder_parse_metrics' (#58646).
3212
3213	* src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy
3214	corresponding code from old engine's `t1_decoder_parse_charstrings'
3215	function to handle `op_callsubr' and `op_return'.
3216
32172020-07-05  David Turner  <david@freetype.org>
3218
3219	[build] Improve visibility support of library function names.
3220
3221	* include/freetype/config/public-macros.h
3222	(FT_PUBLIC_FUNCTION_ATTRIBUTE): New macro to tag functions as
3223	public (and thus exportable).
3224	(FT_EXPORT): Use it.
3225
3226	* include/freetype/config/compiler-macros.h
3227	(FT_INTERNAL_FUNCTION_ATTRIBUTE): New macro to tag functions as
3228	internal to the library (and thus hidden).  Note that on ELF
3229	systems, all internal functions have hidden visibility, which avoids
3230	the need to enforce this when invoking the compiler (e.g., with an
3231	option like `-fvisibility=hidden').
3232
3233	(FT_FUNCTION_DECLARATION, FT_FUNCTION_DEFINITION): New base macros
3234	to deal with C and C++ linkage issues at the same time.
3235
3236	(FT_LOCAL, FT_LOCAL_DEF, FT_LOCAL_ARRAY, FT_LOCAL_ARRAY_DEF,
3237	FT_BASE, FT_BASE_DEF, FT_EXPORT_VAR, FT_BASE_CALLBACK,
3238	FT_BASE_CALLBACK_DEF): Redefined using new macros.
3239
32402020-07-05  David Turner  <david@freetype.org>
3241
3242	[build] Split off more stuff from `ftconfig.h'.
3243
3244	* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
3245	include/freetype/config/ftconfig.h: Split off macro definitions
3246	required by the FreeType API headers to...
3247	* include/freetype/config/public-macros.h: ...this new file.
3248
3249	* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
3250	include/freetype/config/ftconfig.h: Split off macro definitions used
3251	by the library but not to be exposed to clients to...
3252	* include/freetype/config/compiler-macros.h: ...this new file.
3253
3254	* include/freetype/internal/*.h, src/raster/ftraster.h: Include
3255	`compiler-macros.h' where needed.
3256
32572020-07-05  David Turner  <david@freetype.org>
3258
3259	[build] Move mac support code to `mac-support.h'.
3260
3261	* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
3262	include/freetype/config/ftconfig.h: Split off mac-specific stuff
3263	to...
3264	* include/freetype/config/mac-support.h: ...this new file.
3265
3266	* CMakeLists.txt, builds/unix/configure.raw: Remove `/undef ->
3267	#undef' string replacement; the affected code is no longer part of
3268	the `ftconfig.h' template.
3269
32702020-07-05  David Turner  <david@freetype.org>
3271
3272	[build] Put integer type definitions into `integer-types.h'.
3273
3274	Refactor some of the `ftconfig.h' headers and template to move the
3275	definition of the FreeType integer types (e.g., `FT_Int16') to a
3276	common header file `freetype/config/integer-types.h'.
3277
3278	* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
3279	include/freetype/config/ftconfig.h: Split off integer type
3280	definition stuff to...
3281	* include/freetype/config/integer-types.h: ...this new file.
3282
3283	* builds/unix/ftconfig.h.in: Control the definition of
3284	`FT_SIZEOF_INT' and `FT_SIZEOF_LONG' with macro
3285	`FT_USE_AUTOCONF_SIZEOF_TYPES'.  If these are not defined, auto
3286	detection happens in `integer-types.h' as usual based on `INTXX_MAX'
3287	values.  Otherwise the autoconf-detected values are used.
3288
3289	* builds/unix/configure.raw (CPPFLAGS): Don't include path to
3290	`config' directory.  Instead, ...
3291	(FT_CONFIG_STANDARD_LIBRARY_H): Use complete path.
3292
32932020-07-05  David Turner  <david@freetype.org>
3294
3295	[build] Rename `build/unix/ftconfig.in' to `ftconfig.h.in'.
3296
3297	Since we are no longer limited to 8.3 file names, it is simpler to
3298	follow the usual conventions for template files.
3299
3300	* builds/unix/ftconfig.in: Renamed to...
3301	* builds/unix/ftconfig.h.in: ...this.
3302
3303	* CMakeLists.txt, builds/unix/configure.raw: Updated.
3304
33052020-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
3306
3307	[smooth] Introduce direct oversampling for overlaps.
3308
3309	This implements oversampling to mitigate artifacts in pixels partially
3310	covered by overlapping contours.  It turns out that the 4x4
3311	oversampling is sufficient but, at least, quadruples the rendering
3312	time.  The outline has to set FT_OUTLINE_OVERLAP to use this method.
3313
3314	* include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): New flag.
3315	* src/smooth/ftsmooth.c (ft_smooth_render): Check it to...
3316	(ft_smooth_raster_overlap): ... inflate outline and set up direct
3317	rendering for oversampling with...
3318	(ft_smooth_overlap_spans): ... new span function that integrates them.
3319
33202020-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
3321
3322	[smooth] Use direct rendering mode in Harmony.
3323
3324	Instead of rendering 3 bitmaps side by side and reshuffling, we use
3325	direct rendering to deliver the bitmaps on each third byte.
3326
3327	* src/smooth/ftsmooth.c (ft_smooth_raster_lcd)
3328	[!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Set up direct mode with...
3329	(ft_smooth_lcd_spans): ... new span function.
3330
33312020-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
3332
3333	[smooth] Separate LCD paths from gray rendering.
3334
3335	This makes `ft_smooth_render' a lot smaller and easier to follow. It
3336	also cleanly separates Harmony and ClearType-style LCD rendering
3337	algorithms. Now I only wish to move LCD filtering and geometry from
3338	FT_Library to FT_Renderer.
3339
3340	* src/smooth/ftsmooth.c (ft_smooth_render): Move LCD code from here...
3341	(ft_smooth_raster_lcd, ft_smooth_raster_lcdv): ... to here.
3342	[FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Reorganize #ifdef's.
3343
33442020-06-20  Sebastian Rasmussen  <sebras@gmail.com>
3345
3346	[cff] Fix handling of `style_name == NULL' (#58630).
3347
3348	* src/cff/cffobjs.c (cff_face_init): If a call to `cff_strcpy' fails
3349	by returning NULL in `cff_face_init', `remove_style' is still
3350	called.  This means that the NULL pointer is dereferenced, causing a
3351	crash.
3352
33532020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3354
3355	[cff] Fix another two memory leaks (#58629).
3356
3357	* src/cff/cffobjs.c (cff_size_init): If a call to `funcs->create'
3358	fails to allocate one of the `internal->subfont' variables, make
3359	sure to free `internal->topfont' and any successfully allocated
3360	subfonts.
3361
33622020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3363
3364	[psaux] Fix memory leak (#58626).
3365
3366	* src/psaux/psstack.c (cf2_stack_init): If `cf2_stack_init' fails to
3367	allocate the stack, return error early.
3368
33692020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3370
3371	[base] Fix memory leak (#58624).
3372
3373	* src/base/ftobjs.c (FT_New_Size): Avoid trying to free
3374	`size->internal' unless `size' has been allocated.  This mistake
3375	appeared in the fix for issue #58611.
3376
33772020-06-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
3378
3379	[base] Rework d1180b5f9598 until further notice.
3380
3381	* src/base/ftoutln.c (FT_Outline_Get_Orientation): Reject large
3382	outlines.
3383
33842020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3385
3386	[cff, cid] Fix segfaults in case of error (#58621).
3387
3388	* src/cff/cffobjs.c (cff_slot_done), src/cid/cidobjs.c
3389	(cid_slot_done): If `ft_glyphslot_init' fails to allocate
3390	`internal', then the class' `done_slot' callback (called by
3391	`ft_glyphslot_done') must not dereference the pointer to `internal'.
3392
33932020-06-19  Werner Lemberg  <wl@gnu.org>
3394
3395	[base] Fix UBSAN error.
3396
3397	Reported as
3398
3399	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23166
3400
3401	* src/base/ftoutln.c (FT_Outline_Get_Orientation): Avoid values
3402	larger than 32 bits.
3403
34042020-06-19  Werner Lemberg  <wl@gnu.org>
3405
3406	[woff2] Fix segfault.
3407
3408	Reported as
3409
3410	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23402
3411
3412	* src/sfnt/sfwoff2.c (get_x_mins): Check whether `loca' table
3413	exists.
3414
34152020-06-19  Stephen McDowell  <svenevs.dev@gmail.com>
3416
3417	[sfnt] Support Intel compilers.
3418
3419	* src/sfnt/pngshim.c (premultiply_data): Intel compilers do not
3420	currently support `__builtin_shuffle'.
3421
34222020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3423
3424	[base] Fix memory leak (#58611).
3425
3426	* src/base/ftobjs.c (FT_New_Size): When the call to `clazz->init_size'
3427	fails, make sure to free `size->internal'.
3428
34292020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3430
3431	[cff] Fix memory leak (#58610).
3432
3433	* src/cff/cffobjs.c (cff_size_init): When the call to
3434	`funcs->create' fails, make sure to free `internal'.
3435
34362020-06-19  Werner Lemberg  <wl@gnu.org>
3437
3438	* src/cff/cffload.c (cff_index_get_pointers): Rename `t' to `tbl'.
3439
34402020-06-19  Sebastian Rasmussen  <sebras@gmail.com>
3441
3442	[cff] Free table upon error allocating other data (#58609).
3443
3444	* src/cff/cffload.c (cff_index_get_pointers): When new_bytes fails
3445	to allocate, make sure to free the table.  Do the same for both
3446	allocations if there is a later error.
3447
34482020-06-13  Werner Lemberg  <wl@gnu.org>
3449
3450	Remove redundant inclusion of `ft2build.h'.
3451
3452	* */*: Remove `#include <ft2build.h>' where possible.
3453
3454	* include/freetype/freetype.h: Remove cpp error about missing
3455	inclusion of `ft2build.h'.
3456
34572020-06-08  David Turner  <david@freetype.org>
3458
3459	Make macros for header file names optional.
3460
3461	We no longer have to take care of the 8.3 file name limit; this
3462	allows us (a) to introduce longer, meaningful file names, and (b) to
3463	avoid macro names in `#include' lines altogether since some
3464	compilers (most notably Visual C++) doesn't support this properly.
3465
3466	*/*: Replace
3467
3468	   #include FOO_H
3469
3470	with
3471
3472	   #include <freetype/foo.h>
3473
3474	or something similar.  Also update the documentation.
3475
34762020-06-02  Werner Lemberg  <wl@gnu.org>
3477
3478	* src/sfnt/ttcmap.c (tt_face_build_cmaps): Trace number of cmaps.
3479
34802020-05-18  David Turner  <david@freetype.org>
3481
3482	Remove obsolete HAVE_STDINT_H probing macro.
3483
3484	This macro was updated by the unix configure script and the
3485	`CMakeLists.txt' one, but is never used in the source tree (nor is
3486	<stdint.h> included anywhere).
3487
3488	* CMakeLists.txt, builds/unix/ftconfig.in: Don't handle
3489	`HAVE_STDINT_H'.
3490
34912020-05-18  David Turner  <david@freetype.org>
3492
3493	Remove Jamfile files from the tree.
3494
3495	These have not been used in a very, very long time, so better remove
3496	them.  A corresponding patch will be submitted to the
3497	`freetype2-demos' repository.
3498
3499	* src/Jamfile, src/*/Jamfile, Jamrules: Delete.
3500
35012020-05-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
3502
3503	[smooth] Turn on LCD filtering during FreeType initialization.
3504
3505	* src/smooth/ftsmooth.c (ft_smooth_init): Enable LCD filtering.
3506
3507	* include/freetype/ftlcdfil.h: Document it, remove patent warnings.
3508	* include/freetype/freetype.h (FT_Render_Mode): Updated.
3509	* include/freetype/config/ftoption.h, devel/ftoption.h
3510	[FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Do not mention patents.
3511
35122020-05-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
3513
3514	[smooth] Stop using dedicated LCD modules and classes.
3515
3516	The LCD modules were never truly independent. They mostly served as
3517	a way to disable patented LCD rendering, which is no longer necessary.
3518	The `smooth' module now handles LCD modes as well.
3519
3520	* src/smooth/ftsmooth.c (ft_smooth_lcd_renderer_class.
3521	ft_smooth_lcdv_renderer_class): Deleted.
3522	(ft_render_smooth): Reworked from `ft_render_smooth_generic'.
3523	* src/smooth/ftsmooth.h: Remove dedicated LCD classes.
3524	* src/smooth/module.mk: Remove dedicated LCD modules.
3525	* include/freetype/config/ftmodule.h: Ditto.
3526	* builds/amiga/include/config/ftmodule.h: Ditto.
3527	* include/freetype/ftmodapi.h: Do not mention LCD modules.
3528
35292020-05-09  Werner Lemberg  <wl@gnu.org>
3530
3531	* Version 2.10.2 released.
3532	==========================
3533
3534
3535	Tag sources with `VER-2-10-2'.
3536
3537	* docs/VERSION.TXT: Add entry for version 2.10.2.
3538
3539	* README, Jamfile (RefDoc), src/base/ftver.rc,
3540	builds/windows/vc2010/index.html, builds/windows/visualc/index.html,
3541	builds/windows/visualce/index.html,
3542	builds/wince/vc2005-ce/index.html,
3543	builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
3544	s/2.10.1/2.10.2/, s/2101/2102/.
3545
3546	* include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
3547
3548	* builds/unix/configure.raw (version_info): Set to 23:2:17.
3549	* CMakeLists.txt (VERSION_PATCH): Set to 2.
3550
3551	* docs/CHANGES: Updated.
3552
35532020-05-08  Jakub Alba  <jalba@vewd.com>
3554
3555	* src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#58319).
3556
3557	The font that exceeds the old limit is Icono Regular, version
3558	1.00000.
3559
35602020-05-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
3561
3562	* builds/freetype.mk: Refactor for readability.
3563
35642020-05-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
3565
3566	[builds] Clean up Windows CE project files.
3567
3568	Remove version from filenames that caused a lot of polution in the
3569	release process. Use VERSIONINFO resource instead.
3570
3571	* builds/wince/vc2005-ce/freetype.vcproj,
3572	builds/wince/vc2008-ce/freetype.vcproj,
3573	builds/windows/visualce/freetype.vcproj,
3574	builds/windows/visualce/freetype.dsp: s/2101//g, but add `ftver.rc'.
3575	* builds/wince/vc2008-ce/index.html,
3576	builds/wince/vc2005-ce/index.html,
3577	builds/windows/visualce/index.html: s/2101//g.
3578
35792020-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
3580
3581	* devel/ft2build.h: Override FT_CONFIG_MODULES_H here as well.
3582
35832020-05-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
3584
3585	[builds/unix] Consolidate marco overrides (for the demos to see them).
3586
3587	* builds/unix/unix-cc.in (FT_CONFIG_MODULES_H, FT_CONFIG_OPTIONS_H):
3588	Override them here...
3589	* builds/freetype.mk: ... instead of here.
3590
35912020-04-08  Werner Lemberg  <wl@gnu.org>
3592
3593	Allow setting `CC' in Unix build (#58051).
3594
3595	* builds/unix/unix-cc.in (CC): Use `override'.  The command line
3596	  value of `CC' (if any) is stored already in `CCraw'.
3597
35982020-04-04  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3599
3600	[woff2] Return if single stream operation fails.
3601
3602	* src/sfnt/sfwoff2.c (get_x_mins): Do it.
3603
3604	* src/sfnt/woff2tags.c: Remove unused include.
3605
36062020-03-22  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3607
3608	[docs] Fix building docs if `srcdir' != `builddir'.
3609
3610	`docs/reference/*' was moved one directory up in commit 237fed6.
3611
3612	* builds/unix/unix-def.in (PIP): Remove variable.
3613
3614	* configure: Create `docs' directory and copy assets from
3615	`docs/markdown'.
3616
3617	* docs/README: Output directory is `reference'.
3618
36192020-03-21  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3620
3621	[docwriter] Drop support for Python < 3.5.
3622
3623	Python versions < 3.5 have reached end-of-life and as such, no
3624	security or bug fixes will be provided for those versions.  See
3625
3626	  https://devguide.python.org/#status-of-python-branches
3627
3628	for more information.
3629
3630	* Jamfile (RefDoc): Add `site' parameter.
3631
3632	* builds/detect.mk (std_setup): Update Python version requirement.
3633
3634	* builds/freetype.mk (refdoc-venv): Use pip as `python -m pip'.
3635
3636	* builds/unix/ax_compare_version.m4,
3637	builds/unix/ax_prog_python_version.m4: Macros to detect Python
3638	version.  New files.
3639
3640	* builds/unix/configure.raw: Check for Python >= 3.5 and remove
3641	check for `pip'.
3642
3643	* docs/CHANGES, docs/INSTALL.GNU, docs/README: Updated.
3644
36452020-03-02  Moazin Khatti  <moazinkhatri@gmail.com>
3646
3647	[gzip] Support `gzip' encoded header conditionally.
3648
3649	In order to support `gzip' encoded header the call to
3650	`inflateInit2' was modified in commit 6a92b1fadde26477a9179.
3651	However, this code breaks with the outdated internal version
3652	of zlib.  This is a temporary fix to conditionally support
3653	`gzip' encoded header whenever a system installation of zlib
3654	is being used.
3655
3656	Problem report in
3657
3658	  https://lists.nongnu.org/archive/html/freetype-devel/2020-02/msg00023.html
3659
3660	* src/gzip/ftgzip.c (FT_Gzip_Uncompress): Change the the call to
3661	`inflateInit2' depending on whether the system installation is
3662	being used or the internal copy.
3663
36642020-02-29  Ben Wagner  <bungeman@google.com>
3665
3666	[truetype] Fix state of `FT_Face' for buggy `gvar' tables (#57923).
3667
3668	By resetting the blend as implemented with this commit fonts with
3669	invalid `gvar' tables may keep calling into `ft_var_load_gvar' from
3670	`tt_set_mm_blend' and failing, but the font was invalid anyway and
3671	we want to keep seeing the failure in `tt_set_mm_blend'.
3672
3673	* src/truetype/ttgxvar.c (ft_var_load_gvar): Calculate length of
3674	offset array once.
3675	Allocate arrays after `FT_FRAME_ENTER' (extra check before
3676	allocating and avoid needing to free array later if error entering
3677	frame).
3678	Always call `FT_FRAME_EXIT'.
3679	Consistently set counts immediately after array initialized.
3680	Reset the blend (particularly `blend->glyphoffsets') on failure.
3681
36822020-03-01  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3683
3684	[docs] Update docwriter stylesheet.
3685
3686	This change is required to support docwriter 1.2.1.
3687
3688	See
3689
3690	  https://github.com/freetype/docwriter/issues/36
3691
3692	for more information.
3693
3694	* docs/markdown/stylesheets/extra.css:
3695	(.md-typeset code) -> (.md-typeset pre>code)
3696	(pre) -> (pre>code)
3697	(p, .md-typeset p, h4): Remove commented styles.
3698	(table.index): Remove unused styles.
3699
37002020-02-28  Ben Wagner  <bungeman@google.com>
3701
3702	[truetype] Add better checks for loading `gvar' table (#57905).
3703
3704	* src/truetype/ttgxvar.c (ft_var_load_gvar): Delay settings of any
3705	`blend->xxxcount' values until the corresponding data has been
3706	checked.
3707	Also do some sanitizing to avoid a too early exit.
3708
3709	(TT_Vary_Apply_Glyph_Deltas): Improve tracing message.
3710
37112020-02-27  Werner Lemberg  <wl@gnu.org>
3712
3713	Make `FT_HAS_*' and `FT_IS_*' really return true (#57906).
3714
3715	* include/freetype/freetype.h (FT_HAS_*, FT_IS_*): Implement it.
3716
37172020-02-25  Dominik Röttsches  <drott@chromium.org>
3718
3719	Fix for CFF space glyph regression (#57541).
3720
3721	* src/psaux/psft.c (cf2_decoder_parse_substrings): Replace early-out
3722	  with FT_OFFSET.
3723
37242020-02-22  Werner Lemberg  <wl@gnu.org>
3725
3726	[woff2] Fix font table access.
3727
3728	Reported as
3729
3730	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20778
3731
3732	* src/sfnt/sfwoff2.c (get_x_mins): Explicitly check for presence of
3733	`head' table, which might not have been processed yet.
3734
37352020-02-21  Werner Lemberg  <wl@gnu.org>
3736
3737	[psaux] Make `t1_decoder_parse_metrics' handle `op_div' (#57519).
3738
3739	* src/psaux/t1decode.c (t1_decoder_parse_metrics): Copy
3740	corresponding code from old engine's `t1_decoder_parse_charstrings'
3741	function.
3742
37432020-02-19  Nikolaus Waxweiler  <nikolaus.waxweiler@daltonmaag.com>
3744
3745	[autofit] Add support for Hanifi Rohingya script.
3746
3747	* src/autofit/afblue.dat: Add blue zone data for Hanifi Rohingya.
3748	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
3749
3750	* src/autofit/afscript.h: Add Hanifi Rohingya standard character.
3751
3752	* src/autofit/afranges.c, src/autofit/afstyles.h: Add Hanifi
3753	  Rohingya data.
3754
37552020-02-19  Werner Lemberg  <wl@gnu.org>
3756
3757	Require HarfBuzz 1.8.
3758
3759	* builds/unix/configure.raw, CMakeLists.txt: Request HarfBuzz 1.8.0
3760	or newer.
3761
3762	We are going to add auto-hinter support for Hanifi Rohingya, which
3763	was introduced in Unicode 11.0.
3764
37652020-02-12  Werner Lemberg  <wl@gnu.org>
3766
3767	* src/sfnt/ttcmap.c (tt_face_build_cmaps): Ignore version (#57708).
3768
37692020-02-04  Werner Lemberg  <wl@gnu.org>
3770
3771	* src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#57732).
3772
3773	The font that exceeds the old limit is Constantine, version 1.001.
3774
37752020-01-04  Werner Lemberg  <wl@gnu.org>
3776
3777	[base] Fix `FREETYPE_PROPERTIES=type1:hinting-engine=adobe`.
3778
3779	* src/base/ftpsprop.c (ps_property_set) [hinting-engine]: Avoid an
3780	incorrect return value that caused a warning.  The function did the
3781	right thing, though.
3782
37832020-01-03  Werner Lemberg  <wl@gnu.org>
3784
3785	[woff2] Fix memory leaks and a runtime warning.
3786
3787	Reported as
3788
3789	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19773
3790	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18101
3791
3792	* src/sfnt/sfwoff2.c (compute_ULong_sum): Add missing cast.
3793	(reconstruct_hmtx): Add missing deallocation calls.
3794
37952020-01-02  Dominik Röttsches  <drott@chromium.org>
3796
3797	[truetype] Fix UBSan warning on offset to nullptr (#57501).
3798
3799	* src/truetype/ttinterp.c (Ins_CALL): Fail if `exc->FDefs' is null.
3800
38012019-12-31  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
3802
3803	[woff2] Allow bitmap-only fonts (#57394).
3804
3805	* src/sfnt/sfwoff2.c (reconstruct_font): Fix test for `glyf' and
3806	`loca' tables.
3807
38082019-12-21  Hugh McMaster  <hugh.mcmaster@outlook.com>
3809
3810	[docs] (2/2) Fix generation of API documentation (#56745).
3811
3812	Creating the API Reference in the (new) `reference' sub-directory is
3813	consistent with other documentation sub-topics, such as `design',
3814	`glyphs' and `tutorial'.
3815
3816	This patch fixes broken hyperlinks in the documentation pointing to
3817	and from the API Reference.  It also allows web assets to load from
3818	their relative paths.
3819
3820	* builds/freetype.mk (DOC_DIR): Adjust.
3821	(refdoc, refdoc-venv): Add `--site' argument.
3822
3823	* builds/toplevel.mk (do-dist): Updated.
3824
38252019-12-21  Hugh McMaster  <hugh.mcmaster@outlook.com>
3826
3827	[docs] (1/2) Move static web assets (#56745).
3828
3829	* docs/reference/*: Move ...
3830	* docs: ... one directory up.
3831
38322019-12-21  Dominik Röttsches  <drott@chromium.org>
3833
3834	Fix more UBSan warnings on adding offset to nullptr (#57432).
3835
3836	* src/truetype/ttinterp.c (Ins_LOOPCALL), src/psaux/psft.c
3837	(cf2_initLocalRegionBuffer): Use `FT_OFFSET'.
3838
38392019-12-16  Werner Lemberg  <wl@gnu.org>
3840
3841	[truetype] Fix UBSan warnings on adding offsets to nullptr.
3842
3843	Reported as
3844
3845	  https://bugs.chromium.org/p/chromium/issues/detail?id=1032152
3846
3847	* src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Use `FT_OFFSET'.
3848
38492019-12-14  Werner Lemberg  <wl@gnu.org>
3850
3851	[truetype] Fix integer overflow.
3852
3853	Reported as
3854
3855	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19305
3856
3857	* src/truetype/ttinterp.c (Ins_MIRP): Use `ADD_LONG'.
3858
38592019-12-13  Werner Lemberg  <wl@gnu.org>
3860
3861	Another bunch of UBSan warnings on adding offsets to nullptr.
3862
3863	Reported as
3864
3865	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19427
3866	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19433
3867	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19441
3868	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19451
3869	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19452
3870	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19457
3871
3872	* src/autofit/aflatin.c (af_latin_hints_compute_segments,
3873	af_latin_hints_compute_edges): Use `FT_OFFSET'.
3874
3875	* src/base/ftstream.c (FT_Stream_EnterFrame): Use `FT_OFFSET'.
3876
3877	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Exit early
3878	if there is no charstring.
3879
3880	* src/psaux/psobjs.c (t1_decrypt): Use `FT_OFFSET'.
3881
3882	* src/smooth/ftsmooth.c (ft_smooth_render_generic): Exit early for
3883	zero bitmap dimensions.
3884
38852019-12-09  Dominik Röttsches  <drott@chromium.org>
3886
3887	Fix more UBSan warnings on adding offset to nullptr (#57384).
3888
3889	* src/smooth/ftsmooth.c (ft_smooth_render_generic),
3890	src/psaux/psobjs.c (ps_table_add): Use `FT_OFFSET'.
3891
38922019-12-05  Werner Lemberg  <wl@gnu.org>
3893
3894	* src/truetype/ttinterp.c (TT_RunIns): Use `FT_OFFSET'.
3895
3896	Reported as
3897
3898	  https://bugs.chromium.org/p/chromium/issues/detail?id=1030614
3899
39002019-12-03  Werner Lemberg  <wl@gnu.org>
3901
3902	More nullptr offset UBSan warnings (#57331, #57347).
3903
3904	* src/autofit/afcjk.c (af_cjk_hints_compute_segments),
3905	src/psaux/psft.c (cf2_getSeacComponent), src/truetype/ttinterp.c
3906	(Ins_UNKNOWN): Use `FT_OFFSET'.
3907
39082019-11-29  Dominik Röttsches  <drott@chromium.org>
3909
3910	Avoid more nullptr offset UBSan warnings (#57316).
3911
3912	* src/base/ftoutln.c (FT_Outline_Transform): Bail on empty points.
3913	* src/cff/cffload.c (cff_subfont_load): Use `FT_OFFSET'.
3914	* src/psaux/psft.c (cf2_decoder_parse_substrings): Early out if
3915	`charstring_base' or `charstring_len' are null.
3916	* src/sfnt/ttload.c (tt_face_load_name): Use `FT_OFFSET'.
3917
39182019-11-23  John Stracke  <jstracke@Google.com>
3919
3920	[base] Really fix #57194.
3921
3922	Apply accidentally missed second part of patch.
3923
3924	* src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Call
3925	`FT_GlyphLoader_CreateExtra'.
3926
39272019-11-23  Werner Lemberg  <wl@gnu.org>
3928
3929	[truetype] Avoid sanitizer warning (#57289).
3930
3931	* src/truetype/ttpload.c (tt_face_get_device_metrics): Use
3932	`FT_OFFSET'.
3933
39342019-11-23  Armin Hasitzka  <prince.cherusker@gmail.com>
3935
3936	[truetype] Fix integer overflow (#57287).
3937
3938	* src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
3939
39402019-11-23  Ben Wagner  <bungeman@google.com>
3941
3942	[sfnt] Avoid sanitizer warning (#57286).
3943
3944	* src/sfnt/ttcmap.c (tt_face_build_cmaps): Avoid possible `NULL +
3945	offset' computation.
3946	Tag `table' as `const'.
3947
39482019-11-23  John Stracke  <jstracke@Google.com>
3949            Werner Lemberg  <wl@gnu.org>
3950
3951	[base] Fix `NULL + offset' sanitizer warnings (#57194).
3952
3953	* src/base/ftgloadr.c (FT_GlyphLoader_Adjust_Points,
3954	FT_GlyphLoader_Adjust_Subglyphs): Use `FT_OFFSET'.
3955	(FT_GlyphLoader_CreateExtra): Add short cut if some values are zero.
3956
39572019-11-23  Werner Lemberg  <wl@gnu.org>
3958
3959	* include/freetype/internal/ftmemory.h (FT_OFFSET): New macro.
3960
3961	Use this for `base + offset' pointer calculations where `base' can
3962	be NULL (triggering a sanitizer warning even if the resulting
3963	pointer gets never dereferenced since it is undefined behaviour
3964	in C).
3965
3966	Suggested by Ben Wagner.
3967
39682019-11-23  Ben Wagner  <bungeman@google.com>
3969
3970	[sfnt] Ensure OTTO fonts have tables (#57285).
3971
3972	* src/sfnt/ttload.c (tt_face_load_font_dir): Add test.
3973
39742019-11-23  Behdad Esfahbod  <behdad@behdad.org>
3975
3976	Minor fixes for recent compilers.
3977
3978	* src/gzip/infutil.h (inflate_mask): Add `const'.
3979
3980	* src/autofit/aflatin2.c: Include `ft2build.h'.
3981
39822019-11-07  Nikolaus Waxweiler  <madigens@gmail.com>
3983
3984	* CMakeLists.txt: Minor additions to the notes, compile
3985	  builds/unix/ftsystem.c instead of src/base/ftsystem.c on UNIX.
3986
3987	The latter change is based on the code proposed by rim in #55235.
3988
39892019-10-25  Werner Lemberg  <wl@gnu.org>
3990
3991	* src/sfnt/sfwoff2.c (woff2_open_font): Check `num_fonts' for TTCs.
3992
3993	Reported as
3994
3995	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18494
3996
39972019-10-22  Werner Lemberg  <wl@gnu.org>
3998
3999	* src/sfnt/sfwoff2.c (woff2_open_font): Avoid undefined shift.
4000
4001	Also improve tracing.
4002
4003	Reported as
4004
4005	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18390
4006
40072019-10-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
4008
4009	* src/sfnt/pngshim.c (premultiply_data): Optimize for __SSE__ only.
4010
40112019-10-10  Werner Lemberg  <wl@gnu.org>
4012
4013	* src/sfnt/sfwoff2.c (reconstruct_glyf): Check `triplet_size'.
4014
4015	Reported as
4016
4017	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18108
4018
40192019-10-09  John Tytgat  <John.Tytgat@esko.com>
4020
4021	[cff] Fix FT_FACE_FLAG_GLYPH_NAMES for CFF2 based fonts (#57023).
4022
4023	* src/cff/cffobjs.c (cff_face_init): Don't set
4024	FT_FACE_FLAG_GLYPH_NAMES for CFF2 based fonts.
4025
40262019-10-08  Werner Lemberg  <wl@gnu.org>
4027
4028	[woff2] Fix SFNT table checks.
4029
4030	Also reduce number of SFNT table lookups.
4031
4032	Reported as
4033
4034	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18065
4035
4036	* include/freetype/internal/wofftypes.h (WOFF2_InfoRec): Add fields
4037	`glyf_table', `loca_table', and `head_table'.
4038
4039	* src/sfnt/sfwoff2.c (reconstruct_glyf): Update signature.
4040	Use table pointers in `info' parameter.
4041	(get_x_mins): Check `maxp_table'
4042	Use table pointers in `info' parameter.
4043	(reconstruct_font):  Use and set table pointers in `info' parameter.
4044	Fix check for `glyf' and `loca' tables.
4045	Update call to `reconstruct_glyf'.
4046	(woff2_open_font): Updated.
4047
40482019-10-06  Werner Lemberg  <wl@gnu.org>
4049
4050	* src/sfnt/sfwoff2.c (reconstruct_glyf): Fix reallocation.
4051
4052	Reported as
4053
4054	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18046
4055
40562019-10-06  Werner Lemberg  <wl@gnu.org>
4057
4058	Improve memory debugging.
4059
4060	* include/freetype/internal/ftmemory.h (FT_MEM_FREE): Use
4061	`FT_DEBUG_INNER' to set source code file name and line.
4062
4063	* src/base/ftdbgmem.c (ft_mem_table_remove): Better formatting of
4064	tracing message.
4065
40662019-10-03  Werner Lemberg  <wl@gnu.org>
4067
4068	* src/sfnt/sfwoff2 (reconstruct_font): Fix reallocation.
4069
4070	Reported as
4071
4072	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17966
4073
40742019-10-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
4075
4076	* src/base/ftstroke.c (ft_stroker_inside): Speed up.
4077
40782019-10-01  Werner Lemberg  <wl@gnu.org>
4079
4080	* src/sfnt/sfwoff2 (woff2_open_font): Initialize `woff2.ttc_fonts'.
4081
4082	Reported as
4083
4084	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17804
4085
40862019-09-30  Werner Lemberg  <wl@gnu.org>
4087
4088	* src/sfnt/sfwoff2.c (reconstruct_font): Fix memory leak.
4089
4090	Reported as
4091
4092	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17812
4093
40942019-09-30  Werner Lemberg  <wl@gnu.org>
4095
4096	[woff2] Reject fonts without `head' table.
4097
4098	Also fix memory deallocation in case of error.
4099
4100	`head' problem reported as
4101
4102	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17820
4103
4104	* src/sfnt/sfwoff2.c (reconstruct_glyf): Don't use `stream_close'.
4105	Abort if `head_table' is NULL.
4106	Don't free `transformed_buf' in case of error.
4107	(woff2_open_font): Don't set `uncompressed_buf' to NULL.
4108
41092019-09-29  Werner Lemberg  <wl@gnu.org>
4110
4111	[woff2] Fix compiler warnings.
4112
4113	Problem reported by Alexei.
4114
4115	* src/sfnt/sfwoff2.c (reconstruct_glyf): Initialize `x_min'.
4116	(reconstruct_font): Initialize `num_hmetrics'.
4117	(woff2_open_font): Initialize `info'.
4118
41192019-09-28  Werner Lemberg  <wl@gnu.org>
4120
4121	* src/sfnt/sfwoff2.c (woff2_open_font): Fix sanity check.
4122
4123	Correct thinkos in patch from 2019-09-01.
4124
41252019-09-28  Werner Lemberg  <wl@gnu.org>
4126
4127	[woff2] Fix memory leaks.
4128
4129	One of them reported as
4130
4131	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17766
4132
4133	* src/sfnt/sfwoff2.c (woff2_open_font): Free `info->x_mins' and
4134	`woff2->ttc_fonts'.
4135
4136	(reconstruct_glyf): Initialize `info->x_mins'.
4137
41382019-09-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
4139
4140	* src/base/ftstroke.c (ft_stroker_cap): Speed up caps.
4141
41422019-09-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
4143
4144	* src/base/ftstroke.c (ft_stroker_outside): Speed up clipped miter.
4145	* include/freetype/ftstroke.h: Wordsmith miter docs.
4146
41472019-09-25  Werner Lemberg  <wl@gnu.org>
4148
4149	* src/sfnt/sfwoff2.c (woff2_open_font): Check (sum of) table sizes.
4150
4151	Reported as
4152
4153	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17684
4154
41552019-09-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
4156
4157	* src/base/ftstroke.c (ft_stroke_border_arcto): Speed up calculations.
4158
41592019-09-20  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4160
4161	[woff2] Fix memory leaks.
4162
4163	Reported as
4164
4165	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16896
4166
4167	* src/sfnt/sfwoff2.c (woff2_open_font): Fix error handling.
4168	Free `uncompressed_buf'.
4169	(reconstruct_font): Free `transformed_buf'.
4170
41712019-09-17  Werner Lemberg  <wl@gnu.org>
4172
4173	* src/otvalid/otvcommon.c (otv_Coverage_get_last): Guard `count'.
4174
4175	Problem reported by Marc Schönefeld <marc.schoenefeld@gmx.org>.
4176
41772019-09-17  Werner Lemberg  <wl@gnu.org>
4178
4179	* src/sfnt/sfwoff2.c (woff2_open_font): Check table index.
4180
4181	Reported as
4182
4183	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17100
4184
41852019-09-15  Avi Halachmi (:avih)  <avihpit@yahoo.com>
4186
4187	[cmake] Don't fail if brotli is missing (#56894).
4188
4189	The libs which cmake controls are commented out at
4190
4191	  include/freetype/config/ftoption.h
4192
4193	and cmake un-comment each enabled library, but the brotli option was
4194	not commented out, therefore `FT_CONFIG_OPTION_USE_BROTLI' remained
4195	defined even if brotli was missing/disabled/etc.
4196
4197	Comment it such that cmake can control it, which means leaving it
4198	undefined if brotli is missing.
4199
4200	* include/freetype/config/ftoption.h: Fix typo.
4201
42022019-09-05  Werner Lemberg  <wl@gnu.org>
4203
4204	[cmake] Add brotli support.
4205
4206	* CMakeLists.txt (FT_WITH_BROTLI): New option.
4207
4208	* builds/cmake/FindBrotliDec.cmake: New file.
4209
42102019-09-05  Werner Lemberg  <wl@gnu.org>
4211
4212	Fix handling of `AF_CONFIG_OPTION_INDIC'.
4213
4214	* devel/ftoption.h, include/freetype/config/ftoption.h:
4215	`AF_CONFIG_OPTION_INDIC' needs `AF_CONFIG_OPTION_CJK'.
4216
42172019-09-05  Werner Lemberg  <wl@gnu.org>
4218
4219	CMakeLists.txt: Fix generation of DLL related stuff (#56852).
4220
4221	Extract `version_info' variable from `builds/unix/configure.raw' and
4222	use the data to correctly set `LIBRARY_VERSION' and
4223	`LIBRARY_SOVERSION'.
4224
4225	Also use the data to set `ft_version' field in `freetype2.pc'.
4226	Also fix the needed minimum version of HarfBuzz in `freetype2.pc'.
4227
42282019-09-03  Werner Lemberg  <wl@gnu.org>
4229
4230	* src/sfnt/sfwoff2.c (compute_ULong_sum): Fix undefined shift.
4231
4232	Reported as
4233
4234	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16933
4235
42362019-09-01  Werner Lemberg  <wl@gnu.org>
4237
4238	* src/sfnt/sfwoff2.c (woff2_open_font): Add sanity check.
4239
4240	Don't trust `totalSfntSize' unconditionally.
4241
4242	Reported as
4243
4244	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16893
4245
42462019-08-27  Dominik Röttsches  <drott@chromium.org>
4247
4248	[woff2] Don't use `FT_UInt64' (#56815).
4249
4250	* src/sfnt/sfwoff2.c (woff2_open_font): Use `FT_UInt32' for
4251	`file_offset'.  This fixes builds on platforms where `FT_LONG64' is
4252	not defined while still being sufficient to store a file offset.
4253
42542019-08-27  Werner Lemberg  <wl@gnu.org>
4255
4256	[truetype] Prevent crash in `TT_Set_Named_Instance' (#56813).
4257
4258	* src/truetype/ttgxvar.c (TT_Set_Named_Instance): Fix error
4259	handling.
4260
42612019-08-27  Werner Lemberg  <wl@gnu.org>
4262
4263	[woff2] Fix compiler warnings.
4264
4265	* src/sfnt/sfwoff2.c (read_num_hmetrics): Remove unused argument
4266	`table_len'.
4267	Update caller.
4268	(triplet_decode, compute_bbox, store_loca, reconstruct_glyf): Make
4269	`i' variable unsigned.
4270	(reconstruct_glyph): Remove condition which is always false.
4271	(reconstruct_html): Removed unused argument `transformed_size'.
4272	Update caller.
4273
4274	* src/sfnt/woff2tags.c (woff2_known_tags): Remove condition which is
4275	always false.
4276
42772019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4278
4279	[woff2] Check whether known tag is in array bounds.
4280
4281	If table tag is not 0x3f, we expect a value between 0 and 62.  If
4282	this is not the case, exit with errors.
4283
4284	* src/sfnt/sfwoff2/c: Check whether table tag makes sense.
4285
4286	* src/sfnt/woff2tags.c: Return 0 if tag is out of bounds.
4287
42882019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4289
4290	* src/sfnt/sfwoff2.c: Improve trace comments.
4291
4292	Adjust tracing levels for comments, and more formatting.
4293
42942019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4295
4296	[woff2] Support `hmtx' reconstruction when `glyf' is untransformed.
4297
4298	`reconstruct_hmtx' requires `info->x_mins' and `info->num_glyphs' to
4299	reconstruct the hmtx table.  In case glyf is not transformed, we
4300	call `get_x_mins' which does the necessary work.
4301
4302	* src/sfnt/sfwoff2.c (get_x_mins): New function.
4303	(reconstruct_font): Call get_x_mins.
4304
43052019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4306
4307	[sfnt] Support `face->num_faces' for WOFF2 fonts.
4308
4309	Set correct value of `face->num_faces' for WOFF2 fonts.  This is
4310	being handled separately because we only load the tables for the
4311	requested font face in `woff2_open_font' and create a single-face
4312	sfnt stream.
4313
4314	The full discussion is at:
4315
4316	  https://lists.gnu.org/archive/html/freetype-devel/2019-08/msg00000.html
4317
4318	* src/sfnt/sfobjs.c (sfnt_open_font): Add parameter
4319	`woff2_num_faces'.
4320	(sfnt_init_face): Introduce variable `woff2_num_faces', and change
4321	`face->root.num_faces' if `woff2_num_faces' is set.
4322
4323	* src/sfnt/sfwoff2.c (woff2_open_font): Validate requested face
4324	index and handle negative face indices.
4325
4326	* src/sfnt/sfwoff2.h (woff2_open_font): Add parameter `num_faces' to
4327	declaration.
4328
43292019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4330
4331	[woff2] Improve memory and error handling.
4332
4333	Free up memory after use, and improve error handling.
4334
4335	* src/sfnt/sfwoff2.c (reconstruct_font, woff2_open_font): Implement
4336	changes.
4337
43382019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4339
4340	[woff2] Avoid too many calls to `FT_REALLOC'.
4341
4342	We do this by using `totalSfntSize' as an initial reference, and
4343	extending the buffer when required.  This reduces rendering time
4344	considerably.
4345
4346	* include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add
4347	`totalSfntSize', rename `total_sfnt_size' to `actual_sfnt_size'.
4348
4349	* src/sfnt/sfwoff2.c (write_buf): Add parameter `dst_size' to keep
4350	track of and update total size of stream.
4351
4352	(WRITE_SFNT_BUF, WRITE_SFNT_BUF_AT): Modify macros accordingly.
4353
4354	(pad4, store_loca, reconstruct_glyf, reconstruct_hmtx,
4355	reconstruct_font): Update parameters to accept `sfnt_size'.
4356
4357	(woff2_open_font): Add variable `sfnt_size'.  Use WOFF2 header field
4358	`totalSfntSize' as initial reference (if value makes sense) and
4359	allocate `totalSfntSize' bytes for the sfnt stream.  `write_buf'
4360	handles reallocation if and when required.  Also resize the stream
4361	to `actual_sfnt_size' after reconstruction.
4362
43632019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4364
4365	[woff2] Reconstruct `loca', `hmtx', and swap out stream.
4366
4367	Add necessary functions to reconstruct loca and hmtx tables (the two
4368	remaining tables that can have a transform).  `woff2_open_font' is
4369	now capable of loading a woff2 font face.  This code may still need
4370	more refining and better memory management.
4371
4372	* include/freetype/internal/wofftypes.h (WOFF2_HeaderRec): Add total
4373	(final) size of sfnt stream.
4374
4375	(WOFF2_InfoRec): Add header checksum value.
4376
4377	* src/sfnt/sfobjs.c (sfnt_open_font): Change `face_instance_index'
4378	parameter to its pointer so its value can be modified by
4379	`woff2_open_font'.
4380
4381	* src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF_AT): New macro to write into
4382	sfnt buffer at given position.
4383
4384	(write_buf): Add parameter `extend_buf' which allows caller to
4385	specify whether buffer should be reallocated before copying data.
4386
4387	(WRITE_SFNT_BUF): Updated.
4388
4389	(pad4, store_loca, reconstruct_htmx): New functions.
4390
4391	(reconstruct_glyf): Calculate loca values and store them.
4392
4393	(reconstruct_font): Call `reconstruct_hmtx', write table record
4394	entries, and calculate table checksums.  Also calculate font
4395	checksum and update `checksumAdjustment' entry in head table.
4396
4397	(woff2_open_font): Open stream for sfnt buffer, swap out input
4398	stream and return.
4399
4400	* src/sfnt/sfwoff2.h (woff2_open_font): Modify parameter to accept
4401	pointer to `face_index'.
4402
44032019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4404
4405	[woff2] Reconstruct transformed `glyf' table.
4406
4407	Reconstruct `glyf' table if it is transformed in the uncompressed
4408	table stream.  Also add necessary structures, macros and functions.
4409
4410	* include/freetype/internal/wofftypes.h (WOFF2_InfoRec,
4411	WOFF2_SubstreamRec, WOFF2_PointRec): New structures.
4412	(WOFF2_TableRec): s/OrigLength/dst_length/.
4413
4414	* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128): Use
4415	`FT_SET_ERROR' to set implicit `error' variable.
4416
4417	(WRITE_SHORT): New macro.
4418
4419	(N_CONTOUR_STREAM, N_POINTS_STREAM, FLAG_STREAM, GLYPH_STREAM,
4420	COMPOSITE_STREAM, BBOX_STREAM, INSTRUCTION_STREAM): New macros to
4421	refer to substreams of the transformed `glyf' tables.
4422
4423	(Read255UShort, ReadBase128): Return errors set by `FT_READ_XXX'
4424	macros.
4425
4426	(with_sign, safe_int_addition): New functions to add sign to values
4427	based on a flag and perform safe addition respectively.
4428
4429	(triplet_decode): Decode variable-length (flag, xCoordinate,
4430	yCoordinate) triplet for a simple glyph.   See
4431
4432	  https://www.w3.org/TR/WOFF2/#triplet_decoding
4433
4434	(store_points, compute_bbox, composteGlyph_size, reconstruct_glyf):
4435	New functions.
4436
4437	(reconstruct_font): Call `reconstruct_glyf'.
4438
4439	* src/sfnt/sfwoff2.h: Add required constants.
4440
4441	* src/sfnt/woff2tags.h: Move out constants to `sfwoff2.h'.
4442
44432019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4444
4445	[woff2] Copy un-transformed tables to sfnt stream.
4446
4447	Copy un-transformed tables to the sfnt stream.
4448
4449	* src/sfnt/sfwoff2.c: (WRITE_SFNT_BUF): New macro.
4450	(write_buf): New function.  Extend memory of `dst' buffer and copy
4451	bytes from `src'.
4452	(compute_ULong_sum): New function.  Calculate checksum of table.
4453	(reconstruct_font): Change `FT_Byte* sfnt' to `FT_Byte**
4454	sfnt_bytes'.  This has been done because we reallocate memory to
4455	`sfnt' multiple times, which may change the pointer value of `sfnt'.
4456	This new pointer must be propogated back to the caller.  Same reason
4457	for using a double pointer in `write_buf'.
4458
4459	* src/sfnt/woff2tags.h (WOFF2_DEFAULT_MAX_SIZE): New macro used for
4460	overflow checking.
4461
44622019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4463
4464	[woff2] Create stream for uncompressed buffer.
4465
4466	Uncompressed buffer is now an `FT_Stream'.
4467
4468	Perform basic checks and start iterating over tables.
4469
4470	* src/sfnt/sfwoff2.c (stream_close, find_table, read_num_hmetrics):
4471	New functions.
4472	(reconstruct_font): Modify parameters and iterate over tables.
4473	(woff2_open_font): Updated.
4474
44752019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4476
4477	[woff2] Handle TTCs and start reconstructing font.
4478
4479	We `handle' TTCs by modifying the `indices' array to point to only
4480	those tables that are part of the requested `face_index'.
4481
4482	Set and use `num_tables' in `WOFF2_TtcFont'.
4483
4484	* src/sfnt/sfwoff2.c (reconstruct_font): New function.
4485	(woff2_open_font): Start reconstruction of font.
4486
44872019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4488
4489	[woff2] Get known tags from function.
4490
4491	Change `KnownTags' to a function (`woff2_known_tags').  This avoids
4492	introducing a global constant array.  This function returns the
4493	specified index without *any* checks.  The caller must ensure that
4494	`index' is within array limits.
4495
4496	* src/sfnt/sfwoff2.c (woff2_open_font): Change `KnownTags[...]'
4497	notation to `woff2_known_tags( ...  )'.
4498
4499	* src/sfnt/woff2tags.c: Perform changes.
4500
4501	* src/sfnt/woff2tags.h: Update definitions.
4502
45032019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4504
4505	[woff2] Minor.
4506
4507	* src/sfnt/sfwoff2.c (woff2_uncompress): Add error message
4508	(woff2_open_font): Free `uncompressed_buf'.
4509
45102019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4511
4512	[woff2] Uncompress Brotli streams and `face_index' support.
4513
4514	WOFF2 compressed stream is now uncompressed if Brotli is available.
4515	This data is stored in a separate buffer (uncompressed_buf) because
4516	it does not contain direct table data.  Certain tables have
4517	transformations applied to them, and they must be reconstructed
4518	before we can write those tables to the SFNT stream.
4519
4520	`face_index' is now being passed as a parameter to
4521	`woff2_open_font'.
4522
4523	* src/sfnt/sfobjs.c (sfnt_open_font): Add parameter
4524	`face_instance_index'.
4525
4526	* src/sfnt/sfwoff2.c (woff2_uncompress): New function.
4527	(woff2_open_font): Call `woff2_uncompress'.
4528	(compute_first_table_offset): Fix return type.
4529
4530	* src/sfnt/sfwoff2.h (woff2_open_font): Modify declaration.
4531
45322019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4533
4534	* builds/unix/configure.raw: Change argument name to `brotli'.
4535
45362019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4537
4538	Add Brotli dependency and required checks.
4539
4540	Brotli is required for decompressing WOFF2 font directory streams.
4541	The library is thus being added as an optional dependency for
4542	FreeType.
4543
4544	* builds/unix/configure.raw: Add checks for `libbrotlidec'.
4545	(REQUIRES_PRIVATE, LIBS_PRIVATE, LIBSSTATIC_CONFIG): Updated.
4546
4547	* devel/ftoption.h, include/freetype/config/ftoption.h
4548	(FT_CONFIG_OPTION_USE_BROTLI): New macro.
4549
45502019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4551
4552	[woff2] Write SFNT Offset table.
4553
4554	* src/sfnt/sfwoff2.c (WRITE_USHORT, WRITE_ULONG): New macros.
4555	(compare_tags): New function.
4556	(woff2_open_font): Implement it.
4557
45582019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4559
4560	* src/sfnt/sfwoff2.c: #undef macros.
4561
45622019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4563
4564	[woff2] Read table and collection directory.
4565
4566	* include/freetype/internal/wofftypes.h (WOFF2_TtcFontRec): New
4567	structure.
4568	(WOFF2_HeaderRec): Add more fields.
4569
4570	* src/sfnt/sfwoff2.c (READ_255USHORT, READ_BASE128, ROUND4): New
4571	macros.
4572	(Read255UShort, CollectionHeaderSize, compute_first_table_offset):
4573	New functions.
4574	(ReadBase128): Use `FT_READ_BYTE'.
4575	(woff2_open_font): Add functionality to read table directory and
4576	collection directory (if present).
4577
45782019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4579
4580	[sfnt] Include `woff2tags.c' for building.
4581
4582	* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `woff2tags.c'.
4583
4584	* src/sfnt/sfnt.c: Include `woff2tags.c'.
4585
45862019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4587
4588	[sfnt] Add WOFF2 constants.
4589
4590	Add constants required for WOFF2, and known table tags as defined in
4591	the specification.  See
4592
4593	  https://www.w3.org/TR/WOFF2/#table_dir_format
4594
4595	for details.
4596
4597	* src/sfnt/woff2tags.c, src/sfnt/woff2tags.h: New files.
4598
45992019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4600
4601	[sfnt] Read WOFF 2 header.
4602
4603	Check for WOFF2 tag, call `woff2_open_font', and implement it to read
4604	header according to specification.
4605
4606	* include/freetype/internal/fttrace.h: Add `sfwoff2.c'.
4607
4608	* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `sfwoff2.c'.
4609
4610	* src/sfnt/sfnt.c: Include `sfwoff2.c'.
4611
4612	* src/sfnt/sfobjs.c (sfnt_open_font): Check for `wOF2' tag and call
4613	`woff2_open_font'.
4614
4615	* src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h: New files.
4616
46172019-08-27  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4618
4619	Add structures for WOFF2.
4620
4621	Add structures and macro for WOFF 2 header and table directory.
4622
4623	* include/freetype/internal/wofftypes.h (WOFF2_HeaderRec,
4624	WOFF2_TableRec_): New structures.
4625
4626	* include/freetype/tttags.h (TTAG_wOF2): New macro.
4627
46282019-08-26  Werner Lemberg  <wl@gnu.org>
4629
4630	* src/psaux/cffdecode.c (cff_operator_seac): Fix numeric overflow.
4631
4632	Reported as
4633
4634	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16470
4635
46362019-08-26  Werner Lemberg  <wl@gnu.org>
4637
4638	[type1] Fix `FT_Get_Var_Axis_Flags' (#56804).
4639
4640	* src/type1/t1load.c (T1_Get_MM_Var): Allocate space for axis flags.
4641	Also remove redundant assignment.
4642
46432019-07-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
4644
4645	* src/base/ftbbox.c (cubic_peak): Sanitize left shift (#56586).
4646
46472019-07-22  Weiyi Wu  <w1w2y3@gmail.com>
4648
4649	* src/cid/cidload.c (cid_hex_to_binary): Fix typo (#56653).
4650
46512019-07-12  Werner Lemberg  <wl@gnu.org>
4652
4653	[sfnt, winfonts] Avoid memory leaks in case of error (#56587).
4654
4655	* src/sfnt/sfwoff.c (woff_open_font): Call `FT_FRAME_EXIT' in case
4656	of error.
4657
4658	* src/winfonts/winfnt.c (fnt_face_get_dll_font): Ditto.
4659
46602019-07-12  Ben Wagner  <bungeman@google.com>
4661
4662	Properly handle phantom points for variation fonts (#56601).
4663
4664	* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Scale phantom
4665	points if HVAR and/or VVAR is present.
4666
46672019-07-04  Werner Lemberg  <wl@gnu.org>
4668
4669	[psaux] (2/2) Handle fonts that use SEAC for ligatures (#56580).
4670
4671	The same as previous commit but for the old engine.
4672
4673	* src/psaux/t1decode.c (t1operator_seac): Implement it.
4674
46752019-07-04  Chris Liddell <chris.liddell@artifex.com>
4676
4677	[psaux] (1/2) Handle fonts that use SEAC for ligatures (#56580).
4678
4679	As originally intended, a Type 1 SEAC charstring would be used for
4680	an accented glyph (like `acaron' or `uumlaut'), where the advance
4681	width of the SEAC glyph is the same as that of the `base' glyph
4682	(like `a' or `u').  In this case it is not uncommon for the SEAC
4683	glyph to not use an (H)SBW opcode of its own but to rely on the
4684	value from the base glyph.
4685
4686	However, out-of-spec fonts also use SEAC glyphs for ligatures (like
4687	`oe' or `fi'), and in those cases the overall advance width is
4688	greater than that of the `base' glyph.  For this reason we have to
4689	allow that the SEAC glyph can have an (H)SBW value of its own, and
4690	if it has, retain this value, rather than the one from the base
4691	glyph.
4692
4693	* src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escSEAC>:
4694	Implement it.
4695
46962019-07-01  Werner Lemberg  <wl@gnu.org>
4697
4698	* Version 2.10.1 released.
4699	==========================
4700
4701
4702	Tag sources with `VER-2-10-1'.
4703
4704	* docs/VERSION.TXT: Add entry for version 2.10.1.
4705
4706	* README, Jamfile (RefDoc), src/base/ftver.rc,
4707	builds/windows/vc2010/freetype.vcxproj,
4708	builds/windows/vc2010/index.html,
4709	builds/windows/visualc/freetype.dsp,
4710	builds/windows/visualc/freetype.vcproj,
4711	builds/windows/visualc/index.html,
4712	builds/windows/visualce/freetype.dsp,
4713	builds/windows/visualce/freetype.vcproj,
4714	builds/windows/visualce/index.html,
4715	builds/wince/vc2005-ce/freetype.vcproj,
4716	builds/wince/vc2005-ce/index.html,
4717	builds/wince/vc2008-ce/freetype.vcproj,
4718	builds/wince/vc2008-ce/index.html: s/2.10.0/2.10.1/, s/2100/2101/.
4719
4720	* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
4721
4722	* builds/unix/configure.raw (version_info): Set to 23:1:17.
4723	* CMakeLists.txt (VERSION_PATCH): Set to 1.
4724
4725	* include/freetype/fterrors.h (FT_Error_String): Fix C++ compilation.
4726
47272019-06-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
4728
4729	* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Fix inequality.
4730
4731	Reported by Armin Hasitzka.
4732
47332019-06-16  Werner Lemberg  <wl@gnu.org>
4734
4735	* src/tools/apinames.c: Formatting, minor edits.
4736
47372019-06-16  Werner Lemberg  <wl@gnu.org>
4738
4739	[autofit] Disable hinting if no blue zones are available (#56450).
4740
4741	* src/autofit/afglobal.c (af_face_global_get_metrics): Start again
4742	(with dummy hinter module) if no blue zones are present.
4743
4744	* src/autofit/aflatin.c (af_latin_metrics_init_blues): Change
4745	signature to return error code.
4746	If no blue zones are found, update `glyph_styles' array to hold
4747	AF_STYLE_NONE_DFLT instead of the current style.
4748	(af_latin_metrics_init): Return internal error code if no blue zones
4749	are found.
4750
47512019-06-16  Werner Lemberg  <wl@gnu.org>
4752
4753	Towards better VMS support.
4754
4755	More to come.
4756
4757	* builds/vms/LIBS.OPT_IA64, builds/vms/_LINK.OPT_IA64,
4758	builds/vms/vmslib.dat: New files provided by Jouk Jansen
4759	<joukj@hrem.nano.tudelft.nl>.
4760
4761	* builds/vms/ftconfig.h: Update, also from Jouk.
4762
47632019-06-13  Werner Lemberg  <wl@gnu.org>
4764
4765	* src/autofit/aflatin.c (af_latin_metrics_init_widths): Minor.
4766
47672019-06-13  Alexei Podtelezhnikov  <apodtele@gmail.com>
4768
4769	[smooth] Restore the span buffering for direct mode only.
4770
4771	The buffer size FT_MAX_GRAY_SPANS is set to 10 spans, which should be
4772	enough to cover the entire scanline for simple glyphs in most cases:
4773	each slightly slanted edge needs up to two spans, plus a filling span
4774	in-between.  This is not new, we used to do it before cb4388783cecc.
4775
4776	* src/smooth/ftgrays.c (gray_TWorker): Add `spans' and `num_spans'.
4777	(gray_hline, gray_sweep): Implement the span buffering.
4778	(gray_raster_render): Use negative `num_spans' to avoid the direct
4779	mode.
4780
47812019-06-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
4782
4783	* include/freetype/ftmodapi.h (FT_DebugHook_Func): Return error.
4784
4785	Fix a warning by adding a return value as in `TT_RunIns',
4786	which should not be a compatibility issue.
4787
47882019-06-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
4789
4790	* src/truetype/ttobjs.c (tt_check_trickyness_family): Add `const'.
4791
47922019-06-11  Moazin Khatti  <moazinkhatri@gmail.com>
4793
4794	[gzip] Add support for `gzip' encoded header.
4795
4796	* src/gzip/ftgzip.c (FT_Gzip_Uncompress): Modify the the call to
4797	`inflateInit2' to enable support for `gzip' encoded headers.
4798
47992019-06-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
4800
4801	[type1,type42] Use `const' for string literals.
4802
4803	* include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated.
4804	* include/freetype/internal/t1types.h (T1_EncodingRec): Updated.
4805	* src/psaux/psobjs.[ch] (ps_table_add): Updated.
4806	* src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated.
4807	* src/type42/t42objs.c (T42_Open_Face): Updated.
4808	* src/type42/t42parse.c (t42_parse_encoding): Updated.
4809
4810	* src/cff/cffobjs.c (cff_face_init): Minor.
4811
48122019-06-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
4813
4814	[bdf,pcf] Use `const' for string literals.
4815
4816	* src/bdf/bdf.h (bdf_property_t): Updated `name'.
4817	* src/bdf/bdflib.c (_bdf_list_split,bdf_create_property,
4818	_bdf_add_property,_bdf_ato*): Updated.
4819	* src/bdf/bdfdrivr.c (bdf_interpret_style): Updated.
4820	* src/pcf/pcfread.c (pcf_intrpret_style): Ditto.
4821
48222019-06-07  Philip Race  <philip.race@oracle.com>
4823
4824	* src/base/ftinit.c (FT_Set_Default_Properties): Fix crash.
4825
4826	Terminate loop at end of environment.
4827
48282019-05-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
4829
4830	Solidify VC2005 builds.
4831
4832	* include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Explicitly
4833	declare `_BitScanReverse' intrinsic.
4834	* builds/windows/visualc/freetype.vcproj [Debug]: Disable intrinsics.
4835
48362019-05-30  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
4837
4838	[sfnt] Separate WOFF sources and headers.
4839
4840	Move WOFF sources and headers to separate files.
4841
4842	* include/freetype/internal/wofftypes.h, src/sfnt/sfwoff.c,
4843	src/sfnt/sfwoff.h: New files.
4844
4845	* include/freetype/internal/fttrace.h: Register `sfwoff.c'.
4846
4847	* include/freetype/internal/internal.h: Define
4848	FT_INTERNAL_WOFF_TYPES_H.
4849
4850	* include/freetype/internal/sfnt.h: Include FT_INTERNAL_WOFF_TYPES_H.
4851
4852	* include/freetype/internal/tttypes.h: Move out WOFF structures.
4853
4854	* src/sfnt/rules.mk: Add `sfwoff.c'.
4855
4856	* src/sfnt/sfnt.c: Include `sfwoff.c'.
4857
4858	* src/sfnt/sfobjs.c: Include `sfwoff.h', move out WOFF sources.
4859
48602019-05-30  Werner Lemberg  <wl@gnu.org>
4861
4862	[base] Fix `make multi'.
4863
4864	Reported by Nikhil.
4865
4866	* src/base/fterrors.c: Include FT_INTERNAL_DEBUG_H.
4867
48682019-05-29  Ben Wagner  <bungeman@google.com>
4869
4870	[truetype] Fix copy-and-paste error (#56409).
4871
4872	* src/truetype/ttgload.c (load_truetype_glyph): Use correct indices
4873	into `unrounded' array for phantom points.
4874
48752019-05-29  Werner Lemberg  <wl@gnu.org>
4876
4877	[truetype] Fix 32bit builds (#56404).
4878
4879	Patch suggested by Ben Wagner <bungeman@google.com>.
4880
4881	* src/truetype/ttgxvar.c (FT_fixedToInt, FT_fixedToFdot6): Remove
4882	harmful cast to unsigned type.
4883
48842019-05-26  Ben Wagner  <bungeman@google.com>
4885
4886	* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Improve accuracy.
4887
48882019-05-23  Werner Lemberg  <wl@gnu.org>
4889
4890	[truetype] Draw glyphs without deltas in variation font (#56374).
4891
4892	* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Always fill
4893	`unrounded' array.
4894
48952019-05-21  Werner Lemberg  <wl@gnu.org>
4896
4897	* src/truetype/ttinterp.c (opcode_name): Improve mnemonics.
4898
48992019-05-16  Werner Lemberg  <wl@gnu.org>
4900
4901	[truetype] Actually scale varied CVT values.
4902
4903	Up to now, only the unscaled CVT values were varied; in other words,
4904	the `CVAR' data was never used for bytecode hinting.
4905
4906	* src/truetype/ttgxvar.c (tt_cvt_ready_iterator): New auxiliary
4907	function.
4908	(tt_face_vary_cvt): Use it to trigger rescaling of CVT values.
4909
49102019-05-16  Werner Lemberg  <wl@gnu.org>
4911
4912	[truetype] Use 26.6 format for storing unscaled CVT values.
4913
4914	If `CVAR' data is applied to variation fonts, fractional values are
4915	possible.
4916
4917	* include/freetype/internal/tttypes.h (TT_FaceRec): Change type of
4918	`cvt' from `FT_Short' to `FT_Int32'.
4919
4920	* src/truetype/ttgxvar.c (FT_fdot6ToFixed): New macro.
4921	(tt_face_vary_cvt): Use it to update code to 26.6 format.
4922
4923	* src/truetype/ttobjs.c (tt_size_run_prep): Update code to 26.6
4924	format.
4925
4926	* src/truetype/ttpload.c (tt_face_load_cvt): Stora data in 26.6
4927	format.
4928
49292019-05-16  Werner Lemberg  <wl@gnu.org>
4930
4931	* src/truetype/ttgload.c (load_truetype_glyph): Init `unrounded'.
4932
4933	This fixes linear advance width values for spacing glyphs.  Bug
4934	introduced 2019-05-09.
4935
49362019-05-16  Werner Lemberg  <wl@gnu.org>
4937
4938	[truetype] Avoid code duplication.
4939
4940	* src/truetype/ttobjs.c (tt_size_run_prep): Scale CVT values in this
4941	function.
4942	(tt_size_ready_bytecode): Updated.
4943	* src/truetype/ttgload.c (tt_loader_init): Updated.
4944
49452019-05-13  Jouk Jansen  <joukj@hrem.nano.tudelft.nl>
4946
4947	* vms_make.com: Updated.  Handle `bzip2' directory, too.
4948
49492019-05-13  Werner Lemberg  <wl@gnu.org>
4950
4951	* src/psaux/psfont.c (cf2_font_setup): Fix compiler warning.
4952
49532019-05-12  Werner Lemberg  <wl@gnu.org>
4954
4955	[truetype] Doh.  Fix last commit to make it work.
4956
4957	Very embarassing :-)
4958
4959	Reported as
4960
4961	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14701
4962	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14705
4963	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14710
4964
4965	* src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): Move up and add
4966	argument; update all callers.
4967	(TT_Process_Simple_Glyph): Use it.  The `unrounded' array is active
4968	for variation fonts only, thus also enclose related code with
4969	`#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT ...  #endif' where
4970	necessary.
4971	Revert commit a113e5d from 2019-05-09, and don't use `extra_points2'
4972	but allocate a temporary array.
4973	Speed up the scaling of the `unrounded' array.
4974
4975	* src/truetype/ttgxvar.c (FT_fixedToInt, FT_FixedToFdot6): Fix type
4976	conversions and rounding.  The unsigned type must have more or equal
4977	bits to the signed type.
4978
49792019-05-09  Werner Lemberg  <wl@gnu.org>
4980
4981	[truetype] Increase precision of font variation (#54371).
4982
4983	This patch makes FreeType use font units in 26.6 format internally
4984	instead of integers.
4985
4986	* src/truetype/ttgxvar.c (FT_fixedToFdot6): New macro.
4987	(TT_Vary_Apply_Glyph_Deltas): Add argument to output unrounded font
4988	coordinates.
4989	* src/truetype/ttgxvar.h: Updated.
4990
4991	* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Use
4992	`extra_points2' array to temporarily hold unrounded point
4993	coordinates; use them to compute scaled coordinates and linear
4994	advance width and height.
4995	(load_truetype_code): Adjust similarly.
4996
49972019-05-09  Werner Lemberg  <wl@gnu.org>
4998
4999	* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Minor.
5000
50012019-05-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
5002
5003	[smooth] Faster fractions.
5004
5005	* src/smooth/ftgrays.c (SUBPIXELS): Replace with...
5006	(FRACT): A fractional coordinate macro to use in...
5007	(gray_render_line, gray_render_scanline): ... here.
5008
50092019-05-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
5010
5011	* src/raster/ftraster.c (Draw_Sweep): Unbreak.
5012
50132019-05-05  Alexei Podtelezhnikov  <apodtele@gmail.com>
5014
5015	* src/raster/ftraster.c: Clean-ups.
5016
50172019-05-05  Werner Lemberg  <wl@gnu.org>
5018
5019	* src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'.
5020
50212019-05-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
5022
5023	* src/smooth/ftgrays.c (gray_render_line): Small shortcut.
5024
50252019-05-04  Werner Lemberg  <wl@gnu.org>
5026
5027	Various clang 8.0 static analyzer fixes.
5028
5029	Reported by Sender Ghost <lightside@gmx.com>.
5030
5031	* src/autofit/afcjk.c (af_cjk_hints_compute_edges): Catch a corner
5032	case where `edge->first' could be NULL.
5033
5034	* src/pfr/pfrobjs.c (pfr_slot_load): Remove unnecessary test of
5035	`size'.
5036
5037	* src/raster/ftraster.c (Draw_Sweep): Catch a corner case where
5038	`draw_right' might be NULL.
5039
5040	* src/sfnt/ttmtx.c (tt_face_get_metrics): Fix limit test for
5041	`aadvance'.
5042	Ensure `abearing' always hold a meaningful result.
5043
5044	* src/truetype/ttgload.c (load_truetype_glyph): Ensure `subglyph' is
5045	not NULL before accessing it.
5046	* src/truetype/ttgxvar.c (TT_Set_Named_Instance): Remove unnecessary
5047	test of `namedstyle'.
5048
5049	* src/type42/t42parse.c (t42_parser_done): Ensure
5050	`parser->root.funcs.done' is not NULL before accessing it.
5051
50522019-05-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
5053
5054	Miscellaneous macro updates.
5055
5056	* src/base/ftoutln.c (SCALED): Updated.
5057	* src/smooth/ftgrays.c (SCALED): Ditto.
5058	(FLOOR, ROUND, CEILING): Removed.
5059	* src/psaux/psfixed.h (cf2_fracToFixed): Updated.
5060
50612019-05-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
5062
5063	Tweak LCD filtering.
5064
5065	* src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
5066	Choose direction from bitmap's pixel_mode.
5067	* include/freetype/internal/ftobjs.c (FT_Bitmap_LcdFilterFunc):
5068	Updated.
5069	* src/smooth/ftsmooth.c (ft_smooth_render_generic): Updated.
5070
50712019-05-02  Werner Lemberg  <wl@gnu.org>
5072
5073	* vms_make.com: Updated (#56253).
5074
5075	Remove no longer existing directories (`autohint', `otlayout').
5076	Update used base extensions.
5077	Activate `autofit' module.
5078	Add `gxvalid' module.
5079	Update copyright notices.
5080
50812019-04-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
5082
5083	[smooth] Simplify cubic Bézier flattening.
5084
5085	The previous implementation is correct but it is too complex.
5086	The revised algorithm is based on the fact that each split moves
5087	the control points closer to the trisection points on the chord.
5088	The corresponding distances are good surrogates for the curve
5089	deviation from the straight line.
5090
5091	This cubic flattening algorithm is somewhat similar to the conic
5092	algorithm based the distance from the control point to the middle of
5093	the chord.  The cubic distances, however, decrease less predictably
5094	but are easy enough to calculate on each step.
5095
5096	The new algorithm produces slightly larger number of splits, which is
5097	compensated by its simplicity.  The overall rendering performance is
5098	improved by 1-2%.  The larger number of splits does not necessarily
5099	result in higher quality, which stays comparable.
5100
5101	* src/smooth/ftgrays.c (gray_render_cubic): Replace the split
5102	condition.
5103
51042019-04-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
5105
5106	[smooth] Bithacks and cosmetics.
5107
5108	* src/smooth/ftgrays.c (gray_record_cell, gray_set_cell, gray_hline,
5109	gray_render_conic, gray_convert_glyph_inner): Updated.
5110
51112019-04-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
5112
5113	Optimize Bézier bisections.
5114
5115	This change makes bisections faster by 20-30%. When inlined into
5116	`gray_render_cubic', this makes the function faster by 10% and is
5117	noticeable in the overall rendering performance.
5118
5119	* src/raster/ftraster.c (Split_Conic, Split_Cubic): Use shifts and
5120	refactor.
5121	* src/smooth/ftgrays.c (gray_split_conic, gray_split_cubic): Ditto.
5122	* src/base/ftstroke.c (ft_conic_split, ft_cubic_split): Ditto.
5123	* src/base/ftbbox.c (cubic_peak): Use shifts.
5124
51252019-04-23  Werner Lemberg  <wl@gnu.org>
5126
5127	* src/sfnt/ttcmap.c (tt_cmap12_next): Remove dead code.
5128
5129	Found by clang 8.0's static analyzer and reported by Sender Ghost
5130	<lightside@gmx.com>.
5131
51322019-04-23  Werner Lemberg  <wl@gnu.org>
5133
5134	[base] Fix thinko in previous commit.
5135
5136	* src/base/ftbitmap.c (FT_Bitmap_Blend): Check final width, not
5137	target pitch.
5138
5139	Problem reported by Sender Ghost <lightside@gmx.com>.
5140
51412019-04-22  Werner Lemberg  <wl@gnu.org>
5142
5143	* src/base/ftbitmap.c (FT_Bitmap_Blend): Check target pitch.
5144
5145	Problem reported by Sender Ghost <lightside@gmx.com>.
5146
51472019-04-22  Werner Lemberg  <wl@gnu.org>
5148
5149	Fix return value of `FT_Set_Named_Instance' (#56186).
5150
5151	* src/truetype/ttgxvar.c (TT_Set_Named_Instance): Correctly handle
5152	internal return value -1 of `TT_Set_Var_Design'.
5153
51542019-04-18  Werner Lemberg  <wl@gnu.org>
5155
5156	[pcf] Fix handling of undefined glyph (#56067).
5157
5158	This commit fixes the changes from 2018-07-21, which broke charmap
5159	iteration.  We now add the default character as a new glyph with
5160	index 0, thus increasing the number of glyphs by one (as before).
5161
5162	* src/pcf/pcfread.c (pcf_get_metrics): Adjust to new artificial
5163	glyph with index 0.
5164	Limit number of elements to 65534.
5165	(pcf_get_bitmaps): Ditto.
5166	Unify two loops into one; this avoids allocation of an intermediate
5167	array.
5168	(pcf_get_encodings): Don't flip indices but copy glyph metrics of
5169	default character to index 0.
5170	Also handle invalid default character.
5171
5172	* docs/CHANGES: Updated.
5173
51742019-04-15  Minmin Gong  <gongminmin@msn.com>
5175
5176	* CMakeLists.txt: Avoid rewriting of unchanged configuration files.
5177
5178	Reported as
5179
5180	  https://savannah.nongnu.org/patch/index.php?9755
5181
51822019-04-15  JDG  <JonathanG@iQmetrix.com>
5183
5184	* src/tools/apinames.c (main): Fix error message.
5185
5186	Reported as
5187
5188	  https://savannah.nongnu.org/patch/?9796
5189
51902019-04-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
5191
5192	[smooth] Fix segfault in direct mode (#56092).
5193
5194	* src/base/ftoutln.c (FT_Outline_Render): Set missing clip_box for
5195	direct mode.
5196	* src/smooth/ftgrays.c (gray_raster_render): Use it.
5197
51982019-04-06  Werner Lemberg  <wl@gnu.org>
5199
5200	* src/sfnt/ttcmap.c (tt_get_glyph_name): Pacify compiler (#56061).
5201
5202	This is for Visual Studio 2019 on ARM.
5203
52042019-04-06  Werner Lemberg  <wl@gnu.org>
5205
5206	For distribution, replace `.tar.bz2' with `.tar.xz' bundles.
5207
5208	* builds/toplevel.mk (build): Do it.
5209
5210	* README, docs/CHANGES, docs/release: Updated.
5211
52122019-04-06  Antony Lee  <anntzer.lee@gmail.com>
5213
5214	Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'.
5215
5216	* include/freetype/freetype.h (FT_Get_Name_Index),
5217	include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc),
5218	include/freetype/internal/services/svgldict.h
5219	(FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index),
5220	src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c
5221	(sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index),
5222	src/type42/t42drivr.c (t42_get_name_index): Add `const' to second
5223	argument.
5224
52252019-03-31  Armin Hasitzka  <prince.cherusker@gmail.com>
5226
5227	[cff] Fix boundary checks.
5228
5229	642bc7590c701c8cd35a9f60fa899cfa518b17ff introduced dynamically
5230	allocated memory when parsing CFF files with the "old" engine.  Bounds
5231	checks have never been updated, however, leading to pointless
5232	comparisons of pointers in some cases.  This commit presents a
5233	solution for bounds checks in the CFF module with an extended logic
5234	for the "old" engine while staying as concise as possible for the
5235	"new" one.
5236
5237	* src/cff/cffparse.h: Introduce the struct `CFF_T2_StringRec' and
5238	the additional field `t2_strings' within `CFF_ParserRec'.
5239
5240	* src/cff/cffparse.c (cff_parser_within_limits): Move all boundary
5241	checks into this new function and update the rest of `cffparse.c' to
5242	use it.
5243
5244	Reported as
5245
5246	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12137
5247
52482019-03-20  Werner Lemberg  <wl@gnu.org>
5249
5250	[autofit] Fix Mongolian blue zone characters.
5251
5252	* src/autofit/afblue.dat: Use U+200D (ZERO-WIDTH JOINER) characters
5253	to get medial forms for some Mongolian characters.
5254	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
5255
52562019-03-19  Werner Lemberg  <wl@gnu.org>
5257
5258	[autofit] Add support for Mongolian script.
5259
5260	As a de-facto standard, layouts using this script are constructed
5261	horizontally line by line, then the lines are rotated clockwise for
5262	vertical display.
5263
5264	* src/autofit/afblue.dat: Add blue zone data for Mongolian.
5265	* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
5266
5267	* src/autofit/afscript.h: Add Mongolian standard characters.
5268
5269	* src/autofit/afranges.c, src/autofit/afstyles.h: Add Mongolian
5270	data.
5271
52722019-03-15  Werner Lemberg  <wl@gnu.org>
5273
5274	* Version 2.10.0 released.
5275	==========================
5276
5277
5278	Tag sources with `VER-2-10-0'.
5279
5280	* docs/VERSION.TXT: Add entry for version 2.10.0.
5281	* docs/CHANGES: Updated.
5282
5283	* README, Jamfile (RefDoc), src/base/ftver.rc,
5284	builds/windows/vc2010/freetype.vcxproj,
5285	builds/windows/vc2010/index.html,
5286	builds/windows/visualc/freetype.dsp,
5287	builds/windows/visualc/freetype.vcproj,
5288	builds/windows/visualc/index.html,
5289	builds/windows/visualce/freetype.dsp,
5290	builds/windows/visualce/freetype.vcproj,
5291	builds/windows/visualce/index.html,
5292	builds/wince/vc2005-ce/freetype.vcproj,
5293	builds/wince/vc2005-ce/index.html,
5294	builds/wince/vc2008-ce/freetype.vcproj,
5295	builds/wince/vc2008-ce/index.html: s/2.9.1/2.10.0/, s/291/2100/.
5296
5297	* include/freetype/freetype.h (FREETYPE_MINOR): Set to 10.
5298	(FREETYPE_PATCH): Set to 0.
5299
5300	* builds/unix/configure.raw (version_info): Set to 23:0:17.
5301	* CMakeLists.txt (VERSION_MINOR): Set to 10.
5302	(VERSION_PATCH): Set to 0.
5303
5304	* builds/toplevel.mk (version, winversion): Since the minor version
5305	number has two digits now, never omit the patch number.  We would
5306	get ambiguous zip file names otherwise.
5307	(dist): Remove remnants of `docmaker' tool.
5308	(do-dist): Remove unused intermediate files.
5309
5310	* src/cff/cffparse.c (destrict_c2s_item): Guard function with
5311	CFF_CONFIG_OPTION_OLD_ENGINE macro.
5312
53132019-03-07  Andrei Alexeyev  <0x416b617269@gmail.com>
5314            Werner Lemberg  <wl@gnu.org>
5315
5316	Fix invalid function pointer casts.
5317
5318	This change should allow Freetype to work on WASM/Emscripten without
5319	needing `-s EMULATE_FUNCTION_POINTER_CASTS=1'.
5320
5321	* src/autofit/afdummy.c (af_dummy_hints_apply): Fix signature.
5322
5323	* src/cid/cidload.c (cid_parse_font_matrix, parse_fd_array,
5324	parse_expansion_factor, parse_font_name): Return `void', not
5325	`FT_Error'.
5326
5327	* include/freetype/internal/ftobjs.h (FT_CMap_CharVarIsDefaultFunc):
5328	Fix signature.
5329
53302019-03-05  Werner Lemberg  <wl@gnu.org>
5331
5332	[base] Handle numeric overflow (#55827).
5333
5334	* src/base/ftglyph.c (FT_Glyph_Get_CBox): Use `FT_PIX_CEIL_LONG'.
5335
53362019-03-05  Sebastian Rasmussen  <sebras@gmail.com>
5337
5338	[psaux] Fix use of uninitialized memory (#55832).
5339
5340	* src/psaux/psintrp.c (cf2_interpT2CharString): The call to
5341	`cf2_arrstack_setCount' may fail because the allocator ran out of
5342	memory.  When this happens the stack is still written to before the
5343	error condition is checked.  This means that FreeType writes outside
5344	of allocated memory.  This commit moves the error check prior to the
5345	stack assignment, hence the function now properly returns with an
5346	error condition.
5347
53482019-02-23  Werner Lemberg  <wl@gnu.org>
5349
5350	* src/base/ftbitmap.c (FT_Bitmap_Blend): No fractional offsets.
5351
5352	The function only provided a framework without an actual
5353	implementation, which this commit removes.
5354
53552019-02-23  Werner Lemberg  <wl@gnu.org>
5356
5357	* src/tools/update-copyright-year: Insert `(C)'.
5358
53592019-02-21  Armin Hasitzka  <prince.cherusker@gmail.com>
5360
5361	[truetype] Mask numeric overflows.
5362
5363	* src/truetype/ttinterp.c (Move_CVT, Move_CVT_Stretched, Ins_MIRP):
5364	Mask numeric overflows.
5365
5366	Reported as
5367
5368	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11681
5369	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11734
5370
53712019-02-21  Armin Hasitzka  <prince.cherusker@gmail.com>
5372
5373	[psaux] Mask numeric overflow.
5374
5375	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Mask numeric
5376	overflow.
5377
5378	Reported as
5379
5380	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13041
5381
53822019-02-16  Wink Saville  <wink@saville.com>
5383
5384	* src/autofit/afwarp.h (af_warper_compute): Fix declaration.
5385
53862019-02-02  Nikolaus Waxweiler  <madigens@gmail.com>
5387
5388	[truetype] Apply MVAR hasc, hdsc and hlgp metrics to current FT_Face metrics.
5389
5390	Instead of setting typo or win metrics as the new `FT_Face' metrics
5391	indiscriminately, apply only typo deltas to the currently active
5392	`FT_Face' metrics.  This prevents line height differences when the
5393	default outlines were used as the regular face and instances for
5394	everything else, for example.
5395
5396	* src/truetype/ttgxvar.c (tt_apply_mvar): Implement.
5397
53982019-02-02  Nikolaus Waxweiler  <madigens@gmail.com>
5399
5400	[sfnt] Use typo metrics if OS/2 fsSelection USE_TYPO_METRICS bit is set.
5401
5402	If the `OS/2' table exists and `fsSelection' bit 7
5403	(USE_TYPO_METRICS) is set, use the `sTypo*' set of values to compute
5404	the `FT_Face's ascender, descender, and height.  Otherwise, fall
5405	back to old behavior.
5406
5407	* src/sfnt/sfobjs.c (sfnt_load_face): Implement.
5408
54092019-01-18  John Tytgat  <John.Tytgat@esko.com>
5410
5411	[sfnt] Handle TT fonts having two PostScript font names (#55471).
5412
5413	* src/sfnt/sfdriver.c (sfnt_get_name_id): Prefer English over any
5414	other language found for PostScript font names.
5415
54162019-01-08  Chris Liddell <chris.liddell@artifex.com>
5417
5418	[psaux] Fix closepath (#55414).
5419
5420	All of the Type 1 path building is done with code common to the
5421	revised CFF engine, with the exception of closepath, which was still
5422	calling ps_builder_close_contour(), thus previously cached segments
5423	were not always written to the path, and glyph corruption, or even
5424	invalid outlines were possible.
5425
5426	* src/psauc/psinterp.c (cf2_interpT2CharString) <cf2_cmdCLOSEPATH>:
5427	Switch to calling `cf2_glyphpath_closeOpenPath'.
5428
54292018-12-29  Werner Lemberg  <wl@gnu.org>
5430
5431	* src/autofit/aflatin2.c: Some fixes from `aflatin.c' (#55310).
5432
54332018-12-25  Werner Lemberg  <wl@gnu.org>
5434
5435	* src/psaux/cffdecode.c (cff_operaor_seac): Fix numeric overflow.
5436
5437	Reported as
5438
5439	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11915
5440
54412018-12-12  Werner Lemberg  <wl@gnu.org>
5442
5443	[gxvalid] Fix compiler warnings.
5444
5445	* src/gxvalid/gxvjust.c (gxv_just_check_max_gid),
5446	src/gxvalid/gxvmort.c (gxv_mort_coverage_validate): Use `FT_UNUSED'.
5447
54482018-12-11  Werner Lemberg  <wl@gnu.org>
5449
5450	* src/truetype/ttgload.c (TT_Hint_Glyph): Remove useless test.
5451
5452	`control_len' only gets its value from `n_ins' (and vice versa),
5453	which is always read as `unsigned short' and thus can't be larger
5454	than 0xFFFF.
5455
54562018-12-04  Werner Lemberg  <wl@gnu.org>
5457
5458	[bdf] Ignore data after `ENDFONT'.
5459
5460	Reported as
5461
5462	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10798
5463
5464	* src/bdf/bdflib.c (_bdf_parse_end): New function.
5465	(_bdf_parse_glyphs): Switch to `_bdf_parse_end' after `ENDFONT' has
5466	been encountered.
5467
54682018-12-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
5469
5470	* builds/windows/visualc/freetype.dsp: Dust off.
5471
54722018-11-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
5473
5474	* builds/windows/vc2010/freetype.vcxproj: Simplify.
5475
54762018-11-27  Chris Liddell  <chris.liddell@artifex.com>
5477
5478	[type1,cff] Add FT_{Set,Get}_MM_WeightVector API calls.
5479
5480	For multiple master fonts, common usage (in Postscript) is to modify
5481	the WeightVector of an existing font instance, this addition
5482	supports that use.
5483
5484	* include/freetype/ftmm.h, src/base/ftmm.c (FT_Set_MM_WeightVector,
5485	FT_Get_MM_WeightVector): New API functions.
5486
5487	* include/freetype/internalservices/svmm.h
5488	(FT_Set_MM_WeightVector_Func, FT_Get_MM_WeightVector_Func): New
5489	function types.
5490	(MultiMasters): Add `set_mm_weightvector' and `get_mm_weightvector'
5491	members.
5492	(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
5493
5494	* src/cffcffdrivr.c (cff_set_mm_weightvector,
5495	cff_get_mm_weightvector): New functions.
5496	(cff_service_multi_masters): Register them.
5497
5498	* src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
5499	This driver doesn't use the new interface.
5500
5501	* src/type1/t1load.c (T1_Set_MM_WeightVector,
5502	T1_Get_MM_WeightVector): New functions.
5503	* src/type1/t1driver.c (t1_service_multi_masters): Register them.
5504	* src/type1/t1load.h: Updated.
5505
55062018-11-27  Ben Wagner  <bungeman@google.com>
5507
5508	[cff] Fix compiler warning (#55105).
5509
5510	* src/cff/cffparse.c (cff_parser_run): Guard label only used if
5511	CFF_CONFIG_OPTION_OLD_ENGINE is active.
5512
55132018-11-27  Ben Wagner  <bungeman@google.com>
5514
5515	[truetype] Fix numeric overflow (#55103).
5516
5517	* src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
5518
55192018-11-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
5520
5521	[builds] Belated DLL support with vc2002-vc2008.
5522
5523	The solution and project files should be automatically upgraded for
5524	the approriate Visual C++ version.
5525
5526	* builds/windows/visualc/freetype.{sln,vcproj}: Major upgrades.
5527	* builds/windows/visualc/index.html: Document the change.
5528	* builds/windows/vc2005, builds/windows/vc2008: Removed as redundant.
5529
55302018-11-22  Armin Hasitzka  <prince.cherusker@gmail.com>
5531
5532	* src/cff/cffparse.c: Please the compiler.
5533
55342018-11-22  Armin Hasitzka  <prince.cherusker@gmail.com>
5535
5536	[cff] Fix memory overflow.
5537
5538	Reported as
5539
5540	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9869
5541	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10869
5542
5543	* src/cff/cffparse.c (destruct_t2s_item, cff_parser_run): Store
5544	evaluated T2 charstrings in separately allocated memory.
5545
55462018-11-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
5547
5548	* builds/windows/{visualc,vc2005,vc2008}/freetype.vcproj: Fix it.
5549
55502018-11-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
5551
5552	[smooth] Placeholder only for library-enabled LCD filtering.
5553
5554	* src/smooth/ftsmooth.c (ft_smooth_init): Add disabled
5555	`FT_Library_SetLcdFilter' call.
5556
55572018-11-09  Young Xiao  <yangx92@hotmail.com>
5558
5559	[psaux] Add safety guard (#54985).
5560
5561	* src/psaux/psobjs.c (cff_builder_close_contour): Do it.
5562
55632018-11-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
5564
5565	* builds/unix/configure.raw: Require `windows.h' for windres.
5566
55672018-11-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
5568
5569	[ftstroke] Fix unpredictable failures (#54986).
5570
5571	* src/base/ftstroke.c (ft_sroke_border_lineto): Fix lineto check.
5572
55732018-11-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
5574
5575	[ftstroke] Fix unpredictable failures (#54976).
5576
5577	* src/base/ftstroke.c (ft_sroke_border_close): Set the start tags.
5578
55792018-11-07  Ben Wagner  <bungeman@google.com>
5580
5581	[truetype] Fix VF check from 2018-09-12 (#54973).
5582
5583	* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Use correct
5584	offsets for estimates.
5585
55862018-11-06  Werner Lemberg  <wl@gnu.org>
5587
5588	[pshinter] Fix numeric overflow.
5589
5590	Reported as
5591
5592	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11242
5593
5594	* src/pshinter/pshrec.c (ps_dimension_add_t1stem): Implement it.
5595
55962018-11-06  Werner Lemberg  <wl@gnu.org>
5597
5598	[psaux] Fix timeout in old CFF engine.
5599
5600	Reported as
5601
5602	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11260
5603
5604	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
5605	<cff_op_sqrt> [CFF_CONFIG_OPTION_OLD_ENGINE]: Fix potential endless
5606	loop.
5607
56082018-11-04  Alexei Podtelezhnikov  <apodtele@gmail.com>
5609
5610	* src/truetype/ttgxvar.c: Use enum definitions.
5611
56122018-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
5613
5614	* src/truetype/ttgxvar.c (ft_var_apply_tuple): Adjust condition.
5615
56162018-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
5617
5618	* src/truetype/ttgxvar.c (ft_var_apply_tuple): Tracing tweaks.
5619
56202018-11-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
5621
5622	Revert due to specs: [truetype] Speed up variation IUP.
5623
56242018-11-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
5625
5626	* src/truetype/ttgxvar.c (ft_var_get_item_delta): Fixed logic.
5627
5628	Reported and tested by Behdad.
5629
56302018-11-02  Shailesh Mistry  <shailesh.mistry@hotmail.co.uk>
5631
5632	[autofit] Prevent SEGV.
5633
5634	See
5635
5636	  https://bugs.ghostscript.com/show_bug.cgi?id=697545
5637
5638	for more details on how the bug was found.
5639
5640	* src/autofit/afloader.c (af_loader_load_glyph): Propagate error
5641	code.
5642
56432018-10-31  Alexei Podtelezhnikov <apodtele@gmail.com>
5644
5645	[truetype] Speed up variation IUP.
5646
5647	* src/truetype/ttgxvar.c (tt_delta_interpolate): Separate trivial
5648	snapping to the same position from true interpolation.
5649
56502018-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
5651
5652	* src/type1/t1load.c (t1_set_mm_blend): Optimized.
5653
56542018-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
5655
5656	* src/truetype/ttgxvar.c (ft_var_get_item_delta): Optimized.
5657
56582018-10-29  Werner Lemberg  <wl@gnu.org>
5659
5660	[base] Fix numeric overflow.
5661
5662	Reported as
5663
5664	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11080
5665
5666	* src/base/ftoutln.c (FT_Outline_Get_Orientation): Use `MUL_LONG'.
5667
56682018-10-29  Werner Lemberg  <wl@gnu.org>
5669
5670	[cff] Fix numeric overflow.
5671
5672	Reported as
5673
5674	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10988
5675
5676	* src/cff/cffparse.c (cff_parser_run)
5677	[CFF_CONFIG_OPTION_OLD_ENGINE]: Use `NEG_LONG'.
5678
56792018-10-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
5680
5681	[sfnt] Make `head' timestamps unsigned.
5682
5683	It's been more than 2^31 seconds since 1904.
5684
5685	* include/freetype/tttables.h (TT_Header): Change field types.
5686	* src/sfnt/ttload.c (tt_face_load_generic_header): Updated.
5687
56882018-10-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
5689
5690	Revert: Align FreeType with standard C memory management.
5691
56922018-10-27  Werner Lemberg  <wl@gnu.org>
5693
5694	[psaux] Fix numeric overflow.
5695
5696	Triggered by
5697
5698	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11157
5699
5700	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_blend>
5701	[CFF_CONFIG_OPTION_OLD_ENGINE]: Fix integer overflow.
5702
57032018-10-20  Werner Lemberg  <wl@gnu.org>
5704
5705	Avoid endless loop while tracing (#54858).
5706
5707	* src/type1/t1load.c (parse_buildchar): Guard tracing stuff with
5708	FT_DEBUG_LEVEL_TRACE.
5709
57102018-10-17  David Demelier  <markand@malikania.fr>
5711
5712	* CMakeLists.txt: Specify `RUNTIME DESTINATION'.
5713
5714	This is needed for DLL builds.
5715
57162018-10-07  Werner Lemberg  <wl@gnu.org>
5717
5718	A missing Unicode cmap is not a fatal error.
5719
5720	This is a follow-up to the previous commit.
5721
5722	* src/cff/cffobjs.c (cff_face_init), src/sfnt/sfobjs.c
5723	(sfnt_load_face), src/type1/t1objs.c (T1_Face_Init),
5724	src/type42/t42objs.c (T42_Face_Init): Implement it.
5725
57262018-10-07  Werner Lemberg  <wl@gnu.org>
5727
5728	Fix handling of FT_CONFIG_OPTION_ADOBE_GLYPH_LIST (#54794).
5729
5730	* src/cff/cffcmap.c (cff_cmap_unicode_init), src/psaux/t1cmap.c
5731	(t1_cmap_unicode_init), src/sfnt/ttcmap.c (tt_cmap_unicode_init):
5732	Check `unicodes_init' field.
5733
57342018-10-03  Werner Lemberg  <wl@gnu.org>
5735
5736	[ftgrays] Fix typo in stand-alone mode (#54771).
5737
5738	* src/smooth/ftgrays.c (FT_THROW) [STANDALONE_ &&
5739	FT_DEBUG_LEVEL_TRACE]: Fix call to `FT_ERR_CAT'.
5740
57412018-10-02  Werner Lemberg  <wl@gnu.org>
5742
5743	[psaux] Fix segfault.
5744
5745	Reported as
5746
5747	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10768
5748
5749	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
5750	<cff_op_callothersubr> [CFF_CONFIG_OPTION_OLD_ENGINE]: Check
5751	argument.
5752
57532018-10-02  Werner Lemberg  <wl@gnu.org>
5754
5755	[psaux] Fix numeric overflow.
5756
5757	Reported as
5758
5759	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10740
5760
5761	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_roll>
5762	[CFF_CONFIG_OPTION_OLD_ENGINE]: Use NEG_INT.
5763
57642018-10-02  Werner Lemberg  <wl@gnu.org>
5765
5766	[pshinter] Handle numeric overflow.
5767
5768	Reported as
5769
5770	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10550
5771
5772	* src/pshinter/pshglob.c (psh_blues_snap_stem): Mask numeric
5773	overflow.
5774
57752018-09-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
5776
5777	Align FreeType with standard C memory management.
5778
5779	* include/freetype/ftsystem.h: Include FT_TYPES_H.
5780	(*FT_Alloc_Func, *FT_Realloc_Func): Use size_t for the size arguments.
5781	* src/raster/ftmisc.h: Ditto.
5782
5783	* builds/amiga/src/base/ftsystem.c, builds/unix/ftsystem.c,
5784	* builds/vms/ftsystem.c, src/base/ftsystem.c (ft_alloc, ft_realloc):
5785	Use size_t for the size arguments.
5786
5787	* src/base/ftdbgmem.c (ft_mem_debug_alloc, ft_mem_debug_realloc): Use
5788	FT_Offset, aka size_t, for the size arguments.
5789
57902018-09-25  Werner Lemberg  <wl@gnu.org>
5791
5792	Fix handling of `FT_Bool'.
5793
5794	Before this commit we had code like
5795
5796	  (FT_Bool)( globals->glyph_styles[gindex] & 0x8000)
5797
5798	Since `FT_Bool' is defined to be an `unsigned char', the code
5799	evaluated to something like
5800
5801	  (unsigned char)( 0x8532 & 0x8000)
5802
5803	which in turn expanded to
5804
5805	  (unsigned char)( 0x8000)
5806
5807	and finally yielded 0x00 – i.e., false – not as expected.
5808
5809	Problem reported and analyzed by Tony Smith <tony.smith@macro4.com>.
5810
5811	* include/freetype/fttypes.h (FT_BOOL): Add a comparison against
5812	zero so that we always have a Boolean expression.
5813
5814	*/*: Replace castings to `FT_Bool' with calls to `FT_BOOL' where
5815	possible.
5816
58172018-09-23  Alexei Podtelezhnikov  <apodtele@gmail.com>
5818
5819	[bdf] Speed up charmap access.
5820
5821	This makes FT_Get_Char_Index and FT_Get_Next_Char 4-5 times faster.
5822
5823	* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Help binary search
5824	with continuous prediction.
5825
58262018-09-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
5827
5828	* src/base/ftobjs.c (ft_glyphslot_preset_bimap): Another tweak.
5829
5830	This one should be clearer. When the rounded monochrome bbox collapses
5831	we add a pixel that covers most if not all original cbox.
5832
58332018-09-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
5834
5835	* src/base/ftobjs.c (ft_glyphslot_preset_bimap): Further tweak.
5836
58372018-09-21  Ben Wagner  <bungeman@google.com>
5838
5839	Improve auto-hinter handling of bitmap fonts (#54681).
5840
5841	For bitmap fonts, `FT_Load_Glyph' should either return an error or
5842	not set the format to `FT_GLYPH_FORMAT_OUTLINE'.  However, in this
5843	case `FT_Load_Glyph' calls into the auto-hinter which calls back
5844	into `FT_Load_Glyph' with `FT_LOAD_NO_SCALE' in the flags, which
5845	marks the glyph as `FT_GLYPH_FORMAT_OUTLINE' with an empty path
5846	(even though it doesn't have any path).  It appears that the
5847	auto-hinter should not be called when the face doesn't have
5848	outlines.  The current test for using the auto-hinter in
5849	`FT_Load_Glyph' checks whether the driver supports scalable
5850	outlines, but not if the face supports scalable outlines.
5851
5852	* src/base/ftobjs.c (FT_Load_Glyph): Directly check whether we have
5853	scalable outlines.
5854
58552018-09-21  Werner Lemberg  <wl@gnu.org>
5856
5857	[raster] Fix disappearing vertical lines (#54589).
5858
5859	* src/raster/ftraster.c (Vertical_Sweep_Span): Handle special case
5860	where both left and right outline exactly pass pixel centers.
5861
58622018-09-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
5863
5864	* src/base/ftobjs.c (ft_glyphslot_preset_bimap): Tiny rounding tweak.
5865
5866	This adds pixels in case a contour goes through the center
5867	and they need to be turned on in the b/w rasterizer.
5868
58692018-09-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
5870
5871	[pcf] Replace charmap implementation.
5872
5873	PCF comes with charmap lookup table, aka PCF encodings.  Using it
5874	directly makes FT_Get_Char_Index and FT_Get_Next_Char 4-5 times
5875	faster than the original BDF-like binary searches.
5876
5877	* src/pcf/pcf.h (PCF_EncodingRec): Removed.
5878	(PCF_FaceRec): Remove `nencodings' and `encodings'.
5879	* src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Replaced.
5880	* src/pcf/pcfread.c (pcf_get_encodings): Store data differently.
5881
58822018-09-20  Werner Lemberg  <wl@gnu.org>
5883
5884	[base] Remove unused function `FT_GlyphLoader_CopyPoints'.
5885
5886	* include/freetype/internal/ftgloadr.h, src/base/ftgloadr.c
5887	(FT_GlyphLoader_CopyPoints): Do it.
5888
58892018-09-19  Alexei Podtelezhnikov  <apodtele@gmail.com>
5890
5891	[pcf] Prepare to replace charmap implementation.
5892
5893	* src/pcf/pcf.h (PCF_FaceRec): Updated to include...
5894	(PCF_EncRec): ... this new structure to store charmap geometry.
5895
5896	* src/pcf/pcfread.c (pcf_get_encodings): Store charmap geometry.
5897
58982018-09-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
5899
5900	Remove unused fields.
5901
5902	* src/pcf.h (PCF_FaceRec): Remove `charmap' and `charmap_handle'.
5903	* src/bdfdrvr.h (BDF_FaceRec): Ditto.
5904	* src/winfonts/winfnt.h (FNT_FaceRec): Ditto.
5905
59062018-09-17  Werner Lemberg  <wl@gnu.org>
5907
5908	[pshinter] Handle numeric overflow.
5909
5910	Reported as
5911
5912	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10396
5913
5914	* src/pshinter/pshglob.c: Include FT_INTERNAL_CALC_H.
5915	(psh_blues_snap_stem): Mask numeric overflow.
5916
59172018-09-13  Werner Lemberg  <wl@gnu.org>
5918
5919	[truetype] Some fixes for VF checks.
5920
5921	Reported as
5922
5923	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10317
5924
5925	* src/truetype/ttgxvar.c (ft_var_load_gvar): Properly exit memory
5926	frame if we have invalid glyph variation data offsets.
5927	(tt_face_vary_cvt): Protect against missing `tuplecoords' array.
5928	Fix typo.
5929
59302018-09-13  Werner Lemberg  <wl@gnu.org>
5931
5932	* src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Fix last commit.
5933
59342018-09-13  Werner Lemberg  <wl@gnu.org>
5935
5936	* src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Check `result'.
5937
5938	Reported as
5939
5940	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10316
5941
59422018-09-12  John Tytgat  <John.Tytgat@esko.com>
5943
5944	[sfnt] Better PS name handling (#54629).
5945
5946	* src/sfnt/sfdriver (IS_WIN, IS_APPLE): Omit language ID checks.
5947	(get_win_string, get_apple_string): Return NULL when the PostScript
5948	font name characters is not according to specification.
5949	(get_win_string): Make trace output work if the high byte if
5950	non-zero.
5951	(sfnt_get_var_ps_name, sfnt_get_ps_name): Previously we preferred
5952	Win PS name (when there is also an Apple PS name); change this into
5953	a fallback to Apple PS name in case the Win PS name is invalid.
5954
59552018-09-12  Werner Lemberg  <wl@gnu.org>
5956
5957	[truetype] Improve VF check.
5958
5959	Triggered by
5960
5961	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10255
5962
5963	* src/truetype/ttgxvar.c (ft_var_load_gvar): Use better limit check
5964	for `tupleCount'.
5965
59662018-09-12  Werner Lemberg  <wl@gnu.org>
5967
5968	* src/truetype/ttgxvar.c (ft_var_load_gvar): Check `glyphoffsets'.
5969
59702018-09-10  Armin Hasitzka  <prince.cherusker@gmail.com>
5971
5972	* src/pshinter/pshrec.c (t2_hints_stems): Mask numeric overflow.
5973
5974	Reported as
5975
5976	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10215
5977
59782018-09-09  Ben Wagner  <bungeman@google.com>
5979
5980	* builds/freetype.mk (refdoc-venv): Ensure python version (#54631).
5981
59822018-09-07  Werner Lemberg  <wl@gnu.org>
5983
5984	[truetype] Fix assertion failure.
5985
5986	Triggered by
5987
5988	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10212
5989
5990	* src/truetype/ttgload.c (load_truetype_glyph): Reintroduce
5991	`opened_frame' (removed in a change from 2018-08-26) to handle
5992	deallocation of the second frame.
5993
59942018-09-05  Werner Lemberg  <wl@gnu.org>
5995
5996	Synchronize `ftdebug.c' files.
5997
5998	* builds/amiga/src/base/ftdebug.c, builds/wince/ftdebug.c,
5999	builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c'.
6000
60012018-09-05  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
6002
6003	Add documentation guidelines file.
6004
6005	* docs/DOCGUIDE: New file.
6006
60072018-09-04  Werner Lemberg  <wl@gnu.org>
6008
6009	* devel/ftoption.h: Synchronize with master `ftoption.h'.
6010
60112018-09-03  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
6012
6013	[docwriter] Don't break code snippets accross lines.
6014
6015	Reported as
6016
6017	  https://lists.nongnu.org/archive/html/freetype-devel/2018-08/msg00124.html
6018
6019	* docs/reference/markdown/stylesheets/extra.css (.md-typeset code):
6020	Add rule `white-space'.
6021
60222018-09-03  Werner Lemberg  <wl@gnu.org>
6023
6024	*/*: s/PSNames/psnames/.
6025
6026	Only tracing messages are affected.
6027
60282018-09-03  Werner Lemberg  <wl@gnu.org>
6029
6030	[sfnt] Fix heap buffer overflow in CPAL handling.
6031
6032	* src/sfnt/ttcpal.c (tt_face_palette_set): Fix boundary test.
6033	(tt_face_load_cpal): Updated.
6034
60352018-09-01  Werner Lemberg  <wl@gnu.org>
6036
6037	Remove `FT_Outline_{New,Done}_Internal'.
6038
6039	These public API functions(!) were always undocumented and have
6040	escaped all clean-up efforts until now.
6041
6042	* include/freetype/ftoutln.h (FT_Outline_New_Internal,
6043	FT_Outline_Done_Internal): Removed.
6044
6045	* src/base/ftoutln.h (FT_Outline_New_Internal,
6046	FT_Outline_Done_Internal): Merge into...
6047	(FT_Outline_New, FT_Outline_Done): ... these functions.
6048
6049	* docs/README: Updated.
6050
60512018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
6052
6053	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Check glyph format.
6054
60552018-08-31  Armin Hasitzka  <prince.cherusker@gmail.com>
6056
6057	[errors] Refine the macro logic surrounding `FT_Error_String'.
6058
6059	* include/freetype/fterrors.h (FT_INCLUDE_ERR_PROTOS,
6060	FT_ERR_PROTOS_DEFINED): Undefine `FT_INCLUDE_ERR_PROTOS' after
6061	checking it and introduce a new macro that takes proper care of
6062	multiple-inclusion protection.
6063
60642018-08-31  Werner Lemberg  <wl@gnu.org>
6065
6066	* src/base/ftdebug.c (FT_Throw): Restore missing `FT_UNUSED' calls.
6067
60682018-08-31  Werner Lemberg  <wl@gnu.org>
6069
6070	* src/base/ftdebug.c (FT_Throw): Reduce chattiness.
6071
60722018-08-31  Werner Lemberg  <wl@gnu.org>
6073
6074	* src/autofit/afhints.c (af_glyph_hints_reload): Add initialization.
6075
60762018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
6077
6078	Consolidate bitmap presetting and size assessment.
6079
6080	* include/freetype/internal/ftobjs.h (ft_glyphslot_preset_bitmap):
6081	Change return type.
6082	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Return the bitmap
6083	size assessment.
6084
6085	* src/raster/ftrend1.c (ft_raster1_render): Use it to refuse the
6086	rendering of enourmous or far-fetched outlines.
6087	* src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
6088
60892018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
6090
6091	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Correct mono.
6092
60932018-08-30  Armin Hasitzka  <prince.cherusker@gmail.com>
6094
6095	[errors] Introduce a macro to control `FT_Error_String'.
6096
6097	* devel/ftoption.h (FT_CONFIG_OPTION_ERROR_STRINGS),
6098	include/freetype/config/ftoption.h (FT_CONFIG_OPTION_ERROR_STRINGS):
6099	New macro.
6100
61012018-08-30  Armin Hasitzka  <prince.cherusker@gmail.com>
6102
6103	[errors] Introduce `FT_Error_String'.
6104
6105	* include/freetype/fterrors.h (FT_Error_String),
6106	src/base/fterrors.c (FT_Error_String): Implement `FT_Error_String'.
6107
6108	* src/base/ftbase.c, src/base/Jamfile (_source),
6109	src/base/rules.mk (BASE_SRC): Add `fterrors.c' to the build logic.
6110
6111	* src/base/ftdebug.c (FT_Throw): Use `FT_Error_String'.
6112
61132018-08-30  Werner Lemberg  <wl@gnu.org>
6114
6115	[autofit] Trace `before' and `after' edges of strong points.
6116
6117	* src/autofit/afhints.h (AF_PointRec) [FT_DEBUG_AUTOFIT]: New arrays
6118	`before' and `after'.
6119
6120	* src/autofit/afhints.c (af_get_strong_edge_index): New auxiliary
6121	function.
6122	(af_glyph_hints_dump_points): Trace `before' and `after' edges.
6123	(af_glyph_hints_align_strong_points) [FT_DEBUG_AUTOFIT]: Set
6124	`before' and `after' information.
6125
61262018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
6127
6128	[base] Overflow-resistant bitmap presetting.
6129
6130	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Implement it.
6131
61322018-08-29  Armin Hasitzka  <prince.cherusker@gmail.com>
6133
6134	Fix numeric overflows.
6135
6136	* src/pshint/pshalgo.c (psh_hint_align, psh_hint_align_light,
6137	psh_hint_table_find_strong_points): Fix numeric overflows.
6138
6139	Reported as
6140
6141	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10083
6142
61432018-08-29  Werner Lemberg  <wl@gnu.org>
6144
6145	[cff] Fix handling of `roll' op in old engine.
6146
6147	Reported as
6148
6149	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10080
6150
6151	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_roll>
6152	[CFF_CONFIG_OPTION_OLD_ENGINE]: Use modulo for loop count, as
6153	documented in the specification.
6154
61552018-08-26  Werner Lemberg  <wl@gnu.org>
6156
6157	* src/truetype/ttobjs.c (tt_size_read_bytecode): Trace CVT values.
6158
61592018-08-26  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
6160
6161	* configure: Copy assets required by docwriter.
6162
6163	Copy directory `docs/reference/markdown' when FreeType is compiled in a
6164	different directory.
6165
6166	Fixes `make refdoc' if builddir != srcdir.
6167
6168	Reported as
6169
6170	  https://lists.nongnu.org/archive/html/freetype-devel/2018-08/msg00083.html
6171
61722018-08-26  Werner Lemberg  <wl@gnu.org>
6173
6174	* src/pshint/pshalgo.c (psh_hint_overlap): Fix numeric overflow.
6175
6176	Reported as
6177
6178	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10057
6179
61802018-08-26  Werner Lemberg  <wl@gnu.org>
6181
6182	Minor tracing adjustments.
6183
6184	* src/base/ftstream.c (FT_Stream_EnterFrame, FT_Stream_ExitFrame):
6185	Trace.
6186
6187	* src/truetype/ttgload.c (TT_Access_Glyph_Frame): Remove tracing.
6188
61892018-08-26  Werner Lemberg  <wl@gnu.org>
6190
6191	[truetype] Avoid nested frames.
6192
6193	Triggered by
6194
6195	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10054
6196
6197	* src/truetype/ttgload.c (load_truetype_glyph): Don't use variable
6198	`opened_frame' to trace whether a frame must be closed at the end of
6199	function: This fails because `TT_Vary_Apply_Glyph_Deltas' (which
6200	gets called for space glyphs) uses a frame by itself.  Instead,
6201	close the frame after loading the header, then use another frame for
6202	the remaining part of the glyph later on.
6203
6204	Also avoid calling `tt_get_metrics' twice under some circumstances.
6205
62062018-08-26  Werner Lemberg  <wl@gnu.org>
6207
6208	Various minor clean-ups.
6209
6210	* src/base/ftapi.c: Remove.  Unused.
6211	* src/base/Jamfile (_sources): Updated.
6212
6213	* src/base/ftstream.c (FT_Stream_ReleaseFrame): Remove redundant
6214	code.
6215
62162018-08-25  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
6217
6218	Convert documentation markup to Markdown.
6219
6220	It is the result of a GSoC 2018 project; this separate ChangeLog
6221	commit covers the last four commits
6222
6223	  ae5d1a4cec37557f31aec270332cfe886a62f9a0
6224	  53c69ce04faed3dcc68ca0f54cb8d703d8babf69
6225	  195728d5ba38f34fb2c2c20807c01656f2f59b66
6226	  c962db28ea59225f0105c03d907d4a9b71765687
6227
6228	* docs/reference/markdown/images/favico.ico,
6229	docs/reference/markdown/javascripts/extra.js,
6230	docs/reference/markdown/stylesheets/extra.css: New files.
6231
6232	* docs/reference/.gitignore, docs/reference/README: Updated.
6233
6234	* src/tools/docmaker/*: Removed.  It has been replaced with
6235	`docwriter', a python package available at
6236
6237	  https://pypi.org/project/docwriter/
6238
6239	* Jamfile: Updated.
6240	* builds/ansi/ansi-def.mk, builds/beos/beos-def.mk,
6241	builds/dos/dos-def.mk, builds/os2/os2-def.mk (BIN),
6242	builds/unix/unixddef.mk, builds/windows/win32-def.mk: New variable.
6243
6244	* builds/unix/configure.raw: Check for `python' and `pip'.
6245	If not present, warn that `make refdoc' will fail.
6246	* builds/unix/unix-def.in (PYTHON, PIP, BIN): New variables.
6247
6248	* builds/freetype.mk (PYTHON, PIP, VENV_NAME, VENV_DIR, ENV_PYTHON,
6249	ENV_PIP): New variables.
6250	(refdoc): Updated.
6251	(refdoc-venv): New target.
6252	(.PHONY): Updated.
6253
62542018-08-23  Werner Lemberg  <wl@gnu.org>
6255
6256	Add macros for handling over-/underflowing `FT_Int64' values.
6257
6258	* include/freetype/internal/ftcalc.h (ADD_INT64, SUB_INT64,
6259	MUL_INT64, DIV_INT64) [FT_LONG64]: New macros.
6260
6261	* src/base/ftcalc.c (ft_corner_orientation) [FT_LONG64]: Use
6262	`SUB_INT64' and `MUL_INT64'.
6263
6264	Reported as
6265
6266	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10028
6267
62682018-08-22  Werner Lemberg  <wl@gnu.org>
6269
6270	[truetype] Improve legibility of `glyf' parsing.
6271
6272	* src/truetype/ttgload.c (ON_CURVE_POINT, X_SHORT_VECTOR,
6273	Y_SHORT_VECTOR, REPEAT_FLAG, X_POSITIVE, SAME_X, Y_POSITIVE, SAME_Y,
6274	OVERLAP_SIMPLE): New macros.
6275	(TT_Load_Simple_Glyph): Use new macros to make code more readable.
6276	Remove useless adjustment of `outline->tags' elements.
6277
62782018-08-21  Werner Lemberg  <wl@gnu.org>
6279
6280	* src/sfnt/ttcpal.c (tt_face_load_cpal): Add missing safety check.
6281
6282	Reported as
6283
6284	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9981
6285
62862018-08-18  Werner Lemberg  <wl@gnu.org>
6287
6288	[psaux] Avoid slow PS font parsing in case of error.
6289
6290	Reported as
6291
6292	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9955
6293
6294	* src/psaux/psobjs.c (ps_parser_to_bytes): Set `parser->cursor' even
6295	in case of error to avoid potential re-scanning.
6296
62972018-08-18  Werner Lemberg  <wl@gnu.org>
6298
6299	[cff] Fix heap buffer overflow in old engine.
6300
6301	Reported as
6302
6303	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9967
6304
6305	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
6306	<cff_op_blend> [CFF_CONFIG_OPTION_OLD_ENGINE]: `num_designs' must be
6307	non-zero.
6308
63092018-08-16  Young Xiao  <yangx92@hotmail.com>
6310
6311	* builds/mac/ftmac.c (parse_fond): Fix buffer overrun.
6312
6313	Reported as bug #54515, duplicate of #43540.
6314
63152018-08-16  Werner Lemberg  <wl@gnu.org>
6316
6317	* builds/*/ftsystem.c (FT_COMPONENT): Updated also.
6318
63192018-08-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
6320
6321	[bdf] Don't track duplicate encodings.
6322
6323	There is no harm except some umbiguity in broken fonts with duplicate
6324	encodings.
6325
6326	* src/bdf/bdflib.c (_bdf_parse_glyphs): Remove duplicate tracking.
6327	(_bdf_parse_t): Remove large `have' bitfield.
6328
63292018-08-15  Werner Lemberg  <wl@gnu.org>
6330
6331	Don't use `trace_' prefix for FT_COMPONENT arguments.
6332
6333	* include/freetype/internal/ftdebug.h (FT_TRACE_COMP,
6334	FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix.
6335	(FT_TRACE): Use `FT_TRACE_COMP'.
6336
6337	*/* (FT_COMPONENT): Updated.
6338
63392018-08-14  Werner Lemberg  <wl@gnu.org>
6340
6341	Use formatting string in FT_TRACEX calls for non-simple arguments.
6342
6343	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
6344	<cff_op_hstem, cff_op_hintmask, cff_op_hlineto, cff_op_vhcurveto>:
6345	Do it.
6346
6347	* src/psaux/pshints.c (cf2_hintmap_build): Ditto.
6348
6349	* src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
6350	cf2_cmdVSTEM, cf2_cmdHLINETO, cf2_cmdRRCURVETO, cf2_cmdCALLSUBR,
6351	cf2_escHSTEM3, cf2_cmdHINTMASK, cf2_cmdHVCURVETO>: Ditto.
6352
6353	* src/truetype/ttinterp.c (TT_RunIns): Ditto.
6354
63552018-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
6356
6357	[bdf] Remove unused fields.
6358
6359	* src/bdf/bdf.h (bdf_font_t): Remove `nmod', `umod', and `modified',
6360	which were set but never used.
6361	* src/bdf/bdflib.c (_bdf_parse_{glyphs,properties}, bdf_load_font):
6362	Updated accordingly.
6363
63642018-08-14  Werner Lemberg  <wl@gnu.org>
6365
6366	[cff] Fix another segv in old engine.
6367
6368	Reported as
6369
6370	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9872
6371
6372	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
6373	[CFF_CONFIG_OPTION_OLD_ENGINE]: Disallow invalid T1 opcodes in
6374	dictionaries.
6375
63762018-08-14  Werner Lemberg  <wl@gnu.org>
6377
6378	[cff] Fix missing error handling.
6379
6380	Reported as
6381
6382	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9865
6383
6384	* src/psaux/cffparse.c (cff_parser_run)
6385	[CFF_CONFIG_OPTION_OLD_ENGINE]: Don't ignore return value of
6386	`parse_charstrings_old'.
6387
63882018-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>
6389
6390	[bdf] Remove unused overflow storage.
6391
6392	* src/bdf/bdf.h (bdf_glyphlist_t): Remove this type.
6393	(bdf_font_t): Remove `overflow' field.
6394	* src/bdf/bdflib.c (bdf_free_font): Remove `overflow' freeing.
6395
63962018-08-14  Werner Lemberg  <wl@gnu.org>
6397
6398	[cff] Fix segv in old engine.
6399
6400	Reported as
6401
6402	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9864
6403
6404	* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
6405	<cff_op_random> [CFF_CONFIG_OPTION_OLD_ENGINE]: Use top dict's
6406	`random' field directly if parsing dictionaries.
6407
64082018-08-13  Alexei Podtelezhnikov  <apodtele@gmail.com>
6409
6410	[bdf] Use unsigned types.
6411
6412	* src/bdf/bdf.h (bdf_glyph_t): Unsign `encoding'.
6413	(bdf_font_t): Unsign `default_char'.
6414	* src/bdf/bdfdrivr.h (BDF_encoding_el): Unsign `enc'.
6415
6416	* src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_glyphs,
6417	_bdf_parse_start): Updated accordingly.
6418	* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Ditto.
6419
64202018-08-13  Werner Lemberg  <wl@gnu.org>
6421
6422	* src/type42/t42parse.c (t42_parse_sfnts): One more format check.
6423
6424	Reported as
6425
6426	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9832
6427
64282018-08-11  Werner Lemberg  <wl@gnu.org>
6429
6430	* src/base/ftcalc.c (FT_Matrix_Check): Fix integer overflow.
6431
6432	Reported as
6433
6434	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9811
6435
64362018-08-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
6437
6438	* src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Follow specs.
6439
64402018-08-10  Ben Wagner  <bungeman@google.com>
6441
6442	* src/sfnt/sfobjs.c (sfnt_done_face): Fix memory leak (#54435).
6443
64442018-08-10  Werner Lemberg  <wl@gnu.org>
6445
6446	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Improve tracing.
6447
64482018-08-10  Werner Lemberg  <wl@gnu.org>
6449
6450	Fix clang warnings.
6451
6452	* src/base/ftdebug.c (ft_trace_level_enabled,
6453	ft_trace_level_disabled): Add `static' keyword.
6454
64552018-08-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
6456
6457	[raster, smooth] Reinstate bitmap size limits.
6458
6459	This again moves outline and bitmap size checks one level up.
6460
6461	* src/base/ftoutln.c (FT_Outline_Render): Explicitly reject enormous
6462	outlines.
6463	* src/raster/ftrend1.c (ft_raster1_render): Reject enormous bitmaps
6464	and, therefore, outlines that require them.
6465	* src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
6466
6467	* src/raster/ftraster.c (ft_black_render): Remove outline size checks.
6468	* src/smooth/ftgrays.c (gray_raster_render): Ditto.
6469	[STANDALONE]: Remove `FT_Outline_Get_CBox' copy.
6470
64712018-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
6472
6473	[pcf] Revert massive unsigning.
6474
64752018-08-08  Werner Lemberg  <wl@gnu.org>
6476
6477	[smooth] Improve tracing.
6478
6479	* src/smooth/ftgrays.c (gray_convert_glyph_inner): Only use tracing
6480	if called the first time.
6481	(gray_convert_glyph): Updated.
6482
64832018-08-08  Werner Lemberg  <wl@gnu.org>
6484
6485	Add internal functions `FT_Trace_Disable' and `FT_Trace_Enable'.
6486
6487	It sometimes makes sense to suppress tracing informations, for
6488	example, if it outputs identical messages again and again.
6489
6490	* include/freetype/internal/ftdebug.h: Make `ft_trace_levels' a
6491	pointer.
6492	(FT_Trace_Disable, FT_Trace_Enable): New declarations.
6493
6494	* src/base/ftdebug.c (ft_trace_levels): Rename to...
6495	(ft_trace_levels_enabled): ... this.
6496	(ft_trace_levels_disabled): New array.
6497	(ft_trace_levels): New pointer.
6498	(FT_Trace_Disable, FT_Trace_Enable): Implement.
6499	(ft_debug_init): Updated.
6500
65012018-08-08  Werner Lemberg  <wl@gnu.org>
6502
6503	Debugging improvements.
6504
6505	* src/base/ftobjs.c (pixel_modes): Move this array to top level
6506	from ...
6507	(FT_Load_Glyph): ... here.
6508	(FT_Render_Glyph_Internal): Use `width' x `height' in trace message.
6509	Use `pixel_modes'.
6510
65112018-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
6512
6513	[pcf] Massive unsigning (part 2).
6514
6515	Treat all size related properties as unsigned values.
6516
6517	* src/pcf/pcf.h (PCF_ParsePropertyRec): Use unsigned `name' and
6518	`value'.
6519	* src/pcf/pcfread.c (pcf_get_properties, pcf_load_font): Updated
6520	parsing code and handling of AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE,
6521	RESOLUTION_X and RESOLUTION_Y.
6522
65232018-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
6524
6525	[pcf] Massive unsigning (part 1).
6526
6527	Unofficial specifications hesitate to use unsigned 32-bit integers.
6528	Negative values caused a lot of trouble in the past and it is safer
6529	and easier to treat some properties as unsigned.
6530
6531	* src/pcf/pcf.h (PCF_AccelRec): Use unsigned values for `fontAscent',
6532	`fontDescent', and `maxOverlap'.
6533	* src/pcf/pcfread.c (pcf_load_font, pcf_get_accel): Updated.
6534	* src/pcf/pcfdrivr.c (PCF_Glyph_Load, PCF_Size_Select,
6535	PCF_Size_Request): Updated.
6536
65372018-08-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
6538
6539	* src/pcf/pcfread.c (pcf_get_bitmaps): Unsign `offsets' and
6540	`bitmapSizes'.
6541
65422018-08-06  Werner Lemberg  <wl@gnu.org>
6543
6544	* devel/ftoption.h: Synchronize with main `ftoption.h'.
6545
65462018-08-06  Alexei Podtelezhnikov  <apodtele@gmail.com>
6547
6548	[pcf] Use unsigned types.
6549
6550	* src/pcf/pcf.h (PCF_Encoding): Use unsigned `enc'.
6551	* src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Ditto.
6552	* src/pcf/pcfread.c (pcf_get_encodings): Use unsigned types.
6553
65542018-08-05  Werner Lemberg  <wl@gnu.org>
6555
6556	* src/truetype/ttgload.c (compute_glyph_metrics): Fix overflow.
6557
6558	Reported as
6559
6560	  https://bugs.chromium.org/p/chromium/issues/detail?id=777151
6561
65622018-08-04  Werner Lemberg  <wl@gnu.org>
6563
6564	* src/truetype/ttinterp.c (opcode_name): Fix typos.
6565
65662018-08-04  Werner Lemberg  <wl@gnu.org>
6567
6568	Fix clang warnings.
6569
6570	* src/base/ftoutln.c (FT_Outline_EmboldenXY): Fix type of
6571	`orientation'.
6572
6573	* src/gxvalid/gxvcommn.c (gx_lookup_value_read): Fix signature.
6574
6575	* src/pcf/pcfread.c (pcf_get_encodings): Fix type of some variables.
6576	Add cast.
6577
6578	* src/type1/t1load.c (parse_weight_vector): Fix cast.
6579
65802018-07-31  Werner Lemberg  <wl@gnu.org>
6581
6582	* src/cid/cidtoken.h: Handle `XUID' keyword.
6583
65842018-07-31  Werner Lemberg  <wl@gnu.org>
6585
6586	[cid] Trace PostScript dictionaries.
6587
6588	* src/cid/cidload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
6589	(cid_load_keyword, cid_parse_font_matrix, parse_fd_array,
6590	parse_expansion_factor, cid_parse_dict): Add tracing calls.
6591	(parse_font_name): New function to trace `/FontName' keywords in
6592	/FDArray dict.
6593	(cid_field_records): Register `parse_font_name'.
6594
65952018-07-30  Werner Lemberg  <wl@gnu.org>
6596
6597	[cff] Fix typo.
6598
6599	Reported as
6600
6601	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9409
6602
6603	* src/cff/cffdrivr.c (cff_get_cid_from_glyph_index): Fix boundary
6604	check.
6605
66062018-07-29  Werner Lemberg  <wl@gnu.org>
6607
6608	* src/pcf/pcfread.c (pcf_get_encodings): Another thinko.
6609
6610	Reported as
6611
6612	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9608
6613
66142018-07-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
6615
6616	[smooth] Fix Harmony memory management.
6617
6618	Reported as
6619
6620	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9501
6621
6622	* src/smooth/ftgrays.c (ft_smooth_render_generic): Restore buffer
6623	after each rendering in case of failure.
6624
66252018-07-28  Werner Lemberg  <wl@gnu.org>
6626
6627	[type1] Avoid segfaults with `FT_Get_PS_Font_Value'.
6628
6629	Reported as
6630
6631	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9610
6632
6633	* src/type1/t1driver.c (t1_ps_get_font_value): Protect against NULL.
6634
66352018-07-27  Werner Lemberg  <wl@gnu.org>
6636
6637	[truetype] Make `TT_Set_MM_Blend' idempotent (#54388).
6638
6639	* src/truetype/ttgxvar.c (tt_set_mm_blend): Correctly set
6640	`face->doblend' if the current call to the function yields the same
6641	blend coordinates as the previous call.
6642
66432018-07-27  Werner Lemberg  <wl@gnu.org>
6644
6645	[psaux, type1]: More tracing improvements.
6646
6647	* src/psaux/psintrp.c (cf2_interpT2CharString): Trace skipped
6648	outline commands.
6649
6650	* src/psaux/t1decode.c (t1_decoder_parse_charstring): Fix
6651	missing case.
6652	(t1_decoder_parse_metrics): Make tracing output more compact.
6653
6654	* src/type1/t1gload.c (T1_Compute_Max_Advance): Be less verbose.
6655	(T1_Get_Advances): Add tracing.
6656
66572018-07-25  Werner Lemberg  <wl@gnu.org>
6658
6659	[psaux, type1] Trace PostScript dictionaries and other things.
6660
6661	The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary
6662	right now.
6663
6664	* src/psaux/psobjs.c (ps_parser_load_field,
6665	ps_parser_load_field_table): Add tracing calls.
6666
6667	* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing
6668	output more compact.
6669
6670	* src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add
6671	tracing messages.
6672
6673	* src/type1/t1load.c (parse_blend_axis_types,
6674	parse_blend_design_positions, parse_blend_design_map,
6675	parse_weight_vector, t1_load_keyword, t1_parse_font_matrix,
6676	parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add
6677	tracing calls.
6678
6679	* src/type1/t1objs.c (T1_Face_Init): Add tracing call.
6680
6681	* src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more
6682	verbose.
6683
66842018-07-25  Werner Lemberg  <wl@gnu.org>
6685
6686	Fix minor ASAN run-time warnings.
6687
6688	* src/base/ftutil.c (ft_mem_alloc, ft_mem_realloc): Only call
6689	`FT_MEM_ZERO' if we actually have a buffer.
6690	(ft_mem_dup): Only call `ft_memcpy' if we actually have a buffer.
6691
66922018-07-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
6693
6694	[build] Fortify dllexport/dllimport attributes (#53969,#54330).
6695
6696	We no longer use predefined _DLL, which can be defined for static
6697	builds too with /MD. We use DLL_EXPORT and DLL_IMPORT instead,
6698	following libtool convention.
6699
6700	* CMakeLists.txt [WIN32], builds/windows/vc2010/freetype.vcxproj:
6701	Define DLL_EXPORT manually.
6702
6703	* include/freetype/config/ftconfig.h, builds/unix/ftconfig.in,
6704	builds/vms/ftconfig.h, builds/windows/vc2010/index.html,
6705	src/base/ftver.rc: /_DLL/d, s/FT2_DLLIMPORT/DLL_IMPORT/.
6706
67072018-07-24  Werner Lemberg  <wl@gnu.org>
6708
6709	[type1] Check relationship between number of axes and designs.
6710
6711	For Multiple Masters fonts we don't support intermediate designs;
6712	this implies that
6713
6714	  number_of_designs == 2 ^^ number_of_axes
6715
6716	Reported as
6717
6718	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9557
6719
6720	* src/type1/t1load.c (T1_Open_Face): Ensure above constraint.
6721	(T1_Get_MM_Var): Remove now redundant test.
6722
67232018-07-24  Hin-Tak Leung  <htl10@users.sourceforge.net>
6724
6725	[truetype] Match ttdebug's naming of instruction mnemonics.
6726
6727	* src/truetype/ttinterp.c: The form used in ttdebug,
6728	"MDRP[G,B,W,?]", etc., is slightly more readable than
6729	"MDRP[00,01,02,03]".
6730
67312018-07-24  Werner Lemberg  <wl@gnu.org>
6732
6733	* src/pcf/pcfread.c (pcf_get_encodings): Thinko.
6734
6735	Reported as
6736
6737	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9561
6738
67392018-07-22  Werner Lemberg  <wl@gnu.org>
6740
6741	* src/pcf/pcfread.c (pcf_get_encodings): Check index of defaultChar.
6742
6743	Reported as
6744
6745	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9527
6746
67472018-07-22  Werner Lemberg  <wl@gnu.org>
6748
6749	* src/pcf/pcfread.c (pcf_load_font): Fix number of glyphs.
6750
6751	This is an oversight of the module change 2018-07-21.
6752
6753	Reported as
6754
6755	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9524
6756
67572018-07-22  Werner Lemberg  <wl@gnu.org>
6758
6759	[cid] Sanitize `BlueShift' and `BlueFuzz'.
6760
6761	This code is taken from the type1 module.
6762
6763	Reported as
6764
6765	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9510
6766
6767	* src/cid/cidload.c (parse_fd_array): Set some private dict default
6768	values.
6769	(cid_face_open): Do the sanitizing.
6770	Fix some tracing messages.
6771
67722018-07-21  Werner Lemberg  <wl@gnu.org>
6773
6774	[pcf] Fix handling of the undefined glyph.
6775
6776	This change makes the driver use the `defaultChar' property of PCF
6777	files.
6778
6779	* src/pcf/pcf.h (PCF_FaceRec): Change type of `defaultChar' to
6780	unsigned.
6781
6782	* src/pcf/pcfread.c (pcf_get_encodings): Read `defaultChar' as
6783	unsigned.
6784	Validate `defaultChar'.
6785	If `defaultChar' doesn't point to glyph index zero, swap glyphs with
6786	index zero and index `defaultChar' and adjust the encodings
6787	accordingly.
6788
6789	* src/pcf/pcfdrivr.c (pcf_cmap_char_index, pcf_cmap_char_next,
6790	PCF_Glyph_Load): Undo change from 2002-06-16 which always enforced
6791	the first character in the font to be the default character.
6792
67932018-07-20  Armin Hasitzka  <prince.cherusker@gmail.com>
6794
6795	Move the legacy fuzz target to the `freetype-testing' repository.
6796
6797	It can now be found at
6798
6799	  https://github.com/freetype/freetype2-testing/tree/master/fuzzing/src/legacy
6800
6801	* src/tools/ftfuzzer: Remove this folder and its contents from the
6802	repository.
6803
68042018-07-20  Werner Lemberg  <wl@gnu.org>
6805
6806	[cff] Avoid left-shift of negative numbers (#54322).
6807
6808	* src/cff/cffgload.c (cff_slot_load): Use multiplication.
6809
68102018-07-17  Werner Lemberg  <wl@gnu.org>
6811
6812	Allow FT_ENCODING_NONE for `FT_Select_Charmap'.
6813
6814	This is a valid encoding tag for BDF, PCF, and Windows FNT, and
6815	there is no reason to disallow it for these formats.
6816
6817	* src/base/ftobjs.c (FT_Select_Charmap): Implement it.
6818
68192018-07-17  Werner Lemberg  <wl@gnu.org>
6820
6821	* src/pcf/pcfread.c (pcf_get_encodings): Trace `defaultChar'.
6822
68232018-07-16  Armin Hasitzka  <prince.cherusker@gmail.com>
6824
6825	* include/freetype/internal/ftcalc.h: Add macros for handling
6826	harmless over-/underflowing `FT_Int' values.
6827
6828	* src/sfnt/sfdriver.c (fixed2float): Fix negation of
6829	`(int)(-2147483648)'.
6830
6831	Reported as
6832
6833	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9423
6834
68352018-07-16  Werner Lemberg  <wl@gnu.org>
6836
6837	* src/truetype/ttgxvar.c (tt_set_mm_blend): Fix off-by-one error.
6838
6839	Reported as
6840
6841	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9412
6842
68432018-07-12  Werner Lemberg  <wl@gnu.org>
6844
6845	* src/base/ftoutln.c (FT_Outline_Get_Orientation): Init `cbox'.
6846
6847	Taken from patch #9667, written by Steve Langasek
6848	<vorlon@debian.org>.
6849
6850	This fixes a build failure (most probably a bug in gcc) on ppc64el
6851	when building with -O3.
6852
68532018-07-05  Werner Lemberg  <wl@gnu.org>
6854
6855	Fix typo (#54238).
6856
6857	* src/base/ftcolor.c (FT_Palette_Set_Foreground_Color)
6858	[!TT_CONFIG_OPTION_COLOR_LAYERS]: Add return value.
6859
68602018-07-05  Werner Lemberg  <wl@gnu.org>
6861
6862	Adjust table size comparisons (#54242).
6863
6864	* src/sfnt/ttcpal.c (tt_face_load_cpal): Implement it.
6865
68662018-07-05  Werner Lemberg  <wl@gnu.org>
6867
6868	Fix more 32bit issues (#54208).
6869
6870	* src/cff/cffload.c (cff_blend_build_vector): Convert assertion into
6871	run-time error.
6872
6873	* src/truetype/ttgxvar.c (ft_var_to_normalized): Protect against
6874	numeric overflow.
6875
68762018-07-04  Werner Lemberg  <wl@gnu.org>
6877
6878	Fix 32bit build warnings (#54239).
6879
6880	* src/base/ftbitmap.c (FT_Bitmap_Blend): Add casts to avoid signed
6881	vs. unsigned comparisons.
6882
6883	* srb/sfnt/ttcolr.c (tt_face_get_colr_layer): Ditto.
6884
68852018-07-02  Jeff Carey  <Jeff.Carey@monotype.com>
6886
6887	* src/psnames/psmodule.c (ps_unicodes_init): Fix alloc debugging.
6888
68892018-07-02  Werner Lemberg  <wl@gnu.org>
6890
6891	s/palette_types/palette_flags/.
6892
6893	Suggested by Behdad.
6894
68952018-07-02  Werner Lemberg  <wl@gnu.org>
6896
6897	Make `FT_Get_Color_Glyph_Layer' return FT_Bool.
6898
6899	* include/freetype/freetype.h, src/base/ftobjs.c
6900	(FT_Get_Color_Glyph_Layer, FT_Render_Glyph_Internal): Updated.
6901
6902	* include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func),
6903	src/sfnt/ttcolr.h, src/sfnt/ttcolr.c (tt_face_get_colr_layer):
6904	Updated.
6905
69062018-07-01  Werner Lemberg  <wl@gnu.org>
6907
6908	* src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Guard SFNT function.
6909
6910	Reported by Behdad.
6911
69122018-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
6913
6914	* src/base/fttrigon.c (FT_Tan): Improve accuracy.
6915	(FT_Vector_Rotate): Simplify.
6916
69172018-06-28  Alexei Podtelezhnikov  <apodtele@gmail.com>
6918
6919	* src/base/ftobjs.c (FT_Set_Charmap): Robustify.
6920
69212018-06-25  Werner Lemberg  <wl@gnu.org>
6922
6923	[truetype] Fix memory leak.
6924
6925	* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Add initializers.
6926	Fix typo in `goto' destination.
6927
6928	Reported as
6929
6930	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9071
6931
69322018-06-25  Werner Lemberg  <wl@gnu.org>
6933
6934	* src/truetype/ttgxvar.c (tt_face_vary_cvt): Add initializers.
6935
6936	Reported as
6937
6938	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9070
6939
69402018-06-24  Werner Lemberg  <wl@gnu.org>
6941
6942	[truetype] Increase precision while applying VF deltas.
6943
6944	It turned out that we incorrectly round CVT and glyph point deltas
6945	before accumulation, leading to severe positioning errors if there
6946	are many delta values to sum up.
6947
6948	Problem reported by Akiem Helmling <akiem@underware.nl> and analyzed
6949	by Behdad.
6950
6951	* src/truetype/ttgxvar.c (ft_var_readpackeddelta): Return deltas in
6952	16.16 format.
6953	(tt_face_var_cvt): Collect deltas in `cvt_deltas', which is a 16.16
6954	format array, and add the accumulated values to the CVT at the end
6955	of the function.
6956	(TT_Vary_Apply_Glyph_Deltas): Store data in `points_org' and
6957	`points_out' in 16.16 format.
6958	Collect deltas in `point_deltas_x' and `point_deltas_y', which are
6959	16.16 format arrays, and add the accumulated values to the glyph
6960	coordinates at the end of the function.
6961
69622018-06-24  Werner Lemberg  <wl@gnu.org>
6963
6964	New base function `FT_Matrix_Check' (#54019).
6965
6966	* src/base/ftcalc.c (FT_Matrix_Check): New base function to properly
6967	reject degenerate font matrices.
6968
6969	* include/freetype/internal/ftcalc.h: Updated.
6970
6971	* src/cff/cffparse.c (cff_parse_font_matrix), src/cid/cidload.c
6972	(cid_parse_font_matrix), src/type1/t1load.c (t1_parse_font_matrix),
6973	src/type42/t42parse.c (t42_parse_font_matrix): Use
6974	`FT_Matrix_Check'.
6975
69762018-06-23  Werner Lemberg  <wl@gnu.org>
6977
6978	Fix typo.
6979
6980	Reported by Behdad.
6981
6982	* src/base/ftcolor.c (FT_Palette_Data_Get)
6983	[!TT_CONFIG_OPTION_COLOR_LAYERS]: s/apalette/apalette_data/.
6984
69852018-06-21  Werner Lemberg  <wl@gnu.org>
6986
6987	s/FT_PALETTE_USABLE_WITH_/FT_PALETTE_FOR_/.
6988
6989	* include/freetype/ftcolor.h, include/freetype/internal/sfnt.h,
6990	src/sfnt/ttcolr.c: Do it.
6991
69922018-06-19  Werner Lemberg  <wl@gnu.org>
6993
6994	[sfnt] Fix CPAL heap buffer overflow.
6995
6996	Reported as
6997
6998	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8968
6999
7000	* src/sfnt/ttcpal.c (tt_face_load_cpal): Guard CPAL version 1
7001	offsets.
7002
70032018-06-19  Werner Lemberg  <wl@gnu.org>
7004
7005	Doh.  Don't use CPAL or COLR data if tables are missing.
7006
7007	Reported by Alexei.
7008
7009	* src/sfnt/ttcolr.c (tt_face_get_colr_layer): Return immediately if
7010	`colr' is NULL.
7011
7012	* src/sfnt/ttcpal.c (tt_face_palette_set): Return immediately, if
7013	`cpal' is NULL.
7014
70152018-06-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
7016
7017	[base] Introduce `FT_New_Glyph'.
7018
7019	This function facilitates access to full capabilities of FreeType
7020	rendering engine for custom glyphs. This can be quite useful for
7021	consistent rendering of mathematical and chemical formulas, e.g.
7022
7023	  https://bugs.chromium.org/p/chromium/issues/detail?id=757078
7024
7025	* include/freetype/ftglyph.h, src/base/ftglyph.c (FT_New_Glyph): New
7026	function.
7027
70282018-06-17  Armin Hasitzka  <prince.cherusker@gmail.com>
7029
7030	[bdf] Fix underflow of an unsigned value.
7031
7032	bdflib.c:1562 could be reached with `font->glyphs_used == 0'.  That
7033	caused an underflow of the unsigned value which results in undefined
7034	behaviour.
7035
7036	* src/bdf/bdflib.c (_bdf_parse_glyphs): Bail out earlier than before
7037	if the `ENCODING' keyword cannot be found.
7038
70392018-06-17  Werner Lemberg  <wl@gnu.org>
7040
7041	[base] Add tracing for `FT_Bitmap_Blend'.
7042
7043	* include/freetype/internal/fttrace.h (trace_bitmap): New
7044	enumeration.
7045
7046	* src/base/ftbitmap.c (FT_COMPONENT): Define.
7047	(FT_Bitmap_Blend): Add `FT_TRACE5' calls.
7048
70492018-06-17  Werner Lemberg  <wl@gnu.org>
7050
7051	s/trace_bitmap/trace_checksum/.
7052
7053	* include/freetype/internal/fttrace.h: s/bitmap/checksum/.
7054
7055	* src/base/ftobjs.c (FT_COMPONENT): s/trace_bitmap/trace_checksum/.
7056	Adjust code.
7057
70582018-06-16  Werner Lemberg  <wl@gnu.org>
7059
7060	[sfnt] Fix color glyph layer loading.
7061
7062	* src/sfnt/ttcolr.c (Colr): Add `table_size' field.
7063	(tt_face_load_colr): Set it.
7064	(tt_face_get_colr_layer): Check pointer limit for layer entries.
7065
70662018-06-16  Werner Lemberg  <wl@gnu.org>
7067
7068	[sfnt] Fix color palette loading.
7069
7070	Reported as
7071
7072	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8933
7073
7074	* src/sfnt/ttcpal.c (Cpal): Add `table_size' field.
7075	(tt_face_load_cpal): Set it.
7076	(tt_face_palette_set): Check pointer limit for color entries.
7077
70782018-06-16  Werner Lemberg  <wl@gnu.org>
7079
7080	* src/base/ftbitmap.c (FT_Bitmap_Blend): Avoid integer overflow.
7081
70822018-06-16  Werner Lemberg  <wl@gnu.org>
7083
7084	Add `FT_Bitmap_Blend' API.
7085
7086	Still missing: Support for negative bitmap pitch and subpixel offset
7087	of source bitmap.
7088
7089	* include/freetype/ftbitmap.h, src/base/ftbitmap.c
7090	(FT_Bitmap_Blend): New function.
7091
70922018-06-14  Werner Lemberg  <wl@gnu.org>
7093
7094	Replace `FT_Get_GlyphLayers' with `FT_Get_Color_Glyph_Layer'.
7095
7096	This avoids any additional allocation of COLR related structures in
7097	a glyph slot.
7098
7099	* include/freetype/freetype.h (FT_Glyph_Layer, FT_Glyph_LayerRec,
7100	FT_Get_GlyphLayers): Removed.
7101
7102	* include/freetype/internal/ftobjs.h (FT_Colr_InternalRec): Removed.
7103	(FT_Slot_InternalRec): Remove `color_layers'.
7104
7105	* include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func):
7106	Removed.
7107	(SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Remove
7108	`load_colr_layer'.
7109
7110	* src/base/ftobjs.c (ft_glyph_slot_done): Updated.
7111	(FT_Render_Glyph_Internal): Use `FT_Get_Color_Glyph_Layer'.
7112	(FT_Get_GlyphLayers): Removed.
7113
7114	* src/sfnt/sfdriver.c (sfnt_interface): Updated.
7115
7116	* src/sfnt/ttcolr.c (tt_face_load_colr_layers): Removed.
7117	* src/sfnt/ttcolr.h: Updated.
7118
7119	* src/truetype/ttgload.c (TT_Load_Glyph): Updated.
7120
71212018-06-14  Werner Lemberg  <wl@gnu.org>
7122
7123	Provide iterative API to access `COLR' data.
7124
7125	This solution doesn't store any data in an `FT_GlyphSlot' object.
7126
7127	* include/freetype/freetype.h (FT_LayerIterator): New structure.
7128	(FT_Get_Color_Glyph_Layer): New function.
7129
7130	* include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func): New
7131	function type.
7132	(SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it.
7133
7134	* src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Implement it.
7135
7136	* src/sfnt/ttcolr.c (tt_face_get_colr_layer): New function.
7137	* src/sfnt/ttcolr.h: Updated.
7138
7139	* src/sfnt/sfdriver.c (sfnt_interface): Updated.
7140
71412018-06-14  Werner Lemberg  <wl@gnu.org>
7142
7143	Add glyph index and glyph load flags to glyph slot.
7144
7145	* include/freetype/freetype.h (FT_GlyphSlotRec): Rename unused
7146	`reserved' field to `glyph_index'.
7147
7148	* include/freetype/internal/ftobjs.h (FT_Slot_InternalRec): Add
7149	`load_flags' field.
7150
7151	* src/base/ftobjs.c (FT_Load_Glyph): Set new fields.
7152
71532018-06-14  Werner Lemberg  <wl@gnu.org>
7154
7155	[sfnt] Move `CPAL' stuff into separate files.
7156
7157	* src/sfnt/sfdriver.c: Include `ttcpal.h'.
7158	* src/sfnt/sfnt.c: Include `ttcpal.c'.
7159
7160	* src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: Move CPAL stuff to ...
7161	* src/sfnt/ttcpal.c, src/sfnt/ttcpal.c: ... these new files.
7162
7163	* src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC):
7164	Updated.
7165
7166	* include/freetype/internal/fttrace.h: Add support for `colr' and
7167	`cpal'.
7168	Sort entries.
7169
71702018-06-13  Werner Lemberg  <wl@gnu.org>
7171
7172	[sfnt] Separate `CPAL' and `COLR' table handling.
7173
7174	Later on we want to support the `SVG' table also, which needs `CPAL'
7175	(but not `COLR').
7176
7177	* include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_cpal'
7178	and `free_cpal' fields.
7179	(FT_DEFINE_SFNT_INTERFACE): Updated.
7180
7181	* include/freetype/internal/tttypes.h (TT_FaceRec): Replace
7182	`colr_and_cpal' fields with `cpal' and `colr'.
7183
7184	* src/sfnt/sfdriver.c (sfnt_interface): Updated.
7185
7186	* src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Updated.
7187
7188	* src/sfnt/ttcolr.c (Colr, Cpal): Add `table' field.
7189	(ColrCpal): Removed.
7190	(tt_face_load_colr): Split off CPAL handling into...
7191	(tt_face_load_cpal): ... this new function.
7192	(tt_face_free_colr): Split off CPAL handling into...
7193	(tt_face_free_cpal): ... this new function.
7194	(tt_face_load_colr_layers, tt_face_palette_set): Updated.
7195
7196	* src/sfnt/ttcolr.h: Updated.
7197
7198	* src/truetype/ttgload.c (TT_Load_Glyph): Updated.
7199
72002018-06-12  Werner Lemberg  <wl@gnu.org>
7201
7202	[sfnt] Fix `sizeof' thinko.
7203
7204	* src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_palette_set): Don't
7205	use `sizeof' for computing array limit.
7206
72072018-06-12  Werner Lemberg  <wl@gnu.org>
7208
7209	Finish CPAL/COLR support (4/4).
7210
7211	* src/sfnt/ttcolr.c (tt_face_find_color): Removed.
7212	(tt_face_colr_blend_layer): Use `face->palette' instead of calling
7213	`tt_face_find_color'.
7214	Use and set text foreground color.
7215
72162018-06-12  Werner Lemberg  <wl@gnu.org>
7217
7218	Finish CPAL/COLR support (3/4).
7219
7220	* src/base/ftcolor.c: Include FT_INTERNAL_SFNT_H.
7221	(FT_Palette_Select, FT_Palette_Set_Foreground_Color): Implement
7222	functions.
7223
72242018-06-12  Werner Lemberg  <wl@gnu.org>
7225
7226	Finish CPAL/COLR support (2/4).
7227
7228	* src/sfnt/ttcolr.c (tt_face_palette_set): New function.
7229	(tt_face_load_colr): Allocate `face->palette' and call
7230	`tt_face_palette_set'.
7231	Adjust return error code in case of error.
7232
7233	* src/sfnt/ttcolr.h: Updated.
7234
7235	* include/freetype/internal/sfnt.h (TT_Set_Palette_Func): New
7236	function type.
7237	(SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it.
7238
7239	* src/sfnt/sfdriver.c (sfnt_interface), src/sfnt/sfobjs.c
7240	(sfnt_done_face): Updated.
7241
72422018-06-12  Werner Lemberg  <wl@gnu.org>
7243
7244	Finish CPAL/COLR support (1/4).
7245
7246	* include/freetype/internal/tttypes.h (TT_FaceRec): New fields
7247	`palette_index', `palette', `have_foreground_color' and
7248	`foreground_color'.
7249
72502018-06-12  Werner Lemberg  <wl@gnu.org>
7251
7252	[sfnt] Minor.
7253
7254	* src/sfnt/ttcolr.c (tt_face_load_colr_layers):
7255	s/palette_index/palette_entry_index/ for consistency.
7256	Adjust return error code in case of error.
7257
72582018-06-11  Alexei Podtelezhnikov  <apodtele@gmail.com>
7259
7260	[raster] Clean up.
7261
7262	* src/raster/ftraster.c (black_TWorker, SCALED, Set_High_Precision):
7263	Clean up after 5-level gray removal (8dc8635874).
7264	(Vertical_Sweep_Span): Be brief.
7265
72662018-06-10  Werner Lemberg  <wl@gnu.org>
7267
7268	[sfnt] Fix compiler warnings.
7269
7270	* src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_load_colr_layers,
7271	tt_face_colr_blend_layer): Add `NULL' initializers.
7272
72732018-06-10  Werner Lemberg  <wl@gnu.org>
7274
7275	s/FT_Palette/FT_Palette_Data/, s/palette/palette_data/.
7276
7277	* include/freetype/ftcolor.h, include/freetype/internal/tttypes.h,
7278	src/base/ftcolor.c, src/sfnt/sfobjs.c, src/sfnt/ttcolr.c: Updated.
7279
72802018-06-10  Nikolaus Waxweiler  <madigens@gmail.com>
7281
7282	CMakeLists: also accept IOS_PLATFORM=SIMULATOR64
7283
7284	This might be needed to build FreeType for the iOS simulator. See
7285	https://savannah.nongnu.org/bugs/index.php?54048. Patch contributed
7286	by Steve Robinson.
7287
7288	* CMakeLists.txt: Accept IOS_PLATFORM=SIMULATOR64
7289
72902018-06-10  Werner Lemberg  <wl@gnu.org>
7291
7292	Implement `FT_Palette_Get'.
7293
7294	* src/base/ftcolor.c: New file.
7295
7296	* src/base/Jamefile (_sources), src/base/rules.mk (BASE_SRC),
7297	src/base/ftbase.c: Add `ftcolor.c'.
7298
72992018-06-10  Werner Lemberg  <wl@gnu.org>
7300
7301	* src/sfnt/ttcolr.c (tt_face_load_colr): Improve overflow checks.
7302
73032018-06-09  Alexei Podtelezhnikov  <apodtele@gmail.com>
7304
7305	[raster] Deal with pitch sign earlier.
7306
7307	* src/raster/ftraster.c (black_TWorker): Remove unused `traceG',
7308	s/bTarget/bOrigin/.
7309	(Render_Glyph): Set `ras.bOrigin' at the bottom-left corner.
7310	(Vertical_Sweep_Init, {Vertical,Horizontal}_Sweep_{Span,Drop}):
7311	Updated accordingly.
7312
73132018-06-09  Werner Lemberg  <wl@gnu.org>
7314
7315	[sfnt] Read `CPAL' version 1 tables.
7316
7317	* include/freetype/internal.tttypes.h: Include FT_COLOR_H.
7318	(TT_FaceRec): Add `palette' field.
7319
7320	* src/sfnt/ttcolr.c: Include FT_COLOR_H.
7321	(Cpal): Remove all data covered by the new `palette' field in
7322	`TT_FaceRec'.
7323	(tt_face_load_colr): Updated.
7324	Read `CPAL' version 1 data.
7325	(tt_face_load_colr_layers, tt_face_find_color): Updated.
7326
7327	* src/sfnt/sfobjs.c (sfnt_done_face): Free glyph color palette data.
7328
73292018-06-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
7330
7331	[base] API for Harmony LCD rendering.
7332
7333	This introduces `FT_Library_SetLcdGeometry' for setting up arbitrary
7334	LCD subpixel geometry including non-striped patterns.
7335
7336	* src/base/ftlcdfil.c (FT_Library_SetLcdGeometry): New function.
7337	* include/freetype/ftlcdfil.h: Document it.
7338	* include/freetype/freetype.h: Minor.
7339	* include/freetype/ftchapters.h: Minor.
7340
73412018-06-06  Werner Lemberg  <wl@gnu.org>
7342
7343	ftcolor.h: Redesign API.
7344
7345	While going to implement it I noticed that I need access to most of
7346	the `CPAL' elements; I thus plan to add a `cpal' field to
7347	`TT_FaceRec', which makes most of the previously suggested API
7348	functions obsolete because the fields will be directly accessible.
7349
73502018-06-06  Parth Wazurkar  <parthwazurkar@gmail.com>
7351
7352	[bdf, pcf] Remove deprecated FT_FACE_FLAG_FAST_GLYPHS flag.
7353
7354	* src/bdf/bdfdrivr.c (BDF_Face_Init): Remove deprecated
7355	FT_FACE_FLAG_FAST_GLYPHS flag.
7356
7357	* src/pcf/pcfread.c (pcf_load_font): Remove deprecated
7358	FT_FACE_FLAG_FAST_GLYPHS flag.
7359
73602018-06-06  Werner Lemberg  <wl@gnu.org>
7361
7362	[smooth, raster] Limit bitmap size (#54019).
7363
7364	* src/raster/ftraster.c [STANDALONE] (FT_Outline_Get_CBox): Add
7365	function.
7366	[!STANDALONE]: Include FT_OUTLINE_H.
7367	(ft_black_render): Compute CBox and reject glyphs larger than
7368	0xFFFF x 0xFFFF.
7369
7370	* src/smooth/ftgrays.c (gray_raster_render): Reject glyphs larger
7371	than 0xFFFF x 0xFFFF.
7372
73732018-06-03  Armin Hasitzka  <prince.cherusker@gmail.com>
7374
7375	* src/smooth/ftgrays.c (gray_convert_glyph): Remove unused variables.
7376
73772018-06-03  Werner Lemberg  <wl@gnu.org>
7378
7379	* src/tools/glnames.py (main): Emit header in `light' comment style.
7380
73812018-06-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
7382
7383	[smooth] Attempt to mitigate bug #54019.
7384
7385	The robust rendering of estra large glyphs came with unbearable cost.
7386	The old way of bisecting should fail but fail faster.
7387
7388	* src/smooth/ftgrays.c (gray_convert_glyph): Switch back to bisecting
7389	in y-direction.
7390
73912018-06-02  Werner Lemberg  <wl@gnu.org>
7392
7393	* src/truetype/ttinterp.c (Ins_MIRP): Use SUB_LONG; avoid FT_ABS.
7394
7395	Reported as
7396
7397	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8706
7398
73992018-06-02  Werner Lemberg  <wl@gnu.org>
7400
7401	* src/autofit/afwarp.h: Use AF_CONFIG_OPTION_USE_WARPER (#54033).
7402
74032018-05-31  Werner Lemberg  <wl@gnu.org>
7404
7405	* src/raster/ftraster.c (black_TWorker_): Remove `gTarget' field.
7406
7407	This is no longer used.
7408
74092018-05-31  Werner Lemberg  <wl@gnu.org>
7410
7411	[sfnt] Get colors from `CPAL' table in right order (#54015).
7412
7413	* src/sfnt/ttcolr.c (tt_face_find_color): Fix it.
7414
74152018-05-30  Werner Lemberg  <wl@gnu.org>
7416
7417	ftcolor.h: Improve API design, fix typos (#54011, #54014).
7418
7419	* include/freetype/ftcolor.h (FT_Palette_Get_Names): Replace with...
7420	(FT_Palette_Get_Name_IDs): ... this function.
7421	(FT_Palette_Get_Entry_Names): Replace with...
7422	(FT_Palette_Get_Entry_Name_IDs): ... this function
7423	s/FT_Palette_Set_Foreground_COlor/FT_Palette_Set_Foreground_Color/.
7424
74252018-05-30  Armin Hasitzka  <prince.cherusker@gmail.com>
7426
7427	Beautify a3cfed5e87232c933bdc64f43e8ebebcfd18b41b.
7428
7429	* src/autofit/afloader.c (af_loader_load_glyph): Move the
7430	initialisationand declaration of variables into the if-block.
7431
74322018-05-30  Armin Hasitzka  <prince.cherusker@gmail.com>
7433
7434	Fix pointer underflow.
7435
7436	The declaration of `edge2' can be reached with `edge1 == NULL' and
7437	`axis->edges == 0' which results in undefined behaviour.
7438
7439	* src/autofit/afloader.c (af_loader_load_glyph): Initialise `edge2'
7440	after checking `axis->num_edges > 1'.  `edge1 != NULL' can be assumed.
7441
74422018-05-30  Werner Lemberg  <wl@gnu.org>
7443
7444	Various minor color fixes.
7445
7446	* include/freetype/config/ftheader.h (FT_COLOR_H): New macro.
7447
7448	* include/freetype/internal/ftobjs.h (FT_Colr_Internal): Change
7449	type of `load_flags' to `FT_Int32'.
7450
7451	* include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func): Change
7452	type of `idx' to `FT_UInt'.
7453	(TT_Blend_Colr_Func): Change type of `color_index' to `FT_UInt'.
7454
7455	* src/base/ftobjs.c (FT_Render_Glyph_Internal): Change type of
7456	`load_flags' to `FT_Int32'.
7457
7458	* src/sfnt/ttcolr.c (find_base_glyph_record,
7459	tt_face_load_colr_layers): Change type of `glyph_id' to `FT_UInt'.
7460	(tt_face_find_color, tt_face_colr_blend_layer): Change type of
7461	`color_index' to `FT_UInt'.
7462	Fix signedness and type issues.
7463
7464	* src/sfnt/ttcolr.h: Updated.
7465
74662018-05-25  Nikhil Ramakrishnan  <ramakrishnan.nikhil@gmail.com>
7467
7468	[docmaker] Fix missing `Defined in (...)' under Windows/Cygwin.
7469
7470	This platform uses backslashes for paths, which docmaker didn't
7471	understand correctly.
7472
7473	* src/tools/docmaker/tohtml.py (HtmlFormatter::blockEnter): Use
7474	`os.path.normpath' to normalize the path for the platform being
7475	used.
7476
74772018-05-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
7478
7479	[smooth] Formalize Harmony LCD rendering.
7480
7481	This generalizes magic outline shifts that make Harmony LCD
7482	rendering work in terms of precise two-dimensional RGB subpixel
7483	positions. These coordinates are now set in time of the `smooth'
7484	module initialization and later used to shift a glyph outline for
7485	rendering. FT_RENDER_MODE_LCD and FT_RENDER_MODE_LCD_V use the same
7486	coordinates. The letter, however, rotates them before using.
7487	The LCD bitmap padding is also calculated using these coordinates.
7488
7489	* include/freetype/internal/ftobjs.h (FT_LibraryRec): New array field
7490	`lcd_geometry'.
7491	* src/base/ftlcdfil.c (ft_lcd_padding): Reworked.
7492	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Updated accordingly.
7493
7494	* src/smooth/ftsmooth.c [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]
7495	(ft_smooth_init): Initialize `lcd_geometry'.
7496	(ft_smooth_render_generic): Formalize outline shifts.
7497
74982018-05-22  Werner Lemberg  <wl@gnu.org>
7499
7500	[truetype] Reject elements of composites with invalid glyph indices.
7501
7502	Reported as
7503
7504	  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8413
7505
7506	* src/truetype/ttgload.c (TT_Load_Composite_Glyph): Implement it.
7507
75082018-05-22  Werner Lemberg  <wl@gnu.org>
7509
7510	* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Trace # of points.
7511
75122018-05-20  Werner Lemberg  <wl@gnu.org>
7513
7514	* include/freetype/ftcolor.h: New file.
7515
7516	This is an interface to the `CPAL' OpenType table.  No
7517	implementation yet.
7518
75192018-05-18  Alexei Podtelezhnikov  <apodtele@gmail.com>
7520
7521	* include/freetype/internal/ftcalc.h (FT_MSB): Verified `_MSC_VER'.
7522
7523	Actually `_BitScanReverse' is available since VS2005.
7524
75252018-05-18  Werner Lemberg  <wl@gnu.org>
7526
7527	* include/freetype/internal/ftcalc.h (FT_MSB): Use `_MSC_VER' value.
7528
7529	Older VC versions don't provide `_BitScanReverse'.  We test for VC
7530	2013.
7531
7532	Reported by John Emmas <john@creativepost.co.uk>.
7533
75342018-05-17  Werner Lemberg  <wl@gnu.org>
7535
7536	s/inline/__inline/ for MSVC.
7537
7538	Reported by John Emmas <john@creativepost.co.uk>.
7539
7540	* include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Do it.
7541
75422018-05-16  Werner Lemberg  <wl@gnu.org>
7543
7544	Add function `FT_Get_GlyphLayers' to access `COLR' table data.
7545
7546	* include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec): Move this
7547	structure to...
7548	* include/freetype/freetype.h (FT_Glyph_LayerRec): ... this
7549	header file.
7550	(FT_Glyph_Layer): New typedef.
7551	Update code to use it where appropriate.
7552
7553	* src/base/ftobjs.c (FT_Get_GlyphLayers): New function.
7554
75552018-05-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
7556
7557	[base] Fix mono bitmap presetting (#53896).
7558
7559	It is rather fundamental to set monochrome bitmap based on rounded
7560	CBox because the b/w rasterizer turns on pixels when their centers are
7561	inside the glyph outline. The dropout control is unpredictable and can
7562	distort narrow glyphs if the bitmap is too wide.
7563
7564	Reported by Chris Liddell.
7565
7566	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): If BBox boundaries
7567	are too close, adjust them before rounding.
7568
75692018-05-15  Werner Lemberg  <wl@gnu.org>
7570
7571	[psaux] Fix compiler warning (#53915).
7572
7573	* src/psaux/psft.c (cf2_freeT1SeacComponent): Do it.
7574
75752018-05-15  Werner Lemberg  <wl@gnu.org>
7576
7577	[sfnt] Fix memory leak in handling `COLR' data.
7578
7579	* src/truetype/ttgload.c (TT_Load_Glyph): Free old `layers' array
7580	before reassigning allocated memory.
7581	Only allocate `color_layers' if we don't have one already.
7582
75832018-05-15  Werner Lemberg  <wl@gnu.org>
7584
7585	[sfnt] If `COLR' is present, don't assume that all glyphs use it.
7586
7587	* src/sfnt/ttcolr.c (tt_face_load_colr_layers): Return FT_Err_Ok if
7588	current glyph is not a `COLR' base glyph.
7589
7590	* src/truetype/ttgload.c (TT_Load_Glyph): Don't allocate
7591	`color_layers' if there are no color layers.
7592
75932018-05-14  Werner Lemberg  <wl@gnu.org>
7594
7595	* src/base/ftobjs.c (FT_Load_Glyph): Fix signature of `pixel_modes'.
7596
75972018-05-14  Werner Lemberg  <wl@gnu.org>
7598
7599	Provide dummy functions if `TT_CONFIG_OPTION_SFNT_NAMES' is not set.
7600
7601	* src/base/ftsnames.c [!TT_CONFIG_OPTION_SFNT_NAMES]: Implement it.
7602
76032018-05-13  Werner Lemberg  <wl@gnu.org>
7604
7605	* src/base/ftobjs.c (FT_Load_Glyph): Improve tracing.
7606
76072018-05-13  Shao Yu Zhang  <shaozhang@fb.com>
7608	    Werner Lemberg  <wl@gnu.org>
7609
7610	[sfnt] Preliminary support of colored layer outlines (#44689).
7611
7612	This commit enables OpenType's COLR/CPAL table handling; a typical
7613	application are color emojis that can be scaled to any size.
7614
7615	If the color palette does not exist or is invalid, the rendering
7616	step rasterizes the outline instead.  The current implementation
7617	assumes that the foreground is black.
7618
7619	Enable this by defining option TT_CONFIG_OPTION_COLOR_LAYERS.
7620
7621	There are still some issues with metrics; additionally, an API to
7622	fetch color layers is missing.
7623
7624	* devel/ftoption.h, include/freetype/config/ftoption.h
7625	(TT_CONFIG_OPTION_COLOR_LAYERS): New macro.
7626
7627	* include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec,
7628	FT_Colr_InternalRec): New structures.
7629	(FT_Slot_InternalRec): Add `color_layers' field.
7630
7631	* include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func,
7632	TT_Blend_Colr_Func): New function types.
7633	(SFNT_Interface): Add `load_colr', `free_colr', `load_colr_layer',
7634	and `colr_blend' fields.
7635
7636	* include/freetype/internal/tttypes.h (TT_FaceRec): Add
7637	`colr_and_cpal' field.
7638
7639	* include/freetype/internal/tttags. (TTAG_COLR, TTAG_CPAL): New
7640	macros.
7641
7642	* src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: New files.
7643
7644	* src/base/ftobjs.c (ft_glyphslot_done, FT_Render_Glyph_Internal):
7645	Handle glyph color layers.
7646
7647	* src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC): Add
7648	`ttcolr.c'.
7649
7650	* src/sfnt/sfdriver.c: Include `ttcolr.h'.
7651	(PUT_COLOR_LAYERS): New macro.
7652	Update call to `FT_DEFINE_SFNT_INTERFACE'.
7653
7654	* src/sfnt/sfnt.c: Include `ttcolr.c'.
7655
7656	* src/sfnt/sfobjs.c (sfnt_load_face): Load `COLR' and `CPAL' tables.
7657	(sfnt_done_face): Updated.
7658
7659	* src/truetype/ttgload.c (TT_Load_Glyph): Handle color layers.
7660
76612018-05-12  Arkady Shapkin  <arkady.shapkin@gmail.com>
7662
7663	Use MS VC++'s _BitScanReverse to calculate MSB (patch #9636).
7664
7665	* include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Implement
7666	it.
7667
76682018-05-10  Alan Coopersmith  <alan.coopersmith@oracle.com>
7669
7670	Fix DLL compilation on Solaris.
7671
7672	AC_COMPILE_IFELSE only tries to compile a `*.c' to a `*.o'.  The
7673	Solaris Studio 12.1 through 12.5 compilers see the
7674	`-fvisibility=hidden' flag, but ignore it with a warning of:
7675
7676	  cc: Warning: Option -fvisibility=hidden passed to ld,
7677	               if ld is invoked, ignored otherwise
7678
7679	AC_LINK_IFELSE does the compile and then tries to link the result,
7680	at which point the Solaris linker will issue an error:
7681
7682	  ld: fatal: option '-fvisibility=hidden' is incompatible with
7683	      building a dynamic executable
7684
7685	If we don't use AC_LINK_IFELSE to catch the error, then configure
7686	will fail further tests which attempt to link, such as those testing
7687	dependencies like `libbz2'.
7688
7689	Also, don't try adding `-fvisibility' if we have already added
7690	`-xldscope', just use one of them, since Sun Studio 12 and earlier
7691	compilers only issue a warning, and don't try passing through to the
7692	linker to generate an error, so AC_LINK_IFELSE doesn't catch them.
7693
7694	Tested on Solaris 11.4 beta with compiler versions:
7695
7696	  Sun Studio 8 (Sun C 5.5)
7697	  Sun Studio 10 (Sun C 5.7)
7698	  Sun Studio 11 (Sun C 5.8)
7699	  Sun Studio 12 (Sun C 5.9)
7700	  Sun Studio 12.1 (Sun C 5.10)
7701	  Oracle Solaris Studio 12.2 (Sun C 5.11)
7702	  Oracle Solaris Studio 12.3 (Sun C 5.12)
7703	  Oracle Solaris Studio 12.4 (Sun C 5.13)
7704	  Oracle Developer Studio 12.5 (Sun C 5.14)
7705	  Oracle Developer Studio 12.6 (Sun C 5.15)
7706	  gcc 5.5.0
7707	  gcc 7.3.0
7708
7709	and verified the libfreetype.so.6 generated by each of those
7710	compilers exported the same set of symbols.
7711
7712	* builds/unix/configure.raw: Implement it.
7713
77142018-05-08  Werner Lemberg  <wl@gnu.org>
7715
7716	[autofit] Avoid potential SEGV if running out of memory.
7717
7718	Problem reported by Shailesh Mistry <shailesh.mistry@hotmail.co.uk>.
7719
7720	* src/autofit/afshaper.c (af_shaper_buf_create,
7721	af_shaper_buf_destroy) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Don't
7722	allocate and free a four-byte buffer.  Instead, make those functions
7723	no-ops; the calling functions will provide a pointer to a buffer
7724	instead.
7725
7726	* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
7727	af_cjk_metrics_init_blues, af_cjk_metrics_check_digits),
7728	src/autofit/aflatin.c (af_latin_metrics_init_widths,
7729	af_latin_metrics_init_blues, af_latin_metrics_check_digits)
7730	[!FT_CONFIG_OPTION_USE_HARFBUZZ]: Use pointer to local variable for
7731	`shaper_buf'.
7732
77332018-05-07  Nikolaus Waxweiler  <madigens@gmail.com>
7734
7735	[cmake] Allow using project as subfolder in other project.
7736
7737	* CMakeLists.txt: Test for CMake build directory being different
7738	from source directory.  Provide other parts of the build system
7739	access the full include directory.
7740
77412018-05-07  Werner Lemberg  <wl@gnu.org>
7742
7743	[build] Suppress configure's `nothing to be done' message.
7744
7745	This is due to calling the configure script via `make' (within the
7746	top-level `configure' wrapper script).  The same can happen for all
7747	other secondary make targets that are used to only modify the
7748	primary one, e.g., `make setup devel'.
7749
7750	* builds/dos/detect.mk (emx, turboc, watcom, borlandc, borlandc16),
7751	builds/os2/detect (visualage, watcom, borlandc, devel),
7752	builds/unix/detect.mk (devel, lcc, unix), builds/windows/detect.mk
7753	(visualc, watcom, visualage, lcc, mingw32, bcc32, devel-bcc,
7754	devel-gcc): Use no-op recipe.
7755
77562018-05-04  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
7757
7758	Support symbol visibility features of Sun / Oracle C compilers.
7759
7760	Reported by Kiyoshi Kanazawa:
7761	https://lists.gnu.org/archive/html/freetype-devel/2018-05/msg00008.html
7762	Thanks to the suggestions by Alexei and Alan Coopersmith.
7763
7764	* builds/unix/configure.raw: Check if "-xldscope=hidden" is
7765	accepted, and if so, it is added to CFLAGS.  This is the option
7766	making Sun / Oracle C compilers hide the symbols from global
7767	scope.
7768	* include/freetype/config/ftconfig.h: Use "__global" prefix
7769	for FT_EXPORT() macro, if SunPro C is newer than Sun ONE
7770	Studio 8 (2003).
7771	* builds/unix/ftconfig.in: Ditto.
7772	* builds/vms/ftconfig.h: Ditto.
7773
77742018-05-02  Nikolaus Waxweiler  <madigens@gmail.com>
7775
7776	Unbreak CMake Windows installation
7777
7778	* CMakeLists.txt: Generate ftconfig.h on non-UNIX.
7779
77802018-05-02  Werner Lemberg  <wl@gnu.org>
7781
7782	Remove FT_CONFIG_OPTION_PIC and related code.
7783
7784	*/* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this
7785	preprocessor symbol.
7786
7787	*/*: Replace `XXX_GET' macros (which could be either a function in
7788	PIC mode or an array in non-PIC mode) with `xxx' arrays.
7789
7790	* include/freetype/internal/ftpic.h, src/autofit/afpic.c,
7791	src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h,
7792	src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h,
7793	src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c,
7794	src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h,
7795	src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c,
7796	src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h:
7797	Removed.
7798
7799
7800----------------------------------------------------------------------------
7801
7802Copyright (C) 2018-2021 by
7803David Turner, Robert Wilhelm, and Werner Lemberg.
7804
7805This file is part of the FreeType project, and may only be used, modified,
7806and distributed under the terms of the FreeType project license,
7807LICENSE.TXT.  By continuing to use, modify, or distribute this file you
7808indicate that you have read the license and understand and accept it
7809fully.
7810
7811
7812Local Variables:
7813version-control: never
7814coding: utf-8
7815End:
7816