-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog
4958 lines (3080 loc) · 162 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2023-02-09 Werner Lemberg <[email protected]>
* Version 2.13 released.
==========================
Tag sources with `VER-2-13-0'.
* docs/VERSION.TXT: Add entry for version 2.13.
* docs/CHANGES: Updated.
* README, src/base/ftver.rc, builds/windows/vc2010/index.html,
builds/windows/visualc/index.html, builds/windows/visualce/index.html,
builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
docs/freetype-config.1: s/2.12.1/2.13/, s/2121/2130/.
* include/freetype/freetype.h (FREETYPE_MINOR): Set to 13.
(FREETYPE_PATCH): Set to 0.
* builds/unix/configure.raw (version_info): Set to 25:0:19.
* CMakeLists.txt (VERSION_MINOR): Set to 13.
(VERSION_PATCH): Set to 0.
2023-02-09 Alexei Podtelezhnikov <[email protected]>
Comment on `FT_GlyphSlot_Slant'.
2023-02-08 Werner Lemberg <[email protected]>
[autofit] Fix 'multi' compilation.
* src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`.
Add ANSI boilerplate code for otherwise empty file.
* src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`.
Use `FT_BEGIN_HEADER` and `FT_END_HEADER`.
Decorate with `FT_LOCAL`.
* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
2023-02-08 Werner Lemberg <[email protected]>
Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags.
2023-02-08 Werner Lemberg <[email protected]>
Fix 'fall-through' warning messages.
Modern compilers get more insistent on that...
* include/freetype/internal/compiler-macros.h (FALL_THROUGH): Define.
* src/*: Use it instead of `/* fall through */` comments.
2023-02-08 Werner Lemberg <[email protected]>
For debugging, avoid implicit conversion from integer to double.
Otherwise we get zillions of clang 15 warnings.
* src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c,
src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c,
src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use
`double` cast in debugging and tracing macros.
2023-02-08 Werner Lemberg <[email protected]>
Avoid reserved identifiers that are globally defined.
This is mandated by the C99 standard, and clang 15 produces zillions of
warnings otherwise.
* devel/ftoption.h, include/freetype/config/ftoption.h,
include/freetype/internal/ftmemory.h, src/autofit/afhints.h,
src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c,
src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c,
src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
2023-02-08 Werner Lemberg <[email protected]>
Fix minor clang and clang++ warnings.
2023-02-08 Alexei Podtelezhnikov <[email protected]>
[truetype, type1] Additional variation tags.
Sync with
https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags
* src/truetype/ttgxvar.h (TTAG_ital): New tag.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it.
* src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'.
2023-02-08 Alexei Podtelezhnikov <[email protected]>
* src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant.
* include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it.
2023-02-08 anuj <[email protected]>
[sdf] Use 32-bit integers internally.
* src/sdf/ftsdfcommon.h (FT_16D16, FT_26D6): Use 32-bit integers
instead of `FT_Fixed` for internal data types. `FT_Fixed` i.e.
`signed long` is 64-bit on some architectures.
2023-02-07 Werner Lemberg <[email protected]>
docs/CHANGES: Updated.
2023-02-04 Alexei Podtelezhnikov <[email protected]>
Comment on optional ascender and descender.
2023-02-04 Alexei Podtelezhnikov <[email protected]>
* src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender.
2023-02-04 Alexei Podtelezhnikov <[email protected]>
* src/type1/t1afm.c (T1_Read_Metrics): Validate ascender and descender.
The ascender and descender are optional in the AFM specifications.
They could be omitted or even set to zero, e.g., in the current release
of URW++ base 35 fonts.
2023-02-02 Werner Lemberg <[email protected]>
* src/cff/cffgload.c (cff_slot_load): Avoid memory leak.
Fixes issue #1204.
2023-02-01 Werner Lemberg <[email protected]>
* src/truetype/ttgxvar.c (tt_var_get_item_delta): Check `face->blend`.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55581
2023-02-01 Werner Lemberg <[email protected]>
* docs/CHANGES: Add news for 'freetype-demos'.
2023-01-30 Werner Lemberg <[email protected]>
* subprojects/harfbuzz.wrap, subprojects/libpng.wrap: Updated.
2023-01-28 Werner Lemberg <[email protected]>
Minor changes.
Comment fixes, typos, removing of unnecessary parentheses.
2023-01-28 Werner Lemberg <[email protected]>
Whitespace.
2023-01-27 Behdad Esfahbod <[email protected]>
[ttgxvar] Fix crash in COLRv1.
This is a stopgap until issue #1202 is properly fixed.
* src/truetype/ttxgvar.c (tt_var_get_item_delta): Check `normalizedcoords`.
2023-01-19 Werner Lemberg <[email protected]>
The 'COLR' v1 API will no longer be experimental in the next release.
2023-01-18 Alexei Podtelezhnikov <[email protected]>
* docs/oldlogs/ChangeLog.210: Typos.
2023-01-18 Ben Wagner <[email protected]>
[base] Fix typo.
* src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Request module 't1cid',
not 'cid'.
2023-01-18 Ben Wagner <[email protected]>
[base] Return error if requested driver is not found.
In `open_face_from_buffer` it is possible that a driver is requested but
FreeType was built without the requested module. Return an error in this
case to indicate that the request could not be satisfied, rather than trying
all existing driver modules.
* src/base/ftobjs.c (open_face_from_buffer): Return `FT_Err_Missing_Module`
if a driver is specified but not found.
2023-01-18 Dominik Röttsches <[email protected]>
[sfnt] Avoid nullptr dereference in reading malformed 'COLR' v1 table.
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1408044.
* src/sfnt/ttcolr.c (tt_face_load_colr): When the 'COLR' v1 table header is
too small, don't deallocate delta set index map structures.
2023-01-17 Werner Lemberg <[email protected]>
* src/tools/update-copyright: Allow execution from other repositories.
We use this for `freetype-demos`.
2023-01-17 Werner Lemberg <[email protected]>
Update all copyright notices.
2023-01-17 Werner Lemberg <[email protected]>
* src/tools/no-copyright: Updated.
2023-01-17 Ben Wagner <[email protected]>
[base] 'close' callback may not use `stream->memory`.
The documentation for `FT_StreamRec::memory` states that it 'shouldn't be
touched by stream implementations'. This is true even for internal
implementations of the 'close' callback, since it is not guaranteed that
`memory` will even be set when the 'close' callback occurs.
* src/base/ftobjs.c (new_memory_stream): stash current `memory` in
`stream->descriptor`.
(memory_stream_close): Use it.
2023-01-17 Ben Wagner <[email protected]>
[base] Always close user-provided stream.
The `FT_Open_Face` documentation states
> If `FT_OPEN_STREAM` is set in `args->flags`, the stream in `args->stream`
> is automatically closed before this function returns any error (including
> `FT_Err_Invalid_Argument`).
However, if the user provides a stream in `args.stream` with
`FT_OPEN_STREAM` set and a `close` function, but then for some reason passes
NULL for `aface` and a non-negative `face_index`, the error
`Invalid_Argument` is returned but the `close` callback will not be called
on the user-provided stream. This may cause resource leaks if the caller is
depending on the `close` callback to free resources.
The difficulty is that a user may fill out a `FT_StreamRec` and pass its
address as `args.stream`, but the stream isn't really 'live' until
`FT_Stream_New` is called on it (and `memory` is set). In particular, it
cannot really be cleaned up properly in `ft_open_face_internal` until the
stream pointer has been copied into the `stream` local variable.
* src/base/ftobj.c (ft_open_face_internal): Ensure that user-provided
`args.stream.close` is called even with early errors.
2023-01-17 Ben Wagner <[email protected]>
[base] Fix leak of internal stream marked external.
`open_face_from_buffer` allocates a new `FT_Stream` to pass to
`ft_open_face_internal`. Because this is an `FT_OPEN_STREAM`,
`ft_open_face_internal` will mark this as an 'external stream', which the
caller must free. However, `open_face_from_buffer` cannot directly free it
because the stream must last as long as the face. There is currently an
attempt at this by clearing the 'external stream' bit after
`open_face_from_buffer` returns successfully. However, this is too late as
the original stream may have already been closed and the stream on the face
may not be the same stream as originally passed.
It is tempting to use `FT_OPEN_MEMORY` and let `ft_open_face_internal`
create the stream internally. However, with this method there is no means
to pass through a 'close' function to the created stream to free the
underlying data, which must be owned by the stream.
A possibility is to check on success if the stream of the face is the same
as the original stream. If it is then unset the external flag. If not,
then free the original stream. Unfortunately, while no current
implementation does so, it is possible that the face still has the original
stream somewhere other than as the `FT_FaceRec::stream`. The stream needs
to remain available for the life of the face or until it is closed,
whichever comes earlier.
The approach taken here is to let the stream own itself. When the stream is
closed it will free itself.
* src/base/ftobjs.c (memory_stream_close): Free `stream`.
(open_face_from_buffer): Simplify error handling, since
`ft_open_face_internal` always closes `args.stream` on any error.
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54930
2023-01-16 Werner Lemberg <[email protected]>
sr/*.c: Various minor fixes.
* src/autofit/ft-hb.c (_hb_ft_reference_table): Call `FT_UNUSED` after
variable declarations.
* src/gxvalid/gxvjust.c (gxv_just_widthDeltaClusters_validate): Eliminate
unused variable.
* src/gzip/ftgzip.c: Don't call GCC '-Wstrict-prototypes' pragma for C++
compiler.
* src/sfnt/ttcolr.c (ENSURE_READ_BYTES): Remove final semicolon to avoid
compiler warning.
* src/sfnt/ttsvg.c (tt_face_load_svg_doc): Fix signedness warning.
2023-01-16 Dominik Röttsches <[email protected]>
[sfnt] Remove temporary runtime flag for variable 'COLR' v1.
Fixes #1187.
* src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr,
tt_face_free_colr, get_deltas_for_var_index_base,
tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro
definition `VARIABLE_COLRV1_ENABLED` and its usage.
* src/truetype/ttdriver.c (tt_property_set): Remove parsing of
'TEMPORARY-enable-variable-colrv1' property name.
* src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1`
flag.
2023-01-07 Werner Lemberg <[email protected]>
* src/autofit/ft-hb.c (_hb_ft_reference_table): Minor integration fixes.
2023-01-07 Ben Wagner <[email protected]>
[truetype] Reset cvt and storage in context load.
Currently the cvt and storage are saved and restored in `TT_RunIns`.
However, this is too granular as the cvt and storage area should be set to
the original cvt and storage area only when setting up the hinting context.
This allows for the cvt and storage area to be modified while parsing
multiple glyphs, as is the case with composite glyphs.
* src/truetype/ttinterp.h (TT_ExecContextRec): Remove `origCvt` and
`origStorage`.
* src/truetype/ttinterp.c (TT_RunIns): Don't save and restore the cvt and
storage area.
(Modify_CVT_Check, Ins_WS): Switch from "if in glyph and using original data
do copy on write" to "if in glyph and not using glyph specific data do copy
on write".
2023-01-06 Matthias Clasen <[email protected]>
[autofit] Don't depend on 'hb-ft'.
The circular dependency is still there, but at least we no longer depend on
the HarfBuzz API that is only present if HarfBuzz has been built with
FreeType support, making the bootstrapping a bit easier.
* src/autofit/ft-hb.c, src/autofit/ft-hb.h: New files, providing
`_hb_ft_font_create`, which is more or less a verbatim copy of the
corresponding HarfBuzz code from file `hb-ft.cc`.
* src/autofit/afglobal.c (af_face_globals_new): Use it.
* src/autofit/afshaper.h: Don't include `hb-ft.h` but `ft-hb.h`.
* src/autofit/autofit.c: Include `ft-hb.c`.
* LICENSE.TXT: Updated.
2023-01-06 Ben Wagner <[email protected]>
[truetype] Keep variation store consistent.
`tt_var_load_item_variation_store` fills out a `GX_ItemVarStore`. While it
may return an error, the item store must be left in a consistent state so
that any use or destruction of the item store can properly use or free the
data in it. Before this change the counts from the font data were read
directly into the item store before the actual allocation of the arrays to
which they referred. There exist many opportunities between the time the
counts are read and the arrays are allocated to return early due to invalid
data. When this happened the item store claimed to have entires it actually
did not, leading to crashes later when it was used.
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54449
* src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Read the counts
into local variables and store them in the item store only after the related
arrays are actually created on the item store.
2023-01-05 Ben Wagner <[email protected]>
[base] Report used stream's external status.
In `open_face` the initial stream is set on the face, along with the
information about if FreeType is the owner of the stream object itself. The
loaders may in the course of their work replace this stream with a new
stream (as is the case for 'woff' and 'woff2'), which may have a different
ownership than the initial stream object (likely the original stream object
is owned by the user and is external, while the new stream object is created
internally to FreeType and is internal). When the stream is replaced, the
face's flags are updated with the new ownership status.
However, `open_face` cannot itself free this stream as its caller
`ft_open_face_internal` is responsible for this. In addition, in the case
of an error `open_face` cannot return an actual face with the new stream and
its ownership status to the caller. As a result, it must pass this
information back to the caller as a sort of "failed face" so that the caller
can clean up.
`open_face` was already passing back the new stream but was not passing back
the stream ownership information. As a result the stream may not have been
free'd when needed.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54700
* src/base/ftobjs.c (open_face): Pass back the ownership information as
well.
(ft_open_face_internal): Updated.
2023-01-05 Noah Cabral <[email protected]>
fix spelling err in LICENSE.txt
2023-01-05 Dominik Röttsches <[email protected]>
[sfnt] Fix color stop bounds check calculation at table end.
Fixes https://bugs.chromium.org/p/skia/issues/detail?id=14021
* src/sfnt/ttcolr.c (VAR_IDX_BASE_SIZE): New macro.
(tt_face_get_colorline_stops): Fix off-by-one bounds check calculation, take
`VarColorStop` into account, and hopefully make it easier to read.
2023-01-05 Alexei Podtelezhnikov <[email protected]>
* src/base/ftobjs.c (FT_Request_Metrics): Avoid division by zero.
The division-by-zero might happen in broken fonts (see #1194).
Instead of returning a huge number from FT_DivFix and failing
to scale later, we now bail immediately.
2022-12-20 Alexei Podtelezhnikov <[email protected]>
[psaux] Delay the upem validity assertion.
Fixes #1194.
* src/psaux/psft.c (cf2_getUnitsPerEm): Remove the upem assert.
(cf2_checkTransform): Assert the upem validity after checking the scale.
2022-12-14 David Vanderson <[email protected]>
Werner Lemberg <[email protected]>
[gzip] Make static compilation not leak global symbols.
* src/gzip/ftgzip.c (HAVE_HIDDEN): Do not define; it is no longer needed
because everything is static.
(HAVE_MEMCPY): Define.
(zcalloc, zcfree): Remove no longer needed definitions (because `Z_SOLO` is
active).
* src/gzip/patches/freetype-zlib.diff: Regenerated.
Fixes #1146.
2022-12-14 Werner Lemberg <[email protected]>
* src/gzip/ftzconf.h: Updated to zlib 1.2.13.
I forgot to copy that file.
2022-12-14 Werner Lemberg <[email protected]>
* builds/unix/configure.raw: Don't check for `memcpy` and `memmove`.
We expect a C99 compiler, and both functions are part of this standard.
2022-12-13 Werner Lemberg <[email protected]>
[sdf, sfnt] Handle minor compiler warnings.
* src/sdf/ftsdf.c (get_min_distance_conic): Initialize `nearest_point`.
* src/sfnt/ttsvg.c (find_doc): Initialize `mid_doc`.
Fixes #1195.
2022-12-07 Werner Lemberg <[email protected]>
* subprojects/zlib.wrap: Micro-update from upstream.
2022-12-06 Jiří Malák <[email protected]>
* include/freetype/internal/ftcalc.h (FT_MSB): Support Open Watcom 2.0.
Closes !232.
2022-11-23 Luca Bacci <[email protected]>
* src/base/ftdbgmem.c (ft_mem_source_compare): Add FT_COMPARE_DEF.
Closes !230.
2022-11-21 Alexei Podtelezhnikov <[email protected]>
* src/autofit/afloader.c (af_loader_load_glyph): Remove `size` check.
This is done by `FT_Load_Glyph`.
2022-11-18 Alexei Podtelezhnikov <[email protected]>
Comments added.
2022-11-16 Johan Matsson <mjunix@ at github>
* src/autofit/afloader.c (af_loader_load_glyph): Fix dereference.
This must happen after the NULL check.
Taken from
https://github.com/freetype/freetype/pull/2
2022-11-15 Alexei Podtelezhnikov <[email protected]>
* src/pcf/pcfutil.c ({Two,Four}ByteSwap): Use builtins or shifts.
We trust glibc which uses shifts or builtins to swap bytes. This
must be more efficient.
2022-11-14 Werner Lemberg <[email protected]>
* src/truetype/ttgxvar.c (tt_hvadvance_adjust): Integer overflow.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50462
2022-11-14 Loïc Yhuel <[email protected]>
[meson] Use generated ftmodule.h
ftmodule.h is generated at the root of the build directory, but FT_CONFIG_MODULES_H
(freetype/config/ftmodule.h) is used instead.
This makes the build fail when disabling modules in modules.cfg.
* meson.build (harfbuzz_dep): Add '-DFT_CONFIG_MODULES_H=<ftmodule.h>'.
2022-11-14 Loïc Yhuel <[email protected]>
[meson] Fix generated ftmodule.h
The sdf module wasn't recognized, so the generated ftmodule.h had "None_renderer_class".
* builds/meson/parse_modules_cfg.py: Handle sdf in RASTER_MODULES.
2022-11-12 Dominik Röttsches <[email protected]>
Add `TT_CONFIG_OPTION_NO_BORING_EXPANSION` configuration macro.
This gives users a possibility to deactivate new features not (yet) in the
OpenType standard.
* include/freetype/config/ftoption.h, devel/ftoption.h
(TT_CONFIG_OPTION_NO_BORING_EXPANSION): New macro.
* src/truetype/ttgxvar.c (ft_var_load_avar): Use it to disable 'avar'
version 2.0 support.
2022-11-12 Behdad Esfahbod <[email protected]>
[truetype] Improve bounds checks for `ItemVariationStore`.
* src/truetype/ttgxvar.c (tt_hvadvance_adjust): Move bounds check ...
(tt_var_get_item_delta): ... to this function, because it is safer. For
example, the 'avar' table 2.0 codepath was not performing a bounds check at
all.
2022-11-12 Behdad Esfahbod <[email protected]>
[truetype] In `ItemVariationStore`, value 0xFFFF for `dataCount` is valid.
It corresponds to outer indices of 0 to 0xFFFE.
* src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Remove invalid
code.
2022-11-11 Alexei Podtelezhnikov <[email protected]>
[pcf] Improve CMap efficiency and readability.
* src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Check and walk
the encoding array indexes.
2022-11-10 Sam James <[email protected]>
Fix `-Wstrict-prototypes`.
* builds/unix/configure.raw: Fix `-Wstrict-prototypes`.
Clang 16 warns on these and they will be dropped in C23.
* builds/unix/freetype2.m4: Ditto.
2022-11-09 Ben Wagner <[email protected]>
[truetype] Check avar_segment before access
* src/truetype/ttgxvar.c (tt_done_blend): check `avar_segment` before
accessing to free its `correspondence`.
Reported as:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53062
2022-11-09 Ben Wagner <[email protected]>
[truetype] Restore behavior of ft_var_load_hvvar
* src/truetype/ttgcvar.c (ft_var_load_hvvar): restore previous behavior
In a previous change [0] the behavior of `ft_var_load_hvvar` was changed
to not load the item variation store if it was at offset 0, but not
return an error when this happened. This broke any users, like
`tt_hvadvance_adjust`, that rely on successful completion of
`ft_var_load_hvvar` to imply that returned table's `itemStore` had been
initialized. This lead such users to dereference NULL.
This change appears to have been unintentional and unrelated to the
actual avar2 changes. As a result, fix these NULL dereferences by
restoring the code to always attempt to initialize the `itemStore`.
[0] ae4eb996 "[truetype] Add support for `avar` table 2.0 format."
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53061
2022-11-08 Werner Lemberg <[email protected]>
docs/CHANGES: Updated.
2022-11-08 suzuki toshiya <[email protected]>
[build] use AC_CHECK_PROG() macro for libpng-config detection
* builds/unix/configure.raw: use AC_CHECK_PROG() instead of `which` to find `libpng-config`.
2022-11-08 suzuki toshiya <[email protected]>
[build] fix for make multi
Fix "make multi" by MR !223
* include/freetype/internal/services/svmm.h: include ftmm.h to define FT_Get_MM_Func.
* src/truetype/ttgxvar.h: include ftmmtypes.h to use GX_AVarTable properly.
* src/base/ftmac.c: include ftdebug.h to use FT_THROW() properly.
2022-11-08 Alexei Podtelezhnikov <[email protected]>
* src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Accelerate the search.
This is mostly for consistency because PFR fonts with bitmap strikes
do not seem to exist.
2022-11-06 Alexei Podtelezhnikov <[email protected]>
[bdf, pfr, psnames] Accelarate charmap searches.
The binary searches within charmaps can be accelerated because they
often contain dense continuous blocks of character codes. Within such
blocks, you can predict matches based on misses. This method has been
deployed in `bdf` since 0f122fef34; we only refactor it there. We now
use it in `pfr` and `psnames`, which speeds up the unicode charmap
access by about 50% in PFR and Type 1 fonts.
* src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Refactor.
* src/pfr/pfrcmap.c (pfr_cmap_char_{index,next}): Predict `mid` based
on the mismatch distance.
* src/psnames/psmodule.c (ps_unicodes_char_{index,next}): Ditto.
2022-11-04 Behdad Esfahbod <[email protected]>
[truetype] Add support for `avar` table 2.0 format.
See
https://github.com/harfbuzz/boring-expansion-spec/blob/main/avar2.md
for the specification.
Currently, this is implemented only in most recent OS versions on Apple
platforms and in the HarfBuzz library, but it is expected to be added to the
OpenType standard soon.
* src/truetype/ttgxvar.h (GX_AVarTableRec): New structure.
(GX_BlendRec): Use it to replace `avar_segment` with `avar_table`.
* src/truetype/ttgxvar.c (ft_var_load_avar): Load new table version.
(ft_var_to_normalized, tt_done_blend): Extend for new format.
(ft_var_load_hvvar, ft_var_to_design): Updated.
2022-10-24 Werner Lemberg <[email protected]>
Replace '1/64th' (and similar entries) with '1/64' in docs and comments.
2022-10-24 Ivan Panchenko <[email protected]>
* include/freetype/*: Fix documentation typos.
2022-10-21 Alexei Podtelezhnikov <[email protected]>
* src/truetype/ttgload.c: Cosmetic changes.
2022-10-21 Alexei Podtelezhnikov <[email protected]>
[cff, truetype] Simplify SVG metrics scaling.
Use pre-calculated scaling factors. Also, the advance widths used
to be rounded, which was incorrect.
* src/cff/cffgload.c (cff_slot_load): Use `x_scale` and `y_scale`.
* src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
2022-10-20 Werner Lemberg <[email protected]>
* subprojects/zlib.wrap: Update to zlib version 1.2.13.
2022-10-18 Dominik Röttsches <[email protected]>
[sfnt] Additional bounds checks for `COLR` v1 table handling.
* src/sfnt/ttcolr.c (read_paint): Add `colr` argument, necessary for...
... another use of `ENSURE_READ_BYTES`.
Update callers.
(tt_face_get_paint_layers): Ensure that the 4-byte paint table
offset can be read.
This is a follow-up to !124 and issue
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404
2022-10-18 Werner Lemberg <[email protected]>
[gzip] Update sources to zlib 1.2.13.
2022-10-18 Alexei Podtelezhnikov <[email protected]>
* src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Simplify calculations.
2022-10-18 Werner Lemberg <[email protected]>
Minor formatting.
2022-10-18 Dominik Röttsches <[email protected]>
[sfnt] Guard individual `COLR` v1 paint field reads.
* src/sfnt/ttcolr.c (ENSURE_READ_BYTES): New macro.
(read_paint): Use it – after the start pointer `p` has been checked for
whether it allows reading the format byte, each successive paint table field
read need to be bounds-checked before reading further values.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52404
2022-10-17 Xiang Xiao <[email protected]>
* builds/toplevel.mk: Prefix all paths with `$(TOP_DIR)/`.
This is useful for builds that are not started from the root directory.
2022-10-17 Liu Kunpeng(柳鲲鹏) <[email protected]>
* src/base/ftsynth.c (FT_GlyphSlot_Slant): New API with custom slant.
* include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Declare it.
2022-10-15 Alexei Podtelezhnikov <[email protected]>
Note the lack of floating-point data types.
2022-10-10 Werner Lemberg <[email protected]>
[cff] Remove `FT_CONFIG_OPTION_NO_GLYPH_NAMES`.
This ancient option stayed completely undocumented. Given that the 'cff'
driver requires the 'psnames' module, it makes no sense today to have this
macro.
* src/cff/cffdrivr.c (cff_services), src/cff/cffobjs.c (cff_face_init):
Remove corresponding conditional code.
2022-10-10 Werner Lemberg <[email protected]>
Synchronize `ftoption.h` flavours.
2022-10-10 Werner Lemberg <[email protected]>
Minor comment changes.
2022-10-05 Alexei Podtelezhnikov <[email protected]>
Improve FT_Get_Name_Index docs and place it next to FT_Get_Glyph_Name.
2022-10-04 Alexei Podtelezhnikov <[email protected]>
[autofit] Reset the face charmap directly.
There is no need to validate the original charmap in `FT_Set_Charmap`.
It can be reset directly.
* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
Use direct assignment.
* src/autofit/af{latin,cjk,indic}.c (af_latin_metrics_init): Ditto.
2022-10-04 Alexei Podtelezhnikov <[email protected]>
* src/type1/t1afm.c (T1_Read_PFM): Set charmaps directly.
As with the previous commit, we can avoid the validation checks
of `FT_Set_Charmap` and set it directly when choosing from the
available list.
2022-10-03 Alexei Podtelezhnikov <[email protected]>
* src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`.
Set charmap aggressively without all validations of `FT_Set_Charmap`
because we take it from the available array and only temporarily.
Even CMap Format 14 will gracefully return 0.
2022-10-03 Alexei Podtelezhnikov <[email protected]>
* src/cache/ftcbasic.c (ftc_basic_family_get_count): Remove redundancy.
2022-09-30 Werner Lemberg <[email protected]>
* src/psaux/pshints.c (cf2_hintmap_insertHint): Fix midpoint computation.
Replace '(start + end) / 2' with 'start + (end - start) / 2' to avoid
overflow.
Fixes #1180.
2022-09-30 Werner Lemberg <[email protected]>
* src/psaux/pshints.c (cf2_hintmap_build): Improve debugging output.
2022-09-29 mlugg <[email protected]>
[truetype] Fix undefined pointer arithmetic.
* src/truetype/ttgxvar.c (tt_var_get_item_delta, ft_var_load_mvar): Use
`FT_OFFSET`.
2022-09-29 Alexei Podtelezhnikov <[email protected]>
* src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Use lighter FT_DivFix.
2022-09-29 Ali Chraghi <[email protected]>
[base] FT_Attach_Stream: Make `parameters` argument constant.
2022-09-29 Azamat Hackimov <[email protected]>
* src/tools/*.py: Migrate to Python 3.
Fixes #1185, closes !205. Formatting changes according to PEP8.
2022-09-27 Dominik Röttsches <[email protected]>
[sfnt] Guard access in 'COLR' table when requesting child table pointer.
* src/sfnt/ttcolr.c (tt_face_get_colorline_stops, read_paint): Tighten
pointer bounds checks.
(get_child_table_pointer): Check whether incoming pointer `p` lies within
the 'COLR' table.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51816
2022-09-27 Ben Wagner <[email protected]>
[sfnt] Add SVG document bounds checking.
Add a check that the document content is actually contained within the
`SVG ` table. Without this check a malformed font may claim arbitrary
memory as its document content.
* src/sfnt/ttsvg.c (tt_face_load_svg): Take `numEntries` into account when
testing 'documentRecord' extents.
(find_doc): Rename `stream` to `document_records` for clarity.
(tt_face_load_svg_doc): Split `doc` from `doc_list` pointer for clarity.
Test that the document content is contained within the table.
Ensure minimum length of document before testing for gzip format.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51812
2022-09-23 Alexei Podtelezhnikov <[email protected]>
[base] Clean up the bitmap flow control.
* src/base/ftbitmap.c (FT_Bitmap_Copy): Flip the copy if its pitch
is trully opposite, zero is not a positive value.
(FT_Bitmap_Convert): Set negative pitch as needed, accept negative
alignment values.
2022-09-22 Alexei Podtelezhnikov <[email protected]>
[base] Discard and recreate bitmaps for copying and converting.
Reusing target bitmaps for copying and converting is permitted. It is,
however, pointless to preserve their content before overwriting. Free-
malloc might be faster than realloc.
* src/base/ftbitmap.c (FT_Bitmap_Copy, FT_Bitmap_Convert): Free
an old buffer and create a new one.
2022-09-16 Dominik Röttsches <[email protected]>
Reject 'COLR' table if version is 1 but header too small.
* src/sfnt/ttcolr.c (tt_face_load_colr): If the version is determined to
be 1, then the table size has to be at least the size of the v1 header.
Also, for peeking the number of base glyphs and entries in the layer list,
ensure that the table is sufficiently long.
Fixes #1179. Original patch by Sergey Temnikov.
2022-09-15 Werner Lemberg <[email protected]>
* src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix format 1 handling.
Fixes #1181.
2022-09-06 Dominik Röttsches <[email protected]>
[truetype] Reject 'fvar' loading when `num_instances` is too small.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Reject retrieving master when
'fvar' values locally do not match with sanitized values from initialization
at `sfnt_init_face` time.
Reported as
https://bugs.chromium.org/p/chromium/issues/detail?id=1360295
2022-09-05 Dominik Röttsches <[email protected]>
[sfnt] Handle variable `COLR` v1 fonts without delta set index map
Fixes #1178.
* src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Set outer index to
0 and inner index to the delta index when retrieving deltas if the
`COLR` table has no delta set index map.
2022-09-05 Dominik Röttsches <[email protected]>
[sfnt] Pointer sanity checks before reading layer info in 'COLR' v0
* src/sfnt/ttcolr.c (tt_face_get_colr_layer): Check that the pointer to
read from is within the 'COLR' table.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50633
2022-09-05 Werner Lemberg <[email protected]>
[autofit] Minor fix.
* src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Avoid
compiler warning.
2022-09-05 Dominik Röttsches <[email protected]>
[sfnt] Don't require 'gvar' table to support variation fonts.
Fixes #1172.
* src/sfnt/sfobjs.c (sfnt_load_face): Tag font as Multiple Masters font if
`fvar` is present; do not require other tables to be present.
* src/truetype/ttgxvar.c (tt_set_mm_blend): Allow for a missing 'gvar' table
when setting variation coordinates. However, if a 'gvar' table is actually
present, do perform a sanity check and fail on malformedness.
(TT_Get_MM_Var): Don't assume 'fvar' needs 'gvar' or 'CFF2 tables in all
cases, which is an overly tight check.
2022-08-27 Alexei Podtelezhnikov <[email protected]>
* src/base/ftver.rc: Explicitly use UTF-16.
Fixes #1177 to avoid mistranslation and other problems.
2022-08-26 Dominik Röttsches <[email protected]>
[sfnt] Avoid undefined shifts in `COLR` v1 color line retrieval
* src/sfnt/ttcolr.c (tt_face_get_colorline_stops): Disambiguate shift
behavior by using multiplication using macros from ftcalc.h.