src/truetype


Log

Author Commit Date CI Message
Ben Wagner d3dc2da9 2021-06-30T18:22:29 * src/truetype/ttgxvar.c (tt_set_mm_blend): Test `coords`. It is undefined behavior to pass `NULL` to `memcpy`. `coords' is passed to `memcpy` but `TT_Get_MM_Blend` and `TT_Get_Var_Design` explictly call `tt_set_mm_blend` with `coords` as `NULL`. In addition, `TT_Set_MM_Blend` has a similar possible issue.
Werner Lemberg b460a506 2021-06-19T07:03:40 [truetype] Fix integer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=35312 * src/truetype/ttinterp.c (Ins_JMPR): Use `ADD_LONG`.
Alexei Podtelezhnikov 9bfecfd2 2021-06-09T23:34:04 * src/truetype/ttinterp.c (TT_RunIns): Optimize tracing.
Werner Lemberg a50c39aa 2021-05-29T09:50:29 Fix compilation errors and (some) warnings for clang++. * src/autofit/afmodule.c (AF_GlyphHintsRec): Make it static. * src/cache/ftcache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c (ftc_snode_compare): Remove semicolon. * src/cff/cffparse.c (cff_parser_run): Add `break` statement. * src/cid/cidload.c (cid_hex_to_binary): Add cast. * src/sdf/ftbsdf.c (CHECK_NEIGHBOR): Use `do {} while(0)` loop. (bsdf_init_distance_map, finalize_sdf, bsdf_raster_render): Add casts. * src/sdf/ftsdf.c (sdf_generate_bounding_box, sdf_generate_with_overlaps): Ditto. * src/sdf/ftsdfcommon.h (square_root): Ditto. * src/sdf/ftsdfrend.c (sdf_property_get, ft_sdf_render, ft_bsdf_render): Ditto. * src/sfnt/ttcolr.c (find_base_glyph_record, find_base_glyph_v1_record): Fix variable signedness. (read_color_line): Add cast. (read_paint): Add casts. Fix signedness issue. (tt_face_get_colorline_stops) Fix signedness issues. * src/sfnt/ttpost.c (load_format_20): Add casts. * src/truetype/ttsubpix.c (TWEAK_RULES, TWEAK_RULES_EXCEPTIONS): Remove final semicolons.
Alexei Podtelezhnikov 56ae9430 2021-05-01T09:14:04 [truetype] Avoid some memory zeroing. * src/truetype/ttinterp.c (Init_Context): Tweak allocation macro. * src/truetype/ttpload.c (tt_face_load_cvt): Ditto.
Ben Wagner 52f2a008 2021-04-01T09:33:47 Update TT_New_Context documentation In commit 531d463aed365b [truetype] Allocate TT_ExecContext in TT_Size instead of TT_Driver. the `TT_ExecContext` was moved from being on the driver to being on the size to make it easier to use FreeType in a multi-threaded environment. However, the documentation for `TT_New_Context` was not updated and still reflects the old behavior and parameter list. This change updates `TT_New_Context` documentation to reflect the current parameters and usage.
Ben Wagner 369d8be9 2021-03-31T22:31:44 [truetype] Prevent glyph program state from persisting. `FDEF` instructions are specified as allowed only in 'prep' or 'fpgm'. FreeType has attempted to prevent their use in the glyph program, but they were still allowed in glyph programs if defined in a function defined in 'prep' or 'fpgm' and called from the glyph program. Similarly, `IDEF` instructions are specified not to be able to modify any existing instruction. FreeType has attempted to prevent their use in the glyph program, but they can still be used like `FDEF`. This change stores the initial bytecode range type and disallows the use of `FDEF` and `IDEF` while running the glyph program. Most other state is copied from the `TT_Size` into the execution context. However, it is possible for a glyph program to use `WS` to write to the storage area or `WCVTP`, `WCVTF`, and `DELTAC[123]` to write to the control value table. Allowing any change to the global state from the glyph program is problematic as the outlines of any given glyph may change based on the order the glyphs are loaded or even how many times they are loaded. There exist fonts that write to the storage area or the control value table in the glyph program, so their use should not be an error. Possible solutions to using these in the glyph program are * ignore the writes; * value-level copy on write, discard modified values when finished; * array-level copy on write, discard the copy when finished; * array-level copy up-front. Ignoring the writes may break otherwise good uses. A full copy up-front was implemented, but was quite heavy as even well behaved fonts required a full copy and the memory management that goes along with it. Value-level copy on write could use less memory but requires a great deal more record keeping and complexity. This change implements array-level copy on write. If any attempt is made to write to the control value table or the storage area when the initial bytecode range was in a glyph program, the relevant array will be copied to a designated storage area and the copy used for the rest of the glyph program's execution. * src/truetype/ttinterp.h (TT_ExecContextRec): New fields `iniRange`, `glyfCvtSize`, `glyfCvt`, `origCvt`, `glyfStoreSize`, `glyfStorage`, and `origStorage`. * src/truetype/ttinterp.c (Modify_CVT_Check): New function to handle `exc->glyfCvt`. (Write_CVT, Write_CVT_Stretched, Move_CVT, Move_CVT_Stretched): Use it. (Ins_WS): Handle `exc->glyfStorage`. (Ins_FDEF, Ins_IDEF): Updated. (TT_RunIns): Updated. (TT_Done_Context): Free 'glyf' CVT working and storage area. (TT_Load_Context): Fix/add casts. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix cast.
Werner Lemberg 2149b51f 2021-03-13T19:08:09 Handle various VC++ compiler warnings. Fixes #1039. * src/base/ftstroke.c (ft_stroker_inside, ft_stroker_outside): Initialize `sigma`. * src/sdf/ftsdf.c (sdf_generate_with_overlaps): Exit immediately if function arguments are invalid. * src/sdf/ftsdfrend.c (sdf_property_set) <"overlaps">: Fix cast. * src/sfnt/sfwoff2.c (woff2_decompress) [!FT_CONFIG_OPTION_USE_BROTLI]: Use `FT_UNUSED`. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `fvar_head`.
Werner Lemberg d924a66a 2021-02-04T07:44:06 * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. This ensures good logging output, with all lines having a proper prefix (if requested). This is a continuation of a similar patch from 2020-12-02, which missed some locations.
Werner Lemberg b6e8a712 2021-01-17T07:18:48 Update all copyright notices.
Werner Lemberg c6ff2556 2020-12-26T10:50:21 [sdf] Use 'counter-clockwise', not 'anti-clockwise'. We prefer US nomenclature. * src/sdf/ftsdf.c (SDF_Contour_Orientation): s/SDF_ORIENTATION-ACW/SDF_ORIENTATION_CCW/. Update all users.
Chris Liddell f6be9276 2020-12-16T06:03:10 [truetype] Fix incremental metrics (#59503). * src/truetype/ttgload.c (tt_get_metrics, load_truetype_glyph): Previously, the code would populate the phantom points before calling the `get_glyph_metrics` callback. For formats like PCL XL format 1, class 2 downloaded fonts (where metrics are removed from the TTF header), this causes problems when the hinting program uses the phantom points (misplaced and distorted glyphs) due to the metrics being unset (all zeros). (tt_get_metrics_incr_overrides): Renamed to... (tt_get_metrics_incremental): ... this. Updated caller * include/freetype/ftincrem.h: Update the documentation to make it clearer that `get_glyph_metrics` is to retrieve metrics from a non-standard source, but *not* for the purpose of imposing custom metrics.
Werner Lemberg 272ae5ee 2020-12-07T10:29:24 * src/*: More fixes for using a '\n' in `FT_TRACE` and `FT_ERROR`.
Werner Lemberg a6adb256 2020-12-02T14:15:07 * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`. This ensures good logging output, with all lines having a proper prefix (if requested).
Priyesh Kumar 6d9e6b21 2020-08-28T09:56:38 * src/*: Fix `-Wformat` warnings.
Alexei Podtelezhnikov 1286f58c 2020-11-20T14:54:35 Downgrade property tracing.
Werner Lemberg 804e625d 2020-10-28T13:34:52 [truetype] Minor update to forthcoming OpenType 1.8.4 standard. * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): Limit size of `regionCount`.
Alexei Podtelezhnikov 600d59e3 2020-09-02T15:48:03 [truetype] Reduce Infinality footprint (cont'd). * src/truetype/ttinterp.c (Ins_DELTAP): Shrink variable scope. (Ins_SHPIX, Ins_MIRP): Revise if-logic.
Alexei Podtelezhnikov 51a5e338 2020-09-02T00:02:28 [truetype] Reduce Infinality footprint. * src/truetype/ttinterp.c (Ins_SHPIX, Ins_MSIRP, Ins_MIAP, Ins_MDRP, Ins_MIRP): Shrink variable scopes and consolidate ifdefs.
Alexei Podtelezhnikov e6c7e4b4 2020-09-01T21:49:52 [truetype] Refactor compensation color. * src/truetype/ttinterp.h (TT_Round_Func): Change the last argument. * src/truetype/ttinterp.c (Ins_ROUND, Ins_NROUND, Ins_MDAP, Ins_MIAP, Ins_MDRP, Ins_MIRP): Move compensation retrieval from here... (Round_*): ... to here. * src/truetype/ttobjs.c (tt_size_init_bytecode): Reserve zero compensation at color index 3.
Werner Lemberg cdc009c2 2020-08-22T13:30:11 * src/truetype/ttgload.c (TT_Get_VMetrics): Add tracing message.
Alexei Podtelezhnikov f9f6adb6 2020-08-05T08:24:15 [truetype] Retain OVERLAP_SIMPLE and OVERLAP_COMPOUND. For glyphs with OVERLAP_SIMPLE or OVERLAP_COMPOUND, set FT_OUTLINE_OVERLAP to render them with direct oversampling, which mitigates artifacts (see 3bb512bc9f62). * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Redefine to rhyme with OVERLAP_SIMPLE. * src/base/ftgloadr.c (FT_GlyphLoader_Rewind): Reset outline flags. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Retain OVERLAP_SIMPLE. (load_truetype_glyph): Retain OVERLAP_COMPOUND.
Alexei Podtelezhnikov 3a1f4b7a 2020-08-04T22:17:05 * src/truetype/ttgload.c (TT_Load_Glyph): More tracing.
Priyesh Kumar 53be1753 2020-07-28T07:33:40 Fix `-Wformat' compiler warnings. * src/*: Fix format specifiers. * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
Werner Lemberg 8cfc41ae 2020-07-25T12:23:22 Fix `-Wformat' compiler warnings. Problem reported by Priyesh kumar <priyeshkkumar@gmail.com> * src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments to tracing macro. * src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property): Ditto. * src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto. Reformulate message. * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto. * src/sfnt/sfwoff2.c (woff2_open_font): Ditto. Trace table offset, too. * src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
Werner Lemberg 96fb73ef 2020-07-07T16:58:14 Fix clang warnings. * include/freetype/internal/autohint.h (FT_DECLARE_AUTOHINTER_INTERFACE): New macro. * src/autofit/afmodule.h: Use it to declare `af_autofitter_interface'. * include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro. * src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and `ft_outline_glyph_class'. * src/base/ftglyph.c: Include `ftbase.h'. * src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'. * src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'. * src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'. * src/psaux/psauxmod.h: Declare `afm_parser_funcs', `t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'. * src/pshinter/pshmod.c: Include `pshmod.h'. * src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign conversion. (compute_ULong_sum): Fix return type. Fix implicit sign conversion. (store_points): Fix type of `last_flag', `repeat_count', and `flag'. Use casts to avoid warnings. (reconstruct_glyf): Fix implicit sign conversion. Use cast to avoid warning. (get_x_mins): Fix implicit sign conversion. * src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'. * src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to declare cmap classes. * src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast. * src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
Werner Lemberg 16586859 2020-06-13T21:15:45 Remove redundant inclusion of `ft2build.h'. * */*: Remove `#include <ft2build.h>' where possible. * include/freetype/freetype.h: Remove cpp error about missing inclusion of `ft2build.h'.
David Turner e1339133 2020-06-08T13:31:55 Make macros for header file names optional. We no longer have to take care of the 8.3 file name limit; this allows us (a) to introduce longer, meaningful file names, and (b) to avoid macro names in `#include' lines altogether since some compilers (most notably Visual C++) doesn't support this properly. */*: Replace #include FOO_H with #include <freetype/foo.h> or something similar. Also update the documentation.
David Turner 4eee1340 2020-05-18T09:16:12 Remove Jamfile files from the tree. These have not been used in a very, very long time, so better remove them. A corresponding patch will be submitted to the `freetype2-demos' repository. * src/Jamfile, src/*/Jamfile, Jamrules: Delete.
Jakub Alba a45da253 2020-05-08T10:59:37 * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#58319). The font that exceeds the old limit is Icono Regular, version 1.00000.
Ben Wagner 11975fe9 2020-02-29T20:18:00 Fix state of `FT_Face' for buggy `gvar' tables (#57923). By resetting the blend as implemented with this commit fonts with invalid `gvar' tables may keep calling into `ft_var_load_gvar' from `tt_set_mm_blend' and failing, but the font was invalid anyway and we want to keep seeing the failure in `tt_set_mm_blend'. * src/truetype/ttgxvar.c (ft_var_load_gvar): Calculate length of offset array once. Allocate arrays after `FT_FRAME_ENTER' (extra check before allocating and avoid needing to free array later if error entering frame). Always call `FT_FRAME_EXIT'. Consistently set counts immediately after array initialized. Reset the blend (particularly `blend->glyphoffsets') on failure.
Ben Wagner 216e0776 2020-02-28T07:43:00 [truetype] Add better checks for loading `gvar' table (#57905). * src/truetype/ttgxvar.c (ft_var_load_gvar): Delay settings of any `blend->xxxcount' values until the corresponding data has been checked. Also do some sanitizing to avoid a too early exit. (TT_Vary_Apply_Glyph_Deltas): Improve tracing message.
Werner Lemberg 4a19a53d 2020-02-04T13:37:19 * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#57732). The font that exceeds the old limit is Constantine, version 1.001.
Werner Lemberg e5038be7 2020-01-19T17:05:19 Update all copyright notices.
Dominik Röttsches 10d8de75 2019-12-30T11:22:04 [truetype] Fix UBSan warning on offset to nullptr (#57501). * src/truetype/ttinterp.c (Ins_CALL): Fail if `exc->FDefs' is null.
Dominik Röttsches 8cee1dde 2019-12-17T14:12:38 Fix more UBSan warnings on adding offset to nullptr (#57432). * src/truetype/ttinterp.c (Ins_LOOPCALL), src/psaux/psft.c (cf2_initLocalRegionBuffer): Use `FT_OFFSET'.
Werner Lemberg 7e1b39f6 2019-12-16T11:07:58 [truetype] Fix UBSan warnings on adding offsets to nullptr. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=1032152 * src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Use `FT_OFFSET'.
Werner Lemberg 0c14a3ad 2019-12-14T00:04:01 [truetype] Fix integer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19305 * src/truetype/ttinterp.c (Ins_MIRP): Use `ADD_LONG'.
Werner Lemberg dfc9a049 2019-12-05T08:44:30 * src/truetype/ttinterp.c (TT_RunIns): Use `FT_OFFSET'. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=1030614
Werner Lemberg 551bd3a9 2019-12-03T11:52:48 More nullptr offset UBSan warnings (#57331, #57347). * src/autofit/afcjk.c (af_cjk_hints_compute_segments), src/psaux/psft.c (cf2_getSeacComponent), src/truetype/ttinterp.c (Ins_UNKNOWN): Use `FT_OFFSET'.
Werner Lemberg 9df460b6 2019-11-23T11:09:40 [truetype] Avoid sanitizer warning (#57289). * src/truetype/ttpload.c (tt_face_get_device_metrics): Use `FT_OFFSET'.
Armin Hasitzka c67b9a1c 2019-11-23T11:01:18 [truetype] Fix integer overflow (#57287). * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
Werner Lemberg 59415658 2019-08-27T14:07:14 [truetype] Prevent crash in `TT_Set_Named_Instance' (#56813). * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Fix error handling.
Werner Lemberg 7d1d3b9a 2019-08-26T09:08:56 [type1] Fix `FT_Get_Var_Axis_Flags' (#56804). * src/type1/t1load.c (T1_Get_MM_Var): Allocate space for axis flags. Also remove redundant assignment.
Ben Wagner 12e4307d 2019-07-12T10:48:10 Properly handle phantom points for variation fonts (#56601). * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Scale phantom points if HVAR and/or VVAR is present.
Alexei Podtelezhnikov d1b16325 2019-06-11T21:43:47 * src/truetype/ttobjs.c (tt_check_trickyness_family): Add `const'.
Ben Wagner f37083ed 2019-05-29T08:15:38 [truetype] Fix copy-and-paste error (#56409). * src/truetype/ttgload.c (load_truetype_glyph): Use correct indices into `unrounded' array for phantom points.
Werner Lemberg 49079ce2 2019-05-29T08:08:53 [truetype] Fix 32bit builds (#56404). Patch suggested by Ben Wagner <bungeman@google.com>. * src/truetype/ttgxvar.c (FT_fixedToInt, FT_fixedToFdot6): Remove harmful cast to unsigned type.
Ben Wagner 86d997e5 2019-05-26T09:37:41 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Improve accuracy.
Werner Lemberg 306d2f6c 2019-05-23T14:41:57 [truetype] Draw glyphs without deltas in variation font (#56374). * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Always fill `unrounded' array.
Werner Lemberg c3be6f06 2019-05-21T11:23:36 src/truetype/ttinterp.c: Give order of operations for some instructions.
Werner Lemberg 262fce44 2019-05-21T09:58:51 * src/truetype/ttinterp.c (opcode_name): Improve mnemonics.
Werner Lemberg 8eafa528 2019-05-21T09:57:38 ttinterp.c: Improve documentation of engine compensation.
Werner Lemberg b0522701 2019-05-16T12:52:57 [truetype] Actually scale varied CVT values. Up to now, only the unscaled CVT values were varied; in other words, the `CVAR' data was never used for bytecode hinting. * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): New auxiliary function. (tt_face_vary_cvt): Use it to trigger rescaling of CVT values.
Werner Lemberg 37580053 2019-05-16T12:15:54 [truetype] Use 26.6 format for storing unscaled CVT values. If `CVAR' data is applied to variation fonts, fractional values are possible. * include/freetype/internal/tttypes.h (TT_FaceRec): Change type of `cvt' from `FT_Short' to `FT_Int32'. * src/truetype/ttgxvar.c (FT_fdot6ToFixed): New macro. (tt_face_vary_cvt): Use it to update code to 26.6 format. * src/truetype/ttobjs.c (tt_size_run_prep): Update code to 26.6 format. * src/truetype/ttpload.c (tt_face_load_cvt): Stora data in 26.6 format.
Werner Lemberg ac335cd5 2019-05-16T10:15:53 * src/truetype/ttgload.c (load_truetype_glyph): Init `unrounded'. This fixes linear advance width values for spacing glyphs. Bug introduced 2019-05-09.
Werner Lemberg 535b687e 2019-05-16T09:55:16 [truetype] Avoid code duplication. * src/truetype/ttobjs.c (tt_size_run_prep): Scale CVT values in this function. (tt_size_ready_bytecode): Updated. * src/truetype/ttgload.c (tt_loader_init): Updated.
Werner Lemberg 94ebc248 2019-05-12T21:05:36 [truetype] Doh. Fix last commit to make it work. Very embarassing :-) Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14701 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14705 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14710 * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): Move up and add argument; update all callers. (TT_Process_Simple_Glyph): Use it. The `unrounded' array is active for variation fonts only, thus also enclose related code with `#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT ... #endif' where necessary. Revert commit a113e5d from 2019-05-09, and don't use `extra_points2' but allocate a temporary array. Speed up the scaling of the `unrounded' array. * src/truetype/ttgxvar.c (FT_fixedToInt, FT_FixedToFdot6): Fix type conversions and rounding. The unsigned type must have more or equal bits to the signed type.
Werner Lemberg 1178227b 2019-05-11T09:29:19 [truetype] Increase precision of font variation (#54371). This patch make FreeType use font units in 26.6 format internally instead of integers. * src/truetype/ttgxvar.c (FT_fixedToFdot6): New macro. (TT_Vary_Apply_Glyph_Deltas): Add argument to output unrounded font coordinates. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Use `extra_points2' array to temporarily hold unrounded point coordinates; use them to compute scaled coordinates and linear advance width and height. (load_truetype_code): Adjust similarly.
Werner Lemberg a113e5df 2019-05-09T11:37:58 * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Minor.
Werner Lemberg dc39f76c 2019-05-07T10:09:55 * src/truetype/ttgxvar.c: More use of `FT_fdot14ToFixed'.
Werner Lemberg 7b841047 2019-05-04T08:13:22 Various clang 8.0 static analyzer fixes. Reported by Sender Ghost <lightside@gmx.com>. * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Catch a corner case where `edge->first' could be NULL. * src/pfr/pfrobjs.c (pfr_slot_load): Remove unnecessary test of `size'. * src/raster/ftraster.c (Draw_Sweep): Catch a corner case where `draw_right' might be NULL. * src/sfnt/ttmtx.c (tt_face_get_metrics): Fix limit test for `aadvance'. Ensure `abearing' always hold a meaningful result. * src/truetype/ttgload.c (load_truetype_glyph): Ensure `subglyph' is not NULL before accessing it. * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Remove unnecessary test of `namedstyle'. * src/type42/t42parse.c (t42_parser_done): Ensure `parser->root.funcs.done' is not NULL before accessing it.
Werner Lemberg af400438 2019-04-22T07:41:35 Fix return value of `FT_Set_Named_Instance' (#56186). * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Correctly handle internal return value -1 of `TT_Set_Var_Design'.
Werner Lemberg 75859970 2019-02-23T10:07:09 Update all copyright notices.
Armin Hasitzka b77826e1 2019-02-21T10:23:15 Triage 8ea854bfe92443706d55656072f891ec8f2cb3c2.
Armin Hasitzka 8ea854bf 2019-02-21T10:14:57 [truetype] Mask numeric overflows. * src/truetype/ttinterp.c (Move_CVT, Move_CVT_Stretched, Ins_MIRP): Mask numeric overflows. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11681 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11734
Werner Lemberg b66d6a91 2019-02-06T07:38:25 CHANGES: Document recent metrics change from Nikolaus.
Nikolaus Waxweiler a6feefdf 2019-02-02T15:50:57 [truetype] Apply MVAR hasc, hdsc and hlgp metrics to current FT_Face metrics. Instead of setting typo or win metrics as the new FT_Face metrics indiscriminately, apply only typo deltas to the currently active FT_Face metrics. This prevents line height differences when e.g. the default outlines were used as the regular face and instances for everything else. * src/truetype/ttgxvar.c (tt_apply_mvar): Implement.
Werner Lemberg f686ad46 2019-01-22T20:31:44 Update copyright years.
Werner Lemberg afa043de 2018-12-25T22:44:05 Fix links (mostly http -> https).
Werner Lemberg 2b4e61e4 2018-12-12T09:36:39 Minor documentation fixes.
Werner Lemberg 3e8a2283 2018-12-11T23:54:17 * src/truetype/ttgload.c (TT_Hint_Glyph): Remove useless test. `control_len' only gets its value from `n_ins' (and vice versa), which is always read as `unsigned short' and thus can't be larger than 0xFFFF.
Chris Liddell 78a1e695 2018-11-27T22:24:06 [type1,cff] Add FT_{Set,Get}_MM_WeightVector API calls. For multiple master fonts, common usage (in Postscript) is to modify the WeightVector of an existing font instance, this addition supports that use. * include/freetype/ftmm.h, src/base/ftmm.c (FT_Set_MM_WeightVector, FT_Get_MM_WeightVector): New API functions. * include/freetype/internalservices/svmm.h (FT_Set_MM_WeightVector_Func, FT_Get_MM_WeightVector_Func): New function types. (MultiMasters): Add `set_mm_weightvector' and `get_mm_weightvector' members. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * src/cffcffdrivr.c (cff_set_mm_weightvector, cff_get_mm_weightvector): New functions. (cff_service_multi_masters): Register them. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. This driver doesn't use the new interface. * src/type1/t1load.c (T1_Set_MM_WeightVector, T1_Get_MM_WeightVector): New functions. * src/type1/t1driver.c (t1_service_multi_masters): Register them. * src/type1/t1load.h: Updated.
Ben Wagner 74cdd75f 2018-11-27T17:55:40 [truetype] Fix numeric overflow (#55103). * src/truetype/ttgload.c (compute_glyph_metrics): Use `SUB_LONG'.
Ben Wagner fb0d66d0 2018-11-07T00:47:44 [truetype] Fix VF check from 2018-09-12 (#54973). * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Use correct offsets for estimates.
Alexei Podtelezhnikov cc288e38 2018-11-04T22:09:16 Minor.
Alexei Podtelezhnikov 1f43affc 2018-11-04T13:11:16 * src/truetype/ttgxvar.c: Use enum definitions.
Alexei Podtelezhnikov d95a12b8 2018-11-03T23:02:58 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Adjust condition.
Alexei Podtelezhnikov 547f82f2 2018-11-03T23:00:36 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Tracing tweaks.
Alexei Podtelezhnikov ce3feb0b 2018-11-03T22:43:21 Revert due to specs: [truetype] Speed up variation IUP. This reverts commit 1e4496c54c010843c1bac56e5d344115d1a49620.
Alexei Podtelezhnikov dfa86d65 2018-11-03T22:36:52 Revert "[truetype] Speed up variation IUP." This reverts commit 1e4496c54c010843c1bac56e5d344115d1a49620.
Alexei Podtelezhnikov 61d50756 2018-11-02T20:42:25 * src/truetype/ttgxvar.c (ft_var_get_item_delta): Fixed logic. Reported and tested by Behdad.
Alexei Podtelezhnikov 1e4496c5 2018-10-31T23:17:33 [truetype] Speed up variation IUP. * src/truetype/ttgxvar.c (tt_delta_interpolate): Separate trivial snapping to the same position from true interpolation.
Alexei Podtelezhnikov 300da33d 2018-10-31T21:55:40 * src/truetype/ttgxvar.c (ft_var_get_item_delta): Optimized.
Werner Lemberg f262d15d 2018-10-07T07:40:37 Minor comment improvement.
Werner Lemberg a9af6914 2018-09-25T09:10:09 Fix handing of `FT_Bool'. Before this commit we had code like (FT_Bool)( globals->glyph_styles[gindex] & 0x8000) Since `FT_Bool' is defined to be an `unsigned char', the code evaluated to something like (unsigned char)( 0x8532 & 0x8000) which in turn expanded to (unsigned char)( 0x8000) and finally yielded 0x00 – i.e., false – not as expected. Problem reported and analyzed by Tony Smith <tony.smith@macro4.com>. * include/freetype/fttypes.h (FT_BOOL): Add a comparison against zero so that we always have a Boolean expression. */*: Replace castings to `FT_Bool' with calls to `FT_BOOL' where possible.
Werner Lemberg 10e54d04 2018-09-13T21:47:35 [truetype] Some fixes for VF checks. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10317 * src/truetype/ttgxvar.c (ft_var_load_gvar): Properly exit memory frame if we have invalid glyph variation data offsets. (tt_face_vary_cvt): Protect against missing `tuplecoords' array. Fix typo.
Werner Lemberg 65681e6d 2018-09-12T07:40:49 [truetype] Improve VF check. Triggered by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10255 * src/truetype/ttgxvar.c (ft_var_load_gvar): Use better limit check for `tupleCount'.
Werner Lemberg 53c5e4bd 2018-09-12T07:27:30 * src/truetype/ttgxvar.c (ft_var_load_gvar): Check `glyphoffsets'.
Werner Lemberg 1c04eed7 2018-09-07T06:40:55 [truetype] Fix assertion failure. Triggered by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10212 * src/truetype/ttgload.c (load_truetype_glyph): Reintroduce `opened_frame' (removed in a change from 2018-08-26) to handle dealloation of the second frame.
Werner Lemberg ae3afbc4 2018-08-26T15:40:16 * src/truetype/ttobjs.c (tt_size_read_bytecode): Trace CVT values.
Werner Lemberg 4738dcc4 2018-08-26T12:03:33 Minor tracing adjustments. * src/base/ftstream.c (FT_Stream_EnterFrame, FT_Stream_ExitFrame): Trace. * src/truetype/ttgload.c (TT_Access_Glyph_Frame): Remove tracing.
Werner Lemberg 6e339b8d 2018-08-26T11:59:02 [truetype] Avoid nested frames. Triggered by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10054 * src/truetype/ttgload.c (load_truetype_glyph): Don't use variable `opened_frame' to trace whether a frame must be closed at the end of function: This fails because `TT_Vary_Apply_Glyph_Deltas' (which gets called for space glyphs) uses a frame by itself. Instead, close the frame after loading the header, then use another frame for the remaining part of the glyph later on. Also avoid calling `tt_get_metrics' twice under some circumstances.
Werner Lemberg 45524679 2018-08-22T10:31:05 [truetype] Improve legibility of `glyf' parsing. * src/truetype/ttgload.c (ON_CURVE_POINT, X_SHORT_VECTOR, Y_SHORT_VECTOR, REPEAT_FLAG, X_POSITIVE, SAME_X, Y_POSITIVE, SAME_Y, OVERLAP_SIMPLE): New macros. (TT_Load_Simple_Glyph): Use new macros to make code more readable. Remove useless adjustment of `outline->tags' elements.
Werner Lemberg a0dd16fb 2018-08-15T18:13:17 Don't use `trace_' prefix for FT_COMPONENT arguments. * include/freetype/internal/ftdebug.h (FT_TRACE_COMP, FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix. (FT_TRACE): Use `FT_TRACE_COMP'. */* (FT_COMPONENT): Updated.
Werner Lemberg 1d7b034c 2018-08-14T15:48:17 Use formatting string in FT_TRACEX calls for non-simple arguments. * src/psaux/cffdecode.c (cff_decoder_parse_charstrings) <cff_op_hstem, cff_op_hintmask, cff_op_hlineto, cff_op_vhcurveto>: Do it. * src/psaux/pshints.c (cf2_hintmap_build): Ditto. * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM, cf2_cmdVSTEM, cf2_cmdHLINETO, cf2_cmdRRCURVETO, cf2_cmdCALLSUBR, cf2_escHSTEM3, cf2_cmdHINTMASK, cf2_cmdHVCURVETO>: Ditto. * src/truetype/ttinterp.c (TT_RunIns): Ditto.
Werner Lemberg 720ae67f 2018-08-05T07:21:10 * src/truetype/ttgload.c (compute_glyph_metrics): Fix overflow. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=777151
Werner Lemberg ced9c311 2018-08-04T07:03:57 Ditto.
Werner Lemberg be81acc4 2018-08-04T07:01:04 * src/truetype/ttinterp.c (opcode_name): Fix typos.
Werner Lemberg c9edca8e 2018-07-27T10:44:01 [truetype] Make `TT_Set_MM_Blend' idempotent (#54388). * src/truetype/ttgxvar.c (tt_set_mm_blend): Correctly set `face->doblend' if the current call to the function yields the same blend coordinates as the previous call.