Both the native CFF hinter and the auto-hinter now have a very
similar rendering style.
* include/freetype/freetype.h: Mention that FT_LOAD_TARGET_LIGHT no
longer implies FT_LOAD_FORCE_AUTOHINT.
* include/freetype/ftmodapi.h (FT_MODULE_DRIVER_HINTS_LIGHTLY): New
macro.
* include/freetype/internal/ftobjs.h (FT_DRIVER_HINTS_LIGHTLY): New
macro.
* src/cff/cffdrivr.c (cff_driver_class): Use it.
* src/base/ftobjs.c (FT_Load_Glyph): Update auto-hinter selection
logic.
* src/autofit/aflatin.h (AF_LatinBlueRec): Add `ascender' and
`descender' fields.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Collect
ascender and descender data for blue zones.
(af_latin_metrics_scale_dim): Reject vertical scaling values that
change the result by more than two pixels.
* include/freetype/internal/tttypes.h (TT_LoaderRec): New field
`composites'.
* src/truetype/ttgload.c: Include FT_LIST_H.
(load_truetype_glyph): Add composite subglyph index to a list;
abort if index is already in list.
(tt_loader_init): Updated.
(tt_loader_done): New function.
(TT_Load_Glyph): Call `tt_loader_done'.
This is a crude adaption of the original `cf2_computeDarkening'
function.
* src/autofit/afloader.c (af_intToFixed, af_fixedToInt,
af_floatToFixed): New macros, taken from `cf2fixed.h'.
(af_loader_compute_darkening): New function.
* src/autofit/afloader.h: Updated.
We need the computed standard horizontal and vertical widths for the
emboldening calculation. This method provides a convenient way to
extract it from writing-system-specific metrics structures, which
all script definitions must implement.
* src/autofit/aftypes.h (AF_WritingSystem_GetStdWidthsFunc): New
function type.
(AF_WritingSystemClassRec): New member `style_metrics_getstdw'.
(AF_DEFINE_WRITING_SYSTEM_CLASS): Updated.
* src/autofit/afcjk.c (af_cjk_get_standard_width): New function.
(af_cjk_writing_system_class): Updated.
* src/autofit/afdummy.c (af_dummy_writing_system_class): Updated.
* src/autofit/afindic.c (af_cjk_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
* src/autofit/aflatin.c (af_latin_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
* src/autofit/aflatin.c (af_latin_get_standard_width): New function.
(af_indic_writing_system_class): Updated.
Actual code follows in a later commit.
* include/freetype/ftautoh.h: Document `no-stem-darkening' and
`darkening-parameters'.
* src/autofit/afmodule.h: New fields `no_stem_darkening' and
`darken_params'.
* src/autofit/afmodule.c (af_property_set, af_property_get):
Handle them.
(af_autofitter_init): Initialize them.
Currently, libFuzzer only supports mutation of a single file. We
circumvent this problem by using an uncompressed tar archive as
multiple-file input for the fuzzer.
This patch enables tests of `FT_Attach_Stream' and AFM/PFM parsing;
a constructed tarball should contain a font file as the first
element, and files to be attached as further elements.
* src/tools/ftfuzzer/ftfuzzer.cc: Include libarchive headers.
(archive_read_entry_data, parse_data): New functions.
(LLVMFuzzerTestOneInput): Updated.
* src/tools/ftfuzzer/ftmutator.cc: New file, providing a custom
mutator for libFuzzer that can mutate tarballs in a sensible way.
* src/autofit/afhints.c (af_print_idx, af_get_segment_index,
af_get_edge_index): New functions.
(af_glyph_hints_dump_points): Remove unnecessary `|', `[', and `]'.
Add segment and edge index for each point.
Slightly change printing order of some elements.
Don't print `-1' but `--' for missing elements.
(af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Remove
unnecessary `|', `[', and `]'.
Don't print `-1' but `--' for missing elements.
Problem reported by Nikolay Sivov <bunglehead@gmail.com>.
* src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Avoid zero value
for `metrics->height' by applying some heuristics.
This modifies the addition of subroutine number to subroutine bias
from unsigned to signed, but does not change any results.
* src/cff/cf2ft.c (cf2_initGlobalRegionBuffer,
cf2_initLocalRegionBuffer): Change variable names from (unsigned)
`idx' to (signed) `subrNum', since it is not an index until after
the bias is added.
* src/cff/cf2ft.h: Updated.
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdCALLSUBR>:
Updated similarly.
* src/cid/cidload.c (parse_fd_array): Check `num_dicts' against
stream size.
(cid_read_subrs): Check largest offset against stream size.
(cid_parse_dict): Move safety check to ...
(cid_face_open): ... this function.
Also test length of binary data and values of `SDBytes',
`SubrMapOffset', `SubrCount', `CIDMapOffset', and `CIDCount'.
Due to incorrect casting negative numbers were shown as very large
(positive) integers on 64bit systems.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_none>:
Use division instead of shift.