src


Log

Author Commit Date CI Message
Werner Lemberg 14cd0734 2017-12-27T08:59:46 Fix compiler warnings. * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Make `pitch' and `new_pitch' unsigned. * src/base/ftpsprop.c: Include FT_INTERNAL_POSTSCRIPT_PROPS_H.
Werner Lemberg 3cc88e2e 2017-12-27T08:19:09 Fixes for `make multi'. * include/freetype/internal/ftpsprop.h: Use `FT_BASE_CALLBACK'. (ps_property_get): Harmonize declaration with corresponding function typedef. * include/freety[e/internal/fttrace.h: Add `trace_psprops'. * src/base/ftpsprop.c: Include necessary header files. (FT_COMPONENT): Define. (ps_property_set): Tag with `FT_BASE_CALLBACK_DEF'. (ps_property_get): Tag with `FT_BASE_CALLBACK_DEF'. Harmonize declaration with corresponding function typedef.
Werner Lemberg dd6330d7 2017-12-27T08:06:47 Add missing ChangeLog entry, copyright notices, whitespace, formatting.
Ewald Hew a956e36c 2017-12-25T12:34:37 Move PostScript drivers' property handlers to `base' This reduces the amount of duplicated code across PostScript drivers. * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c ({cff,cid,t1}_property_{get,set}): Moved to... * include/freetype/internal/ftpsprop.h: ...this new file. (ps_property_{get,set}): New functions to replace moved ones. * src/base/ftpsprop.c: Implement above functions. * include/freetype/internal/internal.h (FT_INTERNAL_POSTSCRIPT_PROPS_H): New macro. * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c: Updated. * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
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.
Werner Lemberg 2df73b39 2017-12-18T23:32:32 [sfnt] Fix charmap type 2 iterator (#52646). The subsetted demo font of the report that exhibits the bug has a very unusual type 2 cmap for Unicode(!): It contains only two sub-headers, one for one-byte characters (covering the range 0x20 to 0xFA), and a second one for higher byte 0x01 (just for character code U+0131). Before this commit, the iterator wasn't able to correctly handle a sub-header for higher byte 0x01. * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix character increment for outer loop.
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 068a7a03 2017-12-18T20:34:05 * src/*/*: Only use `ft_' and `FT_' variants of stdc library stuff.
Werner Lemberg 2fe272ac 2017-12-18T19:40:07 * src/truetype/ttgxvar.c (tt_face_vary_cvt): Add size guard (#52688).
Werner Lemberg d062c54c 2017-12-18T09:41:17 [truetype] Fix previous commit. * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Correctly handle unhinted phantom points, which must be properly scaled.
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.
Jonathan Kew 7d3dfcd4 2017-12-17T08:19:51 Fix incorrect advance width scaling (#52683). * src/base/ftadvance.c (FT_Get_Advances): Always respect the FT_LOAD_NO_SCALE flag if present.
Werner Lemberg 2c048a8a 2017-12-11T19:24:30 Fix compiler warning (#52640). * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Remove unused variable.
Werner Lemberg ea68f1c8 2017-12-08T20:15:15 [docmaker] Fix code section parsing. Stuff like { <bla> } confused the parser, which incorrectly treated `<bla>' as a markup tag. * src/tools/docmaker/content.py (ContentProcessor::process_content): Apply `re_markup_tags' only outside of code sections.
Werner Lemberg 98ba0c4a 2017-12-08T18:38:41 New `ftdriver.h' file, covering all driver modules. This reduces redundancy and increases synergy; it also reduces the number of header files. * include/freetype/config/ftheader.h (FT_DRIVER_H): New macro. (FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H, FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to FT_DRIVER_H. * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h, include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h, include/freetype/ftttdrv.h: Replaced with... * include/freetype/ftdriver.h: ...this new file. (FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to... (FT_HINTING_ADOBE): ... this new macro. (FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to... (FT_HINTING_FREETYPE): ... this new macro. * src/*/*: Updated accordingly.
Werner Lemberg e1090c60 2017-12-08T09:54:36 Fix access to uninitalized memory (#52613). Also reported as https://bugs.chromium.org/p/chromium/issues/detail?id=791317 * src/base/ftbitmap.c (ft_bitmap_assure_buffer): If increasing the bitmap size needs a larger bitmap buffer, assure that the new memory areas are initialized also.
Werner Lemberg d21f995a 2017-12-07T14:49:03 Fix C++ compilation. * src/psaux/psauxmod.h: Use FT_CALLBACK_TABLE macro where necessary. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Fix warning.
Werner Lemberg 63b91548 2017-12-07T14:33:44 Fix `make multi'. * include/freetype/internal/fttrace.h: Remove unused tracing macros. s/pshalgo2/pshalgo/. Add `trace_cffdecode'. * src/pshinter/pshalgo.c (FT_COMPONENT): Updated. * src/cff/cffload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H. * src/cff/cffobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H and FT_SERVICE_CFF_TABLE_LOAD_H. * src/cid/cidriver.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H. * src/psaux/cffdecode.c: Include FT_FREETYPE_H and FT_INTERNAL_DEBUG_H. (FT_COMPONENT): Define. * src/psaux/cffdecode.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H. * src/psaux/psauxmod.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H. Declare `cff_builder_funcs' and `ps_builder_funcs'. * src/psaux/psft.c: Include `psobjs.h' and `cffdecode.h'. * src/psaux/psobjs.c : Include `psauxmod.h'.
Werner Lemberg 71fecc53 2017-12-05T12:06:29 Improve tracing messages by using singular and plural forms. * src/*/*.c: Implement it.
Werner Lemberg 87ddad20 2017-12-04T20:43:30 Update or fix links to use the https protocol instead of http.
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 c18c391b 2017-11-28T12:43:45 [truetype] Improving tracing of composite glyphs. * src/truetype/ttgload.c (TT_Load_Composite_Glyph) [FT_DEBUG_LEVEL_TRACE]: Show composite glyph information.
Werner Lemberg 40db4a99 2017-11-27T22:17:41 Allow (again) encoding vectors with more than 256 elements (#52464). In version 2.6.1, this has been disallowed to better reject malformed fonts; however, this restriction was too strong. This time, we only take the first 256 elements into account, since encoding arrays are always accessed with a 8bit integer, according to the PostScript Language Reference. * src/type1/t1load.c (parse_encoding): Implement it.
Tor Andersson 2f1863cf 2017-11-23T20:40:52 Silence unused function warnings. Some static function declarations cause unused function warnings if certain config options are turned off via `ftoption.h'. * src/base/ftbase.h, src/base/ftrfork.c, src/sfnt/ttbdf.h, src/truetype/ttgxvar.h: Add #ifdef guards around these sections.
Ewald Hew bec14f68 2017-11-22T18:57:56 * src/psaux/psft.c (cf2_setGlyphWidth): Check format before setting. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4377
Ewald Hew b9bd2d14 2017-11-22T12:32:47 [psaux] Fix CFF advance widths. (#52466) Glyph advance widths were being written to the new `PS_Decoder' but not saved to the underlying format specific decoder. This caused pure CFF fonts to have bad advance width. * include/freetype/internal/psaux.h (PS_Decoder): Change `glyph_width' field to pointer. Remove unused fields. * src/psaux/psobjs.c (ps_decoder_init): Change `glyph_width' from copy to reference. Remove unused. * src/psaux/psft.c (cf2_setGlyphWidth): Update code.
Nikolaus Waxweiler a364e38a 2017-11-14T07:54:53 Use Adobe hinting engine for `light' hinting of both CFF and Type 1. Since Ewald Hew factored the Adobe hinting engine out of the CFF driver code, we can now use it on Type 1 (and CID) font formats, as both have the same hinting philosophy. This change activates the Adobe hinter when in LIGHT mode, and therefore always unless explicitly asking for the auto-hinter. This makes LIGHT behavior consistent with CFF fonts. As of this commit, the hinting engine table looks as follows. LIGHT NORMAL ------------------------- TrueType Auto v40 CFF Adobe Adobe Type 1 Adobe Adobe
Alexei Podtelezhnikov 8f5568bf 2017-11-06T21:42:46 * src/base/ftobjs.c (FT_Load_Glyph): Relocate condition.
Alexei Podtelezhnikov ab6fe076 2017-11-06T21:34:56 * src/smooth/ftgrays.c (gray_set_cell): Fix uninitialized variables.
Ewald Hew cdab9cfa 2017-10-21T16:36:49 [psaux] Fix PostScript interpreter rewinding in Type 1 mode. (#52251) The interpreter in Type 1 mode rewinds the charstring after collecting all hints for building the initial hintmap (commit d52dd7f). However, some charstrings use `endchar' in a final subroutine call, rewinding to the start of that subroutine, and only a small section of the actual glyph is drawn. * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdENDCHAR>: Ensure we are on the top level charstring before rewinding.
suzuki toshiya 77b34e01 2017-11-03T16:13:29 [truetype] Add more tricky fonts. See the report by Yang Yinsen. https://lists.gnu.org/archive/html/freetype-devel/2017-11/msg00000.html * src/truetype/ttobjs.c (trick_names): Add `DFGothic-EB', `DFGyoSho-Lt', `DFHSGothic-W5', `DFHSMincho-W3' and `DFHSMincho-W7'. (tt_check_trickyness_sfnt_ids): Add checksums for DFGothic-EB, DFGyoSho-Lt, DFHSGothic-W5, DFHSMincho-W3 and DFHSMincho-W7. Also add checksums for DLCLiShu and DLCHayBold which their family names were already listed but their checksums were previously unknown.
Alexei Podtelezhnikov 81651636 2017-11-01T22:51:03 [smooth] Fix complex rendering at high ppem. We used to split large glyphs into horizontal bands and continue bisecting them still horizontally if that was not enough. This is guaranteed to fail when a single scanline cannot fit into the rendering memory pool. Now we bisect the bands vertically so that the smallest unit is a column of the band height, which is guranteed to fit into memory. * src/smooth/ftgrays.c (gray_convert_glyph): Implement it.
Alexei Podtelezhnikov 91015cb4 2017-10-21T22:57:43 [smooth] Improve complex rendering at high ppem. At large sizes almost but not exactly horizontal segments can quickly drain the rendering pool. This patch at least avoids filling the pool with trivial cells. Beyond this, we can only increase the pool size. Reported, analyzed, and tested by Colin Fahey. * src/smooth/ftgrays.c (gray_set_cell): Do not record trivial cells.
Alexei Podtelezhnikov d74440a3 2017-10-20T16:27:33 [base] Improve tracing in FT_Load_Glyph, FT_*_Size. * src/base/ftobjs.c (FT_Load_Glyph): Tag tracing messages with function name, glyph index, and load flags. (FT_Select_Metrics, FT_Request_Metrics): Remove all tracing. (FT_Select_Size, FT_Request_Size): Improve tracing.
Alexei Podtelezhnikov c10e7800 2017-10-18T23:05:51 [base] Improve tracing in FT_Render_Glyph. * src/base/ftobjs.c (FT_Render_Glyph_Internal): Add total coverage calculations and downgrade Netpbm dump to bitmap:7.
Ewald Hew 94f6d57a 2017-10-16T11:48:31 [cff] Fix segfault on missing `psaux' (#52218) * src/cff/cffload.c (cff_done_blend): Add a check for possible nullptr. * modules.cfg: Update dependency list.
Alexei Podtelezhnikov ccb0f799 2017-10-15T14:19:13 [base, cff] Fix MSVC warnings. * src/base/ftobjs.c (FT_New_Library): C4702: unreachable code. (ft_glyphslot_preset_bitmap): C4244: possible loss of data. * src/cff/cffload.c (cff_blend_doBlend): C4244: possible loss of data. Turn `sum' into unsigned.
Alexei Podtelezhnikov 6bea49e0 2017-10-14T22:45:11 [base] Netpbm image tracing. * src/base/ftobjs.c (FT_Load_Glyph): Trace bitmap size. (FT_Render_Glyph_Internal): Trace bitmap in Netpbm format. * src/smooth/ftgrays.c (gray_sweep): Sweep remnants of span tracing.
Behdad Esfahbod 90461c01 2017-10-14T08:42:07 [afshaper] Delay creating `hb_set' objects until needed. In runs on Noto Naskh Arabic, this results in 89 sets created instead of 340 before. Makes auto-hinter setup with HarfBuzz enabled 20% to 30% faster. * src/autofit/afshaper.c (af_shaper_get_coverage): Implement it.
Ewald Hew 7e23568b 2017-10-12T18:13:22 [type1, cid] Add hinting engine switch. Implement property service in `type1' and `cid' drivers to allow switching between FreeType or Adobe hinting engine when both are available. * src/cid/cidriver.c (cid_property_{set,get}, cid_services), src/type1/t1driver.c (t1_property_{set,get}, t1_services): Add Properties service. * src/cid/cidobjs.c (cid_driver_init), src/type1/t1objs.c (T1_Driver_Init): Add default property values.
Ewald Hew dff40d03 2017-10-12T18:13:21 Add T1_CONFIG_OPTION_OLD_ENGINE configuration option. This controls whether the old Type 1 engine gets compiled into FreeType. It is disabled by default. * devel/ftoption.h, include/freetype/config/ftoption.h (T1_CONFIG_OPTION_OLD_ENGINE): New macro. * include/freetype/internal/psaux.h (PS_Decoder): Remove unused field. * include/freetype/internal/psaux.h, src/cid/cidgload.c (cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c (ps_builder_add_point), src/psaux/t1decode.c (t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph, t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h, src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround relevant code with macro. Minor code changes.
Ewald Hew 78df3c27 2017-10-12T18:13:08 Extract width parsing from Type 1 parser. Duplicate the fast advance width calculations from the old parser. This is to facilitate adding options for compiling out the old parser. * src/psaux/t1decode.{c,h} (t1_decoder_parse_metrics): New function. * include/freetype/internal/psaux.h (T1_Decoder_Funcs): New entry `parse_metrics'. * src/psaux/psauxmod.c: Set the new entry. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c (cid_load_glyph): Separate conditional for selecting engine.
Werner Lemberg 8768536c 2017-10-12T00:13:51 [autofit] Better visualize table tracing in source code.
Werner Lemberg 64985519 2017-10-09T07:45:03 * src/base/ftoutln.c (FT_Outline_Translate): Fix integer overflow. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=772775
Werner Lemberg b7e43f7d 2017-10-08T11:58:39 * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Integer overflows. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3579
Werner Lemberg 7bfcaaca 2017-10-07T13:14:38 [sfnt] Adjust behaviour of PS font names for variation fonts. * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Use a named instance's PS name only if no variation is applied.
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 dd8539ef 2017-10-07T11:40:03 New function `FT_Set_Named_Instance'. No effect yet. * src/base/ftmm.c (FT_Set_Named_Instance): New function. * include/freetype/ftmm.h: Updated.
Werner Lemberg e23fe2ad 2017-10-07T11:25:04 Add framework for setting named instance in MM service. * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func): New function typedef. (MultiMasters): Add `set_instance' member. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * src/cff/cffdrivr.c (cff_service_multi_masters), src/truetype/ttdriver (tt_service_gx_multi_masters), src/type1/t1driver.c (t1_service_multi_masters): Updated.
Werner Lemberg f06456a8 2017-10-07T10:35:11 [type1] Minor code shuffling. * src/type1/t1load.c (T1_Set_MM_Blend): Make it a wrapper of... (t1_set_mm_blend): ...this new function. (T1_Set_MM_Design): Use `t1_set_mm_blend'.
Werner Lemberg c3083e45 2017-10-05T14:32:24 * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Fix integer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3539
Werner Lemberg 2e58808d 2017-10-05T14:26:33 Fix compiler warnings. * src/cff/cffdrivr.c (cff_ps_get_font_extra): Avoid code that relies on numeric overflow. Add cast. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Fix variable types, add cast.
John Tytgat 1df35d94 2017-10-04T22:46:36 [cff] Add support for `FSType'. * include/freetype/internal/cfftypes.h (CFF_FontRec): Add `font_extra' entry. * src/cff/cffdrivr.c (cff_ps_get_font_extra): New function to retrieve FSType info from the embedded PostScript data. (cff_service_ps_info): Register function. * src/cff/cffload.c (cff_font_done): Free `font_extra'.
Werner Lemberg af03d1ea 2017-10-01T09:23:42 [smooth,type1] Formatting, whitespace.
Werner Lemberg 179caf5a 2017-10-01T01:39:27 [psaux] Formatting, minor fixes, whitespace, copyright notices.
Werner Lemberg 9b549fa6 2017-09-30T16:36:28 [base,cff,cid] Whitespace, formatting.
Alexei Podtelezhnikov c8d8e158 2017-09-30T14:28:58 Signedness fixes in bitmap presetting. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3514. * src/raster/ftrend1.c (ft_raster1_render): Exlicitly signed height. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto. * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Explicitly unsigned subtraction.
Alexei Podtelezhnikov c26f7f97 2017-09-29T00:13:19 Bitmap metrics presetting [2/2]. * src/base/ftobjs.c (FT_Load_Glyph): Preset the bitmap metrics when appropriate but `FT_Render_Glyph' is not called. * include/freetype/freetype.h (FT_GlyphSlotRec): Document the change.
Alexei Podtelezhnikov ae7dc1f6 2017-09-28T22:59:31 [smooth, raster] Miscellaneous cleanups. * src/raster/ftrend1.c (ft_raster1_render): Clean up the exit. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Reduce translations and clean up the exit. (ft_smooth_render_lcd, ft_smooth_render_lcd): Remove unused `error'..
Ben Wagner c06b9cf5 2017-09-28T19:08:38 [truetype] Really, really fix #52082. * src/truetype/ttinterp.c (Ins_MDRP): Correct conditional.
Werner Lemberg ec7d2e5f 2017-09-28T14:21:34 * src/psaux/psintrp.c (cf2_doStems): Fix integer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3510
Ewald Hew 97cd1265 2017-09-28T08:29:33 * src/cid/cidgload.c (cid_slot_load_glyph): Fix memory leak. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3489
Alexei Podtelezhnikov 61d1818b 2017-09-28T00:20:50 Bitmap metrics presetting [1/2]. This mainly just extracts the code for presetting the bitmap metrics from the monochrome, grayscale, and LCD renderers into a separate function. * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): New function that calculates prespective bitmap metrics for the given rendering mode. * include/freetype/internal/ftobjs.h (ft_glyphslot_preset_bitmap): Declare it. * src/base/ftlcdfil.c (ft_lcd_padding): New helper function that adds padding to CBox taking into account pecularities of LCD rendering. * include/freetype/ftlcdfil.h (ft_lcd_padding): Declare it. * src/raster/ftrend1.c (ft_raster1_render): Reworked to use `ft_glyphslot_preset_bitmap'. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto. (ft_smooth_render_lcd, ft_smooth_render_lcd): The pixel_mode setting is moved to `ft_glyphslot_preset_bitmap'.
Ewald Hew dd40d10e 2017-09-28T10:42:23 Fix compiler warning. * src/psaux/pshints.c (cf2_hintmap_dump): Add switch for tracing code.
Werner Lemberg 693a1181 2017-09-27T08:42:50 * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning.
Werner Lemberg 12ae57d9 2017-09-26T12:53:41 Copyright notices, formatting, whitespace, minor doc fixes.
Ewald Hew 9428ee42 2017-09-25T06:15:46 Prepare for Type 1 mode. Add some checks for Type 1 data passing through. * src/psaux/psfont.h (CF2_Font): Add `isT1' flag. * src/psaux/psfont.c (cf2_font_setup): Skip the variations and blend code which is not applicable for Type 1. * src/psaux/psft.c (cf2_decoder_parse_charstrings): Avoid accessing `decoder->cff' in Type 1 mode. Copy `is_t1' flag to `CF2_Font'.
Ewald Hew 0589e3c0 2017-09-25T06:10:20 Use the new objects. * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Fix switching between new and old engines. * src/cff/cffgload.c, src/cff/cffparse.c: Update calls. * src/psaux/psblues.c, src/psaux/psfont.c, src/psaux/psfont.h, src/psaux/psft.c, src/psaux/psft.h, src/psaux/psintrp.c: Update all to use new objects.
Ewald Hew 43c01582 2017-09-24T23:00:36 Objects for new interpreter (part 2). Make the new objects copy over values. They are essentially wrapper types for the different decoders/builders. * include/freetype/internal/psaux.h: Update declarations. (PS_Builder): Add `is_t1' flag. (PS_Decoder_{Get,Free}_Glyph_Callback): Renamed to... (CFF_Decoder_{Get,Free}_Glyph_Callback: ... this. (PS_Decoder): Updated. Add `t1_parse_callback' member. (PSAux_ServiceRec): Add `ps_decoder_init' member. * src/psaux/psdecode.h, src/psaux/psobjs.h: Update declarations. * src/psaux/psdecode.c, src/psaux/psobjs.c: Implement copy with two modes. * src/psaux/psauxmod.c: Add builder and decoder functions to `PSAux' service.
Ewald Hew eba54c28 2017-09-24T22:49:56 Add objects for new interpreter. Introduce `PS_Decoder' and `PS_Builder' which include all fields from either Type 1 or CFF decoders/builders. * include/freetype/internal/psaux.h (PS_Builder, PS_Decoder): New structs. * src/psaux/psobjs.c, src/psaux/psobjs.h: Add `PS_Builder' functions. * src/psaux/psdecode.c, src/psaux/psdecode.h: New files to hold `PS_Decoder' initialization functions. * src/psaux/psaux.c, src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC): Updated.
Ewald Hew 766f529a 2017-09-24T22:40:07 Rename files. Replace the `cf2' file name prefix with `ps' as the Adobe engine will be used for both PostScript Types 1 and 2 (CFF) instead of just CFF. s/cf2/ps/ for all following. * src/psaux/cf2*: Rename files. * src/psaux/*: Update includes. * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRC_SRC, PSAUX_DRV_H): Update file references.
Ewald Hew 8a1b5c0c 2017-09-24T22:35:47 Minor fix. Use `MultiMasters' service in `psaux' instead of a call to `cff'. The project builds if CFF_CONFIG_OPTION_OLD_ENGINE is not defined. * src/psaux/cf2ft.c: Update includes. (cf2_getNormalizedVector): Use `mm->get_var_blend' instead of `cff_get_var_blend'.
Ewald Hew b624868b 2017-09-24T22:32:40 Move `cff_random' into `psaux' service. NOTE: Does not compile! Minor fix to allow both `cff' and `psaux' to use `cff_random'. * src/cff/cffload.c (cff_random): Move to... * src/psaux/psobjs.c: Here. * src/cff/cffload.h: Move corresponding declaration to `src/psaux/psobjs.h'. * include/freetype/internal/psaux.h (PSAux_ServiceRec): Register the function here... * src/psaux/psauxmod.c: And here. * src/cff/cffload.c, src/psaux/cf2intrp.c: Update code.
Ewald Hew df11628b 2017-09-24T22:28:07 Move struct declarations to `freetype/internal'. NOTE: Does not compile! This is so that the CFF functions moved to `psaux' can access the same structs that they need. * src/cff/cfftypes.h: Moved to... * include/freetype/internal/cfftypes.h: ...Here. * src/cff/cffobjs.h: Moved the struct declarations to... * include/freetype/internal/cffotypes.h: ... this new file. * include/freetype/internal/internal.h (FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_CFF_OBJECT_TYPES_H): New macros. * src/cff/cffcmap.h, src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffgload.h, src/cff/cffload.h, src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.h, src/psaux/psobjs.h, include/freetype/internal/psaux.h, include/freetype/internal/services/svcfftl.h: Update includes. * src/cff/rules.mk (CFF_DRV_H): Updated.
Ewald Hew edacde60 2017-09-24T22:20:38 Add new service for inter-module calls. NOTE: Does not compile! This is to allow CFF functions moved to `psaux' to call functions declared in `src/cff/cffload.h'. * include/freetype/internal/services/svcfftl.h: New file, setting up a `CFFLoad' service. * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC10, FT_DEFINE_SERVICEDESCREC): New macros. (FT_SERVICE_CFF_TABLE_LOAD_H): New macro. * src/cff/cffdrivr.c, src/cff/cffpic.h: Register the new service. * src/cff/cfftypes.h (CFF_FontRec), src/psaux/cf2font.h (CF2_FontRec): Add service interface. * src/cff/cffobjs.c, src/psaux/cf2font.c, src/psaux/cf2ft.c, src/psaux/cf2intrp.c, src/psaux/cffdecode.c: Use the new service.
Ewald Hew 9578e07a 2017-09-24T22:05:32 Add callbacks for inter-module calls. NOTE: Does not compile! * include/freetype/internal/psaux.h: Add function pointer declarations. * src/psaux/cffdecode.c (cff_decoder_init): Update to take in callbacks. * src/psaux/cffdecode.h: Ditto. * src/cff/cffgload.c (cff_compute_max_advance, cff_slot_load): Update calls to pass in callbacks. * src/psaux/cf2ft.c, src/psaux/cffdecode.c: Use them.
Ewald Hew 1487be58 2017-09-24T21:56:54 Create new `PSAux' service interface entries. NOTE: Does not compile! * include/freetype/internal/psaux.h: Include FT_INTERNAL_TRUETYPE_TYPES_H. (CFF_Builder_FuncsRec, CFF_Decocer_FuncsRec): New function tables. (CFF_Builder): Updated. Fix for forward declaration. (PSAux_ServiceRec): New field `cff_decoder_funcs'. * src/psaux/psauxmod.c (cff_builder_funcs, cff_decoder_funcs): New function tables. (PSAux_Interface): Updated. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `psaux' service interface. * src/cff/cffgload.c, src/cff/cffobjs.c, src/cff/cffparse.c: Update function calls to use psaux service.
Ewald Hew 816c9c1f 2017-09-24T21:43:05 Move CFF builder components into `psaux' module. NOTE: Does not compile! * src/cff/cffgload.c (cff_builder_{init,done,add_point,add_point1,add_contour,start_point,close_contour}, cff_check_points): Move to... * src/psaux/psobjs.c: Here. * src/cff/cffgload.h: Move corresponding declarations to `src/psaux/psobjs.h'. * src/cff/cffgload.h (CFF_Builder): Move struct declaration to... * include/freetype/internal/psaux.h: Here.
Ewald Hew 705bbe7c 2017-09-24T21:39:20 Move CFF decoder components into `psaux' module. NOTE: Does not compile! * src/cff/cffgload.c (CFF_Operator, CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts, cff_operator_seac, cff_compute_bias, cff_lookup_glyph_by_stdcharcode, cff_decoder_{parse_charstrings,init,prepare}): Move to... * src/psaux/cffdecode.c: This new file. * src/cff/cffgload.h: Move corresponding declarations to... * src/psaux/cffdecode.h: This new file. * src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS}, CFF_Decoder_Zone, CFF_Decoder): Move declarations to... * include/freetype/internal/psaux.h: Here. * src/psaux/cf2ft.h: Update include. * src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with the new file.
Werner Lemberg 4cdbac05 2017-09-25T09:05:00 Fix compiler warnings. * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant test. * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escCALLOTHERSUBR>: Add casts. * src/psaux/psobjs.c (ps_decoder_init): Add cast.
Ewald Hew a1a6a1f6 2017-09-25T08:31:52 Minor fixes. * include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}: Rearrange `ps_builder_init' arguments to conventional order. * src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and notice for `SubFont' in Type 1 mode.
Ewald Hew 6e7da50b 2017-09-25T08:29:38 Documentation fixes.
Ewald Hew ebb1735a 2017-09-25T08:26:57 Move `psdecode' into `psobjs'. As the former only contains a single procedure, move it into `psobjs' for simplicity. Also change the parameter order to the conventional one. * src/psaux/psdecode.c (ps_decoder_init): Moved to... * src/psaux/psobjs.c: ...Here. * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto. * include/freetype/internal/psaux.h (PSAux_ServiceRec): Update `ps_decoder_init' function signature. * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c: Update calls. * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes. * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC): Update file references.
Ewald Hew d52dd7f3 2017-09-25T08:22:26 Fix Type 1 hinting. Type 1 hinting breaks sometimes when mid-charstring hints should have been in the initial hintmap. This fix adds a preprocessing pass that reads all hints and builds the correct initial hintmap first, before proceeding to build the glyph outline. * src/psaux/psintrp.c (cf2_interpT2CharString): New `initial_map_ready' boolean flag. Ignore outline commands and hint changes on first pass. <cf2_cmdENDCHAR>: Add section to build hintmap and rewind.
Ewald Hew 2f0e1140 2017-09-25T08:19:33 Add tracing for hints. * src/psaux/pshints.c (cf2_hintmap_dump): New function. (cf2_hintmap_insertHint): Trace incoming and inserted hints. (cf2_hintmap_build): Dump hintmap before and after hint adjustment.
Ewald Hew 999a75b6 2017-09-25T08:16:59 Minor fixes. * src/psaux/psintrp.c (cf2_interpT2CharString): Fix check for pop results. s/font->decoder/decoder/ where necessary. <cf2_cmdHSTEM, cf2_cmdVSTEM, cf2_escHSTEM3, cf2_escVSTEM3>: Use offset parameter in `cf2_doStems' instead of doing correction for left-sidebearing.
Ewald Hew 0e53cf6d 2017-09-25T08:13:34 Use the new engine. * src/cid/cidgload.c: Update includes. (cid_load_glyph, cid_slot_load_glyph): Implement changes to glyph loading code as with `type1' module.
Ewald Hew a5c02f49 2017-09-25T08:11:32 Add Adobe engine configuration. This is similar to what was done in the `type1' module. * src/cid/cidriver.c (t1cid_driver_class): Update declaration. * src/cid/cidobjs.c: Include FT_TYPE1_DRIVER_H. (cid_driver_init): Update code.
Ewald Hew 93e3cffd 2017-09-25T08:08:21 Change subfont synthesis for CID fonts. Change `t1_make_subfont' to take in the Private dict record as an argument. This is because Type 1 and CID font records in FreeType have this in different places. * src/psaux/psobjs.c (t1_make_subfont): Change `T1_Face' to `FT_Face' so that CID is also accepted. Take `PS_Private' as an argument and let caller figure out where the Private dict actually is. Update references. * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update declaration. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update call.
Ewald Hew e28550af 2017-09-25T08:05:19 Switch to Adobe engine. * src/type1/t1objs.c (T1_Driver_Init): Set default to Adobe engine.
Ewald Hew d813b5da 2017-09-25T08:04:09 Extend Adobe interpreter (seac). This concludes the changes needed to add Type 1 support. * src/psaux/psintrp.c: Update includes. (cf2_interpT2CharString) <cf2_escSEAC>: Implement this similarly to implied seac for CFF. * src/psaux/t1decode.c (t1_lookup_glyph_by_stdcharcode_ps): New function to look up the glyph index. * src/psaux/psft.c (cf2_getT1SeacComponent, cf2_freeT1SeacComponent): New functions to get the charstrings for seac components. * src/psaux/t1decode.h, src/psaux/psft.h: Update declarations.
Ewald Hew d55a701d 2017-09-25T07:59:41 Extend Adobe interpreter (flex in callothersubr). * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escCALLOTHERSUBR>: Fix Flex feature handling (OtherSubrs 0, 1, 2). <cf2_cmdRMOVETO>: Do not actually move the `glyphPath' while doing flex. This is to avoid closing the current contour.
Ewald Hew 96682559 2017-09-25T07:54:02 Extend Adobe interpreter (callothersubr). * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escCALLOTHERSUBR>: Copy code from `t1_decoder_parse_charstrings' (in `t1decode.c'). OtherSubr 3 (change hints) should reset the hintmask, so that the new hints are applied. Fix function calls and stack access.
Ewald Hew 77c1b331 2017-09-25T07:50:03 Extend Adobe interpreter (pop). * src/psaux/psintrp.c (cf2_interpT2CharString): Change how unhandled OtherSubr results are stored. Implement the PostScript stack using an array. <cf2_escPOP>: Ensure that the stack is not cleared after getting `OtherSubr' results. Fix stack access.
Ewald Hew 1e4d3dc8 2017-09-25T07:47:10 Extend Adobe interpreter (callsubr). * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdCALLSUBR>: Type 1 mode. * src/psaux/psft.c (cf2_initLocalRegionBuffer): Add Type 1 mode.
Ewald Hew 4b58c518 2017-09-25T07:44:56 Extend Adobe interpreter (div, four-byte numbers). * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escDIV>: Add Type 1 mode. Type 1 requires large integers to be followed by `div'; cf. `Adobe Type 1 Font Format', section 6.2. <op == 255>: Push Type 1 four-byte numbers as `Int' always. This is to ensure `div' and `callsubr' get values they can use.