ChangeLog


Log

Author Commit Date CI Message
Werner Lemberg ded4bdb5 2016-12-20T23:26:38 [base] More sanity checks for Mac resources. We use https://github.com/kreativekorp/ksfl/wiki/Macintosh-Resource-File-Format and https://developer.apple.com/legacy/library/documentation/mac/pdf/MoreMacintoshToolbox.pdf#page=151 as references. * include/freetype/internal/ftrfork.h (FT_RFork_Ref): Use FT_Short for `res_id'. * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Extract map length and use it to improve sanity checks. Follow the specification more closely;in particular, all data types are signed, not unsigned. (FT_Raccess_Get_DataOffsets): Follow the specification more closely; in particular, all data types are signed, not unsigned. Add some sanity checks.
Werner Lemberg d678b37e 2016-12-20T12:45:31 Another minor ChangeLog addition.
Werner Lemberg 70704b34 2016-12-20T12:27:22 [truetype] Improve logic for getting fast advance widths. * src/cff/cffdrivr.c (cff_get_advances), src/truetype/ttdriver.c (tt_get_advances): Use `is_default_instance' for test; this gets recomputed after changing blend coordinates.
Werner Lemberg 59b0b3a7 2016-12-20T11:39:52 Add bug reference to previous commit.
Ben Wagner cc576f80 2016-12-20T11:37:42 [truetype] Fix linear metrics of GX variation fonts. When asking for an unhinted non-default variations, `linearVertAdvance' is currently the value from the `hmtx' table instead of the actual value after applying the variation. `HVAR' support fixes this, but fonts will exist without that table and will need sane fallback. * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph): Implement linear advance adjustments if `HVAR' or `VVAR' tables are missing.
Werner Lemberg a1e85f11 2016-12-20T10:52:26 [cff, truetype] Fast advance width retrieval for fonts with HVAR. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Don't handle MM. * src/cff/cffdrivr.c: Include FT_SERVICE_METRICS_VARIATIONS_H. (cff_get_advances): Test for HVAR and VVAR. * src/truetype/ttdriver.c (tt_get_advances): Test for HVAR and VVAR.
Werner Lemberg 5743df77 2016-12-18T21:01:03 [base] Fix invalid mac font recursion. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=304 * src/base/ftobjs.c (FT_Open_Face): Code moved to... (ft_open_face_internal): ... this function. Add a parameter to control whether we try special Mac font handling in case of failure. (FT_Open_Face, FT_New_Face, FT_New_Memory_Face, open_face_from_buffer): Use `ft_open_face_internal'.
Werner Lemberg ca3d4019 2016-12-18T18:23:19 * src/cff/cffobjs.c (cff_face_init): Make named instances work.
Werner Lemberg a8652c59 2016-12-18T18:12:03 [truetype, cff] Extend `get_var_blend' function of MM service. In particular, we need access to named instance data. * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func): Add argument for `FT_MM_Var'. * src/cff/cffload.c (cff_get_var_blend): Updated. * src/cff/cffload.h: Updated. * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated. * src/truetype/ttgxvar.c (tt_get_var_blend): Updated. Accept value `NULL' for arguments. * src/truetype/ttgxvar.h: Updated.
Werner Lemberg 25f3ac2b 2016-12-18T15:50:18 [sfnt] Handle `fvar' with zero axes as a non-MM font. This is better behaviour than exiting with an error. * include/freetype/internal/tttypes.h (TT_Face): Add `use_fvar' field. * src/sfnt/sfobjs.c (sfnt_init_face): Compute `use_fvar', also updating the validation code. Use `use_fvar' to compute FT_FACE_FLAG_MULTIPLE_MASTERS. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Remove `fvar' validation code.
Werner Lemberg eb6d0208 2016-12-18T09:29:58 Minor GX code shuffling. * include/freetype/internal/tttypes.h (TT_Face): Move `is_default_instance' into TT_CONFIG_OPTION_GX_VAR_SUPPORT block. * src/sfnt/sfobjs.c (sfnt_init_face): Updated. * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): New macro. (TT_Load_Glyph): Use it.
Werner Lemberg 8f633a08 2016-12-18T06:42:31 [cff] Better handling of non-CFF font formats. * src/cff/cffload.c (cff_font_load): Pure CFFs don't have a signature, so return `FT_Err_Unknown_File_Format' more often.
Werner Lemberg 4cd68179 2016-12-17T22:52:50 * src/cff/cffload.c (cff_build_blend_vector): Remove redundant code.
Werner Lemberg db17ceb4 2016-12-17T13:39:31 * src/truetype/ttobjs.c (tt_face_init): Simplify conditional code.
Werner Lemberg 7c75b166 2016-12-17T13:28:24 [sfnt, truetype] Various sanitizing fixes. * src/sfnt/sfobjs.c (sfnt_init_face): If the axis count in `fvar' is zero, set `num_instances' to zero. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Handle `fvar' table with zero axes as invalid. * src/truetype/ttobjs.c (tt_face_init): Improve logic of loading `loca', `cvt', `fpgm', and `prep' table.
Werner Lemberg 3b125e95 2016-12-17T10:02:19 Improve tracing of `FT_Open_Face'. * src/base/ftobjs.c (FT_Open_Face): Return info on number of available faces and numbered instances, or the indices of the requested face and numbered instance. * src/sfnt/sfobjs. (sfnt_open_font): Trace number of subfonts.
Werner Lemberg 50ff6c1e 2016-12-17T07:44:46 * src/cff/cffload.c (cff_load_private_dict): Always init `blend'. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=295
Werner Lemberg df2cf43e 2016-12-16T11:38:20 [truetype] Fix `cvar' sanity test. Reported by Dave Arnold. * src/truetype/ttgxvar.c (tt_face_vary_cvt): Use tuple count mask.
Werner Lemberg 68620248 2016-12-16T11:15:17 [cff, truetype] Remove compiler warnings; fix `make multi'. * src/cff/cf2font.h: Include `cffload.h'. * src/cff/cffload.c: Include FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H. (cff_vstore_load): Eliminate `vsSize'. (cff_load_private_dict): Tag as `FT_LOCAL_DEF'. * src/cff/cffload.h: Include `cffobjs.h'. Provide declaration for `cff_load_private_dict'. * src/truetype/ttgxvar.c (ft_var_load_hvar): Eliminate `minorVersion' and `map_offset'.
Werner Lemberg beecf80a 2016-12-16T08:52:03 [cff] Fix heap buffer overflow (#49858). * src/cff/cffparse.c (cff_parser_run): Add one more stack size check.
Werner Lemberg 01658be6 2016-12-15T23:10:59 Fix clang warnings. * src/cff/cffload.c (cff_blend_doBlend): Add cast. (cff_subfont_load): Set `error' correctly. * src/sfnt/ttmtx.c (tt_face_get_metrics): Typo.
Dave Arnold edf40148 2016-12-15T21:56:44 [cff] Implement CFF2 support (2/2). The font variation code. All parts dependent on the GX code in the `truetype' module are guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. In other words, you can still compile the `cff' module without defining TT_CONFIG_OPTION_GX_VAR_SUPPORT (which brings you CFF2 support without font variation). * src/cff/cf2font.c (cf2_font_setup): Add support for font variation. * src/cff/cf2font.h (CF2_Font): Add fields for variation data. * src/cff/cf2ft.c (cf2_free_instance): Free blend data. (cf2_getVStore, cf2_getNormalizedVector): New functions. * src/cff/cf2ft.h: Updated. * src/cff/cf2intrp.c: Include `cffload.h'. (cf2_cmdRESERVED_15, cf2_cmdRESERVED_16): Replace with... (cf2_cmdVSINDEX, cf2_cmdBLEND): ... this new enum values. (cf2_doBlend): New function. (cf2_interpT2CharString): Handle `vsindex' and `blend' opcodes. * src/cff/cffload.c (FT_fdot14ToFixed): New macro. (cff_vstore_done, cff_vstore_load): New functions. (cff_blend_clear, cff_blend_doBlend, cff_blend_build_vector, cff_blend_check_vector): New functions. (cff_load_private_dict): Add arguments for blend vector. Handle blend data. (cff_subfont_load, cff_subfont_done): Updated. (cff_font_load): Handle CFF2 variation store data. (cff_font_done): Updated. * src/cff/cffload.h: Include `cffparse.h'. Updated. * src/cff/cffobjs.c (cff_face_done): Updated. * src/cff/cffparse.c: Include `cffload.h'. (cff_parse_num): Handle internal value 255. (cff_parse_vsindex, cff_parse_blend): New functions. (CFF_FIELD_BLEND): New macro. (cff_parser_run): Updated. * src/cff/cffparse.h (cff_kind_blend): New enum value. * src/cff/cfftoken.h: Handle `vstore', `vsindex', and `blend' dictionary values. * src/cff/cfftypes.h (CFF_VarData, CFF_AxisCoords, CFF_VarRegion, CFF_VStore, CFF_Blend): New structures. (CFF_FontRecDict): Add `vstore_offset' field. (CFF_Private): Add `vsindex' field. (CFF_SubFont): Add fields for blend data. (CFF_Font): Add `vstore' field. * src/truetype/ttgxvar.c (TT_Get_MM_Var): `CFF2' is equal to `gvar', since glyph variation data is directly embedded. (TT_Set_MM_Blend): Don't load `gvar' table for CFF2 fonts.
Dave Arnold 9f62d2ca 2016-12-15T20:27:47 [cff] Implement CFF2 support (1/2). This commit does not contain the blend code for font variation support, which follows in another commit. You should ignore whitespace while inspecting this commit. * include/freetype/internal/tttypes.h (TT_Face): Add `isCFF2' member. * src/cff/cf2font.h (CF2_Font): Add `isCFF2' member. * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Handle `isCFF2' flag. (cf2_getMaxstack): New function. * src/cff/cf2ft.h: Updated. * src/cff/cf2intrp.c (cf2_escRESERVED_38): New enum. (cf2_interpT2CharString): Handle CFF2 differences. Add tracing message for errors. * src/cff/cffdrivr.c (cff_get_glyph_name, cff_get_name_index): Update for CFF2. * src/cff/cffload.c (FT_FIXED_ONE): New macro. (cff_index_init, cff_index_load_offsets, cff_index_access_element, cff_index_get_name, cff_ft_select_get, cff_load_private_dict, cff_subfont_load, cff_font_load): Handle CFF2. * src/cff/cffload.h: Updated. * src/cff/cffobjs.c (cff_face_init): Handle CFF2. * src/cff/cffparse.c (cff_parse_maxstack): New function. (CFFCODE_TOPDICT, CFFCODE_PRIVATE): Removed * src/cff/cffparse.h (CFF2_MAX_STACK, CFF2_DEFAULT_STACK): New macros. (CFF2_CODE_TOPDICT, CFF2_CODE_FONTDICT, CFF2_CODE_PRIVATE): New macros. * src/cff/cfftoken.h: Add fields for CFF2 dictionaries (but no blend stuff). * src/cff/cfftypes.h (CFF_Index): Add `hdr_size' field. (CFF_FontRecDict): Add `maxstack' field. (CFF_Private): Add `subfont' field. (CFF_Font): Add `top_dict_length' and `cff2' fields. * src/sfnt/sfobjs.c (sfnt_load_face): Handle `CFF2' table.
Werner Lemberg 3bd79cc2 2016-12-15T14:34:57 [truetype] Provide HVAR advance width variation as a service. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * src/truetype/ttdriver.c (tt_service_metrics_variations): Updated. * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Prevent double adjustment of advance width. * src/sfnt/ttmtx.c: Include FT_SERVICE_METRICS_VARIATIONS_H. (tt_face_get_metrics): Apply metrics variations.
Dave Arnold aa0c4b4f 2016-12-15T14:04:51 [truetype] Provide function to apply `HVAR' advance width variation. * src/truetype/ttgxvar.c (tt_hadvance_adjust): New function. * src/truetype/ttgxvar.h: Updated.
Dave Arnold 097cd874 2016-12-15T12:58:26 [truetype] Add `HVAR' table parsing. Note that this is not complete yet; it only handles advance width variation. Activation of the code follows in another commit. * include/freetype/ftmm.h (FT_Var_Named_Style): Add `psid' member. * src/truetype/ttgxvar.h (GX_HVarData, GX_AxisCoords, GX_HVarRegion, GX_HVStore, GX_WidthMap): New auxiliary structures for... (GX_HVarTable): ... HVAR main structure. (GX_BlendRec): Add data for HVAR loading. * src/truetype/ttgxvar.c (FT_FIXED_ONE, FT_fdot14ToFixed, FT_intToFixed, FT_fixedToInt): New macros. (ft_var_load_hvar): New function. (TT_Get_MM_Var): Updated. (tt_done_blend): Deallocate HVAR data.
Dave Arnold abd58581 2016-12-15T12:17:22 [cff] Extend number parsing. The forthcoming CFF2 support needs a dynamic parsing limit. * src/cff/cffparse.c (cff_parse_num, do_fixed, cff_parse_fixed, cff_parse_fixed_scaled, cff_parse_fixed_dynamic): Add argument for parser. (cff_parse_font_matrix, cff_parse_font_bbox, cff_parse_private_dict, cff_parse_multiple_master, cff_parse_cid_ros, cff_parser_run): Updated. * src/cff/cffparse.h (cff_parse_num): Export locally.
Dave Arnold 010e0614 2016-12-15T11:22:15 [cff] Implement dynamic stack size for Adobe engine. This also adds `cf2_stack_setReal' and `cf2_stack_pop', needed for the forthcoming CFF2 support. * src/cff/cf2stack.c (cf2_stack_init): Add argument for stack size. (cf2_stack_free): Deallocate stack. (cf2_stack_count, cf2_stack_pushInt, cf2_stack_pushFixed, cf2_stack_popInt, cf2_stack_popFixed, cf2_stack_getReal, cf2_stack_clear): Updated. (cf2_stack_setReal, cf2_stack_pop): New functions. * src/cff/cf2stack.h (CF2_Stack): Add `stackSize' member. Update function declarations. * src/cff/cf2intrp.c (cf2_interpT2CharString): Updated. * src/cff/cffparse.c (cff_parser_init): Add parameter for stack size; return error code. (cff_parser_done): New function. (cff_parser_run): Updated. * src/cff/cffparse.h (CFF_Parser): Add `stackSize' member and make `stack' a pointer. Update function declarations. * src/cff/cffload.c (cff_load_private_dict, cff_subfont_load): Updated.
Dave Arnold 41533b95 2016-12-15T00:00:45 [cff] Code shuffling. * src/cff/cfftypes.h (CFF_Font): Add `library' and `base_offset' fields. * src/cff/cffload.c (cff_subfont_load): Change last argument to `CFF_Font' Split off parsing of private dictionary into... (cff_load_private_dict): ...this new function. (cff_font_load): Updated.
Werner Lemberg 0918325e 2016-12-14T20:44:11 [sfnt, truetype] Add framework for Metrics Variations service. No effect yet; service functions will be implemented later on. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * include/freetype/internal/services/svmetric.h: New file. * include/freetype/internal/ftserv.h (FT_SERVICE_METRICS_VARIATIONS_H): New macro. * include/freetype/internal/tttypes.h (TT_Face): New field `var'. * src/sfnt/sfobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H. (sfnt_init_face): Initialize `face->var'. * src/truetype/ttdriver.c: Include FT_SERVICE_METRICS_VARIATIONS_H. (tt_service_metrics_variations): New service. (tt_services): Updated. * src/truetype/ttpic.h: Updated.
Werner Lemberg c628a7df 2016-12-14T19:31:42 [cff] Add Multiple Masters service. The code simply uses the MM functions from the `truetype' module. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * include/freetype/internal/tttypes.h (TT_Face): New field `mm'. * src/cff/cffdrivr.c: Include FT_SERVICE_MULTIPLE_MASTERS_H. (cff_set_mm_blend, cff_get_mm_blend, cff_get_mm_var, cff_set_var_design, cff_get_var_design): New functions. (cff_service_multi_masters): New service. (cff_services): Updated. * src/cff/cffload.c (cff_get_var_blend, cff_done_blend): New functions. * src/cff/cffload.h: Updated. * src/cff/cffpic.h (CFF_SERVICE_MULTI_MASTERS_GET): New macro. * src/sfnt/sfobjs.c: Include FT_SERVICE_MULTIPLE_MASTERS_H. (sfnt_init_face): Initialize `face->mm'.
Werner Lemberg a7dc0c35 2016-12-14T18:54:21 Extend functionality of `ft_module_get_service'. It can now differentiate between local and global searches. * src/base/ftobjs.c (ft_module_get_service): Add `global' argument. (FT_Get_TrueType_Engine_Type): Updated. * src/cff/cffdrivr.c (cff_get_ps_name, cff_get_cmap_info): Updated. * include/freetype/internal/ftobjs.h: Updated. * include/freetype/internal/ftserv.h (FT_FACE_FIND_GLOBAL_SERVICE): Updated.
Werner Lemberg ab22b43b 2016-12-14T18:34:55 * src/truetype/ttgxvar.c (tt_get_var_blend): Fix compiler warning.
Werner Lemberg 4e07516e 2016-12-14T18:25:44 [sfnt, cff] Minor preparations. * include/freetype/tttags.h (TTAG_CFF2, TTAG_HVAR, TTAG_MVAR, TTAG_VVAR): New SFNT table tags. * src/cff/cf2fixed.h (CF2_FIXED_ONE, CF2_FIXED_EPSILON): Add cast.
Werner Lemberg 8b174b4b 2016-12-11T09:16:52 [truetype, type1] Add `get_var_blend' to MM service. For internal use; we want to share code between the forthcoming CFF2 support and TrueType. * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func): New typedef. (MultiMasters): Add `get_var_blend'. (FT_Service_MultiMasters): Updated. * src/truetype/ttgxvar.c (tt_get_var_blend): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated.
Werner Lemberg 27bdb36c 2016-12-10T09:56:03 [truetype, type1] Add `done_blend' to MM service. For internal use; we want to share code between the forthcoming CFF2 support and TrueType. * include/freetype/internal/services/svmm.h (FT_Done_Blend_Func): New typedef. (MultiMasters): Add `done_blend'. (FT_Service_MultiMasters): Updated. * src/truetype/ttgxvar.c (tt_done_blend): Use `TT_Face' as argument. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttobjs.c (TT_Face_Done): Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated.
Werner Lemberg 3205a44d 2016-12-09T06:55:34 [sfnt] Revert change from 2016-12-08. I missed the functionality of `ft_module_get_service', which makes the change unnecessary.
Werner Lemberg 4191b776 2016-12-08T22:33:46 Add framework to support services with 8 functions. We will need this for CFF variation font support. * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC8): New macro.
Werner Lemberg 29aa9577 2016-12-08T08:59:34 [sfnt] Add `get_glyph_name' and `get_name_index' to SFNT interface. CFF2 fonts will need access to those two functions. * include/freetype/internal/sfnt.h: Include FT_SERVICE_GLYPH_DICT_H. (SFNT_Interface): Add `get_glyph_name' and `get_name_index' members. (FT_DEFINE_SFNT_INTERFACE): Updated. * src/sfnt/sfdriver.c (sfnt_get_glyph_name, sfnt_get_name_index): Fix signatures to exactly correspond to the glyph dict service function typedefs. (sfnt_interface): Updated.
Dave Arnold bcae6574 2016-12-05T22:08:15 Add `FT_Get_Var_Design_Coordinates' function. Note that the low-level functions aren't implemented yet. * include/freetype/ftmm.h: Declare. * include/freetype/internal/services/svmm.h (FT_Get_Var_Design_Func): New typedef. (MultiMasters): New MM service function `get_var_design'. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. Update all callers. * src/base/ftmm.c (FT_Get_Var_Design_Coordinates): Implement. * src/truetype/ttdriver.c: Updated. * src/truetype/ttgxvar.c (TT_Get_Var_Design): New dummy function to handle `get_var_design' service. * src/truetype/ttgxvar.h: Updated. * src/type1/t1driver.c: Updated. * src/type1/t1load.c (T1_Get_Var_Design): New dummp function to handle `get_var_design' service. * src/type1/t1load.h: Updated.
Werner Lemberg c0fae7da 2016-12-06T11:13:19 * src/type1/t1load.c (parse_subrs): Fix memory leak. The `subrs' keyword might erroneously occur multiple times. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=231
Werner Lemberg 602be7c8 2016-12-01T11:36:37 [gzip] Improve building with external zlib (#49673). Building FreeType with external zlib 1.2.8 makes msvc 14 stop with the following error. ftgzip.c zlib-1.2.8\zlib.h(86): error C2061: syntax error: identifier 'z_const' zlib-1.2.8\zlib.h(94): error C2054: expected '(' to follow 'z_const' zlib-1.2.8\zlib.h(94): error C2085: 'msg': not in formal parameter list ... zlib-1.2.8\zlib.h(877): fatal error C1003: error count exceeds 100; stopping compilation The error happens because FreeType keeps an own copy of zlib-1.1.4 under `src/gzip'. When building `src/gzip/ftgzip.c' with FT_CONFIG_OPTION_SYSTEM_ZLIB defined, it uses #include <zlib.h> which correctly finds an external `zlib.h', but `zlib.h' itself has a line #include "zconf.h" which makes Visual Studio 2015 find `src/gzip/zconf.h' while compiling the files in `src/gzip'. * src/gzip/zconf.h: Rename to... * src/gzip/ftzconf.h: ... this. * src/gzip/zlib.h, src/gzip/rules.mk (GZIP_DRV_SRCS): Updated.
Oleksandr Chekhovskyi 255828c8 2016-12-01T07:07:22 [autofit] Fix Emscripten crash (patch #9180). Function calls through pointers must use a matching signature to work on Emscripten, since such calls are dispatched through lookup tables grouped by signature. * src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Fix typedef.
Werner Lemberg 1d28f697 2016-11-29T18:45:22 [smooth] Revert previous commit. Already fixed with 6ca54c64.
Werner Lemberg d949a3db 2016-11-29T12:09:56 [smooth] Avoid conditional jump on uninitialized value (#49711). * src/smooth/ftgrays.c (gray_raster_render): Initialize `worker'.
Nikolaus Waxweiler b37b799c 2016-11-27T16:30:53 [autofit] Code shuffling. Also improve some comments and remove unused code. No functional change. * src/autofit/afloader.c (af_loader_load_g): Merged with... (af_loader_load_glyph): ...this function. Split off emboldening code into... (af_loader_embolden_glyph_in_slot): ... this function.
Werner Lemberg 78150503 2016-11-17T12:00:20 Better support of LLP64 systems with gcc (and clang). * builds/unix/configure.raw: Call `AC_TYPE_LONG_LONG_INT'. * builds/unix/ftconfig.in (FT_LONG64): Enable for LLP64 systems (and suppress warnings) even without `FT_CONFIG_OPTION_FORCE_INT64'.
Werner Lemberg dd26e3d0 2016-11-10T12:03:32 Fix `lcd_weights' array size. * include/freetype/internal/ftobjs.h (FT_LibraryRec): Do it. Reported by Nikolaus.
Werner Lemberg e1ee5476 2016-11-06T12:39:05 * src/base/ftobjs.c (FT_Render_Glyph_Internal): Fix tracing.
Werner Lemberg 1c6fd994 2016-11-06T12:37:55 [sfnt] Improve FT_LOAD_BITMAP_METRICS_ONLY for `sbix' format. It's unavoidable to call the PNG engine, but to get the metrics it is sufficient to read the PNG image's header only. * src/sfnt/pngshim.c (Load_SBit_Png): Add argument to control the allocation of the glyph slot. * src/sfnt/pngshim.h: Updated. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_png, tt_face_load_sbix_image, tt_face_load_sbit_image): Updated.
Werner Lemberg 565db95b 2016-11-06T12:33:51 [sfnt] Speed up `sbix' lookup. This also fixes a bug introduced in 2016-10-01 which prevents display of embedded bitmap fonts that use the `sbix' format. * src/sfnt/ttsbit.c (tt_face_load_sbit): Store `sbix' size and offset also in `ebdt_size' and `ebdt_start', respectively. This makes the test for an embedded bitmap data table succeed for this format. (tt_face_load_strike_metrics) <TT_SBIT_TABLE_TYPE_SBIX>: Use `ebdt_size' and `ebdt_start' (tt_face_load_sbix_image): Ditto.
Werner Lemberg 37e193e9 2016-11-06T12:32:51 Introduce a way of quickly retrieving (embedded) bitmap metrics. `FT_Load_Glyph' doesn't generate a bitmap for a non-bitmap glyph until the user calls `FT_Render_Glyph'. However, it always allocates memory for bitmaps and copies or decodes the contents of a bitmap glyph, which can be quite slow for PNG data. * include/freetype/freetype.h (FT_LOAD_BITMAP_METRICS_ONLY): New macro. * src/base/ftobjs.c (FT_Load_Glyph): Unset FT_LOAD_RENDER if FT_LOAD_BITMAP_METRICS_ONLY is used. * src/sfnt/ttsbit.c (tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_bitmap): Add argument to control allocation of the glyph slot. (tt_sbit_decoder_load_image, tt_sbit_decoder_load_compound, tt_face_load_sbit_image): Updated. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Quickly exit if `FT_LOAD_BITMAP_METRICS_ONLY' is set. * src/pfr/pfrsbit.c, src/pfr/pfrsbit.h (pfr_slot_load_bitmap): Add argument to control allocation of the glyph slot. * src/pfr/pfrobjs (pfr_slot_load): Updated. * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto. * docs/CHANGES: Updated.
Werner Lemberg 57f73d1f 2016-11-06T06:06:30 Synchronize with gnulib (#49448). * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in, builds/vms/ftconfig.h (FT_TYPEOF): Update code to use definition in current version of `intprops.h'. Other minor synchronization to reduce code differences between the three files.
Behdad Esfahbod b72858c9 2016-11-03T06:41:00 [truetype] Clamp variation requests to valid range. This is required by OpenType 1.8; it also avoids rounding surprises. * src/truetype/ttgxvar.c (TT_Set_Var_Design): Clamp design coordinates outside of the allowed range to always stay within the range instead of producing an error.
Werner Lemberg 328d6844 2016-10-29T00:18:56 [truetype] Remove clang warnings. * src/truetype/ttinterp.h (TT_ExecContextRec): Using `FT_ULong' for loop counter handling. * src/truetype/ttinterp.c: Updated. (Ins_SCANTYPE): Use signed constant. (TT_RunIns): Ensure `num_twilight_points' is 16bit.
Werner Lemberg ddf38726 2016-10-27T07:27:27 [truetype] Fix commit from 2014-11-24. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/truetype/ttpload.c (tt_face_load_hdmx): Fix file checking logic.
Werner Lemberg 9c45ac39 2016-10-26T16:00:00 Add `FT_Get_{MM,Var}_Blend_Coordinates' functions. * include/freetype/ftmm.h: Declare. * include/freetype/internal/services/svmm.h (FT_Get_MM_Blend_Func): New typedef. (MultiMasters): New MM service function `get_mm_blend'. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. Update all callers. * src/base/ftmm.c (FT_Get_MM_Blend_Coordinates, FT_Get_Var_Blend_Coordinates): Implement. * src/truetype/ttdriver.c: Updated. * src/truetype/ttgxvar.c (TT_Get_MM_Blend): New function to handle `get_mm_blend' service. * src/truetype/ttgxvar.h: Updated. * src/type1/t1driver.c: Updated. * src/type1/t1load.c (T1_Get_MM_Blend): New function to handle `get_mm_blend' service. * src/type1/t1load.h: Updated. * docs/CHANGES: Document.
Werner Lemberg 56140907 2016-10-26T08:10:59 * src/type1/t1load.c (parse_subrs): Fix limit check. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=81
Alexei Podtelezhnikov c5f1bc4b 2016-10-25T22:31:42 [cff] Correct cmap format reporting (#24819). * src/cff/cffdrivr.c (cff_get_cmap_info): Throw an error on synthetic charmap instead of guessing its format and language.
Werner Lemberg 5081674c 2016-10-22T19:16:08 [truetype] Fix SCANTYPE instruction (#49394). * src/truetype/ttinterp.c (Ins_SCANTYPE): Only use lower 16bits.
Werner Lemberg 57741403 2016-10-22T18:34:48 [sfnt] Improve handling of invalid post 2.5 tables [#49393]. * src/sfnt/ttpost.c (load_format_25): We need at least a single table entry.
Werner Lemberg 7eeaf986 2016-10-14T08:58:17 [truetype] Fix handling of `cvar' table data. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Ignore invalid CVT indices.
Werner Lemberg 9c54d124 2016-10-11T08:57:55 [psaux] Fix handling of invalid flex subrs. Problem reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52 * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_callothersubr>: Set `flex_state' after error checking.
Werner Lemberg 92281228 2016-10-11T07:12:12 * src/truetype/ttgxvar.c (tt_done_blend): Fix deallocation.
Werner Lemberg 6b354931 2016-10-08T20:26:59 * src/cid/cidload.c (cid_face_open): Properly propagate `error'.
Werner Lemberg d61b0425 2016-10-08T19:20:33 [cid] Fix parsing of subr offsets. Bug introduced 2016-05-16. * src/cid/cidparse.c (cid_parser_new): Fix off-by-one error.
Werner Lemberg fcc0ee80 2016-10-01T20:12:25 [sfnt] Disable bitmap strikes if we don't have a bitmap data table. * src/sfnt/ttsbit.c (tt_face_load_sbit): Check whether we have a bitmap data table.
Alexei Podtelezhnikov b0aacff4 2016-10-01T12:55:33 [smooth] Remove impossibility. * src/smooth/ftgrays.c (TWorker): Rearrange fields. (gray_convert_glyph): Remove impossible condition and clean up.
Werner Lemberg 3576487a 2016-09-30T08:11:52 [pcf] Enrich family name with foundry name and glyph width info. This is a very old patch from openSuSE (from 2006, submitted to FreeType in 2011) that I forgot to apply. https://build.opensuse.org/package/view_file/openSUSE:Factory/freetype2/freetype2-bitmap-foundry.patch Prepend the foundry name plus a space to the family name. There are many fonts just called `Fixed' which look completely different, and which have nothing to do with each other. When selecting `Fixed' in KDE or Gnome one gets results that appear rather random, the style changes often if one changes the size and one cannot select some fonts at all. We also check whether we have `wide' characters; all put together, we get family names like `Sony Fixed' or `Misc Fixed Wide'. * src/pcf/pcfread.c (pcf_load_font): Implement it. * docs/CHANGES: Document it.
Werner Lemberg 71b617d8 2016-09-29T19:53:39 [ftfuzzer] Speed up. * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Don't check for embedded bitmaps if we have a non-default instance.
Werner Lemberg 2067c698 2016-09-29T19:49:07 [truetype] Disallow bitmap strokes for non-default instances. Also speed up access of default instances if GX variations are active. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `is_default_instance' member. * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `is_default_instance'. * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph): Add test for default instance. (TT_Load_Glyph): Load embedded bitmaps for default instance only. * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Compute `is_default_instance'.
Werner Lemberg bf90239c 2016-09-29T13:04:46 [truetype] Clean up `TT_Face' structure. * include/freetype/internal/tttypes.h (TT_FaceRec): Remove unused fields `horz_metrics' and `vert_metrics'. Update documentation. * src/sfnt/sfobjs.c (sfnt_done_face): Updated.
Werner Lemberg 45cad2e5 2016-09-28T19:10:52 More FT_ZERO usage. * src/gxvalid/gxvcommn.c (gxv_ClassTable_validate): s/ft_memset/FT_MEM_ZERO/. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): s/ft_memset/FT_ARRAY_ZERO/. * src/raster/ftraster.c (FT_ZERO): Define. (ft_black_new): Use it. * src/raster/ftrend1.c (ft_raster1_get_cbox): s/FT_MEM_ZERO/FT_ZERO/. * src/smooth/ftgrays.c (FT_ZERO): Define. (gray_raster_new): Use it. * src/smooth/ftsmooth.c (ft_smooth_get_cbox): s/FT_MEM_ZERO/FT_ZERO/.
Werner Lemberg 2ecf89b4 2016-09-28T19:06:21 */*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
Werner Lemberg a3e2c832 2016-09-27T21:42:02 [truetype] Trace number of executed opcodes. * src/truetype/ttinterp.c (TT_RunIns): Implement it.
Werner Lemberg e27b8a55 2016-09-27T21:21:01 [truetype] Speed up `TT_Load_Glyph'. This avoids additional calls to `tt_face_lookup_table' for the `glyf' table, which can be expensive. * include/freetype/internal/tttypes.h (TT_LoaderRec): Move `glyf_offset' field to ... (TT_FaceRec): ... this structure. * src/truetype/ttgload.c (load_truetype_glyph): Updated. (tt_loader_init): Move initialization of `glyf_offset' to ... * src/truetype/ttpload.c (tt_face_load_loca): .. this function.
Werner Lemberg 0d945929 2016-09-27T08:44:31 [truetype] Introduce dynamic limits for some bytecode opcodes. This speeds up FreeType's handling of malformed fonts. * src/truetype/ttinterp.c (TT_RunIns): Set up limits for the number of twilight points, the total number of negative jumps, and the total number of loops in LOOPCALL opcodes. The values are based on the number of points and entries in the CVT table. (Ins_JMPR): Test negative jump counter. (Ins_LOOPCALL): Test loopcall counter. * src/truetype/ttinterp.h (TT_ExecContext): Updated. * docs/CHANGES: Updated.
Werner Lemberg a764963f 2016-09-25T16:29:05 [truetype] Sanitize only last entry of `loca' table. Without this patch, a loca sequence like `0 100000 0 100000 ...', where value 100000 is larger than the `glyf' table size, makes FreeType handle the whole `glyf' table as a single glyph again and again, which is certainly invalid (and can be very slow, too). * src/truetype/ttpload.c (tt_face_get_location): Implement. Improve tracing messages.
Werner Lemberg d11e8b6e 2016-09-25T15:32:04 * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Fix typo.
Werner Lemberg 2f2e73c5 2016-09-24T22:42:58 [autofit] Tracing fixes. * src/autofit/afmodule.c (af_autofitter_load_glyph): Call dumping functions only if we actually do tracing.
Alexei Podtelezhnikov 53ae7a54 2016-09-22T22:48:15 [smooth] Reduce divisions in the line renderer. We don't need some divisions if a line segments stays within a single row or a single column of pixels. * src/smooth/ftgrays.c (gray_render_line) [FT_LONG64]: Make divisions conditional.
Alexei Podtelezhnikov d5f7533e 2016-09-15T00:13:36 * src/smooth/ftgrays.c (gray_sweep): Remove check for empty table.
Alexei Podtelezhnikov ad47550b 2016-09-14T23:15:03 [smooth] Another tiny speed-up. * src/smooth/ftgrays.c (gray_find_cell): Merge into... (gray_record_cell): ... this function.
Alexei Podtelezhnikov c38be52b 2016-09-11T22:44:44 * src/smooth/ftgrays.c (gray_{find,set}_cell): Remove dubious code.
Alexei Podtelezhnikov 6ca54c64 2016-09-11T16:00:52 [smooth] Fix valgrind warning and reoptimize. The algorithm calls `gray_set_cell' at the start of each new contour or when the contours cross the cell boundaries. Double-checking for that is wasteful. * src/smooth/ftgrays.c (gray_set_cell): Remove check for a new cell. (gray_convert_glyph): Remove initialization introduced by 44b172e88.
Werner Lemberg e421a0bf 2016-09-10T08:02:30 [sfnt] Fix previous commit. Problems reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40 We now map the strike index right before accessing the physical data, not earlier. * src/sfnt/sfobjs.c (sfnt_load_face): Set `face->sbit_strike_map' after creating the map so that... * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): ... this function can be used before and after setting up `sbit_strike_map'. (tt_face_set_sbit_strike): Revert change. (tt_sbit_decoder_init, tt_face_load_sbix_image): Map strike index. * src/truetype/ttdriver.c (tt_size_select): Revert change.
Werner Lemberg deb26155 2016-09-09T22:13:33 [ftfuzzer] Minor improvements. * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Ignore invalid strikes. Use better values for call to `FT_Set_Char_Size'.
Werner Lemberg d609b7c1 2016-09-09T22:11:07 [sfnt] Don't provide (completely) broken strike data. FreeType tries to sanitize strike header data; we now reject completely broken ones. * include/freetype/internal/tttypes.h (TT_FaceRec): New `sbit_strike_map' array pointer. * src/base/ftobjs.c (FT_Match_Size): Reject matches where either width or height would be zero. Add tracing message in case of error. * src/sfnt/sfobjs.c (sfnt_load_face): Populate `sbit_strike_map', only using (more or less) valid strike header data for FT_Face's `available_sizes' array. (sfnt_done_face): Updated. * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use `sbit_strike_map'. (tt_face_load_strike_metrics): Improve tracing. * src/truetype/ttdriver.c (tt_size_select): Use `sbit_strike_map'.
Werner Lemberg d2d5968a 2016-09-08T09:04:32 * Version 2.7 released. ======================= Tag sources with `VER-2-7'. * docs/VERSION.TXT: Add entry for version 2.7. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, builds/windows/vc2005/index.html, builds/windows/vc2008/freetype.vcproj, builds/windows/vc2008/index.html, builds/windows/vc2010/freetype.vcxproj, builds/windows/vc2010/index.html, builds/windows/visualc/freetype.dsp, builds/windows/visualc/freetype.vcproj, builds/windows/visualc/index.html, builds/windows/visualce/freetype.dsp, builds/windows/visualce/freetype.vcproj, builds/windows/visualce/index.html, builds/wince/vc2005-ce/freetype.vcproj, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/freetype.vcproj, builds/wince/vc2008-ce/index.html: s/2.6.5/2.7/, s/265/27/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 7. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 18:6:12. * CMakeLists.txt (VERSION_MINOR): Set to 7. (VERSION_PATCH): Set to 0. * docs/CHANGES: Updated.
Werner Lemberg b1e7b68e 2016-09-08T08:56:34 * src/truetype/ttinterp.c: Include `ttgxvar.h'. This fixes the `multi' build.
Werner Lemberg 8160b201 2016-09-08T08:42:10 Split off ChangeLog.26.
Werner Lemberg 9749f269 2016-09-08T07:51:03 [autofit] Another improvement to Armenian support. Suggested by Hrant H Papazian <hpapazian@gmail.com>. * src/autofit/afscript.h: Use better suited characters to derive default stem widths.
Alexei Podtelezhnikov a0b92bcb 2016-09-07T23:19:57 * src/smooth/ftgrays.c (gray_hline): Microptimize.
Alexei Podtelezhnikov 9d0a3bd8 2016-09-06T23:59:33 [smooth] Operate in absolute bitmap coordinates. Simpler bitmap addressing improves performance by 1.5%. * src/smooth/ftgrays.c (gray_TWorker): Remove count fields. (gray_dump_cells, gray_find_cell, gray_set_cell, gray_hline, gray_sweep, gray_convert_glyph, gray_raster_render): Updated.
Alexei Podtelezhnikov 44b172e8 2016-09-06T23:24:17 [smooth] Improve contour start (take 2). * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly instead of... (gray_start_cell): ... this function, which is removed. (gray_convert_glyph): Make initial y-coordinate invalid.
Werner Lemberg ebbb8b2e 2016-09-06T16:28:57 [type1] MM fonts support exactly zero named instances (#48748). * src/type1/t1load.c (T1_Get_MM_Var): Set `num_namedstyles' to zero.
Jonathan Kew a15133e6 2016-09-06T06:33:36 [cff] Fix uninitialized memory. Problem reported as https://bugzilla.mozilla.org/show_bug.cgi?id=1270288 * src/cff/cf2interp.c (cf2_interpT2CharString): Initialize `storage' array to handle a `get' opcode without a previous `put'.
Alexei Podtelezhnikov 9773d5f7 2016-09-05T23:33:35 * src/smooth/ftgrays.c (gray_move_to, gray_start_cell): Revert.
Alexei Podtelezhnikov 7effc279 2016-09-05T21:58:56 [smooth] Improve contour start. * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly instead of... (gray_start_cell): ... this function, which is removed.
Werner Lemberg 3ebfe3c5 2016-09-05T10:55:07 [cff] Fix memory initialization. * src/cff/cf2stack.c (cf2_stack_init): Use `FT_NEW'. The `Q' variants of FreeType's memory allocation macros don't do zeroing.