src/truetype/ttgxvar.c


Log

Author Commit Date CI Message
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 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).
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`.
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.
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.
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 e5038be7 2020-01-19T17:05:19 Update all copyright notices.
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.
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.
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 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 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 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.
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.
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 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 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 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.
Werner Lemberg 839cb404 2018-07-16T05:45:45 * src/truetype/ttgxvar.c (tt_set_mm_blend): Fix off-by-one error. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9412
Werner Lemberg 6ceeb87f 2018-07-05T22:31:10 Fix more 32bit issues (#54208) * src/cff/cffload.c (cff_blend_build_vector): Convert assertion into run-time error. * src/truetype/ttgxvar.c (ft_var_to_normalized): Protect against numeric overflow.
Werner Lemberg 207ca38f 2018-06-25T18:50:00 [truetype] Fix memory leak. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Add initializers. Fix typo in `goto' destination. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9071
Werner Lemberg 589d1f08 2018-06-25T18:38:04 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Add initializers. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9070
Werner Lemberg a632fb54 2018-06-24T15:22:10 [truetype] Increase precision while applying VF deltas. It turned out that we incorrectly round CVT and glyph point deltas before accumulation, leading to severe positioning errors if there are many delta values to sum up. Problem reported by Akiem Helmling <akiem@underware.nl> and analyzed by Behdad. * src/truetype/ttgxvar.c (ft_var_readpackeddelta): Return deltas in 16.16 format. (tt_face_var_cvt): Collect deltas in `cvt_deltas', which is a 16.16 format array, and add the accumulated values to the CVT at the end of the function. (TT_Vary_Apply_Glyph_Deltas): Store data in `points_org' and `points_out' in 16.16 format. Collect deltas in `point_deltas_x' and `point_deltas_y', which are 16.16 format arrays, and add the accumulated values to the glyph coordinates at the end of the function.
Werner Lemberg 9ac9060d 2018-06-03T09:01:17 [GSoC] src/*.*: Convert block comments to `light' style. This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
Werner Lemberg 597cb3b4 2018-03-30T13:46:03 [truetype] Fix memory leak (only if tracing is on). * src/truetype/ttgxvar.c (TT_Get_MM_Var) [FT_DEBUG_LEVEL_TRACE}: Fix it.
Werner Lemberg 036bdc0c 2018-01-28T00:05:46 [truetype] Minor typo.
Werner Lemberg 68dddcdc 2018-01-27T23:59:30 [truetype] Better protection against invalid VF data. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5739 Bug introduced in commit 08cd62deedefe217f2ea50e392923ce8b5bc7ac7. * src/truetype/ttgxvar.c (TT_Set_Var_Design): Always initialize `normalizedcoords'.
Werner Lemberg f438e069 2018-01-27T14:39:15 * src/truetype/ttgxvar.c (tt_set_mm_blend): Minor.
Werner Lemberg ef486530 2018-01-27T11:16:22 [truetype] Better trace VF instances. * src/truetype/ttgxvar.c (ft_var_to_normalized): Don't emit number of coordinates. (TT_Get_MM_Var): Trace instance indices names. (TT_Set_Var_Design): Updated.
Werner Lemberg 50f693a7 2018-01-27T09:33:17 [truetype] Beautify tracing of VF axis records. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Show axis records in a table-like manner.
Werner Lemberg 994eb2b3 2018-01-26T23:17:43 [truetype] Fix multiple calls of `FT_Get_MM_Var' (#52955). * src/truetype/ttgxvar.c (TT_Get_MM_Var): Set `face->blend->num_axis' in case we have to initialize the `face->blend'.
Werner Lemberg 55d6abea 2018-01-03T19:01:15 * src/truetype/ttgxvar.c (ft_var_to_design): Remove dead code. This is a better fix than the previous commit, which is now reverted.
Werner Lemberg ecfdfd44 2018-01-03T00:20:11 [truetype] Make blend/design coordinate round-tripping work. Behdad reported that setting blend coordinates, then getting design coordinates did incorrectly return the default instance's coordinates. * src/truetype/ttgxvar.c (tt_set_mm_blend): Fix it.
Werner Lemberg 0a0c2256 2018-01-02T09:33:57 Update copyright year.
Werner Lemberg 08cd62de 2017-12-20T22:06:19 Speed up FT_Set_Var_{Design,Blend}_Coordinates if curr == new. We exit early if the current design or blend coordinates are identical to the new ones. * src/truetype/ttgxvar.c (tt_set_mm_blend, TT_Set_Var_Design): Implement it, returning internal error code -1 if there will be no variation change. * src/type1/t1load.c (t1_set_mm_blend): Ditto. * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Updated.
Werner Lemberg 0579d545 2017-12-18T23:45:58 Update incorrect ChangeLog entry.
Matthias Clasen bdab6578 2017-12-18T20:45:17 [truetype] Minor code beautification. * src/truetype/ttgxvar.c (ft_var_to_normalized): Trace number of design coordinates. Simplify code.
Werner Lemberg 2fe272ac 2017-12-18T19:40:07 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Add size guard (#52688).
Werner Lemberg e7935f29 2017-12-18T07:29:57 [truetype] Don't apply HVAR and VVAR deltas twice (#52683). * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Always adjust `pp1' to `pp4', except if we have an HVAR and/or VVAR table. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Handle alternative code branch identically w.r.t. presence of an HVAR and/or VVAR table.
Jonathan Kew 361af72e 2017-12-17T15:07:02 [truetype] Correctly handle variation font phantom points (#52683). * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix phantom point indices.
Werner Lemberg 71fecc53 2017-12-05T12:06:29 Improve tracing messages by using singular and plural forms. * src/*/*.c: Implement it.
Werner Lemberg 337e49cf 2017-12-04T12:36:07 [truetype] Allow shared points in `cvar' table (#52532). * src/truetype/ttgxvar.c (tt_face_vary_cvt): Implement it by copying and adjusting the corresponding code from `TT_Vary_Apply_Glyph_Deltas'.
Werner Lemberg f89c67f0 2017-10-07T13:10:53 [cff, truetype] Adjust behaviour of named instances. This commit completely separates the interaction between named instances and variation functions. In particular, resetting the variation returns to the current named instance (if set) and not to the base font. As a side effect, variation functions no longer change the named instance index. * src/cff/cffobjs.c (cff_face_init): Use MM service's `set_instance' function. Also apply `MVAR' table to named instances. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add cast. (tt_set_mm_blend): No longer check whether requested variation coincides with a named instance. (TT_Set_Var_Design): Use current named instance for default coordinates. * src/truetype/ttobjs.c (tt_face_init): Use `TT_Set_Named_Instance'.
Werner Lemberg e9ef538a 2017-10-07T12:57:11 Make `FT_Set_Named_Instance' work. * src/cff/cffdrivr.c (cff_set_instance): New function. (cff_service_multi_masters): Register it. * src/truetype/ttgxvar.c (TT_Set_Named_Instance): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Register it. * src/type1/t1load.c (T1_Reset_MM_Blend): New function. * src/type1/t1load.h: Updated. * src/type1/t1driver.c (t1_service_multi_masters): Register it.
Werner Lemberg 8c92f762 2017-10-07T12:12:49 Make `FT_FACE_FLAG_VARIATION' work. * include/freetype/internal/tttypes.h (TT_Face): Remove `is_default_instance'; this can be replaced with a combination of `FT_IS_VARIATION' and `FT_IS_INSTANCE'. * src/cff/cffdrivr.c (cff_get_advances): Updated. * src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/sfobjs.c (sfnt_init_face): Updated. * src/truetype/ttdriver.c (tt_get_advances), src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph, IS_DEFAULT_INSTANCE), src/truetype/ttgxvar.c (tt_set_mm_blend): Updated. * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): Handle `FT_FACE_FLAG_VARIATION'. * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Handle `FT_FACE_FLAG_VARIATION'.
Werner Lemberg b19cdc9c 2017-09-21T11:02:35 [truetype] Fix `mmvar' array pointers, part 2. The previous commit was incomplete. * src/truetype/ttgxvar.c: Properly initialize sub-array offsets for `master' also.
Werner Lemberg 3b3cb32d 2017-09-21T09:03:20 [truetype] Fix `mmvar' array pointers. Without this change, clang's AddressSanitizer reports many runtime errors due to misaligned addresses. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use multiples of pointer size for sub-array offsets into `mmvar'.
Werner Lemberg f43b3094 2017-08-05T18:22:17 [base, truetype] New function `FT_Get_Var_Axis_Flags'. The reserved `flags' field got a value in OpenType version 1.8.2; unfortunately, the public `FT_Var_Axis' structure misses the corresponding element. Since we can't add a new field, we add an access function. * src/base/ftmm.c (FT_Get_Var_Axis_Flags): New function. * include/freetype/ftmm.h (FT_VAR_AXIS_FLAG_HIDDEN): New macro. Updated. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Increase allocated memory of `mmvar' to hold axis flags. Fill the axis flags array. * docs/CHANGES: Updated.
Werner Lemberg 7e508242 2017-08-01T12:44:35 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix thinko.
Behdad Esfahbod 55bbb98f 2017-08-01T09:17:02 [truetype] Fix loading of named instances. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Preserve file position while loading the `avar' table.
Werner Lemberg 4261e497 2017-07-05T23:00:23 * src/truetype/ttgxvar.c (FT_Stream_SeekSet): Fix warning (#51395).
Werner Lemberg 1c85479d 2017-07-04T08:08:54 [truetype] Prevent address overflow (#51365). * src/truetype/ttgxvar.c (FT_Stream_SeekSet): Add guard.
Werner Lemberg 5f2a72cb 2017-06-10T11:29:24 [truetype] Fix TT_Set_Var_Design. Reported by Nikolaus Waxweiler <madigens@gmail.com>. * src/truetype/ttgxvar.c (TT_Set_Var_Design): Correctly handle the case where we have less input coordinates than axes.
Werner Lemberg a9331c0f 2017-05-27T15:50:25 [truetype] Fix handling of design coordinates (#51127). * src/truetype/ttgxvar.c (tt_set_mm_blend): Compute all design coordinates if we have to create the `blends->coord' array. (TT_Get_MM_Blend, TT_Get_Var_Design): Select default instance coordinates if no instance is selected yet.
Behdad Esfahbod 60bf264e 2017-05-02T14:38:54 [truetype] Make `IUP' gvar deltas do the same as Apple (#50832). When points are not touched by gvar interpolation deltas, FreeType gave a slightly different result than Apple's CoreText. The OpenType working group will update the specification to document the following behaviour: If the two points with deltas to the `left' and `right' of the untouched point have the same coordinate, then the inferred delta for the untouched point should be zero. * src/truetype/ttgxvar.c (tt_delta_interpolate): Implement new behaviour.
Werner Lemberg da38be83 2017-03-30T13:24:03 [truetype] Fix HVAR and VVAR handling (#50678). * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Handle glyph indices larger than `mapCount' as described in the specification.
Werner Lemberg 1ede3674 2017-03-30T00:26:31 [truetype] Fix thinko related to PS name of default named instance. * src/truetype/ttgxvar.c (TT_Get_MM_Var): `strid' and `psid' are name ID values, not indices into the array of name entries.
Werner Lemberg 9931175d 2017-03-18T07:06:49 Improve `make multi'. * src/autofit/aflatin2.c: Guard file with FT_OPTION_AUTOFIT2. * src/base/ftmac.c: Guard more parts of the file with FT_MACINTOSH. * src/psaux/afmparse.c: Guard file with T1_CONFIG_OPTION_NO_AFM. * src/sfnt/pngshim.c: Guard file with TT_CONFIG_OPTION_EMBEDDED_BITMAPS also. * src/sfnt/ttbdf.c: Avoid empty source file. * src/sfnt/ttpost.c: Guard file with TT_CONFIG_OPTION_POSTSCRIPT_NAMES. * src/sfnt/ttsbit.c: Guard file with TT_CONFIG_OPTION_EMBEDDED_BITMAPS. * src/truetype/ttgxvar.c, src/truetype/ttinterp.c: Avoid empty source file. * src/truetype/ttsubpix.c: Guard file with TT_USE_BYTECODE_INTERPRETER also. * src/type1/t1afm.c: Guard file with T1_CONFIG_OPTION_NO_AFM. * src/autofit/autofit.c, src/base/ftbase.c, src/cache/ftcache.c, src/cff/cff.c, src/cid/type1cid.c, src/gxvalid/gxvalid.c, src/pcf/pcf.c, src/pfr/pfr.c, src/psaux/psaux.c, src/pshinter/pshinter.c, src/psnames/psnames.c, src/raster/raster.c, src/sfnt/sfnt.c, src/smooth/smooth.c, src/truetype/truetype.c, src/type1/type1.c, src/type42/type42.c: Remove conditionals; sort entries.
Werner Lemberg d9ff6f20 2017-03-16T20:20:51 * src/truetype/ttgxvar.c (tt_done_blend): Free `vvar_table'. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=883
Werner Lemberg 981c23b7 2017-03-15T11:35:26 Remove clang compiler warnings (#50548). * include/freetype/internal/tttypes.h (TT_FaceRec): Make `var_postscript_prefix_len' unsigned. * src/autofit/afwarp.c (af_warper_compute_line_best): Remove redundant assignment. * src/cff/cffload.c (cff_subfont_load): Add casts. * src/cff/cffparse.c (cff_parse_blend): Remove redundant assignment. * src/sfnt/sfdriver.c (fmix32, murmur_hash_3_128): Add `static' keyword. Add casts. (fixed2float): Add cast. (sfnt_get_var_ps_name): Make `p' always initialized. Add casts. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add casts.
Werner Lemberg 34010f7c 2017-03-14T21:50:22 [sfnt] Implement PS names for font instances [3/3]. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * include/freetype/internal/tttypes.h (TT_FaceRec): New fields `var_postscript_prefix' and `var_postscript_prefix_len'. * src/sfnt/sfdriver.c: Include FT_TRUETYPE_IDS_H. (sfnt_is_alphanumeric): New wrapperfunction for `ft_isalnum'. (get_win_string, get_apple_string): Remove `const' from return value. (MAX_VALUE_DESCRIPTOR_LEN, MAX_PS_NAME_LEN): New macros. (hexdigits): New array. (sfnt_get_var_ps_name): New function, implementing Adobe TechNote 5902 to construct a PS name for a variation font instance. (sfnt_get_ps_name): Call `sfnt_get_var_ps_name' for font instances. * src/sfnt/sfobjs.c (sfnt_done_face): Updated. * src/truetype/ttgxvar.c (tt_set_mm_blend): Reset `face->postscript_name' to trigger recalculation for new instance parameters.
Werner Lemberg 447a0b62 2017-03-13T07:42:34 [truetype] Ignore invalid MVAR tags. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=838 * src/truetype/ttgxvar.c (ft_var_load_mvar): Ignore value and emit warning for invalid tags. (tt_apply_mvar): Ignore invalid tags.
Werner Lemberg 5eb0fd5e 2017-03-12T20:46:56 [truetype] Store and use design coordinates also. * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func): Add `normalizedcoords' argument. * src/truetype/ttgxvar.h (GX_BlendRec): Add `coords' field to store the design coordinates of the current instance. Updated. * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Move functionality to... (tt_set_mm_blend): ... New function. Convert data in `normalizedcoords' array to `coords' array on demand. (TT_Set_Var_Design): Store argument data in `coords' array. (TT_Get_Var_Design): Get data from `coords' array. (tt_get_var_blend): Updated. (tt_done_blend): Updated. * src/cff/cffload.c, src/cff/cffload.h (cff_get_var_blend): Updated. * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated. * src/cff/cffobjs.c (cff_face_init): Updated.
Werner Lemberg 4a62922b 2017-03-12T10:19:53 src/truetype/ttgxvar.[ch]: s/avar_checked/avar_loaded/.
Werner Lemberg 27fee7f8 2017-03-06T20:45:44 [sfnt, truetype] Always provide default instance. As documented in the OpenType specification, an entry for the default instance may be omitted in the named instance table. In particular this means that even if there is no named instance table in the font we actually do have a named instance, namely the default instance. For consistency, we always want the default instance in our list of named instances. If it is missing, we try to synthesize it. * src/sfnt/sfobjs.c (sfnt_init_face): Check whether the default instance is in the table of named instances. Otherwise adjust number of instances. * src/truetype/ttgxvar.c: Include FT_TRUETYPE_IDS_H. (TT_Get_MM_Var): Use `face->root.style_flags' as the number of named instances. Sythesize a named instance entry if necessary. (tt_done_blend): Free `normalized_stylecoords'.
Werner Lemberg 588e38e0 2017-03-04T11:04:24 [truetype] Make `TT_Set_MM_Blend' set named instance index. * src/truetype/ttgxvar.h (GX_Blend): New array `normalized_stylecoords'. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Allocate and fill `normalized_stylecoords'. (TT_Set_MM_Blend): Check instance tuple and adjust `face_index' accordingly.
Werner Lemberg 4717696c 2017-03-02T21:42:14 [truetype] Split off designer/normalized conversion routines. * src/truetype/ttgxvar.c (TT_Set_Var_Design): Split off conversion code designer->normalized coordinates to... (ft_var_to_normalized): ... New function. (TT_Get_Var_Design): Split off conversion code normalized->designer coordinates to... (ft_var_to_design): ... New function.
Werner Lemberg f0cee1a2 2017-02-23T08:23:39 * include/freetype/internal/tttypes.h (TT_Face): s/isCFF2/is_cff2/. For orthogonality with other structure field names. Update all users.
Werner Lemberg faa3c882 2017-02-06T13:13:02 [truetype] Implement `VVAR' table support. * src/truetype/ttgxvar.h (GX_HVarTable): Renamed to... (GX_HVVarTable): ...This. (GX_Blend): Add fields for `VVAR' table handling. Other minor updates. * src/truetype/ttgxvar.c (ft_var_load_hvar): Renamed to... (ft_var_load_hvvar): ...This. Handle VVAR loading also (controlled by an additional parameter). (tt_hadvance_adjust): Renamed to... (tt_hvadvance_adjust): ...This. Handle application of advance height also (controlled by an additional parameter). (tt_hadvance_adjust, tt_vadvance_adjust): Wrappers for `tt_hvadvance_adjust'. * src/truetype/ttdriver.c (tt_service_metrics_variations): Updated.
Werner Lemberg e80e4d81 2017-01-31T08:32:07 [truetype] Fix sanity check for `gvar' table (#50184). * src/truetype/ttgxvar.c (ft_var_load_gvar): There might be missing variation data for some glyphs.
Werner Lemberg 9db55ad1 2017-01-30T07:35:06 Typo.
Werner Lemberg f502092b 2017-01-23T11:47:40 [truetype] Minor updates for OpenType 1.8.1. * src/truetype/ttgxvar.h (GX_MVarTable): `axisCount' has been removed frem the specification; it is now reserved. * src/truetype/ttgxvar.c (ft_var_load_mvar): Updated. (GX_FVar_Head): Remove `countSizePairs'; the corresponding data field in the `MVAR' table is now reserved. (fvar_fields): Updated.
Werner Lemberg 79d52b9a 2017-01-23T07:43:56 [truetype] Avoid segfault for invalid variation data. * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): Assure `itemCount' is not zero. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=441
Werner Lemberg 322b3be5 2017-01-15T13:57:25 * src/truetype/ttgxvar.c (tt_apply_var): Handle underline parameters also.
Werner Lemberg d718ac4e 2017-01-11T14:12:34 [truetype] Provide metrics variation service. * include/freetype/internal/services/svmetric.h (FT_Metrics_Adjust_Func): Reduce number of necessary parameters. * src/truetype/ttgxvar.c: Include FT_LIST_H. (tt_size_reset_iterator): New auxiliary function for... (tt_apply_var): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_metrics_variations): Add `tt_apply_mvar'. * include/freetype/internal/ftserv.h (FT_ServiceCache): Add metrics variation service.
Werner Lemberg 07ee1d25 2017-01-11T12:50:51 [truetype] Parse `MVAR' table. * src/truetype/ttgxvar.h (MVAR_TAG_XXX): New macros for MVAR tags. (GX_Value, GX_MVarTable): New structures. (GX_Blend): Add it. * src/truetype/ttgxvar.c (GX_VALUE_SIZE, GX_VALUE_CASE, GX_GASP_CASE): New macros. (ft_var_get_value_pointer): New auxiliary function to get a pointer to a value from various SFNT tables already stored in `TT_Face'. (ft_var_load_mvar): New function. (TT_Get_MM_Var): Call it. (tt_done_blend): Updated.
Werner Lemberg 469ced7f 2017-01-08T09:28:34 [truetype] Again some GX code shuffling. We need this later on for MVAR also. * src/truetype/ttgxvar.c (tt_hadvance_adjust): Split off computing an item store variation delta into... (ft_var_get_item_delta): ...new function.