b17a751dcfd18febef40a8959bd106f2b7ac057d
[platform/upstream/freetype2.git] / ChangeLog.28
1 2017-09-16  Werner Lemberg  <wl@gnu.org>
2
3         * Version 2.8.1 released.
4         =========================
5
6
7         Tag sources with `VER-2-8-1'.
8
9         * docs/VERSION.TXT: Add entry for version 2.8.1.
10         * docs/CHANGES: Updated.
11
12         * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
13         builds/windows/vc2005/index.html,
14         builds/windows/vc2008/freetype.vcproj,
15         builds/windows/vc2008/index.html,
16         builds/windows/vc2010/freetype.vcxproj,
17         builds/windows/vc2010/index.html,
18         builds/windows/visualc/freetype.dsp,
19         builds/windows/visualc/freetype.vcproj,
20         builds/windows/visualc/index.html,
21         builds/windows/visualce/freetype.dsp,
22         builds/windows/visualce/freetype.vcproj,
23         builds/windows/visualce/index.html,
24         builds/wince/vc2005-ce/freetype.vcproj,
25         builds/wince/vc2005-ce/index.html,
26         builds/wince/vc2008-ce/freetype.vcproj,
27         builds/wince/vc2008-ce/index.html: s/2.8/2.8.1/, s/28/281/.
28
29         * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
30
31         * builds/unix/configure.raw (version_info): Set to 21:0:15.
32         * CMakeLists.txt (VERSION_PATCH): Set to 1.
33
34 2017-09-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
35
36         [sfnt] lowest gcc for vectors (e1d0249e) is changed to 4.7.
37
38         __builtin_shuffle() was introduced in gcc-4.7.  The lowest
39         gcc to enable vector operation is delayed from 4.6 to 4.7.
40
41         * src/sfnt/pngshim.c (premultiply_data): Fix cpp-macro to
42         enable the vector operation, to change the lowest gcc version
43         from 4.6 to 4.7.
44
45 2017-09-13  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
46
47         [cache] Fix a possible overflow by signed integer comparison.
48
49         Improve the code by 5d3ff05615dda6d1325ed612381a17a0df04c975 ,
50         issues are found by Behdad Esfahbod and Werner Lemberg.
51
52         * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Replace
53         a subtraction to check higher bit by a bit operation,
54         and cpp-conditionalize for appropriate systems.  Add better
55         documentation to the comment.
56         (FTC_ImageCache_LookupScaler): Ditto.
57         (FTC_SBitCache_Lookup): Ditto.
58         (FTC_SBitCache_LookupScaler): Ditto.
59
60 2017-09-13  Werner Lemberg  <wl@gnu.org>
61
62         [autofit] Really fix #41334 (#52000).
63
64         * src/autofit/aflatin.c (af_latin_hints_compute_segments): Set
65         `segment->delta' everywhere.
66
67 2017-09-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
68
69         [autofit, sfnt] Fix for `make multi'.
70
71         * src/autofit/afshaper.c: Include FT_ADVANCE_H, to use
72         FT_Get_Advance() in it.
73         * src/sfnt/ttcmap.c: Include FT_SERVICE_POSTSCRIPT_CMAPS_H
74         to use PS_Unicodes in it, also include `ttpost.h' to use
75         tt_face_get_ps_name() in it.
76
77 2017-09-11  Azzuro  <azzuro@team-mediaportal.com>
78
79         [build] Improve builds with different MS Visual Studio versions.
80
81         * builds/windows/vc2010/freetype.vcxproj: Switch platform toolset
82         according to the Visual Studio version.
83
84 2017-09-11  Werner Lemberg  <wl@gnu.org>
85
86         * src/sfnt/ttkern.c (tt_face_load_kern): Reject format 2 tables.
87
88         Reported by Behdad.
89
90 2017-09-09  Werner Lemberg  <wl@gnu.org>
91
92         [autofit] Improve communication with ftgrid.
93
94         * src/autofit/afhints.c (af_glyph_hints_get_segment_offset):
95         Provide values in font units.
96
97 2017-09-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
98
99         [base] Remove a check for resource ID in the resource fork driver.
100
101         LastResort.dfont has a marginal resource ID 0xFFFF for sfnt
102         resource.  Inside Macintosh: More Macintosh Toolbox, `Resource IDs'
103         (1-46), tells that some IDs are reserved and should not be used.
104         FreeType2 just uses resource ID to sort the fragmented resource.
105         To accept the marginal fonts, the checking is removed.
106
107         * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove res_id
108         validity check, fix a trace message format.
109
110 2017-09-08  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
111
112         [sfnt, truetype] Register the tags for marginal fonts.
113
114         The first 32bit of standard TrueType variants is 0x00010000,
115         `OTTO', `ttcf', `true' or `typ1'.  2 marginal dfonts on legacy Mac
116         OS X, Keyboard.dfont and LastResort.dfont, have the sfnt resources
117         starting 0xA5 followed by `kbd' or `lst'.  Considering the following
118         data could be parsed as conventional TrueType fonts, the header
119         checking is updated to allow these tags.  It seems that recent Mac
120         OS X has already switched to normal TTF for these fonts.
121
122         See the discussion at
123         http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3931.0
124
125         * include/freetype/tttags.h (TTAG_0xA5kbd, TTAG_0xA5lst): New header
126         tags for Keyboard.dfont and LastResort.dfont.
127         * src/sfnt/sfobjs.c (sfnt_open_font): Accept the sfnt resource
128         starts with TTAG_0xA5kbd or TTAG_0xA5lst.
129         * src/truetype/ttobjs.c (tt_face_init): Accept the face with the
130         format tag is TTAG_0xA5kbd or TTAG_0xA5lst.
131
132 2017-09-05  Werner Lemberg  <wl@gnu.org>
133
134         Fix multiple calls of `FT_Bitmap_Convert'.
135
136         The documentation of `FT_Bitmap_Convert' says that multiple calls do
137         proper reallocation of the target FT_Bitmap object.  However, this
138         failed for the sequence
139
140           non-empty bitmap
141           empty bitmap
142           non-empty bitmap
143
144         Reason was that `FT_Bitmap_Convert' only reallocated the bitmap
145         buffer if it became too small; it didn't make the buffer smaller.
146         For an empty bitmap following a non-empty one, only the buffer
147         dimension got set to zero, without deallocation.  If the next call
148         was a non-empty buffer again, an assertion in `ft_mem_qrealloc' was
149         triggered.
150
151         * src/base/ftbitmap.c (FT_Bitmap_Convert): Always reallocate target
152         buffer to the correct size.
153
154         * docs/CHANGES: Document it.
155
156 2017-09-05  Werner Lemberg  <wl@gnu.org>
157
158         [bdf] Fix size and resolution handling.
159
160         * src/bdf/bdfdrivr.c (BDF_Face_Init): Use `SIZE' values if
161         `POINT_SIZE', `RESOLUTION_X', or `RESOLUTION_Y' properties are
162         missing.
163
164         * docs/CHANGES: Document it.
165
166 2017-08-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
167
168         Swap `ALLOC_MULT' arguments (#51833).
169
170         * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Updated.
171         * src/winfonts/winfnt.c (FNT_Load_Glyph): Updated.
172         * src/raster/ftrend1.c (ft_raster1_render): Updated.
173
174 2017-08-23  Werner Lemberg  <wl@gnu.org>
175
176         [sfnt] Fix clang compilation (#51788).
177
178         * src/sfnt/pngshim.c (premultiply_data): Use vectors instead of
179         scalars.
180         (vector_shuffle): New macro to take care of a different built-in
181         function name on clang.
182
183 2017-08-22  Werner Lemberg  <wl@gnu.org>
184
185         [base] Don't zero out allocated memory twice (#51816).
186
187         Patch applied from bug report.
188
189         * src/base/ftutil.c (ft_mem_qrealloc): Use low-level allocation to
190         avoid unnecessary overhead.
191
192 2017-08-22  Werner Lemberg  <wl@gnu.org>
193
194         [truetype] Integer overflow.
195
196         Changes triggered by
197
198           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3107
199
200         * src/truetype/ttinterp.c (Ins_MDRP, Ins_MIRP, Ins_ALIGNPTS): Use
201         NEG_LONG.
202
203 2017-08-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
204
205         [sfnt] Avoid synthetic unicode for symbol fonts with PUA.
206
207         Reported as
208
209           https://bugs.chromium.org/p/chromium/issues/detail?id=754574
210
211         * src/sfnt/sfobjs.c (sfnt_load_face): Check for FT_ENCODING_MS_SYMBOL.
212
213 2017-08-16  Werner Lemberg  <wl@gnu.org>
214
215         * src/sfnt/pngshim.c (premultiply_data): Fix compiler warnings.
216
217 2017-08-15  Behdad Esfahbod  <behdad@behdad.org>
218
219         [sfnt] Speed up PNG image loading.
220
221         This reduces the overhead of `premultiply_data' by 60%.
222
223         * src/sfnt/pngshim.c (premultiply_data): Provide code which uses
224         gcc's (and clang's) `vector_byte' attribute to process 4 pixels at a
225         time.
226
227 2017-08-11  Werner Lemberg  <wl@gnu.org>
228
229         [sfnt, truetype] Improve handling of missing sbits.
230
231         Requested by Behdad.
232
233         Modern bitmap-only SFNTs like `NotoColorEmoji.ttf' don't contain
234         entries in the bitmap strike(s) for empty glyphs.  Instead, they
235         rely that a space glyph gets created from the font's metrics data.
236         This commit makes FreeType behave accordingly.
237
238         * include/freetype/fterrdef.h (FT_Err_Missing_Bitmap): New error
239         code.
240
241         * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image): Change error codes
242         to make a distinction between a missing bitmap in a composite and a
243         simple missing bitmap.
244
245         * src/truetype/ttgload.c (TT_Load_Glyph): For a missing bitmap (in a
246         bitmap-only font), synthesize an empty bitmap glyph if metrics are
247         available.
248
249 2017-08-10  Werner Lemberg  <wl@gnu.org>
250
251         [base] Minor API improvement for default variation axis setting.
252
253         * src/base/ftmm.c (FT_Set_MM_Design_Coordinates,
254         FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
255         FT_Set_Var_Blend_Coordinates): Allow coords==NULL if num_coords==0.
256
257         * docs/CHANGES: Updated.
258
259 2017-08-08  Werner Lemberg  <wl@gnu.org>
260
261         [psnames] Really fix issue #49949.
262
263         We now use a separate preprocessor macro to handle both definition
264         and declaration of the glyph name arrays.
265
266         * src/psnames/psmodule.c (DEFINE_PS_TABLE_DATA): New macro.
267
268         * src/tools/glnames.py (StringTable::dump,
269         StringTable::dump_sublist): Use `DEFINE_PS_TABLE_DATA'.
270         (dump_encoding): Ditto.
271         (main): Use `wb' mode for writing the output file, which works on
272         Windows also.
273
274         * src/psnames/pstables.h: Regenerated.
275
276 2017-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
277
278         [smooth] Harmony LCD rendering.
279
280         This is a new technology for LCD-optimized rendering. It capitalizes
281         on the fact that each color channel grid is shifted by a third of a
282         pixel.  Therefore it is logical to render 3 separate monochrome
283         bitmaps shifting the outline by 1/3 pixel, and then combine them.
284         Importantly, the resulting output does not require additional LCD
285         filtering.
286
287         * src/smooth/ftsmooth.c (ft_smooth_render_generic)
288         [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Implement new LCD-optimized
289         rendering.
290
291         * include/freetype/ftlcdfil.h, include/freetype/freetype.h,
292         include/freetype/config/ftoption.h, devel/ftoption.h: Updated
293         documentation.
294
295 2017-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
296
297         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Clean up.
298
299 2017-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>
300
301         * src/sfnt/ttpost.c (format): Use otspec-compliant versions.
302
303 2017-08-05  Werner Lemberg  <wl@gnu.org>
304
305         [truetype] Integer overflow.
306
307         Reported as
308
309           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2868
310
311         * src/truetype/ttinterp.c (Ins_ALIGNRP): Use NEG_LONG.
312
313 2017-08-05  Werner Lemberg  <wl@gnu.org>
314
315         [base, truetype] New function `FT_Get_Var_Axis_Flags'.
316
317         The reserved `flags' field got a value in OpenType version 1.8.2;
318         unfortunately, the public `FT_Var_Axis' structure misses the
319         corresponding element.  Since we can't add a new field, we add an
320         access function.
321
322         * src/base/ftmm.c (FT_Get_Var_Axis_Flags): New function.
323
324         * include/freetype/ftmm.h (FT_VAR_AXIS_FLAG_HIDDEN): New macro.
325         Updated.
326
327         * src/truetype/ttgxvar.c (TT_Get_MM_Var): Increase allocated memory
328         of `mmvar' to hold axis flags.
329         Fill the axis flags array.
330
331         * docs/CHANGES: Updated.
332
333 2017-08-03  Nikolaus Waxweiler  <madigens@gmail.com>
334
335         [truetype] Fix metrics of B/W hinting in v40 mode.
336
337         Phantom points are now saved outside v40 backwards compatibility
338         mode.  This fixes the jumping glyphs when switching between v35 and
339         v40 monochrome mode.
340
341         * src/truetype/ttgload.c (TT_Hint_Glyph): Fix inversed bool logic.
342
343 2017-08-03  Nikolaus Waxweiler  <madigens@gmail.com>
344
345         [truetype] Do not set any ClearType flags in v40 monochrome mode.
346
347         This fixes weird behavior of instructions that resulted in rendering
348         differences between v35 and v40 in monochrome mode, e.g., in
349         `timesbi.ttf'.
350
351         * src/truetype/ttinterp.c (Ins_GETINFO)
352         [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Check
353         `subpixel_hinting_lean'.
354
355 2017-08-01  Werner Lemberg  <wl@gnu.org>
356
357         * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix thinko.
358
359 2017-08-01  Behdad Esfahbod  <behdad@behdad.org>
360
361         [truetype] Fix loading of named instances.
362
363         * src/truetype/ttgxvar.c (TT_Get_MM_Var): Preserve file position
364         while loading the `avar' table.
365
366 2017-08-01  Werner Lemberg  <wl@gnu.org>
367
368         [sfnt, truetype] Minor adjustments for OpenType 1.8.2.
369
370         * src/sfnt/sfobjs.c (sfnt_load_face): The units per EM value has now
371         (tighter) limits.
372
373         * src/truetype/ttgload.c (load_truetype_glyph): The new OpenType
374         version explicitly allows all negative values for the number of
375         contours if we have a composite glyph (this is for better backwards
376         compatibility I guess), but it still recommends value -1.
377
378 2017-07-26  Werner Lemberg  <wl@gnu.org>
379
380         [cff] Integer overflow.
381
382         Reported as
383
384           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2738
385
386         * src/cff/cf2hints.c (cf2_glyphpath_computeOffset,
387         cf2_glyphpath_curveTo): Use ADD_INT32.
388
389 2017-07-13  Werner Lemberg  <wl@gnu.org>
390
391         [base] Fix memory leak.
392
393         Reported as
394
395           https://bugs.chromium.org/p/chromium/issues/detail?id=738362
396
397         * src/base/ftglyph.c (FT_Get_Glyph): Do proper deallocation in case
398         of error.
399
400 2017-07-12  Werner Lemberg  <wl@gnu.org>
401
402         [base] Integer overflow.
403
404         Reported as
405
406           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2573
407
408         * src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Use
409         FT_PIX_CEIL_LONG and FT_PIX_ROUND_LONG.
410
411 2017-07-12  Werner Lemberg  <wl@gnu.org>
412
413         * src/truetype/ttpload.c (tt_face_get_location): Off-by-one typo.
414
415         Also improve tracing message.
416
417         Problem reported as
418
419           https://bugs.chromium.org/p/chromium/issues/detail?id=738919
420
421 2017-07-07  Werner Lemberg  <wl@gnu.org>
422
423         [cff] Integer overflow.
424
425         Reported as
426
427           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2517
428
429         * src/cff/cf2blues.c (cf2_blues_capture): Use SUB_INT32.
430
431 2017-07-05  Werner Lemberg  <wl@gnu.org>
432
433         * src/sfnt/ttcmap.c (tt_cmap_unicode_class_rec): Fix warning.
434
435 2017-07-05  Werner Lemberg  <wl@gnu.org>
436
437         * src/truetype/ttgxvar.c (FT_Stream_SeekSet): Fix warning (#51395).
438
439 2017-07-04  Werner Lemberg  <wl@gnu.org>
440
441         [truetype] Prevent address overflow (#51365).
442
443         * src/truetype/ttgxvar.c (FT_Stream_SeekSet): Add guard.
444
445 2017-07-03  Alexei Podtelezhnikov  <apodtele@gmail.com>
446
447         * src/base/ftlcdfil.c (ft_lcd_filter_fir): Improve code.
448
449 2017-07-03  Werner Lemberg  <wl@gnu.org>
450
451         [truetype] Integer overflow.
452
453         Reported as
454
455           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2455
456
457         * src/truetype/ttinterp.c (Ins_SCFS): Use SUB_LONG.
458
459 2017-07-01  Alexei Podtelezhnikov  <apodtele@gmail.com>
460
461         * src/sfnt/sfobjs.c (sfnt_load_face): Ignore No_Unicode_Glyph_Name.
462
463 2017-06-28  Ben Wagner  <bungeman@google.com>
464
465         Avoid Microsoft compiler warnings (#51331).
466
467         While clang's sanitizer recommends a cast to unsigned for safe
468         negation (to handle -INT_MIN), both MSVC and Visualc emit warning
469         C4146 if an unsigned value gets negated.
470
471         * include/freetype/internal/ftcalc.h (NEG_LONG, NEG_INT32),
472         src/base/ftcalc.c (FT_MOVE_SIGN): Replace negation with a
473         subtraction.
474
475 2017-06-27  Werner Lemberg  <wl@gnu.org>
476
477         * src/cff/cffparse.c (do_fixed): Fix typo.
478
479         Spotted by chris <chris@gcjd.org>.
480
481 2017-06-27  Werner Lemberg  <wl@gnu.org>
482
483         [truetype] Integer overflows.
484
485         Reported as
486
487           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2384
488           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2391
489
490         * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round, FT_DivFix): Use
491         NEG_LONG.
492
493         * src/truetype/ttinterp.c (Ins_SxVTL): Use NEG_LONG.
494
495 2017-06-24  Werner Lemberg  <wl@gnu.org>
496
497         [truetype] Integer overflows.
498
499         Reported as
500
501           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2364
502
503         * src/truetype/ttinterp.c (Ins_ISECT): Use NEG_LONG.
504
505 2017-06-22  Werner Lemberg  <wl@gnu.org>
506
507         [cff, truetype] Integer overflows.
508
509         Reported as
510
511           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2323
512           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2328
513
514         * src/cff/cf2blues.c (cf2_blues_capture): Use ADD_INT32 and
515         SUB_INT32.
516
517         * src/truetype/ttinterp.c (Ins_SDPVTL): Use SUB_LONG and NEG_LONG.
518
519 2017-06-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
520
521         [sfnt] Synthesize a Unicode charmap if one is missing.
522
523         * src/sfnt/ttcmap.h (tt_cmap_unicode_class_rec): Declare it.
524         * src/sfnt/ttcmap.c (tt_get_glyph_name, tt_cmap_unicode_init,
525         tt_cmap_unicode_done, tt_cmap_unicode_char_index,
526         tt_cmap_unicode_char_next, tt_cmap_unicode_class_rec): Implement
527         synthetic Unicode charmap class.
528         (tt_get_cmap_info): Make sure the callback is available.
529
530         * src/sfnt/sfobjs.c (sfnt_load_face)
531         [FT_CONFIG_OPTION_POSTSCRIPT_NAMES]: If Unicode charmap is missing,
532         synthesize one.
533
534         * include/freetype/config/ftoption.h: Document it.
535         * devel/ftoption.h: Ditto.
536
537 2017-06-20  Tony Theodore  <tonyt@logyst.com>
538
539         Fix pkg-config in freetype-config for cross-compiling (#51274).
540
541         * builds/unix/unix-def.in (PKG_CONFIG): New variable.
542         (freetype-config): Use it in sed expression.
543
544         * builds/unix/freetype-config.in: s/pkg-config/%PKG_CONFIG%/.
545
546 2017-06-20  Werner Lemberg  <wl@gnu.org>
547
548         [cff, truetype] Integer overflows.
549
550         Reported as
551
552           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2300
553           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2313
554
555         * src/cff/cf2hints.c (cf2_hintmap_adjustHints): Use ADD_INT32.
556
557         * src/truetype/ttinterp.c (Ins_ABS): Avoid FT_ABS.
558
559 2017-06-17  Alexei Podtelezhnikov  <apodtele@gmail.com>
560
561         [base, smooth] LCD filtering cleanups.
562
563         * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
564         Clean up, start filtering from the bottom-left origin.
565
566         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Updated.
567
568 2017-06-16  Werner Lemberg  <wl@gnu.org>
569
570         [truetype] Integer overflows.
571
572         Reported as
573
574           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2270
575           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2276
576
577         * src/truetype/ttinterp.c (Ins_MDRP, _iup_worker_interpolate): Use
578         ADD_LONG and SUB_LONG.
579
580 2017-06-15  Werner Lemberg  <wl@gnu.org>
581
582         [bdf, cff] Integer overflows.
583
584         Reported as
585
586           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2244
587           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2261
588
589         * src/bdf/bdfdrivr.c (BDF_Face_Init): Replace calls to FT_ABS with
590         direct code to avoid value negation.
591
592         * src/cff/cf2blues.c (cf2_blues_capture): Use SUB_INT32 and
593         ADD_INT32.
594
595 2017-06-13  Werner Lemberg  <wl@gnu.org>
596
597         * src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding.
598
599         FreeType only sets a default active encoding for Unicode.
600
601 2017-06-13  Werner Lemberg  <wl@gnu.org>
602
603         [cff, truetype] Integer overflows.
604
605         Reported as
606
607           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2216
608           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2218
609
610         * src/cff/cf2fixed.h (cf2_fixedAbs): Use NEG_INT32.
611
612         * src/truetype/ttinterp.c (Ins_IP): Use SUB_LONG.
613
614 2017-06-11  Werner Lemberg  <wl@gnu.org>
615
616         [cff] Integer overflows.
617
618         Reported as
619
620           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2200
621           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2210
622
623         * src/cff/cf2hints.c (cf2_hintmap_insertHint): Use SUB_INT32 and
624         ADD_INT32.
625
626         * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdVMOVETO>: Use
627         ADD_INT32.
628
629 2017-06-10  Werner Lemberg  <wl@gnu.org>
630
631         [truetype] Fix TT_Set_Var_Design.
632
633         Reported by Nikolaus Waxweiler <madigens@gmail.com>.
634
635         * src/truetype/ttgxvar.c (TT_Set_Var_Design): Correctly handle the
636         case where we have less input coordinates than axes.
637
638 2017-06-10  Werner Lemberg  <wl@gnu.org>
639
640         * src/base/ftcalc.c (FT_DivFix): Fix embarrassing typo.
641
642         Bug introduced 2017-05-28.
643
644 2017-06-09  Werner Lemberg  <wl@gnu.org>
645
646         [cff, truetype] Integer overflows.
647
648         Reported as
649
650           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2144
651           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2151
652           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2153
653           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2173
654           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2186
655
656         * src/cff/cf2blues.c (cf2_blues_init): Use SUB_INT32.
657
658         * src/truetype/ttinterp.c (Round_None, Round_To_Grid,
659         Round_To_Half_Grid, Round_Down_To_Grid, Round_Up_To_Grid,
660         Round_To_Double_Grid, Round_Super, Round_Super_45): Use ADD_LONG,
661         SUB_LONG, NEG_LONG, FT_PIX_ROUND_LONG, FT_PIX_CEIL_LONG,
662         FT_PAD_ROUND_LONG
663         (Ins_SxVTL, Ins_MIRP): Use SUB_LONG.
664         (_iup_worker_shift): Use SUB_LONG and ADD_LONG.
665
666 2017-06-09  Werner Lemberg  <wl@gnu.org>
667
668         Provide more macros for flooring, ceiling, and rounding.
669
670         These versions don't produce run-time errors due to integer
671         overflow.
672
673         * include/freetype/internal/ftobjs.h: Include FT_INTERNAL_CALC_H.
674         (FT_PAD_ROUND_LONG, FT_PAD_CEIL_LONG, FT_PIX_ROUND_LONG,
675         FT_PIX_CEIL_LONG): New macros.
676         (FT_PAD_ROUND_INT32, FT_PAD_CEIL_INT32, FT_PIX_ROUND_INT32,
677         FT_PIX_CEIL_INT32): New macros.
678
679 2017-06-09  Werner Lemberg  <wl@gnu.org>
680
681         Remove unused macros.
682
683         * include/freetype/internal/ftcalc.h (ADD_INT, SUB_INT, MUL_INT,
684         NEG_INT): Deleted.
685
686 2017-06-09  Werner Lemberg  <wl@gnu.org>
687
688         */*: Remove `OVERFLOW_' prefix.
689
690         This increases readability.
691
692 2017-06-07  Werner Lemberg  <wl@gnu.org>
693
694         [cff, truetype] Integer overflows.
695
696         Reported as
697
698           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2133
699           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2137
700
701         * src/cff/cf2hints.c (cf2_hint_init): Use OVERFLOW_SUB_INT32.
702
703         * src/truetype/ttinterp.c (PROJECT, DUALPROJ): Use
704         OVERFLOW_SUB_LONG.
705
706 2017-06-06  Werner Lemberg  <wl@gnu.org>
707
708         [cff] Integer overflows.
709
710         Reported as
711
712           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2109
713           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2110
714           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2122
715
716         * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
717
718         * src/cff/cf2hints.c (cf2_hintmap_map): Synchronize if-else
719         branches.
720
721 2017-06-05  Werner Lemberg  <wl@gnu.org>
722
723         [cff] Integer overflow.
724
725         Reported as
726
727           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2089
728
729         * src/cff/cffload.c (cff_blend_doBlend): User OVERFLOW_ADD_INT32.
730
731 2017-06-04  Werner Lemberg  <wl@gnu.org>
732
733         [cff, truetype] Integer overflows.
734
735         Reported as
736
737           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2075
738           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2088
739
740         * src/cff/cf2font.c (cf2_font_setup): Use OVERFLOW_MUL_INT32.
741
742         * src/truetype/ttinterp.c (Ins_ISECT): Use OVERFLOW_MUL_LONG,
743         OVERFLOW_ADD_LONG, and OVERFLOW_SUB_LONG.
744
745 2017-06-03  Werner Lemberg  <wl@gnu.org>
746
747         [base, cff, truetype] Integer overflows.
748
749         Reported as
750
751           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2060
752           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2062
753           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2063
754           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2068
755
756         * src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Use
757         OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG.
758
759         * src/cff/cf2blues.c (cf2_blues_capture), src/cff/cf2hints.c
760         (cf2_hintmap_adjustHints): Use OVERFLOW_SUB_INT32.
761
762         * src/truetype/ttgload.c (compute_glyph_metrics): User
763         OVERFLOW_SUB_LONG.
764
765         * src/truetype/ttinterp.c (Direct_Move, Direct_Move_Orig,
766         Direct_Move_X, Direct_Move_Y, Direct_Move_Orig_X,
767         Direct_Move_Orig_Y, Move_Zp2_Point, Ins_MSIRP): Use
768         OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG.
769
770 2017-06-03  Werner Lemberg  <wl@gnu.org>
771
772         * builds/unix/freetype-config.in: Fix pkg-config test (#51162).
773
774         Patch directly taken from bug report.
775
776 2017-06-03  Werner Lemberg  <wl@gnu.org>
777
778         [bdf] Synchronize sanity checks with pcf driver.
779
780         Reported as
781
782           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2054
783           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2058
784
785         * src/bdf/bdfdrivr.c (BDF_Face_Init): Check font ascent and descent.
786         Check AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and
787         RESOLUTION_Y properties.
788
789 2017-06-03  Werner Lemberg  <wl@gnu.org>
790
791         [cff, truetype] Integer overflows.
792
793         Reported as
794
795           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2047
796           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2057
797
798         * src/cff/cf2hints.c (cf2_hintmap_map): Use OVERFLOW_SUB_INT32.
799
800         * src/truetype/ttinterp.c (Ins_ADD): Use OVERFLOW_ADD_LONG.
801         (Ins_SUB): Use OVERFLOW_SUB_LONG.
802         (Ins_NEG): Use NEG_LONG.
803
804 2017-06-03  Werner Lemberg  <wl@gnu.org>
805
806         ftcalc.h: Avoid left-shift of negative numbers.
807
808         Reported as
809
810           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2055
811
812         * include/freetype/internal/ftcalc.h (INT_TO_F26DOT6,
813         INT_TO_F2DOT14, INT_TO_FIXED, F2DOT14_TO_FIXED): Use multiplication.
814
815 2017-06-02  Werner Lemberg  <wl@gnu.org>
816
817         [cff] Even more integer overflows.
818
819         Reported as
820
821           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2046
822
823         * src/cff/cf2intrp.c (cf2_doStems, cf2_interpT2CharString): Use
824         OVERFLOW_ADD_INT32.
825
826 2017-06-02  Werner Lemberg  <wl@gnu.org>
827
828         [cff] More integer overflows.
829
830         Reported as
831
832           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2032
833
834         * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
835
836 2017-06-02  Werner Lemberg  <wl@gnu.org>
837
838         [bdf] Don't left-shift negative numbers.
839
840         Reported as
841
842           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2031
843
844         * src/bdf/bdfdrivr.c (BDF_Face_Init): Use multiplication.
845
846 2017-06-02  Werner Lemberg  <wl@gnu.org>
847
848         [bdf] Fix integer scanning routines.
849
850         Reported as
851
852           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2029
853
854         * src/bdf/bdflib.c (_bdf_atoul, _bdf_atol, _bdf_atous, _bdf_atos):
855         Stop scanning if result would overflow.
856
857 2017-06-02  Werner Lemberg  <wl@gnu.org>
858
859         [cff] Fix integer overflows.
860
861         Reported as
862
863           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2027
864           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2028
865
866         * src/cff/cf2hints.c (cf2_hintmap_insertHint), src/cff/cf2intrp.c
867         (cf2_doFlex): Use OVERFLOW_ADD_INT32 and OVERFLOW_SUB_INT32.
868
869 2017-06-01  Werner Lemberg  <wl@gnu.org>
870
871         [smooth] Some 32bit integer overflow run-time errors.
872
873         * src/smooth/ftgrays.c [STANDALONE] (OVERFLOW_ADD_LONG,
874         OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG, NEG_LONG): New macros.
875         [!STANDALONE]: Include FT_INTERNAL_CALC_H.
876         (gray_render_cubic): Use those macros where appropriate.
877
878 2017-06-01  Werner Lemberg  <wl@gnu.org>
879
880         * src/base/ftglyph.c (FT_Get_Glyph): Check `slot->advance'.
881
882 2017-06-01  Werner Lemberg  <wl@gnu.org>
883
884         [psaux] 32bit integer overflow tun-time errors (#46149).
885
886         * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Use
887         OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG where appropriate.
888
889 2017-06-01  Werner Lemberg  <wl@gnu.org>
890
891         * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter again.
892
893         Problem reported by Marek Kašík <mkasik@redhat.com>.
894
895         The problematic font that exceeds the old limit is Padauk-Bold,
896         version 3.002, containing bytecode generated by a buggy version of
897         ttfautohint.
898
899 2017-05-31  Werner Lemberg  <wl@gnu.org>
900
901         [cff] 32bit integer overflow run-time errors 2/2 (#46149).
902
903         This commit handles the new engine.
904
905         * include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT32,
906         OVERFLOW_SUB_INT32, OVERFLOW_MUL_INT32, NEG_INT, NEG_LONG,
907         NEG_INT32): New macros.
908
909         * src/cff/cf2ft.c (cf2_getScaleAndHintFlag): Use OVERFLOW_ADD_INT32.
910
911         * src/cff/cf2hints.c (cf2_getWindingMomentum, cf2_hint_init,
912         cf2_hintmap_map, cf2_glyphpath_hintPoint,
913         cf2_glyphpath_computeIntersection, cf2_glyphpath_computeOffset,
914         cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): Use
915         OVERFLOW_ADD_INT32, OVERFLOW_SUB_INT32, OVERFLOW_MUL_INT32, and
916         NEG_INT32 where appropriate.
917
918         * src/cff/cf2intrp.c (cf2_doFlex, cf2_doBlend,
919         cf2_interpT2CharString): Ditto.
920         Also add some other code where needed to avoid overflow.
921
922 2017-05-30  Werner Lemberg  <wl@gnu.org>
923
924         [cff] 32bit integer overflow run-time errors 1/2 (#46149).
925
926         This commit handles the old engine.
927
928         * src/cff/cffgload.c: Include FT_INTERNAL_CALC_H.
929         (cff_decoder_parse_charstrings): Use OVERFLOW_ADD_LONG and
930         OVERFLOW_SUB_LONG where needed.
931
932         * src/cff/cffparse.c: Include FT_INTERNAL_CALC_H.
933         (power_ten_limits): New static array.
934         (do_fixed): Use it to prevent multiplication overflow.
935         (cff_parser_run): Use OVERFLOW_ADD_LONG.
936
937 2017-05-30  Werner Lemberg  <wl@gnu.org>
938
939         [psaux] Correctly handle sequences of multiple number signs.
940
941         * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero
942         if we encounter more than a single sign.
943
944 2017-05-29  Werner Lemberg  <wl@gnu.org>
945
946         [pcf] 32bit integer overflow run-time errors (#46149).
947
948         * src/pcf/pcfread.c (pcf_get_accel): Add sanity checks for
949         `fontAscent' and `fontDescent'.
950         (pcf_load_font): Add sanity checks for global height.
951         Add sanity checks for AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE,
952         RESOLUTION_X, and RESOLUTION_Y properties.
953
954 2017-05-29  Werner Lemberg  <wl@gnu.org>
955
956         Handle some integer overflow run-time errors (#46149, #48979).
957
958         This commit (mainly for 32bit CPUs) is the first of a series of
959         similar commits to handle known integer overflows.  Basically, all
960         of them are harmless, since they affect rendering of glyphs only,
961         not posing security threats.  It is expected that fuzzying will show
962         up more overflows, to be fixed in due course.
963
964         The idea is to mark places where overflows can occur, using macros
965         that simply cast to unsigned integers, because overflow arithmetic
966         is well defined in this case.  Doing so suppresses run-time errors
967         of sanitizers without adding computational overhead.
968
969         * include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT,
970         OVERFLOW_SUB_INT, OVERFLOW_MUL_INT, OVERFLOW_ADD_LONG,
971         OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG): New macros.
972
973         * src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_Matrix_Multiply,
974         FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled,
975         ft_corner_orientation): Use new macros.
976
977         * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use new macros.
978
979 2017-05-28  Werner Lemberg  <wl@gnu.org>
980
981         * include/freetype/internal/ftcalc.h (FLOAT_TO_FIXED): Remove.
982
983         This macro is not used.
984
985 2017-05-28  Werner Lemberg  <wl@gnu.org>
986
987         [cff] s/cf2_floatToFixed/cf2_doubleToFixed/.
988
989         The new name better describes what the macro actually does;
990         additionally, we don't need a trailing `f' for literals (there was
991         only a single such instance in the code, but this caused a clang
992         warning because the macro itself uses `double' literals).
993
994         * src/cff/cf2blues.c, src/cff/cf2blues.h, src/cff/cf2fixed.h,
995         src/cff/cf2font.c, src/cff/cf2hints.c: Updated.
996
997 2017-05-28  Werner Lemberg  <wl@gnu.org>
998
999         Fix negation of INT_MIN and LONG_MIN (#46149).
1000
1001         * src/base/ftcalc.c (FT_MOVE_SIGN): Add argument to pass unsigned
1002         value, to be used as the result.
1003         (FT_MulDiv, FT_MulDiv_No_Round, FT_DivFix, FT_MulFix,
1004         FT_Vector_NormLen): Updated.
1005
1006 2017-05-27  Werner Lemberg  <wl@gnu.org>
1007
1008         [truetype] Fix handling of design coordinates (#51127).
1009
1010         * src/truetype/ttgxvar.c (tt_set_mm_blend): Compute all design
1011         coordinates if we have to create the `blends->coord' array.
1012         (TT_Get_MM_Blend, TT_Get_Var_Design): Select default instance
1013         coordinates if no instance is selected yet.
1014
1015 2017-05-24  Werner Lemberg  <wl@gnu.org>
1016
1017         [bdf, pcf] Support ISO646.1991-IRV character encoding (aka ASCII).
1018
1019         Problem reported by Marek Kašík <mkasik@redhat.com>, cf.
1020
1021           https://bugzilla.redhat.com/show_bug.cgi?id=1451795
1022
1023         * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdrivr.c
1024         (PCF_Face_Init): Implement it.
1025
1026 2017-05-20  Nikolaus Waxweiler  <madigens@gmail.com>
1027
1028         [truetype] Always use interpreter v35 for B/W rendering (#51051).
1029
1030         * src/truetype/ttgload.c (tt_loader_init)
1031         [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Adjust
1032         `subpixel_hinting_lean', `grayscale_cleartype', and
1033         `vertical_lcd_lean' accordingly.
1034
1035         * src/truetype/ttinterp.c (Ins_GETINFO): Updated.
1036         (TT_RunIns): Update `backward_compatibility' flag.
1037
1038 2017-05-20  Alexei Podtelezhnikov  <apodtele@gmail.com>
1039
1040         [smooth] Implement minimal dynamic padding for LCD filtering.
1041
1042         Extra bitmap padding for LCD filtering depends on the filter.  The
1043         default 5-tap filter needs 2 extra subpixels.  The light 3-tap filter
1044         needs only 1 extra subpixel.  This space could be already available
1045         due to rounding.  In order to optimize the padding, we now expand
1046         CBox for the given filter weights before rounding.
1047
1048         This change breaks current Skia (and Firefox).
1049
1050         * include/freetype/internal/ftobjs.h (FT_LibraryRec)
1051         [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Remove `lcd_extra' field.
1052
1053         * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights,
1054         FT_Library_SetLcdFilter): Remove `lcd_extra' initializations.
1055
1056         * src/smooth/ftsmooth.c (ft_smooth_render_generic): Implement dymanic
1057         LCD padding.
1058
1059 2017-05-15  Werner Lemberg  <wl@gnu.org>
1060
1061         [sfnt] Return proper scaling values for SBIX bitmaps.
1062
1063         Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
1064
1065         * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it.
1066
1067 2017-05-15  Werner Lemberg  <wl@gnu.org>
1068
1069         [truetype] Fix error handling for embedded bitmaps.
1070
1071         Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
1072
1073         * src/truetype/ttgload.c (TT_Load_Glyph)
1074         [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Handle error if font is not
1075         scalable.
1076
1077 2017-05-15  Alexei Podtelezhnikov  <apodtele@gmail.com>
1078
1079         [autofit] Make autohint warping NORMAL option.
1080
1081         This moves warping option from LIGHT to NORMAL mode.  This makes LIGHT
1082         truly void of hinting in x-direction, with left side bearing never
1083         changed and right side bearing only altered by advance rounding.
1084         Therefore, LIGHT is now ready to return fractional advance.  As a
1085         NORMAL option, warping substitutes normal hinting.
1086
1087         * src/autofit/afcjk.c (af_cjk_hints_apply): Updated.
1088         * src/autofit/aflatin.c (af_latin_hints_apply): Updated.
1089         * src/autofit/aflatin2.c (af_latin2_hints_apply): Updated.
1090
1091         * src/autofit/afloader.c (af_loader_load_glyph): Handle warping
1092         phantom points as normal.
1093
1094 2017-05-14  Werner Lemberg  <wl@gnu.org>
1095
1096         Remove remnants of raster pool.
1097
1098         * include/freetype/internal/ftobjs.h (FT_LibraryRec): Remove
1099         `raster_pool' and `raster_pool_size' fields.
1100
1101         * src/base/ftobjs.c (FT_New_Library), src/raster/ftrend1.c
1102         (ft_raster1_init), src/smooth/ftsmooth.c (ft_smooth_init): Updated.
1103
1104 2017-05-13  Werner Lemberg  <wl@gnu.org>
1105
1106         * Version 2.8 released.
1107         =======================
1108
1109
1110         Tag sources with `VER-2-8'.
1111
1112         * docs/VERSION.TXT: Add entry for version 2.8.
1113         * docs/CHANGES: Updated.
1114
1115         * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
1116         builds/windows/vc2005/index.html,
1117         builds/windows/vc2008/freetype.vcproj,
1118         builds/windows/vc2008/index.html,
1119         builds/windows/vc2010/freetype.vcxproj,
1120         builds/windows/vc2010/index.html,
1121         builds/windows/visualc/freetype.dsp,
1122         builds/windows/visualc/freetype.vcproj,
1123         builds/windows/visualc/index.html,
1124         builds/windows/visualce/freetype.dsp,
1125         builds/windows/visualce/freetype.vcproj,
1126         builds/windows/visualce/index.html,
1127         builds/wince/vc2005-ce/freetype.vcproj,
1128         builds/wince/vc2005-ce/index.html,
1129         builds/wince/vc2008-ce/freetype.vcproj,
1130         builds/wince/vc2008-ce/index.html: s/2.7.1/2.8/, s/271/28/.
1131
1132         * include/freetype/freetype.h (FREETYPE_MINOR): Set to 8.
1133         (FREETYPE_PATCH): Set to 0.
1134
1135         * builds/unix/configure.raw (version_info): Set to 20:0:14.
1136         * CMakeLists.txt (VERSION_MINOR): Set to 8.
1137         (VERSION_PATCH): Set to 0.
1138
1139 2017-05-12  Hin-Tak Leung  <htl10@users.sourceforge.net>
1140
1141         Fix `FT_UINT_TO_POINTER' macro for Windows.
1142
1143         * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
1144         include/freetype/config/ftconfig.h (FT_UINT_TO_POINTER) [_WIN64]:
1145         Fix definition.
1146
1147 2017-05-11  Sascha Brawer  <sascha@google.com>
1148             Werner Lemberg  <wl@gnu.org
1149
1150         [autofit] Add support for Chakma script.
1151
1152         * src/autofit/afblue.dat: Add blue zone data for Chakma.
1153         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1154
1155         * src/autofit/afscript.h: Add Chakma standard character.
1156
1157         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Chakma data.
1158
1159 2017-05-10  Sascha Brawer  <sascha@google.com>
1160             Werner Lemberg  <wl@gnu.org
1161
1162         [autofit] Add support for Kayah Li script.
1163
1164         * src/autofit/afblue.dat: Add blue zone data for Kayah Li.
1165         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1166
1167         * src/autofit/afscript.h: Add Kayah Li standard character.
1168
1169         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Kayah Li data.
1170
1171 2017-05-10  Sascha Brawer  <sascha@google.com>
1172             Werner Lemberg  <wl@gnu.org
1173
1174         [autofit] Add support for Bamum script.
1175
1176         * src/autofit/afblue.dat: Add blue zone data for Bamum.
1177         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1178
1179         * src/autofit/afscript.h: Add Bamum standard character.
1180
1181         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Bamum data.
1182
1183 2017-05-10  Sascha Brawer  <sascha@google.com>
1184             Werner Lemberg  <wl@gnu.org
1185
1186         [autofit] Add support for Saurashtra script.
1187
1188         * src/autofit/afblue.dat: Add blue zone data for Saurashtra.
1189         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1190
1191         * src/autofit/afscript.h: Add Saurashtra standard character.
1192
1193         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Saurashtra
1194         data.
1195
1196 2017-05-10  Sascha Brawer  <sascha@google.com>
1197             Werner Lemberg  <wl@gnu.org
1198
1199         [autofit] Add support for Buhid script.
1200
1201         * src/autofit/afblue.dat: Add blue zone data for Buhid.
1202         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1203
1204         * src/autofit/afscript.h: Add Buhid standard character.
1205
1206         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Buhid data.
1207
1208 2017-05-08  Sascha Brawer  <sascha@google.com>
1209             Werner Lemberg  <wl@gnu.org
1210
1211         [autofit] Add support for Shavian script.
1212
1213         * src/autofit/afblue.dat: Add blue zone data for Shavian.
1214         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1215
1216         * src/autofit/afscript.h: Add Shavian standard character.
1217
1218         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Shavian data.
1219
1220 2017-05-08  Sascha Brawer  <sascha@google.com>
1221             Werner Lemberg  <wl@gnu.org
1222
1223         [autofit] Add support for Vai script.
1224
1225         * src/autofit/afblue.dat: Add blue zone data for Vai.
1226         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1227
1228         * src/autofit/afscript.h: Add Vai standard character.
1229
1230         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Vai data.
1231
1232 2017-05-08  Sascha Brawer  <sascha@google.com>
1233             Werner Lemberg  <wl@gnu.org
1234
1235         [autofit] Add support for Osmanya script.
1236
1237         * src/autofit/afblue.dat: Add blue zone data for Osmanya.
1238         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1239
1240         * src/autofit/afscript.h: Add Osmanya standard character.
1241
1242         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Osmanya data.
1243
1244 2017-05-08  Sascha Brawer  <sascha@google.com>
1245             Werner Lemberg  <wl@gnu.org
1246
1247         [autofit] Add support for Coptic script.
1248
1249         * src/autofit/afblue.dat: Add blue zone data for Coptic.
1250         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1251
1252         * src/autofit/afscript.h: Add Coptic standard character.
1253
1254         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Coptic data.
1255
1256 2017-05-08  Sascha Brawer  <sascha@google.com>
1257             Werner Lemberg  <wl@gnu.org
1258
1259         [autofit] Add support for Carian script.
1260
1261         * src/autofit/afblue.dat: Add blue zone data for Carian.
1262         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1263
1264         * src/autofit/afscript.h: Add Carian standard character.
1265
1266         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Carian data.
1267
1268 2017-05-07  Werner Lemberg  <wl@gnu.org>
1269
1270         [truetype] Add tricky font `DFGirl-W6-WIN-BF' (from Dynalab).
1271
1272         Reported by Roy Tam <roytam@gmail.com>.
1273
1274         * src/truetype/ttobjs.c (tt_check_trickyness_family): Implement it.
1275
1276 2017-05-07  Roy Tam  <roytam@gmail.com>
1277             Werner Lemberg  <wl@gnu.org>
1278
1279         [truetype] More tricky fonts (mainly from Dynalab).
1280
1281         * src/truetype/ttobjs.c (tt_check_trickyness_family,
1282         tt_check_trickyness_sfnt_ids): Add them.
1283
1284 2017-05-07  Werner Lemberg  <wl@gnu.org>
1285
1286         [truetype] Add tricky font `DLCHayMedium' (from Dynalab).
1287
1288         Reported by Roy Tam <roytam@gmail.com>.
1289
1290         * src/truetype/ttobjs.c (tt_check_trickyness_family): Implement it.
1291
1292 2017-05-03  Werner Lemberg  <wl@gnu.org>
1293
1294         */*: s/backwards compatibility/backward compatibility/.
1295
1296 2017-05-03  Sascha Brawer  <sascha@google.com>
1297             Werner Lemberg  <wl@gnu.org
1298
1299         [autofit] Add support for Unified Canadian Syllabics script.
1300
1301         * src/autofit/afblue.dat: Add blue zone data for Unified Canadian
1302         Syllabics.
1303         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1304
1305         * src/autofit/afscript.h: Add Unified Canadian Syllabics standard
1306         character.
1307
1308         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Unified
1309         Canadian Syllabics data.
1310
1311 2017-05-03  Sascha Brawer  <sascha@google.com>
1312             Werner Lemberg  <wl@gnu.org>
1313
1314         [autofit] Add blue-zone support for Sundanese script.
1315
1316         This essentially moves the Sundanese script from the `Indic' hinter
1317         to the `Latin' hinter.
1318
1319         * src/autofit/afblue.dat: Add blue zone data for Sundanese.
1320
1321         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1322
1323         * src/autofit/afscript.h: Add Sundanese standard character and move
1324         data out of AF_CONFIG_OPTION_INDIC block.
1325
1326         * src/autofit/afranges.c: Move Sundanese data out of
1327         AF_CONFIG_OPTION_INDIC block.
1328
1329         * src/autofit/afstyles.h: Update Sundanese data; in particular, use
1330         AF_WRITING_SYSTEM_LATIN.
1331
1332 2017-05-03  Sascha Brawer  <sascha@google.com>
1333             Werner Lemberg  <wl@gnu.org
1334
1335         [autofit] Add support for Avestan script.
1336
1337         * src/autofit/afblue.dat: Add blue zone data for Avestan.
1338         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1339
1340         * src/autofit/afscript.h: Add Avestan standard character.
1341
1342         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Avestan data.
1343
1344 2017-05-02  Behdad Esfahbod  <behdad@behdad.org>
1345
1346         [truetype] Make `IUP' gvar deltas do the same as Apple (#50832).
1347
1348         When points are not touched by gvar interpolation deltas, FreeType
1349         gave a slightly different result than Apple's CoreText.
1350
1351         The OpenType working group will update the specification to document
1352         the following behaviour: If the two points with deltas to the `left'
1353         and `right' of the untouched point have the same coordinate, then
1354         the inferred delta for the untouched point should be zero.
1355
1356         * src/truetype/ttgxvar.c (tt_delta_interpolate): Implement new
1357         behaviour.
1358
1359 2017-05-02  Werner Lemberg  <wl@gnu.org>
1360
1361         [autofit] Remove `slight' auto-hint mode again.
1362
1363         A poll on freetype-devel favoured changes directly applied to
1364         `light'.
1365
1366         * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT,
1367         FT_RENDER_MODE_SLIGHT): Removed.
1368
1369         * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
1370         (af_latin_hints_init), src/autofit/aflatin2.c
1371         (af_latin2_hints_init): Revert change from 2017-04-22.
1372
1373         * src/autofit/afloader.c (af_loader_load_glyph) Remove references to
1374         FT_RENDER_MODE_SLIGHT.
1375         [AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics
1376         unconditionally.
1377
1378         * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from
1379         2017-04-22.
1380
1381         * src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22.
1382
1383         * src/pshinter/pshalgo.c (ps_hints_apply): Revert change from
1384         2017-04-22.
1385
1386         * src/smooth/ftsmooth.c (ft_smooth_render): Revert change from
1387         2017-04-22.
1388
1389         * docs/CHANGES: Updated.
1390
1391 2017-04-30  Werner Lemberg  <wl@gnu.org>
1392
1393         [autofit] Fix metrics computation.
1394
1395         Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de> and
1396         Nikolaus Waxweiler <madigens@gmail.com>.
1397
1398         * src/base/ftobjs.c (FT_Request_Size): Trigger recomputation of
1399         auto-hinter metrics.  Without this change, multiple size changing
1400         calls for a single face fail.
1401
1402 2017-04-29  Werner Lemberg  <wl@gnu.org>
1403
1404         * src/truetype/ttdriver.c (tt_size_request): Properly check `error'.
1405
1406         Reported by Earnestly <zibeon@googlemail.com> in
1407
1408           https://lists.nongnu.org/archive/html/freetype/2017-04/msg00031.html
1409
1410 2017-04-27  Werner Lemberg  <wl@gnu.org>
1411
1412         Introduce AF_CONFIG_OPTION_TT_SIZE_METRICS configuration option.
1413
1414         * include/freetype/config/ftoption.h
1415         (AF_CONFIG_OPTION_TT_SIZE_METRICS): New option, commented out by
1416         default.
1417
1418         * src/autofit/afloader.c (af_loader_load_glyph): Use
1419         AF_CONFIG_OPTION_TT_SIZE_METRICS to guard the corresponding code.
1420
1421 2017-04-26  Werner Lemberg  <wl@gnu.org>
1422
1423         * include/freetype/freetype.h (FT_Render_Mode): Fix order.
1424
1425         This retains backward compatibility.
1426
1427         Noted by Alexei.
1428
1429 2017-04-22  Werner Lemberg  <wl@gnu.org>
1430
1431         [truetype] Do linear scaling for FT_LOAD_NO_HINTING (#50470).
1432
1433         * src/truetype/ttobjs.h (TT_SizeRec): Add field `hinted_metrics' to
1434         hold hinted metrics.
1435         Make `metrics' a pointer so that `tt_glyph_load' can easily switch
1436         between metrics.
1437
1438         * src/truetype/ttdriver.c (tt_size_request): Updated.
1439         (tt_glyph_load): Use top-level metrics if FT_LOAD_NO_HINTING is
1440         used.
1441
1442         * src/truetype/ttgload.c (TT_Hint_Glyph, TT_Process_Simple_Glyph,
1443         TT_Process_Composite_Component, load_truetype_glyph,
1444         compute_glyph_metrics, TT_Load_Glyph): Updated.
1445
1446         * src/truetype/ttinterp.c (TT_Load_Context): Updated.
1447
1448         * src/truetype/ttobjs.c (tt_size_reset): Updated.
1449
1450         * src/truetype/ttsubpix.c (sph_set_tweaks): Updated.
1451
1452 2017-04-22  Werner Lemberg  <wl@gnu.org>
1453
1454         Add new `slight' auto-hinting mode.
1455
1456         This mode uses fractional advance widths and doesn't scale glyphs
1457         horizontally, only applying vertical scaling and hinting.
1458
1459         At the same time, the behaviour of the `light' auto-hinter gets
1460         restored for backward compatibility: Both vertical and horizontal
1461         scaling is again based on rounded metrics values (this was changed
1462         in a commit from 2017-03-30 as a side effect).  To be more precise,
1463         the behaviour is restored for TrueType fonts only; for other font
1464         formats like Type 1, this is a new feature of the `light' hinting
1465         mode.
1466
1467         * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT): New macro.
1468         (FT_RENDER_MODE_SLIGHT): New render mode.
1469
1470         * include/freetype/internal/ftobjs.h (FT_Size_InternalRec): Add
1471         `autohint_mode' and `autohint_metrics' fields.
1472
1473         * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
1474         (af_latin_hints_init), src/autofit/aflatin2 (af_latin2_hints_init):
1475         Updated.
1476
1477         * src/autofit/afloader.c (af_loader_embolden_glyph_in_slot): Use
1478         `autohint_metrics'.
1479         (af_loader_load_glyph): s/internal/slot_internal/.
1480         Initialize `autohint_metrics' and `autohint_mode' depending on
1481         current auto-hint mode.
1482         Use `autohint_metrics'.
1483         Updated.
1484
1485         * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Updated.
1486
1487         * src/base/ftobjs.c (FT_Load_Glyph): Updated.
1488         (FT_New_Size): Allocate `internal' object.
1489
1490         * src/pshinter/pshalgo.c (ps_hints_apply): Updated.
1491
1492         * src/smooth/ftsmooth.c (ft_smooth_render): Updated.
1493
1494 2017-04-22  Werner Lemberg  <wl@gnu.org>
1495
1496         Introduce `FT_Size_InternalRec' structure.
1497
1498         We are going to extend this later on.
1499
1500         * include/freetype/internal/ftobjs.h (FT_Size_InternalRec): New
1501         structure with a single field `module_data'.
1502
1503         * src/base/ftobjs.c (FT_New_Size): Allocate `internal' field of
1504         `FT_Size' structure.
1505
1506         * src/cff/cffgload.c (cff_builder_init, cff_decoder_prepare): Use
1507         `size->internal->module_data' instead of `size->internal'.
1508
1509         * src/cff/cffobjs.c (cff_size_done): Deallocate `module_data'.
1510         (cff_size_init, cff_size_select, cff_size_request): Use
1511         `size->internal->module_data' instead of `size->internal'.
1512
1513         * src/cif/cidobjs.c (cid_size_done, cid_size_init,
1514         cid_size_request): Use `size->internal->module_data' instead of
1515         `size->internal'.
1516
1517         * src/psaux/psobjs.c (t1_builder_ini): Use
1518         `size->internal->module_data' instead of `size->internal'.
1519
1520         * src/type1/t1objs.c (T1_Size_Done, T1_Size_Init, T1_Size_Request):
1521         Use `size->internal->module_data' instead of `size->internal'.
1522
1523 2017-04-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
1524
1525         * src/smooth/ftsmooth.h: Remove unused guards and declaration.
1526
1527 2017-04-16  Hin-Tak Leung  <htl10@users.sourceforge.net>
1528
1529         Fix tracing messages.
1530
1531         * src/base/ftobjs.c (FT_Face_GetCharVariantIndex,
1532         FT_Face_GetCharVariantIsDefault, FT_Face_GetVariantsOfChar): Print
1533         correct function name.
1534
1535 2017-04-08  Sascha Brawer  <sascha@google.com>
1536             Werner Lemberg  <wl@gnu.org
1537
1538         [autofit] Add support for Old Turkic script.
1539
1540         * src/autofit/afblue.dat: Add blue zone data for Old Turkic.
1541         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1542
1543         * src/autofit/afscript.h: Add Old Turkic standard characters.
1544
1545         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Old Turkic data.
1546
1547 2017-04-08  Sascha Brawer  <sascha@google.com>
1548             Werner Lemberg  <wl@gnu.org
1549
1550         [autofit] Add support for Gothic script.
1551
1552         * src/autofit/afblue.dat: Add blue zone data for Gothic.
1553         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1554
1555         * src/autofit/afscript.h: Add Gothic standard characters.
1556
1557         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Gothic data.
1558
1559 2017-04-08  Sascha Brawer  <sascha@google.com>
1560             Werner Lemberg  <wl@gnu.org
1561
1562         [autofit] Add support for Cypriot script.
1563
1564         * src/autofit/afblue.dat: Add blue zone data for Cypriot.
1565         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1566
1567         * src/autofit/afscript.h: Add Cypriot standard characters.
1568
1569         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Cypriot data.
1570
1571 2017-04-08  Sascha Brawer  <sascha@google.com>
1572             Werner Lemberg  <wl@gnu.org
1573
1574         [autofit] Add support for Deseret script.
1575
1576         * src/autofit/afblue.dat: Add blue zone data for Deseret.
1577         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1578
1579         * src/autofit/afscript.h: Add Deseret standard characters.
1580
1581         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Deseret data.
1582
1583 2017-04-07  Werner Lemberg  <wl@gnu.org>
1584
1585         [autofit] Fix invalid character range description (#50745).
1586
1587         Also reported as
1588
1589           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1034
1590
1591         * src/autofit/afranges.c (af_glag_nonbase_uniranges): Fix typo in
1592         recent commit.
1593
1594 2017-04-07  Werner Lemberg  <wl@gnu.org>
1595
1596         [ftfuzzer] Fix clang warnings.
1597
1598         * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Add
1599         casts.
1600
1601 2017-04-06  Sascha Brawer  <sascha@google.com>
1602             Werner Lemberg  <wl@gnu.org
1603
1604         [autofit] Add support for Lisu script.
1605
1606         * src/autofit/afblue.dat: Add blue zone data for Lisu.
1607         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1608
1609         * src/autofit/afscript.h: Add Lisu standard characters.
1610
1611         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Lisu data.
1612
1613 2017-04-06  Sascha Brawer  <sascha@google.com>
1614             Werner Lemberg  <wl@gnu.org
1615
1616         [autofit] Add support for Osage script.
1617
1618         * src/autofit/afblue.dat: Add blue zone data for Osage.
1619         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1620
1621         * src/autofit/afscript.h: Add Osage standard characters.
1622
1623         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Osage data.
1624
1625 2017-04-06  Sascha Brawer  <sascha@google.com>
1626             Werner Lemberg  <wl@gnu.org
1627
1628         [autofit] Add support for Glagolitic script.
1629
1630         * src/autofit/afblue.dat: Add blue zone data for Glagolitic.
1631         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1632
1633         * src/autofit/afscript.h: Add Glagolitic standard characters.
1634
1635         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Glagolitic data.
1636
1637 2017-04-06  Sascha Brawer  <sascha@google.com>
1638             Werner Lemberg  <wl@gnu.org
1639
1640         [autofit] Add support for Tai Viet script.
1641
1642         * src/autofit/afblue.dat: Add blue zone data for Tai Viet.
1643         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1644
1645         * src/autofit/afscript.h: Add Tai Viet standard characters.
1646
1647         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Tai Viet data.
1648
1649 2017-04-06  Sascha Brawer  <sascha@google.com>
1650             Werner Lemberg  <wl@gnu.org
1651
1652         [autofit] Add support for Tifinagh script.
1653
1654         * src/autofit/afblue.dat: Add blue zone data for Tifinagh.
1655         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1656
1657         * src/autofit/afscript.h: Add Tifinagh standard characters.
1658
1659         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Tifinagh data.
1660
1661 2017-04-06  Sascha Brawer  <sascha@google.com>
1662             Werner Lemberg  <wl@gnu.org
1663
1664         [autofit] Add support for N'Ko script.
1665
1666         * src/autofit/afblue.dat: Add blue zone data for N'Ko.
1667         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1668
1669         * src/autofit/afscript.h: Add N'Ko standard characters.
1670
1671         * src/autofit/afranges.c, src/autofit/afstyles.h: Add N'Ko data.
1672
1673 2017-04-06  Sascha Brawer  <sascha@google.com>
1674
1675         [autofit] Add support for Adlam script.
1676
1677         * src/autofit/afblue.dat: Add blue zone data for Adlam.
1678         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1679
1680         * src/autofit/afscript.h: Add Adlam standard characters.
1681
1682         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Adlam data.
1683
1684 2017-04-06  Sascha Brawer  <sascha@google.com>
1685
1686         [autofit] Add support for Ol Chiki script.
1687
1688         * src/autofit/afblue.dat: Add blue zone data for Ol Chiki.
1689         * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
1690
1691         * src/autofit/afscript.h: Add Ol Chiki standard character.
1692
1693         * src/autofit/afranges.c, src/autofit/afstyles.h: Add Ol Chiki data.
1694
1695 2017-04-03  Werner Lemberg  <wl@gnu.org>
1696
1697         [truetype] Avoid reexecution of `fpgm' and `prep' in case of error.
1698
1699         Reported as
1700
1701           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=981
1702
1703         * include/freetype/fterrdef.h (FT_Err_DEF_In_Glyf_Bytecode): New
1704         error code.
1705
1706         * src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Prohibit execution
1707         of these two opcodes in `glyf' bytecode.
1708         (TT_RunIns): Don't enforce reexecution of `fpgm' and `prep' bytecode
1709         in case of error since function tables can no longer be modified
1710         (due to the changes in `Ins_FDEF' and `Ins_IDEF').  This change can
1711         enormously speed up handling of broken fonts.
1712
1713 2017-04-02  Alexei Podtelezhnikov  <apodtele@gmail.com>
1714
1715         [autofit] Disable metrics adjustment for `FT_LOAD_TARGET_LCD'.
1716
1717         * src/autofit/aflatin.c (af_latin_hints_init): Updated.
1718         * src/autofit/aflatin2.c (af_latin2_hints_init): Ditto.
1719
1720 2017-04-01  Werner Lemberg  <wl@gnu.org>
1721
1722         * src/truetype/ttgload.c: Include FT_CONFIG_CONFIG_H.
1723
1724         Otherwise FT_UINT_TO_POINTER might not be defined.
1725
1726         Problem reported by Alexei.
1727
1728 2017-03-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
1729
1730         [autofit] Disable stem adjustment for `FT_LOAD_TARGET_LCD'.
1731
1732         * include/freetype/freetype.h (FT_LOAD_TARGET_LCD): Document it.
1733         * src/autofit/afcjk.c (af_cjk_hints_init): Updated.
1734         * src/autofit/aflatin.c (af_latin_hints_init): Ditto.
1735         * src/autofit/aflatin2.c (af_latin2_hints_init): Ditto.
1736
1737 2017-03-31  Werner Lemberg  <wl@gnu.org>
1738
1739         * src/cff/cffload.c (cff_font_load): Improve fix from 2017-01-04.
1740
1741         Allow CFFs containing a single font to have an empty font name.
1742
1743         Problem reported by 張俊芝 <418092625@qq.com> in
1744
1745           https://lists.nongnu.org/archive/html/freetype-devel/2017-03/msg00074.html
1746
1747 2017-03-30  Werner Lemberg  <wl@gnu.org>
1748
1749         * src/cff/cffparse.h (CFF2_DEFAULT_STACK): Set to 513 also.
1750
1751         Requested by Dave Arnold.
1752
1753 2017-03-30  Werner Lemberg  <wl@gnu.org>
1754
1755         [truetype] Fix HVAR and VVAR handling (#50678).
1756
1757         * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Handle
1758         glyph indices larger than `mapCount' as described in the
1759         specification.
1760
1761 2017-03-30  Werner Lemberg  <wl@gnu.org>
1762
1763         [truetype] Allow linear scaling for unhinted rendering (#50470).
1764
1765         * src/truetype/ttdriver.c (tt_size_request): Revert change from
1766         2011-07-16; the intended metrics fix seems now to be implemented in
1767         a different way, making the patch unnecessary.  Note that this
1768         change was usually patched out by all major GNU/Linux distributions
1769         due to heavy side effects.
1770
1771         * src/truetype/ttgload.c (compute_glyph_metrics, TT_Load_Glyph):
1772         Refer to the metrics of the `TT_Size' object.
1773
1774 2017-03-29  Werner Lemberg  <wl@gnu.org>
1775
1776         [truetype] Fix thinko related to PS name of default named instance.
1777
1778         * src/truetype/ttgxvar.c (TT_Get_MM_Var): `strid' and `psid' are
1779         name ID values, not indices into the array of name entries.
1780
1781 2017-03-27  Werner Lemberg  <wl@gnu.org>
1782
1783         [cid, truetype] Don't use `index' as a variable name.
1784
1785         At least on FreeBSD there is a global declaration of `index' in file
1786         `/usr/include/strings.h'.
1787
1788         * src/cff/cf2intrp.c, src/truetype/ttgload.c: s/index/idx/ where
1789         appropriate.
1790
1791 2017-03-27  Wojciech Mamrak  <wmamrak@gmail.com>
1792
1793         [sfnt] Minor improvement for handling kern tables.
1794
1795         * src/sfnt/ttkern.c (tt_face_load_kern): Don't check for
1796         cross-stream kerning tables since we reject format 2 tables later
1797         on anyways.
1798         Modify code for limit test...
1799         (tt_face_get_kerning): ... to avoid a limit test here.
1800
1801 2017-03-27  Werner Lemberg  <wl@gnu.org>
1802
1803         [pcf] Fix compiler warnings.
1804
1805         Reported by Alexander Hedges <ahedges@student.ethz.ch>.
1806
1807         * src/pcf/pcfdrivr.c (pcf_property_set, pcf_property_get): Tag
1808         `property_name' with `FT_UNUSED' where necessary.
1809
1810 2017-03-26  Werner Lemberg  <wl@gnu.org>
1811
1812         * src/psaux/psobjs.c (t1_builder_close_contour): Add safety guard.
1813
1814         Reported as
1815
1816           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=941
1817
1818 2017-03-23  Werner Lemberg  <wl@gnu.org>
1819
1820         [psaux] Better protect `flex' handling.
1821
1822         Reported as
1823
1824           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=935
1825
1826         * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
1827         <callothersubr>: Since there is not a single flex operator but a
1828         series of subroutine calls, malformed fonts can call arbitrary other
1829         operators after the start of a flex, possibly adding points.  For
1830         this reason we have to check the available number of points before
1831         inserting a point.
1832
1833 2017-03-23  Werner Lemberg  <wl@gnu.org>
1834
1835         [sfnt] Fix check for default named instance.
1836
1837         * src/sfnt/sfobjs.c (sfnt_init_face): A `fixed' number needs four
1838         bytes, not two...
1839
1840 2017-03-23  Werner Lemberg  <wl@gnu.org>
1841
1842         Make MM fonts work (again).
1843
1844         * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
1845         FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Ignore
1846         return value of `ft_face_get_mvar_service'; instead, check whether a
1847         service is actually returned.
1848
1849 2017-03-20  Werner Lemberg  <wl@gnu.org>
1850
1851         [truetype] Some variable renamings.
1852
1853         Too much local variables holding different structures were called
1854         `metrics'.
1855
1856         * src/truetype/ttdriver.c (tt_size_select): s/metrics/size_metrics/.
1857
1858         * src/truetype/ttgload.c (tt_get_metrics_incr_overrides,
1859         compute_glyph_metrics): s/metrics/incr_metrics/.
1860         (load_sbit_image): s/metrics/sbit_metrics/.
1861
1862         * src/truetype/ttobjs.c (tt_size_run_fpgm): s/metrics/size_metrics/.
1863         (tt_size_init_bytecode): s/metrics/tt_metrics/.
1864         (tt_size_reset): s/metrics/size_metrics/.
1865
1866 2017-03-20  Werner Lemberg  <wl@gnu.org>
1867
1868         [sfnt] Don't add instances to non-variation fonts.
1869
1870         * src/sfnt/sfobjs.c (sfnt_init_face): Fix it.
1871
1872 2017-03-20  Werner Lemberg  <wl@gnu.org>
1873
1874         * src/cff/cffgload.c (cff_builder_init): Add safety guard (#50578).
1875
1876 2017-03-18  Werner Lemberg  <wl@gnu.org>
1877
1878         Introduce FT_UINT_TO_POINTER macro (#50560).
1879
1880         We have to make a separate case for Windows 64's LLP64 data model.
1881
1882         * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
1883         include/freetype/config/ftconfig.h (FT_UINT_TO_POINTER): New macro.
1884
1885         * src/truetype/ttgload.c (load_truetype_glyph): Use it.
1886
1887 2017-03-18  Werner Lemberg  <wl@gnu.org>
1888
1889         * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#50573).
1890
1891         The problematic font that exceeds the old limit is Lato-Regular,
1892         version 2.007, containing bytecode generated by a buggy version of
1893         ttfautohint.
1894
1895 2017-03-18  Werner Lemberg  <wl@gnu.org>
1896
1897         [truetype] Another limitation for bytecode loop count maximum.
1898
1899         Reported as
1900
1901           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=900
1902
1903         * src/truetype/ttinterp.c (TT_RunIns): Limit `loopcall_counter_max'
1904         by number of glyphs also.
1905
1906 2017-03-18  Werner Lemberg  <wl@gnu.org>
1907
1908         [ftfuzzer] Minor improvement.
1909
1910         * src/tools/ftfuzzer/ftfuzzer.cc: Don't set intermediate axis if
1911         bitmap strikes are active.
1912
1913 2017-03-18  Werner Lemberg  <wl@gnu.org>
1914
1915         Improve `make multi'.
1916
1917         * src/autofit/aflatin2.c: Guard file with FT_OPTION_AUTOFIT2.
1918
1919         * src/base/ftmac.c: Guard more parts of the file with FT_MACINTOSH.
1920
1921         * src/psaux/afmparse.c: Guard file with T1_CONFIG_OPTION_NO_AFM.
1922
1923         * src/sfnt/pngshim.c: Guard file with
1924         TT_CONFIG_OPTION_EMBEDDED_BITMAPS also.
1925
1926         * src/sfnt/ttbdf.c: Avoid empty source file.
1927         * src/sfnt/ttpost.c: Guard file with
1928         TT_CONFIG_OPTION_POSTSCRIPT_NAMES.
1929         * src/sfnt/ttsbit.c: Guard file with
1930         TT_CONFIG_OPTION_EMBEDDED_BITMAPS.
1931
1932         * src/truetype/ttgxvar.c, src/truetype/ttinterp.c: Avoid empty
1933         source file.
1934
1935         * src/truetype/ttsubpix.c: Guard file with
1936         TT_USE_BYTECODE_INTERPRETER also.
1937
1938         * src/type1/t1afm.c: Guard file with T1_CONFIG_OPTION_NO_AFM.
1939
1940         * src/autofit/autofit.c, src/base/ftbase.c, src/cache/ftcache.c,
1941         src/cff/cff.c, src/cid/type1cid.c, src/gxvalid/gxvalid.c,
1942         src/pcf/pcf.c, src/pfr/pfr.c, src/psaux/psaux.c,
1943         src/pshinter/pshinter.c, src/psnames/psnames.c, src/raster/raster.c,
1944         src/sfnt/sfnt.c, src/smooth/smooth.c, src/truetype/truetype.c,
1945         src/type1/type1.c, src/type42/type42.c: Remove conditionals; sort
1946         entries.
1947
1948 2017-03-17  Werner Lemberg  <wl@gnu.org>
1949
1950         Fixes for conditional compilation.
1951
1952         * src/autofit/afcjk.c, src/autofit/afindic.c: Include `afcjk.h'
1953         earlier.
1954
1955         * src/sfnt/sfobjs.c (sfnt_init_face): Put `memory' variable into
1956         TT_CONFIG_OPTION_GX_VAR_SUPPORT block.
1957         (sfnt_done_face): Protect some code with
1958         TT_CONFIG_OPTION_GX_VAR_SUPPORT.
1959
1960         * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Remove compiler
1961         warning.
1962
1963         * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Put `tmp' variable
1964         into TT_USE_BYTECODE_INTERPRETER block.
1965
1966         (tt_loader_init): Put `error' variable into
1967         TT_USE_BYTECODE_INTERPRETER block.
1968
1969 2017-03-17  Werner Lemberg  <wl@gnu.org>
1970
1971         Fix preprocessor warning.
1972
1973         * devel/ftoption.h, include/freetype/config/ftoption.h: Test whether
1974         TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined before checking its
1975         value.
1976
1977 2017-03-17  Werner Lemberg  <wl@gnu.org>
1978
1979         `make multi' fixes; compiler warnings.
1980
1981         * src/base/ftsnames.c: Include FT_INTERNAL_DEBUG_H.
1982
1983         * src/cff/cffobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
1984         FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H.
1985
1986         * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
1987         FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H.
1988         (get_win_string, get_apple_string): Initialize `result'.
1989
1990 2017-03-17  Dave Arnold <darnold@adobe.com>
1991
1992         [cff] Fix potential bugs in default NDV for CFF2.
1993
1994         * src/cff/cffload.c (cff_blend_build_vector): Explicitly build blend
1995         vector when `lenNDV' is zero; don't rely on zero-init.
1996         Save `lenNDV' as part of cache key even when `lenNDV' is zero.
1997
1998 2017-03-17  Dave Arnold <darnold@adobe.com>
1999
2000         [cff] Fix CFF2 stack allocation.
2001
2002         * src/cff/cffparse.c (cff_parser_init) add 1 for operator.
2003
2004 2017-03-16  Werner Lemberg  <wl@gnu.org>
2005
2006         * src/truetype/ttgxvar.c (tt_done_blend): Free `vvar_table'.
2007
2008         Reported as
2009
2010           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=883
2011
2012 2017-03-15  Werner Lemberg  <wl@gnu.org>
2013
2014         Remove clang compiler warnings (#50548).
2015
2016         * include/freetype/internal/tttypes.h (TT_FaceRec): Make
2017         `var_postscript_prefix_len' unsigned.
2018
2019         * src/autofit/afwarp.c (af_warper_compute_line_best): Remove
2020         redundant assignment.
2021
2022         * src/cff/cffload.c (cff_subfont_load): Add casts.
2023
2024         * src/cff/cffparse.c (cff_parse_blend): Remove redundant assignment.
2025
2026         * src/sfnt/sfdriver.c (fmix32, murmur_hash_3_128): Add `static'
2027         keyword.
2028         Add casts.
2029         (fixed2float): Add cast.
2030         (sfnt_get_var_ps_name): Make `p' always initialized.
2031         Add casts.
2032
2033         * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add casts.
2034
2035 2017-03-15  Werner Lemberg  <wl@gnu.org>
2036
2037         [ftfuzzer] Limit number of tested faces and instances.
2038
2039         This is inspired by the discussion in and analysis of
2040
2041           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=859
2042
2043         * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Use only
2044         up to 20 face indices.
2045         Use only up to 20 instance indices.
2046
2047 2017-03-15  Werner Lemberg  <wl@gnu.org>
2048
2049         * src/tools/ftfuzzer/ftfuzzer.cc: Improve readability; formatting.
2050
2051 2017-03-14  Werner Lemberg  <wl@gnu.org>
2052
2053         [sfnt] Implement PS names for font instances [3/3].
2054
2055         Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
2056
2057         * include/freetype/internal/tttypes.h (TT_FaceRec): New fields
2058         `var_postscript_prefix' and `var_postscript_prefix_len'.
2059
2060         * src/sfnt/sfdriver.c: Include FT_TRUETYPE_IDS_H.
2061         (sfnt_is_alphanumeric): New wrapperfunction for `ft_isalnum'.
2062         (get_win_string, get_apple_string): Remove `const' from return
2063         value.
2064         (MAX_VALUE_DESCRIPTOR_LEN, MAX_PS_NAME_LEN): New macros.
2065         (hexdigits): New array.
2066         (sfnt_get_var_ps_name): New function, implementing Adobe TechNote
2067         5902 to construct a PS name for a variation font instance.
2068         (sfnt_get_ps_name): Call `sfnt_get_var_ps_name' for font instances.
2069
2070         * src/sfnt/sfobjs.c (sfnt_done_face): Updated.
2071
2072         * src/truetype/ttgxvar.c (tt_set_mm_blend): Reset
2073         `face->postscript_name' to trigger recalculation for new instance
2074         parameters.
2075
2076 2017-03-14  Werner Lemberg  <wl@gnu.org>
2077
2078         [sfnt] Implement PS names for font instances [2/3].
2079
2080         * src/sfnt/sfdriver.c (fix2float) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
2081         New function to find the shortest representation of a 16.16
2082         fractional number.
2083
2084 2017-03-14  Werner Lemberg  <wl@gnu.org>
2085
2086         [sfnt] Implement PS names for font instances [1/3].
2087
2088         Add 128bit MurmurHash 3 function.
2089
2090         Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
2091
2092         * src/sfnt/sfdriver.c (ROTL32): New macro.
2093         (fmix32, murmur_hash_3_128): New functions.
2094
2095 2017-03-13  Werner Lemberg  <wl@gnu.org>
2096
2097         [truetype] Ignore invalid MVAR tags.
2098
2099         Reported as
2100
2101           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=838
2102
2103         * src/truetype/ttgxvar.c (ft_var_load_mvar): Ignore value and emit
2104         warning for invalid tags.
2105         (tt_apply_mvar): Ignore invalid tags.
2106
2107 2017-03-12  Werner Lemberg  <wl@gnu.org>
2108
2109         [truetype] Store and use design coordinates also.
2110
2111         * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func):
2112         Add `normalizedcoords' argument.
2113
2114         * src/truetype/ttgxvar.h (GX_BlendRec): Add `coords' field to store
2115         the design coordinates of the current instance.
2116         Updated.
2117
2118         * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Move functionality to...
2119         (tt_set_mm_blend): ... New function.
2120         Convert data in `normalizedcoords' array to `coords' array on
2121         demand.
2122         (TT_Set_Var_Design): Store argument data in `coords' array.
2123         (TT_Get_Var_Design): Get data from `coords' array.
2124         (tt_get_var_blend): Updated.
2125         (tt_done_blend): Updated.
2126
2127         * src/cff/cffload.c, src/cff/cffload.h (cff_get_var_blend): Updated.
2128
2129         * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated.
2130
2131         * src/cff/cffobjs.c (cff_face_init): Updated.
2132
2133 2017-03-12  Werner Lemberg  <wl@gnu.org>
2134
2135         src/truetype/ttgxvar.[ch]: s/avar_checked/avar_loaded/.
2136
2137 2017-03-08  Werner Lemberg  <wl@gnu.org>
2138
2139         [sfnt] Another fix for buggy variation fonts.
2140
2141         Reported as
2142
2143           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=759
2144
2145         * src/sfnt/sfobjs.c (sfnt_init_face): While setting number of
2146         instances to zero for `CFF' fonts table, ensure that there is no
2147         `CFF2' present also (which gets priority).
2148
2149 2017-03-07  Werner Lemberg  <wl@gnu.org>
2150
2151         [sfnt] Improve handling for buggy variation fonts.
2152
2153         Reported as
2154
2155           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=738
2156
2157         * src/sfnt/sfobjs.c (sfnt_init_face): While setting number of
2158         instances to zero for `CFF' fonts table, ensure that there is no
2159         `glyf' table present also (which gets priority).
2160
2161 2017-03-06  Werner Lemberg  <wl@gnu.org>
2162
2163         [sfnt, truetype] Always provide default instance.
2164
2165         As documented in the OpenType specification, an entry for the
2166         default instance may be omitted in the named instance table.  In
2167         particular this means that even if there is no named instance table
2168         in the font we actually do have a named instance, namely the default
2169         instance.
2170
2171         For consistency, we always want the default instance in our list of
2172         named instances.  If it is missing, we try to synthesize it.
2173
2174         * src/sfnt/sfobjs.c (sfnt_init_face): Check whether the default
2175         instance is in the table of named instances.  Otherwise adjust
2176         number of instances.
2177
2178         * src/truetype/ttgxvar.c: Include FT_TRUETYPE_IDS_H.
2179         (TT_Get_MM_Var): Use `face->root.style_flags' as the number of named
2180         instances.
2181         Sythesize a named instance entry if necessary.
2182         (tt_done_blend): Free `normalized_stylecoords'.
2183
2184 2017-03-05  Werner Lemberg  <wl@gnu.org>
2185
2186         [sfnt] Remove redundant code.
2187
2188         * src/sfnt/sfobjs.c (sfnt_init_face): Remove second test for
2189         `num_instances', which will always succeed.
2190
2191 2017-03-04  Werner Lemberg  <wl@gnu.org>
2192
2193         [sfnt] Add `get_name_id' service.
2194
2195         * include/freetype/internal/sfnt.h (TT_Get_Name_ID_Func): New
2196         typedef.
2197         (SFNT_Interface): Add `get_name_id' field.
2198         (FT_DEFINE_SFNT_INTERFACE): Updated.
2199
2200         * src/sfnt/sfdriver.c (search_name_id): Rename to...
2201         (sfnt_get_name_id): ... this.
2202         (sfnt_get_ps_name, sfnt_interface): Updated.
2203
2204 2017-03-04  Werner Lemberg  <wl@gnu.org>
2205
2206         [truetype] Make `TT_Set_MM_Blend' set named instance index.
2207
2208         * src/truetype/ttgxvar.h (GX_Blend): New array
2209         `normalized_stylecoords'.
2210
2211         * src/truetype/ttgxvar.c (TT_Get_MM_Var): Allocate and fill
2212         `normalized_stylecoords'.
2213         (TT_Set_MM_Blend): Check instance tuple and adjust `face_index'
2214         accordingly.
2215
2216 2017-03-02  Werner Lemberg  <wl@gnu.org>
2217
2218         [truetype] Split off designer/normalized conversion routines.
2219
2220         * src/truetype/ttgxvar.c (TT_Set_Var_Design): Split off conversion
2221         code designer->normalized coordinates to...
2222         (ft_var_to_normalized): ... New function.
2223         (TT_Get_Var_Design): Split off conversion code normalized->designer
2224         coordinates to...
2225         (ft_var_to_design): ... New function.
2226
2227 2017-02-28  Werner Lemberg  <wl@gnu.org>
2228
2229         [sfnt] Further generalize `sfnt_get_ps_name'; report invalid data.
2230
2231         * src/sfnt/sfdriver.c (sfnt_ps_map): New array.
2232         (sfnt_is_postscript): New function.
2233         (char_type_func): New typedef.
2234         (get_win_string, get_apple_string): Add argument to specify
2235         character checking function.
2236         Add argument whether argument checking failures should be reported.
2237         Update callers.
2238         (search_name_id): Fix return value.
2239
2240 2017-02-23  Werner Lemberg  <wl@gnu.org>
2241
2242         [sfnt] Split off another bit of `sfnt_get_ps_name'.
2243
2244         * src/sfnt/sfdriver.c (sfnt_get_ps_name): Split off some
2245         functionality into...
2246         (search_name_id): ... New function.
2247
2248 2017-02-23  Werner Lemberg  <wl@gnu.org>
2249
2250         [sfnt] Modularize `sfnt_get_ps_name'.
2251
2252         * src/sfnt/sfdriver.c (sfnt_get_ps_name): Split off some
2253         functionality into...
2254         (IS_WIN, IS_APPLE): ... New macros.
2255         (get_win_string, get_apple_string): ... New functions.
2256
2257 2017-02-23  Werner Lemberg  <wl@gnu.org>
2258
2259         [truetype] Minor improvement.
2260
2261         * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
2262         load_truetype_glyph): Remove unnecessary tests.
2263
2264 2017-02-23  Werner Lemberg  <wl@gnu.org>
2265
2266         * include/freetype/internal/tttypes.h (TT_Face): s/isCFF2/is_cff2/.
2267
2268         For orthogonality with other structure field names.
2269
2270         Update all users.
2271
2272 2017-02-22  Alexei Podtelezhnikov  <apodtele@gmail.com>
2273
2274         * src/smooth/ftgrays.c (gray_hline): Improve code.
2275
2276 2017-02-20  Dominik Röttsches  <drott@google.com>
2277
2278         Fix some `ttnameid.h' entries (#50313).
2279
2280         * include/freetype/ttnameid.h:
2281         s/TT_MS_LANGID_SPANISH_INTERNATIONAL_SORT/TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT/,
2282         s/TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIA/TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN/.
2283
2284 2017-02-20  Werner Lemberg  <wl@gnu.org>
2285
2286         [cff] Finish support for `random' operator.
2287
2288         * src/cff/cfftypes.h (CFF_SubFontRec): Add `random' field.
2289
2290         * src/cff/cffobjs.c: Updated.
2291         (cff_driver_init): Initialize random seed value.
2292
2293         * src/cff/cffload.c (cff_random): New function.
2294         (cff_subfont_load): Add `face' argument.
2295         Update all callers.
2296         Initialize random number generator with a proper seed value.
2297         (cff_font_load): Add `face' argument.
2298         Update all callers.
2299
2300         * src/cff/cffload.h: Updated.
2301
2302         * src/cff/cf2intrp.c (CF2_FIXME): Removed.
2303         (cf2_interpT2CharString) <cf2_escRANDOM>: Implement opcode.
2304
2305         * src/cff/cffgload.c (cff_decoder_parse_charstrings): Don't
2306         initialize random seed value.
2307         <cff_op_random>: Use new random seed framework.
2308
2309 2017-02-20  Werner Lemberg  <wl@gnu.org>
2310
2311         [cff] Sanitize `initialRandomSeed'.
2312
2313         * src/cff/cffload.c (cff_load_private_dict): Make
2314         `initial_random_seed' value always positive.
2315
2316 2017-02-20  Werner Lemberg  <wl@gnu.org>
2317
2318         [cff] Introduce `random-seed' property (2/2).
2319
2320         * src/base/ftobjs.c: Include `FT_CFF_DRIVER_H'.
2321         (open_face): Initialize `face->internal->random_seed'.
2322         (FT_Face_Properties): Handle `FT_PARAM_TAG_RANDOM_SEED'.
2323
2324         * src/cff/cffdrivr.c (cff_property_set): Handle `random-seed'
2325         property.
2326
2327 2017-02-20  Werner Lemberg  <wl@gnu.org>
2328
2329         [cff] Introduce `random-seed' property (1/2).
2330
2331         We need this for support of the `random' operator.
2332
2333         * include/freetype/ftcffdrv.h (FT_PARAM_TAG_RANDOM_SEED): New macro.
2334
2335         * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
2336         field `random_seed'.
2337
2338         * src/cff/cffobjs.h (CFF_DriverRec): New field `random_seed'.
2339
2340 2017-02-17  Werner Lemberg  <wl@gnu.org>
2341
2342         Remove clang warnings.
2343
2344         * src/autofit/aflatin.c (af_latin_sort_blue): Add missing `static'
2345         keyword.
2346
2347         * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
2348         FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates):
2349         Initialize some variables.
2350
2351 2017-02-16  Nikolaus Waxweiler  <madigens@gmail.com>
2352             Werner Lemberg  <wl@gnu.org>
2353
2354         Add face property for stem darkening.
2355
2356         * include/freetype/ftautoh.h (FT_PARAM_TAG_STEM_DARKENING): New
2357         macro.
2358
2359         * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Add
2360         `no_stem_darkening' field.
2361
2362         * src/autofit/afloader.c (af_loader_load_glyph),
2363         src/autofit/afmodule.c (af_property_set): Updated.
2364
2365         * src/base/ftobjs.c: Include FT_AUTOHINTER_H.
2366         (ft_open_face_internal): Updated.
2367         (FT_Face_Properties): Handle FT_PARAM_TAG_STEM_DARKENING.
2368
2369         * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Updated.
2370
2371         * src/cff/cffdrivr.c (cff_property_set): Updated.
2372
2373 2017-02-16  Nikolaus Waxweiler  <madigens@gmail.com>
2374             Werner Lemberg  <wl@gnu.org>
2375
2376         Add face property for LCD filter weights.
2377
2378         * include/freetype/ftlcdfil.h (FT_PARAM_TAG_LCD_FILTER_WEIGHTS,
2379         FT_LCD_FILTER_FIVE_TAPS): New macros.
2380         (FT_LcdFiveTapFilter): New typedef.
2381
2382         * include/freetype/ftobjs.h (FT_Face_InternalRec)
2383         [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add `lcd_weights' field.
2384         (FT_Bitmap_LcdFilterFunc): Change third argument to weights array.
2385         (ft_lcd_filter_fir): New prototype.
2386         (FT_LibraryRec): Updated.
2387
2388         * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Renamed to...
2389         (ft_lcd_filter_fir): ... this base function.
2390         Updated.
2391         (_ft_lcd_filter_legacy): Updated.
2392         (FT_Library_SetLcdFilterWeights, FT_Library_SetLcdFilter): Updated.
2393
2394         * src/base/ftobjs.c (ft_open_face_internal): Updated.
2395         (FT_Face_Properties): Handle FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
2396
2397         * src/smooth/ftsmooth.c (ft_smooth_render_generic)
2398         [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Handle LCD weights from
2399         `FT_Face_Internal'.
2400
2401 2017-02-14  Nikolaus Waxweiler  <madigens@gmail.com>
2402             Werner Lemberg  <wl@gnu.org>
2403
2404         Add new function `FT_Face_Properties'.
2405
2406         This commit provides the framework, to be filled with something
2407         useful in the next commits.
2408
2409         * include/freetype/freetype.h (FT_Face_Properties): Declare.
2410
2411         * src/base/ftobjs.c (FT_Face_Properties): New function.
2412
2413 2017-02-13  Werner Lemberg  <wl@gnu.org>
2414
2415         [autofit] Prevent overlapping blue zones.
2416
2417         Problem reported as
2418
2419           https://github.com/google/fonts/issues/632
2420
2421         The font in question (Nunito) has values 705 and 713 for the
2422         reference and overshoot values, respectively, of the first blue
2423         zone.  Blue zone 2, however, has value 710 for both the reference
2424         and overshoot.  At 12ppem, reference and overshoot of blue zone 0
2425         becomes 8px, while blue zone 2 becomes 9px.
2426
2427         A peculiarity of this font is that the tops of isolated vertical
2428         stems like `N' have a slight overshoot also.  The auto-hinter tries
2429         to find the nearest blue zone using the *original* coordinates.  For
2430         vertical stems, this is value 713.  For normal horizontal tops like
2431         in character `E', this is value 710.  Since value 713 is mapped to
2432         8px but value 710 to 9px, `N' and similar characters are one pixel
2433         higher than `E', which looks very bad.
2434
2435         This commit sanitizes blue zones to avoid such a behaviour.
2436
2437         * src/autofit/aflatin.c (af_latin_sort_blue): New function.
2438         (af_latin_metrics_init_blues): Sort blue values and remove overlaps.
2439
2440 2017-02-12  Alexei Podtelezhnikov  <apodtele@gmail.com>
2441
2442         * src/smooth/ftgrays.c (gray_sweep): Improve code.
2443
2444 2017-02-06  Werner Lemberg  <wl@gnu.org>
2445
2446         [truetype] Implement `VVAR' table support.
2447
2448         * src/truetype/ttgxvar.h (GX_HVarTable): Renamed to...
2449         (GX_HVVarTable): ...This.
2450         (GX_Blend): Add fields for `VVAR' table handling.
2451         Other minor updates.
2452
2453         * src/truetype/ttgxvar.c (ft_var_load_hvar): Renamed to...
2454         (ft_var_load_hvvar): ...This.
2455         Handle VVAR loading also (controlled by an additional parameter).
2456         (tt_hadvance_adjust): Renamed to...
2457         (tt_hvadvance_adjust): ...This.
2458         Handle application of advance height also (controlled by an
2459         additional parameter).
2460         (tt_hadvance_adjust, tt_vadvance_adjust): Wrappers for
2461         `tt_hvadvance_adjust'.
2462
2463         * src/truetype/ttdriver.c (tt_service_metrics_variations): Updated.
2464
2465 2017-02-05  Werner Lemberg  <wl@gnu.org>
2466
2467         [autofit] Use better blue zone characters for lowercase latin.
2468
2469         The number of lowercase characters for computing the top flat blue
2470         zone value was too small (in most cases only `x' and `z').  If one
2471         of the two characters has a large serif, say, it can happen that
2472         FreeType must select between two different values, having a 50%
2473         chance to use the wrong one.  As a result, rendering at larger PPEM
2474         values could yield uneven lowercase glyph heights.
2475
2476         Problem reported by Christoph Koeberlin <christoph@koe.berlin>.
2477
2478         * src/autofit/afblue.dat (AF_BLUE_STRING_LATIN_SMALL): Replaced
2479         with...
2480         (AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_STRING_LATIN_SMALL_BOTTOM):
2481         ... New, extended sets.
2482         (AF_BLUE_STRINGSET_LATN): Updated.
2483
2484         * src/autofit/afblue.c, scr/autofit/afblue.h: Regenerated.
2485
2486 2017-02-04  Werner Lemberg  <wl@gnu.org>
2487
2488         Make `freetype-config' a wrapper of `pkg-config' if possible.
2489
2490         Based on ideas taken from
2491
2492           https://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-multilib.patch
2493           https://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-2.5.3-freetype-config-prefix.patch
2494
2495         * builds/unix/freetype-config.in: Rewritten.  Use `pkg-config' to
2496         set output variables if program is available.
2497
2498         * docs/CHANGES, docs/freetype-config.1: Updated.
2499
2500 2017-02-04  Werner Lemberg  <wl@gnu.org>
2501
2502         * builds/unix/unix-def.in (freetype-config): Fix permissions.
2503
2504 2017-02-03  Werner Lemberg  <wl@gnu.org>
2505
2506         * src/autofit/afglobal.c (af_face_globals_free): Erase useless code.
2507
2508 2017-02-03  Werner Lemberg  <wl@gnu.org>
2509
2510         * include/freetype/ftgasp.h (FT_GASP_SYMMETRIC_GRIDFIT): Fix value.
2511
2512         Reported by Behdad.
2513
2514 2017-02-02  Werner Lemberg  <wl@gnu.org>
2515
2516         [truetype] Fix MVAR post-action handling.
2517
2518         Reported as
2519
2520           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=509
2521
2522         * src/truetype/ttobjs.c (tt_size_reset): Do nothing for CFF2.  This
2523         is important to make `tt_size_reset_iterator' (called in
2524         `tt_apply_mvar') always work.
2525
2526 2017-02-02  Werner Lemberg  <wl@gnu.org>
2527
2528         Make compilation with FT_CONFIG_OPTION_PIC work again.
2529
2530         All code committed here is guarded with `FT_CONFIG_OPTION_PIC'.
2531
2532         * include/freetype/internal/services/svmetric.h
2533         (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Remove trailing semicolon.
2534
2535         * src/autofit/aflatin.c (af_latin_hints_compute_edges,
2536         af_latin_hint_edges): Provide `globals' variable.
2537
2538         * src/autofit/afloader.c (af_loader_load_glyph): Remove shadowing
2539         variable.
2540
2541         * src/autofit/afmodule.c (AF_SCRIPT_CLASSES_GET,
2542         AF_STYLE_CLASSES_GET): Redefine.
2543
2544         * src/autofit/aftypes.h (AF_DEFINE_WRITING_SYSTEM_CLASS): Fix typo.
2545
2546         * src/cff/cffparse.c (CFF_FIELD_BLEND): Provide it.
2547
2548         * src/cff/cffpic.h (CffModulePIC): Fix typo.
2549
2550 2017-01-31  Alexei Podtelezhnikov  <apodtele@gmail.com>
2551
2552         * src/smooth/ftgrays.c (gray_render_scanline): Improve code.
2553
2554 2017-01-31  Werner Lemberg  <wl@gnu.org>
2555
2556         [cff] Provide metrics variation service interface (#50196).
2557
2558         Only now I've got an OTF with an HVAR table for testing...
2559
2560         The code in `ftmm.c' uses `FT_FACE_LOOKUP_SERVICE' to get the
2561         metrics variations interface.  However, this didn't work with
2562         `FT_FACE_FIND_GLOBAL_SERVICE' used in `sfnt_init_face'.
2563
2564         * src/cff/cffdrivr.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
2565         (cff_hadvance_adjust, cff_metrics_adjust): Wrapper functions for
2566         metric service functions from the `truetype' module.
2567         (cff_service_metrics_variations): New service.
2568         (cff_services): Updated.
2569
2570         * src/cff/cffpic.h (CFF_SERVICE_METRICS_VAR_GET): New macro.
2571         [FT_CONFIG_OPTION_PIC]: Synchronize code.
2572
2573         * src/sfnt/sfobjs.c (sfnt_init_face): Replace call to
2574         FT_FACE_FIND_GLOBAL_SERVICE with `ft_module_get_service' to always
2575         load the service from the `truetype' module.
2576
2577 2017-01-31  Werner Lemberg  <wl@gnu.org>
2578
2579         Add framework to support services with 9 functions.
2580
2581         * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC9):
2582         New macro.
2583
2584 2017-01-31  Werner Lemberg  <wl@gnu.org>
2585
2586         [base] Fix error handing in MM functions.
2587
2588         * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
2589         FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates):
2590         Implement it.
2591
2592 2017-01-31  Werner Lemberg  <wl@gnu.org>
2593
2594         [truetype] Fix sanity check for `gvar' table (#50184).
2595
2596         * src/truetype/ttgxvar.c (ft_var_load_gvar): There might be missing
2597         variation data for some glyphs.
2598
2599 2017-01-31  Werner Lemberg  <wl@gnu.org>
2600
2601         [autofit] Avoid uninitialized jumps (#50191).
2602
2603         * src/autofit/afcjk.c (af_cjk_metrics_check_digits),
2604         src/autofit/aflatin.c (af_latin_metrics_check_digits): Initialize
2605         `advance'.
2606
2607 2017-01-27  Werner Lemberg  <wl@gnu.org>
2608
2609         s/GB2312/PRC/.
2610
2611         * include/freetype/freetype.h (FT_ENCODING_PRC): New enum value.
2612         (FT_ENCODING_GB2312): Deprecated.
2613
2614         * include/freetype/ttnameid.h (TT_MS_ID_PRC): New macro.
2615         (TT_MS_ID_GB2312): Deprecated.
2616
2617         * src/sfnt/sfobjs.c (sfnt_find_encoding): Updated.
2618
2619         * docs/CHANGES: Updated.
2620
2621 2017-01-26  Werner Lemberg  <wl@gnu.org>
2622
2623         [base] Add `FT_Get_Sfnt_LangTag' function.
2624
2625         * include/freetype/ftsnames.h (FT_SfntLangTag): New structure.
2626         (FT_Get_Sfnt_LangTag): New declaration.
2627
2628         * src/base/ftsnames.c (FT_Get_Sfnt_LangTag): New function.
2629
2630         * docs/CHANGES: Updated.
2631
2632 2017-01-26  Werner Lemberg  <wl@gnu.org>
2633
2634         [sfnt] Support `name' table format 1.
2635
2636         * include/freetype/internal/tttypes.h (TT_LangTagRec): New
2637         structure.
2638         (TT_NameTableRec): Add fields `numLangTagRecords' and `langTags'.
2639
2640         * src/sfnt/ttload.c (tt_face_load_name): Add support for language
2641         tags.
2642         Reduce array size of name strings in case of invalid entries.
2643         (tt_face_free_name): Updated.
2644
2645         * docs/CHANGES: Updated.
2646
2647 2017-01-25  Werner Lemberg  <wl@gnu.org>
2648
2649         [sfnt] s/TT_NameEntry/TT_Name/.
2650
2651         * include/freetype/internal/tttypes.h (TT_NameEntryRec): Renamed
2652         to...
2653         (TT_NameRec): This.
2654         (TT_NameTableRec): Updated.
2655
2656         * src/base/ftsnames.c (FT_Get_Sfnt_Name): Updated.
2657
2658         * src/sfnt/sfdriver.c (sfnt_get_ps_name): Updated.
2659
2660         * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
2661         tt_name_entry_ascii_from_other): Renamed to...
2662         (tt_name_ascii_from_utf16, tt_name_entry_ascii_from_other): This,
2663         respectively.
2664         (TT_NameEntry_ConvertFunc): Renamed to...
2665         (TT_Name_ConvertFunc): This.
2666         (tt_face_get_name): Updated.
2667
2668         * src/sfnt/ttload.c (tt_face_load_name, tt_face_free_name):
2669         Updated.
2670
2671 2017-01-24  Werner Lemberg  <wl@gnu.org>
2672
2673         [sfnt] Fix Postscript name service for symbol fonts.
2674
2675         * src/sfnt/sfdriver.c (sfnt_get_ps_name): Accept PID/EID=3/0
2676         entries also.
2677
2678 2017-01-24  Werner Lemberg  <wl@gnu.org>
2679
2680         [truetype] For OpenType 1.7: s/preferred/typographic/ (sub)family.
2681
2682         * include/freetype/ftsnames.h
2683         (FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY,
2684         FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY): New macros.
2685         (FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY,
2686         FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY): Deprecated.
2687
2688         * include/freetype/ttnameid.h (TT_NAME_ID_TYPOGRAPHIC_FAMILY,
2689         TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY): New macros.
2690         (TT_NAME_ID_PREFERRED_FAMILY, TT_NAME_ID_PREFERRED_SUBFAMILY):
2691         Deprecated.
2692
2693         * src/sfnt/sfobjs.c (sfnt_load_face): Updated.
2694
2695         * docs/CHANGES: Updated.
2696
2697 2017-01-23  Werner Lemberg  <wl@gnu.org>
2698
2699         [base] Add `FT_Set_Default_Properties' (#49187).
2700
2701         * include/freetype/ftmodapi.h: Add declaration.
2702
2703         * src/base/ftinit.c (ft_set_default_properties): Renamed to...
2704         (FT_Set_Default_Properties): ... this.
2705         (FT_Init_FreeType): Updated.
2706
2707         * docs/CHANGES: Updated.
2708
2709 2017-01-23  Werner Lemberg  <wl@gnu.org>
2710
2711         [truetype] Minor updates for OpenType 1.8.1.
2712
2713         * src/truetype/ttgxvar.h (GX_MVarTable): `axisCount' has been
2714         removed from the specification; it is now reserved.
2715
2716         * src/truetype/ttgxvar.c (ft_var_load_mvar): Updated.
2717         (GX_FVar_Head): Remove `countSizePairs'; the corresponding data
2718         field in the `MVAR' table is now reserved.
2719         (fvar_fields): Updated.
2720
2721 2017-01-23  Werner Lemberg  <wl@gnu.org>
2722
2723         [truetype] Avoid segfault for invalid variation data.
2724
2725         * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): Assure
2726         `itemCount' is not zero.
2727
2728         Reported as
2729
2730           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=441
2731
2732 2017-01-20  Werner Lemberg  <wl@gnu.org>
2733
2734         * src/truetype/ttinterp.c (TT_RunIns): Adjust loop detector limits.
2735
2736 2017-01-17  Werner Lemberg  <wl@gnu.org>
2737
2738         * include/freetype/ttnameid.h: Updated to OpenType 1.8.1.
2739
2740         (TT_APPLE_ID_FULL_UNICODE): New macro.
2741
2742         (TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC,
2743         TT_MS_LANGID_UPPER_SORBIAN_GERMANY,
2744         TT_MS_LANGID_LOWER_SORBIAN_GERMANY, TT_MS_LANGID_IRISH_IRELAND,
2745         TT_MS_LANGID_INUKTITUT_CANADA_LATIN, TT_MS_LANGID_BASHKIR_RUSSIA,
2746         TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG,
2747         TT_MS_LANGID_GREENLANDIC_GREENLAND, TT_MS_LANGID_MAPUDUNGUN_CHILE,
2748         TT_MS_LANGID_MOHAWK_MOHAWK, TT_MS_LANGID_BRETON_FRANCE,
2749         TT_MS_LANGID_OCCITAN_FRANCE, TT_MS_LANGID_CORSICAN_FRANCE,
2750         TT_MS_LANGID_ALSATIAN_FRANCE, TT_MS_LANGID_YAKUT_RUSSIA,
2751         TT_MS_LANGID_KICHE_GUATEMALA, TT_MS_LANGID_KINYARWANDA_RWANDA,
2752         TT_MS_LANGID_WOLOF_SENEGAL, TT_MS_LANGID_DARI_AFGHANISTAN): New
2753         macros.
2754
2755         (TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC): Fix value.
2756
2757         (TT_MS_LANGID_GERMAN_LIECHTENSTEIN, TT_MS_LANGID_CATALAN_CATALAN,
2758         TT_MS_LANGID_CHINESE_MACAO, TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT,
2759         TT_MS_LANGID_KOREAN_KOREA, TT_MS_LANGID_ROMANSH_SWITZERLAND,
2760         TT_MS_LANGID_SLOVENIAN_SLOVENIA, TT_MS_LANGID_BASQUE_BASQUE,
2761         TT_MS_LANGID_SETSWANA_SOUTH_AFRICA,
2762         TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA,
2763         TT_MS_LANGID_ISIZULU_SOUTH_AFRICA, TT_MS_LANGID_KAZAKH_KAZAKHSTAN,
2764         TT_MS_LANGID_KYRGYZ_KYRGYZSTAN, TT_MS_LANGID_KISWAHILI_KENYA,
2765         TT_MS_LANGID_TATAR_RUSSIA, TT_MS_LANGID_ODIA_INDIA,
2766         TT_MS_LANGID_MONGOLIAN_PRC, TT_MS_LANGID_TIBETAN_PRC,
2767         TT_MS_LANGID_WELSH_UNITED_KINGDOM, TT_MS_LANGID_GALICIAN_GALICIAN,
2768         TT_MS_LANGID_SINHALA_SRI_LANKA, TT_MS_LANGID_TAMAZIGHT_ALGERIA,
2769         TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA, TT_MS_LANGID_YI_PRC,
2770         TT_MS_LANGID_UIGHUR_PRC): New aliases.
2771
2772         Remove commented out code.
2773
2774         (TT_NAME_ID_LIGHT_BACKGROUND, TT_NAME_ID_DARK_BACKGROUND,
2775         TT_NAME_ID_VARIATIONS_PREFIX): New macros.
2776
2777         (HAVE_LIMIT_ON_IDENTS): Remove macro (which was useless since many
2778         years), use guarded long macros by default and define short versions
2779         as aliases for the long ones.
2780
2781 2017-01-15  Werner Lemberg  <wl@gnu.org>
2782
2783         * src/truetype/ttgxvar.c (tt_apply_var): Handle underline parameters
2784         also.
2785
2786 2017-01-11  Werner Lemberg  <wl@gnu.org>
2787
2788         * src/base/ftobjs.c (ft_open_face_internal): Improve tracing.
2789
2790 2017-01-11  Werner Lemberg  <wl@gnu.org>
2791
2792         [truetype] Actually use metrics variation service.
2793
2794         * src/base/ftmm.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
2795         (ft_face_get_mvar_service): New auxiliary function to look up
2796         metrics variation service.
2797         (FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
2798         FT_Set_Var_Blend_Coordinates): Call metrics variation service.
2799
2800         * src/truetype/ttobjs.c (tt_face_init): Use metrics variations for
2801         named instances.
2802
2803 2017-01-11  Werner Lemberg  <wl@gnu.org>
2804
2805         [truetype] Provide metrics variation service.
2806
2807         * include/freetype/internal/services/svmetric.h
2808         (FT_Metrics_Adjust_Func): Reduce number of necessary parameters.
2809
2810         * src/truetype/ttgxvar.c: Include FT_LIST_H.
2811         (tt_size_reset_iterator): New auxiliary function for...
2812         (tt_apply_var): New function.
2813
2814         * src/truetype/ttgxvar.h: Updated.
2815
2816         * src/truetype/ttdriver.c (tt_service_metrics_variations): Add
2817         `tt_apply_mvar'.
2818
2819         * include/freetype/internal/ftserv.h (FT_ServiceCache): Add metrics
2820         variation service.
2821
2822 2017-01-11  Werner Lemberg  <wl@gnu.org>
2823
2824         [truetype] Parse `MVAR' table.
2825
2826         * src/truetype/ttgxvar.h (MVAR_TAG_XXX): New macros for MVAR tags.
2827         (GX_Value, GX_MVarTable): New structures.
2828         (GX_Blend): Add it.
2829
2830         * src/truetype/ttgxvar.c (GX_VALUE_SIZE, GX_VALUE_CASE,
2831         GX_GASP_CASE): New macros.
2832         (ft_var_get_value_pointer): New auxiliary function to get a pointer
2833         to a value from various SFNT tables already stored in `TT_Face'.
2834         (ft_var_load_mvar): New function.
2835         (TT_Get_MM_Var): Call it.
2836         (tt_done_blend): Updated.
2837
2838 2017-01-11  Werner Lemberg  <wl@gnu.org>
2839
2840         [truetype] More preparations for MVAR support.
2841
2842         * src/truetype/ttobjs.c (tt_size_reset): Add argument to make
2843         function only recompute ascender, descender, and height.
2844
2845         * src/truetype/ttobjs.h: Updated.
2846
2847         * src/truetype/ttdriver.c (tt_size_select, tt_size_request):
2848         Updated.
2849
2850 2017-01-09  Werner Lemberg  <wl@gnu.org>
2851
2852         [pcf] Disable long family names by default.
2853
2854         * include/freetype/config/ftoption.h
2855         (PCF_CONFIG_OPTION_LONG_FAMILY_NAMES): Comment out.
2856
2857 2017-01-09  Werner Lemberg  <wl@gnu.org>
2858
2859         [pcf] Make long family names configurable.
2860
2861         The change from 2016-09-29 was too radical (except for people using
2862         the openSuSE GNU/Linux distribution).  To ameliorate the situation,
2863         PCF_CONFIG_OPTION_LONG_FAMILY_NAMES gets introduced which controls
2864         the feature; if set, a new PCF property option
2865         `no-long-family-names' can be used to switch this feature off.
2866
2867         * include/freetype/config/ftoption.h, devel/ftoption.h
2868         (PCF_CONFIG_OPTION_LONG_FAMILY_NAMES): New option.
2869
2870         * include/freetype/ftpcfdrv.h: New header file (only containing
2871         comments currently, used for building the documentation).
2872
2873         * include/freetype/config/ftheader.h (FT_PCF_DRIVER_H): New macro.
2874
2875         * src/pcf/pcf.h (PCF_Driver): Add `no_long_family_names' field.
2876
2877         * src/pcf/pcfdrivr.c: Include FT_SERVICE_PROPERTIES_H and
2878         FT_PCF_DRIVER_H.
2879         (pcf_property_set, pcf_property_get): New functions.
2880         (pcf_service_properties): New service.
2881         (pcf_services): Updated.
2882         (pcf_driver_init) [PCF_CONFIG_OPTION_LONG_FAMILY_NAMES]: Handle
2883         `no_long_family_names'.
2884
2885         * src/pcf/pcfread.c (pcf_load_font): Handle `no_long_family_names'
2886         and PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
2887
2888         * docs/CHANGES: Updated.
2889
2890 2017-01-09  Werner Lemberg  <wl@gnu.org>
2891
2892         [pcf] Introduce a driver structure.
2893
2894         To be filled later on with something useful.
2895
2896         * src/pcf/pcf.h (PCF_Driver): New structure.
2897
2898         * src/pcf/pcfdrivr.c (pcf_driver_init, pcf_driver_done): New dummy
2899         functions.
2900         (pcf_driver_class): Updated.
2901
2902 2017-01-08  Werner Lemberg  <wl@gnu.org>
2903
2904         [truetype] Again some GX code shuffling.
2905
2906         We need this later on for MVAR also.
2907
2908         * src/truetype/ttgxvar.c (tt_hadvance_adjust): Split off computing
2909         an item store variation delta into...
2910         (ft_var_get_item_delta): ...new function.
2911
2912 2017-01-08  Werner Lemberg  <wl@gnu.org>
2913
2914         [truetype] Adjust font variation flags for MVAR.
2915
2916         * include/freetype/internal/tttypes.h (TT_FACE_FLAG_VAR_XXX):
2917         Remove all flags related to MVAR; replace it with...
2918         (TT_FACE_FLAG_VAR_MVAR): ...this new macro.
2919         (TT_Face): Remove `mvar_support' field (which was still unused).
2920
2921 2017-01-06  Werner Lemberg  <wl@gnu.org>
2922
2923         [truetype] More GX code shuffling.
2924
2925         We need this later on for MVAR also.
2926
2927         * src/truetype/ttgxvar.c (tt_done_blend): Split off handling of item
2928         variation store into...
2929         (ft_var_done_item_variation_store): ...new function.
2930
2931 2017-01-06  Werner Lemberg  <wl@gnu.org>
2932
2933         [truetype] More generalization of GX stuff.
2934
2935         We need this later on for MVAR also.
2936
2937         * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping): Add
2938         parameters for delta-set index mapping and item variation store.
2939         (ft_var_load_item_variation_store): Add parameter for item variation
2940         store.
2941         s/hvarData/varData/.
2942         Move allocation of `hvar_table' to...
2943         (ft_var_load_hvar): ...this function.
2944         Updated.
2945
2946 2017-01-06  Werner Lemberg  <wl@gnu.org>
2947
2948         [truetype] Some GX structure renames for generalization.
2949
2950         We need this later on for MVAR also.
2951
2952         * src/truetype/ttgxvar.h (GX_HVarData): Renamed to...
2953         (GX_ItemVarData): ...this.
2954         (GX_HVarRegion): Renamed to...
2955         (GX_VarRegion): ...this.
2956         (GX_HVStore): Renamed to...
2957         (GX_ItemVarStore): ...this.
2958         (GX_WidthMap): Renamed to...
2959         (GX_DeltaSetIdxMap): ...this.
2960
2961         (GX_HVarTable): Updated.
2962
2963         * src/truetype/ttgxvar.c: Updated.
2964
2965 2017-01-06  Werner Lemberg  <wl@gnu.org>
2966
2967         [truetype] Code shuffling.
2968
2969         * src/truetype/ttgxvar.c (ft_var_load_hvar): Split off loading of
2970         item variation store and delta set index mapping into...
2971         (ft_var_load_item_variation_store,
2972         ft_var_load_delta_set_index_mapping): ...new functions.
2973
2974 2017-01-06  Werner Lemberg  <wl@gnu.org>
2975
2976         [truetype] Add HVAR access without advance width map.
2977
2978         * src/truetype/ttgxvar.c (ft_var_load_hvar): Handle case where
2979         `offsetToAdvanceWidthMapping' is zero.
2980         (tt_hadvance_adjust): Implement direct deltaSet access by glyph
2981         index.
2982
2983 2017-01-06  Werner Lemberg  <wl@gnu.org>
2984
2985         [pcf] Revise driver.
2986
2987         This commit improves tracing and handling of malformed fonts.  In
2988         particular, the changes to `pcf_get_properties' fix
2989
2990           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=379
2991
2992         * src/pcf/pcfread.c (tableNames): Use long names for better
2993         readability.
2994         (pcf_read_TOC): Allow at most 9 tables.
2995         (pcf_get_properties): Allow at most 256 properties.
2996         Limit strings array length to 256 * (65536 + 1) bytes.
2997         Better tracing.
2998         (pcf_get_metric): Trace metric data.
2999         (pcf_get_metrics): Allow at most 65536 metrics.
3000         Fix comparison of `metrics->ascent' and `metrics->descent' to avoid
3001         potential overflow.
3002         Better tracing.
3003         (pcf_get_bitmaps): Allow at most 65536 bitmaps.
3004         Better tracing.
3005         (pcf_get_encodings, pcf_get_accel): Better tracing.
3006
3007         * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Don't trace `format' details.
3008         These are now shown by `pcf_get_bitmaps'.
3009
3010 2017-01-04  Werner Lemberg  <wl@gnu.org>
3011
3012         * src/pcf/pcfdrivr.c (PCF_Face_Init): Trace compression format.
3013
3014 2017-01-04  Werner Lemberg  <wl@gnu.org>
3015
3016         [cff] More consistency checks for pure CFFs.
3017
3018         Reported as
3019
3020           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=378
3021
3022         * src/cff/cffload.c (cff_font_load): Check element number and size
3023         of Name and Top DICT indices.
3024
3025 2017-01-04  Werner Lemberg  <wl@gnu.org>
3026
3027         [cff, truetype] Minor tracing improvement.
3028
3029         * src/cff/cffobjs.c (cff_face_init), src/truetype/ttobjs.c
3030         (tt_face_init): Indent first tracing message from SFNT driver.
3031
3032 2017-01-03  Werner Lemberg  <wl@gnu.org>
3033
3034         [truetype] Various minor fixes.
3035
3036         * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check instruction
3037         size only if we do native hinting.
3038         (TT_Load_Glyph): Trace returned error code.
3039
3040         * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Trace
3041         returned error code.
3042         (tt_size_ready_bytecode): Don't run `prep' table if `fpgm' table is
3043         invalid.
3044
3045 2017-01-03  Werner Lemberg  <wl@gnu.org>
3046
3047         [sfnt] Don't fail if PCLT, EBLC (and similar tables) are invalid.
3048
3049         These tables are optional.
3050
3051         * src/sfnt/sfobjs.c (sfnt_load_face): Implement it.
3052
3053 2017-01-03  Werner Lemberg  <wl@gnu.org>
3054
3055         * src/cff/cffparse.c (cff_parse_num): Simplify.
3056
3057 2017-01-03  Werner Lemberg  <wl@gnu.org>
3058
3059         Various fixes for clang's undefined behaviour sanitizer.
3060
3061         * src/cff/cffload.c (FT_fdot14ToFixed): Fix casting.
3062         (cff_blend_doBlend): Don't left-shift negative numbers.
3063         Handle 5-byte numbers byte by byte to avoid alignment issues.
3064
3065         * src/cff/cffparse.c (cff_parse_num): Handle 5-byte numbers byte by
3066         byte to avoid alignment issues.
3067
3068         * src/cid/cidload (cid_read_subrs): Do nothing if we don't have any
3069         subrs.
3070
3071         * src/psaux/t1decode.c (t1_decode_parse_charstring): Fix tracing.
3072
3073         * src/tools/glnames.py (main): Put `DEFINE_PSTABLES' guard around
3074         definition of `ft_get_adobe_glyph_index'.
3075
3076         * src/psnames/pstables.h: Regenerated.
3077
3078         * src/psnames/psmodule.c: Include `pstables.h' twice to get both
3079         declaration and definition.
3080
3081         * src/truetype/ttgxvar.c (FT_fdot14ToFixed, FT_intToFixed): Fix
3082         casting.
3083
3084 2017-01-01  Werner Lemberg  <wl@gnu.org>
3085
3086         [cff] Handle multiple `blend' operators in a row correctly.
3087
3088         Reported as
3089
3090           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=368
3091
3092         * src/cff/cffload.c (cff_blend_doBlend): Adjust `parser->stack'
3093         pointers into `subFont->blend_stack' after reallocation.
3094
3095 2017-01-01  Werner Lemberg  <wl@gnu.org>
3096
3097         [sfnt] Return correct number of named instances for TTCs.
3098
3099         Without this patch, requesting information for face index N returned
3100         the data for face index N+1 (or index 0).
3101
3102         * src/sfnt/sfobjs.c (sfnt_init_face): Correctly adjust `face_index'
3103         for negative `face_instance_index' values.
3104
3105 2016-12-31  Werner Lemberg  <wl@gnu.org>
3106
3107         */*: Use hex numbers for errors in tracing messages.
3108
3109 2016-12-31  Werner Lemberg  <wl@gnu.org>
3110
3111         [truetype] Check axis count in HVAR table.
3112
3113         Reported as
3114
3115           https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=362
3116
3117         * src/truetype/ttgxvar.c (ft_var_load_hvar): Check axis count.
3118         (ft_var_load_avar): Fix tracing message.
3119
3120
3121 ----------------------------------------------------------------------------
3122
3123 Copyright (C) 2016-2020 by
3124 David Turner, Robert Wilhelm, and Werner Lemberg.
3125
3126 This file is part of the FreeType project, and may only be used, modified,
3127 and distributed under the terms of the FreeType project license,
3128 LICENSE.TXT.  By continuing to use, modify, or distribute this file you
3129 indicate that you have read the license and understand and accept it
3130 fully.
3131
3132
3133 Local Variables:
3134 version-control: never
3135 coding: utf-8
3136 End: