diff --git a/reactos/media/doc/3rd Party Files.txt b/reactos/media/doc/3rd Party Files.txt index d9c92597c87..04ed3f127fc 100644 --- a/reactos/media/doc/3rd Party Files.txt +++ b/reactos/media/doc/3rd Party Files.txt @@ -23,7 +23,7 @@ Used Version: 1.1 Website: http://www.geocities.com/dborca/opengl/tc.html Title: FreeType -Used Version: 2.6.4 +Used Version: 2.7.0 Website: http://www.freetype.org Title: Mesa3D diff --git a/reactos/sdk/lib/3rdparty/freetype/ChangeLog b/reactos/sdk/lib/3rdparty/freetype/ChangeLog index 2e3ff02d813..113dd3c96cc 100644 --- a/reactos/sdk/lib/3rdparty/freetype/ChangeLog +++ b/reactos/sdk/lib/3rdparty/freetype/ChangeLog @@ -1,3904 +1,12 @@ -2016-07-05 Werner Lemberg +2016-09-08 Werner Lemberg - * Version 2.6.4 released. - ========================= - - - Tag sources with `VER-2-6-4'. - - * docs/VERSION.TXT: Update documentation and bump version number to - 2.6.4. - - * 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.3/2.6.4/, s/263/264/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. - - * builds/unix/configure.raw (version_info): Set to 18:4:12. - * CMakeLists.txt (VERSION_PATCH): Set to 4. - - * docs/CHANGES: Updated. - -2016-07-05 Werner Lemberg - - * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Fix compiler warning. - -2016-07-04 Alexei Podtelezhnikov - - [smooth] Variable type revision (part 2). - - * src/smooth/ftgrays.c (TArea): Restore original definition as `int'. - (gray_render_line) [FT_LONG64]: Updated. - (gray_convert_glyph): 32-bit band bisection stack should be 32 bands. - (gray_convert_glyph_inner): Trace successes and failures. - -2016-07-04 Werner Lemberg - - [autofit] Handle single-point contours as segments. - - Doing so allows us to link them to edges – some fonts like - `NotoSansGurmukhi-Regular' have such isolated points sitting exactly - on other outlines. - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Don't - ignore one-point contours but handle them specially as one-point - segments. - (af_latin_hints_compute_edges): Append one-point segments to edges - if possible. - -2016-07-02 Werner Lemberg - - [autofit] Remove unused structure members. - - * src/autofit/afhints.h (AF_SegmentRec, AF_EdgeRec): Remove - `num_linked'. - - * src/autofit/afcjk.c (af_cjk_hints_link_segments): Updated. - -2016-07-02 Werner Lemberg - - [autofit] Update to Unicode 9.0.0. - - * src/autofit/afranges.c (af_arab_nonbase_uniranges, - af_cyrl_uniranges): Add new data. - -2016-07-01 Alexei Podtelezhnikov - - [smooth] Variable type revision (part 1). - - This patch restores original `TCoord' definition as `int' so that the - rendering pool is used more efficiently on LP64 platforms (unix). - - * src/smooth/ftgrays.c (gray_TWorker, TCell, gray_TBand): Switch some - fields to `TCoord'. - (gray_find_cell, gray_render_scanline, gray_render_line, gray_hline, - gray_sweep, gray_convert_glyph): Updated. - -2016-06-28 Alexei Podtelezhnikov - - [smooth] Minor clean-ups. - - * src/smooth/ftgrays.c (gray_TWorker): Remove redundant `ycount'. - (gray_sweep, gray_convert_glyph, gray_dump_cells): Updated. - -2016-06-27 Alexei Podtelezhnikov - - [smooth] Minor clean-ups. - - * src/smooth/ftgrays.c (gray_convert_glyph): Do not use volatile - qualifier. - (gray_raster_render): Move span initializations from here. - (gray_sweep): ... to here and remove unused `target' argument. - -2016-06-26 Alexei Podtelezhnikov - - [pcf] Fix handling of very large fonts (#47708). - - * src/pcf/pcfread.c (pcf_get_encodings): Make `encodingOffset' an - unsigned short. - Only reject `0xFFFF' as an invalid encoding offset. - -2016-06-25 Werner Lemberg - - [truetype] Really fix deallocation in case of error (#47726). - - * src/truetype/ttgload.c (load_truetype_glyph): Thinko; initialize - `outline.points' also. - -2016-06-23 Alexei Podtelezhnikov - - [smooth] Consolidate memory management. - - * src/smooth/ftgrays.c (gray_init_cells): Remove function. - (gray_TWorker): Remove fields that become local variables. - (gray_raster_render): Move rendering buffer declaration from here. - (gray_convert_glyph): ... to here and update accordingly. - -2016-06-22 Alexei Podtelezhnikov - - [smooth] Consolidate boundary checks. - - Removing the checks from `gray_hline' shaves 1% off rendering speed. - - * src/smooth/ftgrays.c [STANDALONE_]: Duplicate `FT_MIN' and `FT_MAX'. - (gray_TWorker): No need to store `clip_box'. - (gray_hline): Remove unnecessary boundary checks. - (gray_convert_glyph): Move boundary checks from here. - (gray_raster_render): ... to here and consolidate. - -2016-06-21 Alexei Podtelezhnikov - - [smooth] Use `FT_Outline_Get_CBox'. - - * src/smooth/ftgrays.c [STANDALONE_]: Duplicate `FT_Outline_Get_CBox'. - (gray_compute_cbox): Remove this function. - (gray_convert_glyph): Update to use `FT_Outline_Get_CBox'. - -2016-06-20 Werner Lemberg - - [smooth] Remove compiler warnings. - - * src/smooth/ftgrays.c (gray_convert_glyph): Fix reports from clang. - -2016-06-20 Alexei Podtelezhnikov - - [smooth] Sanitize memory managenent. - - * src/smooth/ftgrays.c (gray_convert_glyph): Cleaned up. - -2016-06-18 Alexei Podtelezhnikov - - [smooth] Remove `band_shoot' that never worked. - - * src/smooth/ftgrays.c (gray_TWorker): Remove `band_shoot'. - (gray_convert_glyph): Updated. - -2016-06-17 Alexei Podtelezhnikov - - [raster, smooth] Handle FT_RENDER_POOL_SIZE better. - - * src/raster/ftraster.c (FT_MAX_BLACK_POOL): New macro. - (ft_black_render): Updated. - * src/smooth/ftgrays.c (FT_MAX_GRAY_POOL): New macro. - (gray_raster_render): Updated. - -2016-06-16 Werner Lemberg - - * src/base/md5.c: Updated to recent version. - -2016-06-14 Alexei Podtelezhnikov - - * src/smooth/ftgrays.c (gray_hline): Optimize if-condition. - -2016-06-13 Werner Lemberg - - [autofit] Add support for Cherokee script. - - * src/autofit/afblue.dat: Add blue zone data for Cherokee. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Cherokee standard characters. - - * src/autofit/afranges.c: Add Cherokee data. - - * src/autofit/afstyles.h: Add Cherokee data. - -2016-06-09 David Capello - - [cmake] Avoid modifying `ftconfig.h' and `ftoption.h' files. - - * CMakeLists.txt: Each time cmake is run those files are - modified and the whole FreeType library is recompiled. With this - change we change the files only if there are real modifications, so - we can avoid recompilations. - -2016-06-09 Werner Lemberg - - [bdf] Check number of properties (#48166). - - * src/bdf/bdflib.c (_bdf_parse_start): Implement. - -2016-06-08 Alexei Podtelezhnikov - - [smooth] Re-enable new line renderer on 64-bit archs. - - * src/smooth/ftgrays.c (gray_render_line): Conditionally re-enable new - implementation, where it is safe from overflows. - -2016-06-08 Alexei Podtelezhnikov - - [smooth] Minor clean-ups. - - * src/smooth/ftgrays.c (gray_dump_cells): Move out of the way. - (gray_render_span): Remove spurious casts and streamline. - -2016-06-07 Werner Lemberg - - [autofit] Add support for Ethiopic script. - - * src/autofit/afblue.dat: Add blue zone data for Ethiopic. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Ethiopic standard characters. - - * src/autofit/afranges.c: Add Ethiopic data. - - * src/autofit/afstyles.h: Add Ethiopic data. - -2016-06-07 Werner Lemberg - - [autofit] Fix compilation with VS2016 (#48126). - - This compiler doesn't recognize the end-of-comment sequence `*/' if - it immediately follows non-ASCII characters. - - * src/autofit/afscript.h: Ensure whitespace before `*/'. - -2016-06-04 Werner Lemberg - - Fix a test for named instances (#48122). - - This was missed while giving negative face indices an extended - meaning. - - * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Implement. - -2016-05-31 Nikolaus Waxweiler - - [truetype] Let SHPIX move points in the twilight zone in v40. - - * src/truetype/ttinterp.c (Ins_SHPIX): Allow SHPIX to move points in - the twilight zone. Otherwise, treat SHPIX the same as DELTAP. - Unbreaks various fonts such as older versions of Rokkitt and DTL - Argo T Light that would glitch severly after calling ALIGNRP after a - blocked SHPIX. - -2016-05-30 Werner Lemberg - - [type42] Support `CharStrings' entry format as created by LilyPond. - - * src/type42/t42parse.c (t42_parse_charstrings): Handle entries - having the format - - (foo) cvn 12345 def - -2016-05-28 Werner Lemberg - - * src/autofit/afranges.c: Remove `UL' postfix from hex numbers. - - Suggested by Alexei. `UL' is only needed for 16bit compilers, but - it seems noone is using this anymore (and we no longer test whether - FreeType compiles in such an environment). Otherwise, it is easy to - add the postfix to the `AF_UNICODE_RANGE' macro. - -2016-05-26 Alexei Podtelezhnikov - - [smooth] Shrink bisection stack. - - The convergence of Bézier flatteners is fast with the deviation - from straight line being assymptotically cut 4-fold on each bisection. - This justifies smaller bisection stack size. - - * src/smooth/ftgrays.c (gray_TWorker): Remove common `bez_stack'. - (gray_render_conic): Create and use conic `bez_stack'. Move back the - band analysis from... - (gray_conic_to): ... here. - (gray_render_cubic): Create and use cubic `bez_stack'. Move back the - band analysis from... - (gray_cubic_to): ... here. - (gray_move_to): Updated. - -2016-05-25 Werner Lemberg - - [autofit] Fixes for Armenian and Gujarati ranges. - - * src/autofit/afranges.c (af_armn_uniranges): Corrected. - (af_guru_nonbase_uniranges): Make U+0A3E a base character. - -2016-05-24 Werner Lemberg - - [autofit] Add support for Armenian script. - - * src/autofit/afblue.dat: Add blue zone data for Armenian. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Armenian standard characters. - - * src/autofit/afranges.c: Add Armenian data. - - * src/autofit/afstyles.h: Add Armenian data. - -2016-05-23 Werner Lemberg - - * builds/unix/unix-cc.in (LINK_LIBRARY): Use `-export-symbols'. - - This was commented about 10 years ago – I think the reason then to - disable libtool's `-export-symbols' option was to give some badly - programmed applications access to internal FreeType functions. - - I believe that we should no longer take care of such programs; the - number of symbols exported should be rather restricted as much as - possible. - -2016-05-22 Werner Lemberg - - [autofit] Add blue-zone support for Gurmukhi script. - - This essentially moves the Gurmukhi script from the `Indic' hinter to - the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Gurmukhi. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Gurmukhi standard characters and move - data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Gurmukhi data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Gurmukhi data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2016-05-21 Werner Lemberg - - Minor clang++ fixes. - - * src/base/ftobjs.c (FT_Add_Module), src/psaux/psobjs.c - (ps_parser_load_field), src/type1/t1load.c (parse_subrs): Add - initializer. - - * src/cache/ftccache.h (FTC_CACHE_TRYLOOP_END): Avoid implicit - conversion from NULL to boolean. - -2016-05-21 Werner Lemberg - - Work around a bug of the C 8.0.0.1 compiler on AIX 5.3 (#47955). - - * include/freetype/internal/ftmemory.h (cplusplus_typeof): Use - braces for `extern "C++"'. - -2016-05-17 Nikolaus Waxweiler - - [truetype] Make TT_LOADER_SET_PP support subpixel hinting [3/3]. - - * src/truetype/ttgload.c (TT_LOADER_SET_PP): Replace macro with... - (tt_loader_set_pp): ... this new function. - Update all callers. - -2016-05-17 Nikolaus Waxweiler - - [truetype] New implementation of v38 bytecode interpreter [2/3]. - - This patch actually modifies the bytecode interpreter. - - See added comments in `ttinterp.h' for more information on this and - the following commit in the series. - - * src/truetype/ttinterp.c (SUBPIXEL_HINTING): Replaced by... - (NO_SUBPIXEL_HINTING, SUBPIXEL_HINTING_INFINALITY, - SUBPIXEL_HINTING_MINIMAL): ...new macros. - (Direct_Move, Direct_Move_X, Direct_Move_Y): Handle backwards - compatibility. - Updated. - (Ins_RS, Ins_FDEF, Ins_ENDF, Ins_CALL, Ins_LOOPCALL, Ins_MD): - Updated. - (Ins_INSTCTRL): Handle native ClearType mode flag. - Updated. - (Ins_FLIPPT, Ins_FLIPRGON, Ins_FLIPRGOFF): Handle backwards - compatibility. - (Move_Zp2_Point): Ditto. - (Ins_SHP): Updated. - (Ins_SHPIX): Handle backwards compatibility. - Updated. - (Ins_MSIRP, Ins_MDAP, Ins_MIAP, Ins_MDRP, Ins_MIRP): Updated. - (Ins_ALIGNRP): Updated. - (Ins_IUP, Ins_DELTAP): Handle backwards compatibility. - Updated. - (Ins_GETINFO): Handle v38 flags. - Updated. - (TT_RunIns): Handle backwards compatibility mode. - Updated. - -2016-05-17 Nikolaus Waxweiler - - [truetype] New implementation of v38 bytecode interpreter [1/3]. - - This patch prepares data structures and the like. - - See added comments in `ttinterp.h' for more information on this and - the following commits in the series. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Assign values to differentiate - between subpixel versions. - (TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY, - TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL): New macros. - - * include/freetype/ftttdrv.h (TT_INTERPRETER_VERSION_40): New macro. - - * include/freetype/internal/tttypes.h (TT_FaceRec): Updated. - - * src/truetype/ttinterp.h (TT_ExecContextRec): Define new fields - `subpixel_hinting_lean', `vertical_lcd_lean', - `backwards_compatibility', `iupx_called', iupy_called', and - `grayscale_cleartype' for new hinting mode. - - * src/truetype/ttdriver.c (tt_property_set): Handle v38 and v40 - interpreters conditionally. - - * src/truetype/ttgload.c (TT_Hint_Glyph): Save phantom points unless - in v38 backwards compatibility mode. - Updated. - (compute_glyph_metrics): Add v38 backwards compatibility mode - constraint for adjusting advance widths. - Updated. - (tt_loader_init): Handle new flags `subpixel_hinting_lean', - `grayscale_cleartype', and `vertical_lcd_lean'. - Updated. - (tt_get_metrics, TT_Process_Simple_Glyph, TT_LOADER_SET_PP): - Updated. - - * src/truetype/ttobjs.c (tt_driver_init): Conditionally set - default interpreter version number. - - * src/truetype/ttsubpix.c, src/truetype/ttsubpix.h: Updated. - -2016-05-17 Werner Lemberg - - [cff] Fix matrix scaling (#47848). - - * include/freetype/config/ftstdlib.h (FT_LONG_MIN): New macro. - - * src/cff/cffparse.c (cff_parse_font_matrix): Use largest scaling - value of all matrix coefficients to scale matrix. - - * src/cff/cffobjs.c (cff_face_init): Use `matrix->yx' member for - matrix normalization if `matrix->yy' is zero. - -2016-05-16 Werner Lemberg - - [base] Reject invalid sfnt Mac resource (#47891). - - * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Check validity - of `CID ' and `TYPE1' table offset and length. - -2016-05-16 Werner Lemberg - - [cid] Fix scanning for `StartData' and `/sfnts' (#47892). - - * src/cid/cidparse.c (STARTDATA, STARTDATA_LEN, SFNTS, SFNTS_LEN): - New macros. - (cid_parser_new): Fix and document algorithm. - -2016-05-16 suzuki toshiya - - [truetype] Improve the recursive reference detector. - - The previous fix for #46372 misunderstood a composite glyph referring - same component twice as a recursive reference. See the discussion - - http://lists.gnu.org/archive/html/freetype/2016-05/msg00000.html - - Thanks to Khaled Hosny for finding this issue. - - * src/truetype/ttgload.c (ft_list_get_node_at): A function to get - the i-th node from FT_List. - (load_truetype_glyph): In the traversal scan of the reference tree - in the composite glyph, we clear the nodes filled by previous - sibling chain. - -2016-05-07 Werner Lemberg - - [cache] Allow value 0 for face ID. - - We never dereference `face_id', and some implementations might use a - running number instead of a pointer. Additionally, disallowing - value zero was undocumented. - - * src/cache/ftccmap.c (FTC_CMapCache_Lookup), src/cache/ftcmanag.c - (FTC_Manager_LookupFace, FTC_Manager_RemoveFaceID): Remove test for - `face_id'. - -2016-05-05 Alexei Podtelezhnikov - - [smooth] More efficient accounting of conic splits and draws. - - A single decrement counter of segments to draw, instead of an array, - contains all the information necessary to decide when to split and - when to draw a conic segment. The number of splits before each draw is - equal to the number of trailing zeros in the counter. - - * src/smooth/ftgrays.c (gray_TWorker): Remove `lev_stack'. - (gray_render_conic): Updated to use decrement counter of segments. - -2016-05-05 Werner Lemberg - - [cff, truetype] Fix logic for `FT_Property_Set'. - - Otherwise some properties could be set to arbitrary values, which is - harmless, but querying could give wrong positive results. - - * src/cff/cffdrivr.c (cff_property_set) [hinting-engine], - * src/truetype/ttdriver.c (tt_property_set) [interpreter-version]: - Only allow defined values. - -2016-04-25 Werner Lemberg - - [autofit] Add blue-zone support for Gujarati script. - - This essentially moves the Gujarati script from the `Indic' hinter to - the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Gujarati. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Gujarati standard characters and move - data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Gujarati data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Gujarati data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2016-04-24 Werner Lemberg - - Minor. - - * include/freetype/freetype.h (FT_HAS_*, FT_IS_*): Protect macro - argument with parentheses. - -2016-04-24 Werner Lemberg - - [truetype] Fix deallocation in case of error (#47726). - - * src/truetype/ttgload.c (load_truetype_glyph): Initialize fields in - `outline' that are going to be deallocated in case of error. - -2016-04-23 Werner Lemberg - - [autofit] Improve Georgian blue zone characters. - - Suggested by Akaki Razmadze . - - * src/autofit/afblue.dat (AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM): - Updated. - - * src/autofit/afblue.c: Regenerated. - -2016-04-16 David Capello - - [cmake] Honor SKIP_INSTALL_* settings (as used in zlib). - - As FreeType depends on zlib, if we don't install zlib (e.g., because - we defined SKIP_INSTALL_ALL), FreeType cannot be installed, too - (cmake triggers an error saying that FreeType cannot be installed - because zlib target isn't in the export set). - - * CMakeLists.txt: Honor `SKIP_INSTALL_HEADERS', - `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL' settings. - -2016-04-16 Behdad Esfahbod - - [truetype] Another fix for non-intermediate GX tuples. - - * src/truetype/ttgxvar.c (ft_var_apply_tuple): Add some missing - cases. - -2016-04-12 Alexei Podtelezhnikov - - Remove forgotten macro. - - * include/freetype/internal/internal.h - [FT_INTERNAL_POSTSCRIPT_GLOBALS_H]: Remove. - -2016-04-09 Werner Lemberg - - [autofit] Add support for Georgian scripts. - - Georgian is problematic, since `uppercase' forms of Mkhedruli - (called Mtavruli) are not yet defined in Unicode, which means that - proper blue zones can't be defined. However, there is already a - proposal submitted to Unicode; see - - http://www.unicode.org/L2/L2016/16034-n4707-georgian.pdf - - Additionally, due to historical reasons, Unicode treats Khutsuri as - the same script as Mkhedruli, and so does OpenType. However, since - the two scripts have completely different shapes it can happen that - blue zones differ considerably. The tag `geok' used here (derived - from ISO 15924) to differentiate the two scripts is not an OpenType - tag in use. If we now have a font that contains both glyphs for - Mkhedruli and Khutsuri, and it uses OpenType features for both also, - HarfBuzz unavoidably treats all glyphs as `geor'. As a consequence, - blue zones for `geok' are not used for glyphs involved in the - OpenType features. - - An issue not yet resolved is which OpenType feature should be used - to access Mtavruli glyph shapes; right now, FreeType doesn't set up - support for them, but it is easy to add them later on as soon as - more information is available. - - * src/autofit/afblue.dat: Add blue zone data for Georgian. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Georgian standard characters. - - * src/autofit/afranges.c: Add Georgian data. - - * src/autofit/afstyles.h: Add Georgian data. - -2016-04-05 Werner Lemberg - - [autofit] Provide dummy blue zone for pseudo script `none'. - - Even if the dummy hinter is used as the handler for `none' (which - doesn't use blue zones), it is more consistent than the old value - (which was 0), pointing to Arabic... - - * src/autofit/afblue.dat: Add `AF_BLUE_STRINGSET_NONE'. - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afstyles.h (none_dflt): Use AF_BLUE_STRINGSET_NONE. - -2016-03-30 Werner Lemberg - - * src/pfr/pfrload.c (pfr_aux_name_load): Thinko (#47567). - -2016-03-30 Werner Lemberg - - * src/pfr/pfrload.c (pfr_log_font_count): Better font size estimate. - -2016-03-30 Werner Lemberg - - * src/pfr/pfrload.c (pfr_aux_name_load): Fix memory leak (#47567). - -2016-03-29 Werner Lemberg - - * src/base/ftadvanc.c (FT_Get_Advances): Fix invalid left shift. - -2016-03-29 Werner Lemberg - - [pfr] Fix binary search (#47514). - - * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Handle border - conditions correctly. - -2016-03-29 Werner Lemberg - - [pfr] Minor. - - * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Replace `left', - `right', and `middle' with `min', `max', and `mid' as used in other - FreeType binary search code. - (pfr_load_bitmap_metrics): Fix invalid left shift. - -2016-03-29 Werner Lemberg - - * src/pfr/pfrtypes.h: Replace all enums with macros. - - We need `~FOO' to unset bits, and only with unsigned values (which - `enum' isn't normally) this works cleanly. - -2016-03-26 Werner Lemberg - - [pfr] Robustify bitmap strike handling (#47514). - - We did a binary search for a charcode without ensuring that the - searched data is ordered. Validating the order is now done lazily, - this is, the first access to a bitmap glyph triggers the order check - in the corresponding bitmap strike. - - * src/pfr/pfrtypes.h (PFR_BitmapFlags): New values - `PFR_BITMAP_VALID_CHARCODES' and `PFR_BITMAP_CHARCODES_VALIDATED'. - - * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Make `flags' argument - a pointer. Handle new PFR_BITMAP_XXX flags. - (pfr_slot_load_bitmap): Updated. - -2016-03-26 Werner Lemberg - - [pfr] Fix handling of compound glyphs. - - Extra items are indicated with different bit positions. - - * src/pfr/pfrtypes.h (PFR_GlyphFlags): Replace - `PFR_GLYPH_EXTRA_ITEMS' with `PFR_GLYPH_SIMPLE_EXTRA_ITEMS' and - `PFR_GLYPH_COMPOUND_EXTRA_ITEMS'. - - * src/pfr/pfrgload.c (pfr_glyph_load_simple, - pfr_glyph_load_compound): Use them. - -2016-03-25 Werner Lemberg - - [pfr] Minor. - - * src/pfr/pfrsbit.c, src/pfr/pfrobjs.c: Use flag names instead of - bare numbers. - -2016-03-25 Werner Lemberg - - [pfr] Various clang sanitizer fixes. - - * src/pfr/pfrsbit.c (pfr_load_bitmap_metrics): Correctly handle - signed nibbles. - (pfr_slot_load_bitmap): Correctly exit frame in case of error. - Fix invalid left shifts. - -2016-03-23 Werner Lemberg - - Rename `VERSION.DLL' (#47472). - - * docs/VERSION.DLL: Renamed to... - * docs/VERSIONS.TXT: ...this. - -2016-03-23 Werner Lemberg - - [raster, smooth] Directly test outline size (#47500). - - This improves stand-alone compilation. - - * src/base/ftoutln.c (FT_Outline_Render): Move cbox size test to... - - * src/raster/ftraster.c (ft_black_render), src/smooth/ftgrays.c - (gray_raster_render): ...these functions. - -2016-03-23 Werner Lemberg - - [raster, smooth] Fix some clang sanitizer runtime issues. - - * src/raster/ftraster.c (ft_black_reset, ft_black_set_mode, - ft_black_render): Harmonize signatures with `ftimage.h'. - - * src/smooth/ftgrays.c (gray_raster_render, gray_raster_reset): - Ditto. - -2016-03-22 Werner Lemberg - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Minor. - - This fixes an AddressSanitizer issue: - - ttgload.c:430:7: runtime error: null pointer passed as argument 1, - which is declared to never be null - -2016-03-21 Werner Lemberg - - * src/autofit/afhints.c (af_glyph_hints_reload): Thinko. - - This fixes the previous commit to this file. - -2016-03-21 Alexei Podtelezhnikov - - [smooth] Partly revert recent changes. - - * src/smooth/ftgrays.c (gray_conic_to, gray_cubic_to): Rework - conditions to fix rendering issues. - -2016-03-20 Werner Lemberg - - [autofit] Show `near' points in tracing. - - * src/autofit/afhints.h (AF_FLAG_NEAR): New macro. - - * src/autofit/afhints.c (af_glyph_hints_dump_points): Implement it. - (af_glyph_hints_reload): Handle AF_FLAG_NEAR. - -2016-03-18 Alexei Podtelezhnikov - - [smooth] Minor refactoring and microoptimizations. - - * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move - band clipping from here. - (gray_conic_to, gray_cubic_to): ... to here. - (gray_rander_line, gray_render_scanline): Initialize variables closer - to their use. - -2016-03-17 Alexei Podtelezhnikov - - [smooth] Minor refactoring. - - * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move - upscaling from here. - (gray_conic_to, gray_cubic_to): ... to here. - -2016-03-15 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_compute_stem_width): Optimize. - -2016-03-14 Alexei Podtelezhnikov - - [smooth] Temporarily revert 6eb6158dd787 (#47114). - - * src/smooth/ftgrays.c (gray_render_line): Old implementation. - -2016-03-12 Werner Lemberg - - [ftfuzzer] Improve coverage of rasterfuzzer. - - * src/tools/ftfuzzer/rasterfuzzer.cc (LLVMFuzzerTestOneInput): Use - input data for `tags' array also. - Trim input data to get more positive hits. - -2016-03-11 Pavlo Denysov - - Fix CMake issues for iOS (patch #8941). - - * CMakeLists.txt (CMAKE_TOOLCHAIN_FILE): Fix directory. - * builds/cmake/iOS.cmake: No longer enforce gcc. - -2016-03-09 Behdad Esfahbod - - [truetype] Fix handling of non-intermediate GX tuples. - - We probably did not notice this as all fonts we tested had only - tuple_coords[i] be +1 or -1 for non-intermediate tuples. - - * src/truetype/ttgxvar.c (ft_var_apply_tuple): Implement it. - -2016-03-06 Alexei Podtelezhnikov - - [base] Refuse to render enormous outlines (#47114). - - The goal is to avoid integer overflows in the rendering algorithms. - The limit is chosen arbitrarily at some 2^18 pixels, which should be - enough for modern devices including printers. - - * src/base/ftoutln.c (FT_Outline_Render): Check CBox and reject - enormous outlines. - -2016-03-06 Alexei Podtelezhnikov - - [smooth] Replace left shifts with multiplications (#47114). - - * src/smooth/ftgrays.c (SUBPIXELS, UPSCALE, DOWNSCALE): Do it. - -2016-03-05 Werner Lemberg - - [autofit] Avoid excessive stem length rounding (#25392). - - * src/autofit/aflatin.c (af_latin_compute_stem_width): Add argument - to pass difference between hinted and unhinted position of base - point; use this to adjust the stem width depending on the PPEM so - that it doesn't become too large under certain circumstances. - Update all callers using value 0 for this argument except... - (af_latin_align_linked_edge): Pass position delta of base point to - `af_latin_compute_stem_width'. - -2016-03-05 J Raynor - - Make FreeType compile on AIX out of the box. - - * builds/unix/configure.raw (XX_ANSIFLAGS): Don't use `-ansi' on - AIX. - -2016-03-01 Werner Lemberg - Kostya Serebryany - - [ftfuzzer] Add unit for testing smooth and black rasterizers. - - * src/tools/ftfuzzer/rasterfuzzer.cc: New file. - -2016-03-01 Werner Lemberg - - [autofit] Fix reallocation error introduced in 2016-02-27 (#47310). - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Reassign - `prev_segment' after reallocation. - -2016-03-01 Werner Lemberg - - Fix clang warnings. - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Use - FT_UShort for `min_flags' and `max_flags'. - Initialize `prev_*' variables. - - * src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Fix - types of local variables. - - * src/smooth/ftgrays.c (gray_dump_cells) [FT_DEBUG_LEVEL_TRACE]: - Update `printf' format string. - - * src/tools/ftfuzzer/ftfuzzer.cc (setIntermediateAxis): Add cast. - (LLVMFuzzerTestOneInput): Fix loop type. - -2016-02-29 Werner Lemberg - - [autofit] Add blue-zone support for Sinhala script. - - This essentially moves the Sinhala script from the `Indic' hinter to - the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Sinhala. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Sinhala standard character and move data - out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Sinhala data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Sinhala data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2016-02-27 Werner Lemberg - - [autofit] Properly handle spikes pointing to the x-axis. - - An example that gets better rendered is glyph `uusignTaml' (glyph - index 2286) in font `FreeSerif.ttf' (Version 0412.2263) at 22ppem. - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Properly - handle segments where the last point of the first segment is - identical to the first point in the second one. This can happen for - malformed fonts or spikes. We either merge the new segment with the - previous one (both segments point into the same direction), or we - discard the shorter segment if they point into different directions. - -2016-02-27 Werner Lemberg - - [autofit] Minor code clean-up. - - * src/autofit/aflatin.c (af_latin_hints_compute_segments): Change - some local variable names to better differentiate between values - along a segment and values orthogonal to it. - -2016-02-26 Werner Lemberg - - [autofit] Improve BOUND action. - - In complex glyph shapes, the original logic was too simple to cater - for situations that would actually need something similar to PS Hint - masks. This fix should alleviate the worst cases. - - * src/autofit/aflatin.c (af_latin_hint_edges): Don't allow - complete disappearance of stems. - -2016-02-25 Werner Lemberg - - [autofit] Add blue-zone support for Tamil script. - - This essentially moves the Tamil script from the `Indic' hinter to - the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Tamil. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Tamil standard character and move data - out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Tamil data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Tamil data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2016-02-18 Werner Lemberg - - [autofit] Add blue-zone support for Malayalam script. - - This essentially moves the Malayalam script from the `Indic' hinter - to the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Malayalam. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Malayalam standard characters and move - data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Malayalam data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Malayalam data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2016-02-16 Alexei Podtelezhnikov - - [smooth] Fix integer overflow (#47114). - - * src/smooth/ftgrays.c (TArea): Make it unconditionally `long'. - -2016-02-15 Werner Lemberg - - * src/cff/cffparse.c (cff_parse_multiple_master): Improve tracing. - -2016-02-15 Werner Lemberg - - [cff] Handle T2 operator only with old CFF engine (#47157). - - * src/cff/cffparse.c (cff_parser_run) : Enclose with - #ifdef CFF_CONFIG_OPTION_OLD_ENGINE...#endif. - -2016-02-15 Werner Lemberg - - [cff] Partially handle `load' and `store' ops in old CFF engine. - - Now all glyphs of MM CFFs like `ITCGaramondMM-It.otf' can be - displayed. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) : Partially implement it. - - * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass - the number of Multiple Master axes. - Update all callers. - (cff_parse_multiple_master): Get number of axes. - (cff_parser_run) : Updated. - * src/cff/cffparse.h: Updated. - (CFF_ParserRec): Add `num_axes' field. - - * src/cff/cffload.c: Updated. - - * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_axes' field. - -2016-02-15 Werner Lemberg - - [cff] Correctly trace SIDs that contain NULL bytes. - - We need this to properly trace Multiple Master CFFs, which contain - two SIDs that are charstrings. - - This commit makes FreeType also show the last SID, omitted - previously due to a bug. - - * src/cff/cfftypes.h (CFF_FontRec): Add `string_pool_size' field. - - * src/cff/cffload.c (cff_index_get_pointers): Add argument to return - the pool size. - Update all callers. - - * src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Directly - access `cff->strings' to display the non-default strings. - -2016-02-14 Werner Lemberg - - * src/base/fthash.c: Include FT_INTERNAL_MEMORY_H. - -2016-02-14 Werner Lemberg - - * src/cff/cffparse.c: Include `cffgload.h'. - - Problem reported by Colin Walters . - -2016-02-14 Werner Lemberg - - [cff] Make old CFF engine show MM CFFs (without variations). - - The new code only displays the first master in the font. - - * src/cff/cffgload.c (cff_decode_parse_charstrings): Add new - parameter to allow function calls from dictionaries also. - : Partially implement it. - Update all callers. - * src/cff/cffgload.h: Updated. - - * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass the - number of Multiple Master designs. - Update all callers. - (cff_parse_multiple_master): New function to rudimentarily parse - operator. - (cff_parser_run): Handle `T2' operator. - * src/cff/cffparse.h: Updated. - (CFF_ParserRec): Add `num_designs' field. - - * src/cff/cffload.c: Updated. - - * src/cff/cfftoken.h: Handle `MultipleMaster' operator. - - * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_designs' field. - - * src/sfnt/sfobjs.c (sfnt_init_face): Don't handle `fvar' table for - MM CFFs. - -2016-02-09 Werner Lemberg - - [docmaker] Don't emit trailing newlines. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_code): - Use `rstrip'. - -2016-02-07 Werner Lemberg - - * Version 2.6.3 released. - ========================= - - - Tag sources with `VER-2-6-3'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.6.3. - - * 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.2/2.6.3/, s/262/263/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. - - * builds/unix/configure.raw (version_info): Set to 18:3:12. - * CMakeLists.txt (VERSION_PATCH): Set to 3. - - * docs/CHANGES: Updated. - -2016-02-07 Werner Lemberg - - Fix another runtime error found by clang's sanitizer (#47082). - - * src/base/ftstroke.c (ft_stroke_border_export): Properly handle - empty input buffer. - -2016-02-07 Werner Lemberg - - Fix runtime errors found by clang's sanitizer (#47082). - - * src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c - (FT_Outline_Copy), src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): - Properly handle empty input buffer. - -2016-02-07 Werner Lemberg - - [cff] Minor. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) : - Remove dead code. - -2016-02-07 Werner Lemberg - - [cff] Implement missing operators in new engine (except `random'). - - * src/cff/cf2font.h (CF2_STORAGE_SIZE): New macro. - - * src/cff/cf2intrp.c (cf2_interpT2CharString): Implement the - following operators: abs, add, and, div, drop, dup, eq, exch, get, - ifelse, index, mul, neg, not, or, put, roll, sqrt, sub. - - * src/cff/cf2stack.h, src/cff/cf2stack.c (cf2_stack_roll): New - auxiliary function for `roll' operator. - -2016-02-06 Werner Lemberg - - [cff] Fix some Type 2 operators in old CFF engine. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Fix `eq' - operator, add `not' and (unsupported) `blend' operators. - -2016-02-05 Sebastian Rasmussen - - Make direct call of `make install' work (#47072). - - * builds/unix/unix-def.in (freetype-config): Make sure - `freetype-config' is generated for both make targets (`all' and - `install'). - -2016-02-05 Werner Lemberg - - [base] Fix advance width loading for MM and GX fonts (#47064). - - * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Return false for - MM and GX fonts. - Update callers. - -2016-02-03 Werner Lemberg - - [cff] Fix handling of face_index == -1 for pure CFF. - - * src/cff/cffobjs.c (cff_face_init): Return correct number of faces. - -2016-01-30 Werner Lemberg - - [autofit] Minor tracing improvement. - - * src/autofit/afhints.c (af_glyph_hints_dump_points): Insert newline - at the start of a new contour. - -2016-01-28 Nikolaus Waxweiler - - Remove unpatented hinter (3/3). - - * include/freetype/config/ftoption.h - (TT_CONFIG_OPTION_UNPATENTED_HINTING): Remove. - - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove - `ignore_unpatented_hinter' field. - Update users. - (FT_DEBUG_HOOK_UNPATENTED_HINTING): Remove. - Update users. - - * include/freetype/internal/tttypes.h (TT_FaceRec): Remove - `unpatented_hinting' field. - Update users. - - * src/base/ftpatent.c (_tt_check_patents_in_range, - _tt_check_patents_in_table, _tt_face_check_patents): Remove. - (FT_Face_CheckTrueTypePatents, FT_Face_SetUnpatentedHinting): - Replace code with dummies. - - * src/truetype/ttobjs.c (tt_face_init): Remove now defunct code. - * src/truetype/ttobjs.h (TT_GraphicsState): Remove `both_x_axis' - field. - -2016-01-28 Nikolaus Waxweiler - - Remove unpatented hinter (2/3). - - * devel/ftoption.h (TT_CONFIG_OPTION_UNPATENTED_HINTING): Remove. - -2016-01-28 Nikolaus Waxweiler - - Remove unpatented hinter (1/3). - - * src/truetype/ttinterp.c [TT_CONFIG_OPTION_UNPATENTED_HINTING]: - Remove all code related to this macro. - -2016-01-28 Werner Lemberg - - [autofit] Add blue-zone support for Kannada script. - - This essentially moves the Kannada script from the `Indic' hinter to - the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Kannada. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Kannada standard characters and move - data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Kannada data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Kannada data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2016-01-22 Alexei Podtelezhnikov - - Better access to 64-bit integers for C99 compilers. - - * include/freetype/config/ftconfig.h [FT_LONG64]: Use - __STDC_VERSION__ to define 64-bit integers. - * builds/unix/ftconfig.in [FT_LONG64]: Ditto. - * builds/vms/ftconfig.h [FT_LONG64]: Ditto. - -2016-01-21 Werner Lemberg - - [gxvalid] Remove commented out code. - - * src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Do it. - -2016-01-20 Werner Lemberg - - [autofit] Complete last autofit commit. - - Problem reported by Kostya Serebryany . - - * src/autofit/afshaper.c (af_shaper_get_coverage) - [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Update signature. - -2016-01-20 Werner Lemberg - - Still handle `__FTERRORS_H__'. - - We need this for backwards compatibility. - - Problem reported by John Emmas . - - * include/freetype/fterrors.h: Fix inclusion guard so that - undefining either `FTERRORS_H_' or `__FTERRORS_H__' works as - expected. - -2016-01-19 Werner Lemberg - - [autofit] Fix handling of default script. - - Patch taken from ttfautohint, commit - 071ae2c00e0d67f9d19418f4fade1c23d27dc185. - - There were two bugs. - - - We now use non-standard script tags like `khms' for special - purposes. However, HarfBuzz maps such tags to `DFLT', and - without this commit the associated lookups were incorrectly - assigned to the non-standard tags. - - - Let's assume we have a Bengali font, and the font's `DFLT' - script tag handles the necessary lookups for Bengali, too. - Without this commit, the `DFLT' lookups were assigned to - ttfautohint's default script (usually `latn') before the - standard lookups for Bengali were handled. - - We now have the following order while searching for covered - glyph indices. - - special features of scripts (e.g. `sups' for Cyrillic) - Unicode mappings of scripts - remaining features of scripts (especially important for Indic - scripts) - default features of default script - - * src/autofit/afshaper.c, src/autofit/afshaper.h - (af_shaper_get_coverage): Add boolean parameter to indicate default - script. - Update all callers. - - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): - Fix search order for coverages. - -2016-01-19 Werner Lemberg - - Various minor clang fixes. - - * src/autofit/afcjk.c (af_cjk_metrics_init_widths), - src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize - `ch'. - - * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Add cast. - - * src/base/ftdbgmem.c (ft_mem_table_destroy): Add cast. - - * src/base/fthash.c (hash_num_lookup): Add cast. - - * src/base/fttrigon.c (ft_trig_downscale) [FT_LONG64]: Fix cast. - - * src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Comment out - redundant code. - - * src/type1/t1driver.c (t1_get_ps_font_value) : Add - cast. - - * src/type1/t1load.c (parse_subrs): Fix type of `count'. - -2016-01-19 Derek B. Noonburg - - [truetype] Add another tricky font. - - * src/truetype/ttobjs.c (TRICK_SFNT_IDS_NUM_FACES): Increase. - (sfnt_id): Add variant of `DFKaiShu'. - -2016-01-14 Alexei Podtelezhnikov - - [base] Empower `FT_Library_SetLcdFilterWeights'. - - * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): Enable filter - in addition to setting weights. - (FT_Library_SetLcdFilter): Clean out FT_FORCE_LIGHT_LCD_FILTER and - FT_FORCE_LEGACY_LCD_FILTER. - * include/freetype/ftlcdfil.h: Documentation update. - -2016-01-12 Werner Lemberg - - Don't use macro names that start with `_[A-Z]' [3/3]. - - Such macro names are reserved for both C and C++. - - * src/cache/ftccache.h: s/_FTC_FACE_ID_HASH/FTC_FACE_ID_HASH/. - Update all callers. - (FTC_CACHE_LOOKUP_CMP): Replace `_XXX' with `XXX_'. - * src/cache/ftcmru.c (FTC_MRULIST_LOOKUP_CMP): Ditto. - -2016-01-12 Werner Lemberg - - Don't use macro names that start with `_[A-Z]' [2/3]. - - Such macro names are reserved for both C and C++. - - * include/freetype/ftimage.h, src/raster/ftraster.c, - src/smooth/ftgrays.c, src/smooth/ftgrays.h: - s/_STANDALONE_/STANDALONE_/. - -2016-01-12 Werner Lemberg - - Don't use macro names that start with `_[A-Z]' [1/3]. - - Such macro names are reserved for both C and C++. - - * src/bdf/bdflib.c: Replace macros of the form `_BDF_XXX' with - `BDF_XXX_'. - -2016-01-12 Werner Lemberg - - Don't use macro names that contain `__' [2/2]. - - Such macro names are reserved for both C and C++. - - * src/cache/*: s/__/_/. - -2016-01-12 Werner Lemberg - - Don't use macro names that contain `__' [1/2]. - - Such macro names are reserved for both C and C++. - - * */*: Replace macros of the form `__XXX_H__' with `XXX_H_'. - -2016-01-10 Jered Gray - - [cff] Fix usage of `|' operator. - - * src/cff/cf2intrp.c (cf2_interpT2CharString) [cf2_cmdEXTENDEDNMBR, - default]: `|' is not guaranteed to be processed from left to right - by the compiler. However, the code repeatedly calls - `cf2_buf_readByte' to get the arguments to `|' ... Fix this. - -2015-12-25 Werner Lemberg - - [autofit] Make top-to-bottom hinting work in latin auto-hinter. - - This improves rendering of scripts like Bengali or Devanagari. - - * src/autofit/afhints.c (af_axis_hints_new_edge): Add parameter to - pass top-to-bottom hinting flag. This makes the function sort edges - in descending vertical position. - - * src/autofit/afhints.c: Updated. - - * src/autofit/aflatin.c (af_latin_hints_compute_edges, - af_latin_hint_edges): Use `top_to_bottom_hinting' flag. - - * src/autofit/afcjk.c (af_cjk_hints_compute_edges), - src/autofit/aflatin2.c (af_latin2_hints_compute_edges): Updated. - -2015-12-24 Werner Lemberg - - [autofit] Add hinting direction to `AF_ScriptClassRec'. - - Still unused. - - * src/autofit/afglobal.c (SCRIPT): Handle hinting direction. - - * src/autofit/aftypes.h (AF_ScriptClassRec): Add - `top_to_bottom_hinting' field. - (AF_HINTING_BOTTOM_TO_TOP, AF_HINTING_TOP_TO_BOTTOM): New macros. - (AF_DEFINE_SCRIPT_CLASS): Updated. - -2015-12-23 Werner Lemberg - - [autofit] Start implementing hinting direction (up/down, down/up). - - Right now, it does nothing. - - * src/autofit/afscript.h: Add another parameter to `SCRIPT', - specifying hinting direction. - - * src/autofit/afglobal.c, src/autofit/afglobal.h, - src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/afshaper.c, - src/autofit/aftypes.h: Extend `SCRIPT' definitions. - -2015-12-22 Werner Lemberg - - * src/type1/t1load.c (parse_subrs): Fix memory leak (#46744). - -2015-12-22 Werner Lemberg - - [base] Make hash interface symmetric. - - Use `num' and `str' infixes everywhere. - - * src/base/fthash.c (ft_hash_init): Renamed to... - (hash_init): ... This. - (ft_hash_str_init, ft_hash_num_init): New functions. - (ft_hash_free): Renamed to... - (ft_hash_str_free): ... This. - - * include/freetype/internal/fthash.h: Updated. - - * src/bdf/bdflib.c, src/type1/t1load.c, src/type1/t1objs.c: Updated. - -2015-12-21 Werner Lemberg - - [type1] Avoid shift of negative numbers (#46732). - - * src/type1/t1load.c (parse_subrs): Do it. - -2015-12-20 Werner Lemberg - - [type1, psaux] Handle large values of num_subrs correctly (#46692). - - We now use a hash to map from subr indices to array elements holding - the subroutines, if necessary. - - * include/freetype/internal/t1types.h: Include FT_INTERNAL_HASH_H. - (T1_FontRec): Add `subrs_hash' field. - - * include/freetype/internal/psaux.h: Include FT_INTERNAL_HASH_H. - (T1_DecoderRec): Add `subrs_hash' field. - - * src/type1/t1load.h (T1_LoaderRec): Add `subrs_hash' field. - - * src/type1/t1driver.c: Include FT_INTERNAL_HASH_H. - (t1_ps_get_font_value) [PS_DICT_SUBR]: Look up hash if necessary. - - * src/type1/t1load.c: Include FT_INTERNAL_HASH_H. - (parse_subrs): Use hash for subr indices that exceed the allocated - number of subr slots. - (t1_init_loader): Remove unnecessary code. - (t1_done_loader, T1_Open_Face): Updated. - - * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances, - T1_Load_Glyph): Updated. - - * src/type1/t1objs.c (T1_Face_Done): Updated. - - * src/psaux/t1decode.c: Include FT_INTERNAL_HASH_H. - (t1_decoder_parse_charstrings) [op_callsubr]: Look up hash if - necessary. - - * src/cid/cidgload.c (cid_load_glyph): Updated. - -2015-12-20 Werner Lemberg - - [base] Thinko: Remove free function pointer. - - We don't copy keys or values while hashing. - - * include/freetype/internal/fthash.h (FT_Hash_FreeFunc): Removed. - (FT_HashRec): Remove `free' field. - - * src/base/fthash.c (hash_str_free): Removed. - (ft_hash_init, ft_hash_free): Updated. - -2015-12-20 Werner Lemberg - - [base, bdf] Don't expose `FT_Hashnode' in hash functions. - - * src/base/fthash.c (hash_lookup, ft_hash_str_lookup, - ft_hash_num_lookup): Return pointer to `size_t' instead of - `FT_Hashnode'. - - * include/freetype/internal/fthash.h: Updated. - - * src/bdf/bdflib.c (bdf_get_property, _bdf_add_property, - bdf_get_font_property): Updated. - -2015-12-20 Werner Lemberg - - [base, bdf] Add number hashing. - - * src/base/fthash.c (hash_num_lookup, hash_num_compare): New - functions. - (ft_hash_init): Add argument to select between number and string - hashing. - (ft_hash_num_insert, ft_hash_num_lookup): New functions. - - * include/freetype/internal/fthash.h: Updated. - - * src/bdf/bdflib.c (_bdf_parse_start): Updated. - -2015-12-20 Werner Lemberg - - [base] Introduce hash lookup, compare, and free function pointers. - - * include/freetype/internal/fthash.c (FT_Hash_LookupFunc, - FT_Hash_CompareFunc, FT_Hash_FreeFunc): New typedefs. - (FT_HashRec): Add `lookup', `compare', and `free' fields. - - * src/base/fthash.c (hash_str_lookup, hash_str_compare, - hash_str_free): New functions. - (ft_hash_init): Set function pointers. - (hash_bucket, ft_hash_free): Use them. - -2015-12-20 Werner Lemberg - - [base, bdf] Use a union as a hash key. - - We want to support both an integer and a string key later on. - - * include/freetype/internal/fthash.h (FT_Hashkey): New union. - (FT_HashnodeRec): Updated. - (ft_hash_insert, ft_hash_lookup): Renamed to ... - (ft_hash_str_insert, ft_hash_str_lookup): ... this. - - * src/base/fthash.c (hash_bucket): Updated. - (ft_hash_insert, ft_hash_lookup): Renamed to ... - (hash_insert, hash_lookup): ... this. - (ft_hash_str_insert, ft_hash_str_lookup): New wrapper functions. - - * src/bdf/bdflib.c: Updated. - -2015-12-19 Werner Lemberg - - [bdf] Use new hash functions. - - * src/bdf/bdf.h: Include FT_INTERNAL_HASH_H. - (hashnode, hashtable): Removed. - (bdf_font_t): Use `FT_HashRec' type for `proptbl'. - - * src/bdf/bdflib.c: Remove all hash functions. - Update code for new hash structure and function names. - -2015-12-19 Werner Lemberg - - [bdf, base] Lift hash functions from bdf driver to base module. - - * src/base/fthash.c, include/freetype/internal/fthash.h: New files, - containing (massaged) code from `bdflib.c' and `bdf.h'. - - * include/freetype/internal/internal.h (FT_INTERNAL_HASH_H): New - macro. - - * src/base/ftbase.c: Include `fthash.c'. - - * src/base/Jamfile (_sources): Add `fthash'. - - * src/base/rules.mk (BASE_SRC): Add `fthash.c'. - - * docs/LICENSE.TXT: Updated. - -2015-12-15 Werner Lemberg - - [autofit] Add blue-zone support for Bengali script. - - This essentially moves the Bengali script from the `Indic' hinter to - the `Latin' hinter. - - * src/autofit/afblue.dat: Add blue zone data for Bengali. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Bengali standard characters and move - data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Bengali data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Bengali data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2015-12-14 Ben Wagner - - [bdf] Remove dead code (#46625). - - The BDF specification only allows decimal numbers, no octal or - hexadecimal decoding is needed. - - * src/bdf/bdflib.c (_bdf_atoul, _bdf_atol, _bdf_atous, - _bdf_atos): Remove unused code and parameters. - Update all callers. - (odigits): Remove. - -2015-12-14 Werner Lemberg - - [base] Fix calls to `FT_Stream_Seek'. - - * src/base/ftobjs.c (Mac_Read_sfnt_Resource, FT_Open_Face): Set - `error'. - -2015-12-14 Ben Wagner - - [base] Check error when seeking to data supplied offset (#46635). - - * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): - `ft_lookup_PS_in_sfnt_stream' returns offset and length from - user supplied data. Use of this these values must be checked. - -2015-12-13 Werner Lemberg - - [autofit] Add support for Myanmar script. - - * src/autofit/afblue.dat: Add blue zone data for Myanmar. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Myanmar standard characters. - - * src/autofit/afranges.c: Add Myanmar data. - - * src/autofit/afstyles.h: Add Myanmar data. - -2015-12-12 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Minor. - -2015-12-12 Werner Lemberg - - * src/autofit/afscript.h: Avoid potential crash. - -2015-12-10 Werner Lemberg - - [autofit] Restore OpenType feature check. - - This was removed while rewriting the HarfBuzz interface. - - * src/autofit/afglobal.h (AF_FaceGlobalsRec): Add `hb_buf' field to - hold internal HarfBuzz buffer, needed for feature comparison. - - * src/autofit/afglobal.c (af_face_globals_new, - af_face_globals_free): Initialize and destroy `hb_buf'. - - * src/autofit/afshaper.c (af_shaper_get_cluster): Compare character - (cluster) with and without applied feature. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix tracing - message. - -2015-12-10 Werner Lemberg - - [autofit] Remove redundant code. - - * src/autofit/aflatin.c (af_latin_metrics_init_widths): Do it. - -2015-12-09 Werner Lemberg - - [autofit] Thinko. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Don't count - empty blue zones (bug introduced 2015-12-06). - -2015-12-09 Werner Lemberg - - [autofit] Introduce subscript top blue zones. - - This feature is mainly for Khmer: The idea is to avoid a clash - between the top of subscript glyphs and the bottom of normal - baseline glyphs. - - This only works for character clusters mapped to multiple glyphs. - - * src/autofit/afblue.dat: Add subscript top blue zone for Khmer. - - * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_SUB_TOP): New - macro. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/aflatin.h (AF_LATIN_IS_SUB_TOP_BLUE, - AF_LATIN_BLUE_SUB_TOP): New macros. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle new - blue zone property. - Update tracing messages. - (af_latin_metrics_scale_dim): Handle new blue zone property. - (af_latin_hints_compute_blue_edges): Updated. - -2015-12-09 Werner Lemberg - - [autofit] Fix tracing message. - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Display - inactive blue zones also. - -2015-12-06 Werner Lemberg - - * src/autofit/afblue.dat: Add more Khmer clusters. - - Some fonts have incorrect ligatures; we need more samples to get a - good mean value. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - -2015-12-06 Werner Lemberg - - [autofit] Typos. - - * src/autofit/afshaper.c (af_shaper_buf_create, af_shaper_get_elem) - [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Make it compile. - -2015-12-06 Werner Lemberg - - [autofit] Add support for Khmer script. - - We split Khmer into two auto-hinter scripts: `Khmer' (`khmr') and - `Khmer symbols' (`khms', U+19E0-U+19FF). - - * src/autofit/afblue.dat: Add blue zone data for Khmer. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Khmer standard characters. - - * src/autofit/afranges.c: Add Khmer data. - - * src/autofit/afstyles.h: Add Khmer data. - -2015-12-06 Werner Lemberg - - [autofit] Rewrite HarfBuzz interface to support character clusters. - - Scripts like Khmer have blue zones that can't be directly - represented by Unicode characters. Instead, it is necessary to let - HarfBuzz convert character clusters into proper glyph representation - forms, then deriving the blue zone information from the resulting - glyphs. - - * src/autofit/hbshim.c, src/autofit/hbshim.h: Replaced by... - * src/autofit/afshaper.c, src/autofit/afshaper.h: ... these two new - files, providing a new API to access HarfBuzz. - - The new API manages a HarfBuzz buffer with `af_shaper_buf_create' - and `af_shaper_buf_destroy'. The buffer receives a UTF8 encoded - string with function `af_shaper_get_cluster', and the resulting - glyph data (indices, advance widths, vertical offsets) can be - iteratively accessed with function `af_shaper_get_elem'. - - * src/autofit/afcjk.c (af_cjk_metrics_init_widths, - af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated. - - * src/autofit/aflatin.c (af_latin_metrics_init_widths, - af_latin_metrics_init_blues, af_latin_metrics_check_digits): - Updated. - - * include/freetype/internal/fttrace.h: s/afharfbuzz/afshaper/. - - * src/autofit/afglobal.c: s/hbshim.h/afshaper.h/. - (af_face_globals_compute_style_coverage): Updated. - - * src/autofit/afglobal.h: s/hbshim.h/afshaper.h/. - - * src/autofit/autofit.c: s/hbshim.c/afshaper.c/. - - * src/autofit/Jamfile, src/autofit/rules.mk (AUTOF_DRV_SRC): - Updated. - -2015-12-06 Werner Lemberg - - [autofit] Prepare forthcoming changes. - - This makes it easier to control the commits. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Add dummy - loop. No functional change. - -2015-12-06 Werner Lemberg - - [autofit] Use string of standard characters. - - This is more flexible; additionally, it would allow character - clusters. - - * src/autofit/aftypes.h (SCRIPT, AF_DEFINE_SCRIPT_CLASS): Updated. - (AF_ScriptClassRec): Replace `standard_char[123]' with - `standard_charstring'. - - * src/autofit/afscript.h: Replace last three character arguments - of the `SCRIPT' calls with a string parameter, holding the standard - characters (in UTF-8 encoding) separated with spaces. - - * src/autofit/afglobal.c, src/autofit/afglobal.h, - src/autofit/afpic.c, src/autofit/afranges.c, src/autofit/hbshim.c - (SCRIPT): Updated. - - * src/autofit/afcjk.c (af_cjk_metrics_init_widths), - src/autofit/aflatin.c (af_latin_metrics_init_widths): Updated. - -2015-12-05 Werner Lemberg - - * src/autofit/afblue.dat: Separate blue zone characters with spaces. - - Another preparation for character cluster support. - - * src/autofit/afblue.c, src/autofit.afblue.h: Regenerated. - -2015-12-05 Werner Lemberg - - * src/tools/afblue.pl (convert_ascii_chars): Don't ignore spaces. - - Instead, reduce multiple spaces to a single one. We need this later - for supporting character clusters in `afblue.dat'. - -2015-12-05 Werner Lemberg - - * src/autofit/afblue.hin (GET_UTF8_CHAR): Use `do...while(0)'. - - * src/autofit/afblue.h: Regenerated. - -2015-12-05 Werner Lemberg - - * src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/. - -2015-12-03 Werner Lemberg - - * builds/unix/install.mk (install): Remove stale `ft2build.h'. - -2015-12-01 Werner Lemberg - - [type1] Avoid dangling pointer (#46572). - - * src/type1/t1afm.c (T1_Read_Metrics): Properly reset - `face->afm_data'. - -2015-11-28 Alexei Podtelezhnikov - - * include/freetype/ftlcdfil.h: Documentation tweak. - -2015-11-28 Werner Lemberg - - * Version 2.6.2 released. - ========================= - - - Tag sources with `VER-2-6-2'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.6.2. - - * 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.1/2.6.2/, s/261/262/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. - - * builds/unix/configure.raw (version_info): Set to 18:2:12. - * CMakeLists.txt (VERSION_PATCH): Set to 2. - - * docs/CHANGES: Updated. - -2015-11-28 Werner Lemberg - - Fix C++ compilation. - - * src/autofit/afloader.c: Include FT_INTERNAL_CALC_H. - - * src/truetype/ttgload.c (load_truetype_glyph): Pacify compiler. - -2015-11-28 Nikolaus Waxweiler - - Change default LCD filter to be normalized and color-balanced. - - * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Update - `default_filter'. - -2015-11-28 Werner Lemberg - - [docmaker] Allow references to section names. - - In the reference, we show the section's title enclosed in single - quotes. - - * src/tools/docmaker/formatter.py (Formatter::__init__): Collect - section names as identifiers. - - * src/tools/docmaker/tohtml.py (section_title_header): Split into... - (section_title_header1, section_title_header2): ... these two - strings. - (HtmlFormatter::make_block_url, make_html_word, html_source_quote): - Handle sections. - (HtmlFormatter::section_enter): Updated to add `id' HTML attribute. - -2015-11-27 Tamas Kenez - - [cmake] Add script to test the config module. - - * builds/cmake/testbuild.sh: New file. - -2015-11-27 Tamas Kenez - - * CMakeLists.txt: Create `freetype-config.cmake' config module. - -2015-11-27 Tamas Kenez - - * CMakeLists.txt: Set CMAKE_DEBUG_POSTFIX to `d'. - -2015-11-27 Tamas Kenez - - [cmake] Add better control of library dependencies. - - * CMakeLists.txt: Add `WITH_*' variables to force/auto/omit - ZLIB/BZip2/PNG/HarfBuzz. - -2015-11-27 Tamas Kenez - - [cmake] Make `FindHarfBuzz' observe the REQUIRED option. - - * builds/cmake/FindHarfBuzz.cmake: Implement it. - -2015-11-27 Werner Lemberg - - [cmake] Collect files specific to cmake in `builds/cmake'. - - * builds/FindHarfBuzz.cmake: Move to ... - * builds/cmake/FindHarfBuzz.cmake: ... this place. - - * CMakeLists.txt (CMAKE_MODULE_PATH): Updated. - -2015-11-27 Alexander Bock - - CMakeLists.txt: Honour new command line flag `FREETYPE_NO_DIST'. - -2015-11-26 Werner Lemberg - - [docmaker] Allow `foo[bar]' as identifier. - - We need this to handle equally named properties in different - modules. - - * src/tools/docmaker/content.py (re_identifier), - src/tools/docmaker/sources.py (re_crossref): Allow `foo[bar]'. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word, - HtmlFormatter::index_exit, HtmlFormatter::section_enter, - HtmlFormatter::block_enter): Handle `foo[bar]'. - -2015-11-25 Werner Lemberg - - * src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46480). - - (_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its - contents. - -2015-11-21 Werner Lemberg - - * include/freetype/internal/ftcalc.h: Don't use `register' keyword. - - This fixes compiler warnings. - - Reported by Behdad. - -2015-11-20 Werner Lemberg - - Add `FT_LCD_FILTER_LEGACY1' enum value. - - This does the same as `FT_LCD_FILTER_LEGACY'. - - See - - https://bugs.freedesktop.org/show_bug.cgi?id=92981 - - for the reasoning. - - * include/freetype/ftlcdfil.h (FT_LcdFilter): New value - `FT_LCD_FILTER_LEGACY1'. - - * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Use it. - -2015-11-15 Werner Lemberg - - * src/autofit/afhints.c (af_get_segment_index): Fix it. - - The old code was too simple, returning invalid values in most cases - where a segment crosses the contour start. - -2015-11-15 Werner Lemberg - - * src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46439). - -2015-11-11 Werner Lemberg - - [cff, autofit] Switch off stem darkening by default. - - * src/autofit/afmodule.c (af_autofitter_init), src/cff/cffobjs.c - (cff_driver_init): Do it. - -2015-11-10 Jan Alexander Steffens (heftig) - - Allow native CFF hinter in FT_RENDER_MODE_LIGHT. - - Both the native CFF hinter and the auto-hinter now have a very - similar rendering style. - - * include/freetype/freetype.h: Mention that FT_LOAD_TARGET_LIGHT no - longer implies FT_LOAD_FORCE_AUTOHINT. - - * include/freetype/ftmodapi.h (FT_MODULE_DRIVER_HINTS_LIGHTLY): New - macro. - - * include/freetype/internal/ftobjs.h (FT_DRIVER_HINTS_LIGHTLY): New - macro. - - * src/cff/cffdrivr.c (cff_driver_class): Use it. - - * src/base/ftobjs.c (FT_Load_Glyph): Update auto-hinter selection - logic. - -2015-11-09 Werner Lemberg - - * src/cid/cidload.c (cid_face_open): Fix GDBytes guard (#46408). - -2015-11-09 Werner Lemberg - - [truetype] Remove integer to pointer conversion compiler warning. - - Problem reported by Alexei. - - * src/truetype/ttgload.c (load_truetype_glyph): Use a solution found - in the glib library to fix the issue. - -2015-11-08 Behdad Esfahbod - - [sfnt] Accept version 3 of `EBLC' and `CBLC' tables also. - - * src/sfnt/ttsbit.c (tt_face_load_sbit): Implement it. - -2015-11-08 Philipp Knechtges - - [autofit] Don't distort (latin) glyphs too much (#46195). - - * src/autofit/aflatin.h (AF_LatinBlueRec): Add `ascender' and - `descender' fields. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Collect - ascender and descender data for blue zones. - (af_latin_metrics_scale_dim): Reject vertical scaling values that - change the result by more than two pixels. - -2015-11-05 Werner Lemberg - - [sfnt] Ignore embedded bitmaps with zero size (#46379). - - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Implement - it. - -2015-11-04 Werner Lemberg - - [truetype] Catch infinite recursion in subglyphs (#46372). - - * include/freetype/internal/tttypes.h (TT_LoaderRec): New field - `composites'. - - * src/truetype/ttgload.c: Include FT_LIST_H. - (load_truetype_glyph): Add composite subglyph index to a list; - abort if index is already in list. - (tt_loader_init): Updated. - (tt_loader_done): New function. - (TT_Load_Glyph): Call `tt_loader_done'. - -2015-11-04 Werner Lemberg - - [truetype] Better tracing of composite glyphs. - - * src/truetype/ttgload.c (TT_Load_Composite_Glyph, - load_truetype_glyph): Implement it. - -2015-11-03 Werner Lemberg - - [sfnt] Protect against zero-size bitmaps (#46345). - - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Check - `glyph_size'. - -2015-11-02 Nikolaus Waxweiler - - * src/autofit/afloader.c (af_loader_load_g): Implement emboldening. - -2015-11-02 Nikolaus Waxweiler - - [autofit] Implement darkening computation function. - - This is a crude adaption of the original `cf2_computeDarkening' - function. - - * src/autofit/afloader.c (af_intToFixed, af_fixedToInt, - af_floatToFixed): New macros, taken from `cf2fixed.h'. - (af_loader_compute_darkening): New function. - * src/autofit/afloader.h: Updated. - -2015-11-02 Nikolaus Waxweiler - - [autofit] Add functions to get standard widths for writing systems. - - We need the computed standard horizontal and vertical widths for the - emboldening calculation. This method provides a convenient way to - extract it from writing-system-specific metrics structures, which - all script definitions must implement. - - * src/autofit/aftypes.h (AF_WritingSystem_GetStdWidthsFunc): New - function type. - (AF_WritingSystemClassRec): New member `style_metrics_getstdw'. - (AF_DEFINE_WRITING_SYSTEM_CLASS): Updated. - - * src/autofit/afcjk.c (af_cjk_get_standard_width): New function. - (af_cjk_writing_system_class): Updated. - * src/autofit/afdummy.c (af_dummy_writing_system_class): Updated. - * src/autofit/afindic.c (af_cjk_get_standard_width): New function. - (af_indic_writing_system_class): Updated. - * src/autofit/aflatin.c (af_latin_get_standard_width): New function. - (af_indic_writing_system_class): Updated. - * src/autofit/aflatin.c (af_latin_get_standard_width): New function. - (af_indic_writing_system_class): Updated. - -2015-11-02 Nikolaus Waxweiler - - [autofit] Extend `AF_FaceGlobalsRec' to hold emboldening data. - - * src/autofit/afglobal.h (AF_FaceGlobalsRec): Add fields. - - * src/autofit/afglobal.c (af_face_globals_new): Initialize new - fields. - (af_face_globals_free): Reset new fields. - -2015-11-02 Nikolaus Waxweiler - - [autofit] Add stem-darkening properties. - - Actual code follows in a later commit. - - * include/freetype/ftautoh.h: Document `no-stem-darkening' and - `darkening-parameters'. - - * src/autofit/afmodule.h: New fields `no_stem_darkening' and - `darken_params'. - - * src/autofit/afmodule.c (af_property_set, af_property_get): - Handle them. - (af_autofitter_init): Initialize them. - -2015-11-02 Ben Wagner - - [ftfuzzer] Add support for multiple files (patch #8779). - - Currently, libFuzzer only supports mutation of a single file. We - circumvent this problem by using an uncompressed tar archive as - multiple-file input for the fuzzer. - - This patch enables tests of `FT_Attach_Stream' and AFM/PFM parsing; - a constructed tarball should contain a font file as the first - element, and files to be attached as further elements. - - * src/tools/ftfuzzer/ftfuzzer.cc: Include libarchive headers. - (archive_read_entry_data, parse_data): New functions. - (LLVMFuzzerTestOneInput): Updated. - - * src/tools/ftfuzzer/ftmutator.cc: New file, providing a custom - mutator for libFuzzer that can mutate tarballs in a sensible way. - -2015-10-31 Werner Lemberg - - [sfnt] Fix cmap 14 validation (#46346). - - * src/sfnt/ttcmap.c (tt_cmap14_validate): Check limit before - accessing `numRanges' and `numMappings'. - Fix size check for non-default UVS table. - -2015-10-31 Werner Lemberg - - [sfnt] Handle infinite recursion in bitmap strikes (#46344). - - * src/sfnt/ttsbit.c (TT_SBitDecoder_LoadFunc, - tt_sbit_decoder_load_bitmap, tt_sbit_decoder_load_byte_aligned, - tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_png): Add - argument for recursion depth. - (tt_sbit_decoder_load_compound): Add argument for recursion depth. - Increase recursion counter for recursive call. - (tt_sbit_decoder_load_image): Add argument for recursion depth. - Check recurse depth. - (tt_face_load_sbit_image): Updated. - -2015-10-29 Werner Lemberg - - * src/autofit/afhints.c (af_glyph_hints_dump_points): Minor. - -2015-10-29 Werner Lemberg - - * CMakeLists.txt: Remove code to set MSVC's /FD compiler switch. - - Problem reported by David Capello ; see - - http://lists.nongnu.org/archive/html/freetype-devel/2015-10/msg00108.html - - for details. - -2015-10-27 Werner Lemberg - - [pfr] Add some safety guards (#46302). - - * src/pfr/pfrload.h (PFR_CHECK): Rename to... - (PFR_CHECK_SIZE): ... this. - (PFR_SIZE): [!PFR_CONFIG_NO_CHECKS]: Define to PFR_CHECK_SIZE. - - * src/pfr/pfrload.c (pfr_log_font_count): Check `count'. - (pfr_extra_item_load_kerning_pairs): Remove tracing message. - (pfr_phy_font_load): Use PFR_CHECK_SIZE where appropriate. - Allocate `chars' after doing a size checks. - - * src/pfr/pfrsbit.c (pfr_load_bitmap_bits): Move test for invalid - bitmap format to... - (pfr_slot_load_bitmap): ... this function. - Check bitmap size. - -2015-10-26 Werner Lemberg - - [truetype] Fix sanitizing logic for `loca' (#46223). - - * src/truetype/ttpload.c (tt_face_load_loca): A thinko caused an - incorrect adjustment of the number of glyphs, most often using far - too large values. - -2015-10-25 Werner Lemberg - - [autofit] Improve tracing. - - * src/autofit/afhints.c (af_print_idx, af_get_segment_index, - af_get_edge_index): New functions. - - (af_glyph_hints_dump_points): Remove unnecessary `|', `[', and `]'. - Add segment and edge index for each point. - Slightly change printing order of some elements. - Don't print `-1' but `--' for missing elements. - - (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Remove - unnecessary `|', `[', and `]'. - Don't print `-1' but `--' for missing elements. - -2015-10-24 Werner Lemberg - - [sfnt] Sanitize bitmap strike glyph height. - - Problem reported by Nikolay Sivov . - - * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Avoid zero value - for `metrics->height' by applying some heuristics. - -2015-10-22 Werner Lemberg - - [sfnt, type42] Fix clang compiler warnings. - - * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `offset'. - - * src/type42/t42parse.c (t42_parse_sfnts): Use proper cast. - -2015-10-22 Dave Arnold - Werner Lemberg - - [cff] Avoid overflow/module arithmetic. - - This modifies the addition of subroutine number to subroutine bias - from unsigned to signed, but does not change any results. - - * src/cff/cf2ft.c (cf2_initGlobalRegionBuffer, - cf2_initLocalRegionBuffer): Change variable names from (unsigned) - `idx' to (signed) `subrNum', since it is not an index until after - the bias is added. - * src/cff/cf2ft.h: Updated. - - * src/cff/cf2intrp.c (cf2_interpT2CharString) : - Updated similarly. - -2015-10-22 Werner Lemberg - - [cid] Better check of `SubrCount' dictionary entry (#46272). - - * src/cid/cidload.c (cid_face_open): Add more sanity tests for - `fd_bytes', `gd_bytes', `sd_bytes', and `num_subrs'. - -2015-10-21 Werner Lemberg - - [base] Pacify compiler (#46266). - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Initialize `in' and - `anchor'. - -2015-10-21 Werner Lemberg - - [type42] Fix heap buffer overflow (#46269). - - * src/type42/t42parse.c (t42_parse_sfnts): Fix off-by-one error in - bounds checking. - -2015-10-21 Dave Arnold - - [cff] Fix limit in assert for max hints. - - * src/cff/cf2interp.c (cf2_hintmask_setAll): Allow mask equal to the - limit (96 bits). - -2015-10-21 Dave Arnold - - [cff] Remove an assert (#46107). - - * src/cff/cf2hints.c (cf2_hintmap_insertHint): Ignore paired edges - in wrong order. - -2015-10-21 Werner Lemberg - - [sfnt] Avoid unnecessarily large allocation for WOFFs (#46257). - - * src/sfnt/sfobjs.c (woff_open_font): Use WOFF's `totalSfntSize' - only after thorough checks. - Add tracing messages. - -2015-10-21 Werner Lemberg - - [type42] Better check invalid `sfnts' array data (#46255). - - * src/type42/t42parse.c (t42_parse_sfnts): Table lengths must be - checked individually against available data size. - -2015-10-20 Werner Lemberg - - [cid] Add a bunch of safety checks. - - * src/cid/cidload.c (parse_fd_array): Check `num_dicts' against - stream size. - (cid_read_subrs): Check largest offset against stream size. - (cid_parse_dict): Move safety check to ... - (cid_face_open): ... this function. - Also test length of binary data and values of `SDBytes', - `SubrMapOffset', `SubrCount', `CIDMapOffset', and `CIDCount'. - -2015-10-20 Werner Lemberg - - [cid] Avoid segfault with malformed input (#46250). - - * src/cid/cidload.c (cid_read_subrs): Return a proper error code for - unsorted offsets. - -2015-10-20 StudioEtrange - - * CMakeLists.txt: Enable shared library builds on MinGW (#46233). - -2015-10-20 Werner Lemberg - - * src/type1/t1afm.c (T1_Read_Metrics): Fix memory leak (#46229). - -2015-10-19 Ben Wagner - - [cid] Better handle invalid glyph stream offsets (#46221). - - * src/cid/cidgload.c (cid_load_glyph): Check minimum size of glyph - length. - -2015-10-18 Werner Lemberg - - [psaux] Fix tracing of negative numbers. - - Due to incorrect casting negative numbers were shown as very large - (positive) integers on 64bit systems. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) : - Use division instead of shift. - -2015-10-18 Werner Lemberg - - [truetype] Improve TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES (#46223). - - * devel/ftoption.h, include/freetype/config/ftoption.h: Surround it - with #ifndef ... #endif, as suggested in the tracker issue. - -2015-10-18 Werner Lemberg - - [truetype] Better protection against malformed `fpgm' (#46223). - - * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't execute a - malformed `fpgm' table more than once. - -2015-10-17 Werner Lemberg - - * src/cid/cidgload.c (cid_load_glyph): Fix memory leak. - - Reported by Kostya Serebryany . - -2015-10-17 Werner Lemberg - - [bdf] Prevent memory leak (#46217). - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Check - _BDF_GLYPH_BITS. - -2015-10-17 Werner Lemberg - - [bdf] Use stream size to adjust number of glyphs. - - * src/bdf/bdflib.c (ACMSG17): New message macro. - (_bdf_parse_t): Add member `size'. - (bdf_load_font): Set `size'. - (_bdf_parse_glyphs): Adjust `cnt' if necessary. - -2015-10-17 Werner Lemberg - - * src/cid/cidload.c (cid_parse_dict): Check `[FG]DBytes' size. - -2015-10-17 Werner Lemberg - - * src/cid/cidgload.c (cid_glyph_load): Check file offsets (#46222). - -2015-10-17 Werner Lemberg - - [psaux] Fix heap buffer overflow (#46221). - - * src/psaux/t1decode.c (t1_decoder_parse_charstring) : - Fix limit check. - -2015-10-17 Werner Lemberg - - * src/cid/cidload.c (cid_parse_dict): Handle invalid input (#46220). - -2015-10-15 Kostya Serebryany - - [ftfuzzer] Add README. - - * src/tools/ftfuzzer/README: New file. - -2015-10-15 Ben Wagner - - [bdf] Fix memory leak (#46213). - - * src/bdf/bdflib.c (bdf_load_font): Always go to label `Fail' in - case of error. - -2015-10-15 Werner Lemberg - - [truetype] Add TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES (#46208). - - * devel/ftoption.h, include/freetype/config/ftoption.h - (TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES): New configuration macro. - - * src/truetype/ttinterp.c (MAX_RUNNABLE_OPCODES): Removed. - (TT_RunIns): Updated. - -2015-10-15 Werner Lemberg - - * src/truetype/ttinterp.c (TT_RunIns): Fix bytecode stack tracing. - - The used indices were off by 1. - -2015-10-15 Ben Wagner - Werner Lemberg - - * src/tools/ftfuzzer/ftfuzzer.cc: Handle fixed sizes (#46211). - -2015-10-15 Werner Lemberg - - [base] Compute MD5 checksums only if explicitly requested. - - This improves profiling accuracy. - - * src/base/ftobjs.c (FT_Render_Glyph_Internal): Implement it. - -2015-10-14 Werner Lemberg - - [base] Use `FT_' namespace for MD5 functions (#42366). - - * src/base/ftobjs.c (MD5_*): Define as `FT_MD5_*'. - Undefine HAVE_OPENSSL. - -2015-10-13 Werner Lemberg - - [type1] Correctly handle missing MM axis names (#46202). - - * src/type1/t1load.c (T1_Get_MM_Var): Implement it. - -2015-10-13 Werner Lemberg - - [pcf] Quickly exit if font index < 0. - - Similar to other font formats, this commit makes the parser no - longer check the whole PCF file but only the header and the TOC if - we just want to get the number of available faces (and a proper - recognition of the font format). - - * src/pcf/pcfdrivr.c (PCF_Face_Init): Updated. - Exit quickly if face_index < 0. - - * src/pcfread.c (pcf_load_font): Add `face_index' argument. - Exit quickly if face_index < 0. - - * src/pcf/pcf.h: Updated. - -2015-10-13 Werner Lemberg - - [ftfuzzer] Handle TTCs and MM/GX variations. - - This patch also contains various other improvements. - - * src/tools/ftfuzzer/ftfuzzer.cc: Add preprocessor guard to reject - pre-C++11 compilers. - (FT_Global): New class. Use it to provide a global constructor and - destructor for the `FT_Library' object. - (setIntermediateAxis): New function to select an (arbitrary) - instance. - (LLVMFuzzerTestOneInput): Loop over all faces and named instances. - Also call `FT_Set_Char_Size'. - -2015-10-13 Werner Lemberg - - [truetype] Refine some GX sanity tests. - - Use the `gvar' table size instead of the remaining bytes in the - stream. - - * src/truetype/ttgxvar.h (GX_BlendRec): New field `gvar_size'. - - * src/truetype/ttgxvar.c (ft_var_load_gvar): Set `gvar_size'. - (ft_var_readpackedpoints, ft_var_readpackeddeltas: New argument - `size'. - (tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): Updated. - -2015-10-13 Werner Lemberg - - [truetype] Another GX sanity test. - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Check - `tupleCount'. - Add tracing message. - -2015-10-13 Werner Lemberg - - [truetype] Fix memory leak for broken GX fonts (#46188). - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix scope of - deallocation. - -2015-10-13 Werner Lemberg - - [truetype] Fix commit from 2015-10-10. - - * src/truetype/ttgxvar.c (ft_var_load_gvar): Add missing error - handling body to condition. - -2015-10-12 Werner Lemberg - - [unix] Make MKDIR_P actually work. - - * builds/unix/configure.raw: Fix underquoting of `INSTALL' and - `MKDIR_P'. - - Problem reported by Dan Liddell . - -2015-10-11 Werner Lemberg - - [sfnt] Improve extraction of number of named instances. - - * src/sfnt/sfobjs.c (sfnt_init_face) - [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check number of instances against - `fvar' table size. - -2015-10-10 Alexei Podtelezhnikov - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix overflow - (#46149). - -2015-10-10 Werner Lemberg - - [sfnt] Fix infinite loops with broken cmaps (#46167). - - * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next): Take care - of border conditions (i.e., if the loops exit naturally). - -2015-10-10 Werner Lemberg - - [truetype] More sanity tests for GX handling. - - These tests should mainly help avoid unnecessarily large memory - allocations in case of malformed fonts. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints, - ft_var_readpackeddeltas): Check number of points against stream - size. - (ft_var_load_avar): Check `pairCount' against table length. - (ft_var_load_gvar): Check `globalCoordCount' and `glyphCount' - against table length. - (tt_face_vary_cvt): Check `tupleCount' and `offsetToData'. - Fix trace. - (TT_Vary_Apply_Glyph_Deltas): Fix trace. - Free `sharedpoints' to avoid memory leak. - -2015-10-10 Werner Lemberg - - [truetype] Better protection against malformed GX data (#46166). - - * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Correctly - handle empty `localpoints' array. - -2015-10-10 Werner Lemberg - - * src/pcf/pcfread.c (pcf_read_TOC): Check stream size (#46162). - -2015-10-09 Werner Lemberg - - * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Use real stream size. - -2015-10-08 Werner Lemberg - - [pcf] Protect against invalid number of TOC entries (#46159). - - * src/pcf/pcfread.c (pcf_read_TOC): Check number of TOC entries - against size of data stream. - -2015-10-08 Werner Lemberg - - [type42] Protect against invalid number of glyphs (#46159). - - * src/type42/t42parse.c (t42_parse_charstrings): Check number of - `CharStrings' dictionary entries against size of data stream. - -2015-10-08 Werner Lemberg - - [sfnt] Fix some signed overflows (#46149). - - * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) - : Use `FT_MulDiv'. - -2015-10-08 Werner Lemberg - - [type1] Protect against invalid number of subroutines (#46150). - - * src/type1/t1load.c (parse_subrs): Check number of - `Subrs' dictionary entries against size of data stream. - -2015-10-07 Kostya Serebryany - - [ftfuzzer] Add support for LLVM's LibFuzzer. - - * src/tools/ftfuzzer/ftfuzzer.cc, src/tools/runinput.cc: New files. - -2015-10-06 Alexei Podtelezhnikov - - [smooth] Faster alternative line renderer. - - This implementation renders the entire line segment at once without - subdividing it into scanlines. The main speed improvement comes from - reducing the number of divisions to just two per line segment, which - is a bare minimum to calculate cell coverage in a smooth rasterizer. - Notably, the progression from cell to cell does not itself require any - divisions at all. The speed improvement is more noticeable at larger - sizes. - - * src/smooth/ftgrays.c (gray_render_line): New implementation. - -2015-10-06 Werner Lemberg - - [cff] Return correct PS names from pure CFF (#46130). - - * src/cff/cffdrivr.c (cff_get_ps_name): Use SFNT service only for - SFNT. - -2015-10-04 Werner Lemberg - - [base] Replace left shifts with multiplication (#46118). - - * src/base/ftglyph.c (ft_bitmap_glyph_bbox, FT_Get_Glyph): Do it. - -2015-10-04 Werner Lemberg - - * Version 2.6.1 released. - ========================= - - - Tag sources with `VER-2-6-1'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.6.1. - - * 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/2.6.1/, s/26/261/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. - - * builds/unix/configure.raw (version_info): Set to 18:1:12. - * CMakeLists.txt (VERSION_PATCH): Set to 1. - - * src/autofit/afmodule.c [AF_DEBUG_AUTOFIT]: Ensure C linking for - dumping functions. - -2015-10-04 Werner Lemberg - - [bzip2, gzip] Avoid access of uninitialized memory (#46109). - - * src/bzip2/ftbzip2.c (ft_bzip2_file_fill_input), src/gzip/ftgzip.c - (ft_gzip_file_fill_input): In case of an error, adjust the limit to - avoid copying uninitialized memory. - -2015-10-03 Werner Lemberg - - [bzip2, gzip] Avoid access of uninitialized memory (#46109). - - * src/bzip2/ftbzip2.c (ft_bzip2_file_fill_output), src/gzip/ftgzip.c - (ft_gzip_file_fill_output): In case of an error, adjust the limit to - avoid copying uninitialized memory. - -2015-10-01 Alexei Podtelezhnikov - - [smooth] Clean up worker. - - * src/smooth/ftgrays.c (gray_TWorker): Remove never used fields. - -2015-10-01 Werner Lemberg - - [sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078). - - * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of - border conditions (i.e., if the loop exits naturally). - -2015-10-01 Werner Lemberg - - * src/autofit/afranges.c (af_deva_nonbase_uniranges): Fix ranges. - They should be a subset of `af_deva_uniranges'. - -2015-10-01 Werner Lemberg - - [sfnt] Make `tt_cmap4_char_map_linear' faster (#46078). - - * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Use inner loop to - reject too large glyph indices. - -2015-09-30 Alexei Podtelezhnikov - - [smooth] Clean up worker. - - * src/smooth/ftgrays.c (gray_TWorker): Remove lightly used `last_ey'. - (gray_start_cell, gray_render_line): Update. - -2015-09-30 Werner Lemberg - - [autofit] Replace `no-base' with `non-base'. - - * src/autofit/*: Do it. - -2015-09-30 Werner Lemberg - - [sfnt] Rewrite `tt_cmap4_char_map_linear' (#46078). - - * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Add code to better - skip invalid segments. - If searching the next character, provide a more efficient logic to - speed up the code. - -2015-09-30 Werner Lemberg - - [truetype] Adjust number of glyphs for malformed `loca' tables. - - * src/truetype/ttpload.c (tt_face_load_loca): Implement it. - -2015-09-29 Werner Lemberg - - [pshinter] Avoid harmless overflow (#45984). - - * src/pshinter/pshglob.c (psh_blues_set_zones): Fix it. - -2015-09-28 Werner Lemberg - - [autofit] Add support for Lao script. - - Thanks to Danh Hong for guidance with blue zone - characters! - - * src/autofit/afblue.dat: Add blue zone data for Lao. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Lao standard characters. - - * src/autofit/afranges.c: Add Lao data. - - * src/autofit/afstyles.h: Add Lao data. - -2015-09-27 suzuki toshiya - - [base] Fix a leak by broken sfnt-PS or resource fork (#46028). - - open_face_from_buffer() frees passed buffer if valid font - is not found. But if copying to the buffer is failed, - the allocated buffer should be freed within the caller. - - * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Free - the buffer `sfnt_ps' if an error caused before calling - open_face_from_buffer(). - (Mac_Read_sfnt_Resource): Free the buffer `sfnt_data' if - an error caused before calling open_face_from_buffer(); - -2015-09-27 suzuki toshiya - - [mac] Fix buffer size calculation for LWFN font. - - * src/base/ftmac.c (read_lwfn): Cast post_size to FT_ULong - to prevent confused copy by too large chunk size. - -2015-09-26 Alexei Podtelezhnikov - - * src/smooth/ftgrays.c (PIXEL_MASK): Remove unused macro. - -2015-09-26 Werner Lemberg - - [autofit] Minor tracing improvement. - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Don't emit - blue zones header line if there are no blue zones. - -2015-09-26 Werner Lemberg - - [bzip2, gzip, lzw] Harmonize function signatures with prototype. - - Suggested by Hin-Tak Leung. - - * src/bzip2/ftbzip2.c (ft_bzip2_stream_io), src/gzip/ftgzip.c - (ft_gzip_stream_io), src/lzw/ftlzw.c (ft_lzw_stream_io): Do it. - -2015-09-26 Hin-Tak Leung - - Add new FT_LOAD_COMPUTE_METRICS load flag. - - * include/freetype/freetype.h (FT_LOAD_COMPUTE_METRICS): New macro. - * src/truetype/ttgload.c (compute_glyph_metrics): Usage. - -2015-09-26 Werner Lemberg - - * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add cast. - -2015-09-25 Werner Lemberg - - [type1] Protect against invalid number of glyphs (#46029). - - * src/type1/t1load.c (parse_charstrings): Check number of - `CharStrings' dictionary entries against size of data stream. - -2015-09-23 Werner Lemberg - - [sfnt] Better checks for invalid cmaps (2/2) (#46019). - - While the current code in `FT_Get_Next_Char' correctly rejects - out-of-bounds glyph indices, it can be extremely slow for malformed - cmaps that use 32bit values. This commit tries to improve that. - - * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next, - tt_cmap12_char_map_binary, tt_cmap13_next, - tt_cmap13_char_map_binary): Reject glyph indices larger than or - equal to the number of glyphs. - -2015-09-23 Werner Lemberg - - [base, sfnt] Better checks for invalid cmaps (1/2). - - * src/base/ftobjs.c (FT_Get_Char_Index): Don't return out-of-bounds - glyph indices. - (FT_Get_First_Char): Updated. - - * src/sfnt/ttcmap.c (tt_cmap6_char_next): Don't return character - codes greater than 0xFFFF. - - (tt_cmap8_char_index): Avoid integer overflow in computation of - glyph index. - (tt_cmap8_char_next): Avoid integer overflows in computation of - both next character code and glyph index. - - (tt_cmap10_char_index): Fix unsigned integer logic. - (tt_cmap10_char_next): Avoid integer overflow in computation of - next character code. - - (tt_cmap12_next): Avoid integer overflows in computation of both - next character code and glyph index. - (tt_cmap12_char_map_binary): Ditto. - (tt_cmap12_char_next): Simplify. - - (tt_cmap13_char_map_binary): Avoid integer overflow in computation - of next character code. - (tt_cmap13_char_next): Simplify. - -2015-09-21 suzuki toshiya - - [base] Check too long POST and sfnt resource (#45919). - - * src/base/ftbase.h (FT_MAC_RFORK_MAX_LEN): Maximum length of the - resource fork for Mac OS. Resource forks larger than 16 MB can be - written but can't be handled correctly, at least in Carbon routine. - See https://support.microsoft.com/en-us/kb/130437. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): No need to use `0x' - prefix for `%p' formatter. - - * src/base/ftbase.c (Mac_Read_POST_Resource): Check the fragment and - total size of the concatenated POST resource before buffer - allocation. - (Mac_Read_sfnt_Resource): Check the declared size of sfnt resource - before buffer allocation. - - * src/base/ftmac.c (read_lwfn, FT_New_Face_From_SFNT): Check the - total resource size before buffer allocation. - -2015-09-19 Werner Lemberg - - [sfnt] Improve handling of invalid SFNT table entries (#45987). - - This patch fixes weaknesses in function `tt_face_load_font_dir'. - - - It incorrectly assumed that valid tables are always at the - beginning. As a consequence, some valid tables after invalid - entries (which are ignored) were never seen. - - - Duplicate table entries (this is, having the same tag) were not - rejected. - - - The number of valid tables was sometimes too large, leading to - access of invalid tables. - - * src/sfnt/ttload.c (check_table_dir): Add argument to return number - of valid tables. - Add another tracing message. - (tt_face_load_font_dir): Only allocate table array for valid - entries as returned by `check_table_dir'. - Reject duplicate tables and adjust number of valid tables - accordingly. - -2015-09-19 Werner Lemberg - - [pcf] Improve `FT_ABS' fix from 2015-09-17 (#45999). - - * src/pcf/pcfread.c (pcf_load_font): Do first the cast to FT_Short, - then take the absolute value. - Also apply FT_ABS to `height'. - -2015-09-17 Werner Lemberg - - [type42] Fix memory leak (#45989). - - * src/type42/t42parse.c (t42_parse_charstrings): Allow only a single - `CharStrings' array. - -2015-09-17 Werner Lemberg - - [psaux] Fix memory leak (#45986). - - * src/psaux/psobjs.c (ps_parser_load_field) : - Free `temp' in case of error. - -2015-09-17 Werner Lemberg - - [psaux] Improve tracing message. - - * src/psaux/psobjs.c (ps_parser_load_field) : - Handle plural correctly. - -2015-09-17 Werner Lemberg - - [pcf] Fix integer overflows (#45985). - - * src/pcf/pcfread.c (pcf_load_font): Use FT_MulDiv. - -2015-09-17 Werner Lemberg - - [pcf] Use FT_ABS for some property values (#45893). - - * src/pcf/pcfread.c (pcf_load_font): Take absolute values for - AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and - RESOLUTION_Y. In tracing mode, add warnings. - -2015-09-16 Werner Lemberg - - Minor fixes for some clang warnings. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Cast, possible missing - initialization. - - * src/truetype/ttgload.c (TT_Process_Composite_Component): Cast. - -2015-09-15 Werner Lemberg - - [type1, type42] Fix memory leaks (#45966). - - * src/type1/t1load.c (parse_blend_axis_types): Handle multiple axis - names. - (parse_blend_design_map): Allow only a single design map. - (parse_encoding): Handle multiple encoding vectors. - - * src/type42/t42parse.c (t42_parse_encoding): Handle multiple - encoding vectors. - -2015-09-15 Werner Lemberg - - [truetype] Fix integer type (#45965). - - * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it. - -2015-09-15 Werner Lemberg - - * src/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964). - -2015-09-15 Werner Lemberg - - [type1, type42] Check encoding array size (#45961). - - * src/type1/t1load.c (parse_encoding), src/type42/t42parse.c - (t42_parse_encoding): Do it. - -2015-09-14 Alexei Podtelezhnikov - - * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Improve. - -2015-09-14 Werner Lemberg - - [type1] Fix another potential buffer overflow (#45955). - - * src/type1/t1parse (T1_Get_Private_Dict): Assure that check for - `eexec' doesn't exceed `limit'. - -2015-09-13 Werner Lemberg - - Replace `mkinstalldirs' with AC_PROG_MKDIR_P. - - * builds/unix/mkinstalldirs: Removed, no longer needed. - - * builds/unix/configure.raw: Call `AC_PROG_MKDIR_P'. - Update pwd call for `$INSTALL'. - - * builds/unix/unix-def.in (MKINSTALLDIRS): Use `@MKDIR_P@'. - - * autogen.sh: Updated. - -2015-09-13 Werner Lemberg - - [winfonts] Check alignment shift count for resource data (#45938). - - * src/winfonts/winfnt.c (fnt_face_get_dll_font): Implement it. - -2015-09-13 Werner Lemberg - - [type1] Fix potential buffer overflow (#45923). - - * src/type1/t1parse.c (T1_Get_Private_Dict): Assure `cur' doesn't - point to end of file buffer. - -2015-09-13 Werner Lemberg - - [gzip] Fix access of small compressed files (#45937). - - * src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak. - - (ft_gzip_get_uncompressed_file): Correct byte order while reading - unsigned long value. Without this change, the whole optimization of - accessing small files in `FT_Stream_OpenGzip' is never executed! As - a consequence, access to PCF files in general (which are normally - small files) should be much improved now as originally intended. - -2015-09-11 Werner Lemberg - - [psaux] Fix potential buffer overflow (#45922). - - * src/psaux/psobjs.c (ps_parser_skip_PS_token): If a token is - enclosed in balanced expressions, ensure that the cursor position - doesn't get larger than the current limit. - -2015-09-11 Werner Lemberg - - [base] Avoid crash while tracing `load_mac_face'. - - Reported in Savannah bug #45919. - - * src/base/ftobjs.c (load_mac_face): Honour FT_OPEN_MEMORY while - tracing. - -2015-09-11 Werner Lemberg - - [type42] Fix endless loop (#45920). - - * src/type42/t42parse.c (t42_parse_encoding): Synchronize with - type1's `parse_encoding'. - -2015-09-10 Werner Lemberg - - [docmaker] Allow `-' in bold and italic markup. - - * src/tools/docmaker/sources.py (re_italic, re_bold): Adjust - accordingly. - -2015-09-09 Alexei Podtelezhnikov - - * src/base/ftcalc.c (FT_RoundFix): Improve. - -2015-09-09 Wojciech Mamrak - - * src/base/ftcalc.c (FT_CeilFix, FT_FloorFix): Normalize. - - This commit makes the functions behave as expected, this is, - rounding towards plus or minus infinity. - -2015-09-07 Alexei Podtelezhnikov - - * src/smooth/ftgrays.c (gray_render_line): Simplify clipping. - -2015-09-04 Alexei Podtelezhnikov - - [raster,smooth] Microoptimizations. - - * src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table, - Bezier_Up, ): Use do-while loops. - - * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line, - gray_convert_glyph): Ditto. - -2015-09-04 Werner Lemberg - - [autofit] Redesign code ranges (2/2). - - This commit adds two fallback scripts (`latb', `latp') and - implements support for the no-base character ranges introduced in - the previous commit. - - * src/autofit/aftypes.h (AF_ScriptClassRec): Add - `script_uni_nobase_ranges' field. - (AF_DEFINE_SCRIPT_CLASS): Updated. - - * src/autofit/afscript.h, src/autofit/afstyles.h: Add `latb' and - `latp' fallback scripts. - - * src/autofit/afblue.dat: Add blue zones for Latin subscript and - superscript fallback scripts. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afglobal.h (AF_NOBASE): New style flag for no-base - characters. - (AF_STYLE_MASK): Updated. - - * src/autofit/afglobal.c (SCRIPT): Updated. - (af_face_globals_compute_style_coverage): Handle new style flag. - - * src/autofit/aflatin.c (af_latin_hints_apply): Handle new style - flag. - - * src/autofit/afranges.h (SCRIPT): Use it to export no-base ranges. - -2015-09-04 Werner Lemberg - - [autofit] Redesign code ranges (1/2). - - This patch introduces auxiliary code ranges that identify no-base - characters; they refer to glyphs of a script that should be hinted - without alignments to blue zones (mostly diacritics). - - It also splits off ranges for fallback scripts that handle subscript - and superscript characters not covered by OpenType features. For - example, this greatly helps improve the hinting of various phonetic - alphabets, which contain a large amount characters that look like - superscript glyphs. - - Finally, code ranges are updated to Unicode 8.0, and enclosed - characters are removed in general since they normally look better if - they stay unhinted. - - * src/autofit/afranges.c (af_latn_uniranges): Updated to Unicode - 8.0. - Split off superscript-like and subscript-like glyphs into... - - (af_latb_uniranges, af_latp_uniranges): ... these two new arrays. - - (af_xxxx_nobase_uniranges): New arrays that hold no-base characters - of the corresponding character ranges. - -2015-09-03 Werner Lemberg - - [autofit] Pass glyph index to hinting function. - - No functionality change yet. - - * src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Pass - glyph index. - - * src/autofit/afcjk.c, src/autofit/afcjk.h (af_cjk_hints_apply), - src/autofit/afdummy.c (af_dummy_hints_apply), src/autofit/afindic.c - (af_indic_hints_apply), src/autofit/aflatin.c - (af_latin_hints_apply), src/autofit/aflatin2.c - (af_latin2_hints_apply), src/autofit/afloader.c (af_loader_load_g): - Updated. - -2015-08-30 Werner Lemberg - - [autofit] Code clean-up. - - * src/autofit/afglobal.h (AF_STYLE_MASK): New macro. - (AF_STYLE_UNASSIGNED): Use AF_STYLE_MASK for definition. - - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): - Updated. - -2015-08-30 Werner Lemberg - - [autofit] Make glyph style array use 16bit values. - - * include/freetype/ftautoh.h (FT_Prop_GlyphToScriptMap): Use - `FT_UShort' for `map' field. - - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage, - af_face_globals_new), src/autofit/hbshim.c, src/autofit/hbshim.h - (af_get_coverage): Use FT_UShort for `glyph_styles' array. - - * src/autofit/afglobal.h (AF_STYLE_UNASSIGNED, AF_DIGIT): Extend to - 16 bits. - (AF_FaceGlobalsRec): Use `FT_UShort' for `glyph_styles' field. - -2015-08-26 Werner Lemberg - - * builds/unix/configure.raw: Need harfbuzz >= 0.9.21 (#45828). - -2015-08-25 Werner Lemberg - - [base] Improve kerning tracing and documentation. - - * src/base/ftobjs.c (FT_Get_Kerning): Emit tracing message if - scaled-down kerning values differ. - -2015-08-18 Werner Lemberg - - [raster] Remove last remnants of `raster5' driver. - - * src/raster/ftrend1.h (ft_raster5_renderer_class): Removed. - - * src/raster/rastpic.c, src/raster/rastpic.h - (ft_raster5_renderer_class_pic_init, - ft_raster5_renderer_class_pic_free): Removed. - -2015-08-17 Alexei Podtelezhnikov - - [base] Improve emboldener (#45596). - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Correct displacement - of zero-length segments. - -2015-08-16 Alexei Podtelezhnikov - - [base] Reoptimize arithmetic. - - * src/base/ftcalc.c (FT_MulDiv, FT_MulFix) [!FT_LONG64]: Remove - special cases that slow down the general use. - -2015-08-15 pazer - - Fix C++ compilation (#45762). - - * src/base/ftstroke.c (ft_outline_glyph_class): Use - FT_CALLBACK_TABLE. - -2015-08-14 Alexei Podtelezhnikov - - [truetype] Clean up. - - * src/truetype/ttgload.c (TT_Process_Composite_Component): Use - `FT_Outline_Transform' and `FT_Outline_Translate'. - (translate_array): Dropped. - -2015-08-14 Andreas Enge - - * builds/unix/detect.mk (CONFIG_SHELL): Don't handle it (#44261). - -2015-08-13 Werner Lemberg - - [truetype] Introduce named instance access to GX fonts. - - For functions querying a face, bits 16-30 of the face index can hold - the named instance index if we have a GX font. The indices start - with value 1; value 0 indicates font access without GX variation - data. - - * include/freetype/freetype.h (FT_FaceRec): Update documentation. - * include/freetype/internal/sfnt.h: Ditto. - - * src/sfnt/sfobjs.c (sfnt_init_face) - [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Get number of named instances and - do argument checks. - (sfnt_load_face): Updated. - - * src/truetype/ttobjs.c (tt_face_init) - [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Use named instance, overwriting - the style name. - - * src/base/ftobjs.c (open_face_from_buffer, - open_face_PS_from_sfnt_stream): Updated. - * src/bdf/bdfdrivr.c (BDF_Face_Init): Updated. - * src/cff/cffload.c (cff_font_load): Updated. - - * src/cff/cffobjs.c (cff_face_init): Make function exit early for - pure CFF fonts if `font_index < 0'. - Updated. - - * src/cid/cidobjs.c (cid_face_init): Updated. - * src/pcf/pcfdrivr.c (PCF_Face_Init): Updated. - * src/pfr/pfrobjs.c (pfr_face_init): Updated. - * src/type1/t1objs.c (T1_Face_Init): Updated. - * src/type42/t42objs.c (T42_Face_Init): Updated. - * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init): - Updated. - - * docs/CHANGES: Updated. - -2015-08-12 Alexei Podtelezhnikov - - [type1,cff,cid] Streamline font matrix application. - - * src/type1/t1gload.c (T1_Load_Glyph): Directly modify advances only - if font matrix is not trivial. - * src/cff/cffgload.c (cff_slot_load): Ditto. - * src/cid/cidgload.c (cid_slot_load_glyph): Ditto for advances and the - entire outline. - -2015-08-11 Werner Lemberg - - [builds/unix] Minor. - - * builds/unix/configure.raw: - s/lib{priv,staticconf}/libs{priv,staticconf}/ for orthogonality with - similarly named uppercase variables. - -2015-08-10 Alexei Podtelezhnikov - - [type1,cid,type42] Minor improvements. - - * src/type1/t1load.c (t1_parse_font_matrix): Scale units per EM only - when necessary. Refresh comments. - * src/cid/cidload.c (cid_parse_font_matrix): Ditto. - * src/type42/t42parse.c (t42_parse_font_matrix): Refresh comments. - -2015-08-08 Werner Lemberg - - [type42] Fix glyph access. - - This is a severe bug: We've missed one level of indirection, as - described in the Type 42 specification. As a result, ftview - sometimes showed incorrect glyphs for given glyph names, and even - displayed `error 0x0006' (invalid argument!) in case the number of - glyph indices differed between the Type 42 font and the embedded - TTF. - - Apparently, noone ever noticed it; this shows how much Type 42 fonts - are in use... - - * src/type42/t42objs.c (T42_GlyphSlot_Load): Map Type 42 glyph index - to embedded TTF's glyph index. - -2015-08-08 Werner Lemberg - - [type42] Minor clean-up. - - * src/type42/t42parse.c (t42_parse_font_matrix): Remove unused - variable. - -2015-08-06 Alexei Podtelezhnikov - - [type42] Parse FontMatrix according to specifications. - - * src/type42/t42parse.c (t42_parse_font_matrix): Type 42 FontMatrix - does not need scaling by 1000. Units_per_EM are taken from the - embedded TrueType. - -2015-08-06 Werner Lemberg - - [autofit] Improve Arabic hinting. - - Problem reported by Titus Nemeth (by using - ttfautohint). - - * src/autofit/afblue.dat: Add neutral blue zone for the tatweel - character. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - -2015-08-05 Alexei Podtelezhnikov - - [truetype] Clean up types. - - * src/truetype/ttobjs.c (TT_Size): Move declaration from here. - * include/freetype/internal/tttypes.h (TT_Size): ... to here. - (TT_LoaderRec): Switch to appropriate types for `face' and `size'. - * src/truetype/ttgload.c: Remove corresponding type casts. - * src/truetype/ttsubpix.c: Ditto. - -2015-08-05 Werner Lemberg - - [autofit] Improve recognition of flat vs. rounded segments. - - Lower the flatness threshold from upem/8 to upem/14, making the - auto-hinter accept shorter elements. - - Synchronize flat/round stem selection algorithm with blue zone code. - - * src/autofit/aflatin.c (FLAT_THRESHOLD): New macro. - (af_latin_metrics_init_blues): Use it. - (af_latin_hints_compute_segments): Collect information on maximum - and minimum coordinates of `on' points; use this to add a constraint - for the flat/round decision similar to - `af_latin_metrics_init_blues'. - -2015-08-04 Werner Lemberg - - Another left-shift bug (#45681). - - * src/base/ftobjs.c (IsMacBinary): Only accept positive values for - `dlen'. - -2015-08-03 Alexei Podtelezhnikov - - [base] Fix `ft_corner_orientation'. - - Remove casting from `FT_Long' to `FT_Int' that might change the sign - of the return value and make it faster too. - - * src/base/ftcalc.c (ft_corner_orientation): On 32-bit systems, stay - with 32-bit arithmetic when safe. Use plain math on 64-bit systems. - * src/pshinter/pshalgo.c: Remove old unused code. - -2015-08-03 Werner Lemberg - - * src/truetype/ttgload.c (load_truetype_glyph) - [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Fix crash for composite glyphs - having a depth greater than 1. - -2015-08-03 Werner Lemberg - - Fix typo in clang bug from 2015-07-31 (#45678). - - * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Fix inequality. - -2015-08-02 Werner Lemberg - - * CMakeLists.txt: Improve shared library support. - - Based on a patch from John Cary . - -2015-08-02 Werner Lemberg - - * builds/unix/freetype-config.in (enable_shared): Remove. Unused. - -2015-08-02 Werner Lemberg - - Fix more invalid left-shifts. - - * src/pfr/pfrgload.c (pfr_glyph_load_compound): Use multiplication, - not left-shift. - - * src/truetype/ttgxvar.c (ft_var_load_avar, ft_var_load_gvar, - tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): Use multiplication, - not left-shift. - -2015-07-31 Werner Lemberg - - Fix some bugs found by clang's `-fsanitize=undefined' (#45661). - - * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Only accept - positive values from header. - Check overflow. - - * src/base/ftoutln.c (SCALED): Correctly handle left-shift of - negative values. - - * src/bdf/bdf.h (_bdf_glyph_modified, _bdf_set_glyph_modified, - _bdf_clear_glyph_modified): Use unsigned long constant. - - * src/bdf/bdfdrivr.c (BDF_Size_Select, BDF_Glyph_Load): Don't - left-shift values that can be negative. - - * src/pcf/pcfdrivr.c (PCF_Size_Select, PCF_Glyph_Load): Don't - left-shift values that can be negative. - - * src/raster/ftraster.c (SCALED): Correctly handle left-shift of - negative values. - - * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Don't left-shift - values that can be negative. - - * src/truetype/ttgload.c (TT_Load_Composite_Glyph, - compute_glyph_metrics, load_sbit_image): Don't left-shift values - that can be negative. - -2015-07-31 Werner Lemberg - - Define FT_LONG_MAX. - - * include/freetype/config/ftstdlib.h (FT_LONG_MAX): New macro. - * src/cff/cf2arrst.c (cf2_arrstack_setNumElements): Use it. - -2015-07-28 Alexei Podtelezhnikov - - * src/base/ftcalc.c (FT_Vector_NormLen): Clarify. - -2015-07-27 Alexei Podtelezhnikov - - * src/base/ftcalc.c (FT_Vector_NormLen): Explicate type conversions. - -2015-07-26 Matthias Clasen - - [cff] Don't use `hmtx' table for LSB (#45520). - - * src/cff/cffgload.c (cff_slot_load): Use `htmx' table for advance - width only. Bug introduced 2015-04-10. - -2015-07-09 Werner Lemberg - - Better support of user-supplied C++ namespaces. - - See - - http://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html - - for a rationale. - - * src/autofit/afpic.h, src/base/basepic.h, src/cff/cffpic.h, - src/pshinter/pshpic.h, src/psnames/pspic.h, src/raster/rastpic.h, - src/sfnt/sfntpic.h, src/smooth/ftspic.h, src/truetype/ttpic.h - (FT_BEGIN_HEADER, FT_END_HEADER): Move macro calls to not enclose - header files that contain FT_{BEGIN,END}_HEADER macros by - themselves. - - * src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include - FT_CONFIG_STANDARD_LIBRARY_H earlier. - - * src/truetype/ttpic.h: Include FT_INTERNAL_PIC_H. - -2015-07-07 Werner Lemberg - - [sfnt] Make `tt_face_get_name' member of the SFNT interface. - - * include/freetype/internal/sfnt.h (TT_Get_Name_Func): New - prototype. - (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): New member `get_name'. - - * src/sfnt/sfdriver.c (sfnt_interface): Updated. - - * src/sfnt/sfobjs.c (tt_face_get_name): Tag it with `LOCAL_DEF'. - * src/sfnt/sfobjs.h: Add prototype for it. - -2015-06-30 Werner Lemberg - - Fix some clang compiler warnings. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY), src/cff/cf2intrp.c - (cf2_interpT2CharString), src/truetype/ttgload.c - (load_truetype_glyph), src/truetype/ttgxvar.c (tt_handle_deltas), - src/truetype/ttinterp.c (Ins_INSTCTRL): Fix signedness issues. - -2015-06-29 Alexei Podtelezhnikov - - [truetype] Speed up bytecode interpreter. - - * src/truetype/ttinterp.c (Normalize): Use `FT_Vector_NormLen'. - -2015-06-29 Alexei Podtelezhnikov - - [base] Speed up emboldening. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use - `FT_Vector_NormLen'. - -2015-06-29 Alexei Podtelezhnikov - - [base] Implement fast vector normalization. - - The function uses Newton's iterations instead of dividing vector - components by its length, which needs a square root. This is, - literally, a bit less accurate but a lot faster. - - * src/base/ftcalc.c (FT_Vector_NormLen): New function. - -2015-06-28 Werner Lemberg - - * CMakeLists.txt: Always create `ftconfig.h'. - - For non-UNIX builds, the file stays unmodified. However, it's - better to have the main configuration files at the same place - regardless of the OS. - -2015-06-28 Werner Lemberg - - * CMakeLists.txt: Improve MSVC support (#43737). - -2015-06-28 Werner Lemberg - - [cmake] Check for libraries and create `ftoption.h'. - - * builds/FindHarfBuzz.cmake: New file, taken from - - https://trac.webkit.org/browser/trunk/Source/cmake/FindHarfBuzz.cmake - - * CMakeLists.Txt: Add path to local cmake modules. - Find dependencies for zlib, bzip2, libpng, and harfbuzz. - Create `ftoption.h' file. - Set up include and linker stuff for libraries. - -2015-06-28 Werner Lemberg - - * CMakeLists.txt: Fix creation of `ftconfig.h'. - Check for UNIX header files using `check_include_file'. - Set up correct header include directories. - -2015-06-28 Werner Lemberg - - * CMakeLists.txt: Disallow in-source builds. - -2015-06-27 Werner Lemberg - - * src/tools/docmaker/utils.py (check_output): Add missing `\n'. - -2015-06-26 Werner Lemberg - - * CMakeLists.txt: Select platform-dependent `ftdebug.c'. - -2015-06-25 Werner Lemberg - - * CMakeLists.txt: Use cmake functions for generating `ftconfig.h'. - Additionally, do this for UNIX only. - -2015-06-25 Werner Lemberg - - * CMakeLists.txt (BASE_SRCS): Use `ftbase.c' and `psnames.c'. - -2015-06-25 Werner Lemberg - - Another adjustment to header locations. - - This change is a result of a discussion thread on freetype-devel - - http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html - - Re-introduce the `freetype2' subdirectory for all FreeType header - files after installation, and rename the `freetype2' subdirectory in - the git repository to `freetype'. - - * include/freetype2: Renamed to... - * include/freetype: This. - - * CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS, - PRIVATE_HEADERS): Updated. - Update creation of `ftconfig.h'. - Install generated `ftconfig.h'. - - * Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated. - - * builds/amiga/include/config/ftconfig.h, builds/freetype.mk - (PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work), - builds/unix/freetype2.in: Updated. - - * builds/unix/freetype-config.in: Updated. - * builds/unix/configure.raw: Don't check for `rmdir'. - * builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable - according to the autoconf info manual. - * builds/unix/install.mk (install, uninstall, - distclean_project_unix): Update and simplify. - - * builds/wince/*, builds/windows/*: Updated. - - * devel/ft2build.h, include/ft2build.h: Updated. - - * include/freetype2/config/ftheader.h, - include/freetype2/internal/ftserv.h, - include/freetype2/internal/internal.h: Update all header file - macros. - - * src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated. - - * docs/*: Updated. - -2015-06-24 Alexei Podtelezhnikov - - * src/bdf/bdflib.c (_bdf_parse_start): Disallow 0 bpp. - -2015-06-24 Alexei Podtelezhnikov - - * src/bdf/bdflib.c (_bdf_parse_start): Simplify bpp parsing. - -2015-06-23 Werner Lemberg - - s/TYPEOF/FT_TYPEOF/ (#45376). - - * builds/unix/ftconfig.in, builds/vms/ftconfig.in, - include/freetype2/config/ftconfig.h, - include/freetype2/internal/ftobjs.h, src/autofit/afwarp.h: Do it. - -2015-06-22 Werner Lemberg - - Fix Savannah bug #45097. - - We no longer `pollute' the namespace of possible header file names; - instead we move `ft2build.h' up by one level so that it gets - installed in the default include directory (e.g., - /usr/local/include). After this commit, only `ft2build.h' stays in - the compiler's include path. - - No visible changes for the user who follows the standard FreeType - header inclusion rules. - - * include/*: Move to ... - * include/freetype2/*: This directory, except `ft2build.h'. - - * CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS, - PRIVATE_HEADERS), Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated. - - * builds/amiga/include/config/ftconfig.h, builds/freetype.mk - (PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work), - builds/unix/install.mk (install, uninstall), - builds/unix/freetype2.in: Updated. - - * builds/unix/freetype-config.in: Updated. - Emit -I directory only if it is not `/usr/include'. - - * builds/wince/*, builds/windows/*: Updated. - - * devel/ft2build.h, include/ft2build.h: Updated. - - * include/freetype2/config/ftheader.h, - include/freetype2/internal/ftserv.h, - include/freetype2/internal/internal.h: Update all header file - macros. - - * src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated. - -2015-06-21 Werner Lemberg - - Make Jam support work again. - - This is just very basic stuff and just a little bit tested on - GNU/Linux only. I won't delve into this since I'm not a Jam user. - - * Jamfile: Call `HDRMACRO' for `ftserv.h' also. - (DEFINES): Replace with... - (CCFLAGS): ... this. - - * src/Jamfile: Don't call `HDRMACRO' for `internal.h'; this is - already handled in the top-level Jamfile. - - * src/autofit/Jamfile (DEFINES): Replace with... - (CCFLAGS): ... this. - (_sources): Add missing files. - - * src/cache/Jamfile: Don't call `HDRMACRO' for `ftcache.h'; it no - longer contains macro header definitions. - - * src/base/Jamfile, src/cff/Jamfile, src/sfnt/Jamfile, - src/truetype/Jamfile (_sources): Add missing files. - -2015-06-16 Werner Lemberg - - Fix Savannah bug #45326. - - * src/sfnt/sfntpic.h (SFNT_SERVICES_GET): Remove duplicate - definitions. - -2015-06-07 Werner Lemberg - - * Version 2.6 released. + * Version 2.7 released. ======================= - Tag sources with `VER-2-6'. + Tag sources with `VER-2-7'. - * docs/VERSION.DLL: Update documentation and bump version number to - 2.6. + * docs/VERSION.TXT: Add entry for version 2.7. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, builds/windows/vc2005/index.html, @@ -3915,1619 +23,631 @@ 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.5.5/2.6/, s/255/26/. + builds/wince/vc2008-ce/index.html: s/2.6.5/2.7/, s/265/27/. - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 6. + * include/freetype/freetype.h (FREETYPE_MINOR): Set to 7. (FREETYPE_PATCH): Set to 0. - * builds/unix/configure.raw (version_info): Set to 18:0:12. - * CMakeLists.txt (VERSION_MINOR): Set to 6. + * builds/unix/configure.raw (version_info): Set to 18:6:12. + * CMakeLists.txt (VERSION_MINOR): Set to 7. (VERSION_PATCH): Set to 0. - * src/autofit/afmodule.c [!FT_MAKE_OPTION_SINGLE_OBJECT]: Add - declarations for dumping functions. - - * src/truetype/ttinterp.c (TT_New_Context): Pacify compiler. - - * builds/toplevel.mk: Use `freetype.mk's code to compute the version - string. - Don't include a zero patch level in version string. - * builds/freetype.mk: Remove code for computing the version string. - -2015-06-06 Ashish Azad - - Fix Savannah bug #45260. - - * src/pfr/pfrdrivr.c (pfr_get_kerning): Fix typo. - -2015-06-03 Werner Lemberg - - [truetype] Fix memory leak. - - Problem reported by Grissiom ; in - - http://lists.nongnu.org/archive/html/freetype/2015-05/msg00013.html - - there is an example code to trigger the bug. - - * src/truetype/ttobjs.c (tt_size_init_bytecode): Free old `size' - data before allocating again. Bug most probably introduced four - years ago in version 2.4.3. - -2015-06-02 Werner Lemberg - - [raster] Add more tracing. - - * src/raster/ftraster.c (FT_TRACE7) [_STANDALONE_]: Define. - (Vertical_Sweep_Span, Vertical_Sweep_Drop, Horizontal_Sweep_Span, - Horizontal_Sweep_Drop, Render_Glyph): Add tracing calls. - -2015-06-01 Werner Lemberg - - [truetype] While tracing opcodes, show code position and stack. - - * src/truetype/ttinterp.c: Change all existing TRACE7 calls to - TRACE6. - (opcode_name): Add string lengths. - (TT_RunIns): Implement display of code position and stack. - -2015-05-31 Werner Lemberg - - [truetype] In GX, make private point numbers work correctly. - - This is completely missing in Apple's documentation: If a `gvar' - tuple uses private point numbers (this is, deltas are specified for - some points only), the uncovered points must be interpolated for - this tuple similar to the IUP bytecode instruction. Examples that - need this functionality are glyphs `Oslash' and `Q' in Skia.ttf. - - * src/truetype/ttgxvar.c (tt_delta_shift, tt_delta_interpolate, - tt_handle_deltas): New functions. - (TT_Vary_Get_Glyph_Deltas): Renamed to... - (TT_Vary_Apply_Glyph_Deltas): ... this; it directly processes the - points and does no longer return an array of deltas. - Add tracing information. - Call `tt_handle_deltas' to interpolate missing deltas. - Also fix a minor memory leak in case of error. - - * src/truetype/ttgxvar.h: Updated. - - * src/truetype/ttgload.c (TT_Process_Simple_Glyph, - load_truetype_glyph): Updated. - -2015-05-31 Werner Lemberg - - [truetype] In GX, make intermediate tuplets work at extrema. - - * src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix range condition. - -2015-05-31 Werner Lemberg - - [truetype] Add tracing information to GX code. - - * src/truetype/ttgxvar.c (ft_var_load_avar, ft_var_load_gvar, - ft_var_apply_tuple, TT_Get_MM_Var, TT_Set_MM_Blend, - TT_Set_Var_Design, tt_face_vary_cvt): Do it. - -2015-05-28 Werner Lemberg - - * src/tools/apinames.c (names_dump): Fix invalid reference. - - Problem reported by Guzman Mosqueda, Jose R - . - -2015-05-24 Werner Lemberg - - [truetype] Fix commit from 2015-05-22. - - * src/truetype/ttgload.c, src/truetype/ttinterp.c: Guard new code - with `TT_CONFIG_OPTION_SUBPIXEL_HINTING'. - - Problem reported by Nikolaus Waxweiler . - -2015-05-23 Werner Lemberg - - [truetype] Fix return values of GETINFO bytecode instruction. - - * src/truetype/ttinterp.h (TT_ExecContextRec): New fields - `vertical_lcd' and `gray_cleartype'. - - * src/truetype/ttgload.c (tt_loader_init): Initialize new fields. - Change `symmetrical smoothing' to TRUE, since FreeType produces - exactly this. - - * src/truetype/ttinterp.c (Ins_GETINFO): Fix selector/return bit - values for symmetrical smoothing, namely 11/18. - Handle bits for vertical LCD subpixels (8/15) and Gray ClearType - (12/19). - -2015-05-23 Werner Lemberg - - [truetype] Minor. - - * src/truetype/ttinterp.h (TT_ExecContext): - s/subpixel/subpixel_hinting. - - * src/truetype/ttgload.c, src/truetype/ttgload.h: Updated. - -2015-05-22 Werner Lemberg - - [truetype] Support selector index 3 of the INSTCTRL instruction. - - This flag activates `native ClearType hinting', disabling backwards - compatibility mode as described in Greg Hitchcocks whitepaper. In - other words, it enables unrestricted functionality of all TrueType - instructions in ClearType. - - * src/truetype/ttgload.c (tt_get_metrics): Call `sph_set_tweaks' - unconditionally. - (tt_loader_init): Unset `ignore_x_mode' flag if bit 2 of - `GS.instruct_control' is active. - - * src/truetype/ttinterp.c (Ins_INSTCTRL): Handle selector index 3. - (Ins_GETINFO): Updated. - - * docs/CHANGES: Document it. - -2015-05-20 Werner Lemberg - - [truetype] Minor. - - * src/truetype/ttinterp.h (SetSuperRound): Fix type of `GridPeriod' - argument. - -2015-05-17 Werner Lemberg - - [truetype] Fix loading of composite glyphs. - - * src/truetype/ttgload.c (TT_Load_Composite_Glyph): If the - ARGS_ARE_XY_VALUES flag is not set, handle argument values as - unsigned. I trust `ttx' (which has exactly such code) that it does - the right thing here... - - The reason that noone has ever noticed this bug is probably the fact - that point-aligned subglyphs are rare, as are subglyphs with a - number of points in the range [128;255], which is quite large (or - even in the range [32768;65535], which is extremely unlikely). - -2015-05-12 Chris Liddell - - [cff] Make the `*curveto' operators more tolerant. - - * src/cff/cf2intrp.c (cf2_interpT2CharString): The opcodes - `vvcurveto', `hhcurveto', `vhcurveto', and `hvcurveto' all iterate, - pulling values off the stack until the stack is exhausted. - Implicitly the stack must be a multiple (or for subtly different - behaviour) a multiple plus a specific number of extra values deep. - If that's not the case, enforce it (as the old code did). - -2015-05-12 Chris Liddell - - [cff] fix incremental interface with new cff code. - - * src/cff/cf2ft.c (cf2_getSeacComponent): When using the incremental - interface to retrieve glyph data for a SEAC, it be left to the - incremental interface callback to apply the encoding to raw - character index (as it was in the previous code). - -2015-04-29 Alexei Podtelezhnikov - - [autofit] Speed up IUP. - - * src/autofit/afhints.c (af_iup_interp): Separate trivial snapping to - the same position from true interpolation, use `scale' to reduce - divisions. - -2015-04-28 Werner Lemberg - - [cff] Use `name' table for PS name if we have a SFNT-CFF. - - This follows the OpenType 1.7 specification. See - - http://tug.org/pipermail/tex-live/2015-April/036634.html - - for a discussion. - - * src/cff/cffdrivr.c (cff_get_ps_name): Use the `sfnt' service if we - have an SFNT. - -2015-04-27 Alexei Podtelezhnikov - - [truetype] Speed up IUP. - - * src/truetype/ttinterp.c (_iup_worker_interpolate): Separate trivial - snapping to the same position from true interpolation. - -2015-04-21 Werner Lemberg - - [autofit] By default, enable warping code but switch off warping. - - Suggested by Behdad. - - * include/config/ftoption.h: Define AF_CONFIG_OPTION_USE_WARPER. - - * src/autofit/afmodule.c (af_autofitter_init): Initialize `warping' - with `false'. - -2015-04-21 Werner Lemberg - * docs/CHANGES: Updated. -2015-04-21 Werner Lemberg +2016-09-08 Werner Lemberg - [autofit] Introduce `warping' property. + * src/truetype/ttinterp.c: Include `ttgxvar.h'. - This code replaces the debugging hook from the previous commit with - a better, more generic solution. + This fixes the `multi' build. - * include/ftautoh.h: Document it. +2016-09-08 Werner Lemberg - * src/autofit/afmodule.h (AF_ModuleRec) - [AF_CONFIG_OPTION_USE_WARPER]: Add `warping' field. + [autofit] Another improvement to Armenian support. - * src/autofit/afmodule.c (_af_debug_disable_warper): Remove. - (af_property_set, af_property_get, af_autofitter_init) - [AF_CONFIG_OPTION_USE_WARPER]: Handle `warping' option. + Suggested by Hrant H Papazian . - * src/autofit/afhints.h (AF_HINTS_DO_WARP): Remove use of the no - longer existing `_af_debug_disable_warper'. + * src/autofit/afscript.h: Use better suited characters to derive + default stem widths. - * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c - (af_latin_hints_init), src/autofit/aflatin2.c (af_latin2_hints_init) - [AF_CONFIG_OPTION_USE_WARPER]: Add `AF_SCALER_FLAG_NO_WARPER' to the - scaler flags if warping is off. +2016-09-07 Alexei Podtelezhnikov - * src/autofit/aftypes.h: Updated. + * src/smooth/ftgrays.c (gray_hline): Microptimize. -2015-04-16 Werner Lemberg +2016-09-06 Alexei Podtelezhnikov - [autofit] Add debugging hook to disable warper. + [smooth] Operate in absolute bitmap coordinates. - * src/autofit/afmodule.c (_af_debug_disable_warper) - [FT_DEBUG_AUTOFIT]: New global variable. + Simpler bitmap addressing improves performance by 1.5%. - * src/autofit/aftypes.h: Updated. - (AF_SCALER_FLAG_NO_WARPER): New macro (not actively used yet). + * 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. - * src/autofit/afhints.h (AF_HINTS_DO_WARP): New macro. +2016-09-06 Alexei Podtelezhnikov - * src/autofit/aflatin.c (af_latin_hints_apply) - [AF_CONFIG_OPTION_USE_WARPER]: Use `AF_HINTS_DO_WARP' to control use - of warper. + [smooth] Improve contour start (take 2). - * src/autofit/afcjk.c (af_cjk_hints_init, af_cjk_hints_apply) - [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. + * 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. - * src/autofit/aflatin2.c (af_latin2_hints_apply) - [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. +2016-09-06 Werner Lemberg -2015-04-10 Werner Lemberg + [type1] MM fonts support exactly zero named instances (#48748). - [cff] Update advance width handling to OpenType 1.7. + * src/type1/t1load.c (T1_Get_MM_Var): Set `num_namedstyles' to zero. - Problem reported by Behdad. +2016-09-06 Jonathan Kew - * src/cff/cffdrivr.c (cff_get_advances): Handle SFNT case - separately. + [cff] Fix uninitialized memory. - * src/cff/cffgload.c (cff_slot_load): Use advance width and side - bearing values from `hmtx' table if present. + Problem reported as -2015-04-03 Alexei Podtelezhnikov + https://bugzilla.mozilla.org/show_bug.cgi?id=1270288 - * src/autofit/afhints.c (af_glyph_hints_reload): Use do-while loop. + * src/cff/cf2interp.c (cf2_interpT2CharString): Initialize `storage' + array to handle a `get' opcode without a previous `put'. -2015-04-02 Alexei Podtelezhnikov +2016-09-05 Alexei Podtelezhnikov - * src/autofit/aflatin.c (af_latin_hint_edges): Reduce logic. + * src/smooth/ftgrays.c (gray_move_to, gray_start_cell): Revert. -2015-04-01 Alexei Podtelezhnikov +2016-09-05 Alexei Podtelezhnikov - [autofit] Finish the thought. + [smooth] Improve contour start. - * src/autofit/afhints.c (af_direction_compute): make sure the long arm - is never negative so that its `FT_ABS' is not necessary. + * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly + instead of... + (gray_start_cell): ... this function, which is removed. -2015-04-01 Werner Lemberg +2016-09-05 Werner Lemberg - [autofit] Call dumper functions for tracing. + [cff] Fix memory initialization. - * src/autofit/afcjk.c (af_cjk_hints_apply): Remove dead code. - * src/autofit/afhints.c (af_glyph_hints_dump_points): Minor - improvement. - * src/autofit/afmodule.c (af_autofitter_load_glyph): Implement it. + * src/cff/cf2stack.c (cf2_stack_init): Use `FT_NEW'. The `Q' + variants of FreeType's memory allocation macros don't do zeroing. -2015-04-01 Werner Lemberg +2016-09-05 Werner Lemberg - [autofit] Make debugging stuff work again. + [ftrandom] Minor improvements. - The interface to ftgrid was broken in the series of commits starting - with + * src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): New macro, set to + 500. - [autofit] Allocate AF_Loader on the stack instead of AF_Module. + * src/tools/ftrandom/Makefile (CFLAGS): Split off include + directories to ... + (INCLUDES): ... this new variable. + (LDFLAGS): New variable. + (ftrandom.o, ftrandom): Updated. - from 2015-01-14. +2016-09-05 Werner Lemberg - * src/autofit/afmodule.c (_af_debug_hints_rec) [FT_DEBUG_AUTOFIT]: - Use a global AF_GlyphHintsRec object for debugging. - (af_autofitter_done, af_autofitter_load_glyph): Updated. + [autofit] Improve Armenian support. - * src/autofit/afloader.c (af_loader_init, af_loader_done): Updated. + Thanks to Hrant H Papazian for help. -2015-04-01 Werner Lemberg - - * src/autofit/afhints.c (af_glyph_hints_done): Fix minor thinko. - -2015-03-29 Werner Lemberg - - [cff] Fix Savannah bug #44629. - - * src/cff/cf2font.h (CF2_MAX_SUBR), src/cff/cffgload.h - (CFF_MAX_SUBRS_CALLS): Set to 16. - -2015-03-29 Werner Lemberg - - [type1, truetype] Make the MM API more flexible w.r.t. `num_coords'. - - This commit allows `num_coords' to be larger or smaller than the - number of available axes while selecting a design instance, either - ignoring excess data or using defaults if data is missing. - - * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): - Implement it. - - * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design, - T1_Set_Var_Design): Ditto. - -2015-03-29 Werner Lemberg - - [type1] Minor. - - * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Use - FT_THROW. - (T1_Set_Var_Design): Use T1_MAX_MM_AXIS and FT_THROW. - -2015-03-27 Werner Lemberg - - [cff] Trace charstring nesting levels. - - * src/cff/cf2intrp.c (cf2_interpT2CharString) : Implement it. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Ditto. - -2015-03-21 Alexei Podtelezhnikov - - [base] Optimize `FT_Angle_Diff'. - - Under normal circumstances we are usually close to the desired range - of angle values, so that the remainder is not really necessary. - - * src/base/fttrigon.c (FT_Angle_Diff): Use loops instead of remainder. - - * src/autofit/aftypes.h (AF_ANGLE_DIFF): Ditto in the unused macro. - -2015-03-21 Werner Lemberg - - [truetype] Improve `gvar' handling. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Correctly handle - single-element runs. Cf. glyph `Q' in Skia.ttf with weights larger - than the default. - -2015-03-20 Alexei Podtelezhnikov - - * src/base/fttrigon.c (FT_Vector_Rotate): Minor refactoring. - -2015-03-17 Alexei Podtelezhnikov - - Fix Savannah bug #44412 (part 2). - - * src/base/fttrigon.c (FT_Sin, FT_Cos, FT_Tan): Call `FT_Vector_Unit'. - -2015-03-11 Werner Lemberg - - [autofit] Add support for Arabic script. - - Thanks to Titus Nemeth for guidance! - - * src/autofit/afblue.dat: Add blue zone data for Arabic. + * src/autofit/afblue.dat (AF_BLUE_STRING_ARMENIAN_*): Improve + selection of characters. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - * src/autofit/afscript.h: Add Arabic standard characters. +2016-09-04 Werner Lemberg - * src/autofit/afranges.c: Add Arabic data. + [ftrandom] Improve Makefile. - * src/autofit/afstyles.h: Add Arabic data. + It now supports both a normal build (`./configure && make') and a + development build (`make devel'). - * docs/CHANGES: Document it. + * src/tools/ftrandom/Makefile (VPATH): Set it so that + `libfreetype.a' gets searched in both `objs' (for the development + build) and `objs/.libs' (for a normal build which uses libtool). + (LIBS): Add missing libraries. + (ftrandom.o): New rule. + (ftrandom): Use automatic variables. -2015-03-11 Werner Lemberg +2016-09-03 Werner Lemberg - Rename `svxf86nm.h' to `svfntfmt.h'; update related symbols. + [truetype] More fixes for handling of GX deltas. - * include/internal/ftserv.h (FT_SERVICE_XFREE86_NAME_H): Renamed - to... - (FT_SERVICE_FONT_FORMAT_H): This. + Problems reported by Bob Taylor . - * include/internal/services/svfntfmt.h (FT_XF86_FORMAT_*): Renamed - to ... - (FT_FONT_FORMAT_*): This. + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix rough + sanity test for glyph variation array header size. + Always set stream position before reading packed x and y deltas. + Fix thinko w.r.t. `localpoints' array. - src/base/ftfntfmt.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c, - src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, - src/truetype/ttdriver.c, src/type1/t1driver.c, - src/type42/t42drivr.c, src/winfonts/winfnt.c: Updated. +2016-09-03 Werner Lemberg -2015-03-11 Werner Lemberg + [ftrandom] Various fixes. - [base] Rename `FT_XFREE86_H' to `FT_FONT_FORMATS_H'. + * src/tools/ftrandom/ftrandom.c (GOOD_FONTS_DIR): Provide better + default. + (error_fraction): Make it of type `double' to work as advertized – + this was completely broken. + Update all related code. + (error_count, fcnt): Make it unsigned to fix compiler warnings. + Update all related code. + (fontlist): Change `len' member to `long' to fix compiler warnings. + (FT_MoveTo, FT_LineTo, FT_ConicTo, FT_CubicTo, abort_test): Tag + unused variables. + (TestFace, FindFonts, copyfont, do_test): Fix compiler warnings. + (ExecuteTest): Ditto. + Call `FT_Done_FreeType'. + (getErrorCnt): Replace `ceil' with an ordinary cast to `unsigned + int'. + (usage): Improve output. + (main): Fix compiler warnings. - * include/config/ftheader.h: Implement it. - * src/base/ftfntfmt.c, docs/CHANGES: Updated. + * src/tools/ftrandom/README: Updated. -2015-03-11 Werner Lemberg +2016-09-03 Werner Lemberg - [base] Rename `FT_Get_X11_Font_Format' to `FT_Get_Font_Format'. + [base] Avoid negative bitmap stroke dimensions (#48985). - * include/ftfntfmt.h, src/base/ftfntfmt.c: Implement it. + * src/base/ftobjs.c (FT_Open_Face): Check whether negation was + actually successful. For example, this can fail for value + -32768 if the type is `signed short'. If there are problems, + disable the stroke. + +2016-09-03 Werner Lemberg + + [cff] Avoid null pointer passed to FT_MEM_COPY (#48984). + + * src/cff/cffload.c (cff_index_get_name): Check `byte_len'. + +2016-09-02 Werner Lemberg + + [unix] Enable 64bit support in file system access (#48962). + + * builds/unix/configure.raw: Call `AC_SYS_LARGEFILE'. + +2016-09-02 Werner Lemberg + + [sfnt] Avoid left shift of negative value (#48980). + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Use unsigned + constant. + +2016-09-02 Werner Lemberg + + * src/smooth/ftgrays.c (gray_hline): Fix clang compiler warnings. + +2016-09-02 Werner Lemberg + + Some preparations for the next release. + + * include/freetype/config/ftoption.h + (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Enable. * docs/CHANGES: Updated. -2015-03-11 Werner Lemberg +2016-09-01 Alexei Podtelezhnikov - Fix automatic copyright updating. + [smooth] Simplify span rendering more. - * src/tools/update-copyright: Make scanning of `no-copyright' - actually work. + It turns out that there is significant cost associated with `FT_Span' + creation and calls to `gray_render_span' because it happerns so + frequently. This removes these steps from our internal use but leaves + it alone for `FT_RASTER_FLAG_DIRECT" to preserve API. The speed gain + is about 5%. - * src/tools/no-copyright: Don't include README in general. + * src/smooth/ftgrays.c (gray_render_span): Removed. The code is + migrated to... + (gray_hline): ... here. -2015-03-11 Werner Lemberg +2016-08-30 Alexei Podtelezhnikov - Rename `ftxf86.[ch]' to `ftfntfmt.[ch]'. + [smooth] Streamline pixmap drawing a bit more. - CMakeLists.txt, builds/amiga/makefile, builds/amiga/makefile.os4, - builds/amiga/smakefile, builds/mac/FreeType.m68k_cfm.make.txt, - builds/mac/FreeType.m68k_far.make.txt, - builds/mac/FreeType.ppc_carbon.make.txt, - builds/mac/FreeType.ppc_classic.make.txt, builds/symbian/bld.inf, - builds/symbian/freetype.mmp, builds/wince/vc2005-ce/freetype.vcproj, - builds/wince/vc2008-ce/freetype.vcproj, - builds/windows/vc2005/freetype.vcproj, - builds/windows/vc2008/freetype.vcproj, - builds/windows/vc2010/freetype.vcxproj, - builds/windows/vc2010/freetype.vcxproj.filters, - builds/windows/visualc/freetype.dsp, - builds/windows/visualc/freetype.vcproj, - builds/windows/visualce/freetype.dsp, - builds/windows/visualce/freetype.vcproj, docs/INSTALL.ANY, - include/config/ftheader.h, include/ftfntfmt.h, modules.cfg, - src/base/ftfntfmt.c, vms_make.com: Updated. + Zero coverage is unlikely (1 out of 256) to warrant checking. This + gives 0.5% speed improvement in rendering simple glyphs. -2015-03-10 Alexei Podtelezhnikov + * src/smooth/ftgrays.c (gray_hline, gray_render_span): Remove checks. - Fix Savannah bug #44412 (part 1). +2016-08-29 Alexei Podtelezhnikov - * src/base/ftstroke.c (ft_stroker_inside): Handle near U-turns. + [smooth] Streamline pixmap drawing. -2015-03-10 Werner Lemberg + This gives 2% speed improvement in rendering simple glyphs. - [base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'. + * src/smooth/ftgrays.c (TPixmap): Reduced pixmap descriptor with a + pointer to its bottom-left and pitch to be used in... + (gray_TWorker): ... here. + (gray_render_span): Move pixmap flow check from here... + (gray_raster_render): .. to here. - * include/ftbitmap.h, src/base/ftbitmap.c: Implement it. - Update all callers. +2016-08-27 Alexei Podtelezhnikov - * docs/CHANGES: Updated. + [smooth] Reduce stack of band boundaries. -2015-03-06 Werner Lemberg + * src/smooth/ftgrays.c (gray_TBand): Removed. + (gray_convert_glyph): Updated to stack band boundaries concisely. - * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning. +2016-08-26 Werner Lemberg - Found by Alexei. + * src/cid/cidload.c (cid_face_open): Improve handling of `SDBytes'. -2015-03-05 Alexei Podtelezhnikov +2016-08-26 Werner Lemberg - * src/base/ftstroke.c: Simplify. + [cid] Fix commit from 2016-05-16. -2015-03-04 Werner Lemberg + * src/cid/cidparse.c (cid_parser_new): Fix off-by-one errors. - [truetype] Some fixes and code refactoring in `ttgxvar.c'. +2016-08-26 Werner Lemberg - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix return value - of `point_cnt' if two bytes are read. - Use a more vertical coding style. - (ft_var_readpackeddeltas): Use FT_UInt for `delta_cnt' parameter. - Use a more vertical coding style. + [sfnt] Cache offset and size to bitmap data table. -2015-03-03 Werner Lemberg + This commit avoids `EBDT' and friends being looked up again and + again while loading a single embedded bitmap. - [autofit] Fix Savannah bug #44241. + * include/freetype/internal/tttypes.h (TT_FaceRec) + [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New fields `ebdt_start' and + `ebdt_size'. - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs - with less than 3 points. + * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Move table lookup to ... + (tt_face_load_sbit): ... this function; also store the table size + and offset. -2015-03-02 Werner Lemberg +2016-08-26 Alexei Podtelezhnikov - Simplify `TYPEOF' macro. + * src/smooth/ftgrays.c (gray_raster_render): Minor tweaks. - No need for two arguments. +2016-08-26 Werner Lemberg - * include/config/ftconfig.h, builds/unix/ftconfig.in, - builds/vms/ftconfig.h (TYPEOF): Updated. + [type1] Fix heap buffer overflow. - * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR), - src/autofit/afwarp.h (AF_WARPER_FLOOR): Updated. + Reported as -2015-03-01 Werner Lemberg + https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36 - Various compiler warning fixes for `make multi'. + * src/type1/t1load.c (parse_charstrings): Reject fonts that don't + contain glyph names. - * src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges), - src/autofit/aflatin.c (af_latin_hint_compute_blue_edges, - af_latin_hint_edges), src/autofit/aflatin2.c - (af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare - as `static'. +2016-08-25 Werner Lemberg - * src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH): - Removed. Unused. - * src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H. - * src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed. Unused. + [sfnt] Fix previous commit (#48901). - * src/cff/cf2intrp.c: Include `cf2intrp.h'. - * src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused. + * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Thinkos. - * src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused. +2016-08-25 Werner Lemberg - * src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'. + [sfnt] Speed up handling of invalid format 4 cmaps. - * src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX): - Removed. Unused. + * src/sfnt/ttcmap.c (tt_cmap4_next, tt_cmap4_char_map_binary): Add + tests for `num_glyph' from `tt_cmap4_char_map_linear'. - * src/raster/ftraster.c (Render_Glyph): Declare as `static'. +2016-08-25 Werner Lemberg - * src/sfnt/ttpost.c (load_format_20): Fix signedness warning. + * include/freetype/internal/ftdriver.h: Remove unused typedefs. - * src/truetype/ttdriver.c (PAIR_TAG): Removed. Unused. - * src/truetype/ttsubpix.c (is_member_of_family_class, - is_member_of_style_class): Declare as `static'. +2016-08-22 Alexei Podtelezhnikov - * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare - as `static'. - * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as - `static'. - (T1_FIELD_COUNT): Removed. Unused. - * src/type1/t1parse.h (T1_Done_Table): Removed. Unused. + [smooth] Simplify span rendering. - * src/type42/t42parse.c (T1_Done_Table): Removed. Unused. + This removes unnecessary complexity of span merging and buffering. + Instead, the spans are rendered as they come, speeding up the + rendering by about 5% as a result. -2015-02-25 Werner Lemberg + * src/smooth/ftgrays.c [FT_MAX_GRAY_SPANS]: Macro removed. + (gray_TWorker): Remove span buffer and related fields. + (gray_sweep, gray_hline): Updated. - [psaux] Signedness fixes. + * include/freetype/ftimage.h: Remove documentation note about + `FT_MAX_GRAY_SPANS', which was never in `ftoption.h' and is now gone. - * include/internal/psaux.h, src/psaux/afmparse.c, - src/psaux/afmparse.h, src/psaux/psconv.c, src/psaux/psobjs.c, - src/psaux/t1cmap.c, src/psaux/t1decode.c: Apply. +2016-08-16 Werner Lemberg -2015-02-25 Werner Lemberg + [truetype] Fix `MPS' instruction. - [otvalid] Signedness fixes. + According to Greg Hitchcock, MPS in DWrite really returns the point + size. - * src/otvalid/otvcommn.c, src/otvalid/otvgdef.c, - src/otvalid/otvgpos.c, src/otvalid/otvgsub.c, src/otvalid/otvmath.c: - Apply. + * src/truetype/ttobjs.h (TT_SizeRec): Add `point_size' member. -2015-02-25 Werner Lemberg + * src/truetype/ttdriver.c (tt_size_request): Set `point_size'. - * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Signedness fix. + * src/truetype/ttinterp.h (TT_ExecContextRec): Add `pointSize' + member. -2015-02-25 Werner Lemberg + * src/truetype/ttinterp.c (TT_Load_Context): Updated. + (Ins_MPS): Fix instruction. - [lzw] Signedness fixes. +2016-08-16 Werner Lemberg - * src/lzw/ftzopen.c, src/lzw/ftzopen.h: Apply. + [lzw] Optimize last commit. -2015-02-25 Werner Lemberg + * src/lzw/ftzopen.c (ft_lzwstate_get_code): Move check into + conditional clause. - [gxvalid] Signedness fixes. +2016-08-16 Werner Lemberg - * src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c, - src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c, - src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c, - src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c, - src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c, - src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c, - src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply. + [lzw] Avoid invalid left shift. -2015-02-25 Werner Lemberg + Reported as - [cache] Signedness fixes. + https://bugzilla.mozilla.org/show_bug.cgi?id=1295366 - * src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c, - src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply. + * src/lzw/ftzopen.c (ft_lzwstate_get_code): Limit `num_bits'. -2015-02-25 Werner Lemberg +2016-08-16 Werner Lemberg - Change dimension fields in `FTC_ImageTypeRec' to unsigned type. + [lzw] Avoid buffer overrun. - This doesn't break ABI. + Reported as - * include/ftcache.h (FTC_ImageTypeRec): Use unsigned types for - `width' and `height'. + https://bugzilla.mozilla.org/show_bug.cgi?id=1273283 - * docs/CHANGES: Document it. + * src/lzw/ftzopen.c (ft_lzwstate_refill): Ensure `buf_size' doesn't + underflow. -2015-02-25 Werner Lemberg +2016-08-16 Werner Lemberg - [cache] Don't use `labs'. + [truetype] Fix compiler warning. - This is the only place in FreeType where this function was used. + * src/truetype/ttgload.c (load_truetype_glyph): Add cast. - * include/config/ftstdlib.h (ft_labs): Remove. +2016-08-13 Werner Lemberg - * src/cache/ftcimage.c (ftc_inode_weight): Replace `ft_labs' with - `FT_ABS'. + [winfonts] Avoid zero bitmap width and height. -2015-02-23 Werner Lemberg + Reported as - [cache] Replace `FT_PtrDist' with `FT_Offset'. + https://bugzilla.mozilla.org/show_bug.cgi?id=1272173 - * src/cache/ftccache.h (FTC_NodeRec): `FT_Offset' (a.k.a. `size_t') - is a better choice for `hash' to hold a pointer than `FT_PtrDist' - (a.k.a. `ptrdiff_t'), especially since the latter is signed, - causing zillions of signedness warnings. [Note that `hash' was of - type `FT_UInt32' before the change to `FT_PtrDist'.] - Update all users. + * src/winfonts/winfnt.c (FNT_Face_Init): Check zero pixel height. + (FNT_Load_Glyph): Check for zero pitch. - * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c, - src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated. +2016-08-11 Alexei Podtelezhnikov -2015-02-23 Werner Lemberg + * src/truetype/ttinterp.c (Pop_Push_Count): Revert changes. - [smooth, raster] Re-enable standalone compilation. +2016-08-11 Alexei Podtelezhnikov - * src/raster/ftraster.c (FT_RENDER_POOL_SIZE, FT_MAX) - [_STANDALONE_]: Define macros. + * src/truetype/ttinterp.c (TT_RunIns): Minor and formatting. - * src/smooth/ftgrays.c (FT_RENDER_POOL_SIZE, FT_MAX, FT_ABS, - FT_HYPOT) [_STANDALONE_]: Define macros. +2016-08-11 Alexei Podtelezhnikov -2015-02-22 Werner Lemberg + * src/truetype/ttinterp.c (Pop_Push_Count): Fix some entries. - [smooth] Signedness fixes. +2016-08-10 Peter Klotz - * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply. + * src/smooth/ftgrays.c (gray_hline): Fix uninitialized access. -2015-02-22 Werner Lemberg +2016-08-10 Werner Lemberg - * src/raster/ftraster.c: Use the file's typedefs everywhere. + [sfnt] Use correct type for `italicAngle' field (#48732). -2015-02-22 Werner Lemberg + * src/sfnt/ttload.c (tt_face_load_post): Fix types. - * src/sfnt/ttpost.c (load_format_20): Fix error tracing message. +2016-08-06 Jon Spencer - Bug introduced 6 commits earlier. + [sfnt] Fix `FT_Get_Advance' for bitmap strikes. -2015-02-22 Werner Lemberg + `FT_Get_Advance' returns 0 for bitmap fonts. It first gets the + advance value from the font table and then scales it by the + `font->size->metrics->x_scale' field. But `FT_Select_Size' doesn't + set that value for bitmap fonts and the advance gets scaled to zero. - [pshinter] Fix thinko. + Taken from - * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Correctly - check `count'. - Bug introduced two commits earlier. + https://github.com/behdad/harfbuzz/issues/252 -2015-02-22 Werner Lemberg + * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) + : Set scale values. - [raster] Signedness fixes. +2016-08-06 Behdad Esfahbod - * src/raster/ftraster.c, src/raster/ftrend1.c: Apply. + [truetype] Fix GX variation handling of composites. -2015-02-22 Werner Lemberg + * src/truetype/ttgload.c (load_truetype_glyph) + [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check `ARGS_ARE_XY_VALUES' flag. - [pshinter] Signedness fixes. +2016-08-05 Alexei Podtelezhnikov - * src/pshinter/pshalgo.c, src/pshinter/pshglob.c, - src/pshinter/pshrec.c: Apply. + [smooth] Minor refactoring. -2015-02-22 Werner Lemberg - - [pshinter] Use macros for (unsigned) flags, not enumerations. - - * src/pshinter/pshalgo.h (PSH_Hint_Flags): Replace with macros. + * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line): Updated. - * src/pshinter/pshrec.h (PS_Hint_Flags): Replace with macros. -2015-02-22 Werner Lemberg +2016-07-29 Werner Lemberg - * src/pshinter/pshrec.c: Simplify. - (ps_hints_open, ps_hints_stem): Remove switch statement. + [sfnt, truetype] Don't abort on invalid `maxComponentDepth'. -2015-02-22 Werner Lemberg + Since 2016-05-16 we detect infinite recursion directly. - [sfnt] Signedness fixes. + * src/sfnt/ttload.c (tt_face_load_maxp): Don't adjust + `maxComponentDepth'. + * src/truetype/ttgload.c (load_truetype_glyph): Don't abort if + `maxComponentDepth' is not valid. Instead, simply adjust its value + and emit a tracing message. - * src/sfnt/pngshim.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap.c, - src/sfnt/ttkern.c, src/sfnt/ttload.c, src/sfnt/ttpost.c, - src/sfnt/ttsbit.c: Apply. - * src/sfnt/sfdriver.c: Apply. - (sfnt_get_ps_name): Simplify. +2016-07-26 Werner Lemberg -2015-02-22 Werner Lemberg + * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Minor. - [bdf] Signedness fixes. + No functional change. - * src/bdf/bdf.h, src/bdf/bdfdrivr.c, src/bdf/bdfdrivr.h, - src/bdf/bdflib.c: Apply. +2016-07-22 Hin-Tak Leung -2015-02-22 Werner Lemberg + [truetype] Record the end of IDEFs. - * src/bdf/bdflib.c (_bdf_atous): New function. - (_bdf_parse_glyphs, _bdf_parse_start): Use it. + To match the logic in FDEF. The value of the end is only used for + bound-checking in `Ins_JMPR', so it may not have been obvious that + it was not recorded. Tested (as part of Font Validator 2.0) all the + fonts on Fedora and did not see any change. -2015-02-22 Werner Lemberg + * src/truetype/ttinterp.c (Ins_IDEF): Updated. - [pcf] Signedness fixes. +2016-07-19 Werner Lemberg - * src/pcf/pcf.h, src/pcf/pcfdrivr.c: Apply. - * src/pcf/pcfread.c: Apply. - (pcf_get_encodings): Ignore invalid negative encoding offsets. + [truetype] Sanitizer fix, second try. -2015-02-21 Werner Lemberg + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary + tests and use only one slot more. - * src/winfonts/winfnt.c: Signedness fixes. +2016-07-19 Werner Lemberg -2015-02-21 Werner Lemberg + [truetype] Sanitizer fix. - [type42] Signedness fixes. + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Increase array + to fix nested loops. - * src/type42/t42parse.c, src/type42/t42parse.h, - src/type42/t42types.h: Apply. +2016-07-18 Werner Lemberg -2015-02-21 Werner Lemberg + [truetype] Make GETDATA work only for GX fonts. - [pfr] Signedness fixes. + * src/truetype/ttinterp.c (opcode_name): Updated. + (Ins_GETDATA): Only define for `TT_CONFIG_OPTION_GX_VAR_SUPPORT'. + (TT_RunIns): Updated. - * src/pfr/pfrdrivr.c, src/pfr/pfrgload.c, src/pfr/pfrload.c, - src/pfr/pfrload.h, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c, - src/pfr/pfrtypes.h: Apply. +2016-07-17 Werner Lemberg -2015-02-21 Werner Lemberg + [truetype] Add support for Apple's - [cff] Minor signedness fixes related to last commit. + GETDATA[], opcode 0x92 - * src/cff/cf2ft.c, src/cff/cf2intrp.c, src/cff/cffgload.c: Apply. + bytecode instruction. It always returns 17, and we have absolutely + no idea what it is good for... -2015-02-20 Werner Lemberg + * src/truetype/ttinterp.c (Pop_Push_Count, opcode_name): Updated. + (Ins_GETDATA): New function. + (TT_RunIns): Add it. - [cff] Thinkos in bias handling. +2016-07-16 Werner Lemberg - Only the final result is always positive. + [truetype] Add bytecode support for GX variation fonts. - Bug introduced three commits earlier. + This commit implements undocumented (but confirmed) stuff from + Apple's old bytecode engine. - * src/cff/cffgload.c, src/cff/cffgload.h: Apply. + GETVARIATION[], opcode 0x91 + This opcode pushes normalized variation coordinates for all axes + onto the stack (in 2.14 format). Coordinate of first axis gets + pushed first. -2015-02-20 Werner Lemberg + GETINFO[], selector bit 3 + If GX variation support is enabled, bit 10 of the result is set + to 1. - [cid] Fix signedness issues and emit some better error codes. + * src/truetype/ttinterp.c: Include FT_MULTIPLE_MASTERS_H. + (opcode_name) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated. + (Ins_GETINFO) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle selector + bit 3, checking support for variation glyph hinting. + (Ins_GETVARIATION) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New function + to implement opcode 0x91. + (TT_RunIns) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle opcode 0x91. - * src/cid/cidgload.c, src/cid/cidload.h, src/cid/cidobjs.c, - src/cid/cidparse.h: Apply. - * src/cid/cidload.c: Apply. - (parse_fd_array): Reject negative values for number of dictionaries. - * src/cid/cidparse.c: Apply. - (cid_parser_new): Reject negative values for hex data length. +2016-07-16 Werner Lemberg -2015-02-20 Werner Lemberg + [truetype] Fix GETINFO bytecode instruction. - [cff] Signedness fixes for new engine. + * src/truetype/ttinterp.c (Ins_GETINFO): Fix return value for + stretching information. - * src/cff/cf2arrst.c, src/cff/cf2fixed.h, src/cff/cf2ft.c, - src/cff/cf2ft.h, src/cff/cf2hints.c, src/cff/cf2intrp.c: Apply. +2016-07-16 Behdad Esfahbod -2015-02-20 Werner Lemberg + [truetype] Make all glyphs in `Zycon' GX font work. - [cff] Signedness fixes for basic infrastructure and old engine. + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary + tests. - * include/internal/pshints.h, src/cff/cffdrivr.c, - src/cff/cffgload.c, src/cff/cffgload.h, src/cff/cffload.c, - src/cff/cffobjs.c, src/cff/cffparse.c, src/pshinter/pshrec.c: Apply. +2016-07-16 Werner Lemberg -2015-02-19 Werner Lemberg + [truetype] Fix GX delta tracing. - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'. + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Trace + relative point movements. - This is hard-coded to value 2 in `fvar' version 1.0 (and no newer - version exists), but some fonts set it incorrectly. +2016-07-16 Behdad Esfahbod - Problem reported by Adam Twardoch . + [truetype] More fixes for GX. -2015-02-19 Werner Lemberg + This finally fixes the rendering of the cyclist and the lizard in + the `Zycon' font. - [cff] Emit better error code for invalid private dict size. + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): `first' point + index is always cumulative. - * src/cff/cffparse.c (cff_parse_private_dict): Reject negative - values for size and offset. + (tt_handle_deltas): Rename to... + (tt_interpolate_deltas): ... This. + Add new parameter for output point array. + Update caller. -2015-02-19 Werner Lemberg + (TT_Vary_Apply_Glyph_Deltas): Add `points_out' array; it now holds + the intermediate results of `tt_interpolate_deltas' that are to be + added to `outline->points'. - [autofit] Fix signedness issues. +2016-07-15 Werner Lemberg - * src/autofit/afangles.c, src/autofit/afcjk.c, - src/autofit/afglobal.c, src/autofit/afhints.c, - src/autofit/aflatin.c, src/autofit/aflatin2.c, src/autofit/afwarp.c, - src/autofit/hbshim.c: Apply. + * src/autofit/aflatin.c (af_latin_hints_compute_segments): Thinko. -2015-02-19 Werner Lemberg + `max_pos' is always larger than `min_pos' so `FT_ABS' is not needed. - [autofit] Use macros for (unsigned) flags, not enumerations. + Reported by Alexei. - This harmonizes with other code in FreeType (and reduces the number - of necessary casts to avoid compiler warnings). +2016-07-16 Nikolaus Waxweiler - * src/autofit/afblue.hin: Make flag macros unsigned. - * src/autofit/afblue.h: Regenerated. + * src/truetype/ttinterp.c (Ins_MIRP): Fix copy-and-paste error. - * src/autofit/afcjk.h: Replace flag enumeration with macros. - * src/autofit/afcjk.c: Updated. + Problem reported by Hin-Tak Leung. - * src/autofit/afhints.h (AF_Flags, AF_Edge_Flags): Replace with - macros. - * src/autofit/afhints.c: Updated. +2016-07-15 Werner Lemberg - * src/autofit/aflatin.h: Replace flag enumerations with macros. - * src/autofit/aflatin.c, src/autofit/aflatin2.c: Updated. + [autofit] Update and improve segment and edge tracing. - * src/autofit/aftypes.h (AF_ScalerFlags): Replace with macros. + * src/autofit/afhints.c (af_glyph_hints_dump_segments): Trace + `delta' also. + Don't show first point of segment as a replacement for `pos'; this + is (a) misleading, since the difference to `pos' can be almost + arbitrarily large in corner cases, and (b) it is better to have all + segment data in font units instead of a single value given in output + space coordinates. + Improve layout. + (af_glyph_hints_dump_edges): Show px->units and units->px conversion + values for convenience. + Improve layout. -2015-02-18 Werner Lemberg +2016-07-15 Werner Lemberg - [type1] Fix signedness issues. + [autofit] For edges, reject segments wider than 1px (#41334). - * include/internal/psaux.h, include/internal/t1types.h, - src/psaux/psobjs.c, src/psaux/psobjs.h, src/psaux/t1decode.c, - src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1parse.c: Apply. + * src/autofit/afhints.h (AF_SegmentRec): New member `delta'. -2015-02-18 Werner Lemberg + * src/autofit/aflatin.c (af_latin_hints_compute_segments): Compute + `delta'. + (af_latin_hints_compute_edges): Reject segments with a delta larger + than 0.5px. - [psaux, type1] Fix minor AFM issues. +2016-07-14 Werner Lemberg - * include/internal/t1types.h (AFM_KernPairRec): Make indices - unsigned. - Update users. - (AFM_FontInfoRec): Make element counters unsigned. - Update users. - * src/psaux/afmparse.h (AFM_ValueRec): Add union member for unsigned - int. + * include/freetype/freetype.h (FT_IS_NAMED_INSTANCE): New macro. - * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs): - Reject negative values for number of kerning elements. +2016-07-14 Werner Lemberg - * src/type1/t1afm.c, src/tools/test_afm.c: Updated. + [sfnt] Fix `face_index' value in `FT_Face' for named instances. -2015-02-18 Werner Lemberg + * src/sfnt/sfobjc.s (sfnt_init_face): Don't strip off higher 16bits. - Don't use `FT_PtrDist' for lengths. +2016-07-14 Werner Lemberg - Use FT_UInt instead. + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix tracing. - * include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec, - T1_DecoderRec): Do it. +2016-07-14 Behdad Esfahbod - * include/internal/t1types.h (T1_FontRec): Ditto. + [truetype] Fix gxvar delta interpolation. - * src/cid/cidload.c (cid_parse_dict): Updated. - * src/pfr/pfrload.c (pfr_extra_item_load_font_id): Ditto. - * src/psaux/psobjs.c (ps_table_add), src/psaux/psobjs.h: Ditto. - * src/type1/t1load.c (parse_blend_axis_types, parse_encoding, - parse_charstrings, parse_dict): Ditto. - * src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings, - t42_parse_dict): Ditto. + The coordinates of the base font should be used for interpolation + purposes, NOT the current points (i.e., the result of accumulation + of previous deltas). -2015-02-18 Werner Lemberg - - * src/type1/t1driver.c (t1_ps_get_font_value): Clean up. - This handles negative values better, avoiding many casts. - -2015-02-17 Werner Lemberg - - [base] Fix Savannah bug #44284. - - * src/base/ftcalc.c (FT_MulFix): Typos. - -2015-02-17 Werner Lemberg - - [truetype] Finish compiler warning fixes for signedness issues. - - * src/truetype/ttgxvar.c, src/truetype/ttsubpix.c, - src/truetype/ttsubpix.h: Apply. - -2015-02-17 Werner Lemberg - - * src/truetype/ttsubpix.c: Adding missing `static' keywords. - -2015-02-17 Werner Lemberg - - [truetype] More signedness fixes. - - * include/internal/tttypes.h, src/truetype/ttinterp.h, - src/truetype/ttobjs.h, src/truetype/ttinterp.c, - src/truetype/ttobjs.c: Apply. - -2015-02-17 Werner Lemberg - - [truetype] Various signedness fixes. - - * include/internal/ftgloadr.h, src/truetype/ttpload.c: Apply. - - * src/truetype/ttgload.c: Apply. - (TT_Get_VMetrics): Protect against invalid ascenders and descenders - while constructing advance height. - -2015-02-16 Werner Lemberg - - [base] Finish compiler warning fixes for signedness issues. - - * src/base/ftglyph.c, src/base/ftlcdfil.c, src/base/ftstroke.c: - Apply. - -2015-02-16 Werner Lemberg - - * include/tttables.h (TT_OS2): `fsType' must be FT_UShort. - -2015-02-16 Werner Lemberg - - More minor signedness warning fixes. - - * src/base/ftbbox.c, src/base/ftbitmap.c, src/base/fttrigon.c, - src/base/ftutil.c: Apply. - -2015-02-16 Werner Lemberg - - Next round of minor compiler warning fixes. - - * include/internal/ftrfork.h (FT_RFork_Ref): Change `offset' member - type to `FT_Long'. - (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Add `static' keyword. - - * include/internal/ftstream.h (FT_Stream_Pos): Return `FT_ULong'. - - * src/base/ftoutln.c, src/base/ftrfork.c, src/base/ftstream.c: - Signedness fixes. - -2015-02-16 Werner Lemberg - - Various minor signedness fixes. - - * include/ftadvanc.h, include/internal/ftobjs.h, - src/base/ftgloadr.c, src/base/ftobjs.c: Apply. - -2015-02-16 Werner Lemberg - - New `TYPEOF' macro. - - This helps suppress signedness warnings, avoiding issues with - implicit conversion changes. - - * include/config/ftconfig.h, builds/unix/ftconfig.in, - builds/vms/ftconfig.h (TYPEOF): Define. - - * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR), - src/autofit/afwarp.h (AF_WARPER_FLOOR): Use it. - -2015-02-16 Werner Lemberg - - * src/base/ftsystem.c: Use casts in standard C function wrappers. - (ft_alloc, ft_realloc, ft_ansi_stream_io, FT_Stream_Open): Do it. - -2015-02-16 Werner Lemberg - - Fix Savannah bug #44261. - - * builds/unix/detect.mk (setup) [unix]: Set `CONFIG_SHELL' in the - environment also while calling the configure script. - -2015-02-16 Werner Lemberg - - * include/internal/ftmemory.h: Add some `FT_Offset' casts. - (FT_MEM_SET, FT_MEM_COPY, FT_MEM_MOVE, FT_ARRAY_ZERO, FT_ARRAY_COPY, - FT_MEM_MOVE): Do it. - -2015-02-15 Werner Lemberg - - [base] Clean up signedness issues in `ftdbgmem.c'. - - Also fix other minor issues. - - * src/base/ftdbgmem.c (FT_MemTableRec): Replace all FT_ULong types - with FT_Long for consistency. - (ft_mem_primes): Change type to `FT_Int'. - (ft_mem_closest_prime, ft_mem_table_set): Updated. - - (ft_mem_debug_panic, ft_mem_debug_alloc, ft_mem_debug_free, - ft_mem_debug_realloc): Use `static' keyword and fix signedness - warnings where necessary. - - (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_destroy, - ft_mem_table_get_nodep, ft_mem_debug_init, FT_DumpMemory): Fix types - and add or remove casts to avoid signedness warnings. - -2015-02-15 Werner Lemberg - - [base] Clean up signedness in arithmetic functions. - - This makes the code more readable and reduces compiler warnings. - - * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round, FT_MulFix, - FT_DivFix): Convert input parameters to unsigned, do the - computation, then convert the result back to signed. - (ft_corner_orientation): Fix casts. - -2015-02-07 Werner Lemberg - - [sfnt] Fix Savannah bug #44184. - - * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir): No - longer reject `htmx' and `vmtx' tables with invalid length but - sanitize them. - -2015-02-06 Jon Anderson - - [truetype] Fix regression in the incremental glyph loader. - - * src/truetype/ttgload.c (load_truetype_glyph): For incremental - fonts, the glyph index may be greater than the number of glyphs - indicated, so guard the check with a preprocessor conditional. - -2015-02-06 Werner Lemberg - - [autofit] Fix potential memory leak. - - While this doesn't show up with FreeType, exactly the same code - leaks with ttfautohint's modified auto-hinter code (which gets used - in a slightly different way). - - It certainly doesn't harm since it is similar to already existing - checks in the code for embedded arrays. - - * src/autofit/afhints.c (af_glyph_hints_reload): Set `max_contours' - and `max_points' for all cases. - -2015-01-31 Werner Lemberg - - [autofit] Add support for Thai script. - - Thanks to Ben Mitchell for guidance with blue - zone characters! - - * src/autofit/afblue.dat: Add blue zone data for Thai. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Thai standard characters. - - * src/autofit/afranges.c: Add Thai data. - - * src/autofit/afstyles.h: Add Thai data. - -2015-01-23 Behdad Esfahbod - - [raster] Handle `FT_RASTER_FLAG_AA' correctly. - - This fixes a breakage caused by the commit `[raster] Remove - 5-level gray AA mode from monochrome rasterizer.'. - - Problem reported by Markus Trippelsdorf . - - * src/raster/ftraster.c (ft_black_render): Handle - `FT_RASTER_FLAG_AA'. - - * src/raster/ftrend1.c (ft_raster1_render): Remove gray AA mode - remnants. - -2015-01-18 Werner Lemberg - - * src/base/ftobjs.c (FT_New_Library): Fix compiler warning. - -2015-01-18 Chris Liddell - - [raster] Fix Savannah bug #44022. - - Add fallback for glyphs with degenerate bounding boxes. - - If a glyph has only one very narrow feature, the bbox can end up - with either the width or height of the bbox being 0, in which case - no raster memory is allocated and no attempt is made to render the - glyph. This is less than ideal when the drop-out compensation in - the rendering code would actually result in the glyph being - rendered. - - This problem can be observed with the `I' glyph (gid 47) in the - Autodesk RomanS TrueType font. - - * src/raster/ftrend1.c (ft_raster1_render): Add a fallback if either - dimension is zero to explicitly round up/down (instead of simply - round). - -2015-01-17 Werner Lemberg - - Add some tools to handle yearly copyright notice updates. - - We are now following the GNU guidelines: A new release automatically - means that the copyright year of all affected files gets updated; it - is no longer used to track years of modification changes. - - * src/tools/update-copyright-year: New Perl script. - * src/tools/update-copyright: New shell script that calls - `update-copyright-year' on all files. - * src/tools/no-copyright: Exceptions that should not be handled by - `update-copyright' - -2015-01-14 Werner Lemberg - - * docs/CHANGES: Updated, using a description from Behdad. - -2015-01-14 Behdad Esfahbod - - * src/autofit/afmodule.c (af_autofitter_done): Fix compiler warning. - -2015-01-14 Behdad Esfahbod - - [autofit] Add embedded array of segments and edges. - - Avoids multiple mallocs per typical glyphs. - - With this and recent changes to avoid mallocs, the thread-safe - stack-based loader is now as fast as the previous model that had one - cached singleton. - - * src/autofit/afhints.h (AF_SEGMENTS_EMBEDDED, AF_EDGES_EMBEDDED): - New macros. - (AF_AxisHintsRec): Add two arrays for segments and edges. - - * src/autofit/afhints.c (af_axis_hints_new_segment): Only allocate - data if number of segments exceeds given threshold value. - (af_axis_hints_new_edge): Only allocate data if number of edges - exceeds given threshold value. - (af_glyph_hints_done): Updated. - -2015-01-14 Behdad Esfahbod - - [autofit] Add embedded arrays for points and contours. - - This avoids at least two malloc calls for typical glyphs. - - * src/autofit/afhints.h (AF_POINTS_EMBEDDED, AF_CONTOURS_EMBEDDED): - New macros. - (AF_GlyphHintsRec): Add two arrays for contours and points. - - * src/autofit/afhints.c (af_glyph_hints_init, af_glyph_hints_done): - Updated. - (af_glyph_hints_reload): Only allocate data if number of contours or - points exceeds given threshold values. - -2015-01-14 Behdad Esfahbod - - [autofit] Allocate hints object on the stack. - - This avoids one malloc per load. - - * src/autofit/afloader.h (AF_LoaderRec): Change type of `hints' to - `AF_GlyphHints'. - Update prototype. - - * src/autofit/afloader.c (af_loader_init): Use `AF_GlyphHints' - parameter instead of `FT_Memory'. - (af_loader_done): Directly reset `load_hints'. - (af_loader_load_g): Updated. - - * src/autofit/afmodule.c (af_autofitter_load_glyph): Use local - `hints' object. - -2015-01-14 Behdad Esfahbod - - [autofit] Reuse slot glyph loader. - - No need to create a new glyph loader; we can reuse the one from - `slot->internal->loader'. It's hard to tell why it was written that - way originally, but new code looks sound and correct to me, and - avoids lots of allocations. - - * src/autofit/afloader.c (af_loader_init): Change return type to - `void'. - Don't call `FT_GlyphLoader_New'. - (af_loader_reset): Don't call `FT_GlyphLoader_Rewind'. - (af_loader_load_g): Update code to use `internal->loader', which - doesn't need copying of data. - - * src/autofit/afloader.h (AF_LoaderRec): Remove `gloader' member. - Update prototype. - - * src/autofit/afmodule.c (af_autofitter_load_glyph): Updated. - -2015-01-14 Behdad Esfahbod - - [autofit] Remove (unused) support for composite glyphs. - - We never have to deal with composite glyphs in the autohinter, as - those will be loaded into FORMAT_OUTLINE by the recursed - `FT_Load_Glyph' function. - - In the rare cases that FT_LOAD_NO_RECURSE is set, it will imply - FT_LOAD_NO_SCALE as per `FT_Load_Glyph', which then implies - FT_LOAD_NO_HINTING: - - /* resolve load flags dependencies */ - - if ( load_flags & FT_LOAD_NO_RECURSE ) - load_flags |= FT_LOAD_NO_SCALE | - FT_LOAD_IGNORE_TRANSFORM; - - if ( load_flags & FT_LOAD_NO_SCALE ) - { - load_flags |= FT_LOAD_NO_HINTING | - FT_LOAD_NO_BITMAP; - - load_flags &= ~FT_LOAD_RENDER; - } - - and as such the auto-hinter is never called. Thus, the recursion in - `af_loader_load_g' never actually happens. So remove the depth - counter as well. - - * src/autofit/afloader.c (af_loader_load_g): Remove `depth' - parameter. - : Remove associated code. - (af_loader_load_glyph): Updated. - -2015-01-14 Behdad Esfahbod - - [raster] Fix uninitialized memory access. - - Apparently `ras.cProfile' might be uninitialized. This will be the - case if `ras.top == ras.cProfile->offset', as can be seen in - `End_Profile'. The overshoot code introduced in a change `Fix B/W - rasterization of subglyphs with different drop-out modes.' (from - 2009-06-18) violated this, accessing `ras.cProfile->flags' - unconditionally just before calling `End_Profile' (which then - detected that `cProfile' is uninitialized and didn't touch it). - - This was harmless, and was not detected by valgrind before because - the objects were allocated on the `raster_pool', which was always - initialized. With recent change to allocate raster buffers on the - stack, valgrind now reported this invalid access. - - * src/raster/ftraster.c (Convert_Glyph): Don't access an - uninitialized `cProfile'. - -2015-01-14 Behdad Esfahbod - - [smooth] Fix uninitialized memory access. - - Looks like `ras.span_y' could always be used without initialization. - This was never detected by valgrind before because the library-wide - `raster_pool' was used for the worker object and `raster_pool' was - originally zero'ed. But subsequent reuses of it were using `span_y' - uninitialized. With the recent change to not use `render_pool' and - allocate worker and buffer on the stack, valgrind now detects this - uninitialized access. - - * src/smooth/ftgrays.c (gray_raster_render): Initialize - `ras.span_y'. - -2015-01-14 Behdad Esfahbod - - [base] Don't initialize unused `driver->glyph_loader'. - - * src/base/ftobjs.c (Destroy_Driver): Don't call - `FT_GlyphLoader_Done'. - (FT_Add_Module): Don't call `FT_GlyphLoader_New'. - -2015-01-14 Behdad Esfahbod - - [base] Don't allocate `library->raster_pool' anymore. - - It's unused after the following commits: - - [raster] Allocate render pool for mono rasterizer on the stack. - [raster] Remove 5-level gray AA mode from monochrome rasterizer. - - The value of FT_RENDER_POOL_SIZE still serves the purpose it used to - serve, which is, to adjust the pool size. But the pool is now - allocated on the stack on demand. - - * src/base/ftobjs.c (FT_New_Library, FT_Done_Library): Implement. - -2015-01-14 Behdad Esfahbod - - [base] Do not reorder library->renderers upon use. - - Instead of keeping `library->renderers' in a MRU order, just leave - it as-is. The MRU machinery wasn't thread-safe. - - With this patch, rasterizing glyphs from different faces from - different threads doesn't fail choosing rasterizer - (FT_Err_Cannot_Render_Glyph). - - Easiest to see that crash was to add a `printf' (or otherwise let - thread yield in FT_Throw with debugging enabled). - - * src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c - (FT_Outline_Render): Don't call `FT_Set_Renderer'. - -2015-01-14 Behdad Esfahbod - - [raster] Allocate render pool for mono rasterizer on the stack. - - Instead of using the `render_pool' member of `FT_Library' that is - provided down to the rasterizer, completely ignore that and allocate - needed objects on the stack instead. - - With this patch, rasterizing glyphs from different faces from - different threads doesn't crash in the monochrome rasterizer. - - * src/raster/ftraster.c (black_TRaster): Remove `buffer', - `buffer_size', and `worker' members. - - (ft_black_render): Create `buffer' locally. - (ft_black_reset): Updated. - -2015-01-14 Behdad Esfahbod - - [raster] Remove 5-level gray AA mode from monochrome rasterizer. - - It was off by default and couldn't be turned on at runtime. And the - smooth rasterizer superceded it over ten years ago. No point in - keeping. Comments suggested that it was there for compatibility - with FreeType 1. - - 550 lines down. - - * src/raster/ftraster.c (FT_RASTER_OPTION_ANTI_ALIASING, - RASTER_GRAY_LINES): Remove macros and all associated code. - - (black_TWorker): Remove `gray_min_x' and `gray_max_x'. - (black_TRaster): Remove `grays' and `gray_width'. - - (Vertical_Sweep_Init, Vertical_Sweep_Span, Vertical_Sweep_Drop, - ft_black_render): Updated. - - * src/raster/ftrend1.c (ft_raster1_render): Simplify code. - (ft_raster5_renderer_class): Removed. - -2015-01-14 Behdad Esfahbod - - [smooth] Allocate render pool for smooth rasterizer on the stack. - - Instead of using the `render_pool' member of `FT_Library' that is - provided down to the rasterizer, completely ignore that and allocate - needed objects on the stack instead. - - With this patch, rasterizing glyphs from different faces from - different threads doesn't crash in the smooth rasterizer. - - Bugs: - - https://bugzilla.redhat.com/show_bug.cgi?id=678397 - https://bugzilla.redhat.com/show_bug.cgi?id=1004315 - https://bugzilla.redhat.com/show_bug.cgi?id=1165471 - https://bugs.freedesktop.org/show_bug.cgi?id=69034 - - * src/smooth/ftgrays.c (gray_TRaster): Remove `buffer', - `buffer_size', `band_size', and `worker' members. - - (gray_raster_render): Create `buffer', `buffer_size', and - `band_size' locally. - (gray_raster_reset): Updated. - -2015-01-14 Behdad Esfahbod - - [truetype] Allocate TT_ExecContext in TT_Size instead of TT_Driver. - - Previously the code had stipulation for using a per-TT_Size exec - context if `size->debug' was true. But there was no way that - `size->debug' could *ever* be true. As such, the code was always - using the singleton `TT_ExecContext' that was stored in `TT_Driver'. - This was, clearly, not threadsafe. - - With this patch, loading glyphs from different faces from different - threads doesn't crash in the bytecode loader code. - - * src/truetype/ttobjs.h (TT_SizeRec): Remove `debug' member. - (TT_DriverRec): Remove `context' member. - - * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Remove - `TT_ExecContext' code related to a global `TT_Driver' object. - - (tt_driver_done): Don't remove `TT_ExecContext' object here but ... - (tt_size_done_bytecode): ... here. - - (tt_driver_init): Don't create `TT_ExecContext' object here but ... - (tt_size_init_bytecode): ... here, only on demand. - - * src/truetype/ttinterp.c (TT_Run_Context): Remove defunct debug - code. - (TT_New_Context): Remove `TT_ExecContext' code related to a global - `TT_Driver' object. - - * src/truetype/ttinterp.h: Updated. - - * src/truetype/ttgload.c (TT_Hint_Glyph, tt_loader_init): Updated. - -2015-01-14 Behdad Esfahbod - - [autofit] Allocate AF_Loader on the stack instead of AF_Module. - - Stop sharing a global `AF_Loader'. Allocate one on the stack during - glyph load. - - Right now this results in about 25% slowdown, to be fixed in a - following commit. - - With this patch loading glyphs from different faces from different - threads doesn't immediately crash in the autohinting loader code. - - Bugs: - - https://bugzilla.redhat.com/show_bug.cgi?id=1164941 - - * src/autofit/afloader.c (af_loader_init): Pass - `AF_Loader' and `FT_Memory' instead of `AF_Module' as arguments. - (af_loader_reset, af_loader_load_glyph): Also pass `loader' as - argument. - (af_loader_done): Use `AF_Loader' instead of `AF_Module' as - argument. - - * src/autofit/afmodule.c (af_autofitter_init): Don't call - `af_loader_init'. - (af_autofitter_done): Don't call `af_loader_done'. - (af_autofitter_load_glyph): Use a local `AF_Loader' object. - - * src/autofit/afloader.h: Include `afmodule.h'. - Update prototypes. - Move typedef for `AF_Module' to... - - * src/autofit/afmodule.h: ... this place. - No longer include `afloader.h'. - -2015-01-14 Behdad Esfahbod - - * src/type42/t42objs.h (T42_DriverRec): Remove unused member. - -2015-01-12 Werner Lemberg - - Fix Savannah bug #43976. - - Assure that FreeType's internal include directories are found before - `CPPFLAGS' (which might be set by the user in the environment), and - `CPPFLAGS' before `CFLAGS'. - - * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'. - (FT_COMPILE): Make this a special variable for compiling only the - files handled in `freetype.mk'. - (.c.$O): Removed, unused. - - * src/*/rules.mk (*_COMPILE): Fix order of include directories. - -2015-01-11 Werner Lemberg - - [truetype] Prettifying. - - * src/truetype/ttinterp.c (project, dualproj, fast_project, - fast_dualproj): Rename to... - (PROJECT, DUALPROJ, FAST_PROJECT, FAST_DUALPROJ): ... this. - -2015-01-11 Werner Lemberg - - * src/truetype/ttinterp.c (Ins_JROT, Ins_JROF): Simplify. - - Based on a patch from Behdad. - -2015-01-11 Werner Lemberg - - * src/truetype/ttinterp.c (Ins_SxVTL): Simplify function call. - -2015-01-11 Werner Lemberg - - * src/truetype/ttinterp.c (Normalize): Remove unused argument. - -2015-01-11 Werner Lemberg - - [truetype] More macro expansions. - - * src/truetype/ttinterp.c (FT_UNUSED_EXEC): Remove macro by - expansion. - -2015-01-11 Werner Lemberg - - [truetype] More macro expansions. - - * src/truetype/ttinterp.c (INS_ARG): Remove macro by expansion, - adjusting function calls where necessary. - (FT_UNUSED_ARG): Removed, no longer needed. - -2015-01-10 Werner Lemberg - - [truetype] More macro expansions. - - Based on a patch from Behdad. - - * src/truetype/ttinterp.c (DO_*): Expand macros into corresponding - `Ins_*' functions. - (TT_RunIns): Replace `DO_*' macros with `Ins_*' function calls. - (ARRAY_BOUND_ERROR): Remove second definition, which is no longer - needed. - (Ins_SVTCA, Ins_SPVTCA, Ins_SFVTCA): Replaced with... - (Ins_SxyTCA): New function. - -2015-01-10 Werner Lemberg - - [truetype] Remove TT_CONFIG_OPTION_INTERPRETER_SWITCH. - - Behdad suggested this code simplification, and nobody objected... - - * include/config/ftoption.h, devel/ftoption.h - (TT_CONFIG_OPTION_INTERPRETER_SWITCH): Remove. - - * src/truetype/ttinterp.c [TT_CONFIG_OPTION_INTERPRETER_SWITCH]: - Remove related code. - (ARRAY_BOUND_ERROR): Use do-while loop. - -2015-01-10 Werner Lemberg - - [truetype] More macro expansions. - - * src/truetype/ttinterp.c, src/truetype/ttinterp.h (EXEC_ARG_, - EXEC_ARG): Remove by replacing with expansion. - -2015-01-10 Werner Lemberg - - [truetype] More macro expansions. - - Based on a patch from Behdad. - - * src/truetype/ttinterp.c (SKIP_Code, GET_ShortIns, NORMalize, - SET_SuperRound, ROUND_None, INS_Goto_CodeRange, CUR_Func_move, - CUR_Func_move_orig, CUR_Func_round, CUR_Func_cur_ppem, - CUR_Func_read_cvt, CUR_Func_write_cvt, CUR_Func_move_cvt, - CURRENT_Ratio, INS_SxVTL, COMPUTE_Funcs, COMPUTE_Round, - COMPUTE_Point_Displacement, MOVE_Zp2_Point): Remove by replacing - with expansion. - - (Cur_Func_project, CUR_Func_dualproj, CUR_fast_project, - CUR_fast_dualproj): Replace with macros `project', `dualproj', - `fast_project', `fast_dualproj'. - -2015-01-10 Werner Lemberg - - [truetype] More macro expansions. - - * src/truetype/ttinterp.c (EXEC_OP_, EXEC_OP): Remove by replacing - with expansion. - -2015-01-10 Werner Lemberg - - [truetype] Remove code for static TrueType interpreter. - - This is a follow-up patch. - - * src/truetype/ttinterp.c, src/truetype/ttinterp.h - [TT_CONFIG_OPTION_STATIC_INTERPRETER, - TT_CONFIG_OPTION_STATIC_RASTER]: Remove macros and related code. - -2015-01-10 Werner Lemberg - - * src/truetype/ttinterp.c (CUR): Remove by replacing with expansion. - - This starts a series of patches that simplifies the code of the - bytecode interpreter. + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize + `points_org' before looping over all tuples. ---------------------------------------------------------------------------- -Copyright 2015-2016 by +Copyright 2016 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, diff --git a/reactos/sdk/lib/3rdparty/freetype/README b/reactos/sdk/lib/3rdparty/freetype/README index 09a203ab718..5a49290bb22 100644 --- a/reactos/sdk/lib/3rdparty/freetype/README +++ b/reactos/sdk/lib/3rdparty/freetype/README @@ -1,5 +1,5 @@ - FreeType 2.6.4 - ============== + FreeType 2.7 + ============ Homepage: http://www.freetype.org @@ -24,9 +24,9 @@ and download one of the following files. - freetype-doc-2.6.4.tar.bz2 - freetype-doc-2.6.4.tar.gz - ftdoc264.zip + freetype-doc-2.7.tar.bz2 + freetype-doc-2.7.tar.gz + ftdoc27.zip To view the documentation online, go to diff --git a/reactos/sdk/lib/3rdparty/freetype/devel/ftoption.h b/reactos/sdk/lib/3rdparty/freetype/devel/ftoption.h index d20df81ed8b..af8894adb8a 100644 --- a/reactos/sdk/lib/3rdparty/freetype/devel/ftoption.h +++ b/reactos/sdk/lib/3rdparty/freetype/devel/ftoption.h @@ -75,6 +75,36 @@ FT_BEGIN_HEADER /*************************************************************************/ + /*************************************************************************/ + /* */ + /* If you enable this configuration option, FreeType recognizes an */ + /* environment variable called `FREETYPE_PROPERTIES', which can be used */ + /* to control the various font drivers and modules. The controllable */ + /* properties are listed in the section `Controlling FreeType Modules' */ + /* in the reference's table of contents; currently there are properties */ + /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */ + /* TrueType (file `ftttdrv.h'). */ + /* */ + /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */ + /* multiple lines for better readability). */ + /* */ + /* */ + /* ':' */ + /* '=' */ + /* */ + /* ':' */ + /* '=' */ + /* ... */ + /* */ + /* Example: */ + /* */ + /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */ + /* cff:no-stem-darkening=1 \ */ + /* autofitter:warping=1 */ + /* */ +//#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + + /*************************************************************************/ /* */ /* Uncomment the line below if you want to activate sub-pixel rendering */ @@ -492,7 +522,21 @@ FT_BEGIN_HEADER /* code will be used. */ /* */ /* Setting this macro is needed for systems that prohibit address */ - /* fixups, such as BREW. */ + /* fixups, such as BREW. [Note that standard compilers like gcc or */ + /* clang handle PIC generation automatically; you don't have to set */ + /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */ + /* compilers.] */ + /* */ + /* Note that FT_CONFIG_OPTION_PIC support is not available for all */ + /* modules (see `modules.cfg' for a complete list). For building with */ + /* FT_CONFIG_OPTION_PIC support, do the following. */ + /* */ + /* 0. Clone the repository. */ + /* 1. Define FT_CONFIG_OPTION_PIC. */ + /* 2. Remove all subdirectories in `src' that don't have */ + /* FT_CONFIG_OPTION_PIC support. */ + /* 3. Comment out the corresponding modules in `modules.cfg'. */ + /* 4. Compile. */ /* */ /* #define FT_CONFIG_OPTION_PIC */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftoption.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftoption.h index 7dd3f55e572..2769ecd4578 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftoption.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftoption.h @@ -75,6 +75,36 @@ FT_BEGIN_HEADER /*************************************************************************/ + /*************************************************************************/ + /* */ + /* If you enable this configuration option, FreeType recognizes an */ + /* environment variable called `FREETYPE_PROPERTIES', which can be used */ + /* to control the various font drivers and modules. The controllable */ + /* properties are listed in the section `Controlling FreeType Modules' */ + /* in the reference's table of contents; currently there are properties */ + /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */ + /* TrueType (file `ftttdrv.h'). */ + /* */ + /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */ + /* multiple lines for better readability). */ + /* */ + /* */ + /* ':' */ + /* '=' */ + /* */ + /* ':' */ + /* '=' */ + /* ... */ + /* */ + /* Example: */ + /* */ + /* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ */ + /* cff:no-stem-darkening=1 \ */ + /* autofitter:warping=1 */ + /* */ +//#define FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + + /*************************************************************************/ /* */ /* Uncomment the line below if you want to activate sub-pixel rendering */ @@ -492,7 +522,21 @@ FT_BEGIN_HEADER /* code will be used. */ /* */ /* Setting this macro is needed for systems that prohibit address */ - /* fixups, such as BREW. */ + /* fixups, such as BREW. [Note that standard compilers like gcc or */ + /* clang handle PIC generation automatically; you don't have to set */ + /* FT_CONFIG_OPTION_PIC, which is only necessary for very special */ + /* compilers.] */ + /* */ + /* Note that FT_CONFIG_OPTION_PIC support is not available for all */ + /* modules (see `modules.cfg' for a complete list). For building with */ + /* FT_CONFIG_OPTION_PIC support, do the following. */ + /* */ + /* 0. Clone the repository. */ + /* 1. Define FT_CONFIG_OPTION_PIC. */ + /* 2. Remove all subdirectories in `src' that don't have */ + /* FT_CONFIG_OPTION_PIC support. */ + /* 3. Comment out the corresponding modules in `modules.cfg'. */ + /* 4. Compile. */ /* */ /* #define FT_CONFIG_OPTION_PIC */ @@ -630,8 +674,8 @@ FT_BEGIN_HEADER /* */ /* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */ /* */ -/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */ -#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 +/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */ +#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 /* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h index 562e255810b..6eefa9f86df 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h @@ -142,7 +142,8 @@ /**********************************************************************/ -#define ft_atol atol +#define ft_strtol strtol +#define ft_getenv getenv /**********************************************************************/ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/freetype.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/freetype.h index 7baf185ce1d..3a50734beb4 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/freetype.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/freetype.h @@ -1358,6 +1358,20 @@ FT_BEGIN_HEADER ( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) + /************************************************************************* + * + * @macro: + * FT_IS_NAMED_INSTANCE( face ) + * + * @description: + * A macro that returns true whenever a face object is a named instance + * of a GX variation font. + * + */ +#define FT_IS_NAMED_INSTANCE( face ) \ + ( (face)->face_index & 0x7FFF0000L ) + + /************************************************************************* * * @macro: @@ -2331,13 +2345,22 @@ FT_BEGIN_HEADER /* FT_Size_Request_Type */ /* */ /* */ - /* An enumeration type that lists the supported size request types. */ + /* An enumeration type that lists the supported size request types, */ + /* i.e., what input size (in font units) maps to the requested output */ + /* size (in pixels, as computed from the arguments of */ + /* @FT_Size_Request). */ /* */ /* */ /* FT_SIZE_REQUEST_TYPE_NOMINAL :: */ /* The nominal size. The `units_per_EM' field of @FT_FaceRec is */ /* used to determine both scaling values. */ /* */ + /* This is the standard scaling found in most applications. In */ + /* particular, use this size request type for TrueType fonts if */ + /* they provide optical scaling or something similar. Note, */ + /* however, that `units_per_EM' is a rather abstract value which */ + /* bears no relation to the actual size of the glyphs in a font. */ + /* */ /* FT_SIZE_REQUEST_TYPE_REAL_DIM :: */ /* The real dimension. The sum of the `ascender' and (minus of) */ /* the `descender' fields of @FT_FaceRec are used to determine both */ @@ -2391,22 +2414,29 @@ FT_BEGIN_HEADER /* */ /* type :: See @FT_Size_Request_Type. */ /* */ - /* width :: The desired width. */ + /* width :: The desired width, given as a 26.6 fractional */ + /* point value (with 72pt = 1in). */ /* */ - /* height :: The desired height. */ + /* height :: The desired height, given as a 26.6 fractional */ + /* point value (with 72pt = 1in). */ /* */ - /* horiResolution :: The horizontal resolution. If set to zero, */ - /* `width' is treated as a 26.6 fractional pixel */ - /* value. */ + /* horiResolution :: The horizontal resolution (dpi, i.e., pixels per */ + /* inch). If set to zero, `width' is treated as a */ + /* 26.6 fractional *pixel* value. */ /* */ - /* vertResolution :: The vertical resolution. If set to zero, */ - /* `height' is treated as a 26.6 fractional pixel */ - /* value. */ + /* vertResolution :: The vertical resolution (dpi, i.e., pixels per */ + /* inch). If set to zero, `height' is treated as a */ + /* 26.6 fractional *pixel* value. */ /* */ /* */ /* If `width' is zero, then the horizontal scaling value is set equal */ /* to the vertical scaling value, and vice versa. */ /* */ + /* If `type' is FT_SIZE_REQUEST_TYPE_SCALES, `width' and `height' are */ + /* interpreted directly as 16.16 fractional scaling values, without */ + /* any further modification, and both `horiResolution' and */ + /* `vertResolution' are ignored. */ + /* */ typedef struct FT_Size_RequestRec_ { FT_Size_Request_Type type; @@ -4175,8 +4205,8 @@ FT_BEGIN_HEADER * */ #define FREETYPE_MAJOR 2 -#define FREETYPE_MINOR 6 -#define FREETYPE_PATCH 4 +#define FREETYPE_MINOR 7 +#define FREETYPE_PATCH 0 /*************************************************************************/ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftautoh.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftautoh.h index 40c8003c4aa..48ff1aa26e4 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftautoh.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftautoh.h @@ -428,6 +428,9 @@ FT_BEGIN_HEADER * @note: * This property can be used with @FT_Property_Get also. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable (using values 1 and 0 for `on' and `off', respectively). + * * The warping code can also change advance widths. Have a look at the * `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure * for details on improving inter-glyph distances while rendering. @@ -473,6 +476,9 @@ FT_BEGIN_HEADER * The smaller the size (especially 9ppem and down), the higher the loss * of emboldening versus the CFF driver. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable similar to the CFF driver. + * */ @@ -489,6 +495,8 @@ FT_BEGIN_HEADER * CFF_CONFIG_OPTION_DARKENING_PARAMETER_* #defines for consistency. * Note the differences described in @no-stem-darkening[autofit]. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable similar to the CFF driver. */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftcffdrv.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftcffdrv.h index ad34541fdb1..8f88cc48fd4 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftcffdrv.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftcffdrv.h @@ -148,6 +148,8 @@ FT_BEGIN_HEADER * @note: * This property can be used with @FT_Property_Get also. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable (using values `adobe' or `freetype'). */ @@ -199,6 +201,9 @@ FT_BEGIN_HEADER * @note: * This property can be used with @FT_Property_Get also. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable (using values 1 and 0 for `on' and `off', respectively). + * */ @@ -248,6 +253,14 @@ FT_BEGIN_HEADER * @note: * This property can be used with @FT_Property_Get also. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable, using eight comma-separated integers without spaces. Here + * the above example, using `\' to break the line for readability. + * + * { + * FREETYPE_PROPERTIES=\ + * cff:darkening-parameters=500,300,1000,200,1500,100,2000,0 + * } */ /* */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftimage.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftimage.h index 28b2704e80e..4f86c560fb3 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftimage.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftimage.h @@ -860,16 +860,6 @@ FT_BEGIN_HEADER /* This can be used to write anti-aliased outlines directly to a */ /* given background bitmap, and even perform translucency. */ /* */ - /* Note that the `count' field cannot be greater than a fixed value */ - /* defined by the `FT_MAX_GRAY_SPANS' configuration macro in */ - /* `ftoption.h'. By default, this value is set to~32, which means */ - /* that if there are more than 32~spans on a given scanline, the */ - /* callback is called several times with the same `y' parameter in */ - /* order to draw all callbacks. */ - /* */ - /* Otherwise, the callback is only called once per scan-line, and */ - /* only for those scanlines that do have `gray' pixels on them. */ - /* */ typedef void (*FT_SpanFunc)( int y, int count, diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftmm.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftmm.h index 6c05f0c3909..b5d68589a09 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftmm.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftmm.h @@ -195,11 +195,15 @@ FT_BEGIN_HEADER /* (where every glyph could have a different */ /* number of designs). */ /* */ - /* num_namedstyles :: The number of named styles; only meaningful for */ - /* GX that allows certain design coordinates to */ - /* have a string ID (in the `name' table) */ - /* associated with them. The font can tell the */ - /* user that, for example, Weight=1.5 is `Bold'. */ + /* num_namedstyles :: The number of named styles; a `named style' is */ + /* a tuple of design coordinates that has a string */ + /* ID (in the `name' table) associated with it. */ + /* The font can tell the user that, for example, */ + /* [Weight=1.5,Width=1.1] is `Bold'. */ + /* */ + /* For Type 1 Multiple Masters fonts, this value */ + /* is always zero because the format does not */ + /* support named styles. */ /* */ /* axis :: An axis descriptor table. */ /* GX fonts contain slightly more data than MM. */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftoutln.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftoutln.h index 6a6451207c5..ef66d48c8d4 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftoutln.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftoutln.h @@ -115,6 +115,10 @@ FT_BEGIN_HEADER /* outline for stroking purposes (otherwise it would result in a */ /* visible dot when round caps are used). */ /* */ + /* Similarly, the function returns success for an empty outline also */ + /* (doing nothing, this is, not calling any emitter); if necessary, */ + /* you should filter this out, too. */ + /* */ FT_EXPORT( FT_Error ) FT_Outline_Decompose( FT_Outline* outline, const FT_Outline_Funcs* func_interface, @@ -213,6 +217,10 @@ FT_BEGIN_HEADER /* */ /* FreeType error code. 0~means success. */ /* */ + /* */ + /* An empty outline, or an outline with a single point only is also */ + /* valid. */ + /* */ FT_EXPORT( FT_Error ) FT_Outline_Check( FT_Outline* outline ); diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftttdrv.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftttdrv.h index 0d868bc2590..22186ee4a5a 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftttdrv.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/ftttdrv.h @@ -181,6 +181,8 @@ FT_BEGIN_HEADER * @note: * This property can be used with @FT_Property_Get also. * + * This property can be set via the `FREETYPE_PROPERTIES' environment + * variable (using values `35', `38', or `40'). */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h index 3e1e66e9798..902f02fd9d6 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h @@ -67,15 +67,6 @@ FT_BEGIN_HEADER FT_Int32 load_flags ); - typedef FT_UInt - (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap, - FT_Long charcode ); - - typedef FT_Long - (*FT_CharMap_CharNextFunc)( FT_CharMap charmap, - FT_Long charcode ); - - typedef FT_Error (*FT_Face_GetKerningFunc)( FT_Face face, FT_UInt left_glyph, diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h index 8c06fc21a5e..fc33b2f50da 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h @@ -108,10 +108,12 @@ extern "C++" /* * The allocation functions return a pointer, and the error code - * is written to through the `p_error' parameter. See below for - * for documentation. + * is written to through the `p_error' parameter. */ + /* The `q' variants of the functions below (`q' for `quick') don't fill */ + /* the allocated or reallocated memory with zero bytes. */ + FT_BASE( FT_Pointer ) ft_mem_alloc( FT_Memory memory, FT_Long size, @@ -143,6 +145,9 @@ extern "C++" const void* P ); + /* The `Q' variants of the macros below (`Q' for `quick') don't fill */ + /* the allocated or reallocated memory with zero bytes. */ + #define FT_MEM_ALLOC( ptr, size ) \ FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \ (FT_Long)(size), \ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h index e3fa32083be..0a9f2d4eeac 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h @@ -532,6 +532,14 @@ FT_BEGIN_HEADER ft_module_get_service( FT_Module module, const char* service_id ); +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_BASE( FT_Error ) + ft_property_string_set( FT_Library library, + const FT_String* module_name, + const FT_String* property_name, + FT_String* value ); +#endif + /* */ diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h index 870e90ed7cf..75e62446b25 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h @@ -29,7 +29,8 @@ FT_BEGIN_HEADER typedef FT_Error (*FT_Properties_SetFunc)( FT_Module module, const char* property_name, - const void* value ); + const void* value, + FT_Bool value_is_string ); typedef FT_Error (*FT_Properties_GetFunc)( FT_Module module, diff --git a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/tttypes.h b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/tttypes.h index 4110d50285e..4ed980be8d0 100644 --- a/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/tttypes.h +++ b/reactos/sdk/lib/3rdparty/freetype/include/freetype/internal/tttypes.h @@ -1393,6 +1393,12 @@ FT_BEGIN_HEADER FT_Bool sph_compatibility_mode; #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + /* since 2.7 */ + FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */ + FT_ULong ebdt_size; +#endif + } TT_FaceRec; diff --git a/reactos/sdk/lib/3rdparty/freetype/modules.cfg b/reactos/sdk/lib/3rdparty/freetype/modules.cfg index d677565a2bc..f30049c38cc 100644 --- a/reactos/sdk/lib/3rdparty/freetype/modules.cfg +++ b/reactos/sdk/lib/3rdparty/freetype/modules.cfg @@ -37,6 +37,7 @@ FONT_MODULES += truetype # PostScript Type 1 font driver. # # This driver needs the `psaux', `pshinter', and `psnames' modules. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += type1 # CFF/OpenType font driver. @@ -47,24 +48,30 @@ FONT_MODULES += cff # Type 1 CID-keyed font driver. # # This driver needs the `psaux', `pshinter', and `psnames' modules. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += cid # PFR/TrueDoc font driver. See optional extension ftpfr.c below also. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += pfr # PostScript Type 42 font driver. # # This driver needs the `truetype' and `psaux' modules. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += type42 # Windows FONT/FNT font driver. See optional extension ftwinfnt.c below # also. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += winfonts # PCF font driver. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += pcf # BDF font driver. See optional extension ftbdf.c below also. +# No FT_CONFIG_OPTION_PIC support. FONT_MODULES += bdf # SFNT files support. If used without `truetype' or `cff', it supports @@ -107,33 +114,41 @@ RASTER_MODULES += smooth # FreeType's cache sub-system (quite stable but still in beta -- this means # that its public API is subject to change if necessary). See # include/freetype/ftcache.h. Needs ftglyph.c. +# No FT_CONFIG_OPTION_PIC support. AUX_MODULES += cache # TrueType GX/AAT table validation. Needs ftgxval.c below. +# +# No FT_CONFIG_OPTION_PIC support. # AUX_MODULES += gxvalid # Support for streams compressed with gzip (files with suffix .gz). # # See include/freetype/ftgzip.h for the API. +# No FT_CONFIG_OPTION_PIC support. AUX_MODULES += gzip # Support for streams compressed with LZW (files with suffix .Z). # # See include/freetype/ftlzw.h for the API. +# No FT_CONFIG_OPTION_PIC support. AUX_MODULES += lzw # Support for streams compressed with bzip2 (files with suffix .bz2). # # See include/freetype/ftbzip2.h for the API. +# No FT_CONFIG_OPTION_PIC support. AUX_MODULES += bzip2 # OpenType table validation. Needs ftotval.c below. # +# No FT_CONFIG_OPTION_PIC support. # AUX_MODULES += otvalid # Auxiliary PostScript driver component to share common code. # # This module depends on `psnames'. +# No FT_CONFIG_OPTION_PIC support. AUX_MODULES += psaux # Support for PostScript glyph names. diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.c b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.c index 95786ed6f2b..7719c02caab 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.c @@ -32,13 +32,13 @@ '\0', '\xD9', '\x80', /* Ů€ */ '\0', - '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x93', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ô± Ő„ Ő’ Ő“ Ô˛ Ôł Ô´ Ő• */ + '\xD4', '\xB1', ' ', '\xD5', '\x84', ' ', '\xD5', '\x92', ' ', '\xD5', '\x8D', ' ', '\xD4', '\xB2', ' ', '\xD4', '\xB3', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x95', /* Ô± Ő„ Ő’ ŐŤ Ô˛ Ôł Ô´ Ő• */ '\0', - '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD5', '\x93', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Ő’ Ő Ő“ Ő Ő‡ ŐŤ ŐŹ Ő• */ + '\xD5', '\x92', ' ', '\xD5', '\x88', ' ', '\xD4', '\xB4', ' ', '\xD5', '\x83', ' ', '\xD5', '\x87', ' ', '\xD5', '\x8D', ' ', '\xD5', '\x8F', ' ', '\xD5', '\x95', /* Ő’ Ő Ô´ Ő Ő‡ ŐŤ ŐŹ Ő• */ '\0', - '\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x83', ' ', '\xD6', '\x86', ' ', '\xD6', '\x83', /* ŐĄ Ő§ Ő« Ő´ Őľ Ö Ö† Ö */ + '\xD5', '\xA5', ' ', '\xD5', '\xA7', ' ', '\xD5', '\xAB', ' ', '\xD5', '\xB4', ' ', '\xD5', '\xBE', ' ', '\xD6', '\x86', ' ', '\xD5', '\xB3', /* ŐĄ Ő§ Ő« Ő´ Őľ Ö† Őł */ '\0', - '\xD5', '\xA1', ' ', '\xD5', '\xB5', ' ', '\xD6', '\x82', ' ', '\xD5', '\xBD', ' ', '\xD5', '\xA3', ' ', '\xD5', '\xBB', ' ', '\xD6', '\x80', ' ', '\xD6', '\x85', /* Őˇ Őµ Ö‚ Ő˝ ŐŁ Ő» Ö€ Ö… */ + '\xD5', '\xA1', ' ', '\xD5', '\xB5', ' ', '\xD6', '\x82', ' ', '\xD5', '\xBD', ' ', '\xD5', '\xA3', ' ', '\xD5', '\xB7', ' ', '\xD6', '\x80', ' ', '\xD6', '\x85', /* Őˇ Őµ Ö‚ Ő˝ ŐŁ Ő· Ö€ Ö… */ '\0', '\xD5', '\xB0', ' ', '\xD5', '\xB8', ' ', '\xD5', '\xB3', ' ', '\xD5', '\xA1', ' ', '\xD5', '\xA5', ' ', '\xD5', '\xAE', ' ', '\xD5', '\xBD', ' ', '\xD6', '\x85', /* Ő° Ő¸ Őł Őˇ ŐĄ Ő® Ő˝ Ö… */ '\0', diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.dat b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.dat index 0734ec71f00..f5f04f28982 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.dat +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.dat @@ -87,13 +87,13 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: "Ů€" AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP - "Ô± Ő„ Ő’ Ő“ Ô˛ Ôł Ô´ Ő•" + "Ô± Ő„ Ő’ ŐŤ Ô˛ Ôł Ô´ Ő•" AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM - "Ő’ Ő Ő“ Ő Ő‡ ŐŤ ŐŹ Ő•" + "Ő’ Ő Ô´ Ő Ő‡ ŐŤ ŐŹ Ő•" AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER - "ŐĄ Ő§ Ő« Ő´ Őľ Ö Ö† Ö" + "ŐĄ Ő§ Ő« Ő´ Őľ Ö† Őł" AF_BLUE_STRING_ARMENIAN_SMALL_TOP - "Őˇ Őµ Ö‚ Ő˝ ŐŁ Ő» Ö€ Ö…" + "Őˇ Őµ Ö‚ Ő˝ ŐŁ Ő· Ö€ Ö…" AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM "Ő° Ő¸ Őł Őˇ ŐĄ Ő® Ő˝ Ö…" AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.h b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.h index 41f838e4577..75c3ab50834 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.h +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afblue.h @@ -83,104 +83,104 @@ FT_BEGIN_HEADER AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP = 36, AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM = 60, AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER = 84, - AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 108, - AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 132, - AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 156, - AF_BLUE_STRING_BENGALI_BASE = 180, - AF_BLUE_STRING_BENGALI_TOP = 212, - AF_BLUE_STRING_BENGALI_HEAD = 240, - AF_BLUE_STRING_CHEROKEE_CAPITAL = 272, - AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 304, - AF_BLUE_STRING_CHEROKEE_SMALL = 336, - AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 368, - AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 384, - AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 408, - AF_BLUE_STRING_CYRILLIC_SMALL = 432, - AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 456, - AF_BLUE_STRING_DEVANAGARI_BASE = 465, - AF_BLUE_STRING_DEVANAGARI_TOP = 497, - AF_BLUE_STRING_DEVANAGARI_HEAD = 529, - AF_BLUE_STRING_DEVANAGARI_BOTTOM = 561, - AF_BLUE_STRING_ETHIOPIC_TOP = 569, - AF_BLUE_STRING_ETHIOPIC_BOTTOM = 601, - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 633, - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 665, - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 697, - AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 729, - AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 761, - AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 793, - AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 825, - AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 857, - AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 889, - AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 921, - AF_BLUE_STRING_GREEK_CAPITAL_TOP = 953, - AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 974, - AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 992, - AF_BLUE_STRING_GREEK_SMALL = 1010, - AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 1034, - AF_BLUE_STRING_GUJARATI_TOP = 1058, - AF_BLUE_STRING_GUJARATI_BOTTOM = 1090, - AF_BLUE_STRING_GUJARATI_ASCENDER = 1122, - AF_BLUE_STRING_GUJARATI_DESCENDER = 1172, - AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 1205, - AF_BLUE_STRING_GURMUKHI_BASE = 1225, - AF_BLUE_STRING_GURMUKHI_HEAD = 1257, - AF_BLUE_STRING_GURMUKHI_TOP = 1289, - AF_BLUE_STRING_GURMUKHI_BOTTOM = 1321, - AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 1353, - AF_BLUE_STRING_HEBREW_TOP = 1373, - AF_BLUE_STRING_HEBREW_BOTTOM = 1397, - AF_BLUE_STRING_HEBREW_DESCENDER = 1415, - AF_BLUE_STRING_KANNADA_TOP = 1430, - AF_BLUE_STRING_KANNADA_BOTTOM = 1474, - AF_BLUE_STRING_KHMER_TOP = 1506, - AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 1530, - AF_BLUE_STRING_KHMER_BOTTOM = 1570, - AF_BLUE_STRING_KHMER_DESCENDER = 1602, - AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 1636, - AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 1723, - AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 1731, - AF_BLUE_STRING_LAO_TOP = 1739, - AF_BLUE_STRING_LAO_BOTTOM = 1771, - AF_BLUE_STRING_LAO_ASCENDER = 1803, - AF_BLUE_STRING_LAO_LARGE_ASCENDER = 1819, - AF_BLUE_STRING_LAO_DESCENDER = 1831, - AF_BLUE_STRING_LATIN_CAPITAL_TOP = 1855, - AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 1871, - AF_BLUE_STRING_LATIN_SMALL_F_TOP = 1887, - AF_BLUE_STRING_LATIN_SMALL = 1901, - AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 1915, - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 1925, - AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 1945, - AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1965, - AF_BLUE_STRING_LATIN_SUBS_SMALL = 1985, - AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 2021, - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 2041, - AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 2072, - AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 2101, - AF_BLUE_STRING_LATIN_SUPS_SMALL = 2127, - AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 2152, - AF_BLUE_STRING_MALAYALAM_TOP = 2163, - AF_BLUE_STRING_MALAYALAM_BOTTOM = 2207, - AF_BLUE_STRING_MYANMAR_TOP = 2239, - AF_BLUE_STRING_MYANMAR_BOTTOM = 2271, - AF_BLUE_STRING_MYANMAR_ASCENDER = 2303, - AF_BLUE_STRING_MYANMAR_DESCENDER = 2331, - AF_BLUE_STRING_SINHALA_TOP = 2363, - AF_BLUE_STRING_SINHALA_BOTTOM = 2395, - AF_BLUE_STRING_SINHALA_DESCENDER = 2427, - AF_BLUE_STRING_TAMIL_TOP = 2471, - AF_BLUE_STRING_TAMIL_BOTTOM = 2503, - AF_BLUE_STRING_TELUGU_TOP = 2535, - AF_BLUE_STRING_TELUGU_BOTTOM = 2563, - AF_BLUE_STRING_THAI_TOP = 2591, - AF_BLUE_STRING_THAI_BOTTOM = 2615, - AF_BLUE_STRING_THAI_ASCENDER = 2643, - AF_BLUE_STRING_THAI_LARGE_ASCENDER = 2655, - AF_BLUE_STRING_THAI_DESCENDER = 2667, - AF_BLUE_STRING_THAI_LARGE_DESCENDER = 2683, - AF_BLUE_STRING_THAI_DIGIT_TOP = 2691, - af_blue_1_1 = 2702, + AF_BLUE_STRING_ARMENIAN_SMALL_TOP = 105, + AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM = 129, + AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER = 153, + AF_BLUE_STRING_BENGALI_BASE = 177, + AF_BLUE_STRING_BENGALI_TOP = 209, + AF_BLUE_STRING_BENGALI_HEAD = 237, + AF_BLUE_STRING_CHEROKEE_CAPITAL = 269, + AF_BLUE_STRING_CHEROKEE_SMALL_ASCENDER = 301, + AF_BLUE_STRING_CHEROKEE_SMALL = 333, + AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER = 365, + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 381, + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 405, + AF_BLUE_STRING_CYRILLIC_SMALL = 429, + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 453, + AF_BLUE_STRING_DEVANAGARI_BASE = 462, + AF_BLUE_STRING_DEVANAGARI_TOP = 494, + AF_BLUE_STRING_DEVANAGARI_HEAD = 526, + AF_BLUE_STRING_DEVANAGARI_BOTTOM = 558, + AF_BLUE_STRING_ETHIOPIC_TOP = 566, + AF_BLUE_STRING_ETHIOPIC_BOTTOM = 598, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP = 630, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM = 662, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER = 694, + AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER = 726, + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP = 758, + AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM = 790, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_TOP = 822, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 854, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 886, + AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 918, + AF_BLUE_STRING_GREEK_CAPITAL_TOP = 950, + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 971, + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 989, + AF_BLUE_STRING_GREEK_SMALL = 1007, + AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 1031, + AF_BLUE_STRING_GUJARATI_TOP = 1055, + AF_BLUE_STRING_GUJARATI_BOTTOM = 1087, + AF_BLUE_STRING_GUJARATI_ASCENDER = 1119, + AF_BLUE_STRING_GUJARATI_DESCENDER = 1169, + AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 1202, + AF_BLUE_STRING_GURMUKHI_BASE = 1222, + AF_BLUE_STRING_GURMUKHI_HEAD = 1254, + AF_BLUE_STRING_GURMUKHI_TOP = 1286, + AF_BLUE_STRING_GURMUKHI_BOTTOM = 1318, + AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 1350, + AF_BLUE_STRING_HEBREW_TOP = 1370, + AF_BLUE_STRING_HEBREW_BOTTOM = 1394, + AF_BLUE_STRING_HEBREW_DESCENDER = 1412, + AF_BLUE_STRING_KANNADA_TOP = 1427, + AF_BLUE_STRING_KANNADA_BOTTOM = 1471, + AF_BLUE_STRING_KHMER_TOP = 1503, + AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 1527, + AF_BLUE_STRING_KHMER_BOTTOM = 1567, + AF_BLUE_STRING_KHMER_DESCENDER = 1599, + AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 1633, + AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 1720, + AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 1728, + AF_BLUE_STRING_LAO_TOP = 1736, + AF_BLUE_STRING_LAO_BOTTOM = 1768, + AF_BLUE_STRING_LAO_ASCENDER = 1800, + AF_BLUE_STRING_LAO_LARGE_ASCENDER = 1816, + AF_BLUE_STRING_LAO_DESCENDER = 1828, + AF_BLUE_STRING_LATIN_CAPITAL_TOP = 1852, + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 1868, + AF_BLUE_STRING_LATIN_SMALL_F_TOP = 1884, + AF_BLUE_STRING_LATIN_SMALL = 1898, + AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 1912, + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 1922, + AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 1942, + AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 1962, + AF_BLUE_STRING_LATIN_SUBS_SMALL = 1982, + AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 2018, + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 2038, + AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 2069, + AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 2098, + AF_BLUE_STRING_LATIN_SUPS_SMALL = 2124, + AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 2149, + AF_BLUE_STRING_MALAYALAM_TOP = 2160, + AF_BLUE_STRING_MALAYALAM_BOTTOM = 2204, + AF_BLUE_STRING_MYANMAR_TOP = 2236, + AF_BLUE_STRING_MYANMAR_BOTTOM = 2268, + AF_BLUE_STRING_MYANMAR_ASCENDER = 2300, + AF_BLUE_STRING_MYANMAR_DESCENDER = 2328, + AF_BLUE_STRING_SINHALA_TOP = 2360, + AF_BLUE_STRING_SINHALA_BOTTOM = 2392, + AF_BLUE_STRING_SINHALA_DESCENDER = 2424, + AF_BLUE_STRING_TAMIL_TOP = 2468, + AF_BLUE_STRING_TAMIL_BOTTOM = 2500, + AF_BLUE_STRING_TELUGU_TOP = 2532, + AF_BLUE_STRING_TELUGU_BOTTOM = 2560, + AF_BLUE_STRING_THAI_TOP = 2588, + AF_BLUE_STRING_THAI_BOTTOM = 2612, + AF_BLUE_STRING_THAI_ASCENDER = 2640, + AF_BLUE_STRING_THAI_LARGE_ASCENDER = 2652, + AF_BLUE_STRING_THAI_DESCENDER = 2664, + AF_BLUE_STRING_THAI_LARGE_DESCENDER = 2680, + AF_BLUE_STRING_THAI_DIGIT_TOP = 2688, + af_blue_1_1 = 2699, #ifdef AF_CONFIG_OPTION_CJK AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1, AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203, diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.c b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.c index 6c3d032d1c7..0f7f6e5c419 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.c @@ -420,20 +420,19 @@ dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" )); if ( axis->num_segments ) - AF_DUMP(( " index pos dir from to" - " link serif edge" + AF_DUMP(( " index pos delta dir from to " + " link serif edge" " height extra flags\n" )); else AF_DUMP(( " (none)\n" )); for ( seg = segments; seg < limit; seg++ ) - AF_DUMP(( " %5d %5.2g %5s %4d %4d" + AF_DUMP(( " %5d %5d %5d %5s %4d %4d" " %4s %5s %4s" " %6d %5d %11s\n", AF_INDEX_NUM( seg, segments ), - dimension == AF_DIMENSION_HORZ - ? (int)seg->first->ox / 64.0 - : (int)seg->first->oy / 64.0, + seg->pos, + seg->delta, af_dir_str( (AF_Direction)seg->dir ), AF_INDEX_NUM( seg->first, points ), AF_INDEX_NUM( seg->last, points ), @@ -553,18 +552,26 @@ * note: AF_DIMENSION_HORZ corresponds to _vertical_ edges * since they have a constant X coordinate. */ - AF_DUMP(( "Table of %s edges:\n", - dimension == AF_DIMENSION_HORZ ? "vertical" - : "horizontal" )); + if ( dimension == AF_DIMENSION_HORZ ) + AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n", + "vertical", + 65536.0 * 64.0 / hints->x_scale, + 10.0 * hints->x_scale / 65536.0 / 64.0 )); + else + AF_DUMP(( "Table of %s edges (1px=%.2fu, 10u=%.2fpx):\n", + "horizontal", + 65536.0 * 64.0 / hints->y_scale, + 10.0 * hints->y_scale / 65536.0 / 64.0 )); + if ( axis->num_edges ) - AF_DUMP(( " index pos dir link serif" - " blue opos pos flags\n" )); + AF_DUMP(( " index pos dir link serif" + " blue opos pos flags\n" )); else AF_DUMP(( " (none)\n" )); for ( edge = edges; edge < limit; edge++ ) - AF_DUMP(( " %5d %5.2g %5s %4s %5s" - " %c %5.2f %5.2f %11s\n", + AF_DUMP(( " %5d %7.2f %5s %4s %5s" + " %c %7.2f %7.2f %11s\n", AF_INDEX_NUM( edge, edges ), (int)edge->opos / 64.0, af_dir_str( (AF_Direction)edge->dir ), diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.h b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.h index 5142e6ed217..4fdf732d423 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.h +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afhints.h @@ -260,6 +260,7 @@ FT_BEGIN_HEADER FT_Byte flags; /* edge/segment flags for this segment */ FT_Char dir; /* segment direction */ FT_Short pos; /* position of segment */ + FT_Short delta; /* deviation from segment position */ FT_Short min_coord; /* minimum coordinate of segment */ FT_Short max_coord; /* maximum coordinate of segment */ FT_Short height; /* the hinted segment height */ diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/aflatin.c b/reactos/sdk/lib/3rdparty/freetype/src/autofit/aflatin.c index 18559fc4a85..09b3609fbae 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/aflatin.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/aflatin.c @@ -1092,7 +1092,7 @@ FT_UInt ppem; - scaled = FT_MulFix( blue->shoot.org, scaler->y_scale ); + scaled = FT_MulFix( blue->shoot.org, scale ); ppem = metrics->root.scaler.face->size->metrics.x_ppem; limit = metrics->root.globals->increase_x_height; threshold = 40; @@ -1139,8 +1139,6 @@ if ( dist == 0 ) { - scale = new_scale; - FT_TRACE5(( "af_latin_metrics_scale_dim:" " x height alignment (style `%s'):\n" @@ -1148,9 +1146,11 @@ " vertical scaling changed from %.4f to %.4f (by %d%%)\n" "\n", af_style_names[metrics->root.style_class->style], - axis->org_scale / 65536.0, scale / 65536.0, + new_scale / 65536.0, ( fitted - scaled ) * 100 / scaled )); + + scale = new_scale; } #ifdef FT_DEBUG_LEVEL_TRACE else @@ -1552,8 +1552,9 @@ /* points are different: we are just leaving an edge, thus */ /* record a new segment */ - segment->last = point; - segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 ); + segment->last = point; + segment->pos = (FT_Short)( ( min_pos + max_pos ) >> 1 ); + segment->delta = (FT_Short)( ( max_pos - min_pos ) >> 1 ); /* a segment is round if either its first or last point */ /* is a control point, and the length of the on points */ @@ -1982,6 +1983,7 @@ FT_Fixed scale; FT_Pos edge_distance_threshold; FT_Pos segment_length_threshold; + FT_Pos segment_width_threshold; axis->num_edges = 0; @@ -2003,9 +2005,15 @@ * corresponding threshold in font units. */ if ( dim == AF_DIMENSION_HORZ ) - segment_length_threshold = FT_DivFix( 64, hints->y_scale ); + segment_length_threshold = FT_DivFix( 64, hints->y_scale ); else - segment_length_threshold = 0; + segment_length_threshold = 0; + + /* + * Similarly, we ignore segments that have a width delta + * larger than 0.5px (i.e., a width larger than 1px). + */ + segment_width_threshold = FT_DivFix( 32, scale ); /*********************************************************************/ /* */ @@ -2038,9 +2046,10 @@ FT_Int ee; - /* ignore too short segments and, in this loop, */ - /* one-point segments without a direction */ + /* ignore too short segments, too wide ones, and, in this loop, */ + /* one-point segments without a direction */ if ( seg->height < segment_length_threshold || + seg->delta > segment_width_threshold || seg->dir == AF_DIR_NONE ) continue; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afmodule.c b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afmodule.c index 7b91f5ef6fa..5f831e0953c 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afmodule.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afmodule.c @@ -107,18 +107,29 @@ static FT_Error af_property_set( FT_Module ft_module, const char* property_name, - const void* value ) + const void* value, + FT_Bool value_is_string ) { FT_Error error = FT_Err_Ok; AF_Module module = (AF_Module)ft_module; +#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_UNUSED( value_is_string ); +#endif + if ( !ft_strcmp( property_name, "fallback-script" ) ) { - FT_UInt* fallback_script = (FT_UInt*)value; + FT_UInt* fallback_script; + FT_UInt ss; - FT_UInt ss; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + return FT_THROW( Invalid_Argument ); +#endif + + fallback_script = (FT_UInt*)value; /* We translate the fallback script to a fallback style that uses */ /* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */ @@ -147,19 +158,33 @@ } else if ( !ft_strcmp( property_name, "default-script" ) ) { - FT_UInt* default_script = (FT_UInt*)value; + FT_UInt* default_script; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + return FT_THROW( Invalid_Argument ); +#endif + + default_script = (FT_UInt*)value; + module->default_script = *default_script; return error; } else if ( !ft_strcmp( property_name, "increase-x-height" ) ) { - FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value; + FT_Prop_IncreaseXHeight* prop; AF_FaceGlobals globals; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + return FT_THROW( Invalid_Argument ); +#endif + + prop = (FT_Prop_IncreaseXHeight*)value; + error = af_property_get_face_globals( prop->face, &globals, module ); if ( !error ) globals->increase_x_height = prop->limit; @@ -169,28 +194,77 @@ #ifdef AF_CONFIG_OPTION_USE_WARPER else if ( !ft_strcmp( property_name, "warping" ) ) { - FT_Bool* warping = (FT_Bool*)value; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; + long w = ft_strtol( s, NULL, 10 ); - module->warping = *warping; + if ( w == 0 ) + module->warping = 0; + else if ( w == 1 ) + module->warping = 1; + else + return FT_THROW( Invalid_Argument ); + } + else +#endif + { + FT_Bool* warping = (FT_Bool*)value; + + + module->warping = *warping; + } return error; } #endif /* AF_CONFIG_OPTION_USE_WARPER */ else if ( !ft_strcmp( property_name, "darkening-parameters" ) ) { - FT_Int* darken_params = (FT_Int*)value; + FT_Int* darken_params; + FT_Int x1, y1, x2, y2, x3, y3, x4, y4; - FT_Int x1 = darken_params[0]; - FT_Int y1 = darken_params[1]; - FT_Int x2 = darken_params[2]; - FT_Int y2 = darken_params[3]; - FT_Int x3 = darken_params[4]; - FT_Int y3 = darken_params[5]; - FT_Int x4 = darken_params[6]; - FT_Int y4 = darken_params[7]; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_Int dp[8]; + if ( value_is_string ) + { + const char* s = (const char*)value; + char* ep; + int i; + + + /* eight comma-separated numbers */ + for ( i = 0; i < 7; i++ ) + { + dp[i] = (FT_Int)ft_strtol( s, &ep, 10 ); + if ( *ep != ',' || s == ep ) + return FT_THROW( Invalid_Argument ); + + s = ep + 1; + } + + dp[7] = (FT_Int)ft_strtol( s, &ep, 10 ); + if ( !( *ep == '\0' || *ep == ' ' ) || s == ep ) + return FT_THROW( Invalid_Argument ); + + darken_params = dp; + } + else +#endif + darken_params = (FT_Int*)value; + + x1 = darken_params[0]; + y1 = darken_params[1]; + x2 = darken_params[2]; + y2 = darken_params[3]; + x3 = darken_params[4]; + y3 = darken_params[5]; + x4 = darken_params[6]; + y4 = darken_params[7]; + if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 || y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 || x1 > x2 || x2 > x3 || x3 > x4 || @@ -210,10 +284,28 @@ } else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) { - FT_Bool* no_stem_darkening = (FT_Bool*)value; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; + long nsd = ft_strtol( s, NULL, 10 ); - module->no_stem_darkening = *no_stem_darkening; + if ( nsd == 0 ) + module->no_stem_darkening = 0; + else if ( nsd == 1 ) + module->no_stem_darkening = 1; + else + return FT_THROW( Invalid_Argument ); + } + else +#endif + { + FT_Bool* no_stem_darkening = (FT_Bool*)value; + + + module->no_stem_darkening = *no_stem_darkening; + } return error; } diff --git a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afscript.h b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afscript.h index 33c30129816..cffe59105dc 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/autofit/afscript.h +++ b/reactos/sdk/lib/3rdparty/freetype/src/autofit/afscript.h @@ -40,7 +40,7 @@ "Armenian", HB_SCRIPT_ARMENIAN, HINTING_BOTTOM_TO_TOP, - "\xD6\x85 \xD5\x95" ) /* Ö… Ő• */ + "\xD5\xBD \xD5\x8D" ) /* Ő˝ ŐŤ */ /* there are no simple forms for letters; we thus use two digit shapes */ SCRIPT( beng, BENG, diff --git a/reactos/sdk/lib/3rdparty/freetype/src/base/ftdbgmem.c b/reactos/sdk/lib/3rdparty/freetype/src/base/ftdbgmem.c index 6ab50727482..38d1a803f05 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/base/ftdbgmem.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/base/ftdbgmem.c @@ -842,7 +842,7 @@ p = getenv( "FT2_ALLOC_TOTAL_MAX" ); if ( p != NULL ) { - FT_Long total_max = ft_atol( p ); + FT_Long total_max = ft_strtol( p, NULL, 10 ); if ( total_max > 0 ) @@ -855,7 +855,7 @@ p = getenv( "FT2_ALLOC_COUNT_MAX" ); if ( p != NULL ) { - FT_Long total_count = ft_atol( p ); + FT_Long total_count = ft_strtol( p, NULL, 10 ); if ( total_count > 0 ) @@ -868,7 +868,7 @@ p = getenv( "FT2_KEEP_ALIVE" ); if ( p != NULL ) { - FT_Long keep_alive = ft_atol( p ); + FT_Long keep_alive = ft_strtol( p, NULL, 10 ); if ( keep_alive > 0 ) diff --git a/reactos/sdk/lib/3rdparty/freetype/src/base/ftinit.c b/reactos/sdk/lib/3rdparty/freetype/src/base/ftinit.c index c2dd0a7b372..02ef938d5ea 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/base/ftinit.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/base/ftinit.c @@ -226,6 +226,115 @@ } +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + +#define MAX_LENGTH 128 + + /* + * Set default properties derived from the `FREETYPE_PROPERTIES' + * environment variable. + * + * `FREETYPE_PROPERTIES' has the following syntax form (broken here into + * multiple lines for better readability) + * + * + * ':' + * '=' + * + * ':' + * '=' + * ... + * + * Example: + * + * FREETYPE_PROPERTIES=truetype:interpreter-version=35 \ + * cff:no-stem-darkening=1 \ + * autofitter:warping=1 + * + */ + + static void + ft_set_default_properties( FT_Library library ) + { + const char* env; + const char* p; + const char* q; + + char module_name[MAX_LENGTH + 1]; + char property_name[MAX_LENGTH + 1]; + char property_value[MAX_LENGTH + 1]; + + int i; + + + env = ft_getenv( "FREETYPE_PROPERTIES" ); + if ( !env ) + return; + + for ( p = env; *p; p++ ) + { + /* skip leading whitespace and separators */ + if ( *p == ' ' || *p == '\t' ) + continue; + + /* read module name, followed by `:' */ + q = p; + for ( i = 0; i < MAX_LENGTH; i++ ) + { + if ( !*p || *p == ':' ) + break; + module_name[i] = *p++; + } + module_name[i] = '\0'; + + if ( !*p || *p != ':' || p == q ) + break; + + /* read property name, followed by `=' */ + q = ++p; + for ( i = 0; i < MAX_LENGTH; i++ ) + { + if ( !*p || *p == '=' ) + break; + property_name[i] = *p++; + } + property_name[i] = '\0'; + + if ( !*p || *p != '=' || p == q ) + break; + + /* read property value, followed by whitespace (if any) */ + q = ++p; + for ( i = 0; i < MAX_LENGTH; i++ ) + { + if ( !*p || *p == ' ' || *p == '\t' ) + break; + property_value[i] = *p++; + } + property_value[i] = '\0'; + + if ( !( *p == '\0' || *p == ' ' || *p == '\t' ) || p == q ) + break; + + /* we completely ignore errors */ + ft_property_string_set( library, + module_name, + property_name, + property_value ); + } + } + +#else + + static void + ft_set_default_properties( FT_Library library ) + { + FT_UNUSED( library ); + } + +#endif + + /* documentation is in freetype.h */ FT_EXPORT_DEF( FT_Error ) @@ -256,6 +365,8 @@ else FT_Add_Default_Modules( *alibrary ); + ft_set_default_properties( *alibrary ); + return error; } diff --git a/reactos/sdk/lib/3rdparty/freetype/src/base/ftobjs.c b/reactos/sdk/lib/3rdparty/freetype/src/base/ftobjs.c index c2dc6183b04..0c9e4090c56 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/base/ftobjs.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/base/ftobjs.c @@ -2314,11 +2314,24 @@ if ( bsize->height < 0 ) - bsize->height = (FT_Short)-bsize->height; + bsize->height = -bsize->height; if ( bsize->x_ppem < 0 ) - bsize->x_ppem = (FT_Short)-bsize->x_ppem; + bsize->x_ppem = -bsize->x_ppem; if ( bsize->y_ppem < 0 ) bsize->y_ppem = -bsize->y_ppem; + + /* check whether negation actually has worked */ + if ( bsize->height < 0 || bsize->x_ppem < 0 || bsize->y_ppem < 0 ) + { + FT_TRACE0(( "FT_Open_Face:" + " Invalid bitmap dimensions for stroke %d," + " now disabled\n", i )); + bsize->width = 0; + bsize->height = 0; + bsize->size = 0; + bsize->x_ppem = 0; + bsize->y_ppem = 0; + } } } @@ -4564,7 +4577,8 @@ const FT_String* module_name, const FT_String* property_name, void* value, - FT_Bool set ) + FT_Bool set, + FT_Bool value_is_string ) { FT_Module* cur; FT_Module* limit; @@ -4634,8 +4648,13 @@ return FT_THROW( Unimplemented_Feature ); } - return set ? service->set_property( cur[0], property_name, value ) - : service->get_property( cur[0], property_name, value ); + return set ? service->set_property( cur[0], + property_name, + value, + value_is_string ) + : service->get_property( cur[0], + property_name, + value ); } @@ -4651,7 +4670,8 @@ module_name, property_name, (void*)value, - TRUE ); + TRUE, + FALSE ); } @@ -4667,10 +4687,33 @@ module_name, property_name, value, + FALSE, FALSE ); } +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + + /* this variant is used for handling the FREETYPE_PROPERTIES */ + /* environment variable */ + + FT_BASE_DEF( FT_Error ) + ft_property_string_set( FT_Library library, + const FT_String* module_name, + const FT_String* property_name, + FT_String* value ) + { + return ft_property_do( library, + module_name, + property_name, + (void*)value, + TRUE, + TRUE ); + } + +#endif + + /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2intrp.c b/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2intrp.c index 10c12a2b601..77bb8964317 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2intrp.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2intrp.c @@ -474,6 +474,7 @@ CF2_GlyphPathRec glyphPath; #endif + FT_ZERO( &storage ); /* initialize the remaining objects */ cf2_arrstack_init( &subrStack, diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2stack.c b/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2stack.c index 6fafd901f33..8f3adb6d686 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2stack.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cff/cf2stack.c @@ -53,14 +53,14 @@ cf2_stack_init( FT_Memory memory, FT_Error* e ) { - FT_Error error = FT_Err_Ok; /* for FT_QNEW */ + FT_Error error = FT_Err_Ok; /* for FT_NEW */ CF2_Stack stack = NULL; - if ( !FT_QNEW( stack ) ) + if ( !FT_NEW( stack ) ) { - /* initialize the structure; FT_QNEW zeroes it */ + /* initialize the structure; FT_NEW zeroes it */ stack->memory = memory; stack->error = e; stack->top = &stack->buffer[0]; /* empty stack */ diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cff/cffdrivr.c b/reactos/sdk/lib/3rdparty/freetype/src/cff/cffdrivr.c index 950a9605c38..67bf09d8c0d 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cff/cffdrivr.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cff/cffdrivr.c @@ -659,26 +659,62 @@ static FT_Error cff_property_set( FT_Module module, /* CFF_Driver */ const char* property_name, - const void* value ) + const void* value, + FT_Bool value_is_string ) { FT_Error error = FT_Err_Ok; CFF_Driver driver = (CFF_Driver)module; +#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_UNUSED( value_is_string ); +#endif + if ( !ft_strcmp( property_name, "darkening-parameters" ) ) { - FT_Int* darken_params = (FT_Int*)value; + FT_Int* darken_params; + FT_Int x1, y1, x2, y2, x3, y3, x4, y4; - FT_Int x1 = darken_params[0]; - FT_Int y1 = darken_params[1]; - FT_Int x2 = darken_params[2]; - FT_Int y2 = darken_params[3]; - FT_Int x3 = darken_params[4]; - FT_Int y3 = darken_params[5]; - FT_Int x4 = darken_params[6]; - FT_Int y4 = darken_params[7]; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_Int dp[8]; + if ( value_is_string ) + { + const char* s = (const char*)value; + char* ep; + int i; + + + /* eight comma-separated numbers */ + for ( i = 0; i < 7; i++ ) + { + dp[i] = (FT_Int)ft_strtol( s, &ep, 10 ); + if ( *ep != ',' || s == ep ) + return FT_THROW( Invalid_Argument ); + + s = ep + 1; + } + + dp[7] = (FT_Int)ft_strtol( s, &ep, 10 ); + if ( !( *ep == '\0' || *ep == ' ' ) || s == ep ) + return FT_THROW( Invalid_Argument ); + + darken_params = dp; + } + else +#endif + darken_params = (FT_Int*)value; + + x1 = darken_params[0]; + y1 = darken_params[1]; + x2 = darken_params[2]; + y2 = darken_params[3]; + x3 = darken_params[4]; + y3 = darken_params[5]; + x4 = darken_params[6]; + y4 = darken_params[7]; + if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 || y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 || x1 > x2 || x2 > x3 || x3 > x4 || @@ -698,26 +734,62 @@ } else if ( !ft_strcmp( property_name, "hinting-engine" ) ) { - FT_UInt* hinting_engine = (FT_UInt*)value; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; - if ( *hinting_engine == FT_CFF_HINTING_ADOBE + if ( !ft_strcmp( s, "adobe" ) ) + driver->hinting_engine = FT_CFF_HINTING_ADOBE; #ifdef CFF_CONFIG_OPTION_OLD_ENGINE - || *hinting_engine == FT_CFF_HINTING_FREETYPE + else if ( !ft_strcmp( s, "freetype" ) ) + driver->hinting_engine = FT_CFF_HINTING_FREETYPE; #endif - ) - driver->hinting_engine = *hinting_engine; + else + return FT_THROW( Invalid_Argument ); + } else - error = FT_ERR( Unimplemented_Feature ); +#endif + { + FT_UInt* hinting_engine = (FT_UInt*)value; - return error; + if ( *hinting_engine == FT_CFF_HINTING_ADOBE +#ifdef CFF_CONFIG_OPTION_OLD_ENGINE + || *hinting_engine == FT_CFF_HINTING_FREETYPE +#endif + ) + driver->hinting_engine = *hinting_engine; + else + error = FT_ERR( Unimplemented_Feature ); + + return error; + } } else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) { - FT_Bool* no_stem_darkening = (FT_Bool*)value; +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; + long nsd = ft_strtol( s, NULL, 10 ); - driver->no_stem_darkening = *no_stem_darkening; + if ( nsd == 0 ) + driver->no_stem_darkening = 0; + else if ( nsd == 1 ) + driver->no_stem_darkening = 1; + else + return FT_THROW( Invalid_Argument ); + } + else +#endif + { + FT_Bool* no_stem_darkening = (FT_Bool*)value; + + + driver->no_stem_darkening = *no_stem_darkening; + } return error; } diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cff/cffgload.c b/reactos/sdk/lib/3rdparty/freetype/src/cff/cffgload.c index 752c18ed92b..4f375a61231 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cff/cffgload.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cff/cffgload.c @@ -2942,6 +2942,7 @@ cff_decoder_init( &decoder, face, size, glyph, hinting, FT_LOAD_TARGET_MODE( load_flags ) ); + /* this is for pure CFFs */ if ( load_flags & FT_LOAD_ADVANCE_ONLY ) decoder.width_only = TRUE; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cff/cffload.c b/reactos/sdk/lib/3rdparty/freetype/src/cff/cffload.c index 3d1bda97b94..470fa82151b 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cff/cffload.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cff/cffload.c @@ -602,7 +602,8 @@ if ( !FT_ALLOC( name, byte_len + 1 ) ) { - FT_MEM_COPY( name, bytes, byte_len ); + if ( byte_len ) + FT_MEM_COPY( name, bytes, byte_len ); name[byte_len] = 0; } cff_index_forget_element( idx, &bytes ); diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cid/cidload.c b/reactos/sdk/lib/3rdparty/freetype/src/cid/cidload.c index d4f1ad1a7fb..21397c2c0e5 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cid/cidload.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cid/cidload.c @@ -777,7 +777,8 @@ CID_FaceDict dict = cid->font_dicts + n; - if ( dict->sd_bytes < 0 ) + if ( dict->sd_bytes < 0 || + ( dict->num_subrs && dict->sd_bytes < 1 ) ) { FT_ERROR(( "cid_parse_dict: Invalid `SDBytes' value\n" )); error = FT_THROW( Invalid_File_Format ); diff --git a/reactos/sdk/lib/3rdparty/freetype/src/cid/cidparse.c b/reactos/sdk/lib/3rdparty/freetype/src/cid/cidparse.c index 73aca2ac6a7..cb07c45099f 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/cid/cidparse.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/cid/cidparse.c @@ -199,7 +199,7 @@ limit = parser->root.limit; cur = parser->root.cursor; - while ( cur < limit - SFNTS_LEN ) + while ( cur <= limit - SFNTS_LEN ) { if ( parser->root.error ) { @@ -208,12 +208,12 @@ } if ( cur[0] == 'S' && - cur < limit - STARTDATA_LEN && + cur <= limit - STARTDATA_LEN && ft_strncmp( (char*)cur, STARTDATA, STARTDATA_LEN ) == 0 ) { if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 ) { - FT_Long tmp = ft_atol( (const char *)arg2 ); + FT_Long tmp = ft_strtol( (const char *)arg2, NULL, 10 ); if ( tmp < 0 ) diff --git a/reactos/sdk/lib/3rdparty/freetype/src/lzw/ftzopen.c b/reactos/sdk/lib/3rdparty/freetype/src/lzw/ftzopen.c index e17b3c5247a..9e66ba983f3 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/lzw/ftzopen.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/lzw/ftzopen.c @@ -42,7 +42,12 @@ state->buf_total += count; state->in_eof = FT_BOOL( count < state->num_bits ); state->buf_offset = 0; - state->buf_size = ( state->buf_size << 3 ) - ( state->num_bits - 1 ); + + state->buf_size <<= 3; + if ( state->buf_size > state->num_bits ) + state->buf_size -= state->num_bits - 1; + else + return -1; /* not enough data */ if ( count == 0 ) /* end of file */ return -1; @@ -66,7 +71,10 @@ { if ( state->free_ent >= state->free_bits ) { - state->num_bits = ++num_bits; + state->num_bits = ++num_bits; + if ( num_bits > LZW_MAX_BITS ) + return -1; + state->free_bits = state->num_bits < state->max_bits ? (FT_UInt)( ( 1UL << num_bits ) - 256 ) : state->max_free + 1; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfdriver.c b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfdriver.c index 47e89677527..22332694bbc 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfdriver.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfdriver.c @@ -459,55 +459,62 @@ FT_DEFINE_SFNT_INTERFACE( sfnt_interface, - tt_face_goto_table, + tt_face_goto_table, /* TT_Loader_GotoTableFunc goto_table */ - sfnt_init_face, - sfnt_load_face, - sfnt_done_face, - sfnt_get_interface, + sfnt_init_face, /* TT_Init_Face_Func init_face */ + sfnt_load_face, /* TT_Load_Face_Func load_face */ + sfnt_done_face, /* TT_Done_Face_Func done_face */ + sfnt_get_interface, /* FT_Module_Requester get_interface */ - tt_face_load_any, + tt_face_load_any, /* TT_Load_Any_Func load_any */ - tt_face_load_head, - tt_face_load_hhea, - tt_face_load_cmap, - tt_face_load_maxp, - tt_face_load_os2, - tt_face_load_post, + tt_face_load_head, /* TT_Load_Table_Func load_head */ + tt_face_load_hhea, /* TT_Load_Metrics_Func load_hhea */ + tt_face_load_cmap, /* TT_Load_Table_Func load_cmap */ + tt_face_load_maxp, /* TT_Load_Table_Func load_maxp */ + tt_face_load_os2, /* TT_Load_Table_Func load_os2 */ + tt_face_load_post, /* TT_Load_Table_Func load_post */ - tt_face_load_name, - tt_face_free_name, + tt_face_load_name, /* TT_Load_Table_Func load_name */ + tt_face_free_name, /* TT_Free_Table_Func free_name */ - tt_face_load_kern, - tt_face_load_gasp, - tt_face_load_pclt, + tt_face_load_kern, /* TT_Load_Table_Func load_kern */ + tt_face_load_gasp, /* TT_Load_Table_Func load_gasp */ + tt_face_load_pclt, /* TT_Load_Table_Func load_init */ /* see `ttload.h' */ PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ), - + /* TT_Load_Table_Func load_bhed */ PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ), + /* TT_Load_SBit_Image_Func load_sbit_image */ /* see `ttpost.h' */ PUT_PS_NAMES( tt_face_get_ps_name ), + /* TT_Get_PS_Name_Func get_psname */ PUT_PS_NAMES( tt_face_free_ps_names ), + /* TT_Free_Table_Func free_psnames */ /* since version 2.1.8 */ - tt_face_get_kerning, + tt_face_get_kerning, /* TT_Face_GetKerningFunc get_kerning */ /* since version 2.2 */ - tt_face_load_font_dir, - tt_face_load_hmtx, + tt_face_load_font_dir, /* TT_Load_Table_Func load_font_dir */ + tt_face_load_hmtx, /* TT_Load_Metrics_Func load_hmtx */ /* see `ttsbit.h' and `sfnt.h' */ PUT_EMBEDDED_BITMAPS( tt_face_load_sbit ), + /* TT_Load_Table_Func load_eblc */ PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ), + /* TT_Free_Table_Func free_eblc */ PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ), + /* TT_Set_SBit_Strike_Func set_sbit_strike */ PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ), + /* TT_Load_Strike_Metrics_Func load_strike_metrics */ - tt_face_get_metrics, + tt_face_get_metrics, /* TT_Get_Metrics_Func get_metrics */ - tt_face_get_name + tt_face_get_name /* TT_Get_Name_Func get_name */ ) diff --git a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfobjs.c b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfobjs.c index 2e8c1ecde6f..4413bbcf2a9 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfobjs.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/sfobjs.c @@ -977,7 +977,7 @@ #endif face->root.num_faces = face->ttc_header.count; - face->root.face_index = face_index; + face->root.face_index = face_instance_index; return error; } diff --git a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttcmap.c b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttcmap.c index 01255a887ee..cd7467d4d86 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttcmap.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttcmap.c @@ -763,6 +763,9 @@ static void tt_cmap4_next( TT_CMap4 cmap ) { + TT_Face face = (TT_Face)cmap->cmap.cmap.charmap.face; + FT_Byte* limit = face->cmap_table + face->cmap_size; + FT_UInt charcode; @@ -788,15 +791,19 @@ FT_Byte* p = values + 2 * ( charcode - cmap->cur_start ); + /* if p > limit, the whole segment is invalid */ + if ( p > limit ) + goto Next_Segment; + do { FT_UInt gindex = FT_NEXT_USHORT( p ); - if ( gindex != 0 ) + if ( gindex ) { gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU; - if ( gindex != 0 ) + if ( gindex ) { cmap->cur_charcode = charcode; cmap->cur_gindex = gindex; @@ -812,7 +819,26 @@ FT_UInt gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU; - if ( gindex != 0 ) + if ( gindex >= (FT_UInt)face->root.num_glyphs ) + { + /* we have an invalid glyph index; if there is an overflow, */ + /* we can adjust `charcode', otherwise the whole segment is */ + /* invalid */ + gindex = 0; + + if ( (FT_Int)charcode + delta < 0 && + (FT_Int)end + delta >= 0 ) + charcode = (FT_UInt)( -delta ); + + else if ( (FT_Int)charcode + delta < 0x10000L && + (FT_Int)end + delta >= 0x10000L ) + charcode = (FT_UInt)( 0x10000L - delta ); + + else + goto Next_Segment; + } + + if ( gindex ) { cmap->cur_charcode = charcode; cmap->cur_gindex = gindex; @@ -822,6 +848,7 @@ } } + Next_Segment: /* we need to find another range */ if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 ) break; @@ -1170,6 +1197,9 @@ FT_UInt32* pcharcode, FT_Bool next ) { + TT_Face face = (TT_Face)cmap->cmap.charmap.face; + FT_Byte* limit = face->cmap_table + face->cmap_size; + FT_UInt num_segs2, start, end, offset; FT_Int delta; FT_UInt max, min, mid, num_segs; @@ -1221,10 +1251,6 @@ if ( mid >= num_segs - 1 && start == 0xFFFFU && end == 0xFFFFU ) { - TT_Face face = (TT_Face)cmap->cmap.charmap.face; - FT_Byte* limit = face->cmap_table + face->cmap_size; - - if ( offset && p + offset + 2 > limit ) { delta = 1; @@ -1347,13 +1373,40 @@ if ( offset ) { p += offset + ( charcode - start ) * 2; + + /* if p > limit, the whole segment is invalid */ + if ( next && p > limit ) + break; + gindex = TT_PEEK_USHORT( p ); - if ( gindex != 0 ) + if ( gindex ) + { gindex = (FT_UInt)( (FT_Int)gindex + delta ) & 0xFFFFU; + if ( gindex >= (FT_UInt)face->root.num_glyphs ) + gindex = 0; + } } else + { gindex = (FT_UInt)( (FT_Int)charcode + delta ) & 0xFFFFU; + if ( next && gindex >= (FT_UInt)face->root.num_glyphs ) + { + /* we have an invalid glyph index; if there is an overflow, */ + /* we can adjust `charcode', otherwise the whole segment is */ + /* invalid */ + gindex = 0; + + if ( (FT_Int)charcode + delta < 0 && + (FT_Int)end + delta >= 0 ) + charcode = (FT_UInt)( -delta ); + + else if ( (FT_Int)charcode + delta < 0x10000L && + (FT_Int)end + delta >= 0x10000L ) + charcode = (FT_UInt)( 0x10000L - delta ); + } + } + break; } } diff --git a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttload.c b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttload.c index 2f5b2c38438..a653a718690 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttload.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttload.c @@ -775,15 +775,6 @@ maxProfile->maxTwilightPoints = 0xFFFFU - 4; } - - /* we arbitrarily limit recursion to avoid stack exhaustion */ - if ( maxProfile->maxComponentDepth > 100 ) - { - FT_TRACE0(( "tt_face_load_maxp:" - " abnormally large component depth (%d) set to 100\n", - maxProfile->maxComponentDepth )); - maxProfile->maxComponentDepth = 100; - } } FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs )); @@ -1193,8 +1184,8 @@ #define FT_STRUCTURE TT_Postscript FT_FRAME_START( 32 ), - FT_FRAME_ULONG( FormatType ), - FT_FRAME_ULONG( italicAngle ), + FT_FRAME_LONG ( FormatType ), + FT_FRAME_LONG ( italicAngle ), FT_FRAME_SHORT( underlinePosition ), FT_FRAME_SHORT( underlineThickness ), FT_FRAME_ULONG( isFixedPitch ), diff --git a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttsbit.c b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttsbit.c index e24e7d6cdd8..36c261dcce9 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttsbit.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/sfnt/ttsbit.c @@ -197,6 +197,27 @@ if ( !error ) FT_TRACE3(( "sbit_num_strikes: %u\n", face->sbit_num_strikes )); + face->ebdt_start = 0; + face->ebdt_size = 0; + + if ( face->sbit_table_type != TT_SBIT_TABLE_TYPE_NONE ) + { + FT_ULong ebdt_size; + + + error = face->goto_table( face, TTAG_CBDT, stream, &ebdt_size ); + if ( error ) + error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size ); + if ( error ) + error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size ); + + if ( !error ) + { + face->ebdt_start = FT_STREAM_POS(); + face->ebdt_size = ebdt_size; + } + } + return FT_Err_Ok; Exit: @@ -323,6 +344,16 @@ strike[18] + /* max_width */ (FT_Char)strike[23] /* min_advance_SB */ ) * 64; + + /* set the scale values (in 16.16 units) so advances */ + /* from the hmtx and vmtx table are scaled correctly */ + metrics->x_scale = FT_MulDiv( metrics->x_ppem, + 64 * 0x10000, + face->header.Units_Per_EM ); + metrics->y_scale = FT_MulDiv( metrics->y_ppem, + 64 * 0x10000, + face->header.Units_Per_EM ); + return FT_Err_Ok; } @@ -414,17 +445,13 @@ FT_ULong strike_index, TT_SBit_MetricsRec* metrics ) { - FT_Error error; + FT_Error error = FT_ERR( Table_Missing ); FT_Stream stream = face->root.stream; - FT_ULong ebdt_size; - error = face->goto_table( face, TTAG_CBDT, stream, &ebdt_size ); - if ( error ) - error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size ); - if ( error ) - error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size ); - if ( error ) + if ( !face->ebdt_size ) + goto Exit; + if ( FT_STREAM_SEEK( face->ebdt_start ) ) goto Exit; decoder->face = face; @@ -435,8 +462,8 @@ decoder->metrics_loaded = 0; decoder->bitmap_allocated = 0; - decoder->ebdt_start = FT_STREAM_POS(); - decoder->ebdt_size = ebdt_size; + decoder->ebdt_start = face->ebdt_start; + decoder->ebdt_size = face->ebdt_size; decoder->eblc_base = face->sbit_table; decoder->eblc_limit = face->sbit_table + face->sbit_table_size; @@ -854,7 +881,7 @@ } *pwrite++ |= ( ( rval >> nbits ) & 0xFF ) & - ( ~( 0xFF << w ) << ( 8 - w - x_pos ) ); + ( ~( 0xFFU << w ) << ( 8 - w - x_pos ) ); rval <<= 8; w = line_bits - w; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/smooth/ftgrays.c b/reactos/sdk/lib/3rdparty/freetype/src/smooth/ftgrays.c index 790ce5518ab..d3d6c49ac1d 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/smooth/ftgrays.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/smooth/ftgrays.c @@ -403,9 +403,12 @@ typedef ptrdiff_t FT_PtrDist; } TCell; + typedef struct TPixmap_ + { + unsigned char* origin; /* pixmap origin at the bottom-left */ + int pitch; /* pitch to go down one row */ - /* maximum number of gray spans in a call to the span callback */ -#define FT_MAX_GRAY_SPANS 32 + } TPixmap; /* maximum number of gray cells in the buffer */ #if FT_RENDER_POOL_SIZE > 2048 @@ -430,7 +433,6 @@ typedef ptrdiff_t FT_PtrDist; TCoord ex, ey; TCoord min_ex, max_ex; TCoord min_ey, max_ey; - TCoord count_ex, count_ey; TArea area; TCoord cover; @@ -443,14 +445,10 @@ typedef ptrdiff_t FT_PtrDist; TPos x, y; FT_Outline outline; - FT_Bitmap target; - - FT_Span gray_spans[FT_MAX_GRAY_SPANS]; - int num_gray_spans; + TPixmap target; FT_Raster_Span_Func render_span; void* render_span_data; - int span_y; PCell* ycells; @@ -482,17 +480,17 @@ typedef ptrdiff_t FT_PtrDist; static void gray_dump_cells( RAS_ARG ) { - int yindex; + int y; - for ( yindex = 0; yindex < ras.count_ey; yindex++ ) + for ( y = ras.min_ey; y < ras.max_ey; y++ ) { - PCell cell; + PCell cell = ras.ycells[y - ras.min_ey]; - printf( "%3d:", yindex ); + printf( "%3d:", y ); - for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next ) + for ( ; cell != NULL; cell = cell->next ) printf( " (%3d, c:%4d, a:%6d)", cell->x, cell->cover, cell->area ); printf( "\n" ); @@ -513,10 +511,10 @@ typedef ptrdiff_t FT_PtrDist; TCoord x = ras.ex; - if ( x > ras.count_ex ) - x = ras.count_ex; + if ( x > ras.max_ex ) + x = ras.max_ex; - pcell = &ras.ycells[ras.ey]; + pcell = &ras.ycells[ras.ey - ras.min_ey]; for (;;) { cell = *pcell; @@ -579,14 +577,11 @@ typedef ptrdiff_t FT_PtrDist; /* All cells that are on the left of the clipping region go to the */ /* min_ex - 1 horizontal position. */ - ey -= ras.min_ey; - if ( ex > ras.max_ex ) ex = ras.max_ex; - ex -= ras.min_ex; - if ( ex < 0 ) - ex = -1; + if ( ex < ras.min_ex ) + ex = ras.min_ex - 1; /* are we moving to a different cell ? */ if ( ex != ras.ex || ey != ras.ey ) @@ -601,34 +596,11 @@ typedef ptrdiff_t FT_PtrDist; ras.ey = ey; } - ras.invalid = ( (unsigned int)ey >= (unsigned int)ras.count_ey || - ex >= ras.count_ex ); + ras.invalid = ( ey >= ras.max_ey || ey < ras.min_ey || + ex >= ras.max_ex ); } - /*************************************************************************/ - /* */ - /* Start a new contour at a given cell. */ - /* */ - static void - gray_start_cell( RAS_ARG_ TCoord ex, - TCoord ey ) - { - if ( ex > ras.max_ex ) - ex = ras.max_ex; - - if ( ex < ras.min_ex ) - ex = ras.min_ex - 1; - - ras.area = 0; - ras.cover = 0; - ras.ex = ex - ras.min_ex; - ras.ey = ey - ras.min_ey; - ras.invalid = 0; - - gray_set_cell( RAS_VAR_ ex, ey ); - } - #ifndef FT_LONG64 /*************************************************************************/ @@ -657,14 +629,14 @@ typedef ptrdiff_t FT_PtrDist; return; } - fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); - fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); + fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); + fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); + delta = y2 - y1; /* everything is located in a single cell. That is easy! */ /* */ if ( ex1 == ex2 ) { - delta = y2 - y1; ras.area += (TArea)(( fx1 + fx2 ) * delta); ras.cover += delta; return; @@ -673,14 +645,17 @@ typedef ptrdiff_t FT_PtrDist; /* ok, we'll have to render a run of adjacent cells on the same */ /* scanline... */ /* */ - p = ( ONE_PIXEL - fx1 ) * ( y2 - y1 ); - first = ONE_PIXEL; - incr = 1; - dx = x2 - x1; + dx = x2 - x1; - if ( dx < 0 ) + if ( dx > 0 ) { - p = fx1 * ( y2 - y1 ); + p = ( ONE_PIXEL - fx1 ) * delta; + first = ONE_PIXEL; + incr = 1; + } + else + { + p = fx1 * delta; first = 0; incr = -1; dx = -dx; @@ -764,8 +739,6 @@ typedef ptrdiff_t FT_PtrDist; dy = to_y - ras.y; /* vertical line - avoid calling gray_render_scanline */ - incr = 1; - if ( dx == 0 ) { TCoord ex = TRUNC( ras.x ); @@ -773,8 +746,12 @@ typedef ptrdiff_t FT_PtrDist; TArea area; - first = ONE_PIXEL; - if ( dy < 0 ) + if ( dy > 0) + { + first = ONE_PIXEL; + incr = 1; + } + else { first = 0; incr = -1; @@ -806,11 +783,13 @@ typedef ptrdiff_t FT_PtrDist; } /* ok, we have to render several scanlines */ - p = ( ONE_PIXEL - fy1 ) * dx; - first = ONE_PIXEL; - incr = 1; - - if ( dy < 0 ) + if ( dy > 0) + { + p = ( ONE_PIXEL - fy1 ) * dx; + first = ONE_PIXEL; + incr = 1; + } + else { p = fy1 * dx; first = 0; @@ -1218,15 +1197,11 @@ typedef ptrdiff_t FT_PtrDist; TPos x, y; - /* record current cell, if any */ - if ( !ras.invalid ) - gray_record_cell( RAS_VAR ); - /* start to a new position */ x = UPSCALE( to->x ); y = UPSCALE( to->y ); - gray_start_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) ); + gray_set_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) ); ras.x = x; ras.y = y; @@ -1264,60 +1239,14 @@ typedef ptrdiff_t FT_PtrDist; } - static void - gray_render_span( int y, - int count, - const FT_Span* spans, - gray_PWorker worker ) - { - unsigned char* p; - FT_Bitmap* map = &worker->target; - - - /* first of all, compute the scanline offset */ - p = (unsigned char*)map->buffer - y * map->pitch; - if ( map->pitch >= 0 ) - p += ( map->rows - 1 ) * (unsigned int)map->pitch; - - for ( ; count > 0; count--, spans++ ) - { - unsigned char coverage = spans->coverage; - - - if ( coverage ) - { - unsigned char* q = p + spans->x; - - - /* For small-spans it is faster to do it by ourselves than - * calling `memset'. This is mainly due to the cost of the - * function call. - */ - switch ( spans->len ) - { - case 7: *q++ = coverage; - case 6: *q++ = coverage; - case 5: *q++ = coverage; - case 4: *q++ = coverage; - case 3: *q++ = coverage; - case 2: *q++ = coverage; - case 1: *q = coverage; - case 0: break; - default: - FT_MEM_SET( q, coverage, spans->len ); - } - } - } - } - - static void gray_hline( RAS_ARG_ TCoord x, TCoord y, TArea area, TCoord acount ) { - int coverage; + int coverage; + FT_Span span; /* compute the coverage line's coverage, depending on the */ @@ -1346,64 +1275,37 @@ typedef ptrdiff_t FT_PtrDist; coverage = 255; } - y += ras.min_ey; - x += ras.min_ex; - - if ( coverage ) + if ( ras.render_span ) /* for FT_RASTER_FLAG_DIRECT only */ { - FT_Span* span; - int count; + span.x = (short)x; + span.len = (unsigned short)acount; + span.coverage = (unsigned char)coverage; + + ras.render_span( y, 1, &span, ras.render_span_data ); + } + else + { + unsigned char* q = ras.target.origin - ras.target.pitch * y + x; + unsigned char c = (unsigned char)coverage; - /* see whether we can add this span to the current list */ - count = ras.num_gray_spans; - span = ras.gray_spans + count - 1; - if ( span->coverage == coverage && - span->x + span->len == x && - ras.span_y == y && - count > 0 ) + /* For small-spans it is faster to do it by ourselves than + * calling `memset'. This is mainly due to the cost of the + * function call. + */ + switch ( acount ) { - span->len = (unsigned short)( span->len + acount ); - return; + case 7: *q++ = c; + case 6: *q++ = c; + case 5: *q++ = c; + case 4: *q++ = c; + case 3: *q++ = c; + case 2: *q++ = c; + case 1: *q = c; + case 0: break; + default: + FT_MEM_SET( q, c, acount ); } - - if ( ras.span_y != y || count >= FT_MAX_GRAY_SPANS ) - { - if ( ras.render_span && count > 0 ) - ras.render_span( ras.span_y, count, ras.gray_spans, - ras.render_span_data ); - -#ifdef FT_DEBUG_LEVEL_TRACE - - if ( count > 0 ) - { - int n; - - - FT_TRACE7(( "y = %3d ", ras.span_y )); - span = ras.gray_spans; - for ( n = 0; n < count; n++, span++ ) - FT_TRACE7(( "[%d..%d]:%02x ", - span->x, span->x + span->len - 1, span->coverage )); - FT_TRACE7(( "\n" )); - } - -#endif /* FT_DEBUG_LEVEL_TRACE */ - - ras.num_gray_spans = 0; - ras.span_y = (int)y; - - span = ras.gray_spans; - } - else - span++; - - /* add a gray span to the current list */ - span->x = (short)x; - span->len = (unsigned short)acount; - span->coverage = (unsigned char)coverage; - - ras.num_gray_spans++; } } @@ -1411,22 +1313,19 @@ typedef ptrdiff_t FT_PtrDist; static void gray_sweep( RAS_ARG ) { - int yindex; + int y; if ( ras.num_cells == 0 ) return; - ras.num_gray_spans = 0; - ras.span_y = 0; - FT_TRACE7(( "gray_sweep: start\n" )); - for ( yindex = 0; yindex < ras.count_ey; yindex++ ) + for ( y = ras.min_ey; y < ras.max_ey; y++ ) { - PCell cell = ras.ycells[yindex]; + PCell cell = ras.ycells[y - ras.min_ey]; TCoord cover = 0; - TCoord x = 0; + TCoord x = ras.min_ex; for ( ; cell != NULL; cell = cell->next ) @@ -1434,48 +1333,25 @@ typedef ptrdiff_t FT_PtrDist; TArea area; - if ( cell->x > x && cover != 0 ) - gray_hline( RAS_VAR_ x, yindex, (TArea)cover * ( ONE_PIXEL * 2 ), + if ( cover != 0 && cell->x > x ) + gray_hline( RAS_VAR_ x, y, (TArea)cover * ( ONE_PIXEL * 2 ), cell->x - x ); cover += cell->cover; area = (TArea)cover * ( ONE_PIXEL * 2 ) - cell->area; - if ( area != 0 && cell->x >= 0 ) - gray_hline( RAS_VAR_ cell->x, yindex, area, 1 ); + if ( area != 0 && cell->x >= ras.min_ex ) + gray_hline( RAS_VAR_ cell->x, y, area, 1 ); x = cell->x + 1; } if ( cover != 0 ) - gray_hline( RAS_VAR_ x, yindex, (TArea)cover * ( ONE_PIXEL * 2 ), - ras.count_ex - x ); - } - - if ( ras.render_span && ras.num_gray_spans > 0 ) - ras.render_span( ras.span_y, ras.num_gray_spans, - ras.gray_spans, ras.render_span_data ); - -#ifdef FT_DEBUG_LEVEL_TRACE - - if ( ras.num_gray_spans > 0 ) - { - FT_Span* span; - int n; - - - FT_TRACE7(( "y = %3d ", ras.span_y )); - span = ras.gray_spans; - for ( n = 0; n < ras.num_gray_spans; n++, span++ ) - FT_TRACE7(( "[%d..%d]:%02x ", - span->x, span->x + span->len - 1, span->coverage )); - FT_TRACE7(( "\n" )); + gray_hline( RAS_VAR_ x, y, (TArea)cover * ( ONE_PIXEL * 2 ), + ras.max_ex - x ); } FT_TRACE7(( "gray_sweep: end\n" )); - -#endif /* FT_DEBUG_LEVEL_TRACE */ - } @@ -1839,13 +1715,6 @@ typedef ptrdiff_t FT_PtrDist; #endif /* STANDALONE_ */ - typedef struct gray_TBand_ - { - TCoord min, max; - - } gray_TBand; - - FT_DEFINE_OUTLINE_FUNCS( func_interface, @@ -1895,47 +1764,49 @@ typedef ptrdiff_t FT_PtrDist; #ifdef __REACTOS__ TCell *buffer; #else - TCell buffer[FT_MAX_GRAY_POOL]; + TCell buffer[FT_MAX_GRAY_POOL]; #endif - const int band_size = FT_MAX_GRAY_POOL / 8; - gray_TBand bands[32]; - gray_TBand* band; - int n, num_bands; - TCoord min, max, max_y; + TCoord band_size = FT_MAX_GRAY_POOL / 8; + TCoord count = ras.max_ey - ras.min_ey; + int num_bands; + TCoord min, max, max_y; + TCoord bands[32]; /* enough to accommodate bisections */ + TCoord* band; #ifdef __REACTOS__ buffer = malloc(FT_MAX(FT_RENDER_POOL_SIZE, 2048)); #endif /* set up vertical bands */ - num_bands = (int)( ( ras.max_ey - ras.min_ey ) / band_size ); - if ( num_bands == 0 ) - num_bands = 1; - if ( num_bands >= 39 ) - num_bands = 39; + if ( count > band_size ) + { + /* two divisions rounded up */ + num_bands = (int)( ( count + band_size - 1) / band_size ); + band_size = ( count + num_bands - 1 ) / num_bands; + } min = ras.min_ey; max_y = ras.max_ey; - for ( n = 0; n < num_bands; n++, min = max ) + for ( ; min < max_y; min = max ) { max = min + band_size; - if ( n == num_bands - 1 || max > max_y ) + if ( max > max_y ) max = max_y; - bands[0].min = min; - bands[0].max = max; - band = bands; + band = bands; + band[1] = min; + band[0] = max; do { - TCoord bottom, top, middle; + TCoord width = band[0] - band[1]; int error; /* memory management */ { - size_t ycount = (size_t)( band->max - band->min ); + size_t ycount = (size_t)width; size_t cell_start; @@ -1955,9 +1826,8 @@ typedef ptrdiff_t FT_PtrDist; ras.num_cells = 0; ras.invalid = 1; - ras.min_ey = band->min; - ras.max_ey = band->max; - ras.count_ey = band->max - band->min; + ras.min_ey = band[1]; + ras.max_ey = ras.ey = band[0]; error = gray_convert_glyph_inner( RAS_VAR ); @@ -1977,13 +1847,11 @@ typedef ptrdiff_t FT_PtrDist; ReduceBands: /* render pool overflow; we will reduce the render band by half */ - bottom = band->min; - top = band->max; - middle = bottom + ( ( top - bottom ) >> 1 ); + width >>= 1; /* This is too complex for a single scanline; there must */ /* be some problems. */ - if ( middle == bottom ) + if ( width == 0 ) { FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" )); #ifdef __REACTOS__ @@ -1992,11 +1860,9 @@ typedef ptrdiff_t FT_PtrDist; return 1; } - band[1].min = bottom; - band[1].max = middle; - band[0].min = middle; - band[0].max = top; band++; + band[1] = band[0]; + band[0] += width; } while ( band >= bands ); } @@ -2016,12 +1882,18 @@ typedef ptrdiff_t FT_PtrDist; const FT_Bitmap* target_map = params->target; FT_BBox cbox, clip; +#ifndef FT_STATIC_RASTER gray_TWorker worker[1]; +#endif if ( !raster ) return FT_THROW( Invalid_Argument ); + /* this version does not support monochrome rendering */ + if ( !( params->flags & FT_RASTER_FLAG_AA ) ) + return FT_THROW( Invalid_Mode ); + if ( !outline ) return FT_THROW( Invalid_Outline ); @@ -2036,9 +1908,19 @@ typedef ptrdiff_t FT_PtrDist; outline->contours[outline->n_contours - 1] + 1 ) return FT_THROW( Invalid_Outline ); - /* if direct mode is not set, we must have a target bitmap */ - if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) ) + ras.outline = *outline; + + if ( params->flags & FT_RASTER_FLAG_DIRECT ) { + if ( !params->gray_spans ) + return 0; + + ras.render_span = (FT_Raster_Span_Func)params->gray_spans; + ras.render_span_data = params->user; + } + else + { + /* if direct mode is not set, we must have a target bitmap */ if ( !target_map ) return FT_THROW( Invalid_Argument ); @@ -2048,11 +1930,18 @@ typedef ptrdiff_t FT_PtrDist; if ( !target_map->buffer ) return FT_THROW( Invalid_Argument ); - } - /* this version does not support monochrome rendering */ - if ( !( params->flags & FT_RASTER_FLAG_AA ) ) - return FT_THROW( Invalid_Mode ); + if ( target_map->pitch < 0 ) + ras.target.origin = target_map->buffer; + else + ras.target.origin = target_map->buffer + + ( target_map->rows - 1 ) * (unsigned int)target_map->pitch; + + ras.target.pitch = target_map->pitch; + + ras.render_span = (FT_Raster_Span_Func)NULL; + ras.render_span_data = NULL; + } FT_Outline_Get_CBox( outline, &cbox ); @@ -2095,23 +1984,6 @@ typedef ptrdiff_t FT_PtrDist; if ( ras.max_ex <= ras.min_ex || ras.max_ey <= ras.min_ey ) return 0; - ras.count_ex = ras.max_ex - ras.min_ex; - ras.count_ey = ras.max_ey - ras.min_ey; - - ras.outline = *outline; - - if ( params->flags & FT_RASTER_FLAG_DIRECT ) - { - ras.render_span = (FT_Raster_Span_Func)params->gray_spans; - ras.render_span_data = params->user; - } - else - { - ras.target = *target_map; - ras.render_span = (FT_Raster_Span_Func)gray_render_span; - ras.render_span_data = &ras; - } - return gray_convert_glyph( RAS_VAR ); } diff --git a/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/Makefile b/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/Makefile index 2e619299cdf..24dc49c5639 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/Makefile +++ b/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/Makefile @@ -5,7 +5,12 @@ TOP_DIR ?= ../../.. OBJ_DIR ?= $(TOP_DIR)/objs -# The setup below is for gcc on a Unix-like platform. +# The setup below is for gcc on a Unix-like platform, +# where FreeType has been set up to create a static library +# (which is the default). + +VPATH = $(OBJ_DIR) \ + $(OBJ_DIR)/.libs SRC_DIR = $(TOP_DIR)/src/tools/ftrandom @@ -20,16 +25,21 @@ WFLAGS = -Wmissing-prototypes \ -Wchar-subscripts \ -Wsequence-point CFLAGS = $(WFLAGS) \ - -g \ - -I $(TOP_DIR)/include + -g +INCLUDES = -I $(TOP_DIR)/include +LDFLAGS = LIBS = -lm \ - -L $(OBJ_DIR) \ - -lfreetype \ - -lz + -lz \ + -lpng \ + -lbz2 \ + -lharfbuzz all: $(OBJ_DIR)/ftrandom -$(OBJ_DIR)/ftrandom: $(SRC_DIR)/ftrandom.c $(OBJ_DIR)/libfreetype.a - $(CC) -o $(OBJ_DIR)/ftrandom $(CFLAGS) $(SRC_DIR)/ftrandom.c $(LIBS) +$(OBJ_DIR)/ftrandom.o: $(SRC_DIR)/ftrandom.c + $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< + +$(OBJ_DIR)/ftrandom: $(OBJ_DIR)/ftrandom.o libfreetype.a + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) # EOF diff --git a/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README b/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README index 71bf05323da..7c610864b6a 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README +++ b/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/README @@ -1,48 +1,69 @@ ftrandom --------- +======== This program expects a set of directories containing good fonts, and a set of extensions of fonts to be tested. It will randomly pick a font, copy it, -introduce and error and then test it. +introduce an error and then test it. -The FreeType tests are quite basic: +The FreeType tests are quite basic; for each erroneous font ftrandom - For each erroneous font it - forks off a new tester; - initializes the library; - opens each font in the file; - loads each glyph; - (optionally reviewing the contours of the glyph) - (optionally rasterizing) - closes the face. + . forks off a new tester, + . initializes the library, + . opens each font in the file, + . loads each glyph, + . optionally reviews the contours of the glyph, + . optionally rasterizes the glyph, and + . closes the face. -If the tester exits with a signal, or takes longer than 20 seconds then -ftrandom saves the erroneous font and continues. If the tester exits -normally or with an error, then the superstructure removes the test font and -continues. +If a tester takes longer than 20 seconds, ftrandom saves the erroneous font +and continues. If the tester exits normally or with an error, then the +superstructure removes the test font and continues. -Arguments are: + +Command line options +-------------------- --all Test every font in the directory(ies) no matter - what its extension (some CID-keyed fonts have no - extension). - --check-outlines Call FT_Outline_Decompose on each glyph. + what its extension. + --check-outlines Call `FT_Outline_Decompose' on each glyph. --dir Append to the list of directories to search - for good fonts. + for good fonts. No recursive search. --error-count Introduce single-byte errors into the - erroneous fonts. + erroneous fonts (default: 1). --error-fraction Multiply the file size of the font by and introduce that many errors into the erroneous - font file. - --ext Add to the set of font types tested. Known - extensions are `ttf', `otf', `ttc', `cid', `pfb', - `pfa', `bdf', `pcf', `pfr', `fon', `otb', and - `cff'. + font file. should be in the range [0;1] + (default: 0.0). + --ext Add to the set of font types tested. --help Print out this list of options. --nohints Specify FT_LOAD_NO_HINTING when loading glyphs. - --rasterize Call FT_Render_Glyph as well as loading it. + --rasterize Call `FT_Render_Glyph' as well as loading it. --result This is the directory in which test files are placed. --test Run a single test on a pre-generated testcase. - Done in the current process so it can be debugged - more easily. + This is done in the current process so it can be + debugged more easily. + +The default font extensions tested by ftrandom are + + .ttf .otf .ttc .cid .pfb .pfa .bdf .pcf .pfr .fon .otb .cff + +The default font directory is controlled by the macro `GOOD_FONTS_DIR' in +the source code (and can be thus specified during compilation); its default +value is + + /usr/local/share/fonts + +The default result directory is `results' (in the current directory). + + +Compilation +----------- + +Two possible solutions. + +. Run ftrandom within a debugging tool like `valgrind' to catch various + memory issues. + +. Compile FreeType with sanitizer flags as provided by gcc or clang, for + example, then link it with ftrandom. diff --git a/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/ftrandom.c b/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/ftrandom.c index 9a5b632673c..ff311690927 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/ftrandom.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/tools/ftrandom/ftrandom.c @@ -29,6 +29,9 @@ /* This file is now part of the FreeType library */ +#define _XOPEN_SOURCE 500 /* for `kill', `strdup', `random', and `srandom' */ + + #include #include #include @@ -38,7 +41,6 @@ #include #include #include -#include #include #include @@ -56,7 +58,7 @@ static int rasterize = false; static char* results_dir = "results"; -#define GOOD_FONTS_DIR "/home/wl/freetype-testfonts" +#define GOOD_FONTS_DIR "/usr/local/share/fonts" static char* default_dir_list[] = { @@ -81,28 +83,31 @@ NULL }; - static int error_count = 1; - static int error_fraction = 0; + static unsigned int error_count = 1; + static double error_fraction = 0.0; static FT_F26Dot6 font_size = 12 * 64; static struct fontlist { char* name; - int len; + long len; unsigned int isbinary: 1; unsigned int isascii: 1; unsigned int ishex: 1; } *fontlist; - static int fcnt; + static unsigned int fcnt; static int FT_MoveTo( const FT_Vector *to, void *user ) { + FT_UNUSED( to ); + FT_UNUSED( user ); + return 0; } @@ -111,6 +116,9 @@ FT_LineTo( const FT_Vector *to, void *user ) { + FT_UNUSED( to ); + FT_UNUSED( user ); + return 0; } @@ -120,6 +128,10 @@ const FT_Vector *to, void *user ) { + FT_UNUSED( _cp ); + FT_UNUSED( to ); + FT_UNUSED( user ); + return 0; } @@ -130,6 +142,11 @@ const FT_Vector *to, void *user ) { + FT_UNUSED( cp1 ); + FT_UNUSED( cp2 ); + FT_UNUSED( to ); + FT_UNUSED( user ); + return 0; } @@ -147,8 +164,8 @@ static void TestFace( FT_Face face ) { - int gid; - int load_flags = FT_LOAD_DEFAULT; + unsigned int gid; + int load_flags = FT_LOAD_DEFAULT; if ( check_outlines && @@ -202,7 +219,7 @@ TestFace( face ); else { - int i, num; + long i, num; num = face->num_faces; @@ -215,6 +232,8 @@ } } + FT_Done_FreeType( context ); + exit( 0 ); } @@ -329,9 +348,10 @@ FindFonts( char** fontdirs, char** extensions ) { - int i, max; - char buffer[1025]; - struct stat statb; + int i; + unsigned int max; + char buffer[1025]; + struct stat statb; max = 0; @@ -392,13 +412,13 @@ } - static int + static unsigned int getErrorCnt( struct fontlist* item ) { - if ( error_count == 0 && error_fraction == 0 ) + if ( error_count == 0 && error_fraction == 0.0 ) return 0; - return error_count + ceil( error_fraction * item->len ); + return error_count + (unsigned int)( error_fraction * item->len ); } @@ -417,10 +437,10 @@ copyfont( struct fontlist* item, char* newfont ) { - static char buffer[8096]; - FILE *good, *new; - int len; - int i, err_cnt; + static char buffer[8096]; + FILE *good, *new; + size_t len; + unsigned int i, err_cnt; good = fopen( item->name, "r" ); @@ -446,7 +466,7 @@ err_cnt = getErrorCnt( item ); for ( i = 0; i < err_cnt; ++i ) { - fseek( new, getRandom( 0, item->len - 1 ), SEEK_SET ); + fseek( new, getRandom( 0, (int)( item->len - 1 ) ), SEEK_SET ); if ( item->isbinary ) putc( getRandom( 0, 0xFF ), new ); @@ -484,6 +504,8 @@ static void abort_test( int sig ) { + FT_UNUSED( sig ); + /* If a time-out happens, then kill the child */ kill( child_pid, SIGFPE ); write( 2, "Timeout... ", 11 ); @@ -493,7 +515,7 @@ static void do_test( void ) { - int i = getRandom( 0, fcnt - 1 ); + int i = getRandom( 0, (int)( fcnt - 1 ) ); static int test_num = 0; char buffer[1024]; @@ -534,22 +556,42 @@ usage( FILE* out, char* name ) { + char** d = default_dir_list; + char** e = default_ext_list; + + fprintf( out, "%s [options] -- Generate random erroneous fonts\n" " and attempt to parse them with FreeType.\n\n", name ); fprintf( out, " --all All non-directory files are assumed to be fonts.\n" ); fprintf( out, " --check-outlines Make sure we can parse the outlines of each glyph.\n" ); - fprintf( out, " --dir Append to list of font search directories.\n" ); - fprintf( out, " --error-count Introduce single byte errors into each font.\n" ); + fprintf( out, " --dir Append to list of font search directories\n" + " (no recursive search).\n" ); + fprintf( out, " --error-count Introduce single byte errors into each font\n" + " (default: 1)\n" ); fprintf( out, " --error-fraction Introduce *filesize single byte errors\n" - " into each font.\n" ); + " into each font (default: 0.0).\n" ); fprintf( out, " --ext Add to list of extensions indicating fonts.\n" ); fprintf( out, " --help Print this.\n" ); fprintf( out, " --nohints Turn off hinting.\n" ); fprintf( out, " --rasterize Attempt to rasterize each glyph.\n" ); - fprintf( out, " --results Directory in which to place the test fonts.\n" ); + fprintf( out, " --results Place the created test fonts into \n" + " (default: `results')\n" ); fprintf( out, " --size Use the given font size for the tests.\n" ); fprintf( out, " --test Run a single test on an already existing file.\n" ); + fprintf( out, "\n" ); + + fprintf( out, "Default font extensions:\n" ); + fprintf( out, " " ); + while ( *e ) + fprintf( out, " .%s", *e++ ); + fprintf( out, "\n" ); + + fprintf( out, "Default font directories:\n" ); + fprintf( out, " " ); + while ( *d ) + fprintf( out, " %s", *d++ ); + fprintf( out, "\n" ); } @@ -564,8 +606,8 @@ char* testfile = NULL; - dirs = calloc( argc + 1, sizeof ( char ** ) ); - exts = calloc( argc + 1, sizeof ( char ** ) ); + dirs = calloc( (size_t)( argc + 1 ), sizeof ( char ** ) ); + exts = calloc( (size_t)( argc + 1 ), sizeof ( char ** ) ); for ( i = 1; i < argc; ++i ) { @@ -585,9 +627,9 @@ else if ( strcmp( pt, "-error-count" ) == 0 ) { if ( !rset ) - error_fraction = 0; + error_fraction = 0.0; rset = true; - error_count = strtol( argv[++i], &end, 10 ); + error_count = (unsigned int)strtoul( argv[++i], &end, 10 ); if ( *end != '\0' ) { fprintf( stderr, "Bad value for error-count: %s\n", argv[i] ); @@ -605,6 +647,11 @@ fprintf( stderr, "Bad value for error-fraction: %s\n", argv[i] ); exit( 1 ); } + if ( error_fraction < 0.0 || error_fraction > 1.0 ) + { + fprintf( stderr, "error-fraction must be in the range [0;1]\n" ); + exit( 1 ); + } } else if ( strcmp( pt, "-ext" ) == 0 ) exts[ecnt++] = argv[++i]; @@ -658,7 +705,7 @@ ExecuteTest( testfile ); /* This should never return */ time( &now ); - srandom( now ); + srandom( (unsigned int)now ); FindFonts( dirs, exts ); mkdir( results_dir, 0755 ); diff --git a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttdriver.c b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttdriver.c index c9d4081efe3..6520c93df65 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttdriver.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttdriver.c @@ -61,26 +61,48 @@ static FT_Error tt_property_set( FT_Module module, /* TT_Driver */ const char* property_name, - const void* value ) + const void* value, + FT_Bool value_is_string ) { FT_Error error = FT_Err_Ok; TT_Driver driver = (TT_Driver)module; +#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + FT_UNUSED( value_is_string ); +#endif + if ( !ft_strcmp( property_name, "interpreter-version" ) ) { - FT_UInt* interpreter_version = (FT_UInt*)value; + FT_UInt interpreter_version; - if ( *interpreter_version == TT_INTERPRETER_VERSION_35 +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES + if ( value_is_string ) + { + const char* s = (const char*)value; + + + interpreter_version = (FT_UInt)ft_strtol( s, NULL, 10 ); + } + else +#endif + { + FT_UInt* iv = (FT_UInt*)value; + + + interpreter_version = *iv; + } + + if ( interpreter_version == TT_INTERPRETER_VERSION_35 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - || *interpreter_version == TT_INTERPRETER_VERSION_38 + || interpreter_version == TT_INTERPRETER_VERSION_38 #endif #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - || *interpreter_version == TT_INTERPRETER_VERSION_40 + || interpreter_version == TT_INTERPRETER_VERSION_40 #endif ) - driver->interpreter_version = *interpreter_version; + driver->interpreter_version = interpreter_version; else error = FT_ERR( Unimplemented_Feature ); @@ -317,6 +339,25 @@ { error = tt_size_reset( ttsize ); ttsize->root.metrics = ttsize->metrics; + +#ifdef TT_USE_BYTECODE_INTERPRETER + /* for the `MPS' bytecode instruction we need the point size */ + { + FT_UInt resolution = ttsize->metrics.x_ppem > ttsize->metrics.y_ppem + ? req->horiResolution + : req->vertResolution; + + + /* if we don't have a resolution value, assume 72dpi */ + if ( req->type == FT_SIZE_REQUEST_TYPE_SCALES || + !resolution ) + resolution = 72; + + ttsize->point_size = FT_MulDiv( ttsize->ttmetrics.ppem, + 64 * 72, + resolution ); + } +#endif } return error; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgload.c b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgload.c index 8be9b6ae65d..2d0b29f0715 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgload.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgload.c @@ -1436,13 +1436,12 @@ FT_TRACE5(( " nesting level: %d\n", recurse_count )); #endif - /* some fonts have an incorrect value of `maxComponentDepth', */ - /* thus we allow depth 1 to catch the majority of them */ - if ( recurse_count > 1 && - recurse_count > face->max_profile.maxComponentDepth ) + /* some fonts have an incorrect value of `maxComponentDepth' */ + if ( recurse_count > face->max_profile.maxComponentDepth ) { - error = FT_THROW( Invalid_Composite ); - goto Exit; + FT_TRACE1(( "load_truetype_glyph: maxComponentDepth set to %d\n", + recurse_count )); + face->max_profile.maxComponentDepth = (FT_UShort)recurse_count; } #ifndef FT_CONFIG_OPTION_INCREMENTAL @@ -1808,11 +1807,11 @@ for ( i = 0; i < limit; i++, subglyph++ ) { - /* XXX: overflow check for subglyph->{arg1,arg2}. */ - /* Deltas must be within signed 16-bit, */ - /* but the restriction of summed deltas is not clear */ - subglyph->arg1 = (FT_Int16)points[i].x; - subglyph->arg2 = (FT_Int16)points[i].y; + if ( subglyph->flags & ARGS_ARE_XY_VALUES ) + { + subglyph->arg1 = (FT_Int16)points[i].x; + subglyph->arg2 = (FT_Int16)points[i].y; + } } loader->pp1.x = points[i + 0].x; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgxvar.c b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgxvar.c index 9a02c5a8c14..c0d013c17fe 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgxvar.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttgxvar.c @@ -158,48 +158,49 @@ return NULL; } - if ( FT_NEW_ARRAY( points, n ) ) + /* in the nested loops below we increase `i' twice; */ + /* it is faster to simply allocate one more slot */ + /* than to add another test within the loop */ + if ( FT_NEW_ARRAY( points, n + 1 ) ) return NULL; *point_cnt = n; - i = 0; + first = 0; + i = 0; while ( i < n ) { runcnt = FT_GET_BYTE(); if ( runcnt & GX_PT_POINTS_ARE_WORDS ) { runcnt &= GX_PT_POINT_RUN_COUNT_MASK; - first = FT_GET_USHORT(); + first += FT_GET_USHORT(); points[i++] = first; - if ( runcnt < 1 || i + runcnt > n ) - goto Exit; - /* first point not included in run count */ for ( j = 0; j < runcnt; j++ ) { first += FT_GET_USHORT(); points[i++] = first; + if ( i >= n ) + break; } } else { - first = FT_GET_BYTE(); + first += FT_GET_BYTE(); points[i++] = first; - if ( runcnt < 1 || i + runcnt > n ) - goto Exit; - for ( j = 0; j < runcnt; j++ ) { first += FT_GET_BYTE(); points[i++] = first; + if ( i >= n ) + break; } } } - Exit: return points; } @@ -1716,12 +1717,11 @@ /* modeled after `Ins_IUP */ static void - tt_handle_deltas( FT_Outline* outline, - FT_Vector* in_points, - FT_Bool* has_delta ) + tt_interpolate_deltas( FT_Outline* outline, + FT_Vector* out_points, + FT_Vector* in_points, + FT_Bool* has_delta ) { - FT_Vector* out_points; - FT_Int first_point; FT_Int end_point; @@ -1736,8 +1736,6 @@ if ( !outline->n_contours ) return; - out_points = outline->points; - contour = 0; point = 0; @@ -1841,6 +1839,7 @@ GX_Blend blend = face->blend; FT_Vector* points_org = NULL; + FT_Vector* points_out = NULL; FT_Bool* has_delta = NULL; FT_Error error; @@ -1872,6 +1871,7 @@ } if ( FT_NEW_ARRAY( points_org, n_points ) || + FT_NEW_ARRAY( points_out, n_points ) || FT_NEW_ARRAY( has_delta, n_points ) ) goto Fail1; @@ -1894,7 +1894,8 @@ offsetToData = FT_GET_USHORT(); /* rough sanity test */ - if ( offsetToData + tupleCount * 4 > blend->gvar_size ) + if ( offsetToData + ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) * 4 > + blend->gvar_size ) { FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" " invalid glyph variation array header\n" )); @@ -1922,6 +1923,9 @@ FT_TRACE5(( "gvar: there are %d tuples:\n", tupleCount & GX_TC_TUPLE_COUNT_MASK )); + for ( j = 0; j < n_points; j++ ) + points_org[j] = outline->points[j]; + for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ ) { FT_UInt tupleDataSize; @@ -1976,10 +1980,10 @@ here = FT_Stream_FTell( stream ); + FT_Stream_SeekSet( stream, offsetToData ); + if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) { - FT_Stream_SeekSet( stream, offsetToData ); - localpoints = ft_var_readpackedpoints( stream, blend->gvar_size, &point_count ); @@ -2015,22 +2019,20 @@ /* this means that there are deltas for every point in the glyph */ for ( j = 0; j < n_points; j++ ) { -#ifdef FT_DEBUG_LEVEL_TRACE - FT_Vector point_org = outline->points[j]; -#endif + FT_Pos delta_x = FT_MulFix( deltas_x[j], apply ); + FT_Pos delta_y = FT_MulFix( deltas_y[j], apply ); - outline->points[j].x += FT_MulFix( deltas_x[j], apply ); - outline->points[j].y += FT_MulFix( deltas_y[j], apply ); + outline->points[j].x += delta_x; + outline->points[j].y += delta_y; #ifdef FT_DEBUG_LEVEL_TRACE - if ( ( point_org.x != outline->points[j].x ) || - ( point_org.y != outline->points[j].y ) ) + if ( delta_x || delta_y ) { FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n", j, - point_org.x, - point_org.y, + outline->points[j].x - delta_x, + outline->points[j].y - delta_y, outline->points[j].x, outline->points[j].y )); count++; @@ -2044,9 +2046,6 @@ #endif } - else if ( localpoints == NULL ) - ; /* failure, ignore it */ - else { #ifdef FT_DEBUG_LEVEL_TRACE @@ -2058,13 +2057,13 @@ /* IUP bytecode instruction */ for ( j = 0; j < n_points; j++ ) { - points_org[j] = outline->points[j]; has_delta[j] = FALSE; + points_out[j] = points_org[j]; } for ( j = 0; j < point_count; j++ ) { - FT_UShort idx = localpoints[j]; + FT_UShort idx = points[j]; if ( idx >= n_points ) @@ -2072,34 +2071,43 @@ has_delta[idx] = TRUE; - outline->points[idx].x += FT_MulFix( deltas_x[j], apply ); - outline->points[idx].y += FT_MulFix( deltas_y[j], apply ); + points_out[idx].x += FT_MulFix( deltas_x[j], apply ); + points_out[idx].y += FT_MulFix( deltas_y[j], apply ); } /* no need to handle phantom points here, */ /* since solitary points can't be interpolated */ - tt_handle_deltas( outline, - points_org, - has_delta ); + tt_interpolate_deltas( outline, + points_out, + points_org, + has_delta ); -#ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE7(( " point deltas:\n" )); - for ( j = 0; j < n_points; j++) + for ( j = 0; j < n_points; j++ ) { - if ( ( points_org[j].x != outline->points[j].x ) || - ( points_org[j].y != outline->points[j].y ) ) + FT_Pos delta_x = points_out[j].x - points_org[j].x; + FT_Pos delta_y = points_out[j].y - points_org[j].y; + + + outline->points[j].x += delta_x; + outline->points[j].y += delta_y; + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( delta_x || delta_y ) { FT_TRACE7(( " %d: (%d, %d) -> (%d, %d)\n", j, - points_org[j].x, - points_org[j].y, + outline->points[j].x - delta_x, + outline->points[j].y - delta_y, outline->points[j].x, outline->points[j].y )); count++; } +#endif } +#ifdef FT_DEBUG_LEVEL_TRACE if ( !count ) FT_TRACE7(( " none\n" )); #endif @@ -2128,6 +2136,7 @@ Fail1: FT_FREE( points_org ); + FT_FREE( points_out ); FT_FREE( has_delta ); return error; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.c b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.c index 2e3f9ef9d72..2d15ea7121b 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.c @@ -26,10 +26,14 @@ #include FT_TRIGONOMETRY_H #include FT_SYSTEM_H #include FT_TRUETYPE_DRIVER_H +#include FT_MULTIPLE_MASTERS_H #include "ttinterp.h" #include "tterrors.h" #include "ttsubpix.h" +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT +#include "ttgxvar.h" +#endif #ifdef TT_USE_BYTECODE_INTERPRETER @@ -74,14 +78,6 @@ exc->func_dualproj( exc, (v)->x, (v)->y ) - /*************************************************************************/ - /* */ - /* Instruction dispatch function, as used by the interpreter. */ - /* */ - typedef void (*TInstruction_Function)( TT_ExecContext exc, - FT_Long* args ); - - /*************************************************************************/ /* */ /* Two simple bounds-checking macros. */ @@ -404,6 +400,7 @@ exec->maxIDefs = size->max_instruction_defs; exec->FDefs = size->function_defs; exec->IDefs = size->instruction_defs; + exec->pointSize = size->point_size; exec->tt_metrics = size->ttmetrics; exec->metrics = size->metrics; @@ -689,17 +686,17 @@ /* IUP[0] */ PACK( 0, 0 ), /* IUP[1] */ PACK( 0, 0 ), - /* SHP[0] */ PACK( 0, 0 ), - /* SHP[1] */ PACK( 0, 0 ), + /* SHP[0] */ PACK( 0, 0 ), /* loops */ + /* SHP[1] */ PACK( 0, 0 ), /* loops */ /* SHC[0] */ PACK( 1, 0 ), /* SHC[1] */ PACK( 1, 0 ), /* SHZ[0] */ PACK( 1, 0 ), /* SHZ[1] */ PACK( 1, 0 ), - /* SHPIX */ PACK( 1, 0 ), - /* IP */ PACK( 0, 0 ), + /* SHPIX */ PACK( 1, 0 ), /* loops */ + /* IP */ PACK( 0, 0 ), /* loops */ /* MSIRP[0] */ PACK( 2, 0 ), /* MSIRP[1] */ PACK( 2, 0 ), - /* AlignRP */ PACK( 0, 0 ), + /* AlignRP */ PACK( 0, 0 ), /* loops */ /* RTDG */ PACK( 0, 0 ), /* MIAP[0] */ PACK( 2, 0 ), /* MIAP[1] */ PACK( 2, 0 ), @@ -772,7 +769,7 @@ /* SANGW */ PACK( 1, 0 ), /* AA */ PACK( 1, 0 ), - /* FlipPT */ PACK( 0, 0 ), + /* FlipPT */ PACK( 0, 0 ), /* loops */ /* FlipRgON */ PACK( 2, 0 ), /* FlipRgOFF */ PACK( 2, 0 ), /* INS_$83 */ PACK( 0, 0 ), @@ -790,8 +787,8 @@ /* INS_$8F */ PACK( 0, 0 ), /* INS_$90 */ PACK( 0, 0 ), - /* INS_$91 */ PACK( 0, 0 ), - /* INS_$92 */ PACK( 0, 0 ), + /* GETVAR */ PACK( 0, 0 ), /* will be handled specially */ + /* GETDATA */ PACK( 0, 1 ), /* INS_$93 */ PACK( 0, 0 ), /* INS_$94 */ PACK( 0, 0 ), /* INS_$95 */ PACK( 0, 0 ), @@ -1073,8 +1070,13 @@ "7 INS_$8F", "7 INS_$90", +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + "6 GETVAR", + "7 GETDATA", +#else "7 INS_$91", "7 INS_$92", +#endif "7 INS_$93", "7 INS_$94", "7 INS_$95", @@ -2582,13 +2584,20 @@ Ins_MPS( TT_ExecContext exc, FT_Long* args ) { - /* Note: The point size should be irrelevant in a given font program; */ - /* we thus decide to return only the PPEM value. */ -#if 0 - args[0] = exc->metrics.pointSize; -#else - args[0] = exc->func_cur_ppem( exc ); -#endif + if ( NO_SUBPIXEL_HINTING ) + { + /* Microsoft's GDI bytecode interpreter always returns value 12; */ + /* we return the current PPEM value instead. */ + args[0] = exc->func_cur_ppem( exc ); + } + else + { + /* A possible practical application of the MPS instruction is to */ + /* implement optical scaling and similar features, which should be */ + /* based on perceptual attributes, thus independent of the */ + /* resolution. */ + args[0] = exc->pointSize; + } } @@ -2881,7 +2890,7 @@ /* */ /* NEG[]: NEGate */ /* Opcode range: 0x65 */ - /* Stack: f26.6 --> f26.6 */ + /* Stack: f26.6 --> f26.6 */ /* */ static void Ins_NEG( FT_Long* args ) @@ -3121,7 +3130,7 @@ /*************************************************************************/ /* */ /* MAX[]: MAXimum */ - /* Opcode range: 0x68 */ + /* Opcode range: 0x8B */ /* Stack: int32? int32? --> int32 */ /* */ static void @@ -3135,7 +3144,7 @@ /*************************************************************************/ /* */ /* MIN[]: MINimum */ - /* Opcode range: 0x69 */ + /* Opcode range: 0x8C */ /* Stack: int32? int32? --> int32 */ /* */ static void @@ -4010,6 +4019,7 @@ exc->error = FT_THROW( Nested_DEFS ); return; case 0x2D: /* ENDF */ + def->end = exc->IP; return; } } @@ -4493,7 +4503,7 @@ /* */ /* FLIPOFF[]: Set auto-FLIP to OFF */ /* Opcode range: 0x4E */ - /* Stack: --> */ + /* Stack: --> */ /* */ static void Ins_FLIPOFF( TT_ExecContext exc ) @@ -6096,7 +6106,6 @@ exc->GS.freeVector.x != 0 && !( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) control_value_cutin = minimum_distance = 0; - else #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ @@ -7236,7 +7245,7 @@ /* Return Bit(s): 8 */ /* */ if ( ( args[0] & 2 ) != 0 && exc->tt_metrics.rotated ) - K |= 0x80; + K |= 1 << 8; /********************************/ /* GLYPH STRETCHED */ @@ -7244,7 +7253,18 @@ /* Return Bit(s): 9 */ /* */ if ( ( args[0] & 4 ) != 0 && exc->tt_metrics.stretched ) - K |= 1 << 8; + K |= 1 << 9; + +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + /********************************/ + /* VARIATION GLYPH */ + /* Selector Bit: 3 */ + /* Return Bit(s): 10 */ + /* */ + /* XXX: UNDOCUMENTED! */ + if ( (args[0] & 8 ) != 0 && exc->face->blend ) + K |= 1 << 10; +#endif /********************************/ /* BI-LEVEL HINTING AND */ @@ -7388,6 +7408,57 @@ } +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + + /*************************************************************************/ + /* */ + /* GETVARIATION[]: get normalized variation (blend) coordinates */ + /* Opcode range: 0x91 */ + /* Stack: --> f2.14... */ + /* */ + /* XXX: UNDOCUMENTED! There is no official documentation from Apple for */ + /* this bytecode instruction. Active only if a font has GX */ + /* variation axes. */ + /* */ + static void + Ins_GETVARIATION( TT_ExecContext exc, + FT_Long* args ) + { + FT_UInt num_axes = exc->face->blend->num_axis; + FT_Fixed* coords = exc->face->blend->normalizedcoords; + + FT_UInt i; + + + if ( BOUNDS( num_axes, exc->stackSize + 1 - exc->top ) ) + { + exc->error = FT_THROW( Stack_Overflow ); + return; + } + + for ( i = 0; i < num_axes; i++ ) + args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */ + } + + + /*************************************************************************/ + /* */ + /* GETDATA[]: no idea what this is good for */ + /* Opcode range: 0x92 */ + /* Stack: --> 17 */ + /* */ + /* XXX: UNDOCUMENTED! There is no documentation from Apple for this */ + /* very weird bytecode instruction. */ + /* */ + static void + Ins_GETDATA( FT_Long* args ) + { + args[0] = 17; + } + +#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + + static void Ins_UNKNOWN( TT_ExecContext exc ) { @@ -7574,7 +7645,21 @@ exc->args = 0; } - exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 ); +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + if ( exc->opcode == 0x91 ) + { + /* this is very special: GETVARIATION returns */ + /* a variable number of arguments */ + + /* it is the job of the application to `activate' GX handling, */ + /* this is, calling any of the GX API functions on the current */ + /* font to select a variation instance */ + if ( exc->face->blend ) + exc->new_top = exc->args + exc->face->blend->num_axis; + } + else +#endif + exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 ); /* `new_top' is the new top of the stack, after the instruction's */ /* execution. `top' will be set to `new_top' after the `switch' */ @@ -7767,7 +7852,7 @@ Ins_ALIGNPTS( exc, args ); break; - case 0x28: /* ???? */ + case 0x28: /* RAW */ Ins_UNKNOWN( exc ); break; @@ -8119,10 +8204,33 @@ Ins_INSTCTRL( exc, args ); break; - case 0x8F: + case 0x8F: /* ADJUST */ + case 0x90: /* ADJUST */ Ins_UNKNOWN( exc ); break; +#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT + case 0x91: + /* it is the job of the application to `activate' GX handling, */ + /* this is, calling any of the GX API functions on the current */ + /* font to select a variation instance */ + if ( exc->face->blend ) + Ins_GETVARIATION( exc, args ); + else + Ins_UNKNOWN( exc ); + break; + + case 0x92: + /* there is at least one MS font (LaoUI.ttf version 5.01) that */ + /* uses IDEFs for 0x91 and 0x92; for this reason we activate */ + /* GETDATA for GX fonts only, similar to GETVARIATION */ + if ( exc->face->blend ) + Ins_GETDATA( args ); + else + Ins_UNKNOWN( exc ); + break; +#endif + default: if ( opcode >= 0xE0 ) Ins_MIRP( exc, args ); diff --git a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.h b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.h index df7ce51f1c6..53f09446bf8 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.h +++ b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttinterp.h @@ -170,6 +170,7 @@ FT_BEGIN_HEADER pts, twilight; + FT_Long pointSize; /* in 26.6 format */ FT_Size_Metrics metrics; TT_Size_Metrics tt_metrics; /* size metrics */ diff --git a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttobjs.h b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttobjs.h index ed61a7d5178..98ad383736b 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttobjs.h +++ b/reactos/sdk/lib/3rdparty/freetype/src/truetype/ttobjs.h @@ -286,6 +286,8 @@ FT_BEGIN_HEADER #ifdef TT_USE_BYTECODE_INTERPRETER + FT_Long point_size; /* for the `MPS' bytecode instruction */ + FT_UInt num_function_defs; /* number of function definitions */ FT_UInt max_function_defs; TT_DefArray function_defs; /* table of function definitions */ diff --git a/reactos/sdk/lib/3rdparty/freetype/src/type1/t1load.c b/reactos/sdk/lib/3rdparty/freetype/src/type1/t1load.c index c981adcf2cc..e728cf4507b 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/type1/t1load.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/type1/t1load.c @@ -321,7 +321,7 @@ mmvar->num_axis = mmaster.num_axis; mmvar->num_designs = mmaster.num_designs; - mmvar->num_namedstyles = ~0U; /* Does not apply */ + mmvar->num_namedstyles = 0; /* Not supported */ mmvar->axis = (FT_Var_Axis*)&mmvar[1]; /* Point to axes after MM_Var struct */ mmvar->namedstyle = NULL; @@ -1776,6 +1776,12 @@ } } + if ( !n ) + { + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } + loader->num_glyphs = n; /* if /.notdef is found but does not occupy index 0, do our magic. */ diff --git a/reactos/sdk/lib/3rdparty/freetype/src/type42/t42drivr.c b/reactos/sdk/lib/3rdparty/freetype/src/type42/t42drivr.c index c63ed0c8127..54c4eb32883 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/type42/t42drivr.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/type42/t42drivr.c @@ -81,7 +81,8 @@ if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) ) - return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] ); + return (FT_UInt)ft_strtol( (const char *)face->type1.charstrings[i], + NULL, 10 ); } return 0; diff --git a/reactos/sdk/lib/3rdparty/freetype/src/type42/t42objs.c b/reactos/sdk/lib/3rdparty/freetype/src/type42/t42objs.c index 4672c6e164c..089ae0f5af2 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/type42/t42objs.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/type42/t42objs.c @@ -656,8 +656,9 @@ FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index )); /* map T42 glyph index to embedded TTF's glyph index */ - glyph_index = (FT_UInt)ft_atol( - (const char *)t42face->type1.charstrings[glyph_index] ); + glyph_index = (FT_UInt)ft_strtol( + (const char *)t42face->type1.charstrings[glyph_index], + NULL, 10 ); t42_glyphslot_clear( t42slot->ttslot ); error = ttclazz->load_glyph( t42slot->ttslot, diff --git a/reactos/sdk/lib/3rdparty/freetype/src/winfonts/winfnt.c b/reactos/sdk/lib/3rdparty/freetype/src/winfonts/winfnt.c index 1c74ccd5ab3..a0a18001b62 100644 --- a/reactos/sdk/lib/3rdparty/freetype/src/winfonts/winfnt.c +++ b/reactos/sdk/lib/3rdparty/freetype/src/winfonts/winfnt.c @@ -759,6 +759,14 @@ if ( error ) goto Fail; + /* sanity check */ + if ( !face->font->header.pixel_height ) + { + FT_TRACE2(( "invalid pixel height\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } + /* we now need to fill the root FT_Face fields */ /* with relevant information */ { @@ -1062,7 +1070,8 @@ bitmap->rows = font->header.pixel_height; bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - if ( offset + pitch * bitmap->rows > font->header.file_size ) + if ( !pitch || + offset + pitch * bitmap->rows > font->header.file_size ) { FT_TRACE2(( "invalid bitmap width\n" )); error = FT_THROW( Invalid_File_Format );