From 72b880c604b5451a9dafd466baf3b3798b7ebd79 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 1 Dec 2015 10:36:24 +0000 Subject: [PATCH] [FREETYPE] Update to v2.6.2. CORE-10614 svn path=/trunk/; revision=70225 --- reactos/lib/3rdparty/freetype/CMakeLists.txt | 2 +- reactos/lib/3rdparty/freetype/ChangeLog | 8734 +++++------------ reactos/lib/3rdparty/freetype/README | 8 +- .../lib/3rdparty/freetype/devel/ftoption.h | 40 +- .../include/freetype/config/ftoption.h | 18 + .../freetype/include/freetype/freetype.h | 100 +- .../freetype/include/freetype/ftautoh.h | 53 + .../freetype/include/freetype/ftcffdrv.h | 8 +- .../freetype/include/freetype/fterrdef.h | 2 +- .../freetype/include/freetype/ftlcdfil.h | 134 +- .../3rdparty/freetype/include/freetype/ftmm.h | 7 +- .../freetype/include/freetype/ftmodapi.h | 15 +- .../include/freetype/internal/ftcalc.h | 8 +- .../include/freetype/internal/ftobjs.h | 3 + .../include/freetype/internal/tttypes.h | 3 + .../lib/3rdparty/freetype/src/autofit/afcjk.c | 18 + .../3rdparty/freetype/src/autofit/afdummy.c | 1 + .../3rdparty/freetype/src/autofit/afglobal.c | 27 +- .../3rdparty/freetype/src/autofit/afglobal.h | 16 + .../3rdparty/freetype/src/autofit/afhints.c | 144 +- .../3rdparty/freetype/src/autofit/afindic.c | 18 + .../3rdparty/freetype/src/autofit/aflatin.c | 92 +- .../3rdparty/freetype/src/autofit/aflatin.h | 2 + .../3rdparty/freetype/src/autofit/aflatin2.c | 17 + .../3rdparty/freetype/src/autofit/afloader.c | 268 + .../3rdparty/freetype/src/autofit/afloader.h | 5 + .../3rdparty/freetype/src/autofit/afmodule.c | 87 +- .../3rdparty/freetype/src/autofit/afmodule.h | 2 + .../3rdparty/freetype/src/autofit/aftypes.h | 23 +- .../lib/3rdparty/freetype/src/base/ftdbgmem.c | 2 +- .../lib/3rdparty/freetype/src/base/ftglyph.c | 14 +- .../lib/3rdparty/freetype/src/base/ftlcdfil.c | 7 +- .../lib/3rdparty/freetype/src/base/ftobjs.c | 83 +- .../lib/3rdparty/freetype/src/base/ftoutln.c | 14 +- .../lib/3rdparty/freetype/src/bdf/bdfdrivr.c | 36 +- .../lib/3rdparty/freetype/src/bdf/bdflib.c | 28 +- .../3rdparty/freetype/src/cache/ftccache.c | 2 +- reactos/lib/3rdparty/freetype/src/cff/cf2ft.c | 14 +- reactos/lib/3rdparty/freetype/src/cff/cf2ft.h | 4 +- .../lib/3rdparty/freetype/src/cff/cf2hints.c | 5 +- .../lib/3rdparty/freetype/src/cff/cf2intrp.c | 14 +- .../lib/3rdparty/freetype/src/cff/cffdrivr.c | 74 +- .../lib/3rdparty/freetype/src/cff/cffobjs.c | 2 +- .../lib/3rdparty/freetype/src/cid/cidgload.c | 29 +- .../lib/3rdparty/freetype/src/cid/cidload.c | 157 +- .../lib/3rdparty/freetype/src/cid/cidriver.c | 62 +- .../3rdparty/freetype/src/gxvalid/gxvmod.c | 4 +- .../lib/3rdparty/freetype/src/gzip/ftgzip.c | 6 +- .../3rdparty/freetype/src/otvalid/otvmod.c | 2 +- reactos/lib/3rdparty/freetype/src/pcf/pcf.h | 5 +- .../lib/3rdparty/freetype/src/pcf/pcfdrivr.c | 44 +- .../lib/3rdparty/freetype/src/pcf/pcfread.c | 32 +- .../lib/3rdparty/freetype/src/pfr/pfrcmap.c | 2 +- .../lib/3rdparty/freetype/src/pfr/pfrdrivr.c | 39 +- .../lib/3rdparty/freetype/src/pfr/pfrgload.c | 51 +- .../lib/3rdparty/freetype/src/pfr/pfrload.c | 165 +- .../lib/3rdparty/freetype/src/pfr/pfrload.h | 15 +- .../lib/3rdparty/freetype/src/pfr/pfrobjs.c | 25 +- .../lib/3rdparty/freetype/src/pfr/pfrsbit.c | 81 +- .../3rdparty/freetype/src/psaux/t1decode.c | 4 +- .../3rdparty/freetype/src/psnames/psmodule.c | 32 +- .../lib/3rdparty/freetype/src/sfnt/sfdriver.c | 18 +- .../lib/3rdparty/freetype/src/sfnt/sfobjs.c | 64 +- .../lib/3rdparty/freetype/src/sfnt/ttcmap.c | 36 +- .../lib/3rdparty/freetype/src/sfnt/ttsbit.c | 163 +- .../3rdparty/freetype/src/smooth/ftgrays.c | 153 +- .../freetype/src/tools/docmaker/content.py | 21 +- .../freetype/src/tools/docmaker/formatter.py | 5 + .../freetype/src/tools/docmaker/sources.py | 20 +- .../freetype/src/tools/docmaker/tohtml.py | 84 +- .../3rdparty/freetype/src/truetype/ttdriver.c | 51 +- .../3rdparty/freetype/src/truetype/ttgload.c | 54 +- .../3rdparty/freetype/src/truetype/ttgxvar.c | 116 +- .../3rdparty/freetype/src/truetype/ttgxvar.h | 2 + .../3rdparty/freetype/src/truetype/ttinterp.c | 13 +- .../3rdparty/freetype/src/truetype/ttobjs.c | 8 + .../3rdparty/freetype/src/truetype/ttpload.c | 18 +- .../lib/3rdparty/freetype/src/type1/t1afm.c | 14 +- .../3rdparty/freetype/src/type1/t1driver.c | 65 +- .../lib/3rdparty/freetype/src/type1/t1load.c | 18 + .../3rdparty/freetype/src/type42/t42drivr.c | 49 +- .../3rdparty/freetype/src/type42/t42parse.c | 32 +- .../3rdparty/freetype/src/winfonts/winfnt.c | 34 +- reactos/media/doc/3rd Party Files.txt | 2 +- 84 files changed, 4737 insertions(+), 7212 deletions(-) diff --git a/reactos/lib/3rdparty/freetype/CMakeLists.txt b/reactos/lib/3rdparty/freetype/CMakeLists.txt index c59743613dc..08d6e89296e 100644 --- a/reactos/lib/3rdparty/freetype/CMakeLists.txt +++ b/reactos/lib/3rdparty/freetype/CMakeLists.txt @@ -58,4 +58,4 @@ list(APPEND SOURCE src/type42/type42.c src/winfonts/winfnt.c) -add_library(freetype ${SOURCE}) +add_library(freetype ${SOURCE}) \ No newline at end of file diff --git a/reactos/lib/3rdparty/freetype/ChangeLog b/reactos/lib/3rdparty/freetype/ChangeLog index f5ca59f5e34..31c2ac9e016 100644 --- a/reactos/lib/3rdparty/freetype/ChangeLog +++ b/reactos/lib/3rdparty/freetype/ChangeLog @@ -1,13 +1,13 @@ -2015-10-04 Werner Lemberg +2015-11-28 Werner Lemberg - * Version 2.6.1 released. + * Version 2.6.2 released. ========================= - Tag sources with `VER-2-6-1'. + Tag sources with `VER-2-6-2'. * docs/VERSION.DLL: Update documentation and bump version number to - 2.6.1. + 2.6.2. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, builds/windows/vc2005/index.html, @@ -24,4688 +24,840 @@ 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/. + builds/wince/vc2008-ce/index.html: s/2.6.1/2.6.2/, s/261/262/. - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. - * builds/unix/configure.raw (version_info): Set to 18:1:12. - * CMakeLists.txt (VERSION_PATCH): Set to 1. + * builds/unix/configure.raw (version_info): Set to 18:2:12. + * CMakeLists.txt (VERSION_PATCH): Set to 2. - * src/autofit/afmodule.c [AF_DEBUG_AUTOFIT]: Ensure C linking for - dumping functions. + * docs/CHANGES: Updated. -2015-10-04 Werner Lemberg +2015-11-28 Werner Lemberg - [bzip2, gzip] Avoid access of unitialized memory (#46109). + Fix C++ compilation. - * 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. + * src/autofit/afloader.c: Include FT_INTERNAL_CALC_H. -2015-10-03 Werner Lemberg + * src/truetype/ttgload.c (load_truetype_glyph): Pacify compiler. - [bzip2, gzip] Avoid access of unitialized memory (#46109). +2015-11-28 Nikolaus Waxweiler - * 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. + Change default LCD filter to be normalized and color-balanced. -2015-10-01 Alexei Podtelezhnikov + * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Update + `default_filter'. - [smooth] Clean up worker. +2015-11-28 Werner Lemberg - * src/smooth/ftgrays.c (gray_TWorker): Remove never used fields. + [docmaker] Allow references to section names. -2015-10-01 Werner Lemberg + In the reference, we show the section's title enclosed in single + quotes. - [sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078). + * src/tools/docmaker/formatter.py (Formatter::__init__): Collect + section names as identifiers. - * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of - border conditions (i.e., if the loop exits naturally). + * 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-10-01 Werner Lemberg +2015-11-27 Tamas Kenez - * src/autofit/afranges.c (af_deva_nonbase_uniranges): Fix ranges. - They should be a subset of `af_deva_uniranges'. + [cmake] Add script to test the config module. -2015-10-01 Werner Lemberg + * builds/cmake/testbuild.sh: New file. - [sfnt] Make `tt_cmap4_char_map_linear' faster (#46078). +2015-11-27 Tamas Kenez - * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Use inner loop to - reject too large glyph indices. + * CMakeLists.txt: Create `freetype-config.cmake' config module. -2015-09-30 Alexei Podtelezhnikov +2015-11-27 Tamas Kenez - [smooth] Clean up worker. + * CMakeLists.txt: Set CMAKE_DEBUG_POSTFIX to `d'. - * src/smooth/ftgrays.c (gray_TWorker): Remove lightly used `last_ey'. - (gray_start_cell, gray_render_line): Update. +2015-11-27 Tamas Kenez -2015-09-30 Werner Lemberg + [cmake] Add better control of library dependencies. - [autofit] Replace `no-base' with `non-base'. + * CMakeLists.txt: Add `WITH_*' variables to force/auto/omit + ZLIB/BZip2/PNG/HarfBuzz. - * src/autofit/*: Do it. +2015-11-27 Tamas Kenez -2015-09-30 Werner Lemberg + [cmake] Make `FindHarfbuzz' observe the REQUIRED option. - [sfnt] Rewrite `tt_cmap4_char_map_linear' (#46078). + * builds/cmake/FindHarfBuzz.cmake: Implement it. - * 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-11-27 Werner Lemberg -2015-09-30 Werner Lemberg + [cmake] Collect files specific to cmake in `builds/cmake'. - [truetype] Adjust number of glyphs for malformed `loca' tables. + * builds/FindHarfBuzz.cmake: Move to ... + * builds/cmake/FindHarfBuzz.cmake: ... this place. - * src/truetype/ttpload.c (tt_face_load_loca): Implement it. + * CMakeLists.txt (CMAKE_MODULE_PATH): Updated. -2015-09-29 Werner Lemberg +2015-11-27 Alexander Bock - [pshinter] Avoid harmless overflow (#45984). + CMakeLists.txt: Honour new command line flag `FREETYPE_NO_DIST'. - * src/pshinter/pshglob.c (psh_blues_set_zones): Fix it. +2015-11-26 Werner Lemberg -2015-09-28 Werner Lemberg + [docmaker] Allow `foo[bar]' as identifier. - [autofit] Add support for Lao script. + We need this to handle equally named properties in different + modules. - Thanks to Danh Hong for guidance with blue zone - characters! + * src/tools/docmaker/content.py (re_identifier), + src/tools/docmaker/sources.py (re_crossref): Allow `foo[bar]'. - * src/autofit/afblue.dat: Add blue zone data for Lao. + * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word, + HtmlFormatter::index_exit, HtmlFormatter::section_enter, + HtmlFormatter::block_enter): Handle `foo[bar]'. - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. +2015-11-25 Werner Lemberg - * src/autofit/afscript.h: Add Lao standard characters. + * src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46480). - * src/autofit/afranges.c: Add Lao data. + (_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its + contents. - * src/autofit/afstyles.h: Add Lao data. +2015-11-21 Werner Lemberg -2015-09-27 suzuki toshiya - - [base] Fix a leak by broken sfnt-PS or resource fork (#46028). + * include/freetype/internal/ftcalc.h: Don't use `register' keyword. - 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. + This fixes compiler warnings. - * 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(); + Reported by Behdad. -2015-09-27 suzuki toshiya +2015-11-20 Werner Lemberg - [mac] Fix buffer size calculation for LWFN font. + Add `FT_LCD_FILTER_LEGACY1' enum value. - * src/base/ftmac.c (read_lwfn): Cast post_size to FT_ULong - to prevent confused copy by too large chunk size. + This does the same as `FT_LCD_FILTER_LEGACY'. -2015-09-26 Alexei Podtelezhnikov + See - * src/smooth/ftgrays.c (PIXEL_MASK): Remove unused macro. + https://bugs.freedesktop.org/show_bug.cgi?id=92981 -2015-09-26 Werner Lemberg + for the reasoning. - [autofit] Minor tracing improvement. + * include/freetype/ftlcdfil.h (FT_LcdFilter): New value + `FT_LCD_FILTER_LEGACY1'. - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Don't emit - blue zones header line if there are no blue zones. + * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Use it. -2015-09-26 Werner Lemberg +2015-11-15 Werner Lemberg - [bzip2, gzip, lzw] Harmonize function signatures with prototype. + * src/autofit/afhints.c (af_get_segment_index): Fix it. - Suggested by Hin-Tak Leung. + The old code was too simple, returning invalid values in most cases + where a segment crosses the contour start. - * 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-11-15 Werner Lemberg -2015-09-26 Hin-Tak Leung + * src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46439). - Add new FT_LOAD_COMPUTE_METRICS load flag. +2015-11-11 Werner Lemberg - * include/freetype/freetype.h (FT_LOAD_COMPUTE_METRICS): New macro. - * src/truetype/ttgload.c (compute_glyph_metrics): Usage. + [cff, autofit] Switch off stem darkening by default. -2015-09-26 Werner Lemberg + * src/autofit/afmodule.c (af_autofitter_init), src/cff/cffobjs.c + (cff_driver_init): Do it. - * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add cast. +2015-11-10 Jan Alexander Steffens (heftig) -2015-09-25 Werner Lemberg + Allow native CFF hinter in FT_RENDER_MODE_LIGHT. - [type1] Protect against invalid number of glyphs (#46029). + Both the native CFF hinter and the auto-hinter now have a very + similar rendering style. - * src/type1/t1load.c (parse_charstrings): Check number of - `CharStrings' dictionary entries against size of data stream. + * include/freetype/freetype.h: Mention that FT_LOAD_TARGET_LIGHT no + longer implies FT_LOAD_FORCE_AUTOHINT. -2015-09-23 Werner Lemberg + * include/freetype/ftmodapi.h (FT_MODULE_DRIVER_HINTS_LIGHTLY): New + macro. - [sfnt] Better checks for invalid cmaps (2/2) (#46019). + * include/freetype/internal/ftobjs.h (FT_DRIVER_HINTS_LIGHTLY): New + macro. - 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/cff/cffdrivr.c (cff_driver_class): Use it. - * 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. + * src/base/ftobjs.c (FT_Load_Glyph): Update auto-hinter selection + logic. -2015-09-23 Werner Lemberg +2015-11-09 Werner Lemberg - [base, sfnt] Better checks for invalid cmaps (1/2). + * src/cid/cidload.c (cid_face_open): Fix GDBytes guard (#46408). - * src/base/ftobjs.c (FT_Get_Char_Index): Don't return out-of-bounds - glyph indices. - (FT_Get_First_Char): Updated. +2015-11-09 Werner Lemberg - * src/sfnt/ttcmap.c (tt_cmap6_char_next): Don't return character - codes greater than 0xFFFF. + [truetype] Remove integer to pointer conversion compiler warning. - (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. + Problem reported by Alexei. - (tt_cmap10_char_index): Fix unsigned integer logic. - (tt_cmap10_char_next): Avoid integer overflow in computation of - next character code. + * src/truetype/ttgload.c (load_truetype_glyph): Use a solution found + in the glib library to fix the issue. - (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. +2015-11-08 Behdad Esfahbod - (tt_cmap13_char_map_binary): Avoid integer overflow in computation - of next character code. - (tt_cmap13_char_next): Simplify. + [sfnt] Accept version 3 of `EBLC' and `CBLC' tables also. -2015-09-21 suzuki toshiya + * src/sfnt/ttsbit.c (tt_face_load_sbit): Implement it. - [base] Check too long POST and sfnt resource (#45919). +2015-11-08 Philipp Knechtges - * 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. + [autofit] Don't distort (latin) glyphs too much (#46195). - * src/base/ftobjs.c (Mac_Read_POST_Resource): No need to use `0x' - prefix for `%p' formatter. + * src/autofit/aflatin.h (AF_LatinBlueRec): Add `ascender' and + `descender' fields. - * 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/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. - * src/base/ftmac.c (read_lwfn, FT_New_Face_From_SFNT): Check the - total resource size before buffer allocation. +2015-11-05 Werner Lemberg -2015-09-19 Werner Lemberg + [sfnt] Ignore embedded bitmaps with zero size (#46379). - [sfnt] Improve handling of invalid SFNT table entries (#45987). + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Implement + it. - This patch fixes weaknesses in function `tt_face_load_font_dir'. +2015-11-04 Werner Lemberg - - 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. + [truetype] Catch infinite recursion in subglyphs (#46372). - - Duplicate table entries (this is, having the same tag) were not - rejected. + * include/freetype/internal/tttypes.h (TT_LoaderRec): New field + `composites'. - - The number of valid tables was sometimes too large, leading to - access of invalid tables. + * 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'. - * 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-11-04 Werner Lemberg -2015-09-19 Werner Lemberg + [truetype] Better tracing of composite glyphs. - [pcf] Improve `FT_ABS' fix from 2015-09-17 (#45999). + * src/truetype/ttgload.c (TT_Load_Composite_Glyph, + load_truetype_glyph): Implement it. - * 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-11-03 Werner Lemberg -2015-09-17 Werner Lemberg + [sfnt] Protect against zero-size bitmaps (#46345). - [type42] Fix memory leak (#45989). + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Check + `glyph_size'. - * src/type42/t42parse.c (t42_parse_charstrings): Allow only a single - `CharStrings' array. +2015-11-02 Nikolaus Waxweiler -2015-09-17 Werner Lemberg + * src/autofit/afloader.c (af_loader_load_g): Implement emboldening. - [psaux] Fix memory leak (#45986). +2015-11-02 Nikolaus Waxweiler - * src/psaux/psobjs.c (ps_parser_load_field) : - Free `temp' in case of error. + [autofit] Implement darkening computation function. -2015-09-17 Werner Lemberg + This is a crude adaption of the original `cf2_computeDarkening' + function. - [psaux] Improve tracing message. + * 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. - * src/psaux/psobjs.c (ps_parser_load_field) : - Handle plural correctly. +2015-11-02 Nikolaus Waxweiler -2015-09-17 Werner Lemberg + [autofit] Add functions to get standard widths for writing systems. - [pcf] Fix integer overflows (#45985). + 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/pcf/pcfread.c (pcf_load_font): Use FT_MulDiv. + * src/autofit/aftypes.h (AF_WritingSystem_GetStdWidthsFunc): New + function type. + (AF_WritingSystemClassRec): New member `style_metrics_getstdw'. + (AF_DEFINE_WRITING_SYSTEM_CLASS): Updated. -2015-09-17 Werner Lemberg + * 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. - [pcf] Use FT_ABS for some property values (#45893). +2015-11-02 Nikolaus Waxweiler - * 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. + [autofit] Extend `AF_FaceGlobalsRec' to hold emboldening data. -2015-09-16 Werner Lemberg + * src/autofit/afglobal.h (AF_FaceGlobalsRec): Add fields. - Minor fixes for some clang warnings. + * src/autofit/afglobal.c (af_face_globals_new): Initialize new + fields. + (af_face_globals_free): Reset new fields. - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Cast, possible missing - initialization. +2015-11-02 Nikolaus Waxweiler - * src/truetype/ttgload.c (TT_Process_Composite_Component): Cast. + [autofit] Add stem-darkening properties. -2015-09-15 Werner Lemberg + Actual code follows in a later commit. - [type1, type42] Fix memory leaks (#45966). + * include/freetype/ftautoh.h: Document `no-stem-darkening' and + `darkening-parameters'. - * 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/autofit/afmodule.h: New fields `no_stem_darkening' and + `darken_params'. - * src/type42/t42parse.c (t42_parse_encoding): Handle multiple - encoding vectors. + * src/autofit/afmodule.c (af_property_set, af_property_get): + Handle them. + (af_autofitter_init): Initialize them. -2015-09-15 Werner Lemberg +2015-11-02 Bungeman - [truetype] Fix integer type (#45965). + [ftfuzzer] Add support for multiple files (patch #8779). - * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it. + 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. -2015-09-15 Werner Lemberg + 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/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964). + * src/tools/ftfuzzer/ftfuzzer.cc: Include libarchive headers. + (archive_read_entry_data, parse_data): New functions. + (LLVMFuzzerTestOneInput): Updated. -2015-09-15 Werner Lemberg + * src/tools/ftfuzzer/ftmutator.cc: New file, providing a custom + mutator for libFuzzer that can mutate tarballs in a sensible way. - [type1, type42] Check encoding array size (#45961). +2015-10-31 Werner Lemberg - * src/type1/t1load.c (parse_encoding), src/type42/t42parse.c - (t42_parse_encoding): Do it. + [sfnt] Fix cmap 14 validation (#46346). -2015-09-14 Alexei Podtelezhnikov + * src/sfnt/ttcmap.c (tt_cmap14_validate): Check limit before + accessing `numRanges' and `numMappings'. + Fix size check for non-default UVS table. - * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Improve. +2015-10-31 Werner Lemberg -2015-09-14 Werner Lemberg + [sfnt] Handle infinite recursion in bitmap strikes (#46344). - [type1] Fix another potential buffer overflow (#45955). + * 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. - * src/type1/t1parse (T1_Get_Private_Dict): Assure that check for - `eexec' doesn't exceed `limit'. +2015-10-29 Werner Lemberg -2015-09-13 Werner Lemberg + * src/autofit/afhints.c (af_glyph_hints_dump_points): Minor. - Replace `mkinstalldirs' with AC_PROG_MKDIR_P. +2015-10-29 Werner Lemberg - * builds/unix/mkinstalldirs: Removed, no longer needed. + * CMakeLists.txt: Remove code to set MSVC's /FD compiler switch. - * builds/unix/configure.raw: Call `AC_PROG_MKDIR_P'. - Update pwd call for `$INSTALL'. + Problem reported by David Capello ; see - * builds/unix/unix-def.in (MKINSTALLDIRS): Use `@MKDIR_P@'. + http://lists.nongnu.org/archive/html/freetype-devel/2015-10/msg00108.html - * autogen.sh: Updated. + for details. -2015-09-13 Werner Lemberg +2015-10-27 Werner Lemberg - [winfonts] Check alignment shift count for resource data (#45938). + [pfr] Add some safety guards (#46302). - * src/winfonts/winfnt.c (fnt_face_get_dll_font): Implement it. + * src/pfr/pfrload.h (PFR_CHECK): Rename to... + (PFR_CHECK_SIZE): ... this. + (PFR_SIZE): [!PFR_CONFIG_NO_CHECKS]: Define to PFR_CHECK_SIZE. -2015-09-13 Werner Lemberg + * 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. - [type1] Fix potential buffer overflow (#45923). + * src/pfr/pfrsbit.c (pfr_load_bitmap_bits): Move test for invalid + bitmap format to... + (pfr_slot_load_bitmap): ... this function. + Check bitmap size. - * src/type1/t1parse.c (T1_Get_Private_Dict): Assure `cur' doesn't - point to end of file buffer. +2015-10-26 Werner Lemberg -2015-09-13 Werner Lemberg + [truetype] Fix sanitizing logic for `loca' (#46223). - [gzip] Fix access of small compressed files (#45937). + * 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. - * src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak. +2015-10-25 Werner Lemberg - (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. + [autofit] Improve tracing. -2015-09-11 Werner Lemberg + * src/autofit/afhints.c (af_print_idx, af_get_segment_index, + af_get_edge_index): New functions. - [psaux] Fix potential buffer overflow (#45922). + (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. - * 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. + (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Remove + unnecessary `|', `[', and `]'. + Don't print `-1' but `--' for missing elements. -2015-09-11 Werner Lemberg +2015-10-24 Werner Lemberg - [base] Avoid crash while tracing `load_mac_face'. + [sfnt] Sanitize bitmap strike glyph height. - Reported in Savannah bug #45919. + Problem reported by Nikolay Sivov . - * src/base/ftobjs.c (load_mac_face): Honour FT_OPEN_MEMORY while - tracing. + * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Avoid zero value + for `metrics->height' by applying some heuristics. -2015-09-11 Werner Lemberg +2015-10-22 Werner Lemberg - [type42] Fix endless loop (#45920). + [sfnt, type42] Fix clang compiler warnings. - * src/type42/t42parse.c (t42_parse_encoding): Synchronize with - type1's `parse_encoding'. + * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `offset'. -2015-09-10 Werner Lemberg + * src/type42/t42parse.c (t42_parse_sfnts): Use proper cast. - [docmaker] Allow `-' in bold and italic markup. +2015-10-22 Dave Arnold + Werner Lemberg - * src/tools/docmaker/sources.py (re_italic, re_bold): Adjust - accordingly. + [cff] Avoid overflow/module arithmetic. -2015-09-09 Alexei Podtelezhnikov + This modifies the addition of subroutine number to subroutine bias + from unsigned to signed, but does not change any results. - * src/base/ftcalc.c (FT_RoundFix): Improve. + * 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. -2015-09-09 Wojciech Mamrak + * src/cff/cf2intrp.c (cf2_interpT2CharString) : + Updated similarly. - * src/base/ftcalc.c (FT_CeilFix, FT_FloorFix): Normalize. +2015-10-22 Werner Lemberg - This commit makes the functions behave as expected, this is, - rounding towards plus or minus infinity. + [cid] Better check of `SubrCount' dictionary entry (#46272). -2015-09-07 Alexei Podtelezhnikov + * src/cid/cidload.c (cid_face_open): Add more sanity tests for + `fd_bytes', `gd_bytes', `sd_bytes', and `num_subrs'. - * src/smooth/ftgrays.c (gray_render_line): Simplify clipping. +2015-10-21 Werner Lemberg -2015-09-04 Alexei Podtelezhnikov + [base] Pacify compiler (#46266). - [raster,smooth] Microoptimizations. + * src/base/ftoutln.c (FT_Outline_EmboldenXY): Initialize `in' and + `anchor'. - * src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table, - Beziier_Up, ): Use do-while loops. +2015-10-21 Werner Lemberg - * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line, - gray_convert_glyph): Ditto. + [type42] Fix heap buffer overflow (#46269). -2015-09-04 Werner Lemberg + * src/type42/t42parse.c (t42_parse_sfnts): Fix off-by-one error in + bounds checking. - [autofit] Redesign code ranges (2/2). +2015-10-21 Dave Arnold - This commit adds two fallback scripts (`latb', `latp') and - implements support for the no-base character ranges introduced in - the previous commit. + [cff] Fix limit in assert for max hints. - * src/autofit/aftypes.h (AF_ScriptClassRec): Add - `script_uni_nobase_ranges' field. - (AF_DEFINE_SCRIPT_CLASS): Updated. + * src/cff/cf2interp.c (cf2_hintmask_setAll): Allow mask equal to the + limit (96 bits). - * src/autofit/afscript.h, src/autofit/afstyles.h: Add `latb' and - `latp' fallback scripts. +2015-10-21 Dave Arnold - * src/autofit/afblue.dat: Add blue zones for Latin subscript and - superscript fallback scripts. + [cff] Remove an assert (#46107). - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + * src/cff/cf2hints.c (cf2_hintmap_insertHint): Ignore paired edges + in wrong order. - * src/autofit/afglobal.h (AF_NOBASE): New style flag for no-base - characters. - (AF_STYLE_MASK): Updated. +2015-10-21 Werner Lemberg - * src/autofit/afglobal.c (SCRIPT): Updated. - (af_face_globals_compute_style_coverage): Handle new style flag. + [sfnt] Avoid unnecessarily large allocation for WOFFs (#46257). - * src/autofit/aflatin.c (af_latin_hints_apply): Handle new style - flag. + * src/sfnt/sfobjs.c (woff_open_font): Use WOFF's `totalSfntSize' + only after thorough checks. + Add tracing messages. - * src/autofit/afranges.h (SCRIPT): Use it to export no-base ranges. +2015-10-21 Werner Lemberg -2015-09-04 Werner Lemberg + [type42] Better check invalid `sfnts' array data (#46255). - [autofit] Redesign code ranges (1/2). + * src/type42/t42parse.c (t42_parse_sfnts): Table lengths must be + checked individually against available data size. - 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). +2015-10-20 Werner Lemberg - 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. + [cid] Add a bunch of safety checks. - 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/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'. - * src/autofit/afranges.c (af_latn_uniranges): Updated to Unicode - 8.0. - Split off superscript-like and subscript-like glyphs into... +2015-10-20 Werner Lemberg - (af_latb_uniranges, af_latp_uniranges): ... these two new arrays. + [cid] Avoid segfault with malformed input (#46250). - (af_xxxx_nobase_uniranges): New arrays that hold no-base characters - of the corresponding character ranges. + * src/cid/cidload.c (cid_read_subrs): Return a proper error code for + unsorted offsets. -2015-09-03 Werner Lemberg +2015-10-20 StudioEtrange - [autofit] Pass glyph index to hinting function. + * CMakeLists.txt: Enable shared library builds on MinGW (#46233). - No functionality change yet. +2015-10-20 Werner Lemberg - * src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Pass - glyph index. + * src/type1/t1afm.c (T1_Read_Metrics): Fix memory leak (#46229). - * 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-10-19 Bungeman -2015-08-30 Werner Lemberg + [cid] Better handle invalid glyph stream offsets (#46221). - [autofit] Code clean-up. + * src/cid/cidgload.c (cid_load_glyph): Check minimum size of glyph + length. - * src/autofit/afglobal.h (AF_STYLE_MASK): New macro. - (AF_STYLE_UNASSIGNED): Use AF_STYLE_MASK for definition. +2015-10-18 Werner Lemberg - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): - Updated. + [psaux] Fix tracing of negative numbers. -2015-08-30 Werner Lemberg + Due to incorrect casting negative numbers were shown as very large + (positive) integers on 64bit systems. - [autofit] Make glyph style array use 16bit values. + * src/psaux/t1decode.c (t1_decoder_parse_charstrings) : + Use division instead of shift. - * include/freetype/ftautoh.h (FT_Prop_GlyphToScriptMap): Use - `FT_UShort' for `map' field. +2015-10-18 Werner Lemberg - * 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. + [truetype] Improve TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES (#46223). - * src/autofit/afglobal.h (AF_STYLE_UNASSIGNED, AF_DIGIT): Extend to - 16 bits. - (AF_FaceGlobalsRec): Use `FT_UShort' for `glyph_styles' field. + * devel/ftoption.h, include/freetype/config/ftoption.h: Surround it + with #ifndef ... #endif, as suggested in the tracker issue. -2015-08-26 Werner Lemberg +2015-10-18 Werner Lemberg - * builds/unix/configure.raw: Need harfbuzz >= 0.9.21 (#45828). + [truetype] Better protection against malformed `fpgm' (#46223). -2015-08-25 Werner Lemberg + * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't execute a + malformed `fpgm' table more than once. - [base] Improve kerning tracing and documentation. +2015-10-17 Werner Lemberg - * src/base/ftobjs.c (FT_Get_Kerning): Emit tracing message if - scaled-down kerning values differ. + * src/cid/cidgload.c (cid_load_glyph): Fix memory leak. -2015-08-18 Werner Lemberg + Reported by Kostya Serebryany . - [raster] Remove last remnants of `raster5' driver. +2015-10-17 Werner Lemberg - * src/raster/ftrend1.h (ft_raster5_renderer_class): Removed. + [bdf] Prevent memory leak (#46217). - * src/raster/rastpic.c, src/raster/rastpic.h - (ft_raster5_renderer_class_pic_init, - ft_raster5_renderer_class_pic_free): Removed. + * src/bdf/bdflib.c (_bdf_parse_glyphs) : Check + _BDF_GLYPH_BITS. -2015-08-17 Alexei Podtelezhnikov +2015-10-17 Werner Lemberg - [base] Improve emboldener (#45596). + [bdf] Use stream size to adjust number of glyphs. - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Correct displacement - of zero-lenght segments. + * 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-08-16 Alexei Podtelezhnikov +2015-10-17 Werner Lemberg - [base] Reoptimize arithmetic. + * src/cid/cidload.c (cid_parse_dict): Check `[FG]DBytes' size. - * src/base/ftcalc.c (FT_MulDiv, FT_MulFix) [!FT_LONG64]: Remove - special cases that slow down the general use. +2015-10-17 Werner Lemberg -2015-08-15 pazer + * src/cid/cidgload.c (cid_glyph_load): Check file offsets (#46222). - Fix C++ compilation (#45762). +2015-10-17 Werner Lemberg - * src/base/ftstroke.c (ft_outline_glyph_class): Use - FT_CALLBACK_TABLE. + [psaux] Fix heap buffer overflow (#46221). -2015-08-14 Alexei Podtelezhnikov + * src/psaux/t1decode.c (t1_decoder_parse_charstring) : + Fix limit check. - [truetype] Clean up. +2015-10-17 Werner Lemberg - * src/truetype/ttgload.c (TT_Process_Composite_Component): Use - `FT_Outline_Transform' and `FT_Outline_Translate'. - (translate_array): Dropped. + * src/cid/cidload.c (cid_parse_dict): Handle invalid input (#46220). -2015-08-14 Andreas Enge +2015-10-15 Kostya Serebryany - * builds/unix/detect.mk (CONFIG_SHELL): Don't handle it (#44261). + [ftfuzzer] Add README. -2015-08-13 Werner Lemberg + * src/tools/ftfuzzer/README: New file. - [truetype] Introduce named instance access to GX fonts. +2015-10-15 Bungeman - 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. + [bdf] Fix memory leak (#46213). - * include/freetype/freetype.h (FT_FaceRec): Update documentation. - * include/freetype/internal/sfnt.h: Ditto. + * src/bdf/bdflib.c (bdf_load_font): Always go to label `Fail' in + case of error. - * 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. +2015-10-15 Werner Lemberg - * src/truetype/ttobjs.c (tt_face_init) - [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Use named instance, overwriting - the style name. + [truetype] Add TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES (#46208). - * 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. + * devel/ftoption.h, include/freetype/config/ftoption.h + (TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES): New configuration macro. - * src/cff/cffobjs.c (cff_face_init): Make function exit early for - pure CFF fonts if `font_index < 0'. - Updated. + * src/truetype/ttinterp.c (MAX_RUNNABLE_OPCODES): Removed. + (TT_RunIns): 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. +2015-10-15 Werner Lemberg - * docs/CHANGES: Updated. + * src/truetype/ttinterp.c (TT_RunIns): Fix bytecode stack tracing. -2015-08-12 Alexei Podtelezhnikov + The used indices were off by 1. - [type1,cff,cid] Streamline font matrix application. +2015-10-15 Bungeman + Werner Lemberg - * 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. - * sff/cid/cidgload.c (cid_slot_load_glyph): Ditto for advances and the - entire outline. + * src/tools/ftfuzzer/ftfuzzer.cc: Handle fixed sizes (#46211). -2015-08-11 Werner Lemberg +2015-10-15 Werner Lemberg - [builds/unix] Minor. + [base] Compute MD5 checksums only if explicitly requested. - * builds/unix/configure.raw: - s/lib{priv,staticconf}/libs{priv,staticconf}/ for orthogonality with - similarly named uppercase variables. + This improves profiling accuracy. -2015-08-10 Alexei Podtelezhnikov + * src/base/ftobjs.c (FT_Render_Glyph_Internal): Implement it. - [type1,cid,type42] Minor improvements. +2015-10-14 Werner Lemberg - * 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. + [base] Use `FT_' namespace for MD5 functions (#42366). -2015-08-08 Werner Lemberg + * src/base/ftobjs.c (MD5_*): Define as `FT_MD5_*'. + Undefine HAVE_OPENSSL. - [type42] Fix glyph access. +2015-10-13 Werner Lemberg - 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. + [type1] Correctly handle missing MM axis names (#46202). - Apparently, noone ever noticed it; this shows how much Type 42 fonts - are in use... + * src/type1/t1load.c (T1_Get_MM_Var): Implement it. - * src/type42/t42objs.c (T42_GlyphSlot_Load): Map Type 42 glyph index - to embedded TTF's glyph index. +2015-10-13 Werner Lemberg -2015-08-08 Werner Lemberg + [pcf] Quickly exit if font index < 0. - [type42] Minor clean-up. + 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/type42/t42parse.c (t42_parse_font_matrix): Remove unused - variable. + * src/pcf/pcfdrivr.c (PCF_Face_Init): Updated. + Exit quickly if face_index < 0. -2015-08-06 Alexei Podtelezhnikov + * src/pcfread.c (pcf_load_font): Add `face_index' argument. + Exit quickly if face_index < 0. - [type42] Parse FontMatrix according to specifications. + * src/pcf/pcf.h: Updated. - * 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-10-13 Werner Lemberg -2015-08-06 Werner Lemberg + [ftfuzzer] Handle TTCs and MM/GX variations. - [autofit] Improve Arabic hinting. + This patch also contains various other improvements. - Problem reported by Titus Nemeth (by using - ttfautohint). + * 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'. - * src/autofit/afblue.dat: Add neutral blue zone for the tatweel - character. +2015-10-13 Werner Lemberg - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + [truetype] Refine some GX sanity tests. -2015-08-05 Alexei Podtelezhnikov + Use the `gvar' table size instead of the remaining bytes in the + stream. - [truetype] Clean up types. + * src/truetype/ttgxvar.h (GX_BlendRec): New field `gvar_size'. - * 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. + * 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-08-05 Werner Lemberg +2015-10-13 Werner Lemberg - [autofit] Improve recognition of flat vs. rounded segments. + [truetype] Another GX sanity test. - Lower the flatness threshold from upem/8 to upem/14, making the - auto-hinter accept shorter elements. + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Check + `tupleCount'. + Add tracing message. - Synchronize flat/round stem selection algorithm with blue zone code. +2015-10-13 Werner Lemberg - * 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'. + [truetype] Fix memory leak for broken GX fonts (#46188). -2015-08-04 Werner Lemberg + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix scope of + deallocation. - Another left-shift bug (#45681). +2015-10-13 Werner Lemberg - * src/base/ftobjs.c (IsMacBinary): Only accept positive values for - `dlen'. + [truetype] Fix commit from 2015-10-10. -2015-08-03 Alexei Podtelezhnikov + * src/truetype/ttgxvar.c (ft_var_load_gvar): Add missing error + handling body to condition. - [base] Fix `ft_corner_orientation'. +2015-10-12 Werner Lemberg - Remove casting from `FT_Long' to `FT_Int' that might change the sign - of the return value and make it faster too. + [unix] Make MKDIR_P actually work. - * 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. + * builds/unix/configure.raw: Fix underquoting of `INSTALL' and + `MKDIR_P'. -2015-08-03 Werner Lemberg + Problem reported by Dan Liddell . - * 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-10-11 Werner Lemberg -2015-08-03 Werner Lemberg + [sfnt] Improve extraction of number of named instances. - Fix typo in clang bug from 2015-07-31 (#45678). + * src/sfnt/sfobjs.c (sfnt_init_face) + [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check number of instances against + `fvar' table size. - * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Fix inequality. +2015-10-10 Alexei Podtelezhnikov -2015-08-02 Werner Lemberg + * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix overflow + (#46149). - * CMakeLists.txt: Improve shared library support. +2015-10-10 Werner Lemberg - Based on a patch from John Cary . + [sfnt] Fix infinite loops with broken cmaps (#46167). -2015-08-02 Werner Lemberg + * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next): Take care + of border conditions (i.e., if the loops exit naturally). - * builds/unix/freetype-config.in (enable_shared): Remove. Unused. +2015-10-10 Werner Lemberg -2015-08-02 Werner Lemberg + [truetype] More sanity tests for GX handling. - Fix more invalid left-shifts. + These tests should mainly help avoid unnecessarily large memory + allocations in case of malformed fonts. - * src/pfr/pfrgload.c (pfr_glyph_load_compound): Use multiplication, - not left-shift. + * 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. - * 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-10-10 Werner Lemberg -2015-07-31 Werner Lemberg + [truetype] Better protection against malformed GX data (#46166). - Fix some bugs found by clang's `-fsanitize=undefined' (#45661). + * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Correctly + handle empty `localpoints' array. - * 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_INTERNL_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. - ======================= - - - Tag sources with `VER-2-6'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.6. - - * 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.5.5/2.6/, s/255/26/. - - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 6. - (FREETYPE_PATCH): Set to 0. - - * builds/unix/configure.raw (version_info): Set to 18:0:12. - * CMakeLists.txt (VERSION_MINOR): Set to 6. - (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 - - [autofit] Introduce `warping' property. - - This code replaces the debugging hook from the previous commit with - a better, more generic solution. - - * include/ftautoh.h: Document it. - - * src/autofit/afmodule.h (AF_ModuleRec) - [AF_CONFIG_OPTION_USE_WARPER]: Add `warping' field. - - * 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. - - * src/autofit/afhints.h (AF_HINTS_DO_WARP): Remove use of the no - longer existing `_af_debug_disable_warper'. - - * 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. - - * src/autofit/aftypes.h: Updated. - -2015-04-16 Werner Lemberg - - [autofit] Add debugging hook to disable warper. - - * src/autofit/afmodule.c (_af_debug_disable_warper) - [FT_DEBUG_AUTOFIT]: New global variable. - - * src/autofit/aftypes.h: Updated. - (AF_SCALER_FLAG_NO_WARPER): New macro (not actively used yet). - - * src/autofit/afhints.h (AF_HINTS_DO_WARP): New macro. - - * src/autofi/aflatin.c (af_latin_hints_apply) - [AF_CONFIG_OPTION_USE_WARPER]: Use `AF_HINTS_DO_WARP' to control use - of warper. - - * src/autofit/afcjk.c (af_cjk_hints_init, af_cjk_hints_apply) - [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. - - * src/autofit/aflatin2.c (af_latin2_hints_apply) - [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. - -2015-04-10 Werner Lemberg - - [cff] Update advance width handling to OpenType 1.7. - - Problem reported by Behdad. - - * src/cff/cffdrivr.c (cff_get_advances): Handle SFNT case - separately. - - * src/cff/cffgload.c (cff_slot_load): Use advance width and side - bearing values from `hmtx' table if present. - -2015-04-03 Alexei Podtelezhnikov - - * src/autofit/afhints.c (af_glyph_hints_reload): Use do-while loop. - -2015-04-02 Alexei Podtelezhnikov - - * src/autofit/aflatin.c (af_latin_hint_edges): Reduce logic. - -2015-04-01 Alexei Podtelezhnikov - - [autofit] Finish the thought. - - * src/autofit/afhints.c (af_direction_compute): make sure the long arm - is never negative so that its `FT_ABS' is not necessary. - -2015-04-01 Werner Lemberg - - [autofit] Call dumper functions for tracing. - - * 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. - -2015-04-01 Werner Lemberg - - [autofit] Make debugging stuff work again. - - The interface to ftgrid was broken in the series of commits starting - with - - [autofit] Allocate AF_Loader on the stack instead of AF_Module. - - from 2015-01-14. - - * 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. - - * src/autofit/afloader.c (af_loader_init, af_loader_done): Updated. - -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.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Arabic standard characters. - - * src/autofit/afranges.c: Add Arabic data. - - * src/autofit/afstyles.h: Add Arabic data. - - * docs/CHANGES: Document it. - -2015-03-11 Werner Lemberg - - Rename `svxf86nm.h' to `svfntfmt.h'; update related symbols. - - * include/internal/ftserv.h (FT_SERVICE_XFREE86_NAME_H): Renamed - to... - (FT_SERVICE_FONT_FORMAT_H): This. - - * include/internal/services/svfntfmt.h (FT_XF86_FORMAT_*): Renamed - to ... - (FT_FONT_FORMAT_*): This. - - 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. - -2015-03-11 Werner Lemberg - - [base] Rename `FT_XFREE86_H' to `FT_FONT_FORMATS_H'. - - * include/config/ftheader.h: Implement it. - * src/base/ftfntfmt.c, docs/CHANGES: Updated. - -2015-03-11 Werner Lemberg - - [base] Rename `FT_Get_X11_Font_Format' to `FT_Get_Font_Format'. - - * include/ftfntfmt.h, src/base/ftfntfmt.c: Implement it. - - * docs/CHANGES: Updated. - -2015-03-11 Werner Lemberg - - Fix automatic copyright updating. - - * src/tools/update-copyright: Make scanning of `no-copyright' - actually work. - - * src/tools/no-copyright: Don't include README in general. - -2015-03-11 Werner Lemberg - - Rename `ftxf86.[ch]' to `ftfntfmt.[ch]'. - - 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. - -2015-03-10 Alexei Podtelezhnikov - - Fix Savannah bug #44412 (part 1). - - * src/base/ftstroke.c (ft_stroker_inside): Handle near U-turns. - -2015-03-10 Werner Lemberg - - [base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'. - - * include/ftbitmap.h, src/base/ftbitmap.c: Implement it. - Update all callers. - - * docs/CHANGES: Updated. - -2015-03-06 Werner Lemberg - - * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning. - - Found by Alexei. - -2015-03-05 Alexei Podtelezhnikov - - * src/base/ftstroke.c: Simplify. - -2015-03-04 Werner Lemberg - - [truetype] Some fixes and code refactoring in `ttgxvar.c'. - - * 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. - -2015-03-03 Werner Lemberg - - [autofit] Fix Savannah bug #44241. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs - with less than 3 points. - -2015-03-02 Werner Lemberg - - Simplify `TYPEOF' macro. - - No need for two arguments. - - * include/config/ftconfig.h, builds/unix/ftconfig.in, - builds/vms/ftconfig.h (TYPEOF): Updated. - - * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR), - src/autofit/afwarp.h (AF_WARPER_FLOOR): Updated. - -2015-03-01 Werner Lemberg - - Various compiler warning fixes for `make multi'. - - * 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'. - - * 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. - - * src/cff/cf2intrp.c: Include `cf2intrp.h'. - * src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused. - - * src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused. - - * src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'. - - * src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX): - Removed. Unused. - - * src/raster/ftraster.c (Render_Glyph): Declare as `static'. - - * src/sfnt/ttpost.c (load_format_20): Fix signedness warning. - - * 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'. - - * 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. - - * src/type42/t42parse.c (T1_Done_Table): Removed. Unused. - -2015-02-25 Werner Lemberg - - [psaux] Signedness fixes. - - * 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. - -2015-02-25 Werner Lemberg - - [otvalid] Signedness fixes. - - * src/otvalid/otvcommn.c, src/otvalid/otvgdef.c, - src/otvalid/otvgpos.c, src/otvalid/otvgsub.c, src/otvalid/otvmath.c: - Apply. - -2015-02-25 Werner Lemberg - - * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Signedness fix. - -2015-02-25 Werner Lemberg - - [lzw] Signedness fixes. - - * src/lzw/ftzopen.c, src/lzw/ftzopen.h: Apply. - -2015-02-25 Werner Lemberg - - [gxvalid] Signedness fixes. - - * 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. - -2015-02-25 Werner Lemberg - - [cache] Signedness fixes. - - * src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c, - src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply. - -2015-02-25 Werner Lemberg - - Change dimension fields in `FTC_ImageTypeRec' to unsigned type. - - This doesn't break ABI. - - * include/ftcache.h (FTC_ImageTypeRec): Use unsigned types for - `width' and `height'. - - * docs/CHANGES: Document it. - -2015-02-25 Werner Lemberg - - [cache] Don't use `labs'. - - This is the only place in FreeType where this function was used. - - * include/config/ftstdlib.h (ft_labs): Remove. - - * src/cache/ftcimage.c (ftc_inode_weight): Replace `ft_labs' with - `FT_ABS'. - -2015-02-23 Werner Lemberg - - [cache] Replace `FT_PtrDist' with `FT_Offset'. - - * 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/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c, - src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated. - -2015-02-23 Werner Lemberg - - [smooth, raster] Re-enable standalone compilation. - - * src/raster/ftraster.c (FT_RENDER_POOL_SIZE, FT_MAX) - [_STANDALONE_]: Define macros. - - * src/smooth/ftgrays.c (FT_RENDER_POOL_SIZE, FT_MAX, FT_ABS, - FT_HYPOT) [_STANDALONE_]: Define macros. - -2015-02-22 Werner Lemberg - - [smooth] Signedness fixes. - - * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply. - -2015-02-22 Werner Lemberg - - * src/raster/ftraster.c: Use the file's typedefs everywhere. - -2015-02-22 Werner Lemberg - - * src/sfnt/ttpost.c (load_format_20): Fix error tracing message. - - Bug introduced 6 commits earlier. - -2015-02-22 Werner Lemberg - - [pshinter] Fix thinko. - - * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Correctly - check `count'. - Bug introduced two commits earlier. - -2015-02-22 Werner Lemberg - - [raster] Signedness fixes. - - * src/raster/ftraster.c, src/raster/ftrend1.c: Apply. - -2015-02-22 Werner Lemberg - - [pshinter] Signedness fixes. - - * src/pshinter/pshalgo.c, src/pshinter/pshglob.c, - src/pshinter/pshrec.c: Apply. - -2015-02-22 Werner Lemberg - - [pshinter] Use macros for (unsigned) flags, not enumerations. - - * src/pshinter/pshalgo.h (PSH_Hint_Flags): Replace with macros. - Updated. - * src/pshinter/pshrec.h (PS_Hint_Flags): Replace with macros. - -2015-02-22 Werner Lemberg - - * src/pshinter/pshrec.c: Simplify. - (ps_hints_open, ps_hints_stem): Remove switch statement. - -2015-02-22 Werner Lemberg - - [sfnt] Signedness fixes. - - * 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. - -2015-02-22 Werner Lemberg - - [bdf] Signedness fixes. - - * src/bdf/bdf.h, src/bdf/bdfdrivr.c, src/bdf/bdfdrivr.h, - src/bdf/bdflib.c: Apply. - -2015-02-22 Werner Lemberg - - * src/bdf/bdflib.c (_bdf_atous): New function. - (_bdf_parse_glyphs, _bdf_parse_start): Use it. - -2015-02-22 Werner Lemberg - - [pcf] Signedness fixes. - - * src/pcf/pcf.h, src/pcf/pcfdrivr.c: Apply. - * src/pcf/pcfread.c: Apply. - (pcf_get_encodings): Ignore invalid negative encoding offsets. - -2015-02-21 Werner Lemberg - - * src/winfonts/winfnt.c: Signedness fixes. - -2015-02-21 Werner Lemberg - - [type42] Signedness fixes. - - * src/type42/t42parse.c, src/type42/t42parse.h, - src/type42/t42types.h: Apply. - -2015-02-21 Werner Lemberg - - [pfr] Signedness fixes. - - * 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. - -2015-02-21 Werner Lemberg - - [cff] Minor signedness fixes related to last commit. - - * src/cff/cf2ft.c, src/cff/cf2intrp.c, src/cff/cffgload.c: Apply. - -2015-02-20 Werner Lemberg - - [cff] Thinkos in bias handling. - - Only the final result is always positive. - - Bug introduced three commits earlier. - - * src/cff/cffgload.c, src/cff/cffgload.h: Apply. - -2015-02-20 Werner Lemberg - - [cid] Fix signedness issues and emit some better error codes. - - * 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. - -2015-02-20 Werner Lemberg - - [cff] Signedness fixes for new engine. - - * 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. - -2015-02-20 Werner Lemberg - - [cff] Signedness fixes for basic infrastructure and old engine. - - * 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. - -2015-02-19 Werner Lemberg - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'. - - This is hard-coded to value 2 in `fvar' version 1.0 (and no newer - version exists), but some fonts set it incorrectly. - - Problem reported by Adam Twardoch . - -2015-02-19 Werner Lemberg - - [cff] Emit better error code for invalid private dict size. - - * src/cff/cffparse.c (cff_parse_private_dict): Reject negative - values for size and offset. - -2015-02-19 Werner Lemberg - - [autofit] Fix signedness issues. - - * 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. - -2015-02-19 Werner Lemberg - - [autofit] Use macros for (unsigned) flags, not enumerations. - - This harmonizes with other code in FreeType (and reduces the number - of necessary casts to avoid compiler warnings). - - * src/autofit/afblue.hin: Make flag macros unsigned. - * src/autofit/afblue.h: Regenerated. - - * src/autofit/afcjk.h: Replace flag enumeration with macros. - * src/autofit/afcjk.c: Updated. - - * src/autofit/afhints.h (AF_Flags, AF_Edge_Flags): Replace with - macros. - * src/autofit/afhints.c: Updated. - - * src/autofit/aflatin.h: Replace flag enumerations with macros. - * src/autofit/aflatin.c, src/autofit/aflatin2.c: Updated. - - * src/autofit/aftypes.h (AF_ScalerFlags): Replace with macros. - -2015-02-18 Werner Lemberg - - [type1] Fix signedness issues. - - * 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. - -2015-02-18 Werner Lemberg - - [psaux, type1] Fix minor AFM issues. - - * 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. - - * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs): - Reject negative values for number of kerning elements. - - * src/type1/t1afm.c, src/tools/test_afm.c: Updated. - -2015-02-18 Werner Lemberg - - Don't use `FT_PtrDist' for lengths. - - Use FT_UInt instead. - - * include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec, - T1_DecoderRec): Do it. - - * include/internal/t1types.h (T1_FontRec): Ditto. - - * 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_chharstrings, parse_dict): Ditto. - * src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings, - t42_parse_dict): Ditto. - -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: - Signedess 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] Prettyfing. - - * 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 funtion 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. - -2014-12-30 Werner Lemberg - - * Version 2.5.5 released. - ========================= - - - Tag sources with `VER-2-5-5'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.5.5. - - * 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.5.4/2.5.5/, s/254/255/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5. - - * builds/unix/configure.raw (version_info): Set to 17:4:11. - * CMakeLists.txt (VERSION_PATCH): Set to 5. - * docs/CHANGES: Updated. - - * builds/toplevel.mk (dist): Fix typos. - -2014-12-24 Alexei Podtelezhnikov - - [base] Formatting and nanooptimizations. - - * src/base/ftcalc.c, - * src/base/fttrigon.c: Revise sign restoration. - -2014-12-13 Werner Lemberg - - * src/pcf/pcfread.c (pcf_read_TOC): Improve fix from 2014-12-08. - -2014-12-11 Werner Lemberg - - * builds/toplevel.mk (dist): Use older POSIX standard for `tar'. - - Apparently, BSD tar isn't capable yet of handling POSIX-1.2001 - (contrary to GNU tar), so force the POSIX-1.1988 format. - - Problem reported by Stephen Fisher . - -2014-12-11 Werner Lemberg - - * src/type42/t42parse.c (t42_parse_sfnts): Reject invalid TTF size. - -2014-12-11 Werner Lemberg - - * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check. - - Problem reported by Dennis Felsing . - -2014-12-11 Werner Lemberg - - * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'. - - Problem reported by Dennis Felsing . - -2014-12-09 suzuki toshiya - - [gxvalid] Fix a naming convention conflicting with ftvalid. - - See previous changeset for otvalid. - - * src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace - `valid' by `gxvalid'. - * src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c, - gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c, - gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c, - gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c, - gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if - it is typed as GXV_Validator. - -2014-12-09 suzuki toshiya - - [otvalid] Fix a naming convention conflicting with ftvalid. - - Some prototypes in ftvalid.h use `valid' for the variables - typed as FT_Validator. Their implementations in src/base/ - ftobjs.c and utilizations in src/sfnt/ttcmap.c do similar. - - Some macros in otvcommn.h assume the exist of the variable - `valid' typed as OTV_Validator in the caller. - - Mixing these two conventions cause invalid pointer conversion - and unexpected SEGV in longjmp. To prevent it, all variables - typed as OTV_Validator are renamed to `otvalid'. - - * src/otvalid/otvcommn.h: Replace `valid' by `otvalid'. - * src/otvalid/{otvcommn.c, otvbase.c, otvgdef.c, otvgpos.c, - otvgsub.c, otvjstf.c, otvmath.c}: Replace `valid' by `otvalid' - if it is typed as OTV_Validator. - -2014-12-09 suzuki toshiya - - [ftvalid] Introduce FT_THROW() in FT_INVALID_XXX macros. - - Original patch is designed by Werner Lemberg. Extra part - for otvalid and gxvalid are added by suzuki toshiya, see - discussion: - http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00002.html - http://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00007.html - - * include/internal/ftvalid.h: Introduce FT_THROW() in FT_INVALID_(). - * src/gxvalid/gxvcommn.h: Ditto. - * src/otvalid/otvcommn.h: Ditto. - -2014-12-08 Werner Lemberg - - [pcf] Fix Savannah bug #43774. - - Work around `features' of X11's `pcfWriteFont' and `pcfReadFont' - functions. Since the PCF format doesn't have an official - specification, we have to exactly follow these functions' behaviour. - - The problem was unveiled with a patch from 2014-11-06, fixing issue - #43547. - - * src/pcf/pcfread.c (pcf_read_TOC): Don't check table size for last - element. Instead, assign real size. - -2014-12-07 Werner Lemberg - - Work around a bug in Borland's C++ compiler. - - See - - http://qc.embarcadero.com/wc/qcmain.aspx?d=118998 - - for Borland's bug tracker entry. - - Reported by Yuliana Zigangirova , - http://lists.gnu.org/archive/html/freetype-devel/2014-04/msg00001.html. - - * include/internal/ftvalid.h (FT_ValidatorRec), src/smooth/ftgrays.c - (gray_TWorker_): Move `ft_jmp_buf' field to be the first element. - -2014-12-07 Werner Lemberg - - */*: Decorate hex constants with `U' and `L' where appropriate. - -2014-12-07 Werner Lemberg - - [truetype] Prevent memory leak for buggy fonts. - - * src/truetype/ttobjs.c (tt_size_done): Unconditionally call - `tt_size_done_bytecode'. - -2014-12-06 Werner Lemberg - - * Version 2.5.4 released. - ========================= - - - Tag sources with `VER-2-5-4'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.5.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.5.3/2.5.4/, s/253/254/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. - - * builds/unix/configure.raw (version_info): Set to 17:3:11. - * CMakeLists.txt (VERSION_PATCH): Set to 4. - * docs/CHANGES: Updated. - -2014-12-04 Werner Lemberg - - docs/CHANGES: Updated, formatted. - -2014-12-04 Dave Arnold - - [cff] Modify an FT_ASSERT. - - * src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah - bug #43661, the test font `...aspartam.otf' still triggers an - FT_ASSERT. Since hintmap still works with count==0, ... - (cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to - suppress the assert. - -2014-12-04 Dave Arnold - - [cff] Fix Savannah bug #43661. - - * src/cff/cf2intrp.c (cf2_interpT2CharString) : Don't append to stem arrays after - hintmask is constructed. - - * src/cff/cf2hints.c (cf2_hintmap_build): Add defensive code to - avoid reading past end of hintmask. - -2014-12-03 Werner Lemberg - - docs/CHANGES: Updated. - -2014-12-03 Werner Lemberg - - [autofit] Better fix for conversion specifiers in debug messages. - - Using `%ld' for pointer differences causes warnings on 32bit - platforms. The correct type would be (the relatively new) `%td', - however, this is missing on some important platforms. - - This patch improves the change from 2014-11-28. - - * src/autofit/afhints.c (AF_INDEX_NUM): Use `int' typecast. Our - pointer differences are always sufficiently small. - (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, - af_glyph_hints_dump_edge): Revert to `%d' and use `AF_INDEX_NUM'. - -2014-12-03 Werner Lemberg - - FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality. - - All public FreeType enumeration and flag values are uppercase... - - * include/tttables.h (FT_Sfnt_Tag): Implement it. For backwards - compatilibity, retain the old values as macros. - - * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c - (get_sfnt_table): Updated. - -2014-12-02 Werner Lemberg - - * include/*: Improve structure of documentation. - - . Add and update many `' tags. - . Apply various documentation fixes. - . Remove details to deprecated (or never implemented) data. - -2014-12-02 Werner Lemberg - - [docmaker] Always handle `' section elements. - - Previously, those elements were handled only for sections present in - a `' chapter element. - - * src/tools/docmaker/content.py (ContentProcessor::finish): - Implement it. - -2014-12-02 Werner Lemberg - - [docmaker] Properly handle empty rows in Synopsis. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit - ` ' for empty fields. - -2014-12-02 Werner Lemberg - - [docmaker] Thinko. - - * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): - Emit `/empty/' string for first element also. - -2014-12-02 Werner Lemberg - - [docmaker] Honour empty lines in `' section element. - - This greatly improves the readability of the `Synopsis' links. - - * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): - Insert string `/empty/' between items. - - * src/tools/docmaker/formatter.py (Formatter::section_dump): Make it - robust against nonexistent keys. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit - empty elements for `/empty/'. - -2014-12-02 Werner Lemberg - - [docmaker] Ensure Python 3 compatibility. - - * src/tools/docmaker/content.py (ContentProcessor::set_section, - ContentProcessor::finish): Replace `has_key' function with `in' - keyword. - - * src/tools/docmaker/formatter.py (Formatter::__init__): Replace - sorting function with a key generator. - (Formatter::add_identifier): Replace `has_key' function with `in' - keyword. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::html_source_quote): - Replace `has_key' function with `in' keyword. - (HtmlFormatter::index_exit, HtmlFormatter::section_enter): Use - integer division. - s/<>/>/. - - * src/tools/docmaker/utils.py: Import `itertools'. - (index_sort): Replaced by... - (index_key): ... this new key generator (doing exactly the same). - -2014-11-29 Werner Lemberg - - [docmaker] Don't output a block multiple times. - - This bug was hidden by not processing all lines of `' blocks. - - * src/tools/docmaker/formatter.py (Formatter::section_dump): Filter - out field names. - -2014-11-29 Werner Lemberg - - [docmaker] Use field values as HTML link targets where possible. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::make_block_url): - Accept second, optional argument to specify a name. - (HtmlFormatter::html_source_quote): Link to field ID if possible. - (HtmlFormatter::print_html_field_list): Emit `id' attribute. - -2014-11-29 Werner Lemberg - - [docmaker] Allow empty lines in `' blocks. - - Before this patch, the suggested order of entries stopped at the - first empty line. - - Obviously, nobody noticed that this problem caused a much reduced - set of links in the `Synopsis' sections; in particular, the - `' blocks contain a lot of entries that wouldn't be listed - otherwise... - - * src/tools/docmaker/content.py (DocBlock::get_markup_words_all): - New function to iterate over all items. - (DocSection::process): Use it. - -2014-11-29 Werner Lemberg - - * src/tools/docmaker/sources.py (column) [Format 2]: Fix regexp. - - After the single asterisk there must be no other immediately following - asterisk. - -2014-11-29 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Improve CSS for vertical spacing. - -2014-11-29 Werner Lemberg - - [docmaker] Improve HTML code for table of contents. - - * src/tools/docmaker/tohtml.py: Introduce a new table class `toc', - together with proper CSS. - -2014-11-29 Werner Lemberg - - [docmaker] Provide higher-level markup and simplify HTML. - - * src/tools/docmaker/tohtml.py: Instead of using extraneous `
' - elements, use CSS descendants (of class `section') to format the - data. - - Also remove reduntant

and
elements, replacing them with - proper CSS. - - Globally reduce page width to 75%. - - (block_header): Rename

class to `section'. - -2014-11-29 Werner Lemberg - - [docmaker] Add `top' links after blocks. - - * src/tools/docmaker/tohtml.py (block_footer_middle): Implement it. - -2014-11-29 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Improve CSS for fields. - - Make fields align horizontally relative to full line width. - -2014-11-29 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Fix index and TOC templates. - - This thinko was introduced 2014-11-27. - -2014-11-28 Werner Lemberg - - [docmaker] Format field lists with CSS. - - This also simplifies the inserted HTML code. - - * src/tools/docmaker/tohtml.py - (HtmlFormatter::print_html_field_list): Do it. - -2014-11-28 suzuki toshiya - - Fix compiler warning to the comparison between signed and - unsigned variable. - - * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix the comparison - between `ypos + ysize' and FT_INT_{MAX,MIN}. - -2014-11-28 Werner Lemberg - - [docmaker] Replace empty `' with CSS. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Do - it. - -2014-11-28 Werner Lemberg - - [docmaker] Replace some `' tags with `

' and `
'. - - * src/tools/docmaker/tohtml.py (marker_*): Use `

'. - (source_*): Use `
'. - (HtmlFormatter::block_enter): s/

/

/. - -2014-11-28 suzuki toshiya - - Fix compiler warning to conversion specifiers in debug messages. - - * src/autofit/afhints.c (af_glyph_hints_dump_points): Add length - modifier to dump long integers. - (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Ditto. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Use more CSS for index. - -2014-11-27 Werner Lemberg - - [docmaker] Replace `name' attribute of `' with `id'. - - * src/tools/docmaker/tohtml.py (HtmlFormatter::block_enter): Do it. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Remove remaining `width' attributes. - - For `Index' and `TOC' links, we now simply use the `text-align' CSS - property of `

' to enforce flush-left and flush-right, - eliminating the hack with an empty, full-width `' element - inbetween. - - The change also enforces the same (smaller) size for all index and - TOC links. - -2014-11-27 suzuki toshiya - - * src/cff/cf2font.c: Include `ftcalc.h' to use FT_MSB(), - cf2font.c could not find it under `make multi' build. - -2014-11-27 suzuki toshiya - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove - unrequired negative value check for `width' and `height'. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: More HTML table refactoring. - - Replace some `' tags with `
' to simplify structure. - - Move `bgcolor' attribute to CSS. - - Replace most `width' attributes with CSS. The remaining instances - (providing a similar effect as LaTeX's `\hfill' command) are removed - in a later patch. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Replace with CSS. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Center
with CSS. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Replace `
' with `
'. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/tohtml.py: Remove redundant `
' tags. - - This starts a series of commits into the direction of generating - valid HTML 5 code, especially using much more CSS. - -2014-11-27 suzuki toshiya - - Prevent too negative values (< FT_INT_MIN) in bitmap metrics, - suggested by Alexei. - - * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Prevent too - negative values in `xpos' and `ypos + ysize'. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Prevent - too negative values in `x_left' and `y_top'. Either negative - values in `width' and `height' are checked. - -2014-11-27 Werner Lemberg - - [docmaker] Produce better HTML code. - - * src/tools/docmaker/tohtml.py: Always use double quotes for - attribute values. - (source_footer): Close `td' and `tr' groups. - -2014-11-27 Werner Lemberg - - Use better way to disable creation of .pyc files for `make refdoc'. - - Python 2.6 was released in 2008... - - * builds/freetype.mk (refdoc): Use python's `-B' option. - - * builds/detect.mk (std_setup, dos_setup): Mention required python - version for `refdoc' target. - -2014-11-27 Werner Lemberg - - * src/tools/docmaker/sources.py (re_bold, re_italic): Use - non-grouping parentheses. - * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word): - Updated. - -2014-11-27 Werner Lemberg - - * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning. - - Introdruced in previous change. Reported by Alexei. - -2014-11-26 Werner Lemberg - - * src/*: Add checks for parameters of API functions where missing. - - `API functions' are functions tagged with `FT_EXPORT_DEF'. - - Besides trivial fixes, the following changes are included, too. - - * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set - error code if no service is available. - - * src/base/ftinit.c (FT_Done_FreeType): Change return value for - invalid `library' parameter to `Invalid_Library_Handle'. - - * src/base/ftobjs.c (FT_New_Size): Change return value for invalid - `asize' parameter to `Invalid_Argument'. - - * src/base/ftoutln.c (FT_Outline_Copy): Change return value for - invalid `source' and `target' parameters to `Invalid_Outline'. - (FT_Outline_Done_Internal): Change return value for invalid - `outline' parameter to `Invalid_Outline'. - -2014-11-26 Werner Lemberg - - * src/cache/ftcbasic.c: Use single calls to `FT_TRACE'. - -2014-11-26 suzuki toshiya - - * src/base/ftobj.c (Mac_Read_POST_Resource): Additional - overflow check in the summation of POST fragment lengths, - suggested by Mateusz Jurczyk . - -2014-11-26 suzuki toshiya - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Insert comments - and fold too long tracing messages. - -2014-11-26 suzuki toshiya - - Fix Savannah bug #43540. - - * src/base/ftmac.c (parse_fond): Prevent a buffer overrun - caused by a font including too many (> 63) strings to store - names[] table. - -2014-11-26 suzuki toshiya - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Use unsigned long - variables to read the lengths in POST fragments. Suggested by - Mateusz Jurczyk . - -2014-11-26 suzuki toshiya - - Fix Savannah bug #43539. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow - by a broken POST table in resource-fork. - -2014-11-26 suzuki toshiya - - Fix Savannah bug #43538. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow - by a broken POST table in resource-fork. - -2014-11-26 suzuki toshiya - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak - by a broken POST table in resource-fork. Return after freeing - the buffered POST table when it is found to be broken. - -2014-11-25 Werner Lemberg - - */*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate. - -2014-11-25 Werner Lemberg - - */*: s/Invalid_Argument/Invalid_Stream_Handle/ where appropriate. - -2014-11-25 Werner Lemberg - - */*: s/Invalid_Argument/Invalid_Library_Handle/ where appropriate. - -2014-11-25 Werner Lemberg - - */*: s/Invalid_Argument/Invalid_Outline/ where appropriate. - -2014-11-25 Werner Lemberg - - */*: s/Invalid_Argument/Invalid_Face_Handle/ where appropriate. - -2014-11-24 Werner Lemberg - - [Savannah bug #43682] Adjust some renderer callbacks. - - * src/raster/ftraster.c (ft_black_set_mode): Change return type to - `int' to stay in sync with `FT_Renderer_SetModeFunc' prototype. - - * src/smooth/ftgrays.c (gray_raster_set_mode): New dummy function - for orthogonality. - (ft_grays_raster): Use it. - -2014-11-25 Werner Lemberg - - [Savannah bug #43682] Properly handle missing return errors. - - The functions in this patch *do* return non-trivial errors that must - be taken care of. - - * src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c - (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render), - src/cff/cffgload.c (cff_decoder_parse_charstrings) , - src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode - (t1_decoder_parse_charstrings) , src/truetype/ttgload.c - (load_truetype_glyph , tt_loader_init, - TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend), - src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it. - -2014-11-25 Werner Lemberg - - [Savannah bug #43682] Add/remove `void' casts to some functions. - - We use a cast to indicate that we intentionally ignore a function's - return value. However, this doesn't apply to API functions where - errors can only happen for trivially invalid input. - - * src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder), - src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c - (cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning), - src/type1/t1load.c (parse_encoding), src/type42/t42parse.c - (t42_parse_encoding): Do it. - -2014-11-25 Werner Lemberg - - [Savannah bug #43682] Change some signatures to `void' return type. - - * include/internal/pshints.h (PSH_Globals_SetScaleFunc), - include/internal/sfnt.h (TT_Get_Metrics_Func), - src/pshinter/pshglob.c (psh_globals_set_scale), - src/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c - (tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange, - TT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context, - TT_Save_Context): Do it. - - * src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h, - src/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c - (TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c - (tt_size_run_fpgm, tt_size_run_prep): Updated. - -2014-11-24 Werner Lemberg - - Remove all code related to FT_MAX_CHARMAP_CACHEABLE. - - This is no longer used. - - * src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c, - src/sfnt/ttcmap.c: Do it. - -2014-11-24 Werner Lemberg - - [sfnt] Fix Savannah bug #43680. - - This adds an additional constraint to make the fix from 2013-01-25 - really work. - - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image) : - Check `p' before `num_glyphs'. - -2014-11-24 Werner Lemberg - - [truetype] Fix Savannah bug #43679. - - * src/truetype/ttpload.c (tt_face_load_hdmx): Check minimum size of - `record_size'. - -2014-11-24 Jarkko Pöyry - - [cff, pfr, psaux, winfonts] Fix Savannah bug #43676. - - Don't cast cmap init function pointers to an incompatible type. - - Without this patch, the number of parameters between declaration and - the real signature differs. Calling such a function results in - undefined behavior. - - ISO/IEC 9899:TC3 (Committee Draft September 7, 2007) - 6.5.2.2 Function calls - 9 If the function is defined with a type that is not - compatible with the type (of the expression) pointed to by - the expression that denotes the called function, the - behavior is undefined. - - On certain platforms (c -> js with emscripten) this causes - termination of execution or invalid calls because in the emscripten - implementation, function pointers of different types are stored in - different pointer arrays. Incorrect pointer type here results in - indexing of an incorrect array. - - * src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_unicode_init), - src/pfr/pfrcmap.c (pfr_cmap_init), src/psaux/t1cmap.c - t1_cmap_standard_init, t1_cmap_expert_init, t1_cmap_custom_init, - t1_cmap_unicode_init), src/winfonts/winfnt.c (fnt_cmap_init): Fix - signature. - -2014-11-24 Werner Lemberg - - [sfnt] Fix Savannah bug #43672. - - * src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for - minimum table length test. - -2014-11-24 Werner Lemberg - - [type1, type42] Another fix for Savannah bug #43655. - - * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c - (t42_parse_charstrings): Add another boundary testing. - -2014-11-24 Werner Lemberg - - [docmaker] Formatting, copyright, improved documentation. - - * src/tools/docmaker/*: No code changes besides trivial - modifications. - -2014-11-22 Werner Lemberg - - [bdf] Fix Savannah bug #43660. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) <"ENDFONT">: Check - `_BDF_GLYPH_BITS'. - -2014-11-22 Werner Lemberg - - [type42] Allow only embedded TrueType fonts. - - This is a follow-up to Savannah bug #43659. - - * src/type42/t42objs.c (T42_Face_Init): Exclusively use the - `truetype' font driver for loading the font contained in the `sfnts' - array. - -2014-11-22 Werner Lemberg - - [type42] Fix Savannah bug #43659. - - * src/type42/t42objs.c (T42_Open_Face): Initialize `face->ttf_size'. - - * src/type42/t42parse.c (t42_parse_sfnts): Always set - `face->ttf_size' directly. This ensures a correct stream size in - the call to `FT_Open_Face', which follows after parsing, even for - buggy input data. - Fix error messages. - -2014-11-22 Werner Lemberg - - [cff] Fix Savannah bug #43658. - - * src/cff/cf2ft.c (cf2_builder_lineTo, cf2_builder_cubeTo): Handle - return values of point allocation routines. - -2014-11-22 Werner Lemberg - - [sfnt] Fix Savannah bug #43656. - - * src/sfnt/ttcmap.c (tt_cmap4_validate): Fix order of validity - tests. - -2014-11-21 Werner Lemberg - - [type1, type42] Fix Savannah bug #43655. - - * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c - (t42_parse_charstrings): Fix boundary testing. - -2014-11-21 Werner Lemberg - - * src/pcf/pcfread.c (pcf_get_metrics): Sanitize invalid metrics. - -2014-11-21 Werner Lemberg - - [ftlcdfil] Obey flow direction. - - * src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy): - Handle `up' flow. - -2014-11-21 Werner Lemberg - - * src/base/ftbitmap.c (FT_Bitmap_Convert): Improve. - - This commit completes argument checks and adds support for different - flow directions. - -2014-11-21 Werner Lemberg - - * src/base/ftbitmap.c (FT_Bitmap_Copy): Improve. - - This commit adds argument checks and support for different flow - directions. - -2014-11-20 Werner Lemberg - - * src/base/ftbitmap.c (FT_Bitmap_New): Check argument. - -2014-11-19 Werner Lemberg - - Change some fields in `FT_Bitmap' to unsigned type. - - This doesn't break ABI. - - * include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays', - `pixel_mode', and `palette_mode' unsigned types. - - * src/base/ftbitmap.c: Updated. - (FT_Bitmap_Copy): Fix casts. - - * src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c: - Updated. - -2014-11-19 Werner Lemberg - - Make `FT_Bitmap_Convert' correctly handle negative `pitch' values. - - * src/base/ftbitmap.c (FT_Bitmap_Convert): Always use positive value - for the pitch while copying data. - Correctly set pitch sign in target bitmap. - -2014-11-19 Werner Lemberg - - Minor code improvement in `FT_Bitmap_Embolden'. - - * src/base/ftbitmap.c (FT_Bitmap_Embolden) : - Fix thinko. - -2014-11-19 Alexei Podtelezhnikov - - * src/base/fttrigon.c: Use dedicated `FT_Angle' for arctan table. - -2014-11-19 Behdad Esfahbod - - Avoid compiler warnings on x86-64 for `FT_MulFix'. - - `FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h', - but several inline implementations of it in `ftcalc.h' take - `FT_Int32' arguments. This is causing compiler warnings on x86-64: - If parameters of type `FT_Fixed' (= `FT_Long') are passed to the - inline implementation of this function, integer values are truncated - from 64bit to 32bit. - - * include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add - casts. - -2014-11-15 Werner Lemberg - - [sfnt] Fix Savannah bug #43597. - - * src/sfnt/pngshim.c (Load_SBit_Png): Protect against too large - bitmaps. - -2014-11-12 Werner Lemberg - - [sfnt] Fix Savannah bug #43591. - - * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Protect against addition - and multiplication overflow. - -2014-11-12 Werner Lemberg - - [sfnt] Fix Savannah bug #43590. - - * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir): - Protect against addition overflow. - -2014-11-12 Werner Lemberg - - [sfnt] Fix Savannah bug #43589. - - * src/sfnt/sfobjs.c (woff_open_font): Protect against addition - overflow. - -2014-11-12 Werner Lemberg - - [sfnt] Fix Savannah bug #43588. - - * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate, - tt_cmap12_validate, tt_cmap13_validate, tt_cmap14_validate): Protect - against overflow in additions and multiplications. - -2014-11-10 Alexei Podtelezhnikov - - [base] CORDIC improvements. - - The scaling between the hypotenuse and its CORDIC approximation is - based on regression analysis. The smaller padding for `theta' is - justifed by its maximum error of less than 6. - - * src/base/fttrigon.c (ft_trig_downscale): Borrow code from - ./ftcalc.c (ft_multo64), change linear intercept. - (ft_trig_pseudo_polarize): Decrease `theta' padding. - -2014-11-09 Werner Lemberg - - * src/base/ftstroke.c (ft_stroker_inside): Fix border intersections. - - One more place to check whether `radius' is zero. - - Problem reported by Marco Wertz . - -2014-11-07 Werner Lemberg - - [bdf] Fix Savannah bug #43535. - - * src/bdf/bdflib.c (_bdf_strncmp): New macro that checks one - character more than `strncmp'. - s/ft_strncmp/_bdf_strncmp/ everywhere. - -2014-11-06 Werner Lemberg - - [pcf] Fix Savannah bug #43548. - - * src/pcf/pcfread.c (pcf_get_encodings): Add sanity checks for row - and column values. - -2014-11-06 Werner Lemberg - - [pcf] Fix Savannah bug #43547. - - * src/pcf/pcfread.c (pcf_read_TOC): Check `size' and `offset' - values. - -2014-11-06 Werner Lemberg - - * src/pcf/pcfread.c (pcf_read_TOC): Avoid memory leak. - -2014-11-03 Infinality - - * src/truetype/ttsubpix.c (COMPATIBILITY_MODE_Rules): Updated. - - The previous commit deteriorates rendering of DejaVu and similar - fonts; this gets compensated with this rule. - -2014-11-03 Werner Lemberg - - * src/truetype/ttinterp.c (Ins_DELTAP): Fix subpixel hinting. - - Before this patch, it was impossible to ever call DELTAP[123] in - subpixel hinting mode as described in the ClearType whitepaper; it - only worked if in `compatibility mode'. However, compatibility mode - essentially disables SHPIX, completely ruining hinting of - ttfautohint output, for example. - - We now follow the whitepaper more closely so that DELTAP[123] - instructions for touched points in the non-subpixel direction are - executed. - -2014-10-31 Alexei Podtelezhnikov - - [smooth] Improve code readability. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code. - -2014-10-31 Alexei Podtelezhnikov - - [smooth] Reduce outline translations during rendering. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Translate origin - virtually by modifying cbox, actually translate outline if cumulative - shift is not zero. - -2014-10-30 Alexei Podtelezhnikov - - [smooth] Fix Savannah bug #35604 (cont'd). - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and - casts that became unnecessary after the variable type upgrades. - -2014-10-29 Alexei Podtelezhnikov - - [smooth] Improve code readability. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code. - -2014-10-29 Alexei Podtelezhnikov - - Unify hypotenuse approximations. - - * include/internal/ftcalc.h (FT_HYPOT): Move macro from here... - * include/internal/ftobjs.h: ... to here, next to required `FT_ABS'. - * src/smooth/ftgrays.c (gray_render_cubic): Use it here. - -2014-10-25 Werner Lemberg - - [cff] Test valid darkening parameter macros in `ftoption.h'. - - We no longer need an otherwise unused typedef that can cause a gcc - warning. - Problem reported by Alexei. - - * src/cff/cffobjs.c (cff_driver_init): Use - `CFF_CONFIG_OPTION_DARKENING_PARAMETER_XXX' macros directly. - (SET_DARKENING_PARAMETERS): Removed. - Compile time tests are now ... - - * devel/ftoption.h, include/config/ftoption.h: ... here. - -2014-10-25 Alexei Podtelezhnikov - - Improve flat corner definition. - - * include/internal/ftcalc.h (FT_HYPOT): Macro to approximate Euclidean - distance with the alpha max plus beta min algorithm. - * src/base/ftcalc.c (ft_corner_is_flat): Use it instead of Taxicab - metric. - -2014-10-23 David Weiß - - [build] Improve property file for vc2010. - - User-defined properties should be empty by default to prevent linker - failures. - - * builds/windows/vc2010/freetype.user.props, - builds/windows/vc2010/freetype.vcxproj: - s/OptionsDirectory/UserOptionDirectory/. - Comment out all user options. - -2014-10-23 Werner Lemberg - - [cff] Work around bug in preprocessor of MSVC 2010. - - We have been hit by - - https://connect.microsoft.com/VisualStudio/feedback/details/718976/msvc-pr - - * devel/ftoption.h, include/config/ftoption.h: Replace - `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' with eight macros - `CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}'. - - * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS): Removed. We no - longer need double expansion. - (SET_DARKENING_PARAMETERS_0): Renamed to ... - (SET_DARKENING_PARAMETERS): ... this. - Update call. - -2014-10-20 Werner Lemberg - - [sbit] Minor fixes. - - * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: - Accept overlay format also, but emit warning message in that case. - (tt_sbit_decoder_load_metrics): Add missing newline to error - message. - (tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS - 7.1) to the list of unsupported formats. - -2014-10-19 Alexei Podtelezhnikov - - [truetype] Clean up bytecode rounding. - - Zero distance does not have to be treated specially if you follow - specifications and check the sign as the very last step of rounding. - - * src/truetype/ttinterp.c (Round_None, Round_To_Grid, - Round_Down_To_Grid, Round_Up_To_Grid, Round_To_Double_Grid): Use - macros when available, do not check for non-zero distance. - (Round_To_Half_Grid, Round_Super, Round_Super_45): Ditto, return phase - if sign changed. - -2014-10-18 Alexei Podtelezhnikov - - [truetype] Unwrap engine compensation settings. - - * src/truetype/ttobjs.c (tt_size_init_bytecode): Updated. - -2014-10-18 David Weiß - - [build] Add property file to vc2010 project. - - This simplifies custom build configurations, especially for - automated build environments. - - * builds/windows/vc2010/freetype.user.props: New configuration file. - - * builds/windows/vc2010/freetype.vcxproj: Include - `freetype.user.props' and use its data fields. - - * builds/windows/vc2010/index.html: Updated. - -2014-10-18 Werner Lemberg - - [autofit] Add blue-zone support for Telugu. - - This essentially moves the Telugu script from the `Indic' hinter to - the `Latin' hinter. - - Note that this is a first shot and quite certainly needs - refinements. - - * src/autofit/afblue.dat: Add blue zone data for Telugu. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Telugu standard characters and move - data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Telugu data out of - AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afstyles.h: Update Telugu data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2014-10-18 David Wimsey - - [cmake] Add iOS build support. - From Savannah patch #8497. - - * builds/cmake/iOS.cmake: New file. Universal binaries are built - with both 32 and 64 bit arm architectures. - - * CMakeLists.txt (IOS_PLATFORM): New variable for running the iOS - toolchain. Possible values are `OS' to build on iOS, or - `SIMULATOR' to build on APPLE. - -2014-10-16 Behdad Esfahbod - Werner Lemberg - - [cff] Add `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' config macro. - - * devel/ftoption.h, include/config/ftoption.h - (CFF_CONFIG_OPTION_DARKENING_PARAMETERS): New macro. - - * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS, - SET_DARKENING_PARAMETERS_0): New macros. - (cff_driver_init): Use new macros. - -2014-10-14 Alexei Podtelezhnikov - - [truetype] Limit delta shift range. - - The valid range for delta shift is zero through six. Negative values - are invalid according to - - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20shift - - * src/truetype/ttobjs.h (delta_shift, delta_base): Make unsigned. - * src/truetype/ttinterp.h (DO_SDS): Throw an error if `delta_shift' - is out of range. - (Ins_DELTAP, Ins_DELTAC): Optimize for valid `delta_shift'. - -2014-10-16 Werner Lemberg - - A better fix for Savannah bug #43392. - Suggested by Doug Felt . - - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set - `vertAdvance' to zero... - - * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default - value for `vertAdvance' based on `linearVertAdvance' in case - `vertAdvance' is zero. Note that the previous computed ad-hoc value - for `linearVertAdvance' was apparently not tested in a real-life - situation. - -2014-10-14 David Weiß - - [build] Better optimization settings for vc2010 solution file. - - * builds/windows/vc2010/freetype.sln, - builds/windows/vc2010/freetype.vcxproj: Updated. - -2014-10-14 Werner Lemberg - - [autofit] Adjust Devenagari character range. - - * src/autofit/afranges.c (af_deva_uniranges): Omit characters that - are common to all other Indic scripts. - -2014-10-12 Werner Lemberg - - [sfnt] Fix Savannah bug #43392. - - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let - vertical metrics uninitialized. - -2014-10-11 Alexei Podtelezhnikov - - [base] Small bbox correction. - - * src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox - instead of initial point that could be `off' in conic outlines. - -2014-10-08 Alexei Podtelezhnikov - - [base] Fix Savannah bug #43356. - - * src/base/ftbbox.c (BBox_Move_To, BBox_Conic_To): Update bbox in case - of implicit `to'. - (BBox_Line_To): New emitter that does not update bbox. - -2014-10-08 Alexei Podtelezhnikov - - [base] Introduce and use new macro `FT_UPDATE_BBOX' - - * src/base/ftbbox.c (FT_UPDATE_BBOX): New macro. - (FT_Outline_Get_BBox): Use it here. - -2014-10-02 Alexei Podtelezhnikov - - [base] Significant optimization of `ft_div64by32' - - We shift as many bits as we can into the high register, perform - 32-bit division with modulo there, then work through the remaining - bits with long division. This optimization is especially noticeable - for smaller dividends that barely use the high register. - - * src/base/ftcalc.c (ft_div64by32): Updated. - -2014-10-02 Dave Arnold - - [cff] Fix Savannah bug #43271. - - * src/cff/cf2font.c (cf2_computeDarkening): Change overflow - detection to use logarithms and clamp `scaledStem'. - -2014-10-01 Alexei Podtelezhnikov - - * src/base/ftcalc.c: Remove miscellaneous type casts. - -2014-10-01 Alexei Podtelezhnikov - - [base] Use more common `FT_MSB' implementation with masks. - - * src/base/ftcalc.c (FT_MSB): Updated. - -2014-09-30 Alexei Podtelezhnikov - - [base] Clean up. - - * src/base/ftcalc.c (FT_MOVE_SIGN): New macro for frequently used - code. - -2014-09-25 Alexei Podtelezhnikov - - [base] Avoid unnecessary long division. - - This applies to `FT_MulDiv' but not to `FT_DivFix', where overflows or - lack thereof are predicted accurately. - - * src/base/ftcalc.c (ft_div64by32): Improve readability. - (FT_MulDiv, FT_MulDiv_No_Round) [!FT_LONG64]: Use straight division - when multiplication stayed within 32 bits. - -2014-09-24 Werner Lemberg - - [autofit] Minor clean-ups. - - * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values. - - * src/autofit/afhints.c (af_glyph_hints_dump_points, - af_glyph_hints_align_strong_points): Updated. - - * src/autofit/aflatin.c (af_latin_hints_link_segments, - af_latin_hints_compute_segments), src/autofit/afcjk.c - (af_cjk_hints_link_segments), src/autofit/aflatin2.c - (af_latin2_hints_link_segments, af_latin2_hints_compute_segments): - There are no longer fake segments since more than 10 years... - -2014-09-22 Werner Lemberg - - [autofit] Minor code streamlining. - - * src/autofit/afhints.c (af_axis_hints_new_edge): Remove redundant - initialization. - -2014-09-19 Alexei Podtelezhnikov - - * src/base/ftcalc.c: Harmonize code. - -2014-09-15 Alexei Podtelezhnikov - - [base] Tighten the overflow check in `FT_MulDiv'. - - * src/base/ftcalc.c (FT_MulDiv) [!FT_LONG64]: Updated. - -2014-09-08 Alexei Podtelezhnikov - - Fix Savannah bug #43153. - - * src/psaux/psconv.c (PS_Conv_ToFixed): Add protection against - overflow in `divider'. - -2014-09-03 Alexei Podtelezhnikov - - [base] Tighten the overflow check in `FT_DivFix'. - - This fixes a 13-year old bug. The original overflow check should have - been updated when rounding was introduced into this function - (c2cd00443b). - - * src/base/ftcalc.c (FT_DivFix) [!FT_LONG64]: Updated. - * include/freetype.h (FT_DivFix): Updated documentation. - -2014-09-03 Alexei Podtelezhnikov - - [base] Tighten the overflow check in `FT_MulFix'. - - * src/base/ftcalc.c (FT_MulFix) [!FT_LONG64]: Updated. - -2014-09-02 Alexei Podtelezhnikov - - [truetype] Shortcut ppem calculations for square pixels. - - * src/truetype/ttinterp.h (TT_ExecContextRec): New field - `cur_ppem_func' with a function pointer. - * src/truetype/ttinterp.c (TT_RunIns): Initialize `cur_ppem_func' - depending on the pixel geometry to either... - (Current_Ppem_Stretched): ... this for stretched pixels. - (Current_Ppem): ... or this for square pixels. - (DO_MPPEM, DO_MPS, Ins_DELTAP, Ins_DELTAC): Use `cur_ppem_func'. - -2014-08-31 Behdad Esfahbod - - Don't use `register' keyword. Fixes compiler warnings. - - * src/base/ftcalc.c (FT_Add64) [!FT_LONG64]: Do it. - * src/gzip/inftrees.c (huft_build): Ditto. - * src/truetype/ttinterp.c (TT_MulFix14_arm): Ditto. - -2014-08-24 Alexei Podtelezhnikov - - [truetype] Optimize DELTAP and DELTAC. - - * src/truetype/ttinterp.c (Ins_DELTAP, Ins_DELTAC): Move ppem - calculations outside of the loop. - -2014-08-21 Alexei Podtelezhnikov - - Fix Savannah bug #43033. - - * include/config/ftconfig.h, builds/unix/ftconfig.in, - builds/vms/ftconfig.h [FT_LONG64]: Do not disable the macro when - 64-bit type is `long'. - -2014-08-20 Alexei Podtelezhnikov - - [base] Small optimization of `FT_MulFix'. - - * src/base/ftcalc.c (FT_MulFix): Loosen up the condition for direct - 32-bit calculations. - -2014-08-19 Alexei Podtelezhnikov - - [base] Use unsigned calculation in `FT_MulDiv'. - - * src/base/ftcalc.c (FT_MulDiv): Updated to expand 32-bit range. - -2014-08-18 Alexei Podtelezhnikov - - [base] Remove truncation in `FT_DivFix'. - - * src/base/ftcalc.c (FT_DivFix): Updated. - -2014-08-14 Alexei Podtelezhnikov - - Minor refactoring. - - * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Updated. - -2014-08-14 Alexei Podtelezhnikov - - Turn FT_MSB into a macro when using gcc builtins. - - * src/base/ftcalc.c, include/internal/ftcalc.h: Updated. - -2014-08-12 Alexei Podtelezhnikov - - [base] Avoid undefined FT_MSB in `BBox_Cubic_Check'. - - * src/base/ftbbox.c (BBox_Cubic_Check): Update. - (update_cubic_max): Repalce with... - (cubic_peak): ... this, which now handles upscaling. - -2014-08-11 Alexei Podtelezhnikov - - [base] Handle collapsed outlines to avoid undefined FT_MSB. +2015-10-10 Werner Lemberg - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Update. + * src/pcf/pcfread.c (pcf_read_TOC): Check stream size (#46162). -2014-08-11 Alexei Podtelezhnikov +2015-10-09 Werner Lemberg - [base] Restore FT_MulFix inlining. + * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Use real stream size. - * include/freetype.h (FT_MulFix): Unconditionally defined. +2015-10-08 Werner Lemberg - * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: Move code from here... + [pcf] Protect against invalid number of TOC entries (#46159). - * include/internal/ftcalc.h [FT_MULFIX_ASSEMBLER]: ... to here, - which conditionally replaces the function with an inline version - through the macro. + * src/pcf/pcfread.c (pcf_read_TOC): Check number of TOC entries + against size of data stream. -2014-08-08 Alexei Podtelezhnikov +2015-10-08 Werner Lemberg - * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Refactor. + [type42] Protect against invalid number of glyphs (#46159). -2014-07-26 Werner Lemberg - - [cff] Fix typo. - - * src/cff/cf2hints.c (cf2_glyphpath_computeOffset): Use correct - offsets in third quadrant. - - Reported by maks . - -2014-07-17 Werner Lemberg - - Fix Savannah bug #42788. - - * src/pfr/pfrobjs.c: Include `ftcalc.h'. - -2014-07-16 Alexei Podtelezhnikov - - Replace `ft_highpow2' function. - - * src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of - `ft_highpow2'. - - * src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove - it. - -2014-07-15 Alexei Podtelezhnikov - - * src/base/ftcalc.c (FT_MSB): Utilize gcc builtins. - -2014-07-15 Alexei Podtelezhnikov - - [base] Move assembler code back in the source file. - - FT_MulFix assembler used to reside in ftcalc.c before f47d263f1b. - - * include/config/ftconfig.h, builds/unix/ftconfig.in, - builds/vms/ftconfig.h [FT_MULFIX_ASSEMBLER]: Move code from here... - - * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: ... to here. - -2014-07-14 Alexei Podtelezhnikov - - [base] Further clean up color bitmap conversion. - - * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Stop - using FT_MulFix and FT_DivFix since all calculations fit into 32 bits. - -2014-07-13 Werner Lemberg - - [truetype] Improve handling of buggy `prep' tables. - - In case of an error in the `prep' table, no longer try to execute it - again and again. This makes FreeType handle endless loops in buggy - fonts much faster. - - * src/truetype/ttobjs.h (TT_SizeRec): The fields `bytecode_ready' - and `cvt_ready' are now negative if not initialized yet, otherwise - they indicate the error code of the last run. - - * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep, - tt_size_done_bytecode, tt_size_init_bytecode, - tt_size_ready_bytecode, tt_size_init, tt_size_done, tt_size_reset): - Updated. - - * src/truetype/ttgload.c (tt_loader_init): Updated. - * src/truetype/ttinterp.c (TT_RunIns): Force reexecution of `fpgm' - and `prep' only if we are in the `glyf' table. - -2014-07-12 Werner Lemberg - - * builds/vms/ftconfig.h: Synchronize. - Problem reported by Alexei. - -2014-07-11 Alexei Podtelezhnikov - - [base] Clean up bitmap conversion. - - * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use - appropriate FT_DivFix and remove superfluous upscaling. - -2014-07-04 Alexei Podtelezhnikov - - [base] Small optimization of the ancient code. - - * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Loosen up the - condition for direct 32-bit calculations. - -2014-06-27 Werner Lemberg - - Fix Apple standard glyph names. - - * src/sfnt/ttpost.c (tt_post_default_names): Synchronize with - `tools/glnames.py' - - Problem reported by Adam Twardoch . - -2014-06-17 Werner Lemberg - - Partially revert commit from 2014-06-13. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Move - declaration of `p_first' and `p_last' out of the loop. - -2014-06-17 Werner Lemberg - - * builds/unix/freetype2.m4: s/AC_PATH_PROG/AC_PATH_TOOL/. - - This simplifies cross-compiling. - -2014-06-13 Werner Lemberg + * src/type42/t42parse.c (t42_parse_charstrings): Check number of + `CharStrings' dictionary entries against size of data stream. - Fix more compiler warnings. - Reported by Wojciech Mamrak . +2015-10-08 Werner Lemberg - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): - Make integer constant unsigned. + [sfnt] Fix some signed overflows (#46149). * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) - : Fix types. - (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper - casts. - -2014-06-13 Werner Lemberg - - Fix compiler warnings. - Reported by Wojciech Mamrak . - - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage), - src/autofit/afmodule.c (af_property_set): Fix `signed' vs. - `unsigned' issues. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler - happy. - - * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements - for `fir'. - Fix `signed' vs. `unsigned' issues. - - * src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused. - (WRITE_USHORT, WRITE_ULONG): Add proper casts. - - * src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts. - - * src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1' - and `B2'. - -2014-05-16 Alexey Petruchik - - [cmake] Add option to build OS X framework. - - * CMakeLists.txt: Update accordingly. - - * builds/mac/freetype-Info.plist: New file. - -2014-05-13 Pavel Koshevoy - - * CMakeLists.txt (BASE_SRCS): Add missing `ftbdf.c'. - -2014-05-11 Werner Lemberg - - [autofit] Fix variable initializations. - - * src/autofit/afhints.c (af_glyph_hints_reload): Assign default - values to `in_dir' and `out_dir' for all points. - -2014-05-11 Werner Lemberg - - [autofit] Fix crash with font `CabinSketch-Bold.ttf'. - - Problem reported by Ralf S. Engelschall . - - * src/autofit/afhints.c (af_glyph_hints_reload): Fix threshold for - finding first non-near point. - Properly initialize non-near point deltas. - -2014-05-01 Werner Lemberg - - [autofit] Add blue-zone support for Devanagari. - - This essentially moves the Devanagari script from the `Indic' hinter - to the `Latin' hinter. Thanks to Girish Dalvi - for guidance with blue zone characters! - - * src/autofit/afblue.dat: Add blue zone data for Devanagari. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afscript.h: Add Devanagari standard characters and - move data out of AF_CONFIG_OPTION_INDIC block. - - * src/autofit/afranges.c: Move Devanagari data out of - AF_CONFIG_OPTION_INDIC block. - Move U+20B9, (new) Rupee sign, from Latin to Devanagari. - - * src/autofit/afstyles.h: Update Devanagari data; in particular, use - AF_WRITING_SYSTEM_LATIN. - -2014-05-01 Werner Lemberg - - [autofit] Fix handling of neutral blue zones in stems. - - * src/autofit/afhints.h (AF_Edge_Flags): New value - `AF_EDGE_NEUTRAL'. - - * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace - neutral blue zones with AF_EDGE_NEUTRAL. - (af_latin_hint_edges): Skip neutral blue zones if necessary. - -2014-04-28 Werner Lemberg - - [autofit] Introduce neutral blue zones to the latin module. - - Such blue zones match either the top or the bottom of a contour. We - need them for scripts where accent-like elements directly touch the - base character (for example, some vowel signs in Devanagari, cf. - U+0913 or U+0914). - - * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New - property. - - * src/autofit/afblue.h: Regenerated. - - * src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro. - (AF_LATIN_BLUE_NEUTRAL): New enumeration value. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues, - af_latin_hints_compute_blue_edges): Handle neutral blue zones. - -2014-04-25 Werner Lemberg - - * src/autofit/hbshim.c: Partially revert commit from 2014-04-17. - - Using input glyph coverage data is simply wrong. - - Problem reported by Nikolaus Waxweiler and - Mantas Mikulėnas . - -2014-04-23 Werner Lemberg - - * src/raster/ftraster.c (Vertical_Sweep_Span): Use drop-out mode. - - This spot has been missed while introducing support for various - drop-out modes years ago (including no drop-out mode, which this - commit fixes). - - Problem reported by Patrick Thomas . - -2014-04-22 Werner Lemberg - - * src/sfnt/pngshim.c (error_callback): s/longjmp/ft_longjmp/. - -2014-04-20 Werner Lemberg - - [autofit] Fix Savannah bug #42148. - - The adaptation of the cjk auto-hinter module to blue stringsets in - 2013-08-25 had three severe bugs. Mea culpa. - - 1. Contrary to the latin auto-hinter, characters for reference and - overshoot values of a blue zone are specified separately. Due to - the screwed-up change it didn't work at all. - - 2. A boolean comparison was erroneously replaced with a cast, - causing invalid results with the `^' operator later on. The - visual artifact caused by this problem is the topic of the bug - report. - - 3. Two flag values were inverted, causing incorrect assignment of - reference and overshoot values. - - * src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new - syntax to have both reference and overshoot characters in a single - string. This is error #1. - Add extensive comments. - - * src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no - longer used. - (AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values. - This is error #3. - - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - - * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1. - Use character `|' to separate characters for reference and overshoot - values. - Improve tracing messages, synchronizing them with the latin - auto-hinter. - (af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'. - This is error #2. - (af_cjk_align_linked_edge): Add tracing message. - - * src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer - used. - -2014-04-17 Werner Lemberg - - [autofit] More coverage fixes for complex scripts. - - * src/autofit/hbshim.c (af_get_coverage): Merge input glyph coverage - of GSUB lookups into output coverage. Otherwise, ligatures are not - handled properly. - Don't check blue zone characters for default coverage. - -2014-04-17 Werner Lemberg - - Make `FT_Get_SubGlyph_Info' actually work. - - * src/base/ftobjs.c (FT_Get_SubGlyph_Info): Return FT_Err_Ok - if there is no error. - -2014-04-15 Werner Lemberg - - [afblue.pl]: Minor improvements. - - * src/tools/afblue.pl: Allow whitespace before comments. - Ignore whitespace in strings. - -2014-04-14 Werner Lemberg - - [autofit] Improve coverage handling. - - * src/autofit/hbshim.c (af_get_coverage): Don't exclude glyphs - appearing in the GPOS table if we are processing the default - coverage. + : Use `FT_MulDiv'. -2014-04-13 David Weber +2015-10-08 Werner Lemberg - [smooth] Fix stand-alone compilation. + [type1] Protect against invalid number of subroutines (#46150). - * src/smooth/ftgrays.c (FT_BEGIN_STMNT, FT_END_STMNT): Define. + * src/type1/t1load.c (parse_subrs): Check number of + `Subrs' dictionary entries against size of data stream. -2014-04-12 Werner Lemberg +2015-10-07 Kostya Serebryany - [autofit] Redesign the recognition algorithm of strong points. + [ftfuzzer] Add support for LLVM's LibFuzzer. - In particular, local extrema without horizontal or vertical segments - are better recognized: + * src/tools/ftfuzzer/ftfuzzer.cc, src/tools/runinput.cc: New files. - + A + D - \ / - \ / - \ / - \ / - \ + C - \ / - B +/ +2015-10-06 Alexei Podtelezhnikov - If the distances AB and CD are large, point B wasn't previously - detected as an extremum since the `ft_corner_is_flat' function - `swallowed' BC regardless of its direction, tagging point B as weak. - The next iteration started at B and made `ft_corner_is_flat' swallow - point C, tagging it as weak also, et voilà. + [smooth] Faster alternative line renderer. - To improve that, another pass gets now performed before calling - `ft_corner_is_flat' to improve the `topology' of an outline: A - sequence of non-horizontal or non-vertical vectors that point into - the same quadrant are handled as a single, large vector. + 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. - Additionally, distances of near points are now accumulated, which - makes the auto-hinter handle them as if they were prepended to the - next non-near vector. + * src/smooth/ftgrays.c (gray_render_line): New implementation. - This generally improves the auto-hinter's rendering results. +2015-10-06 Werner Lemberg - * src/autofit/afhints.c (af_glyph_hints_reload): Implement it. + [cff] Return correct PS names from pure CFF (#46130). - * src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag - `AF_FLAG_NEAR'. + * src/cff/cffdrivr.c (cff_get_ps_name): Use SFNT service only for + SFNT. -2014-04-05 Werner Lemberg - - [autofit] Improve scoring algorithm for identifying stems. - - Problem reported by Karsten Lücke . - - The new algorithm takes care of the width of stems: If the distance - between two segments is larger than the largest stem width, the - demerits quickly increase for larger distances. This improves - hinting of slanted fonts (especially if the inner parts of serifs - have non-horizontal `shoulders'), avoiding false stem links. - - * src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest - stem width (if available) to compute better demerits for distances - between stems. - (af_latin_hints_detect_features): Pass stem width array and array - size. - (af_latin_metrics_init_widths): Updated to use original algorithm. - (af_latin_hints_apply): Updated to use new algorithm. - - * src/autofit/aflatin.h: Updated. - * src/autofit/afcjk.c: Updated. - -2014-04-03 Werner Lemberg - - Don't require `gzip' module for `sfnt'. - - Reported by Preet . - - * src/sfnt/sfobjs.c (woff_open_font): Guard use of - FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB. - -2014-03-27 Werner Lemberg - - Fix Savannah bug #38235. - - Work around a bug in pkg-config version 0.28 and earlier: If a - variable value gets surrounded by doublequotes (in particular values - for the `prefix' variable), the prefix override mechanism fails. - - * builds/unix/freetype2.in: Don't use doublequotes. - * builds/unix/unix-def.in (freetype.pc): Escape spaces in directory - names with backslashes. - -2014-03-24 Werner Lemberg - - Fix Savannah bug #41946. - - Based on a patch from Marek Kašík . - - * builds/unix/configure.raw (LIBS_CONFIG): Remove. - * builds/unix/freetype-config.in (libs): Hard-code value. - * builds/unix/unix-def.in: Updated. - -2014-03-22 Werner Lemberg - - Another revert for the change from 2014-03-18. - - Problem reported by Nikolaus Waxweiler . - - * src/base/ftcalc.c (FT_MulFix): Ensure that an `FT_MulFix' symbol - gets always exported. - -2014-03-20 Werner Lemberg - - CMakeLists.txt: Another fix for include directories. - - Problem reported by Taylor Holberton . - -2014-03-19 Werner Lemberg - - CMakeLists.txt: Fix include directories. - - Problem reported by Taylor Holberton . - -2014-03-19 Werner Lemberg - - Partially revert last commit. - - Found by Alexei. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initializing - those variables is plain wrong, since we are in a loop. - -2014-03-18 Sean McBride - Werner Lemberg - - Fix clang warnings. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize - some variables. - - * src/base/ftcalc.c (FT_MulFix): Only use code if - `FT_MULFIX_INLINED' is not defined. - - * src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c - (ftc_basic_image_family_class, ftc_basic_image_cache_class, - ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class), - src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c - (ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c - (pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make - function static. - - * src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant - code. - -2014-03-17 Werner Lemberg - - Fix Savannah bug #41869. - - This works around a problem with HarfBuzz (<= 0.9.26), which doesn't - validate glyph indices returned by - `hb_ot_layout_lookup_collect_glyphs'. - - * src/autofit/hbshim.c (af_get_coverage): Guard `idx'. - - * docs/CHANGES: Updated. - -2014-03-14 Werner Lemberg - - * builds/unix/configure.raw: Don't show error messages of `which'. - -2014-03-09 Alan Coopersmith - - Fix cppcheck 1.64 warning. - - * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer - dereference in case of error. +2015-10-04 Werner Lemberg -2014-03-09 Sean McBride + [base] Replace left shifts with multiplication (#46118). - * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning. + * src/base/ftglyph.c (ft_bitmap_glyph_bbox, FT_Get_Glyph): Do it. -2014-03-06 Werner Lemberg +2015-10-04 Werner Lemberg - * Version 2.5.3 released. + * Version 2.6.1 released. ========================= - Tag sources with `VER-2-5-3'. + Tag sources with `VER-2-6-1'. * docs/VERSION.DLL: Update documentation and bump version number to - 2.5.3. + 2.6.1. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, builds/windows/vc2005/index.html, @@ -4722,3169 +874,2723 @@ 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.2/2.5.3/, s/252/253/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. - - * builds/unix/configure.raw (version_info): Set to 17:2:11. - * CMakeLists.txt (VERSION_PATCH): Set to 3. - * docs/CHANGES: Updated. - -2014-03-06 Werner Lemberg - - Fixes for compilation with C++. - - * src/autofit/hbshim.c (scripts): Change type to `hb_script_t'. - (af_get_coverage): Updated. - (COVERAGE): Add cast. - -2014-03-06 Sean McBride - - Remove more clang analyzer warnings. - - * src/bdf/bdflib.c (_bdf_readstream), src/truetype/ttgload.c - (TT_Load_Glyph): Remove dead stores. - -2014-03-05 Werner Lemberg - - * builds/unix/configure.raw: Simplify. - -2014-03-05 suzuki toshiya - - Fix a bug in configure in library dependency setting - Reported in https://bugs.freedesktop.org/show_bug.cgi?id=75652. - - * builds/unix/configure.raw: Use `x"${xxx}" != xno' style. - -2014-03-04 Werner Lemberg - - Minor fix for `make devel'. - - * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Don't use - pkg-config for bzip2 since not all GNU/Linux distributions have - `bzip2.pc' (and the header file `bzlib.h' is located in /usr/include - normally). - -2014-03-04 Sean McBride - - Fix several clang static analyzer dead store warnings. - - * src/autofit/afhints.c (af_glyph_hints_reload, - af_glyph_hints_align_weak_points): Remove unnecessary assignments. - - * src/bdf/bdflib.c (bdf_font_load): Ditto. - - * src/pshinter/pshalgo.c (psh_glyph_compute_extrema, - psh_glyph_interpolate_other_points): Ditto. - - * src/type1/t1load.c (T1_Set_MM_Blend): Ditto. - -2014-03-03 Werner Lemberg - - Rewrite library option handling in `configure'. - - o Introduce `auto' value for `--with-XXX' library options; this is - now the default. - - o First use `pkg-config' for library detection, then fall back to - other tests. - - * builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png, - --with-harfbuzz): Rewrite. - Use new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf' - variables to collect data for `freetype2.pc' and `freetype-config'. - (FT2_EXTRA_LIBS): Renamed to ... - (ft2_extra_libs): This since it gets no longer substituted. - (REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG): - New output variables, replacing `XXX_PKG' and `LIBXXX'. - Add notice at the end of `configure' showing the library - configuration. - - * builds/unix/freetype-config.in (--static): New command line - option. - (libs): Updated. - (staticlibs): New variable, to be used if `--static' is given. - * docs/freetype-config.1: Document `--static'. - - * builds/unix/freetype2.in, builds/unix/unix-def.in: Updated. - -2014-03-01 Werner Lemberg - - Avoid `long long' warnings with older gcc compilers. - Problem reported by Hin-Tak Leung . - - * builds/unix/configure.raw: Don't use gcc's `-pedantic' flag for - versions < 4.6. This is especially needed for Max OS X since this - OS runs a gcc variant (or emulation) based on version 4.2.1. - -2014-03-01 Werner Lemberg - - * docs/INSTALL.CROSS: Revised and updated. - -2014-03-01 Werner Lemberg - - Make `make clean' remove `freetype2.pc'. - - This is a generated file at build time, not configure time. - - * builds/unix/unix-def.in (DISTCLEAN): Move `freetype2.pc' to ... - (CLEAN): This variable. - -2014-03-01 Werner Lemberg - - Use pkg-config for detecting libpng and libbz2 also. - - * builds/unix/configure.raw (HAVE_PKG): New variable. - Search for libbz2 using `pkg-config'; s/BZ2/BZIP2/. - Search for libpng using `pkg-config'. - Fix definition of `LIBHARFBUZZ' variable. - * builds/unix/freetype-config.in ($libs): Updated. - * builds/unix/freetype2.in: Add `URL' field. - Update `Requires.private' and `Libs.private'. - * builds/unix/unix-def.in: Updated. - -2014-03-01 Werner Lemberg - - Add configure support for HarfBuzz. - - * builds/unix/pkg.m4: New file. - * builds/unix/configure.raw: Search for libharfbuzz using - `pkg-config'. - Add `--without-harfbuzz' option. - * builds/unix/freetype-config.in, builds/unix/freetype2.in, - builds/unix/unix-def.in (freetype-config, freetype2.pc): Handle - HarfBuzz. - - * docs/INSTALL.UNIX: Document interdependency of Freetype with - HarfBuzz. + builds/wince/vc2008-ce/index.html: s/2.6/2.6.1/, s/26/261/. -2014-02-28 Alexei Podtelezhnikov + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. - [cff] Math simplifications. + * builds/unix/configure.raw (version_info): Set to 18:1:12. + * CMakeLists.txt (VERSION_PATCH): Set to 1. - * src/cf2blues.c (cf2_blues_init): Use `FT_MulDiv'. - * src/cf2ft.c (cf2_getScaleAndHintFlag): Use simple division. + * src/autofit/afmodule.c [AF_DEBUG_AUTOFIT]: Ensure C linking for + dumping functions. -2014-02-28 Dave Arnold +2015-10-04 Werner Lemberg - [cff] Fix Savannah bug #41697, part 2. + [bzip2, gzip] Avoid access of unitialized memory (#46109). - * src/cff/cf2ft.c (cf2_initLocalRegionBuffer, - cf2_initGlobalRegionBuffer): It is possible for a charstring to call - a subroutine if no subroutines exist. This is an error but should - not trigger an assert. Split the assert to account for this. + * 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. -2014-02-28 Dave Arnold +2015-10-03 Werner Lemberg - [cff] Fix Savannah bug #41697, part 1. + [bzip2, gzip] Avoid access of unitialized memory (#46109). - * src/cff/cf2hints.c (cf2_hintmap_build): Return when `hintMask' is - invalid. In this case, it is not safe to use the length of - `hStemHintArray'; the exception has already been recorded in - `hintMask'. + * 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. -2014-02-26 Werner Lemberg +2015-10-01 Alexei Podtelezhnikov - [sfnt] Fix Savannah bug #41696. + [smooth] Clean up worker. - * src/sfnt/ttcmap.c (tt_cmap0_validate, tt_cmap2_validate, - tt_cmap4_validate, tt_cmap14_validate): Fix limit tests. + * src/smooth/ftgrays.c (gray_TWorker): Remove never used fields. -2014-02-26 Werner Lemberg +2015-10-01 Werner Lemberg - [winfnt] Fix Savannah bug #41694. + [sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078). - * src/winfonts/winfnt.c (FNT_Load_Glyph): Check glyph offset. + * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of + border conditions (i.e., if the loop exits naturally). -2014-02-26 Werner Lemberg +2015-10-01 Werner Lemberg - [cff] Fix Savannah bug #41693. + * src/autofit/afranges.c (af_deva_nonbase_uniranges): Fix ranges. + They should be a subset of `af_deva_uniranges'. - * src/cff/cffload.c (CFF_Load_FD_Select): Reject empty array. +2015-10-01 Werner Lemberg -2014-02-26 Werner Lemberg + [sfnt] Make `tt_cmap4_char_map_linear' faster (#46078). - [bdf] Fix Savannah bug #41692. + * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Use inner loop to + reject too large glyph indices. - bdflib puts data from the input stream into a buffer in chunks of - 1024 bytes. The data itself gets then parsed line by line, simply - increasing the current pointer into the buffer; if the search for - the final newline character exceeds the buffer size, more data gets - read. +2015-09-30 Alexei Podtelezhnikov - However, in case the current line's end is very near to the buffer - end, and the keyword to compare with is longer than the current - line's length, an out-of-bounds read might happen since `memcmp' - doesn't stop properly at the string end. + [smooth] Clean up worker. - * src/bdf/bdflib.c: s/ft_memcmp/ft_strncmp/ to make comparisons - stop at string ends. + * src/smooth/ftgrays.c (gray_TWorker): Remove lightly used `last_ey'. + (gray_start_cell, gray_render_line): Update. -2014-02-17 suzuki toshiya +2015-09-30 Werner Lemberg - [autofit] Fix `make multi' compilation. + [autofit] Replace `no-base' with `non-base'. - * src/autofit/hbshim.c: Include `afglobal.h' and `aftypes.h'. + * src/autofit/*: Do it. -2014-02-19 Werner Lemberg - Simon Bünzli +2015-09-30 Werner Lemberg - Fix Savannah bug #32902. + [sfnt] Rewrite `tt_cmap4_char_map_linear' (#46078). - Patch taken from + * 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. - https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/_patches/freetype2.patch?spec=svn8620&r=8620#87 +2015-09-30 Werner Lemberg - with slight modifications. + [truetype] Adjust number of glyphs for malformed `loca' tables. - * src/type1/t1parse.c (T1_Get_Private_Dict): Add heuristic test to - handle fonts that incorrectly use \r at the beginning of an eexec - block. + * src/truetype/ttpload.c (tt_face_load_loca): Implement it. -2014-02-19 Simon Bünzli +2015-09-29 Werner Lemberg - Fix Savannah bug #41590. + [pshinter] Avoid harmless overflow (#45984). - * src/type1/t1load.c (parse_encoding): Protect against invalid - number. + * src/pshinter/pshglob.c (psh_blues_set_zones): Fix it. -2014-02-12 Dave Arnold +2015-09-28 Werner Lemberg - [cff] Optimize by using `FT_MulDiv'. - Suggested by Alexei. + [autofit] Add support for Lao script. - * src/cff/cf2font.c (cf2_computeDarkening): Do it. + Thanks to Danh Hong for guidance with blue zone + characters! -2014-02-12 Werner Lemberg + * src/autofit/afblue.dat: Add blue zone data for Lao. - Fix Savannah bug #41465. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - * builds/unix/unix-def.in (CLEAN): Add `freetype-config'. - (DISTCLEAN): Remove `freetype-config'. + * src/autofit/afscript.h: Add Lao standard characters. -2014-02-08 Sean McBride + * src/autofit/afranges.c: Add Lao data. - Fix clang static analyzer and compiler warnings. + * src/autofit/afstyles.h: Add Lao data. - * src/autofit/afhints.c (af_glyph_hints_align_weak_points), - src/autofit/afloader (af_loader_load_g) , - src/base/ftcalc.c (FT_MSB), src/base/ftoutln.c - (FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style), - src/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c - (cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load), - src/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c - (sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next, - tt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead - code. +2015-09-27 suzuki toshiya + + [base] Fix a leak by broken sfnt-PS or resource fork (#46028). - * src/autofit/afmodule.c (af_property_get_face_globals, - af_property_set, af_property_get), src/base/ftbitmap.c - (ft_gray_for_premultiplied_srgb_bgra): Make functions static. + 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 (ft_remove_renderer): Protect against - library == NULL. - (ft_property_do): Make function static. + * 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(); - * src/base/ftrfork.c: Include `ftbase.h'. +2015-09-27 suzuki toshiya - * src/sfnt/ttsbit.c (tt_face_load_sbix_image) - [!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c - (T1_Compute_Max_Advance): Avoid compiler warning. + [mac] Fix buffer size calculation for LWFN font. - * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of - variable. + * src/base/ftmac.c (read_lwfn): Cast post_size to FT_ULong + to prevent confused copy by too large chunk size. -2014-02-08 Werner Lemberg +2015-09-26 Alexei Podtelezhnikov - Fix Windows build directories. + * src/smooth/ftgrays.c (PIXEL_MASK): Remove unused macro. - The build target is now `windows' instead of `win32'. +2015-09-26 Werner Lemberg - Problem reported by Nickolas George . + [autofit] Minor tracing improvement. - * builds/modules.mk: Don't use `win32' and `win16' (!) but - `windows'. + * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Don't emit + blue zones header line if there are no blue zones. - * builds/windows/detect.mk, builds/windows/win32-def.mk: - s/win32/windows/. +2015-09-26 Werner Lemberg -2014-02-08 Eugen Sawin + [bzip2, gzip, lzw] Harmonize function signatures with prototype. - Fix Savannah bug #41507. + Suggested by Hin-Tak Leung. - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) - [!FT_CONFIG_OPTION_USE_PNG] <17, 17, 19>: Fix error handling. + * 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. -2014-02-08 Dave Arnold +2015-09-26 Hin-Tak Leung - [cff] Fix minor performance bug. + Add new FT_LOAD_COMPUTE_METRICS load flag. - * src/cff/cf2font.c (cf2_font_setup): Darkening amount and blue zone - calculations are now cached and not recomputed on each glyph. + * include/freetype/freetype.h (FT_LOAD_COMPUTE_METRICS): New macro. + * src/truetype/ttgload.c (compute_glyph_metrics): Usage. -2014-02-05 Werner Lemberg +2015-09-26 Werner Lemberg - Fix problems with perl 5.8.8 as distributed with current MinGW. + * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add cast. - * src/tools/afblue.pl: Work-around for Perl bug #63402. - (string_re): Avoid `possessive quantifiers', which have been - introduced in Perl version 5.10. +2015-09-25 Werner Lemberg -2014-02-04 Werner Lemberg + [type1] Protect against invalid number of glyphs (#46029). - Fix compilation with MinGW. + * src/type1/t1load.c (parse_charstrings): Check number of + `CharStrings' dictionary entries against size of data stream. - Right now, compilation out of the box with latest MinGW is broken - due to bugs in header files of mingwrt 4.0.3 in strict ANSI mode, - cf. +2015-09-23 Werner Lemberg - https://sourceforge.net/p/mingw/bugs/2024/ - https://sourceforge.net/p/mingw/bugs/2046/ + [sfnt] Better checks for invalid cmaps (2/2) (#46019). - * builds/unix/configure.raw: Don't set `-ansi' flag for MinGW. + 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. -2014-02-04 Werner Lemberg + * 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. - [autofit] Minor fix. +2015-09-23 Werner Lemberg - * src/autofit/afcjk.c (af_cjk_metrics_init_widths), - src/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling - of alternative standard characters. - This also fixes a compilation warning in non-debug mode. + [base, sfnt] Better checks for invalid cmaps (1/2). -2014-02-03 Werner Lemberg + * src/base/ftobjs.c (FT_Get_Char_Index): Don't return out-of-bounds + glyph indices. + (FT_Get_First_Char): Updated. - [cff] Fix Savannah bug #41363. + * src/sfnt/ttcmap.c (tt_cmap6_char_next): Don't return character + codes greater than 0xFFFF. - * src/cff/cf2ft.c (cf2_checkTransform): Convert assertion into - parameter check. - (cf2_decoder_parse_charstrings): Call `cf2_checkTransform' only if - we are scaling the outline. - (cf2_getPpemY): Remove problematic assertion. + (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. -2014-01-26 Werner Lemberg + (tt_cmap10_char_index): Fix unsigned integer logic. + (tt_cmap10_char_next): Avoid integer overflow in computation of + next character code. - [autofit] Introduce two more slots for standard characters. + (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. - This is useful for OpenType features like `c2sc' (caps to small - caps) that don't have lowercase letters by definition, or other - features that mainly operate on numerals. + (tt_cmap13_char_map_binary): Avoid integer overflow in computation + of next character code. + (tt_cmap13_char_next): Simplify. - * src/autofit/afscript.h: Add more standard characters. +2015-09-21 suzuki toshiya - * src/autofit/aftypes.h: Update use of `SCRIPT' macro. - (AF_ScriptClassRec): Add members to hold two more standard - characters. - (AF_DEFINE_SCRIPT_CLASS): Updated. + [base] Check too long POST and sfnt resource (#45919). - * src/autofit/afglobal.c, src/autofit/afglobal.h, - * src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/hbshim.c: - Update use of `SCRIPT' macro. + * 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/autofit/afcjk.c (af_cjk_metrics_init_widths), - src/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more - standard characters. + * src/base/ftobjs.c (Mac_Read_POST_Resource): No need to use `0x' + prefix for `%p' formatter. -2014-01-24 Werner Lemberg + * 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. - Fix Savannah bug #41320. + * src/base/ftmac.c (read_lwfn, FT_New_Face_From_SFNT): Check the + total resource size before buffer allocation. - * src/autofit/aflatin.c (af_latin_metrics_init_blues) - : Avoid negative index of `last'. +2015-09-19 Werner Lemberg -2014-01-23 Werner Lemberg + [sfnt] Improve handling of invalid SFNT table entries (#45987). - Fix Savannah bug #41310. + This patch fixes weaknesses in function `tt_face_load_font_dir'. - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) : - Don't check metrics, which this format doesn't have. - This is another correction to the commit from 2013-11-21. + - 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. -2014-01-23 Werner Lemberg + - Duplicate table entries (this is, having the same tag) were not + rejected. - Fix Savannah bug #41309. + - The number of valid tables was sometimes too large, leading to + access of invalid tables. - * src/type1/t1load.c (t1_parse_font_matrix): Properly handle result - of `T1_ToFixedArray'. + * 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. - * src/cid/cidload.c (cid_parse_font_matrix): Synchronize with - `t1_parse_font_matrix'. +2015-09-19 Werner Lemberg - * src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with - `t1_parse_font_matrix'. - (t42_parse_encoding): Synchronize with `t1_parse_encoding'. + [pcf] Improve `FT_ABS' fix from 2015-09-17 (#45999). - * src/psaux/psobjs.c (ps_parser_load_field) , - : Properly handle result of `ps_tofixedarray'. + * 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'. -2014-01-22 Werner Lemberg +2015-09-17 Werner Lemberg - * src/autofit/hbshim.c (af_get_coverage): Fix memory leaks. + [type42] Fix memory leak (#45989). -2014-01-16 Werner Lemberg + * src/type42/t42parse.c (t42_parse_charstrings): Allow only a single + `CharStrings' array. - [autofit] Improve tracing of style coverages. +2015-09-17 Werner Lemberg - * include/internal/fttrace.h: Add `afglobal' for tracing style - coverages. + [psaux] Fix memory leak (#45986). - * src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H. - (FT_COMPONENT): Define. - (af_face_globals_compute_style_coverage): Trace `gstyles' array - data. + * src/psaux/psobjs.c (ps_parser_load_field) : + Free `temp' in case of error. -2014-01-09 Werner Lemberg +2015-09-17 Werner Lemberg - Fix Savannah bug #41158. + [psaux] Improve tracing message. - * builds/unix/install.mk (install): Create man page directory. + * src/psaux/psobjs.c (ps_parser_load_field) : + Handle plural correctly. -2014-01-08 Chongyu Zhu +2015-09-17 Werner Lemberg - [arm] Fix Savannah bug #41138, part 2. + [pcf] Fix integer overflows (#45985). - * builds/unix/ftconfig.in (FT_MulFix_arm), include/config/ftconfig.h - (FT_MulFix_arm), src/truetype/ttinterp.c (TT_MulFix14_arm): Fix - preprocessor conditionals for `add.w'. + * src/pcf/pcfread.c (pcf_load_font): Use FT_MulDiv. -2014-01-08 Werner Lemberg +2015-09-17 Werner Lemberg - [autofit] Fix Savannah bug #41138, part 1. + [pcf] Use FT_ABS for some property values (#45893). - * src/tools/afblue.pl : Produce correct auxiliary - enumeration names for generated `#else'. + * 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. - * src/autofit/afblue.h: Regenerated. +2015-09-16 Werner Lemberg -2014-01-06 Werner Lemberg + Minor fixes for some clang warnings. - Add manual page for `freetype-config'. - Contributed by Nis Martensen . + * src/base/ftoutln.c (FT_Outline_EmboldenXY): Cast, possible missing + initialization. - * docs/freetype-config.1: New file. + * src/truetype/ttgload.c (TT_Process_Composite_Component): Cast. - * builds/unix/unix-def.in (mandir): Define. - * builds/unix/install.mk (install, uninstall): Handle manpage. +2015-09-15 Werner Lemberg -2014-01-05 Werner Lemberg + [type1, type42] Fix memory leaks (#45966). - [autofit] Minor fixes for `afblue.pl'. + * 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/tools/afblue.pl (aux_name): Don't use `reverse'. - : Use proper indentation for generated `#else'. + * src/type42/t42parse.c (t42_parse_encoding): Handle multiple + encoding vectors. - * src/autofit/afblue.h: Regenerated. +2015-09-15 Werner Lemberg -2014-01-04 Werner Lemberg + [truetype] Fix integer type (#45965). - [autofit] Fix Indic scripts. + * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it. - Split the single, incorrect Indic entry into separate scripts so - that the covered ranges are the same: Bengali, Devanagari, Gujarati, - Gurmukhi, Kannada, Limbu, Malayalam, Oriya, Sinhala, Sundanese, - Syloti Nagri, Tamil, Telugu, and Tibetan. At the same time, remove - entries for Meetai Mayak and Sharada – the Unicode ranges were - incorrect (and nobody has complained about that), fonts are scarce - for those scripts, and the Indic auto-hinter support is rudimentary - anyways. +2015-09-15 Werner Lemberg - * src/autofit/afscript.h: Updated, using AF_CONFIG_OPTION_INDIC and - AF_CONFIG_OPTION_CJK. + * src/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964). - * src/autofit/afstyles.h (STYLE_DEFAULT_INDIC): New auxiliary macro. - Use it, together with AF_CONFIG_OPTION_INDIC and - AF_CONFIG_OPTION_CJK, to update. +2015-09-15 Werner Lemberg - * src/autofit/afranges.c [AF_CONFIG_OPTION_INDIC]: Updated. - [!AF_CONFIG_OPTION_INDIC, !AF_CONFIG_OPTION_CJK]: Removed. - Sort entries by tags. + [type1, type42] Check encoding array size (#45961). -2014-01-03 Werner Lemberg + * src/type1/t1load.c (parse_encoding), src/type42/t42parse.c + (t42_parse_encoding): Do it. - [autofit] Thinko. +2015-09-14 Alexei Podtelezhnikov - * src/autofit/hbshim.c (af_get_char_index): Similar to - `af_get_coverage', reject glyphs which are not substituted. + * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Improve. -2014-01-03 Werner Lemberg +2015-09-14 Werner Lemberg - [autofit] Fix handling of default coverages. + [type1] Fix another potential buffer overflow (#45955). - With this commit, the implementation of coverage handling is - completed. + * src/type1/t1parse (T1_Get_Private_Dict): Assure that check for + `eexec' doesn't exceed `limit'. - * src/autofit/hbshim.c (af_get_coverage): Exit early if nothing to - do. - Reject coverages which don't contain appropriate glyphs for blue - zones. +2015-09-13 Werner Lemberg -2014-01-03 Werner Lemberg + Replace `mkinstalldirs' with AC_PROG_MKDIR_P. - [autofit] Fix handling of default coverages. + * builds/unix/mkinstalldirs: Removed, no longer needed. - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): - First handle non-default coverages, then the default coverage of the - default script, and finally the other default coverages. + * builds/unix/configure.raw: Call `AC_PROG_MKDIR_P'. + Update pwd call for `$INSTALL'. -2014-01-03 Werner Lemberg + * builds/unix/unix-def.in (MKINSTALLDIRS): Use `@MKDIR_P@'. - [autofit] Fix scaling of HarfBuzz shaping. + * autogen.sh: Updated. - * src/autofit/hbshim.c (af_get_char_index): Scale to units per EM. +2015-09-13 Werner Lemberg -2014-01-03 Werner Lemberg + [winfonts] Check alignment shift count for resource data (#45938). - [autofit] Better ftgrid support. + * src/winfonts/winfnt.c (fnt_face_get_dll_font): Implement it. - * src/autofit/afhints.c (af_glyph_hints_get_segment_offset): Add - parameters `is_blue' and `blue_offset'. +2015-09-13 Werner Lemberg -2014-01-01 Werner Lemberg + [type1] Fix potential buffer overflow (#45923). - [autofit] Remove some styles. + * src/type1/t1parse.c (T1_Get_Private_Dict): Assure `cur' doesn't + point to end of file buffer. - * src/autofit/afcover.h: Remove coverages for alternative fractions, - denominators, numerators, and fractions. +2015-09-13 Werner Lemberg - * src/autofit/afstyles.h (META_STYLE_LATIN): Updated. + [gzip] Fix access of small compressed files (#45937). -2014-01-01 Werner Lemberg + * src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak. - [autofit] Add more styles. + (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. - * src/autofit/afstyles.h (STYLE_LATIN, META_STYLE_LATIN): New - auxiliary macros; use them to define styles for Cyrillic, Greek, and - Latin. +2015-09-11 Werner Lemberg - * src/autofit/afcover.h: Remove coverage for oldstyle figures. - Since those digits are used in combination with ordinary letters, it - makes no sense to handle them separately. + [psaux] Fix potential buffer overflow (#45922). - * src/autofit/afglobal.c (af_face_globals_get_metrics): Don't limit - `options' parameter to 4 bits. + * 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. -2014-01-01 Werner Lemberg +2015-09-11 Werner Lemberg - [autofit] Fix style assignments to glyphs. + [base] Avoid crash while tracing `load_mac_face'. - * src/autofit/hbshim.c (af_get_coverage) - [FT_CONFIG_OPTION_USE_HARFBUZZ]: Scan GPOS coverage of features also - so that we can skip glyphs that have both GSUB and GPOS data. + Reported in Savannah bug #45919. -2014-01-01 Werner Lemberg + * src/base/ftobjs.c (load_mac_face): Honour FT_OPEN_MEMORY while + tracing. - * src/autofit/hbshim.c: s/{lookups,glyphs}/gsub_{lookups,glyphs}/. +2015-09-11 Werner Lemberg -2014-01-01 Werner Lemberg + [type42] Fix endless loop (#45920). - [autofit] Implement and use `af_get_char_index' with HarfBuzz. + * src/type42/t42parse.c (t42_parse_encoding): Synchronize with + type1's `parse_encoding'. - * src/autofit/hbshim.c (COVERAGE) [FT_CONFIG_OPTION_USE_HARFBUZZ]: - Redefine to construct HarfBuzz features. - (af_get_char_index) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Rewritten. +2015-09-10 Werner Lemberg - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Use - `y_offset' to adjust `best_y'. + [docmaker] Allow `-' in bold and italic markup. -2013-12-31 Werner Lemberg + * src/tools/docmaker/sources.py (re_italic, re_bold): Adjust + accordingly. - [autofit] s/AF_STYLE_...._DEFAULT/AF_STYLE_...._DFLT/i. +2015-09-09 Alexei Podtelezhnikov -2013-12-31 Werner Lemberg + * src/base/ftcalc.c (FT_RoundFix): Improve. - [autofit] Fix interface of `af_get_char_index'. +2015-09-09 Wojciech Mamrak - * src/autofit/hbshim.c (af_get_char_index): Return error value. - Add argument for y offset (to be used in a yet-to-come patch). + * src/base/ftcalc.c (FT_CeilFix, FT_FloorFix): Normalize. - * src/autofit/hbshim.h, src/autofit/afcjk.c, - src/autofit/aflatin.c: Updated. + This commit makes the functions behave as expected, this is, + rounding towards plus or minus infinity. -2013-12-30 Werner Lemberg +2015-09-07 Alexei Podtelezhnikov - [autofit] Don't combine multiple features into one set. + * src/smooth/ftgrays.c (gray_render_line): Simplify clipping. - Combining them, as originally envisioned, would lead to much more - complicated code, as investigations have shown meanwhile. The major - drawback is that we run out of available style slots much earlier. - However, this is only a theoretical issue since we don't support a - large number of scripts currently. +2015-09-04 Alexei Podtelezhnikov - * src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with - a single-element `COVERAGE' macro, sort the elements by the feature - tags, and add entry for `ruby'. + [raster,smooth] Microoptimizations. - * src/autofit/aftypes.h: Updated. - * src/autofit/hbshim.c: Updated. + * src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table, + Beziier_Up, ): Use do-while loops. -2013-12-28 Werner Lemberg + * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line, + gray_convert_glyph): Ditto. - [autofit] Code shuffling to reduce use of cpp macros. +2015-09-04 Werner Lemberg - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): - Call `af_get_coverage' unconditionally. + [autofit] Redesign code ranges (2/2). - * src/autofit/autofit.c: Include `hbshim.c' unconditionally. + This commit adds two fallback scripts (`latb', `latp') and + implements support for the no-base character ranges introduced in + the previous commit. - * src/autofit/hbshim.c (af_get_coverage) - [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function. + * src/autofit/aftypes.h (AF_ScriptClassRec): Add + `script_uni_nobase_ranges' field. + (AF_DEFINE_SCRIPT_CLASS): Updated. - * src/autofit/hbshim.h: Provide function declarations - unconditionally. + * src/autofit/afscript.h, src/autofit/afstyles.h: Add `latb' and + `latp' fallback scripts. -2013-12-28 Werner Lemberg + * src/autofit/afblue.dat: Add blue zones for Latin subscript and + superscript fallback scripts. - [autofit] Add wrapper function for `FT_Get_Char_Index'. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - Yet-to-come changes will provide HarfBuzz functionality for the new - function. + * src/autofit/afglobal.h (AF_NOBASE): New style flag for no-base + characters. + (AF_STYLE_MASK): Updated. - * src/autofit/hbshim.c (af_get_char_index): New function. - * src/autofit/hbshim.h: Updated. + * src/autofit/afglobal.c (SCRIPT): Updated. + (af_face_globals_compute_style_coverage): Handle new style flag. - * 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_hints_apply): Handle new style + flag. - * src/autofit/aflatin.c (af_latin_metrics_init_widths, - af_latin_metrics_init_blues, af_latin_metrics_check_digits): - Updated. + * src/autofit/afranges.h (SCRIPT): Use it to export no-base ranges. -2013-12-28 Werner Lemberg +2015-09-04 Werner Lemberg - [autofit] Use `global' HarfBuzz font object. + [autofit] Redesign code ranges (1/2). - We now use `hb_font' instead of `hb_face' since yet-to-come changes - need this. + 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). - * src/autofit/afglobal.h: Include `hbshim.h'. - (AF_FaceGlobalsRec) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New member - `hb_font'. + 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. - * src/autofit/afglobal.c (af_face_globals_new) - [FT_CONFIG_OPTION_USE_HARFBUZZ]: Create `hb_font'. - (af_face_globals_free) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Destroy - `hb_font'. + 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/hbshim.h: Include HarfBuzz headers. + * src/autofit/afranges.c (af_latn_uniranges): Updated to Unicode + 8.0. + Split off superscript-like and subscript-like glyphs into... - * src/autofit/hbshim.c: Include `hbshim.h' instead of HarfBuzz - headers. - (af_get_coverage): Updated. + (af_latb_uniranges, af_latp_uniranges): ... these two new arrays. -2013-12-27 Werner Lemberg + (af_xxxx_nobase_uniranges): New arrays that hold no-base characters + of the corresponding character ranges. - [autofit] Handle `DFLT' OpenType script for coverages. +2015-09-03 Werner Lemberg - * include/ftautoh.h: Document new `default-script' property. + [autofit] Pass glyph index to hinting function. - * src/autofit/hbshim.c (af_get_coverage): Use `AF_FaceGlobals' for - type of first parameter. - (script_tags): Add one more element. - (af_get_coverage): Adjust `script_tags' to handle `DFLT' script tag. + No functionality change yet. - * src/autofit/hbshim.h: Updated. + * src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Pass + glyph index. - * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): + * 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. - * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT): New macro. - - * src/autofit/afmodule.h (AF_ModuleRec): New `default_script' - member. +2015-08-30 Werner Lemberg - * src/autofit/afmodule.c (af_property_set, af_property_get): Handle - `default-script' property. - (af_autofitter_init): Updated. + [autofit] Code clean-up. -2013-12-27 suzuki toshiya + * src/autofit/afglobal.h (AF_STYLE_MASK): New macro. + (AF_STYLE_UNASSIGNED): Use AF_STYLE_MASK for definition. - [ftrfork] Fix the face order difference between POSIX and Carbon. + * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): + Updated. - The fragmented resources in Suitcase and .dfont should be reordered - when `POST' resource for Type1 is being restored, but reordering of - sfnt resources induces the different face order. Now the ordering - is restricted to `POST' resource only, to prevent the different - order issue (e.g. the face index in the fontconfig cache generated - with Carbon framework is incompatible with that by FreeType 2 - without Carbon framework.) Found by Khaled Hosny and Hin-Tak Leung. +2015-08-30 Werner Lemberg - http://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.html - http://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html + [autofit] Make glyph style array use 16bit values. - * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch - `sort_by_res_id' to control the fragmented resource ordering. - * include/internal/ftrfork.h: Declare new switch. - * src/base/ftobjs.c (IsMacResource): Enable the sorting for `POST' - resource, and disable the sorting for `sfnt' resource. + * include/freetype/ftautoh.h (FT_Prop_GlyphToScriptMap): Use + `FT_UShort' for `map' field. -2013-12-25 Werner Lemberg + * 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. - Fix Savannah bug #40997. + * src/autofit/afglobal.h (AF_STYLE_UNASSIGNED, AF_DIGIT): Extend to + 16 bits. + (AF_FaceGlobalsRec): Use `FT_UShort' for `glyph_styles' field. - * src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to - adjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already - be set. - * src/cff/cffobjs.c (cff_face_init): Ditto. - * src/cid/cidobjs.c (cid_face_init): Ditto. - * src/pcf/pcfread.c (pcf_load_font): Ditto. - * src/pfr/pfrobjs.c (pfr_face_init): Ditto. - * src/type1/t1objs.c (T1_Face_Init): Ditto. - * src/type42/t42objs.c (T42_Face_Init): Ditto. - * src/winfonts/winfnt.c (FNT_Face_Init): Ditto. +2015-08-26 Werner Lemberg -2013-12-21 Werner Lemberg + * builds/unix/configure.raw: Need harfbuzz >= 0.9.21 (#45828). - [autofit] Introduce `coverages'. +2015-08-25 Werner Lemberg - Coverages are the interface to the HarfBuzz library to acces - OpenType features for handling glyphs not addressable by the cmap. + [base] Improve kerning tracing and documentation. - Right now, compilation of HarfBuzz is only added to the development - build. A solution for standard build mode will be delayed until - HarfBuzz gets split into two libraries to avoid mutual dependencies - between FreeType and HarfBuzz. + * src/base/ftobjs.c (FT_Get_Kerning): Emit tracing message if + scaled-down kerning values differ. - Note that this is only a first step in handling coverages, basically - providing the framework only. Code for handling selected OpenType - features (this is, actually using the data in `afcover.h') will - follow. +2015-08-18 Werner Lemberg - * devel/ftoption.h, include/config/ftoption.h - (FT_CONFIG_OPTION_USE_HARFBUZZ): New macro. + [raster] Remove last remnants of `raster5' driver. - * src/autofit/hbshim.c, src/autofit/hbshim.h, src/autofit/afcover.h: - New files. + * src/raster/ftrend1.h (ft_raster5_renderer_class): Removed. - * src/autofit/afscript.h: Add HarfBuzz script name tags. + * src/raster/rastpic.c, src/raster/rastpic.h + (ft_raster5_renderer_class_pic_init, + ft_raster5_renderer_class_pic_free): Removed. - * src/autofit/afstyles.h: Add default coverage enumeration values. +2015-08-17 Alexei Podtelezhnikov - * src/autofit/aftypes.h: Update use of `SCRIPT' and `STYLE' macros. - (AF_Coverage): New enumeration (generated by `afcover.h'). - (AF_StyleClassRec): New member `coverage'. - (AF_DEFINE_STYLE_CLASS): Updated. + [base] Improve emboldener (#45596). - * include/internal/fttrace.h: Add `afharfbuzz' for tracing coverage - data. + * src/base/ftoutln.c (FT_Outline_EmboldenXY): Correct displacement + of zero-lenght segments. - * src/autofit/afglobal.h: Update use of `SCRIPT' and `STYLE' macros. - (AF_SCRIPT_FALLBACK): Renamed to ... - (AF_STYLE_FALLBACK): ... this. +2015-08-16 Alexei Podtelezhnikov - * src/autofit/afglobal.c: Include `hbshim.c'. - Update use of `SCRIPT' and `STYLE' macros. - (af_face_globals_compute_style_coverage) - [FT_CONFIG_OPTION_USE_HARFBUZZ]: Call `af_get_coverage'. - Update. + [base] Reoptimize arithmetic. - * src/autofit/afmodule.h (AF_ModuleRec): - s/fallback_script/fallback_style/. + * src/base/ftcalc.c (FT_MulDiv, FT_MulFix) [!FT_LONG64]: Remove + special cases that slow down the general use. - * src/autofit/afmodule.c (af_property_set): Adapt handling of - `fallback-script' property to set a fallback style. - (af_property_get, af_autofitter_init): Updated. +2015-08-15 pazer - * src/autofit/afpic.c: Update use of `SCRIPT' and `STYLE' macros. + Fix C++ compilation (#45762). - * src/autofit/afranges.h: Update use of `SCRIPT' macro. + * src/base/ftstroke.c (ft_outline_glyph_class): Use + FT_CALLBACK_TABLE. - * src/autofit/autofit.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include - `hbshim.c'. +2015-08-14 Alexei Podtelezhnikov - * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `hbshim.c'. - (AUTOF_DRV_H): Add `afcover.h'. + [truetype] Clean up. - * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Use pkg-config for - all libraries needed by FreeType. + * src/truetype/ttgload.c (TT_Process_Composite_Component): Use + `FT_Outline_Transform' and `FT_Outline_Translate'. + (translate_array): Dropped. -2013-12-21 Werner Lemberg +2015-08-14 Andreas Enge - Fix Savannah bug #40975 (sort of). + * builds/unix/detect.mk (CONFIG_SHELL): Don't handle it (#44261). - * src/truetype/ttinterp.c (Ins_IP): Fix sign typo to make FreeType - behave the same as the Windows TrueType engine for the invalid case. +2015-08-13 Werner Lemberg -2013-12-21 Werner Lemberg + [truetype] Introduce named instance access to GX fonts. - [autofit] Make PIC mode work actually. + 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. - * src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the - enumeration values automatically generated by including `afscript.h' - and friends. + * include/freetype/freetype.h (FT_FaceRec): Update documentation. + * include/freetype/internal/sfnt.h: Ditto. - * src/autofit/afpic.c (autofit_module_class_pic_init): Updated. + * 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. -2013-12-21 Werner Lemberg + * src/truetype/ttobjs.c (tt_face_init) + [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Use named instance, overwriting + the style name. - Fix PIC linking. + * 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. - * include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix - generated function name. + * src/cff/cffobjs.c (cff_face_init): Make function exit early for + pure CFF fonts if `font_index < 0'. + Updated. - * src/base/basepic.c (FT_Init_Table_raccess_guess_table): Rename - to ... - (FT_Init_Table_ft_raccess_guess_table): ... this so that the - function name correctly corresponds to what the macro framework - expects. + * 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. - * src/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so - that PIC functions are compiled also. + * docs/CHANGES: Updated. -2013-12-21 Werner Lemberg +2015-08-12 Alexei Podtelezhnikov - [base] Add missing dependencies to Makefile. + [type1,cff,cid] Streamline font matrix application. - * src/base/rules.mk (BASE_SRC): Add `basepic.c' and `ftpic.c'. - (BASE_H): Add `basepic.h'. + * 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. + * sff/cid/cidgload.c (cid_slot_load_glyph): Ditto for advances and the + entire outline. -2013-12-20 Werner Lemberg +2015-08-11 Werner Lemberg - [autofit] Fix PIC compilation. + [builds/unix] Minor. - * src/autofit/afcjk.c (af_cjk_metrics_init_widths), - src/autofit/aflatin.c (af_latin_metrics_init_widths) - [FT_CONFIG_OPTION_PIC]: Declare `globals'. + * builds/unix/configure.raw: + s/lib{priv,staticconf}/libs{priv,staticconf}/ for orthogonality with + similarly named uppercase variables. - * src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and - AF_DEFINE_STYLE_CLASS. +2015-08-10 Alexei Podtelezhnikov - * src/autofit/afpic.c: Include `afglobal.h'. - (autofit_module_class_pic_init): Typo. + [type1,cid,type42] Minor improvements. - * src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS, - AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro - parameter and structure member. + * 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. -2013-12-20 Werner Lemberg +2015-08-08 Werner Lemberg - [autofit] Introduce `styles'. + [type42] Fix glyph access. - This is the new top-level structure for handling glyph input data; - scripts are now defined separately. + 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. - * src/autofit/aftypes.h (SCRIPT): Updated. - (AF_ScriptClassRec): Move `blue_stringset' and `writing_system' - members to ... - (AF_Style_ClassRec): ... this new structure. - (AF_Style): New enumeration. - (AF_StyleMetricsRec): Replace `script' enumeration with - `style_class' pointer. - (AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated. - (AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros. + Apparently, noone ever noticed it; this shows how much Type 42 fonts + are in use... - * src/autofit/afstyles.h: New file, using data from `afscript.h'. - * src/autofit/afscript.h: Updated. + * src/type42/t42objs.c (T42_GlyphSlot_Load): Map Type 42 glyph index + to embedded TTF's glyph index. - * src/autofit/afcjk.c (af_cjk_metrics_init_widths, - af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated. +2015-08-08 Werner Lemberg - * src/autofit/afglobal.c (SCRIPT): Updated. - (STYLE): Redefine macro to load `afstyles.h'. - (af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with... - (af_style_names): ... this array. - (af_face_globals_compute_script_coverage): Renamed to... - (af_face_globals_compute_style_coverage): ... this. - Updated. - (af_face_globals_new, af_face_globals_free, - af_face_globals_get_metrics): Updated. + [type42] Minor clean-up. - * src/autofit/afglobal.h (SCRIPT): Updated. - (STYLE): Redefine macro to load `afstyles.h'. - (AF_SCRIPT_FALLBACK): Update definition. This will get more - refinements with later on. - (AF_SCRIPT_UNASSIGNED): Replace with... - (AF_STYLE_UNASSIGNED): ... this macro. - (AF_FaceGlobalsRec): Updated. + * src/type42/t42parse.c (t42_parse_font_matrix): Remove unused + variable. - * src/autofit/aflatin.c (af_latin_metrics_init_widths, - af_latin_metrics_init_blues, af_latin_metrics_scale_dim, - af_latin_hint_edges): Updated. +2015-08-06 Alexei Podtelezhnikov - * src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated. - (af_ltn2_uniranges): Removed. + [type42] Parse FontMatrix according to specifications. - * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): - Updated. + * 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. - * src/autofit/afpic.c (autofit_module_class_pic_init): Updated. - * src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro. - (AFModulePIC): Add `af_style_classes' and `af_style_classes_rec' - members. +2015-08-06 Werner Lemberg - * src/autofit/afranges.h: Updated. + [autofit] Improve Arabic hinting. - * src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'. + Problem reported by Titus Nemeth (by using + ttfautohint). -2013-12-19 Werner Lemberg + * src/autofit/afblue.dat: Add neutral blue zone for the tatweel + character. - [autofit] Factor scripts and uniranges out of writing system files. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - * src/autofit/afranges.c, src/autofit/afranges.h: New files. +2015-08-05 Alexei Podtelezhnikov - * src/autofit/afscript.h: Extend `SCRIPT' macro with more - parameters, taking data from the writing system files. + [truetype] Clean up types. - * src/autofit/aftypes.h: Updated. + * 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. - * src/autofit/afglobal.c: Include `afranges.h'. - Load `afscript.h' to call AF_DEFINE_SCRIPT_CLASS. - * src/autofit/afglobal.c: Include `afranges.h'. - Load `afscript.h' to call AF_DECLARE_SCRIPT_CLASS. +2015-08-05 Werner Lemberg - * src/autofit/afcjk.c, src/autofit/afcjk.h: Updated. - * src/autofit/afdummy.c, src/autofit/afdummy.h: Updated. - * src/autofit/afindic.c, src/autofit/afindic.h: Updated. - * src/autofit/aflatin.c, src/autofit/aflatin.h: Updated. - * src/autofit/aflatn2.c, src/autofit/aflatn2.h: Updated. + [autofit] Improve recognition of flat vs. rounded segments. - * src/autofit/afpic.c: Updated. + Lower the flatness threshold from upem/8 to upem/14, making the + auto-hinter accept shorter elements. - * src/autofir/autofit.c: Include `afranges.c'. - * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'. + Synchronize flat/round stem selection algorithm with blue zone code. -2013-12-18 Werner Lemberg + * 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'. - [autofit] More code orthogonality. +2015-08-04 Werner Lemberg - * src/autofit/aftypes.h (AF_StyleMetrics): Replace `script_class' - pointer to an `AF_ScriptClass' structure with `script' index of type - `AF_Script'. - Move some code around. + Another left-shift bug (#45681). - * src/autofit/afcjk.c: Include `afpic.h'. - (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, - af_cjk_hint_edges): Updated. + * src/base/ftobjs.c (IsMacBinary): Only accept positive values for + `dlen'. - * src/autofit/aflatin.c: Include `afpic.h'. - (af_latin_metrics_init_widths, af_latin_metrics_init_blues, - af_latin_metrics_scale_dim, af_latin_hint_edges): Updated. +2015-08-03 Alexei Podtelezhnikov - * src/autofit/afglobal.c (af_face_globals_get_metrics): Updated. + [base] Fix `ft_corner_orientation'. - * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): - Updated. + Remove casting from `FT_Long' to `FT_Int' that might change the sign + of the return value and make it faster too. -2013-12-18 Werner Lemberg + * 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. - [autofit] s/ScriptMetrics/StyleMetrics/. +2015-08-03 Werner Lemberg -2013-12-18 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. - [autofit] s/script_{metrics,hints}/style_{metrics,hints}/ +2015-08-03 Werner Lemberg -2013-12-18 Werner Lemberg + Fix typo in clang bug from 2015-07-31 (#45678). - [autofit] s/gscripts/gstyles/. + * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Fix inequality. -2013-12-18 Werner Lemberg +2015-08-02 Werner Lemberg - [autofit] s/glyph_scripts/glyph_styles/. + * CMakeLists.txt: Improve shared library support. - This is the first commit of a series to create a new top-level - structure (a `style') for handling scripts, writing_systems, and - soon-to-be-added coverages. + Based on a patch from John Cary . -2013-12-17 Werner Lemberg +2015-08-02 Werner Lemberg - [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate. + * builds/unix/freetype-config.in (enable_shared): Remove. Unused. -2013-12-11 Infinality +2015-08-02 Werner Lemberg - [truetype] Simplify logic of rendering modes. + Fix more invalid left-shifts. - This patch unifies the subpixel and non-subpixel cases. + * src/pfr/pfrgload.c (pfr_glyph_load_compound): Use multiplication, + not left-shift. - * src/truetype/ttinterp.h (TT_ExecContextRec): Remove - `grayscale_hinting'; all code should refer to `grayscale' instead. - Remove unused `native_hinting' member. - Rename `subpixel_hinting' member to `subpixel. + * 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. - * src/truetype/ttgload.c (TT_LOADER_SET_PP): Updated. - (tt_loader_init): Updated. +2015-07-31 Werner Lemberg - * src/truetype/ttinterp.c (Ins_GETINFO): Simplify. - Updated. + Fix some bugs found by clang's `-fsanitize=undefined' (#45661). -2013-12-11 Werner Lemberg + * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Only accept + positive values from header. + Check overflow. - [documentation] Add section how to include FreeType header files. - Problem reported by David Kastrup . + * src/base/ftoutln.c (SCALED): Correctly handle left-shift of + negative values. - Surprisingly, a description how to do that was completely missing in - the API reference. + * src/bdf/bdf.h (_bdf_glyph_modified, _bdf_set_glyph_modified, + _bdf_clear_glyph_modified): Use unsigned long constant. - * include/freetype.h, include/ftchapters.h: New documentation - section `header_inclusion'. + * src/bdf/bdfdrivr.c (BDF_Size_Select, BDF_Glyph_Load): Don't + left-shift values that can be negative. -2013-12-10 Werner Lemberg + * src/pcf/pcfdrivr.c (PCF_Size_Select, PCF_Glyph_Load): Don't + left-shift values that can be negative. - [autofit] s/DFLT/NONE/, s/dflt/none/. + * src/raster/ftraster.c (SCALED): Correctly handle left-shift of + negative values. -2013-12-10 Werner Lemberg + * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Don't left-shift + values that can be negative. - [autofit] s/AF_SCRIPT_NONE/AF_SCRIPT_UNASSIGNED/. + * src/truetype/ttgload.c (TT_Load_Composite_Glyph, + compute_glyph_metrics, load_sbit_image): Don't left-shift values + that can be negative. -2013-12-10 Werner Lemberg +2015-07-31 Werner Lemberg - [truetype] Fix scaling of vertical phantom points. + Define FT_LONG_MAX. - * src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and - pp4.x also. + * include/freetype/config/ftstdlib.h (FT_LONG_MAX): New macro. + * src/cff/cf2arrst.c (cf2_arrstack_setNumElements): Use it. -2013-12-10 Werner Lemberg +2015-07-28 Alexei Podtelezhnikov - [truetype] Fix positioning of composite glyphs. - Problem reported by Nigel Tao . + * src/base/ftcalc.c (FT_Vector_NormLen): Clarify. - * src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts - the glyph (component) by a fractional value computed from the LSB - phantom point. This is wrong, since the horizontal phantom points - get rounded horizontally later on. +2015-07-27 Alexei Podtelezhnikov -2013-12-08 Werner Lemberg + * src/base/ftcalc.c (FT_Vector_NormLen): Explicate type conversions. - * Version 2.5.2 released. - ========================= +2015-07-26 Matthias Clasen + [cff] Don't use `hmtx' table for LSB (#45520). - Tag sources with `VER-2-5-2'. + * src/cff/cffgload.c (cff_slot_load): Use `htmx' table for advance + width only. Bug introduced 2015-04-10. - * docs/VERSION.DLL: Update documentation and bump version number to - 2.5.2. +2015-07-09 Werner Lemberg - * 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.5.1/2.5.2/, s/251/252/. + Better support of user-supplied C++ namespaces. - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. + See - * builds/unix/configure.raw (version_info): Set to 17:1:11. - * CMakeLists.txt (VERSION_PATCH): Set to 2. - * docs/CHANGES: Updated. + http://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html -2013-12-07 Werner Lemberg + for a rationale. - [truetype] Next round in phantom point handling. + * 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. - Greg Hitchcock provided very interesting insights into the - complicated history of the horizontal positions of the TSB and BSB - phantom points. + * src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include + FT_CONFIG_STANDARD_LIBRARY_H earlier. - * src/truetype/ttgload.c (TT_LOADER_SET_PP) - [TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Use `subpixel_hinting' and - `grayscale_hinting' flags as conditionals for the x position of TSB - and BSB. + * src/truetype/ttpic.h: Include FT_INTERNL_PIC_H. -2013-12-05 Werner Lemberg +2015-07-07 Werner Lemberg - * builds/freetype.mk (FT_CC): Removed. Unused. + [sfnt] Make `tt_face_get_name' member of the SFNT interface. -2013-12-04 Werner Lemberg + * include/freetype/internal/sfnt.h (TT_Get_Name_Func): New + prototype. + (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): New member `get_name'. - [sfnt] Fix handling of embedded bitmap strikes. + * src/sfnt/sfdriver.c (sfnt_interface): Updated. - This corrects the commit from 2013-11-21. Problem reported by - Andrey Panov . + * src/sfnt/sfobjs.c (tt_face_get_name): Tag it with `LOCAL_DEF'. + * src/sfnt/sfobjs.h: Add prototype for it. - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Fix logic to - detect excessive bytes for bit-aligned bitmaps. +2015-06-30 Werner Lemberg -2013-12-03 Werner Lemberg + Fix some clang compiler warnings. - [truetype] Remove dead code. + * 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. - Reported by Nigel Tao . +2015-06-29 Alexei Podtelezhnikov - * include/internal/tttypes.h (TT_LoaderRec): Remove unused - `preserve_pps' field. - * src/truetype/ttgload.c (TT_Hint_Glyph): Updated. + [truetype] Speed up bytecode interpreter. -2013-12-03 Werner Lemberg + * src/truetype/ttinterp.c (Normalize): Use `FT_Vector_NormLen'. - [truetype] Fix phantom point handling. +2015-06-29 Alexei Podtelezhnikov - This is a further improvement to the changes from 2013-11-06. + [base] Speed up emboldening. - * src/truetype/ttgload.c (TT_Hint_Glyph): Horizontal phantom points - are rounded horizontally, vertical ones are rounded vertically. - (TT_LOADER_SET_PP): The horizontal position of vertical phantom - points in pre-ClearType mode is zero, as shown in the OpenType - specification. + * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use + `FT_Vector_NormLen'. -2013-12-02 Werner Lemberg +2015-06-29 Alexei Podtelezhnikov - [truetype] Fix change from 2013-11-20. + [base] Implement fast vector normalization. - Problem reported by Akira Kakuto . + 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/truetype/ttgload.c (TT_Load_Simple_Glyph): Protect call to - `Update_Max' with both a TT_USE_BYTECODE_INTERPRETER guard and a - `IS_HINTED' clause. - Also remove redundant check using `maxSizeOfInstructions' – in - simple glyphs, the bytecode data comes before the outline data, and - a validity test for this is already present. + * src/base/ftcalc.c (FT_Vector_NormLen): New function. -2013-11-27 Werner Lemberg +2015-06-28 Werner Lemberg - [autofit] Fix use of dumping functions in `ftgrid' demo program. + * CMakeLists.txt: Always create `ftconfig.h'. - * src/autofit/afhints.c (AF_DUMP) [FT_DEBUG_AUTOFIT]: New macro. - (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, - af_glyph_hints_dump_edges) [FT_DEBUG_AUTOFIT]: Add parameter to - handle output to stdout. - Use AF_DUMP. - (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, - af_glyph_hints_dump_edges) [!FT_DEBUG_AUTOFIT]: Removed. + 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. -2013-11-25 Werner Lemberg +2015-06-28 Werner Lemberg - * Version 2.5.1 released. - ========================= + * CMakeLists.txt: Improve MSVC support (#43737). +2015-06-28 Werner Lemberg - Tag sources with `VER-2-5-1'. + [cmake] Check for libraries and create `ftoption.h'. - * docs/VERSION.DLL: Update documentation and bump version number to - 2.5.1. + * builds/FindHarfBuzz.cmake: New file, taken from - * 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.5.0/2.5.1/, s/250/251/. + https://trac.webkit.org/browser/trunk/Source/cmake/FindHarfBuzz.cmake - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. + * 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. - * builds/unix/configure.raw (version_info): Set to 17:0:11. - * CMakeLists.txt (VERSION_PATCH): Set to 1. - * docs/CHANGES, docs/release: Updated. +2015-06-28 Werner Lemberg -2013-11-23 Werner Lemberg + * CMakeLists.txt: Fix creation of `ftconfig.h'. + Check for UNIX header files using `check_include_file'. + Set up correct header include directories. - [truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'. +2015-06-28 Werner Lemberg - * src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS, - TRICK_NAMES_COUNT): Updated. - (trick_names): Add family name for the two fonts. + * CMakeLists.txt: Disallow in-source builds. -2013-11-23 Werner Lemberg +2015-06-27 Werner Lemberg - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Typo. + * src/tools/docmaker/utils.py (check_output): Add missing `\n'. -2013-11-21 Werner Lemberg +2015-06-26 Werner Lemberg - [sfnt] Typo. + * CMakeLists.txt: Select platform-dependent `ftdebug.c'. - Problem reported by Hin-Tak Leung . +2015-06-25 Werner Lemberg - * src/sfnt/sfobjs.c (sfnt_load_face): Return correct `bsize->width' - value if the font lacks an `OS/2' table. + * CMakeLists.txt: Use cmake functions for generating `ftconfig.h'. + Additionally, do this for UNIX only. -2013-11-21 Werner Lemberg +2015-06-25 Werner Lemberg - [sfnt] Improve handling of buggy embedded bitmap strikes. + * CMakeLists.txt (BASE_SRCS): Use `ftbase.c' and `psnames.c'. - We are now able to successfully load `AppleMyoungJo.ttf'. - Problem reported by Hin-Tak Leung . +2015-06-25 Werner Lemberg - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph - format. + Another adjustment to header locations. -2013-11-20 Werner Lemberg + This change is a result of a discussion thread on freetype-devel - [truetype] Don't trust `maxp's `maxSizeOfInstructions'. + http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html - Problem reported by Hin-Tak Leung ; see + Re-introduce the `freetype2' subdirectory for all FreeType header + files after installation, and rename the `freetype2' subdirectory in + the git repository to `freetype'. - http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html + * include/freetype2: Renamed to... + * include/freetype: This. - for details. + * CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS, + PRIVATE_HEADERS): Updated. + Update creation of `ftconfig.h'. + Install generated `ftconfig.h'. - * src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep' - tables also for setting `autohint'. + * Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated. - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from - `TT_Process_Composite_Glyph' for handling unreliable values of - `maxSizeOfInstructions'. + * builds/amiga/include/config/ftconfig.h, builds/freetype.mk + (PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work), + builds/unix/freetype2.in: Updated. -2013-11-16 Werner Lemberg + * 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. - [sfnt] Fix `OS/2' table version 5 support. + * builds/wince/*, builds/windows/*: Updated. - We now follow the `official' announcement from Microsoft (on the - OpenType mailing list, which unfortunately hasn't a public archive). + * devel/ft2build.h, include/ft2build.h: Updated. - * include/freetype/tttables.h (TT_OS2): - s/usLowerPointSize/usLowerOpticalPointSize/, - s/usUpperPointSize/usUpperOpticalPointSize/. + * include/freetype2/config/ftheader.h, + include/freetype2/internal/ftserv.h, + include/freetype2/internal/internal.h: Update all header file + macros. - * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct - default values. + * src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated. -2013-11-13 Werner Lemberg + * docs/*: Updated. - * builds/unix/ft2unix.h: Remove. No longer necessary. +2015-06-24 Alexei Podtelezhnikov - * builds/unix/install.mk (install): Updated. + * src/bdf/bdflib.c (_bdf_parse_start): Disallow 0 bpp. -2013-11-13 Werner Lemberg +2015-06-24 Alexei Podtelezhnikov - Simplify header file hierarchy. + * src/bdf/bdflib.c (_bdf_parse_start): Simplify bpp parsing. - This large patch changes the header file directory layout from - `include/freetype/...' to `include/...', effectively removing one - level. Since the file `ft2build.h' is also located in `include' - (and it stays there even after installation), all FreeType header - files are now in a single directory. +2015-06-23 Werner Lemberg - Applications that use (a) `freetype-config' or FreeType's - `pkg-config' file to get the include directory for the compiler, and - (b) the documented way for header inclusion like + s/TYPEOF/FT_TYPEOF/ (#45376). - #include - #include FT_FREETYPE_H - ... + * builds/unix/ftconfig.in, builds/vms/ftconfig.in, + include/freetype2/config/ftconfig.h, + include/freetype2/internal/ftobjs.h, src/autofit/afwarp.h: Do it. - don't need any change to the source code. +2015-06-22 Werner Lemberg - * include/freetype/*: Move up to... - * include/*: ... this directory. + Fix Savannah bug #45097. - * builds/amiga/include/freetype/*: Move up to... - * builds/amiga/include/*: ... this directory. + 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. - */*: Essentially do `s@/freetype/@/@' where appropriate. + No visible changes for the user who follows the standard FreeType + header inclusion rules. - * CMakeList.txt: Simplify. - * builds/unix/freetype-config.in, builds/unix/freetype2.in: For - `--cflags', return a single directory. - * builds/unix/install.mk (install): No longer try to remove `cache' - and `internal' subdirectories; instead, remove the `freetype' - subdirectory. + * include/*: Move to ... + * include/freetype2/*: This directory, except `ft2build.h'. -2013-11-12 Werner Lemberg + * CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS, + PRIVATE_HEADERS), Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated. - [truetype] Fix last `truetype' commit. + * 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. - * src/truetype/ttgload.c (tt_get_metrics): Preserve stream position. - Return error value. - (load_truetype_glyph): Updated. + * builds/unix/freetype-config.in: Updated. + Emit -I directory only if it is not `/usr/include'. -2013-11-10 Werner Lemberg + * builds/wince/*, builds/windows/*: Updated. - * docs/CMAKE: New dummy file. + * devel/ft2build.h, include/ft2build.h: Updated. -2013-11-08 Dave Arnold + * include/freetype2/config/ftheader.h, + include/freetype2/internal/ftserv.h, + include/freetype2/internal/internal.h: Update all header file + macros. - [cff] Fix for hints that touch. + * src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated. - * src/cff/cf2hints.c (cf2_hintmap_insertHint): Fix condition for - finding index value of insertion point. +2015-06-21 Werner Lemberg -2013-11-06 Werner Lemberg + Make Jam support work again. - [truetype] Fix handling of phantom points in composite glyphs. - Problem reported by Nigel Tao . + 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. - This is a follow-up commit to the previous one. + * Jamfile: Call `HDRMACRO' for `ftserv.h' also. + (DEFINES): Replace with... + (CCFLAGS): ... this. - * src/truetype/ttgload.c (load_truetype_glyph): Call - `tt_get_metrics' after loading the glyph header. + * src/Jamfile: Don't call `HDRMACRO' for `internal.h'; this is + already handled in the top-level Jamfile. -2013-11-06 Werner Lemberg + * src/autofit/Jamfile (DEFINES): Replace with... + (CCFLAGS): ... this. + (_sources): Add missing files. - [truetype] Improve emulation of vertical metrics. + * src/cache/Jamfile: Don't call `HDRMACRO' for `ftcache.h'; it no + longer contains macro header definitions. - This commit also improves the start values of vertical phantom - points. Kudos to Greg Hitchcock for help. + * src/base/Jamfile, src/cff/Jamfile, src/sfnt/Jamfile, + src/truetype/Jamfile (_sources): Add missing files. - * src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass - `yMax' value. Replace code with fixed Microsoft definition. - (tt_get_metrics): Updated. - (TT_LOADER_SET_PP): Add explanation how to initialize phantom - points, taken from both the OpenType specification and private - communication with Greg (which will eventually be added to the - standard). - Fix horizontal position of `pp3' and `pp4'. +2015-06-16 Werner Lemberg - * src/truetype/ttgload.h: Updated. + Fix Savannah bug #45326. - * src/truetype/ttdriver.c (tt_get_advances): Updated. + * src/sfnt/sfntpic.h (SFNT_SERVICES_GET): Remove duplicate + definitions. - * docs/CHANGES: Updated. +2015-06-07 Werner Lemberg -2013-11-05 Werner Lemberg + * Version 2.6 released. + ======================= - * builds/windows/vc2010/freetype.vcxproj: s/v110/v100/. - PlatformToolSet version 110 is for VC2012. - Problem reported (with solution) by Dave Arnold . + Tag sources with `VER-2-6'. -2013-11-05 Werner Lemberg + * docs/VERSION.DLL: Update documentation and bump version number to + 2.6. - [truetype] Correctly reset point tags for glyph components. - Problem reported by Nigel Tao . + * 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.5.5/2.6/, s/255/26/. - * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix loop. + * include/freetype/freetype.h (FREETYPE_MINOR): Set to 6. + (FREETYPE_PATCH): Set to 0. -2013-11-02 Werner Lemberg + * builds/unix/configure.raw (version_info): Set to 18:0:12. + * CMakeLists.txt (VERSION_MINOR): Set to 6. + (VERSION_PATCH): Set to 0. - [truetype] Fix GETINFO opcode handling of subpixel hinting bits. + * src/autofit/afmodule.c [!FT_MAKE_OPTION_SINGLE_OBJECT]: Add + declarations for dumping functions. - * src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to - get info on subpixel hinting. + * src/truetype/ttinterp.c (TT_New_Context): Pacify compiler. - * docs/CHANGES: Updated. + * 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. -2013-11-02 Werner Lemberg +2015-06-06 Ashish Azad - Fix Savannah bug #40451. + Fix Savannah bug #45260. - Simply apply the patch from the bug report. + * src/pfr/pfrdrivr.c (pfr_get_kerning): Fix typo. - * builds/unix/ftconfig.in, builds/vms/ftconfig.h, - include/freetype/config/ftconfig.h: The used #pragma directives only - work with gcc versions 4.6 and higher. +2015-06-03 Werner Lemberg -2013-11-01 Werner Lemberg + [truetype] Fix memory leak. - * docs/CHANGES: Updated. + Problem reported by Grissiom ; in -2013-11-01 Werner Lemberg + http://lists.nongnu.org/archive/html/freetype/2015-05/msg00013.html - [truetype] Minor code refactoring. + there is an example code to trigger the bug. - Two benefits: The allocated FDEF (and IDEF) array gets slightly - smaller, and the `ttdebug' demo program has access to function - numbers without additional costs. + * 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. - Fortunately, no changes to FontForge are necessary – this is the - only external TrueType debugger I know of, but others may exist and - should check the code accordingly. +2015-06-02 Werner Lemberg - * src/truetype/ttinterp.h (TT_CallRec): Replace `Cur_Restart' and - `Cur_End' with a pointer to the corresponding `TT_DefRecord' - structure. + [raster] Add more tracing. - * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF, Ins_ENDF, - Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns ): - Updated. + * 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. -2013-10-27 Werner Lemberg +2015-06-01 Werner Lemberg - [sfnt] Implement support for `OS/2' table version 5. + [truetype] While tracing opcodes, show code position and stack. - See + * 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. - http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism +2015-05-31 Werner Lemberg - for the announcement. + [truetype] In GX, make private point numbers work correctly. - * include/freetype/tttables.h (TT_OS2): Add fields - `usLowerPointSize' and `usUpperPointSize'. Since FreeType returns - this structure only as a pointer through `FT_Get_Sfnt_Table', there - shouldn't be any ABI problems. + 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/sfnt/ttload.c (tt_face_load_os2): Implement it. + * 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. - * docs/CHANGES: Updated. + * src/truetype/ttgxvar.h: Updated. -2013-10-24 Werner Lemberg + * src/truetype/ttgload.c (TT_Process_Simple_Glyph, + load_truetype_glyph): Updated. - * README.git, docs/CHANGES, docs/INSTALL: Updated. +2015-05-31 Werner Lemberg -2013-10-24 John Cary + [truetype] In GX, make intermediate tuplets work at extrema. - Provide cmake support. + * src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix range condition. - * CMakeLists.txt: New file. +2015-05-31 Werner Lemberg -2013-10-23 Kenneth Miller - Werner Lemberg + [truetype] Add tracing information to GX code. - Provide support for x64 builds in Visual C++ project files. + * 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. - * src/builds/win32: Renamed to... - * src/builds/windows: This. +2015-05-28 Werner Lemberg - * src/builds/windows/vc2010/*: Updated to handle x64 target. + * src/tools/apinames.c (names_dump): Fix invalid reference. - * src/builds/windows/*.mk, docs/INSTALL.GNU: s/win32/windows/ where - appropriate. + Problem reported by Guzman Mosqueda, Jose R + . -2013-10-22 Werner Lemberg +2015-05-24 Werner Lemberg - * src/base/md5.c, src/base/md5.h: Updated to recent version. + [truetype] Fix commit from 2015-05-22. - * src/base/ftobjs.c: Updated; `md5.c' no longer uses `free'. + * src/truetype/ttgload.c, src/truetype/ttinterp.c: Guard new code + with `TT_CONFIG_OPTION_SUBPIXEL_HINTING'. - The canonical URL to get updates for this file is + Problem reported by Nikolaus Waxweiler . - http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/popa3d/popa3d/md5/ +2015-05-23 Werner Lemberg - as the author told me in private communication. + [truetype] Fix return values of GETINFO bytecode instruction. -2013-10-19 Werner Lemberg + * src/truetype/ttinterp.h (TT_ExecContextRec): New fields + `vertical_lcd' and `gray_cleartype'. - [autofit] s/SMALL_TOP/X_HEIGHT/. + * src/truetype/ttgload.c (tt_loader_init): Initialize new fields. + Change `symmetrical smoothing' to TRUE, since FreeType produces + exactly this. - * src/autofit/afblue.dat: Updated. + * 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). - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. +2015-05-23 Werner Lemberg - * src/autofit/aflatin.c, src/autofit/aflatin.h, - src/autofit/atlatin2.c: Updated. + [truetype] Minor. -2013-10-19 Werner Lemberg + * src/truetype/ttinterp.h (TT_ExecContext): + s/subpixel/subpixel_hinting. - * src/autofit/afblue.dat: s/MINOR/DESCENDER/. + * src/truetype/ttgload.c, src/truetype/ttgload.h: Updated. - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. +2015-05-22 Werner Lemberg -2013-10-16 Werner Lemberg + [truetype] Support selector index 3 of the INSTCTRL instruction. - [autofit] Add description strings to script entries. + 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. - Currently, this is unused. + * 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/autofit/afscript.h: Do it. - * src/autofit/afglobal.c, src/autofit/afpic.c, - src/autofit/aftypes.h: Updated. + * src/truetype/ttinterp.c (Ins_INSTCTRL): Handle selector index 3. + (Ins_GETINFO): Updated. -2013-10-16 Werner Lemberg + * docs/CHANGES: Document it. - [autofit] Improve tracing message for extra light flag. +2015-05-20 Werner Lemberg - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Do it. + [truetype] Minor. -2013-10-15 Chongyu Zhu + * src/truetype/ttinterp.h (SetSuperRound): Fix type of `GridPeriod' + argument. - [arm] Fix thumb2 inline assembly under LLVM. +2015-05-17 Werner Lemberg - When using `ADD' with an immediate operand, the instruction is - actually `ADD Rd, Rn, #', that is, the maximum of the - immediate operand cannot exceed 4095. It will fail to compile with - LLVM. + [truetype] Fix loading of composite glyphs. - However, in GCC, due to some legacy compatibility considerations, - `ADD.W' will be automatically emitted when the immediate operand is - larger than 4095. + * 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... - * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h - (FT_MulFix_arm) [__GNUC__]: Support clang compiler. + 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). - * src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto. +2015-05-12 Chris Liddell -2013-10-12 Werner Lemberg + [cff] Make the `*curveto' operators more tolerant. - [autofit] Improve tracing of `latin' hinter. + * 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). - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue - zone types. - (af_latin_metrics_scale_dim): Report scaling changes due to x height - alignment. - Report scaled stroke width and blue zone values. +2015-05-12 Chris Liddell -2013-10-03 Dave Arnold + [cff] fix incremental interface with new cff code. - * src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero. + * 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). - Note that the old code avoided using a region of the piecewise - linear function where the slope was zero. The recovery was to use a - different section of the function, which produced a different, - incorrect amount of darkening. +2015-04-29 Alexei Podtelezhnikov -2013-10-02 Darrell Bellert + [autofit] Speed up IUP. - * src/sfnt/ttload.c (tt_face_load_pclt): Fix `pclt_fields'. + * src/autofit/afhints.c (af_iup_interp): Separate trivial snapping to + the same position from true interpolation, use `scale' to reduce + divisions. -2013-10-02 Dave Arnold +2015-04-28 Werner Lemberg - * src/cff/cf2font.c (cf2_computeDarkening): Initialize darkenAmount. + [cff] Use `name' table for PS name if we have a SFNT-CFF. - This line was lost in commit 89ca1fd6 (from 2013-06-25). The effect - is to use a previous darkening amount when producing an unhinted, - unscaled outline. This can cause autohint samples in ftgrid and - ftview to be based on darkened CFF outlines instead of unhinted, - undarkened ones. + This follows the OpenType 1.7 specification. See -2013-09-29 Dave Arnold + http://tug.org/pipermail/tex-live/2015-April/036634.html - Fix Savannah bug #39295. + for a discussion. - The bug was caused by switching to the initial hintmap (the one in - effect when `moveto' executes) just before drawing the final element - in the charstring. This ensured that the path was closed (in both - Character Space and Device Space). But if the final element was a - curve and if the final hintmap was different enough from the initial - one, then the curve was visibly distorted. + * src/cff/cffdrivr.c (cff_get_ps_name): Use the `sfnt' service if we + have an SFNT. - The first part of the fix is to draw the final curve using the final - hintmap as specified by the charstring. This corrects the - distortion but does not ensure closing in Device Space. It may - require the rasterizer to automatically generate an extra closing - line. Depending on the hintmap differences, this line could be from - zero to a couple pixels in length. +2015-04-27 Alexei Podtelezhnikov - The second part of the fix covers the case where the charstring - subpath is closed with an explicit line. We now modify that line's - end point to avoid the distortion. + [truetype] Speed up IUP. - Some glyphs in the bug report font (TexGyreHeros-Regular) that show - the change are: + * src/truetype/ttinterp.c (_iup_worker_interpolate): Separate trivial + snapping to the same position from true interpolation. - 25ppem S (98) - 24ppem eight (52) - 25.5ppem p (85) +2015-04-21 Werner Lemberg - Curves at the *end* of a subpath are no longer distorted. However, - some of these glyphs have bad hint substitutions in the middle of a - subpath, and these are not affected. + [autofit] By default, enable warping code but switch off warping. - The patch has been tested with a set of 106 fonts that shipped with - Adobe Creative Suite 4, together with 756 Open Source CFF fonts from - Google Fonts. There are 1.5 million glyphs, of which some 20k are - changed with the fix. A sampling of a few hundred of these changes - have been examined more closely, and the changes look good (or at - least acceptable). + Suggested by Behdad. - * src/cff/cf2hints.h (CF2_GlyphPathRec): New element `pathIsClosing' - to indicate that we synthesize a closepath line. + * include/config/ftoption.h: Define AF_CONFIG_OPTION_USE_WARPER. - * src/cff/cf2hints.c (cf2_glyphpath_init): Updated. - (cf2_glyphpath_pushPrevElem): If closing, use first hint map (for - `lineto' operator) and adjust hint zone. - For synthesized closing lines, use end point in first hint zone. - (cf2_glyphpath_lineTo): Take care of synthesized closing lines. In - particular, shift the detection of zero-length lines from character - space to device space. - (cf2_glyphpath_closeOpenPath): Remove assertion. - Updated. + * src/autofit/afmodule.c (af_autofitter_init): Initialize `warping' + with `false'. -2013-09-25 Werner Lemberg +2015-04-21 Werner Lemberg - * src/autofit/aflatin.c (af_{grek,cyrl}_uniranges): Fix arrays. + * docs/CHANGES: Updated. -2013-09-25 suzuki toshiya +2015-04-21 Werner Lemberg - [bdf, pcf] Refuse non-zero face_index. + [autofit] Introduce `warping' property. - Suggested by Akira Tagoh, see + This code replaces the debugging hook from the previous commit with + a better, more generic solution. - http://lists.gnu.org/archive/html/freetype/2013-09/msg00030.html + * include/ftautoh.h: Document it. - * src/bdf/bdfdrivr.c (BDF_Face_Init): Return `Invalid_Argument' - error if the font could be opened but non-zero `face_index' is - given. - * src/pcf/pcfdrivr.c (PCF_Face_Init): Ditto. + * src/autofit/afmodule.h (AF_ModuleRec) + [AF_CONFIG_OPTION_USE_WARPER]: Add `warping' field. - * src/type42/t42objs.c (T42_Face_Init): Remove unrequired FT_UNUSED - macro for `face_index' because it is validated later. + * 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. -2013-09-23 Werner Lemberg + * src/autofit/afhints.h (AF_HINTS_DO_WARP): Remove use of the no + longer existing `_af_debug_disable_warper'. - Fix Savannah bug #40090. + * 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. - * src/autofit/afcjk.c (af_cjk_metrics_scale): Revert commit - 306f8c5d (from 2013-08-25) affecting this function. + * src/autofit/aftypes.h: Updated. -2013-09-22 Werner Lemberg +2015-04-16 Werner Lemberg - [autofit] Disunify Cyrillic and Greek handling from Latin. + [autofit] Add debugging hook to disable warper. - * src/autofit/afscript.h: Add Cyrillic and Greek. + * src/autofit/afmodule.c (_af_debug_disable_warper) + [FT_DEBUG_AUTOFIT]: New global variable. - * src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK, - AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic. - (AF_BLUE_STRINGSET_LATN): Fix typo. - * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + * src/autofit/aftypes.h: Updated. + (AF_SCALER_FLAG_NO_WARPER): New macro (not actively used yet). - * src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New - arrays. - (af_grek_script_class, af_cyrl_script_class): New scripts. - * src/autofit/aflatin.h: Updated. + * src/autofit/afhints.h (AF_HINTS_DO_WARP): New macro. -2013-09-20 Werner Lemberg + * src/autofi/aflatin.c (af_latin_hints_apply) + [AF_CONFIG_OPTION_USE_WARPER]: Use `AF_HINTS_DO_WARP' to control use + of warper. - * docs/CHANGES: Updated. + * src/autofit/afcjk.c (af_cjk_hints_init, af_cjk_hints_apply) + [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. -2013-09-20 Behdad Esfahbod + * src/autofit/aflatin2.c (af_latin2_hints_apply) + [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'. - Fix vertical size of emboldened glyphs. +2015-04-10 Werner Lemberg - Cf. https://bugzilla.gnome.org/show_bug.cgi?id=686709 + [cff] Update advance width handling to OpenType 1.7. - * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY' - also. + Problem reported by Behdad. -2013-09-11 Alexei Podtelezhnikov + * src/cff/cffdrivr.c (cff_get_advances): Handle SFNT case + separately. - * include/freetype/ftoutln.h: Correct FT_Outline_Get_Orientation - algorithm description. + * src/cff/cffgload.c (cff_slot_load): Use advance width and side + bearing values from `hmtx' table if present. -2013-09-11 Werner Lemberg +2015-04-03 Alexei Podtelezhnikov - [autofit] Improve Hebrew rendering. + * src/autofit/afhints.c (af_glyph_hints_reload): Use do-while loop. - This change introduces a new blue zone property - `AF_BLUE_PROPERTY_LATIN_LONG' to make the auto-hinter ignore short - top segments. +2015-04-02 Alexei Podtelezhnikov - * src/autofit/afblue.dat: Fix Hebrew blue strings. - Use AF_BLUE_PROPERTY_LATIN_LONG for AF_BLUE_STRING_HEBREW_TOP. + * src/autofit/aflatin.c (af_latin_hint_edges): Reduce logic. - * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_LONG): New macro. +2015-04-01 Alexei Podtelezhnikov - * src/autofit/afblue.c, src/autofit/afblue.h: Updated. + [autofit] Finish the thought. - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle - `AF_LATIN_IS_LONG_BLUE'. + * src/autofit/afhints.c (af_direction_compute): make sure the long arm + is never negative so that its `FT_ABS' is not necessary. - * src/autofit/aflatin.h (AF_LATIN_IS_LONG_BLUE): New macro. +2015-04-01 Werner Lemberg -2013-08-28 Behdad Esfahbod + [autofit] Call dumper functions for tracing. - [sfnt] Fix frame access while reading WOFF table directory. + * 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/sfnt/sfobjs.c (woff_open_font): Using single memory frame - while reading the directory entries for the whole loop. +2015-04-01 Werner Lemberg -2013-08-29 Werner Lemberg - Behdad Esfahbod + [autofit] Make debugging stuff work again. - Implement support for WOFF containers. + The interface to ftgrid was broken in the series of commits starting + with - We simply synthesize a SFNT from the WOFF, create a memory stream - for the new data, and load the SFNT as usual. + [autofit] Allocate AF_Loader on the stack instead of AF_Module. - Does NOT add any API to access WOFF metadata or private blocks. + from 2015-01-14. - * include/freetype/internal/tttypes.h (WOFF_HeaderRec, - WOFF_TableRec): New structures. + * 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. - * include/freetype/tttags.h (TTAG_wOFF): New macro. + * src/autofit/afloader.c (af_loader_init, af_loader_done): Updated. - * src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling - `open_face'. +2015-04-01 Werner Lemberg - * src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include - `FT_GZIP_H'. - (WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for - writing to a stream. - (sfnt_stream_close, compare_offsets, woff_open_font): New functions. - (sfnt_open_font): Handle `TTAG_wOFF'. - (sfnt_init_face): Set `stream' after calling `sfnt_open_font'. + * src/autofit/afhints.c (af_glyph_hints_done): Fix minor thinko. - * src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling - `sfnt->init_face'. +2015-03-29 Werner Lemberg - * src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an - argument so that a changed stream survives. - Update callers. + [cff] Fix Savannah bug #44629. -2013-08-28 Werner Lemberg + * src/cff/cf2font.h (CF2_MAX_SUBR), src/cff/cffgload.h + (CFF_MAX_SUBRS_CALLS): Set to 16. - [gzip] New function `FT_Gzip_Uncompress'. +2015-03-29 Werner Lemberg - This is modeled after zlib's `uncompress' function. We need this - for WOFF support. + [type1, truetype] Make the MM API more flexible w.r.t. `num_coords'. - * include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress): - New function. + 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/gzip/rules.mk: Rewrite to better reflect dependencies. + * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): + Implement it. -2013-08-28 Werner Lemberg + * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design, + T1_Set_Var_Design): Ditto. - [autofit] Fix `make multi' compilation. +2015-03-29 Werner Lemberg - * src/autofit/afblue.cin, src/autofit/afblue.c: Don't include - `afblue.h' but `aftypes.h'. - * src/autofit/afcjk.c: Don't include `aftypes.h' but `afglobal.h'. + [type1] Minor. -2013-08-28 Werner Lemberg + * 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. - [autofit] Fix C++ compilation. +2015-03-27 Werner Lemberg - * src/autofit/afglobal.c (af_face_globals_get_metrics), - src/autofit/afdummy.c (af_dflt_script_class), src/autofit/afindic.c - (af_deva_script_class): Use proper casts. + [cff] Trace charstring nesting levels. -2013-08-27 Behdad Esfahbod + * src/cff/cf2intrp.c (cf2_interpT2CharString) : Implement it. - * src/sfnt/ttload.c (tt_face_load_font_dir): Fix sign typos. + * src/cff/cffgload.c (cff_decoder_parse_charstrings) + : Ditto. -2013-08-27 Behdad Esfahbod +2015-03-21 Alexei Podtelezhnikov - FT_Open_Face: Improve external stream handling. + [base] Optimize `FT_Angle_Diff'. - If the font's `clazz->init_face' function wants to swap to new - stream, handling of whether original stream was external could - result to either memory leak or double free. Mark externality into - face flags before calling `init_face' such that the clazz can handle - external streams properly. + Under normal circumstances we are usually close to the desired range + of angle values, so that the remainder is not really necessary. - * src/base/ftobjs.c (FT_Open_Face): Move code to set - FT_FACE_FLAG_EXTERNAL_STREAM to... - (open_face): This function. + * src/base/fttrigon.c (FT_Angle_Diff): Use loops instead of remainder. -2013-08-27 Werner Lemberg + * src/autofit/aftypes.h (AF_ANGLE_DIFF): Ditto in the unused macro. - Remove `FT_SqrtFixed' function. +2015-03-21 Werner Lemberg - It's no longer used. + [truetype] Improve `gvar' handling. - * include/freetype/internal/ftcalc.h, src/base/ftcalc.c: Do it. + * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Correctly handle + single-element runs. Cf. glyph `Q' in Skia.ttf with weights larger + than the default. -2013-08-27 Werner Lemberg +2015-03-20 Alexei Podtelezhnikov - [autofit] While tracing, report script names instead of ID values. + * src/base/fttrigon.c (FT_Vector_Rotate): Minor refactoring. - * src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]: - New array. - * src/autofit/afglobal.h: Updated. +2015-03-17 Alexei Podtelezhnikov - * src/autofit/afcjk.c (af_cjk_metrics_init_widths, - af_cjk_hint_edges): Use `af_script_names'. - * src/autofit/aflatin.c (af_latin_metrics_init_widths, - af_latin_hint_edges): Ditto. + Fix Savannah bug #44412 (part 2). -2013-08-26 Werner Lemberg + * src/base/fttrigon.c (FT_Sin, FT_Cos, FT_Tan): Call `FT_Vector_Unit'. - [autofit] Report used script while hinting a glyph. +2015-03-11 Werner Lemberg - * src/autofit/afcjk.c (af_cjk_hint_edges), src/autofit/aflatin.c - (af_latin_hint_edges): Implement it. + [autofit] Add support for Arabic script. -2013-08-26 Werner Lemberg + Thanks to Titus Nemeth for guidance! - [autofit] Add support for Hebrew script. + * src/autofit/afblue.dat: Add blue zone data for Arabic. - * src/autofit/afblue.dat: Add blue strings for Hebrew. * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - * src/autofit/aflatin.c (af_hebr_uniranges): New array. - (af_hebr_script_class): New script. - * src/autofit/aflatin.h, src/autofit/afscript.h: Updated. + * src/autofit/afscript.h: Add Arabic standard characters. -2013-08-26 Werner Lemberg + * src/autofit/afranges.c: Add Arabic data. - [autofit] Improve tracing messages. + * src/autofit/afstyles.h: Add Arabic data. - * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script - ID in tracing message. - (af_cjk_metrics_init_blues): Initialize `axis' outside of the inner - loop. - Improve tracing messages. - (af_cjk_hint_edges) [FT_DEBUG_LEVEL_TRACE]: New variable - `num_actions' to count hinting actions. - Improve tracing messages. + * docs/CHANGES: Document it. - * src/autofit/aflatin.c (af_latin_metrics_init_widths): Mention - script ID in tracing message. - (af_latin_metrics_init_blues, af_latin_hint_edges): Improve tracing - messages. +2015-03-11 Werner Lemberg -2013-08-26 Werner Lemberg + Rename `svxf86nm.h' to `svfntfmt.h'; update related symbols. - Better tracing of loaded glyphs. + * include/internal/ftserv.h (FT_SERVICE_XFREE86_NAME_H): Renamed + to... + (FT_SERVICE_FONT_FORMAT_H): This. - Previously, the loading of a glyph was traced at level 4, if at all. - With this change, all font loading routines emit a tracing message - at level 1, making it easier to select tracing output (for example - using F2_DEBUG="any:1 afhints:7 aflatin:7"). - - * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message. - * src/cff/cffdrivr.c (cff_glyph_load): Ditto. - * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing - messages. - * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing - message. - * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto. - * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message. - * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. - * src/type1/t1gload.c (T1_Load_Glyph): Ditto. - * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto. - * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto. + * include/internal/services/svfntfmt.h (FT_XF86_FORMAT_*): Renamed + to ... + (FT_FONT_FORMAT_*): This. -2013-08-26 Werner Lemberg + 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. - [autofit] Fix script selection. +2015-03-11 Werner Lemberg - * src/autofit/afglobal.c (af_face_globals_get_metrics): Use - `AF_SCRIPT_DFLT', not value 0. - Simplify code. + [base] Rename `FT_XFREE86_H' to `FT_FONT_FORMATS_H'. - * src/autofit/afscript.h: Sort by script name. + * include/config/ftheader.h: Implement it. + * src/base/ftfntfmt.c, docs/CHANGES: Updated. -2013-08-26 Werner Lemberg +2015-03-11 Werner Lemberg - [autofit] Make `dummy' hinter work as expected. + [base] Rename `FT_Get_X11_Font_Format' to `FT_Get_Font_Format'. - * src/autofit/afdummy.c (af_dummy_hints_init): Properly set scaling - information. - (af_dummy_hints_apply): Scale the glyphs. + * include/ftfntfmt.h, src/base/ftfntfmt.c: Implement it. -2013-08-25 Werner Lemberg + * docs/CHANGES: Updated. - [autofit] Make `cjk' module use blue stringsets. +2015-03-11 Werner Lemberg - * src/autofit/afcjk.c (AF_CJK_MAX_TEST_CHARACTERS): Removed. - (af_cjk_hani_blue_chars): Removed. - (AF_CJK_BLUE_TYPE_*): Removed. - (af_cjk_metrics_init_blues): Replace AF_CJK_MAX_TEST_CHARACTERS with - AF_BLUE_STRING_MAX_LEN. - Change loops to use offsets (in file `afblue.h') into the new arrays - `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c'). - Instead of three dimensions (as used in the old blue string array) - we now use properties to do the same, saving one loop nesting level. + Fix automatic copyright updating. - * src/autofit/afcjk.h: Remove old enumeration values superseded by - the new data in `afblue.h'. - (AF_CJK_IS_TOP_BLUE, AF_CJK_IS_HORIZ_BLUE, AF_CJK_IS_FILLED_BLUE, - AF_CJK_IS_RIGHT_BLUE): New macros, to be used in - `af_cjk_metrics_init_blues'. - (AF_CJK_BLUE_IS_RIGHT): Remove this now redundant enum value. - (AF_CJK_BLUE_IS_TOP): Renamed to... - (AF_CJK_BLUE_TOP): This. - (AF_CJK_MAX_BLUES): Remove. - (AF_CJKAxisRec): Updated. + * src/tools/update-copyright: Make scanning of `no-copyright' + actually work. -2013-08-25 Werner Lemberg + * src/tools/no-copyright: Don't include README in general. - [autofit] Typo. +2015-03-11 Werner Lemberg - * src/autofit/afblue.hin, src/autofit/afblue.c (GET_UTF8_CHAR): Use - cast. + Rename `ftxf86.[ch]' to `ftfntfmt.[ch]'. -2013-08-25 Werner Lemberg + 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. - [autofit] Synchronize `cjk' with `latin' module (and vice versa). +2015-03-10 Alexei Podtelezhnikov - * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Add tracing - messages. - (af_cjk_metrics_init_blues): Don't pass blue string array as - argument but use the global array directly. - Use `outline' directly. - Update and add tracing messages. - (af_cjk_metrics_init): Simplify code. - (af_cjk_metrics_scale_dim): Improve tracing message. - (af_cjk_metrics_scale): Synchronize. - - * src/autofit/aflatin.c (af_latin_metrics_init_widths, - af_latin_metrics_init_blues): Improve and add tracing messages. - -2013-08-25 Werner Lemberg - - [autofit] Make `latin' module use blue stringsets. + Fix Savannah bug #44412 (part 1). - * src/autofit/aflatin.c (AF_LATIN_MAX_TEST_CHARACTERS): Removed. - (af_latin_blue_chars): Removed. - (af_latin_metrics_init_blues): Replace AF_LATIN_MAX_TEST_CHARACTERS - with AF_BLUE_STRING_MAX_LEN. - Change loops to use offsets (in file `afblue.h') into the new arrays - `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c'). - Use `AF_LATIN_IS_SMALL_TOP_BLUE' macro. + * src/base/ftstroke.c (ft_stroker_inside): Handle near U-turns. - * src/autofit/aflatin.h: Remove old enumeration values superseded by - the new data in `afblue.h'. - (AF_LATIN_IS_TOP_BLUE): Updated definition. - (AF_LATIN_IS_SMALL_TOP_BLUE): New macro. - (AF_LATIN_MAX_BLUES): Remove. - (AF_LatinAxisRec): Updated. +2015-03-10 Werner Lemberg -2013-08-25 Werner Lemberg - - [autofit] Add blue stringsets. + [base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'. - * src/autofit/aftypes.h: Include `afblue.h'. - (AF_ScriptClassRec): Add `blue_stringset' field. - (AF_DEFINE_SCRIPT_CLASS): Updated. + * include/ftbitmap.h, src/base/ftbitmap.c: Implement it. + Update all callers. - * src/autofit/autofit.c: Include `afblue.c'. + * docs/CHANGES: Updated. - * src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c - (af_dflt_script_class), src/autofit/afindic.c - (af_deva_script_class), src/autofit/aflatin.c - (af_latn_script_class), src/autofit/aflatin2.c - (af_ltn2_script_class): Updated. +2015-03-06 Werner Lemberg - * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'. + * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning. -2013-08-25 Werner Lemberg + Found by Alexei. - [autofit] Introduce data file for blue strings. +2015-03-05 Alexei Podtelezhnikov - The idea is to have a central file which gets processed by a Perl - script to create proper `.c' and `.h' files using templates. There - are two other reasons to do that: + * src/base/ftstroke.c: Simplify. - . The data file should be easily readable. We use UTF-8 encoding - which then gets converted to single bytes. +2015-03-04 Werner Lemberg - . Since the number of supported scripts will increase soon, the - current usage of blue string arrays is a waste of space. Using - the Perl script it is possible to imitate jagged arrays, - defining enumeration constants as offsets into the arrays. + [truetype] Some fixes and code refactoring in `ttgxvar.c'. - This commit only adds files without changing any functionality. + * 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. - * src/autofit/afblue.dat: New data file. - * src/tools/afblue.pl: New Perl script for processing `afblue.dat'. +2015-03-03 Werner Lemberg - * src/autofit/afblue.cin, src/autofit/afblue.hin: New template files - for... - * src/autofit/afblue.c, src/autofit/afblue.c: New source files. - To avoid a dependency on Perl, we add them too. + [autofit] Fix Savannah bug #44241. -2013-08-19 Alexei Podtelezhnikov + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs + with less than 3 points. - [base] Enable new algorithm for `BBox_Cubic_Check'. +2015-03-02 Werner Lemberg - * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove - the old one. - Improve comments. + Simplify `TYPEOF' macro. -2013-08-18 Werner Lemberg + No need for two arguments. - * builds/unix/unix-def.in (freetype2.pc): Don't set executable bit. + * include/config/ftconfig.h, builds/unix/ftconfig.in, + builds/vms/ftconfig.h (TYPEOF): Updated. -2013-08-18 Werner Lemberg + * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR), + src/autofit/afwarp.h (AF_WARPER_FLOOR): Updated. - Fix Savannah bug #39804. +2015-03-01 Werner Lemberg - * builds/unix/configure.raw (LIBPNG): Define and export. - * builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle - libpng. + Various compiler warning fixes for `make multi'. -2013-08-17 Alexei Podtelezhnikov + * 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'. - [base] Clean up BBox_Conic_Check. + * 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. - * src/base/ftbbox.c (BBox_Conic_Check): Remove redundant checks for - extremum at the segment ends, which are already within the bbox. - Slightly modify calculations. + * src/cff/cf2intrp.c: Include `cf2intrp.h'. + * src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused. -2013-08-15 Alexei Podtelezhnikov + * src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused. - [base] Finish experimental (disabled) BBox_Cubic_Check implementation. + * src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'. - * src/base/ftbbox.c (BBox_Cubic_Check): Scale arguments to improve - accuracy and avoid overflows. + * src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX): + Removed. Unused. -2013-08-13 Alexei Podtelezhnikov + * src/raster/ftraster.c (Render_Glyph): Declare as `static'. - [base] Refactor experimental (disabled) BBox_Cubic_Check. + * src/sfnt/ttpost.c (load_format_20): Fix signedness warning. - * src/base/ftbbox.c (BBox_Cubic_Check): Implement the minimum search - as the mirror image of the maximum search implemented here... - (update_max): New function. + * 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'. -2013-08-06 John Tytgat + * 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. - Fix Savannah bug #39702. + * src/type42/t42parse.c (T1_Done_Table): Removed. Unused. - * src/cff/cffload.c (cff_index_get_pointers): Check for `cur_offset - != 0'; this stronger test is mandated by the CFF specification. - Fix test for INDEX structures which have one or more empty entries - at the end. +2015-02-25 Werner Lemberg -2013-08-05 Werner Lemberg + [psaux] Signedness fixes. - Fix gcc pragmas, part 2. + * 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. - * src/truetype/ttinterp.c (TT_MulFix14_long_long, - TT_DotFix14_long_long): `#pragma gcc diagnostic {push,pop}' has been - introduced with gcc version 4.6. +2015-02-25 Werner Lemberg -2013-08-05 Werner Lemberg + [otvalid] Signedness fixes. - Fix gcc pragmas. + * src/otvalid/otvcommn.c, src/otvalid/otvgdef.c, + src/otvalid/otvgpos.c, src/otvalid/otvgsub.c, src/otvalid/otvmath.c: + Apply. - * src/truetype/ttinterp.c (TT_MulFix14_long_long, - TT_DotFix14_long_long): Older gcc versions don't accept diagnostic - pragmas within a function body. +2015-02-25 Werner Lemberg -2013-08-05 Werner Lemberg + * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Signedness fix. - Fix Savannah bug #39700. +2015-02-25 Werner Lemberg - * builds/unix/ftconfig.h: Synchronize with - `include/freetype/config/ftconfig.h'. + [lzw] Signedness fixes. - * builds/vms/ftconfig.h: Ditto. - Make the differences to the master `ftconfig.h' file as small as - possible for easier maintainance. + * src/lzw/ftzopen.c, src/lzw/ftzopen.h: Apply. -2013-08-05 Werner Lemberg +2015-02-25 Werner Lemberg - [autofit] Improve handling of `near' points. + [gxvalid] Signedness fixes. - Points which are very near to each other are now marked as such. - The `weak' flag is then computed by using the `in' vector of the - first and the `out' vector of the last point of a group of near - points. + * 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. - For example, this fixes the rendering of glyph `Oslash' in - `Roboto-Thin.ttf'. +2015-02-25 Werner Lemberg - * src/autofit/afhints.h (AF_Flags): New value `AF_FLAGS_NEAR'. + [cache] Signedness fixes. - * src/autofit/afhints.c (af_glyph_hints_reload): Introduce - the heuristic value `near_limit' to decide whether the current point - is near to the previous one, then set `AF_FLAG_NEAR' accordingly. - Store good `in' vector (of last non-near point) in - `last_good_in_{x,y}' and use it as an argument to - `ft_corner_is_flat' if necessary. + * src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c, + src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply. -2013-08-02 Werner Lemberg +2015-02-25 Werner Lemberg - * include/freetype/ftcffdrv.h: Improve documentation. - This is based on blog entries from David Lemon and Dave Arnold (both - from Adobe) with kind permission. Dave also helped in - proof-reading. + Change dimension fields in `FTC_ImageTypeRec' to unsigned type. -2013-08-02 Werner Lemberg + This doesn't break ABI. - [autofit] Move declaration of scripts into separate file. + * include/ftcache.h (FTC_ImageTypeRec): Use unsigned types for + `width' and `height'. - This has the benefit that we don't need to duplicate the data at - different places. + * docs/CHANGES: Document it. - * src/autofit/afscript.h: New file. +2015-02-25 Werner Lemberg - * src/autofit/aftypes.h (AF_Script): Include `afscript.h' to define - the enumeration values. + [cache] Don't use `labs'. - * src/autofit/afglobal.c: Include `afscript.h' to get the script - specific header files. - (af_script_classes): Include `afscript.h' to fill this array. + This is the only place in FreeType where this function was used. - * src/autofit/afpic.c: Include `afscript.h' to get the script - specific header files. - (autofit_module_class_pic_init): Include `afscript.h' for - initialization. - * src/autofit/afpic.h (AF_SCRIPT_CLASSES_COUNT, - AF_SCRIPT_CLASSES_REC_COUNT): Removed. Use `AF_SCRIPT_MAX' instead. + * include/config/ftstdlib.h (ft_labs): Remove. - * src/autofit/rules.mk (AUTOF_DRV_H): Updated. + * src/cache/ftcimage.c (ftc_inode_weight): Replace `ft_labs' with + `FT_ABS'. -2013-08-02 Werner Lemberg +2015-02-23 Werner Lemberg - [autofit] Move declaration of writing systems into separate file. + [cache] Replace `FT_PtrDist' with `FT_Offset'. - This has the benefit that we don't need to duplicate the data at - different places. + * 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/autofit/afwrtsys.h: New file. + * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c, + src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated. - * src/autofit/aftypes.h (AF_WritingSystem): Include `afwrtsys.h' to - define the enumeration values. +2015-02-23 Werner Lemberg - * src/autofit/afglobal.c: Include `afwrtsys.h' to get the writing - system specific header files. - Include `afpic.h'. - (af_writing_system_classes): Include `afwrtsys.h' to fill this - array. + [smooth, raster] Re-enable standalone compilation. - * src/autofit/afpic.c: Include `afwrtsys.h' to get the writing - system specific header files. - (autofit_module_class_pic_init): Include `afwrtsys.h' for - initialization. - * src/autofit/afpic.h (AF_WRITING_SYSTEM_CLASSES_COUNT, - AF_WRITING_SYSTEM_CLASSES_REC_COUNT): Removed. Use - `AF_WRITING_SYSTEM_MAX' instead. + * src/raster/ftraster.c (FT_RENDER_POOL_SIZE, FT_MAX) + [_STANDALONE_]: Define macros. -2013-08-02 Werner Lemberg + * src/smooth/ftgrays.c (FT_RENDER_POOL_SIZE, FT_MAX, FT_ABS, + FT_HYPOT) [_STANDALONE_]: Define macros. - [sfnt] Fix compilation with g++. +2015-02-22 Werner Lemberg - * src/sfnt/pngshim.c (error_callback, read_data_from_FT_stream): Use - cast. - (Load_SBit_Png): Pacify compiler. + [smooth] Signedness fixes. -2013-08-02 suzuki toshiya - Werner Lemberg + * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply. - [autofit] Fix `make multi'. +2015-02-22 Werner Lemberg - * include/freetype/config/ftconfig.h (FT_LOCAL_ARRAY, - FT_LOCAL_ARRAY_DEF): New macros. + * src/raster/ftraster.c: Use the file's typedefs everywhere. - * src/autofit/afglobal.c (af_writing_system_classes, - af_script_classes): Use FT_LOCAL_ARRAY_DEF. - * src/autofit/afglobal.h: Declare `af_writing_system_classes' and - `af_script_classes'. - * src/autofit/afloader.c: Include `afpic.h'. +2015-02-22 Werner Lemberg -2013-08-01 Werner Lemberg + * src/sfnt/ttpost.c (load_format_20): Fix error tracing message. - Another round of cppcheck nitpicks. + Bug introduced 6 commits earlier. - The call was (from the top-level of the FreeType tree): +2015-02-22 Werner Lemberg - cppcheck --force \ - --enable=all \ - -I /usr/include \ - -I /usr/local/include \ - -I /usr/lib/gcc/i586-suse-linux/4.7/include \ - -I include \ - -I include/freetype \ - -I include/freetype/config \ - -I include/freetype/internal \ - -DFT2_BUILD_LIBRARY \ - . &> cppcheck.log + [pshinter] Fix thinko. - using cppcheck git commit f7e93f99. + * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Correctly + check `count'. + Bug introduced two commits earlier. - Note that cppcheck still can't handle `#include FOO' (with `FOO' a - macro). +2015-02-22 Werner Lemberg - */* Improve variable scopes. - */* Remove redundant initializations which get overwritten. + [raster] Signedness fixes. - * src/gxvalid/*: Comment out redundant code or guard it with - FT_DEBUG_LEVEL_TRACE. + * src/raster/ftraster.c, src/raster/ftrend1.c: Apply. -2013-07-30 Werner Lemberg +2015-02-22 Werner Lemberg - [autofit] Introduce `writing systems'. + [pshinter] Signedness fixes. - This patch adds a new top level to the auto-hinter's script class - hierarchy. It defines `writing systems' which can contain multiple - scripts. + * src/pshinter/pshalgo.c, src/pshinter/pshglob.c, + src/pshinter/pshrec.c: Apply. - For example, the `latin' writing system (in file `aflatin.c') is - able to support scripts like Latin, Cyrillic, Armenian, etc., which - can be handled similarly. +2015-02-22 Werner Lemberg - Scripts are now named using four-letter OpenType tags. + [pshinter] Use macros for (unsigned) flags, not enumerations. - * src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members - to... - (AF_WritingSystemClassRec): This new structure. It holds pointers - to functions which can be shared among related scripts. - (AF_WritingSystem): New enumeration. - (AF_Script): Revised values using four-letter tags. - (AF_DEFINE_WRITING_SYSTEM_CLASS): New macro. - (AF_DEFINE_SCRIPT_CLASS): Updated. + * src/pshinter/pshalgo.h (PSH_Hint_Flags): Replace with macros. + Updated. + * src/pshinter/pshrec.h (PS_Hint_Flags): Replace with macros. - * src/autofit/afglobal.c (af_writing_system_classes): New global, - constant array. - (af_script_classes): Updated. - (af_face_globals_free): Updated. - Remove assertion. - (af_face_globals_get_metrics): Updated. +2015-02-22 Werner Lemberg - * src/autofit/afglobal.h (AF_SCRIPT_FALLBACK) - [!AF_CONFIG_OPTION_CJK]: Handle this case. + * src/pshinter/pshrec.c: Simplify. + (ps_hints_open, ps_hints_stem): Remove switch statement. - * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): - Updated. +2015-02-22 Werner Lemberg - * src/autofit/afpic.c (autofit_module_class_pic_init): Updated; - initialize structures for both writing systems and scripts. - * src/autofit/afpic.h: Updated. - (AF_WRITING_SYSTEM_CLASSES_GET): New macro. - - * src/autofit/afcjk.c (af_cjk_writing_system_class): New writing - system. - (af_cjk_uniranges): Renamed to... - (af_hani_uniranges): This. - (af_cjk_script_class): Reduced and renamed to... - (af_hani_script_class): This. - * src/autofit/afcjk.h: Updated. - - * src/autofit/afdummy.c (af_dummy_writing_system_class): New writing - system. - (af_dummy_script_class): Reduced and renamed to... - (af_dflt_script_class): This. - * src/autofit/afdummy.h: Updated. - - * src/autofit/afindic.c (af_indic_writing_system_class): New writing - system. - (af_indic_uniranges): Renamed to... - (af_deva_uniranges): This. - (af_indic_script_class): Reduced and renamed to... - (af_deva_script_class): This. - * src/autofit/afcjk.h: Updated. - - * src/autofit/aflatin.c (af_latin_writing_system_class): New writing - system. - (af_latin_uniranges): Renamed to... - (af_latn_uniranges): This. - (af_latin_script_class): Reduced and renamed to... - (af_latn_script_class): This. - * src/autofit/aflatin.h: Updated. - - * src/autofit/aflatin2.c (af_latin2_writing_system_class): New - writing system. - (af_latin2_uniranges): Renamed to... - (af_ltn2_uniranges): This. - Synchronize ranges with `latin'. - (af_latin2_script_class): Reduced and renamed to... - (af_ltn2_script_class): This. - * src/autofit/aflatin2.h: Updated. - -2013-07-30 Werner Lemberg - - [autofit] Variable renaming. - - * src/autofit/aftypes.h (AF_ScriptMetricsRec): - s/clazz/script_class/. - Update all users. + [sfnt] Signedness fixes. -2013-07-30 suzuki toshiya + * 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. - Ignore libpng-config under cross-building configuration, - because it will return the flags for the hosting environment. +2015-02-22 Werner Lemberg - * builds/unix/configure.raw: Ignore libpng-config when - `cross_compiling' == yes. + [bdf] Signedness fixes. -2013-07-30 Behdad Esfahbod + * src/bdf/bdf.h, src/bdf/bdfdrivr.c, src/bdf/bdfdrivr.h, + src/bdf/bdflib.c: Apply. - Prevent division by zero by a transparent color. +2015-02-22 Werner Lemberg - * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): - Return 0 immediately, when alpha channel is zero. + * src/bdf/bdflib.c (_bdf_atous): New function. + (_bdf_parse_glyphs, _bdf_parse_start): Use it. -2013-07-25 Behdad Esfahbod +2015-02-22 Werner Lemberg - Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR. + [pcf] Signedness fixes. - Also disambiguate Google's color bitmap tables. + * src/pcf/pcf.h, src/pcf/pcfdrivr.c: Apply. + * src/pcf/pcfread.c: Apply. + (pcf_get_encodings): Ignore invalid negative encoding offsets. - * include/freetype/freetype.h (FT_FACE_FLAG_COLOR, FT_HAS_COLOR): - New macros. +2015-02-21 Werner Lemberg - * include/freetype/internal/tttypes.h (TT_SbitTableType): Add - TT_SBIT_TABLE_TYPE_CBLC. + * src/winfonts/winfnt.c: Signedness fixes. - * src/sfnt/sfobjs.c (sfnt_load_face): Handle FT_FACE_FLAG_COLOR. +2015-02-21 Werner Lemberg - * src/sfnt/ttsbit.c (tt_face_load_sbit, - tt_face_load_strike_metrics, tt_face_load_sbit_image): Handle - TT_SBIT_TABLE_TYPE_CBLC. + [type42] Signedness fixes. -2013-07-24 suzuki toshiya + * src/type42/t42parse.c, src/type42/t42parse.h, + src/type42/t42types.h: Apply. - [sfnt] Fix for `make multi' target. +2015-02-21 Werner Lemberg - * src/sfnt/pngshim.c (Load_SBit_Png): Use FT_LOCAL_DEF(). + [pfr] Signedness fixes. -2013-07-20 Werner Lemberg + * 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. - * docs/INSTALL.GNU: Updated. +2015-02-21 Werner Lemberg -2013-07-20 Behdad Esfahbod + [cff] Minor signedness fixes related to last commit. - [sfnt] Fix `sbix' table version handling. + * src/cff/cf2ft.c, src/cff/cf2intrp.c, src/cff/cffgload.c: Apply. - * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: - USHORT version numbers are to be considered as `minor'. +2015-02-20 Werner Lemberg -2013-07-19 Werner Lemberg + [cff] Thinkos in bias handling. - [autofit] Fix segment classification for blue zones. + Only the final result is always positive. - The old code (essentially unchanged since the very beginning) - incorrectly handled this configuration + Bug introduced three commits earlier. - x -o- x - / \ - / \ - / \ - o o + * src/cff/cffgload.c, src/cff/cffgload.h: Apply. - as flat and this +2015-02-20 Werner Lemberg - o o - / / - x| x| - | | - o---------------o + [cid] Fix signedness issues and emit some better error codes. - as round. (`o' and `x' are on and off points, respectively). + * 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. - This is a major change which should improve the rendering results - enormously for many TrueType fonts, especially in the range approx. - 20-40ppem, fixing the appearance of many overshoots. +2015-02-20 Werner Lemberg - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Look at the - first and last points of the segment, not the points right before - and after. + [cff] Signedness fixes for new engine. -2013-07-19 Behdad Esfahbod + * 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. - [sfnt] `sbix' fix-ups. +2015-02-20 Werner Lemberg - * src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps - are rendered scaled and then the `glyf' outline rendered on top. We - don't support that yet, so just ignore the `glyf' outline and - advertise it as a bitmap-only font. + [cff] Signedness fixes for basic infrastructure and old engine. - * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) - [TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units. - (tt_face_load_sbix_image): Typo. + * 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. -2013-07-18 Behdad Esfahbod +2015-02-19 Werner Lemberg - [sfnt] Add support for Apple's `sbix' color bitmap table. + * src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'. - * include/freetype/internal/tttypes.h (TT_SBit_MetricsRec): Widen - fields to FT_Short and FT_UShort, respectively. - (TT_SBitTableType): New enumeration. - (TT_FaceRec): Add `sbit_table_type' field. + This is hard-coded to value 2 in `fvar' version 1.0 (and no newer + version exists), but some fonts set it incorrectly. - * include/freetype/tttags.h (TTAG_sbix): New macro. + Problem reported by Adam Twardoch . - * src/sfnt/pngshim.c (Load_SBit_Png): Pass a more generic - FT_GlyphSlot argument instead FT_Bitmap. - Add flag to control map and metrics handling. - Update all users. +2015-02-19 Werner Lemberg - * src/sfnt/ttsbit.c: Include `ttmtx.h'. - (tt_face_load_eblc): Renamed to... - (tt_face_load_sbit): This. - Handlic `sbix' bitmaps. - (tt_face_free_eblc): Renamed to... - (tt_face_load_sbit): This. - Updated. - (tt_face_load_strike_metrics): Handle `sbix' bitmaps. - (tt_face_load_sbix_image): New function. - (tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_image, - tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, - tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png, - tt_sbit_decoder_load_image, tt_sbit_decoder_load_bitmap): Don't pass - and handle load flags. - (tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG]: Better - handle formats 17-19. - Move color to grayscale conversion to... - (tt_face_load_sbit_image): Here. - Handle `sbix' bitmaps. + [cff] Emit better error code for invalid private dict size. - * src/sfnt/pngshim.h: Updated. - * src/sfnt/ttsbit.h: Updated. - * src/sfnt/sfdriver.c: Updated. + * src/cff/cffparse.c (cff_parse_private_dict): Reject negative + values for size and offset. -2013-07-18 Werner Lemberg +2015-02-19 Werner Lemberg - [sfnt] Ignore invalid magic number in `head' or `bhed'. + [autofit] Fix signedness issues. - Other font engines seem to ignore it also. Problem reported by - Hin-Tak Leung . + * 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/sfnt/ttload.c (check_table_dir): Don't abort but warn only if - we have an invalid magic number. +2015-02-19 Werner Lemberg -2013-07-16 Werner Lemberg + [autofit] Use macros for (unsigned) flags, not enumerations. - [smooth] Fix segfault caused by previous commit. + This harmonizes with other code in FreeType (and reduces the number + of necessary casts to avoid compiler warnings). - * src/smooth/ftgrays.c (gray_set_cell): Always compute - `ras.invalid'. + * src/autofit/afblue.hin: Make flag macros unsigned. + * src/autofit/afblue.h: Regenerated. -2013-07-16 David Turner + * src/autofit/afcjk.h: Replace flag enumeration with macros. + * src/autofit/afcjk.c: Updated. - [smooth] Improve performance. + * src/autofit/afhints.h (AF_Flags, AF_Edge_Flags): Replace with + macros. + * src/autofit/afhints.c: Updated. - Provide a work-around for an ARM-specific performance bug in GCC. - This speeds up the rasterizer by more than 5%. + * src/autofit/aflatin.h: Replace flag enumerations with macros. + * src/autofit/aflatin.c, src/autofit/aflatin2.c: Updated. - Also slightly optimize `set_gray_cell' and `gray_record_cell' (which - also improves performance on other platforms by a tiny bit (<1%). + * src/autofit/aftypes.h (AF_ScalerFlags): Replace with macros. - * src/smooth/ftgrays.c (FT_DIV_MOD): New macro. - Use it where appropriate. +2015-02-18 Werner Lemberg - (gray_record_cell, gray_set_cell, gray_move_to, - gray_convert_glyph_inner): Streamline condition handling. + [type1] Fix signedness issues. -2013-07-16 David Turner + * 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. - [truetype] Add assembler code for TT_MulFix14 and TT_DotFix14. +2015-02-18 Werner Lemberg - This patch provides slightly optimized versions for ARM, x86, and - x86_64 CPUs if built with GCC. + [psaux, type1] Fix minor AFM issues. - Also remove some dead code. + * 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. - * src/truetype/ttinterp.c (TT_MulFix14_arm, TT_MulFix14_long_long, - TT_DotFix14_long_long): New functions. + * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs): + Reject negative values for number of kerning elements. -2013-07-16 David Turner + * src/type1/t1afm.c, src/tools/test_afm.c: Updated. - Optimize FT_MulFix for x86_64 GCC builds. +2015-02-18 Werner Lemberg - This patch provides an optimized `FT_MulFix' implementation for - x86_64 machines when FreeType is built with GCC, or compatible - compilers like Clang. + Don't use `FT_PtrDist' for lengths. - Example: - bin/ftbench -p -t 5 -s 14 -f 0008 Arial.ttf + Use FT_UInt instead. - Before: + * include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec, + T1_DecoderRec): Do it. - Load 4.863 us/op - Load_Advances (Normal) 4.816 us/op - Load_Advances (Fast) 0.028 us/op - Render 2.753 us/op - Get_Glyph 0.463 us/op - Get_CBox 0.077 us/op - Get_Char_Index 0.023 us/op - Iterate CMap 13.898 us/op - New_Face 12.368 us/op - Embolden 0.028 us/op - Get_BBox 0.302 us/op + * include/internal/t1types.h (T1_FontRec): Ditto. - After: + * 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_chharstrings, parse_dict): Ditto. + * src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings, + t42_parse_dict): Ditto. - Load 4.617 us/op - Load_Advances (Normal) 4.645 us/op - Load_Advances (Fast) 0.027 us/op - Render 2.789 us/op - Get_Glyph 0.460 us/op - Get_CBox 0.077 us/op - Get_Char_Index 0.024 us/op - Iterate CMap 13.403 us/op - New_Face 12.278 us/op - Embolden 0.028 us/op - Get_BBox 0.301 us/op +2015-02-18 Werner Lemberg - * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h - (FT_MulFix_x86_64): New function. + * src/type1/t1driver.c (t1_ps_get_font_value): Clean up. + This handles negative values better, avoiding many casts. -2013-07-16 David Turner +2015-02-17 Werner Lemberg - Speed up ARMv7 support. + [base] Fix Savannah bug #44284. - When building for ARMv7 with thumb2 instructions, the optimized - `FT_MulFix_arm' assembly routine was not being used. + * src/base/ftcalc.c (FT_MulFix): Typos. - The reason for this is in the `ftconfig.h' header, namely: +2015-02-17 Werner Lemberg - - The assembly routine uses the `smull' instruction which is not - available when generating Thumb-1 machine code. It is available - in Thumb-2 mode, though. + [truetype] Finish compiler warning fixes for signedness issues. - - The header was written a long time ago before Thumb-2 became - widely popular (e.g. with Android). So it simply doesn't use the - assembly routine if the `__thumb__' built-in macro is defined. + * src/truetype/ttgxvar.c, src/truetype/ttsubpix.c, + src/truetype/ttsubpix.h: Apply. - - When compiling in Thumb-2 mode, the compiler will define both - `__thumb__' and `__thumb2__'. +2015-02-17 Werner Lemberg - By checking for `(__thumb2__ || !__thumb__)', we ensure that the - assembly routine is only avoided when generating Thumb-1 code. + * src/truetype/ttsubpix.c: Adding missing `static' keywords. - Given that this is performance-sensitive function, this improves - `ftbench' as follows on a Galaxy Nexus: +2015-02-17 Werner Lemberg - Before (us/op) After (us/op) + [truetype] More signedness fixes. - - loading Arial.ttf glyphs at 14 ppem [1] + * include/internal/tttypes.h, src/truetype/ttinterp.h, + src/truetype/ttobjs.h, src/truetype/ttinterp.c, + src/truetype/ttobjs.c: Apply. - Load 34.285 33.098 +2015-02-17 Werner Lemberg - - same operation with the light auto-hinter [2] + [truetype] Various signedness fixes. - Load 31.317 29.590 + * include/internal/ftgloadr.h, src/truetype/ttpload.c: Apply. - - same operation without hinting [3] + * src/truetype/ttgload.c: Apply. + (TT_Get_VMetrics): Protect against invalid ascenders and descenders + while constructing advance height. - Load 6.143 5.376 +2015-02-16 Werner Lemberg - - loading Arial.ttf advances at 14 ppem [4] + [base] Finish compiler warning fixes for signedness issues. - Load_Advances (normal) 34.216 33.016 - Load_Advances (fast) 0.176 0.176 + * src/base/ftglyph.c, src/base/ftlcdfil.c, src/base/ftstroke.c: + Apply. - [1] ftbench -t 5 -p -s 14 -b a -f 0008 Arial.ttf - [2] ftbench -t 5 -p -s 14 -b a -r 1 -f 0028 Arial.ttf - [3] ftbench -t 5 -p -s 14 -b a -f 000a Arial.ttf - [4] ftbench -t 5 -p -s 14 -b b -f 0008 Arial.ttf +2015-02-16 Werner Lemberg - * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h - (FT_MULFIX_ASSEMBLER): Fix handling for ARMv7. + * include/tttables.h (TT_OS2): `fsType' must be FT_UShort. -2013-06-28 Werner Lemberg +2015-02-16 Werner Lemberg - * docs/CHANGES: Updated. + More minor signedness warning fixes. -2013-06-27 Werner Lemberg + * src/base/ftbbox.c, src/base/ftbitmap.c, src/base/fttrigon.c, + src/base/ftutil.c: Apply. - * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix bitmap width guard. +2015-02-16 Werner Lemberg -2013-06-25 Werner Lemberg + Next round of minor compiler warning fixes. - [cff] Add darkening limit to `darkening-parameters'. + * include/internal/ftrfork.h (FT_RFork_Ref): Change `offset' member + type to `FT_Long'. + (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Add `static' keyword. - * src/cff/cffdrivr.c (cff_property_set): Add check. + * include/internal/ftstream.h (FT_Stream_Pos): Return `FT_ULong'. -2013-06-25 Werner Lemberg + * src/base/ftoutln.c, src/base/ftrfork.c, src/base/ftstream.c: + Signedess fixes. - [cff] Add `darkening-parameters' property. +2015-02-16 Werner Lemberg - * include/freetype/ftcffdrv.h: Document it. + Various minor signedness fixes. - * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle - `darkening-parameters' property. + * include/ftadvanc.h, include/internal/ftobjs.h, + src/base/ftgloadr.c, src/base/ftobjs.c: Apply. - * src/cff/cf2font.h (CF2_FontRec): Add `darkenParams' array. +2015-02-16 Werner Lemberg - * src/cff/cf2font.c (cf2_computeDarkening): Add `darkenParams' - argument and use it. - Update all callers. + New `TYPEOF' macro. - * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Copy - `darken_params' values. + This helps suppress signedness warnings, avoiding issues with + implicit conversion changes. - * src/cff/cffobjs.h (CFF_DriverRec): Add `darken_params' array. + * include/config/ftconfig.h, builds/unix/ftconfig.in, + builds/vms/ftconfig.h (TYPEOF): Define. - * src/cff/cffobjs.c (cff_driver_init): Set default values for - `darken_params'. + * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR), + src/autofit/afwarp.h (AF_WARPER_FLOOR): Use it. -2013-06-25 Werner Lemberg +2015-02-16 Werner Lemberg - [docmaker] Code shuffling. + * src/base/ftsystem.c: Use casts in standard C function wrappers. + (ft_alloc, ft_realloc, ft_ansi_stream_io, FT_Stream_Open): Do it. - * src/tools/docmaker/tohtml.py (re_url): Move regexp... - * src/tools/docmaker/sources.py: ... to this file. +2015-02-16 Werner Lemberg -2013-06-25 Werner Lemberg + Fix Savannah bug #44261. - [docmaker] Remove unused functions. + * builds/unix/detect.mk (setup) [unix]: Set `CONFIG_SHELL' in the + environment also while calling the configure script. - * src/tools/docmaker/content.py (DocMarkup.get_start, - DocBlock.get_markup_name): Removed. - * src/tools/docmaker/tohtml.py (html_quote0, dump_html_code, - HtmlFormatter.make_html_words): Removed. +2015-02-16 Werner Lemberg -2013-06-25 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. - * builds/freetype.mk (dll): Remove target. +2015-02-15 Werner Lemberg - Problem reported by Jörg Günnewig . + [base] Clean up signedness issues in `ftdbgmem.c'. -2013-06-25 Werner Lemberg + Also fix other minor issues. - [docmaker] Recognise URLs. + * 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. - * src/tools/docmaker/tohtml.py (re_url): New regular expression. - (make_html_para): Use it. + (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. -2013-06-19 Werner Lemberg + (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. - * Version 2.5.0.1 released. - =========================== +2015-02-15 Werner Lemberg + [base] Clean up signedness in arithmetic functions. - Tag sources with `VER-2-5-0-1'. + This makes the code more readable and reduces compiler warnings. - * include/freetype/config/ftoption.h: Undefine - CFF_CONFIG_OPTION_OLD_ENGINE. - * devel/ftoption.h: Define CFF_CONFIG_OPTION_OLD_ENGINE. + * 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. -2013-06-19 Werner Lemberg +2015-02-07 Werner Lemberg - * builds/unix/install.mk (install): Don't create `cache' directory. + [sfnt] Fix Savannah bug #44184. - Found by Peter Breitenlohner . + * 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. -2013-06-19 Werner Lemberg +2015-02-06 Jon Anderson - * Version 2.5.0 released. - ========================= + [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. - Tag sources with `VER-2-5-0'. +2015-02-06 Werner Lemberg - * docs/VERSION.DLL: Update documentation and bump version number to - 2.5.0. - - * README, Jamfile (RefDoc), - builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, - builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, - builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, - builds/win32/visualc/freetype.dsp, - builds/win32/visualc/freetype.vcproj, - builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, - builds/win32/visualce/freetype.vcproj, - builds/win32/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.4.12/2.5.0/, s/2412/250/. + [autofit] Fix potential memory leak. - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 5. - (FREETYPE_PATCH): Set to 0. + 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). - * builds/unix/configure.raw (version_info): Set to 16:2:10. + It certainly doesn't harm since it is similar to already existing + checks in the code for embedded arrays. - * src/base/ftobjs.c (FT_Open_Face): Pacify compiler. - * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIRP): Ditto. + * src/autofit/afhints.c (af_glyph_hints_reload): Set `max_contours' + and `max_points' for all cases. -2013-06-18 Werner Lemberg +2015-01-31 Werner Lemberg - Fix Savannah bug #39269. + [autofit] Add support for Thai script. - * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Free memory in - case of reacollocation failures. + Thanks to Ben Mitchell for guidance with blue + zone characters! -2013-06-18 Andrew Church + * src/autofit/afblue.dat: Add blue zone data for Thai. - Fix Savannah bug #39266. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. - If memory allocations fail at certain points while opening a font, - FreeType can either crash due to a NULL dereference or leak memory. + * src/autofit/afscript.h: Add Thai standard characters. - * include/freetype/internal/ftobjs.c (FT_Face_InternalRec, - FT_LibraryRec): Make `refcount' a signed integer. If, for example, - FT_Open_Face() fails in a memory allocation before the face's - reference count is set to 1, a subsequent `FT_Done_Library' call - would otherwise loop over `FT_Done_Face' 2^32 times before freeing - the face. + * src/autofit/afranges.c: Add Thai data. - * src/base/ftobjs.c (open_face): Initialize `stream' and friends - earlier. - (FT_Open_Face) : Behave correctly if `node' is NULL. - (FT_Destroy_Module) : Check that `renderer_clazz' is valid. + * src/autofit/afstyles.h: Add Thai data. -2013-06-14 Werner Lemberg +2015-01-23 Behdad Esfahbod - * src/smooth/ftgrays.c One final pragma to silence 64-bit MSVC. + [raster] Handle `FT_RASTER_FLAG_AA' correctly. -2013-06-06 Dave Arnold - Werner Lemberg + This fixes a breakage caused by the commit `[raster] Remove + 5-level gray AA mode from monochrome rasterizer.'. - [cff] Add code to Adobe's engine to handle ppem > 2000. + Problem reported by Markus Trippelsdorf . - * src/cff/cffgload.c (cff_slot_load): If we get - FT_Err_Glyph_Too_Big, retry unhinted and scale up later on. + * src/raster/ftraster.c (ft_black_render): Handle + `FT_RASTER_FLAG_AA'. -2013-06-12 Werner Lemberg + * src/raster/ftrend1.c (ft_raster1_render): Remove gray AA mode + remnants. - Another try on pragmas. +2015-01-18 Werner Lemberg - * include/freetype/internal/ftdebug.h: Move pragmas to... - * include/freetype/internal/internal.h: ... this file since it gets - included by all source files. - * include/freetype/internal/ftserv.h: Remove pragma which has no - effect. + * src/base/ftobjs.c (FT_New_Library): Fix compiler warning. -2013-06-12 Werner Lemberg +2015-01-18 Chris Liddell - * include/freetype/internal/ftdebug.h: Disable MSVC warning C4127. + [raster] Fix Savannah bug #44022. - This partially undoes commit 3f6e0e0c. + Add fallback for glyphs with degenerate bounding boxes. -2013-06-12 Werner Lemberg + 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. - More compiler warning fixes. + This problem can be observed with the `I' glyph (gid 47) in the + Autodesk RomanS TrueType font. - */*: Use cast to `FT_Bool' (or `Bool') where appropriate. + * src/raster/ftrend1.c (ft_raster1_render): Add a fallback if either + dimension is zero to explicitly round up/down (instead of simply + round). -2013-06-10 Werner Lemberg +2015-01-17 Werner Lemberg - [truetype] Improve handling of broken sbit advance widths. + Add some tools to handle yearly copyright notice updates. - * src/truetype/ttgload.c (TT_Load_Glyph): Use the glyph's (scaled) - `linearHoriAdvance' if the sbit's `horiAdvance' value is zero. + 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. - Cf. font `Fixedsys Excelsior' v3.01 (FSEX300.ttf), glyph A, 16ppem. + * 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' -2013-06-10 Werner Lemberg +2015-01-14 Werner Lemberg - [sfnt] Improve embedded bitmap tracing. + * docs/CHANGES: Updated, using a description from Behdad. - * src/base/ftobjs.c (FT_Request_Size): Move trace message regarding - bitmap strike match to... - (FT_Match_Size): This function. +2015-01-14 Behdad Esfahbod - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics, - tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, - tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png, - tt_sbit_decoder_load_image): Decorate with tracing messages. + * src/autofit/afmodule.c (af_autofitter_done): Fix compiler warning. -2013-06-10 Werner Lemberg +2015-01-14 Behdad Esfahbod - Fix Savannah bug #39160. + [autofit] Add embedded array of segments and edges. - * src/truetype/ttinterp.c (Ins_SDPVTL): Set projection vector too - for the degenerate case. + Avoids multiple mallocs per typical glyphs. -2013-06-09 David Turner + 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/cache/ftcmanag.c (FTC_Manager_Reset): Add missing cache flush. + * src/autofit/afhints.h (AF_SEGMENTS_EMBEDDED, AF_EDGES_EMBEDDED): + New macros. + (AF_AxisHintsRec): Add two arrays for segments and edges. - This code, present since eight(!) years in the unused `CACHE' - branch, has been forgotten to apply to the master branch. It's - really amazing that noone has ever complained since - `FTC_Manager_Reset' is pretty useless without flushing the cache. + * 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. -2013-06-07 Werner Lemberg +2015-01-14 Behdad Esfahbod - Add and improve pragmas for MSVC compiler. + [autofit] Add embedded arrays for points and contours. - * include/freetype/internal/ftdebug.h: Remove pragmas. - * include/freetype/internal/ftserv.h: Use push and pop for pragmas. - * include/freetype/internal/ftvalid.h: Handle warning C4324. - * src/base/ftobjs.c: Use push and pop for pragmas. - * src/gzip/ftgzip.c: Handle warning C4244. + This avoids at least two malloc calls for typical glyphs. -2013-06-07 Werner Lemberg + * src/autofit/afhints.h (AF_POINTS_EMBEDDED, AF_CONTOURS_EMBEDDED): + New macros. + (AF_GlyphHintsRec): Add two arrays for contours and points. - [cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/. + * 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. - * src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it. +2015-01-14 Behdad Esfahbod -2013-06-06 Dave Arnold + [autofit] Allocate hints object on the stack. - [cff] Add early exit feature for width-only calls. + This avoids one malloc per load. - This is for `FT_Get_Advance'. + * src/autofit/afloader.h (AF_LoaderRec): Change type of `hints' to + `AF_GlyphHints'. + Update prototype. - There are 7 places where the spec says the width can be defined: + * 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. - hstem/hstemhm - vstem/vstemhm - cntrmask/hintmask - hmoveto - vmoveto - rmoveto - endchar + * src/autofit/afmodule.c (af_autofitter_load_glyph): Use local + `hints' object. - * src/cff/cf2intrp.c (cf2_doStems): Exit early for width-only calls, - if possible. +2015-01-14 Behdad Esfahbod - (cf2_interpT2CharString) , , - , , , - , : Exit early for width-only calls. + [autofit] Reuse slot glyph loader. -2013-06-06 Werner Lemberg + 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. - Next round of compiler fixes. + * 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. - * builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init): - Add proper cast. + * src/autofit/afloader.h (AF_LoaderRec): Remove `gloader' member. + Update prototype. - * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix - cast. - * include/freetype/internal/ftstream.h: Decorate stream and frame - macros with `FT_Long' and `FT_ULong' as appropriate. + * src/autofit/afmodule.c (af_autofitter_load_glyph): Updated. - * src/base/ftrfork.c (raccess_guess_darwin_hfsplus, - raccess_guess_darwin_newvfs): Use cast. +2015-01-14 Behdad Esfahbod - * src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast. + [autofit] Remove (unused) support for composite glyphs. - * src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast. - * src/cache/ftcmanag.h (FTC_ManagerRec): Ditto. + 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. - * src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast. - * src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto. - * src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto. + 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: - * src/cid/cidparse.c (cid_parser_new): Use cast. + /* resolve load flags dependencies */ - * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast. + if ( load_flags & FT_LOAD_NO_RECURSE ) + load_flags |= FT_LOAD_NO_SCALE | + FT_LOAD_IGNORE_TRANSFORM; - * src/psaux/psobjs.c (reallocate_t1_table): Fix argument type. + if ( load_flags & FT_LOAD_NO_SCALE ) + { + load_flags |= FT_LOAD_NO_HINTING | + FT_LOAD_NO_BITMAP; - * src/raster/ftraster.c (ft_black_reset): Use cast. + load_flags &= ~FT_LOAD_RENDER; + } - * src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast. - (ALL_POINTS): Fix cast. + 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/type1/t1driver.c (t1_ps_get_font_value): Add casts. - * src/type1/t1parse.c (T1_Get_Private_Dict): Add cast. + * src/autofit/afloader.c (af_loader_load_g): Remove `depth' + parameter. + : Remove associated code. + (af_loader_load_glyph): Updated. -2013-06-05 Dave Arnold +2015-01-14 Behdad Esfahbod - Fix more MSVC Win32 compiler warnings. + [raster] Fix uninitialized memory access. - * src/base/ftobjs.c: Fix typo in MS pragma. + 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). - * src/base/bdflib.c (_bdf_set_default_spacing, _bdf_add_property): - `lineno' is only used in debug mode. + 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/cff/cf2ft.c (cf2_builder_moveTo): `params' is only used in - debug mode. + * src/raster/ftraster.c (Convert_Glyph): Don't access an + uninitialized `cProfile'. -2013-06-05 Werner Lemberg +2015-01-14 Behdad Esfahbod - Fix compiler warnings. + [smooth] Fix uninitialized memory access. - * include/freetype/internal/ftmemory.h: Decorate memory allocation - macros with `FT_Long' where appropriate. - Remove duplicate of FT_MEM_QRENEW_ARRAY definition. + 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/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use - cast. + * src/smooth/ftgrays.c (gray_raster_render): Initialize + `ras.span_y'. - * src/base/ftobjs.c: Add warning disabling pragma for MSVC while - including `md5.c'. +2015-01-14 Behdad Esfahbod - * src/cff/cf2intrp.c (cf2_interpT2CharString) : Add - cast. + [base] Don't initialize unused `driver->glyph_loader'. - * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts. - (tt_sbit_decoder_load_bitmap): Beautification. + * src/base/ftobjs.c (Destroy_Driver): Don't call + `FT_GlyphLoader_Done'. + (FT_Add_Module): Don't call `FT_GlyphLoader_New'. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize - variables (earlier). +2015-01-14 Behdad Esfahbod - * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler. + [base] Don't allocate `library->raster_pool' anymore. - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants - where appropriate. + It's unused after the following commits: - * src/type1/t1load.c (T1_Get_MM_Var): Ditto. + [raster] Allocate render pool for mono rasterizer on the stack. + [raster] Remove 5-level gray AA mode from monochrome rasterizer. -2013-06-04 Werner Lemberg + 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/cff/cf2font.c (cf2_getGlyphWidth): Initialize `advWidth'. + * src/base/ftobjs.c (FT_New_Library, FT_Done_Library): Implement. - Problem reported by Ingmar Sittl . +2015-01-14 Behdad Esfahbod -2013-06-04 Werner Lemberg + [base] Do not reorder library->renderers upon use. - Apply fixes for cppcheck nitpicks. + Instead of keeping `library->renderers' in a MRU order, just leave + it as-is. The MRU machinery wasn't thread-safe. - http://cppcheck.sourceforge.net/ + With this patch, rasterizing glyphs from different faces from + different threads doesn't fail choosing rasterizer + (FT_Err_Cannot_Render_Glyph). - The call was (from the top-level of the FreeType tree): + Easiest to see that crash was to add a `printf' (or otherwise let + thread yield in FT_Throw with debugging enabled). - cppcheck --force \ - --enable=all \ - -I include \ - -I include/freetype/ \ - -I include/freetype/config/ \ - -I include/freetype/internal/ \ - . &> cppcheck.log + * src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c + (FT_Outline_Render): Don't call `FT_Set_Renderer'. - Note that the current version heavily chokes on FreeType, delivering - many wrong results. I will report those issues to the cppcheck team - so that a newer version gives improved results hopefully. +2015-01-14 Behdad Esfahbod - */* Improve variable scopes. - */* Remove redundant initializations which get overwritten. + [raster] Allocate render pool for mono rasterizer on the stack. - * src/base/ftmac.c, builds/mac/ftmac.c (count_faces_scalable): - Remove unused variable. + 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. - * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero. + With this patch, rasterizing glyphs from different faces from + different threads doesn't crash in the monochrome rasterizer. - * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate): - Remove functionless code. + * src/raster/ftraster.c (black_TRaster): Remove `buffer', + `buffer_size', and `worker' members. - * src/tools/ftrandom.c (main): Fix memory leak. + (ft_black_render): Create `buffer' locally. + (ft_black_reset): Updated. -2013-06-03 Werner Lemberg +2015-01-14 Behdad Esfahbod - Add CFF_CONFIG_OPTION_OLD_ENGINE configuration option. + [raster] Remove 5-level gray AA mode from monochrome rasterizer. - This controls whether the old FreeType CFF engine gets compiled into - FreeType. It is now disabled by default. + 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. - * devel/ftoption.h, include/freetype/config/ftoption.h - (CFF_CONFIG_OPTION_OLD_ENGINE): New macro. + 550 lines down. - * src/cff/cffdrivr.c (cff_property_set), src/cff/cffgload.c - (CFF_Operator, cff_argument_counts, cff_builder_add_point, - cff_operator_seac, cff_decoder_parse_charstrings, cff_slot_load), - src/cff/cffgload.h, src/cff/cffobjs.c (cff_driver_init): Use - CFF_CONFIG_OPTION_OLD_ENGINE to guard the affected code. + * src/raster/ftraster.c (FT_RASTER_OPTION_ANTI_ALIASING, + RASTER_GRAY_LINES): Remove macros and all associated code. - * docs/CHANGES: Updated. + (black_TWorker): Remove `gray_min_x' and `gray_max_x'. + (black_TRaster): Remove `grays' and `gray_width'. -2013-06-02 Werner Lemberg + (Vertical_Sweep_Init, Vertical_Sweep_Span, Vertical_Sweep_Drop, + ft_black_render): Updated. - Fix PNG library handling. + * src/raster/ftrend1.c (ft_raster1_render): Simplify code. + (ft_raster5_renderer_class): Removed. - * builds/unix/configure.raw: Don't use LIBPNG_LIBS but - LIBPNG_LDFLAGS. +2015-01-14 Behdad Esfahbod -2013-05-23 Behdad Esfahbod + [smooth] Allocate render pool for smooth rasterizer on the stack. - Add support for color embedded bitmaps (eg. color emoji). + 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. - A new load flag, FT_LOAD_COLOR, makes FreeType load color - embedded-bitmaps, following this draft specification + With this patch, rasterizing glyphs from different faces from + different threads doesn't crash in the smooth rasterizer. - https://color-emoji.googlecode.com/git/specification/v1.html + Bugs: - which defines two new SFNT tables, `CBDT' and `CBLC' (named and - modeled after `EBDT' and `EBLC', respectively). The color bitmaps - are stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA - pre-multiplied sRGB images. If PNG support is available, PNG color - images as defined in the same proposed specification are supported - also. + 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 - Note that color bitmaps are converted to grayscale if client didn't - ask for color. + * src/smooth/ftgrays.c (gray_TRaster): Remove `buffer', + `buffer_size', `band_size', and `worker' members. - * builds/unix/configure.raw: Search for libpng. - Add `--without-png' option. + (gray_raster_render): Create `buffer', `buffer_size', and + `band_size' locally. + (gray_raster_reset): Updated. - * devel/ftoption.h, include/freetype/config/ftoption.h - (FT_CONFIG_OPTION_USE_PNG): New macro. +2015-01-14 Behdad Esfahbod - * include/freetype/freetype.h (FT_LOAD_COLOR): New load flag. + [truetype] Allocate TT_ExecContext in TT_Size instead of TT_Driver. - * include/freetype/ftimage.h (FT_Pixel_Mode): Add - `FT_PIXEL_MODE_BGRA'. + 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. - * include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags. + With this patch, loading glyphs from different faces from different + threads doesn't crash in the bytecode loader code. - * src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated. - (ft_gray_for_premultiplied_srgb_bgra): New function. - (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA. + * src/truetype/ttobjs.h (TT_SizeRec): Remove `debug' member. + (TT_DriverRec): Remove `context' member. - * src/sfnt/pngshim.c, src/sfnt/pngshim.h: New files. + * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Remove + `TT_ExecContext' code related to a global `TT_Driver' object. - * src/sfnt/sfnt.c: Include `pngshim.c'. + (tt_driver_done): Don't remove `TT_ExecContext' object here but ... + (tt_size_done_bytecode): ... here. - * src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h' - (tt_face_load_eblc): Load `CBLC'. - (tt_sbit_decoder_init): Load `CBDT'. - (tt_sbit_decoder_alloc_bitmap): Pass load flags to select between - color and grayscale bitmaps. - Set `num_grays'. This is used by `ftview' to choose the blending - algorithm. - (tt_sbit_decoder_load_byte_aligned, - tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound, - tt_sbit_decoder_load_image): Pass load flag. - s/write/pwrite/. - Don't call `tt_sbit_decoder_alloc_bitmap'. - Updated. - (tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function. - (tt_sbit_decoder_load_bitmap): Pass load flag. - Handle new glyph formats 17, 18, and 19. - Call `tt_sbit_decoder_alloc_bitmap'. - Flatten color bitmaps if necessary. - (tt_face_load_sbit_image): Updated. + (tt_driver_init): Don't create `TT_ExecContext' object here but ... + (tt_size_init_bytecode): ... here, only on demand. - * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'. + * 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. - * docs/CHANGES: Updated. + * src/truetype/ttinterp.h: Updated. -2013-05-24 Guenter + * src/truetype/ttgload.c (TT_Hint_Glyph, tt_loader_init): Updated. - Apply Savannah patch #8055. +2015-01-14 Behdad Esfahbod - Make `apinames' create an import file for NetWare. + [autofit] Allocate AF_Loader on the stack instead of AF_Module. - * src/tools/apinames.c (PROGRAM_VERSION): Set to 0.2. - (OutputFormat): Add `OUTPUT_NETWARE_IMP'. - (names_dump): Handle it. - (usage): Updated. - (main): Handle new command line flag `-wN'. + Stop sharing a global `AF_Loader'. Allocate one on the stack during + glyph load. -2013-05-23 Behdad Esfahbod + Right now this results in about 25% slowdown, to be fixed in a + following commit. - Compilation fix. + With this patch loading glyphs from different faces from different + threads doesn't immediately crash in the autohinting loader code. - * src/truetype/ttinterp.c (TT_RunIns) - [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Make it work. + Bugs: -2013-05-22 Infinality + https://bugzilla.redhat.com/show_bug.cgi?id=1164941 - [truetype] Formatting and an additional subpixel tweak. + * 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/truetype/ttinterp.c (Ins_SHPIX): Formatting fix. - * src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules): - Revert previous modification for Verdana clones. + * 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. -2013-05-22 Infinality + * src/autofit/afloader.h: Include `afmodule.h'. + Update prototypes. + Move typedef for `AF_Module' to... - [truetype] Adjust subpixel zp2 moves and tweak rules. + * src/autofit/afmodule.h: ... this place. + No longer include `afloader.h'. - These modifications fix thin diagonal stems in some legacy fonts. +2015-01-14 Behdad Esfahbod - * src/truetype/ttinterp.c (Direct_Move_X): Remove unused macro. - (Move_Zp2_Point): Don't always disable x moves for subpixel rendering. - (Ins_SHP): Disable x moves here for subpixel rendering. - (Ins_SHPIX): Only disable x moves in compatibility mode. - Split out zp2 move reversals and reorder conditional respectively. + * src/type42/t42objs.h (T42_DriverRec): Remove unused member. - * src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules): Fix oversight. - Only adjust Verdana clones for 17 ppem. - (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Courier New. - (ALWAYS_SKIP_DELTAP_Rules): Found additional cases for Arial `s'. +2015-01-12 Werner Lemberg -2013-05-20 Infinality + Fix Savannah bug #43976. - [truetype] Simplify and improve subpixel function detection. + 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'. - Some small enhancements have allowed the removal of many macros and - the simplification of existing rules in `ttsubpix.c'. + * 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/truetype/ttsubpix.h (SPH_TWEAK_ALLOW_X_DMOVEX, - SPH_TWEAK_ALLOW_X_MOVE_ZP2, - SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES, - SPH_TWEAK_SKIP_INLINE_DELTAS, SPH_TWEAK_MIRP_CVT_ZERO): Removed. - (SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP): New rule macro. + * src/*/rules.mk (*_COMPILE): Fix order of include directories. - * src/truetype/ttsubpix.c: Updated affected rules. +2015-01-11 Werner Lemberg - * src/truetype/ttinterp.c (Direct_Move_X): Updated. - (INS_FDEF): Add additional function detection. - (INS_ENDF): Set runtime flag. - (Ins_CALL): Skip the call under certain conditions. - Remove bad code. - (Ins_LOOPCALL): Skip the call under certain conditions. - Remove bad code. - (Move_Zp2_Point): Updated. - (Ins_SHPIX): Updated. - Skip the move under some situations. - (Ins_MIAP): Improve conditions. - (Ins_MIRP): Updated. - (Ins_DELTAP): Skip move under certain conditions. - Simplify conditions. - (TT_RunIns): Updated. - Add code to handle new function detection. - Trace messages. + [truetype] Prettyfing. -2013-05-17 Werner Lemberg + * src/truetype/ttinterp.c (project, dualproj, fast_project, + fast_dualproj): Rename to... + (PROJECT, DUALPROJ, FAST_PROJECT, FAST_DUALPROJ): ... this. - Update more FT_Err_XXX macros using FT_ERR and FT_THROW; +2015-01-11 Werner Lemberg - * builds/amiga/src/base/ftsystem.c, builds/mac/ftmac.c, - builds/unix/ftsystem.c, builds/vms/ftsystem.c: Do it. + * src/truetype/ttinterp.c (Ins_JROT, Ins_JROF): Simplify. -2013-05-15 Werner Lemberg + Based on a patch from Behdad. - [truetype] Add `interpreter-version' property. +2015-01-11 Werner Lemberg - This makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable - at runtime. + * src/truetype/ttinterp.c (Ins_SxVTL): Simplify function call. - * include/freetype/ftttdrv.h: New file. +2015-01-11 Werner Lemberg - * include/freetype/config/ftheader.h (FT_TRUETYPE_DRIVER_H): New - macro. + * src/truetype/ttinterp.c (Normalize): Remove unused argument. - * src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H. - (tt_property_set, tt_property_get): Fill templates. +2015-01-11 Werner Lemberg - * src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version' - member. - Remove unused `extension_component' member. + [truetype] More macro expansions. - * src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H. - (tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph, - compute_glyph_metrics, tt_loader_init): Use `interpreter_version'. + * src/truetype/ttinterp.c (FT_UNUSED_EXEC): Remove macro by + expansion. - * src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H. - (SUBPIXEL_HINTING): New macro to check `interpreter_version' flag. - Update all affected functions to use it. - Use TT_INTERPRETER_VERSION_XXX where appropriate. +2015-01-11 Werner Lemberg - * src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H. - (tt_driver_init): Initialize `interpreter_version'. + [truetype] More macro expansions. - * src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H. - Use TT_INTERPRETER_VERSION_XXX where appropriate. + * src/truetype/ttinterp.c (INS_ARG): Remove macro by expansion, + adjusting funtion calls where necessary. + (FT_UNUSED_ARG): Removed, no longer needed. -2013-05-13 Werner Lemberg +2015-01-10 Werner Lemberg - [truetype] Avoid empty source file. + [truetype] More macro expansions. - * src/truetype/ttsubpix.c [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: - Provide dummy typedef. + Based on a patch from Behdad. -2013-05-13 Werner Lemberg + * 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. - * src/cff/cf2font.c (cf2_getGlyphWidth): Fix uninitialized variable. +2015-01-10 Werner Lemberg - Fix suggested by Vaibhav Nagarnaik . + [truetype] Remove TT_CONFIG_OPTION_INTERPRETER_SWITCH. -2013-05-13 Brian Nixon + Behdad suggested this code simplification, and nobody objected... - Fix Savannah bug #38970. + * include/config/ftoption.h, devel/ftoption.h + (TT_CONFIG_OPTION_INTERPRETER_SWITCH): Remove. - * src/base/ftdebug.c, builds/win32/ftdebug.c, - builds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c - (ft_debug_init): Don't read past the environment variable FT2_DEBUG. + * src/truetype/ttinterp.c [TT_CONFIG_OPTION_INTERPRETER_SWITCH]: + Remove related code. + (ARRAY_BOUND_ERROR): Use do-while loop. -2013-05-12 Werner Lemberg +2015-01-10 Werner Lemberg - [truetype] Add framework for TrueType properties. + [truetype] More macro expansions. - * src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H. - (tt_property_set, tt_property_get): New functions, still empty. - Define `tt_service_properties' service. - Update `tt_services'. + * src/truetype/ttinterp.c, src/truetype/ttinterp.h (EXEC_ARG_, + EXEC_ARG): Remove by replacing with expansion. - * src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H. - (TT_SERVICE_PROPERTIES_GET): New macro. - (TTModulePIC): Add `tt_service_properties'. +2015-01-10 Werner Lemberg -2013-05-12 Werner Lemberg + [truetype] More macro expansions. - Fix Savannah bug #38967. + Based on a patch from Behdad. - * src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast. + * 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. -2013-05-12 Werner Lemberg + (Cur_Func_project, CUR_Func_dualproj, CUR_fast_project, + CUR_fast_dualproj): Replace with macros `project', `dualproj', + `fast_project', `fast_dualproj'. - Introduce unsigned 64bit type (if available). +2015-01-10 Werner Lemberg - * include/freetype/config/ftconfig.h: Define FT_UINT64 if available. - [FT_LONG64]: Provide FT_UInt64. + [truetype] More macro expansions. - * builds/unix/ftconfig.in: Synchronized. + * src/truetype/ttinterp.c (EXEC_OP_, EXEC_OP): Remove by replacing + with expansion. -2013-05-12 Werner Lemberg +2015-01-10 Werner Lemberg - Fix Savannah bug #38968. + [truetype] Remove code for static TrueType interpreter. - * include/freetype/ftmodapi.h: Add `FT_EXPORT' to - FT_Property_{Set,Get}. - * src/base/ftobjs.c: Add `FT_EXPORT_DEF' to - FT_Property_{Set,Get}. + This is a follow-up patch. -2013-05-10 Werner Lemberg + * src/truetype/ttinterp.c, src/truetype/ttinterp.h + [TT_CONFIG_OPTION_STATIC_INTERPRETER, + TT_CONFIG_OPTION_STATIC_RASTER]: Remove macros and related code. - [sfnt] Clean up bitmap code. +2015-01-10 Werner Lemberg - * src/sfnt/ttsbit.c: Deleted. - * src/sfnt/ttsbit0.c: Renamed to `ttsbit.c'. - * rules.mk (SFNT_DRV_H): Updated. + * src/truetype/ttinterp.c (CUR): Remove by replacing with expansion. -2013-05-10 Werner Lemberg + This starts a series of patches that simplifies the code of the + bytecode interpreter. - */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code. ---------------------------------------------------------------------------- -Copyright 2013-2015 by +Copyright 2015 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/lib/3rdparty/freetype/README b/reactos/lib/3rdparty/freetype/README index ed62e1dee76..f53644dacee 100644 --- a/reactos/lib/3rdparty/freetype/README +++ b/reactos/lib/3rdparty/freetype/README @@ -1,4 +1,4 @@ - FreeType 2.6.1 + FreeType 2.6.2 ============== Homepage: http://www.freetype.org @@ -24,9 +24,9 @@ and download one of the following files. - freetype-doc-2.6.1.tar.bz2 - freetype-doc-2.6.1.tar.gz - ftdoc261.zip + freetype-doc-2.6.2.tar.bz2 + freetype-doc-2.6.2.tar.gz + ftdoc262.zip To view the documentation online, go to diff --git a/reactos/lib/3rdparty/freetype/devel/ftoption.h b/reactos/lib/3rdparty/freetype/devel/ftoption.h index eda772e84a4..f68b3adec6e 100644 --- a/reactos/lib/3rdparty/freetype/devel/ftoption.h +++ b/reactos/lib/3rdparty/freetype/devel/ftoption.h @@ -203,6 +203,17 @@ FT_BEGIN_HEADER #define FT_CONFIG_OPTION_USE_BZIP2 + /*************************************************************************/ + /* */ + /* Define to disable the use of file stream functions and types, FILE, */ + /* fopen() etc. Enables the use of smaller system libraries on embedded */ + /* systems that have multiple system libraries, some with or without */ + /* file stream support, in the cases where file stream support is not */ + /* necessary such as memory loading of font files. */ + /* */ +/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ + + /*************************************************************************/ /* */ /* PNG bitmap support. */ @@ -230,17 +241,6 @@ FT_BEGIN_HEADER #define FT_CONFIG_OPTION_USE_HARFBUZZ - /*************************************************************************/ - /* */ - /* Define to disable the use of file stream functions and types, FILE, */ - /* fopen() etc. Enables the use of smaller system libraries on embedded */ - /* systems that have multiple system libraries, some with or without */ - /* file stream support, in the cases where file stream support is not */ - /* necessary such as memory loading of font files. */ - /* */ -/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ - - /*************************************************************************/ /* */ /* DLL export compilation */ @@ -692,6 +692,24 @@ FT_BEGIN_HEADER #define TT_CONFIG_OPTION_BDF + /*************************************************************************/ + /* */ + /* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */ + /* number of bytecode instructions executed for a single run of the */ + /* bytecode interpreter, needed to prevent infinite loops. You don't */ + /* want to change this except for very special situations (e.g., making */ + /* a library fuzzer spend less time to handle broken fonts). */ + /* */ + /* It is not expected that this value is ever modified by a configuring */ + /* script; instead, it gets surrounded with #ifndef ... #endif so that */ + /* the value can be set as a preprocessor option on the compiler's */ + /* command line. */ + /* */ +#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES +#define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L +#endif + + /*************************************************************************/ /*************************************************************************/ /**** ****/ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h b/reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h index 4970945d153..b481f8fbac5 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h @@ -692,6 +692,24 @@ FT_BEGIN_HEADER #define TT_CONFIG_OPTION_BDF + /*************************************************************************/ + /* */ + /* Option TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES controls the maximum */ + /* number of bytecode instructions executed for a single run of the */ + /* bytecode interpreter, needed to prevent infinite loops. You don't */ + /* want to change this except for very special situations (e.g., making */ + /* a library fuzzer spend less time to handle broken fonts). */ + /* */ + /* It is not expected that this value is ever modified by a configuring */ + /* script; instead, it gets surrounded with #ifndef ... #endif so that */ + /* the value can be set as a preprocessor option on the compiler's */ + /* command line. */ + /* */ +#ifndef TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES +#define TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES 1000000L +#endif + + /*************************************************************************/ /*************************************************************************/ /**** ****/ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/freetype.h b/reactos/lib/3rdparty/freetype/include/freetype/freetype.h index b6247f510f0..41379ea1843 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/freetype.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/freetype.h @@ -2821,9 +2821,6 @@ FT_BEGIN_HEADER * have specified (e.g., the TrueType bytecode interpreter). You can set * @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. * - * Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it - * always implies @FT_LOAD_FORCE_AUTOHINT. - * * @values: * FT_LOAD_TARGET_NORMAL :: * This corresponds to the default hinting algorithm, optimized for @@ -2831,11 +2828,14 @@ FT_BEGIN_HEADER * @FT_LOAD_TARGET_MONO instead. * * FT_LOAD_TARGET_LIGHT :: - * A lighter hinting algorithm for non-monochrome modes. Many - * generated glyphs are more fuzzy but better resemble its original - * shape. A bit like rendering on Mac OS~X. - * - * As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT. + * A lighter hinting algorithm for gray-level modes. Many generated + * glyphs are fuzzier but better resemble their original shape. This + * is achieved by snapping glyphs to the pixel grid only vertically + * (Y-axis), as is done by Microsoft's ClearType and Adobe's + * proprietary font renderer. This preserves inter-glyph spacing in + * horizontal text. The snapping is done either by the native font + * driver if the driver itself and the font support it or by the + * auto-hinter. * * FT_LOAD_TARGET_MONO :: * Strong hinting algorithm that should only be used for monochrome @@ -2942,7 +2942,10 @@ FT_BEGIN_HEADER /* field in the @FT_GlyphSlotRec structure gives the format of the */ /* returned bitmap. */ /* */ - /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity. */ + /* All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity, */ + /* indicating pixel coverage. Use linear alpha blending and gamma */ + /* correction to correctly render non-monochrome glyph bitmaps onto a */ + /* surface; see @FT_Render_Glyph. */ /* */ /* */ /* FT_RENDER_MODE_NORMAL :: */ @@ -3012,6 +3015,83 @@ FT_BEGIN_HEADER /* the glyph image format, finding the relevant renderer, and */ /* invoking it. */ /* */ + /* When FreeType outputs a bitmap of a glyph, it really outputs an */ + /* alpha coverage map. If a pixel is completely covered by a */ + /* filled-in outline, the bitmap contains 0xFF at that pixel, meaning */ + /* that 0xFF/0xFF fraction of that pixel is covered, meaning the */ + /* pixel is 100% black (or 0% bright). If a pixel is only 50% */ + /* covered (value 0x80), the pixel is made 50% black (50% bright or a */ + /* middle shade of grey). 0% covered means 0% black (100% bright or */ + /* white). */ + /* */ + /* On high-DPI screens like on smartphones and tablets, the pixels */ + /* are so small that their chance of being completely covered and */ + /* therefore completely black are fairly good. On the low-DPI */ + /* screens, however, the situation is different. The pixels are too */ + /* large for most of the details of a glyph and shades of gray are */ + /* the norm rather than the exception. */ + /* */ + /* This is relevant because all our screens have a second problem: */ + /* they are not linear. 1~+~1 is not~2. Twice the value does not */ + /* result in twice the brightness. When a pixel is only 50% covered, */ + /* the coverage map says 50% black, and this translates to a pixel */ + /* value of 128 when you use 8~bits per channel (0-255). However, */ + /* this does not translate to 50% brightness for that pixel on our */ + /* sRGB and gamma~2.2 screens. Due to their non-linearity, they */ + /* dwell longer in the darks and only a pixel value of about 186 */ + /* results in 50% brightness – 128 ends up too dark on both bright */ + /* and dark backgrounds. The net result is that dark text looks */ + /* burnt-out, pixely and blotchy on bright background, bright text */ + /* too frail on dark backgrounds, and colored text on colored */ + /* background (for example, red on green) seems to have dark halos or */ + /* `dirt' around it. The situation is especially ugly for diagonal */ + /* stems like in `w' glyph shapes where the quality of FreeType's */ + /* anti-aliasing depends on the correct display of grays. On */ + /* high-DPI screens where smaller, fully black pixels reign supreme, */ + /* this doesn't matter, but on our low-DPI screens with all the gray */ + /* shades, it does. 0% and 100% brightness are the same things in */ + /* linear and non-linear space, just all the shades in-between */ + /* aren't. */ + /* */ + /* The blending function for placing text over a background is */ + /* */ + /* { */ + /* dst = alpha * src + (1 - alpha) * dst , */ + /* } */ + /* */ + /* which is known as the OVER operator. */ + /* */ + /* To correctly composite an antialiased pixel of a glyph onto a */ + /* surface, */ + /* */ + /* 1. take the foreground and background colors (e.g., in sRGB space) */ + /* and apply gamma to get them in a linear space, */ + /* */ + /* 2. use OVER to blend the two linear colors using the glyph pixel */ + /* as the alpha value (remember, the glyph bitmap is an alpha */ + /* coverage bitmap), and */ + /* */ + /* 3. apply inverse gamma to the blended pixel and write it back to */ + /* the image. */ + /* */ + /* Internal testing at Adobe found that a target inverse gamma of~1.8 */ + /* for step~3 gives good results across a wide range of displays with */ + /* an sRGB gamma curve or a similar one. */ + /* */ + /* This process can cost performance. There is an approximation that */ + /* does not need to know about the background color; see */ + /* https://bel.fi/alankila/lcd/ and */ + /* https://bel.fi/alankila/lcd/alpcor.html for details. */ + /* */ + /* *ATTENTION*: Linear blending is even more important when dealing */ + /* with subpixel-rendered glyphs to prevent color-fringing! A */ + /* subpixel-rendered glyph must first be filtered with a filter that */ + /* gives equal weight to the three color primaries and does not */ + /* exceed a sum of 0x100, see section @lcd_filtering. Then the */ + /* only difference to gray linear blending is that subpixel-rendered */ + /* linear blending is done 3~times per pixel: red foreground subpixel */ + /* to red background subpixel and so on for green and blue. */ + /* */ /* */ /* slot :: A handle to the glyph slot containing the image to */ /* convert. */ @@ -4093,7 +4173,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 6 -#define FREETYPE_PATCH 1 +#define FREETYPE_PATCH 2 /*************************************************************************/ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h b/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h index ab39c219952..d0f6445ed1f 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h @@ -439,6 +439,59 @@ FT_BEGIN_HEADER */ + /************************************************************************** + * + * @property: + * no-stem-darkening[autofit] + * + * @description: + * *Experimental* *only,* *requires* *linear* *alpha* *blending* *and* + * *gamma* *correction* + * + * Stem darkening emboldens glyphs at smaller sizes to make them more + * readable on common low-DPI screens when using linear alpha blending + * and gamma correction, see @FT_Render_Glyph. When not using linear + * alpha blending and gamma correction, glyphs will appear heavy and + * fuzzy! + * + * Gamma correction essentially lightens fonts since shades of grey are + * shifted to higher pixel values (=~higher brightness) to match the + * original intention to the reality of our screens. The side-effect is + * that glyphs `thin out'. Mac OS~X and Adobe's proprietary font + * rendering library implement a counter-measure: stem darkening at + * smaller sizes where shades of gray dominate. By emboldening a glyph + * slightly in relation to its pixel size, individual pixels get higher + * coverage of filled-in outlines and are therefore `blacker'. This + * counteracts the `thinning out' of glyphs, making text remain readable + * at smaller sizes. All glyphs that pass through the auto-hinter will + * be emboldened unless this property is set to TRUE. + * + * See the description of the CFF driver for algorithmic details. Total + * consistency with the CFF driver is currently not achieved because the + * emboldening method differs and glyphs must be scaled down on the + * Y-axis to keep outline points inside their precomputed blue zones. + * The smaller the size (especially 9ppem and down), the higher the loss + * of emboldening versus the CFF driver. + * + */ + + + /************************************************************************** + * + * @property: + * darkening-parameters[autofit] + * + * @description: + * *Experimental* *only* + * + * See the description of the CFF driver for details. This + * implementation appropriates the + * CFF_CONFIG_OPTION_DARKENING_PARAMETER_* #defines for consistency. + * Note the differences described in @no-stem-darkening[autofit]. + * + */ + + /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h b/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h index 6c8e416cee3..8500346c877 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h @@ -111,8 +111,8 @@ FT_BEGIN_HEADER * * @order: * hinting-engine - * no-stem-darkening - * darkening-parameters + * no-stem-darkening[cff] + * darkening-parameters[cff] * */ @@ -175,7 +175,7 @@ FT_BEGIN_HEADER /************************************************************************** * * @property: - * no-stem-darkening + * no-stem-darkening[cff] * * @description: * By default, the Adobe CFF engine darkens stems at smaller sizes, @@ -205,7 +205,7 @@ FT_BEGIN_HEADER /************************************************************************** * * @property: - * darkening-parameters + * darkening-parameters[cff] * * @description: * By default, the Adobe CFF engine darkens stems as follows (if the diff --git a/reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h b/reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h index d865da7127c..3bf4e63b569 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h @@ -243,7 +243,7 @@ FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, "no Unicode glyph name found" ) FT_ERRORDEF_( Glyph_Too_Big, 0xA4, - "glyph to big for hinting" ) + "glyph too big for hinting" ) /* BDF errors */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h b/reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h index 4cd999a4b34..653ed3669ee 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h @@ -41,56 +41,78 @@ FT_BEGIN_HEADER * LCD Filtering * * @abstract: - * Reduce color fringes of LCD-optimized bitmaps. + * Reduce color fringes of subpixel-rendered bitmaps. * * @description: - * The @FT_Library_SetLcdFilter API can be used to specify a low-pass - * filter, which is then applied to LCD-optimized bitmaps generated - * through @FT_Render_Glyph. This is useful to reduce color fringes - * that would occur with unfiltered rendering. + * Subpixel rendering exploits the color-striped structure of LCD + * pixels, increasing the available resolution in the direction of the + * stripe (usually horizontal RGB) by a factor of~3. Since these + * subpixels are color pixels, using them unfiltered creates severe + * color fringes. Use the @FT_Library_SetLcdFilter API to specify a + * low-pass filter, which is then applied to subpixel-rendered bitmaps + * generated through @FT_Render_Glyph. The filter sacrifices some of + * the higher resolution to reduce color fringes, making the glyph image + * slightly blurrier. Positional improvements will remain. * * Note that no filter is active by default, and that this function is * *not* implemented in default builds of the library. You need to * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file * in order to activate it. * - * FreeType generates alpha coverage maps, which are linear by nature. - * For instance, the value 0x80 in bitmap representation means that - * (within numerical precision) 0x80/0xFF fraction of that pixel is - * covered by the glyph's outline. The blending function for placing - * text over a background is - * - * { - * dst = alpha * src + (1 - alpha) * dst , - * } - * - * which is known as OVER. However, when calculating the output of the - * OVER operator, the source colors should first be transformed to a - * linear color space, then alpha blended in that space, and transformed - * back to the output color space. - * - * When linear light blending is used, the default FIR5 filtering - * weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as - * they have been designed for black on white rendering while lacking - * gamma correction. To preserve color neutrality, weights for a FIR5 - * filter should be chosen according to two free parameters `a' and `c', - * and the FIR weights should be - * - * { - * [a - c, a + c, 2 * a, a + c, a - c] . - * } - * - * This formula generates equal weights for all the color primaries - * across the filter kernel, which makes it colorless. One suggested - * set of weights is - * - * { - * [0x10, 0x50, 0x60, 0x50, 0x10] , - * } - * - * where `a' has value 0x30 and `b' value 0x20. The weights in filter - * may have a sum larger than 0x100, which increases coloration slightly - * but also improves contrast. + * A filter should have two properties: + * + * 1) It should be normalized, meaning the sum of the 5~components + * should be 256 (0x100). It is possible to go above or under this + * target sum, however: going under means tossing out contrast, going + * over means invoking clamping and thereby non-linearities that + * increase contrast somewhat at the expense of greater distortion + * and color-fringing. Contrast is better enhanced through stem + * darkening. + * + * 2) It should be color-balanced, meaning a filter `{~a, b, c, b, a~}' + * where a~+ b~=~c. It distributes the computed coverage for one + * subpixel to all subpixels equally, sacrificing some won resolution + * but drastically reducing color-fringing. Positioning improvements + * remain! Note that color-fringing can only really be minimized + * when using a color-balanced filter and alpha-blending the glyph + * onto a surface in linear space; see @FT_Render_Glyph. + * + * Regarding the form, a filter can be a `boxy' filter or a `beveled' + * filter. Boxy filters are sharper but are less forgiving of non-ideal + * gamma curves of a screen (viewing angles!), beveled filters are + * fuzzier but more tolerant. + * + * Examples: + * + * - [0x10 0x40 0x70 0x40 0x10] is beveled and neither balanced nor + * normalized. + * + * - [0x1A 0x33 0x4D 0x33 0x1A] is beveled and balanced but not + * normalized. + * + * - [0x19 0x33 0x66 0x4c 0x19] is beveled and normalized but not + * balanced. + * + * - [0x00 0x4c 0x66 0x4c 0x00] is boxily beveled and normalized but not + * balanced. + * + * - [0x00 0x55 0x56 0x55 0x00] is boxy, normalized, and almost + * balanced. + * + * - [0x08 0x4D 0x56 0x4D 0x08] is beveled, normalized and, almost + * balanced. + * + * It is important to understand that linear alpha blending and gamma + * correction is critical for correctly rendering glyphs onto surfaces + * without artifacts and even more critical when subpixel rendering is + * involved. + * + * Each of the 3~alpha values (subpixels) is independently used to blend + * one color channel. That is, red alpha blends the red channel of the + * text color with the red channel of the background pixel. The + * distribution of density values by the color-balanced filter assumes + * alpha blending is done in linear space; only then color artifacts + * cancel out. */ @@ -111,10 +133,21 @@ FT_BEGIN_HEADER * The default filter reduces color fringes considerably, at the cost * of a slight blurriness in the output. * + * It is a beveled, normalized, and color-balanced five-tap filter + * that is more forgiving to screens with non-ideal gamma curves and + * viewing angles. Note that while color-fringing is reduced, it can + * only be minimized by using linear alpha blending and gamma + * correction to render glyphs onto surfaces. + * * FT_LCD_FILTER_LIGHT :: - * The light filter is a variant that produces less blurriness at the - * cost of slightly more color fringes than the default one. It might - * be better, depending on taste, your monitor, or your personal vision. + * The light filter is a variant that is sharper at the cost of + * slightly more color fringes than the default one. + * + * It is a boxy, normalized, and color-balanced three-tap filter that + * is less forgiving to screens with non-ideal gamma curves and + * viewing angles. This filter works best when the rendering system + * uses linear alpha blending and gamma correction to render glyphs + * onto surfaces. * * FT_LCD_FILTER_LEGACY :: * This filter corresponds to the original libXft color filter. It @@ -126,14 +159,23 @@ FT_BEGIN_HEADER * This filter is only provided for comparison purposes, and might be * disabled or stay unsupported in the future. * + * FT_LCD_FILTER_LEGACY1 :: + * For historical reasons, the FontConfig library returns a different + * enumeration value for legacy LCD filtering. To make code work that + * (incorrectly) forwards FontConfig's enumeration value to + * @FT_Library_SetLcdFilter without proper mapping, it is thus easiest + * to have another enumeration value, which is completely equal to + * `FT_LCD_FILTER_LEGACY'. + * * @since: - * 2.3.0 + * 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2) */ typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, + FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX /* do not remove */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftmm.h b/reactos/lib/3rdparty/freetype/include/freetype/ftmm.h index 6ef47987e6d..96dd66e1452 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftmm.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/ftmm.h @@ -203,9 +203,13 @@ FT_BEGIN_HEADER /* */ /* axis :: An axis descriptor table. */ /* GX fonts contain slightly more data than MM. */ + /* Memory management of this pointer is done */ + /* internally by FreeType. */ /* */ /* namedstyle :: A named style table. */ /* Only meaningful with GX. */ + /* Memory management of this pointer is done */ + /* internally by FreeType. */ /* */ typedef struct FT_MM_Var_ { @@ -255,7 +259,8 @@ FT_BEGIN_HEADER /* */ /* */ /* amaster :: The Multiple Masters/GX var descriptor. */ - /* Allocates a data structure, which the user must free. */ + /* Allocates a data structure, which the user must */ + /* deallocate with `free' after use. */ /* */ /* */ /* FreeType error code. 0~means success. */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h b/reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h index 544279a68af..89d9347e5b7 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h @@ -111,12 +111,14 @@ FT_BEGIN_HEADER #define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ #define FT_MODULE_STYLER 8 /* this module is a styler */ -#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ +#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ /* scalable fonts */ -#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ +#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ /* support vector outlines */ -#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ +#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ /* own hinter */ +#define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800 /* the driver's hinter */ + /* produces LIGHT hints */ /* deprecated values */ @@ -125,9 +127,10 @@ FT_BEGIN_HEADER #define ft_module_hinter FT_MODULE_HINTER #define ft_module_styler FT_MODULE_STYLER -#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE -#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES -#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER +#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE +#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES +#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER +#define ft_module_driver_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY typedef FT_Pointer FT_Module_Interface; diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h b/reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h index 67ade7e5f94..a76682b0c04 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h @@ -47,7 +47,7 @@ FT_BEGIN_HEADER FT_MulFix_arm( FT_Int32 a, FT_Int32 b ) { - register FT_Int32 t, t2; + FT_Int32 t, t2; __asm @@ -80,7 +80,7 @@ FT_BEGIN_HEADER FT_MulFix_arm( FT_Int32 a, FT_Int32 b ) { - register FT_Int32 t, t2; + FT_Int32 t, t2; __asm__ __volatile__ ( @@ -116,7 +116,7 @@ FT_BEGIN_HEADER FT_MulFix_i386( FT_Int32 a, FT_Int32 b ) { - register FT_Int32 result; + FT_Int32 result; __asm__ __volatile__ ( @@ -152,7 +152,7 @@ FT_BEGIN_HEADER FT_MulFix_i386( FT_Int32 a, FT_Int32 b ) { - register FT_Int32 result; + FT_Int32 result; __asm { diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h b/reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h index da5582dc3fc..9a333fc1dee 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h @@ -506,6 +506,9 @@ FT_BEGIN_HEADER #define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \ FT_MODULE_DRIVER_HAS_HINTER ) +#define FT_DRIVER_HINTS_LIGHTLY( x ) ( FT_MODULE_CLASS( x )->module_flags & \ + FT_MODULE_DRIVER_HINTS_LIGHTLY ) + /*************************************************************************/ /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h b/reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h index 1507a7c57a0..000c5a85977 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h +++ b/reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h @@ -1515,6 +1515,9 @@ FT_BEGIN_HEADER FT_Byte* cursor; FT_Byte* limit; + /* since version 2.6.2 */ + FT_ListRec composites; + } TT_LoaderRec; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c b/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c index 69b93bccbdd..7b1efe217d0 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c @@ -703,6 +703,22 @@ } + /* Extract standard_width from writing system/script specific */ + /* metrics class. */ + + FT_LOCAL_DEF( void ) + af_cjk_get_standard_widths( AF_CJKMetrics metrics, + FT_Pos* stdHW, + FT_Pos* stdVW ) + { + if ( stdHW ) + *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; + + if ( stdVW ) + *stdVW = metrics->axis[AF_DIMENSION_HORZ].standard_width; + } + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -2295,6 +2311,7 @@ (AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init, (AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)af_cjk_get_standard_widths, (AF_WritingSystem_InitHintsFunc) af_cjk_hints_init, (AF_WritingSystem_ApplyHintsFunc) af_cjk_hints_apply @@ -2314,6 +2331,7 @@ (AF_WritingSystem_InitMetricsFunc) NULL, (AF_WritingSystem_ScaleMetricsFunc)NULL, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)NULL, (AF_WritingSystem_InitHintsFunc) NULL, (AF_WritingSystem_ApplyHintsFunc) NULL diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c b/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c index 18dd301d101..9142c78c21c 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c @@ -65,6 +65,7 @@ (AF_WritingSystem_InitMetricsFunc) NULL, (AF_WritingSystem_ScaleMetricsFunc)NULL, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)NULL, (AF_WritingSystem_InitHintsFunc) af_dummy_hints_init, (AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c index b071cc76fb3..f5a39574fbf 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c @@ -350,11 +350,17 @@ (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) ) goto Exit; - globals->face = face; - globals->glyph_count = face->num_glyphs; + globals->face = face; + globals->glyph_count = face->num_glyphs; /* right after the globals structure come the glyph styles */ - globals->glyph_styles = (FT_UShort*)( globals + 1 ); - globals->module = module; + globals->glyph_styles = (FT_UShort*)( globals + 1 ); + globals->module = module; + globals->stem_darkening_for_ppem = 0; + globals->darken_x = 0; + globals->darken_y = 0; + globals->standard_vertical_width = 0; + globals->standard_horizontal_width = 0; + globals->scale_down_factor = 0; #ifdef FT_CONFIG_OPTION_USE_HARFBUZZ globals->hb_font = hb_ft_font_create( face, NULL ); @@ -406,9 +412,16 @@ globals->hb_font = NULL; #endif - globals->glyph_count = 0; - globals->glyph_styles = NULL; /* no need to free this one! */ - globals->face = NULL; + globals->glyph_count = 0; + globals->stem_darkening_for_ppem = 0; + globals->darken_x = 0; + globals->darken_y = 0; + globals->standard_vertical_width = 0; + globals->standard_horizontal_width = 0; + globals->scale_down_factor = 0; + /* no need to free this one! */ + globals->glyph_styles = NULL; + globals->face = NULL; FT_FREE( globals ); } diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h index ffb2f860668..a3112de2c5d 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h @@ -117,6 +117,22 @@ FT_BEGIN_HEADER AF_StyleMetrics metrics[AF_STYLE_MAX]; + /* Compute darkening amount once per size. Use this to check whether */ + /* darken_{x,y} needs to be recomputed. */ + FT_UShort stem_darkening_for_ppem; + /* Copy from e.g. AF_LatinMetrics.axis[AF_DIMENSION_HORZ] */ + /* to compute the darkening amount. */ + FT_Pos standard_vertical_width; + /* Copy from e.g. AF_LatinMetrics.axis[AF_DIMENSION_VERT] */ + /* to compute the darkening amount. */ + FT_Pos standard_horizontal_width; + /* The actual amount to darken a glyph along the X axis. */ + FT_Pos darken_x; + /* The actual amount to darken a glyph along the Y axis. */ + FT_Pos darken_y; + /* Amount to scale down by to keep emboldened points */ + /* on the Y-axis in pre-computed blue zones. */ + FT_Fixed scale_down_factor; AF_Module module; /* to access global properties */ } AF_FaceGlobalsRec; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afhints.c b/reactos/lib/3rdparty/freetype/src/autofit/afhints.c index 37482ebd1f2..56c82200051 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afhints.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afhints.c @@ -219,6 +219,82 @@ #define AF_INDEX_NUM( ptr, base ) (int)( (ptr) ? ( (ptr) - (base) ) : -1 ) + static char* + af_print_idx( char* p, + int idx ) + { + if ( idx == -1 ) + { + p[0] = '-'; + p[1] = '-'; + p[2] = '\0'; + } + else + ft_sprintf( p, "%d", idx ); + + return p; + } + + + static int + af_get_segment_index( AF_GlyphHints hints, + int point_idx, + int dimension ) + { + AF_AxisHints axis = &hints->axis[dimension]; + AF_Point point = hints->points + point_idx; + AF_Segment segments = axis->segments; + AF_Segment limit = segments + axis->num_segments; + AF_Segment segment; + + + for ( segment = segments; segment < limit; segment++ ) + { + if ( segment->first <= segment->last ) + { + if ( point >= segment->first && point <= segment->last ) + break; + } + else + { + AF_Point p = segment->first; + + + for (;;) + { + if ( point == p ) + goto Exit; + + if ( p == segment->last ) + break; + + p = p->next; + } + } + } + + Exit: + if ( segment == limit ) + return -1; + + return (int)( segment - segments ); + } + + + static int + af_get_edge_index( AF_GlyphHints hints, + int segment_idx, + int dimension ) + { + AF_AxisHints axis = &hints->axis[dimension]; + AF_Edge edges = axis->edges; + AF_Segment segment = axis->segments + segment_idx; + + + return segment_idx == -1 ? -1 : AF_INDEX_NUM( segment->edge, edges ); + } + + #ifdef __cplusplus extern "C" { #endif @@ -234,22 +310,39 @@ AF_DUMP(( "Table of points:\n" )); if ( hints->num_points ) - AF_DUMP(( " [ index | xorg | yorg | xscale | yscale" - " | xfit | yfit | flags ]\n" )); + AF_DUMP(( " index hedge hseg vedge vseg flags" + " xorg yorg xscale yscale xfit yfit\n" )); else AF_DUMP(( " (none)\n" )); for ( point = points; point < limit; point++ ) - AF_DUMP(( " [ %5d | %5d | %5d | %6.2f | %6.2f" - " | %5.2f | %5.2f | %c ]\n", - AF_INDEX_NUM( point, points ), + { + int point_idx = AF_INDEX_NUM( point, points ); + int segment_idx_0 = af_get_segment_index( hints, point_idx, 0 ); + int segment_idx_1 = af_get_segment_index( hints, point_idx, 1 ); + + char buf1[16], buf2[16], buf3[16], buf4[16]; + + + AF_DUMP(( " %5d %5s %5s %5s %5s %s " + " %5d %5d %7.2f %7.2f %7.2f %7.2f\n", + point_idx, + af_print_idx( buf1, + af_get_edge_index( hints, segment_idx_1, 1 ) ), + af_print_idx( buf2, segment_idx_1 ), + af_print_idx( buf3, + af_get_edge_index( hints, segment_idx_0, 0 ) ), + af_print_idx( buf4, segment_idx_0 ), + ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? "weak" + : " -- ", + point->fx, point->fy, point->ox / 64.0, point->oy / 64.0, point->x / 64.0, - point->y / 64.0, - ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ')); + point->y / 64.0 )); + } AF_DUMP(( "\n" )); } #ifdef __cplusplus @@ -306,21 +399,23 @@ AF_Segment limit = segments + axis->num_segments; AF_Segment seg; + char buf1[16], buf2[16], buf3[16]; + AF_DUMP(( "Table of %s segments:\n", dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" )); if ( axis->num_segments ) - AF_DUMP(( " [ index | pos | dir | from" - " | to | link | serif | edge" - " | height | extra | flags ]\n" )); + AF_DUMP(( " index pos 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 | %4d | %5d | %4d" - " | %6d | %5d | %11s ]\n", + AF_DUMP(( " %5d %5.2g %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 @@ -328,9 +423,11 @@ af_dir_str( (AF_Direction)seg->dir ), AF_INDEX_NUM( seg->first, points ), AF_INDEX_NUM( seg->last, points ), - AF_INDEX_NUM( seg->link, segments ), - AF_INDEX_NUM( seg->serif, segments ), - AF_INDEX_NUM( seg->edge, edges ), + + af_print_idx( buf1, AF_INDEX_NUM( seg->link, segments ) ), + af_print_idx( buf2, AF_INDEX_NUM( seg->serif, segments ) ), + af_print_idx( buf3, AF_INDEX_NUM( seg->edge, edges ) ), + seg->height, seg->height - ( seg->max_coord - seg->min_coord ), af_edge_flags_to_string( seg->flags ) )); @@ -435,6 +532,8 @@ AF_Edge limit = edges + axis->num_edges; AF_Edge edge; + char buf1[16], buf2[16]; + /* * note: AF_DIMENSION_HORZ corresponds to _vertical_ edges @@ -444,19 +543,20 @@ dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" )); 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 | %4d" - " | %5d | %c | %5.2f | %5.2f | %11s ]\n", + AF_DUMP(( " %5d %5.2g %5s %4s %5s" + " %c %5.2f %5.2f %11s\n", AF_INDEX_NUM( edge, edges ), (int)edge->opos / 64.0, af_dir_str( (AF_Direction)edge->dir ), - AF_INDEX_NUM( edge->link, edges ), - AF_INDEX_NUM( edge->serif, edges ), + af_print_idx( buf1, AF_INDEX_NUM( edge->link, edges ) ), + af_print_idx( buf2, AF_INDEX_NUM( edge->serif, edges ) ), + edge->blue_edge ? 'y' : 'n', edge->opos / 64.0, edge->pos / 64.0, diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afindic.c b/reactos/lib/3rdparty/freetype/src/autofit/afindic.c index 05b6bdd8876..59b14d7e098 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afindic.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afindic.c @@ -89,6 +89,22 @@ } + /* Extract standard_width from writing system/script specific */ + /* metrics class. */ + + static void + af_indic_get_standard_widths( AF_CJKMetrics metrics, + FT_Pos* stdHW, + FT_Pos* stdVW ) + { + if ( stdHW ) + *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; + + if ( stdVW ) + *stdVW = metrics->axis[AF_DIMENSION_HORZ].standard_width; + } + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -108,6 +124,7 @@ (AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init, (AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)af_indic_get_standard_widths, (AF_WritingSystem_InitHintsFunc) af_indic_hints_init, (AF_WritingSystem_ApplyHintsFunc) af_indic_hints_apply @@ -127,6 +144,7 @@ (AF_WritingSystem_InitMetricsFunc) NULL, (AF_WritingSystem_ScaleMetricsFunc)NULL, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)NULL, (AF_WritingSystem_InitHintsFunc) NULL, (AF_WritingSystem_ApplyHintsFunc) NULL diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c index 25c2aee49e8..b4acd6885c2 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c @@ -309,6 +309,8 @@ const char* p = &af_blue_strings[bs->string]; FT_Pos* blue_ref; FT_Pos* blue_shoot; + FT_Pos ascender; + FT_Pos descender; #ifdef FT_DEBUG_LEVEL_TRACE @@ -360,6 +362,8 @@ num_flats = 0; num_rounds = 0; + ascender = 0; + descender = 0; while ( *p ) { @@ -421,20 +425,30 @@ if ( AF_LATIN_IS_TOP_BLUE( bs ) ) { for ( pp = first; pp <= last; pp++ ) + { if ( best_point < 0 || points[pp].y > best_y ) { best_point = pp; best_y = points[pp].y; + ascender = FT_MAX( ascender, best_y + y_offset ); } + else + descender = FT_MIN( descender, points[pp].y + y_offset ); + } } else { for ( pp = first; pp <= last; pp++ ) + { if ( best_point < 0 || points[pp].y < best_y ) { best_point = pp; best_y = points[pp].y; + descender = FT_MIN( descender, best_y + y_offset ); } + else + ascender = FT_MAX( ascender, points[pp].y + y_offset ); + } } if ( best_point != old_best_point ) @@ -807,6 +821,9 @@ } } + blue->ascender = ascender; + blue->descender = descender; + blue->flags = 0; if ( AF_LATIN_IS_TOP_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_TOP; @@ -989,18 +1006,52 @@ #endif if ( dim == AF_DIMENSION_VERT ) { - scale = FT_MulDiv( scale, fitted, scaled ); - - FT_TRACE5(( - "af_latin_metrics_scale_dim:" - " x height alignment (style `%s'):\n" - " " - " 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, - ( fitted - scaled ) * 100 / scaled )); + FT_Pos max_height; + FT_Pos dist; + FT_Fixed new_scale; + + + new_scale = FT_MulDiv( scale, fitted, scaled ); + + /* the scaling should not change the result by more than two pixels */ + max_height = metrics->units_per_em; + + for ( nn = 0; nn < Axis->blue_count; nn++ ) + { + max_height = FT_MAX( max_height, Axis->blues[nn].ascender ); + max_height = FT_MAX( max_height, -Axis->blues[nn].descender ); + } + + dist = FT_ABS( FT_MulFix( max_height, new_scale - scale ) ); + dist &= ~127; + + if ( dist == 0 ) + { + scale = new_scale; + + FT_TRACE5(( + "af_latin_metrics_scale_dim:" + " x height alignment (style `%s'):\n" + " " + " 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, + ( fitted - scaled ) * 100 / scaled )); + } +#ifdef FT_DEBUG_LEVEL_TRACE + else + { + FT_TRACE5(( + "af_latin_metrics_scale_dim:" + " x height alignment (style `%s'):\n" + " " + " excessive vertical scaling abandoned\n" + "\n", + af_style_names[metrics->root.style_class->style] )); + } +#endif } } } @@ -1165,6 +1216,22 @@ } + /* Extract standard_width from writing system/script specific */ + /* metrics class. */ + + FT_LOCAL_DEF( void ) + af_latin_get_standard_widths( AF_LatinMetrics metrics, + FT_Pos* stdHW, + FT_Pos* stdVW ) + { + if ( stdHW ) + *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; + + if ( stdVW ) + *stdVW = metrics->axis[AF_DIMENSION_HORZ].standard_width; + } + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -2960,6 +3027,7 @@ (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init, (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)af_latin_get_standard_widths, (AF_WritingSystem_InitHintsFunc) af_latin_hints_init, (AF_WritingSystem_ApplyHintsFunc) af_latin_hints_apply diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h index 6855492ca3b..dd75ef34172 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h @@ -74,6 +74,8 @@ FT_BEGIN_HEADER { AF_WidthRec ref; AF_WidthRec shoot; + FT_Pos ascender; + FT_Pos descender; FT_UInt flags; } AF_LatinBlueRec, *AF_LatinBlue; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c b/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c index 0380ffc04c1..2fb7d1d3588 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c @@ -693,6 +693,22 @@ } + /* Extract standard_width from writing system/script specific */ + /* metrics class. */ + + FT_LOCAL_DEF( void ) + af_latin2_get_standard_widths( AF_LatinMetrics metrics, + FT_Pos* stdHW, + FT_Pos* stdVW ) + { + if ( stdHW ) + *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width; + + if ( stdVW ) + *stdVW = metrics->axis[AF_DIMENSION_HORZ].standard_width; + } + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -2392,6 +2408,7 @@ (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init, (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale, (AF_WritingSystem_DoneMetricsFunc) NULL, + (AF_WritingSystem_GetStdWidthsFunc)af_latin2_get_standard_widths, (AF_WritingSystem_InitHintsFunc) af_latin2_hints_init, (AF_WritingSystem_ApplyHintsFunc) af_latin2_hints_apply diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afloader.c b/reactos/lib/3rdparty/freetype/src/autofit/afloader.c index 722ffd31ecd..aa5b8fdcbc4 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afloader.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afloader.c @@ -23,6 +23,8 @@ #include "afmodule.h" #include "afpic.h" +#include FT_INTERNAL_CALC_H + /* Initialize glyph loader. */ @@ -76,6 +78,14 @@ } +#define af_intToFixed( i ) \ + ( (FT_Fixed)( (FT_UInt32)(i) << 16 ) ) +#define af_fixedToInt( x ) \ + ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) ) +#define af_floatToFixed( f ) \ + ( (FT_Fixed)( (f) * 65536.0 + 0.5 ) ) + + /* Do the main work of `af_loader_load_glyph'. Note that we never */ /* have to deal with composite glyphs as those get loaded into */ /* FT_GLYPH_FORMAT_OUTLINE by the recursed `FT_Load_Glyph' function. */ @@ -88,6 +98,8 @@ FT_UInt glyph_index, FT_Int32 load_flags ) { + AF_Module module = loader->globals->module; + FT_Error error; FT_Face face = loader->face; AF_StyleMetrics metrics = loader->metrics; @@ -103,6 +115,132 @@ if ( error ) goto Exit; + /* + * Apply stem darkening (emboldening) here before hints are applied to + * the outline. Glyphs are scaled down proportionally to the + * emboldening so that curve points don't fall outside their precomputed + * blue zones. + * + * Any emboldening done by the font driver (e.g., the CFF driver) + * doesn't reach here because the autohinter loads the unprocessed + * glyphs in font units for analysis (functions `af_*_metrics_init_*') + * and then above to prepare it for the rasterizers by itself, + * independently of the font driver. So emboldening must be done here, + * within the autohinter. + * + * All glyphs to be autohinted pass through here one by one. The + * standard widths can therefore change from one glyph to the next, + * depending on what script a glyph is assigned to (each script has its + * own set of standard widths and other metrics). The darkening amount + * must therefore be recomputed for each size and + * `standard_{vertical,horizontal}_width' change. + */ + if ( !module->no_stem_darkening ) + { + AF_FaceGlobals globals = loader->globals; + AF_WritingSystemClass writing_system_class; + + FT_Pos stdVW = 0; + FT_Pos stdHW = 0; + + FT_Bool size_changed = face->size->metrics.x_ppem + != globals->stem_darkening_for_ppem; + + FT_Fixed em_size = af_intToFixed( face->units_per_EM ); + FT_Fixed em_ratio = FT_DivFix( af_intToFixed( 1000 ), em_size ); + + FT_Matrix scale_down_matrix = { 0x10000L, 0, 0, 0x10000L }; + + + /* Skip stem darkening for broken fonts. */ + if ( !face->units_per_EM ) + goto After_Emboldening; + + /* + * We depend on the writing system (script analyzers) to supply + * standard widths for the script of the glyph we are looking at. If + * it can't deliver, stem darkening is effectively disabled. + */ + writing_system_class = + AF_WRITING_SYSTEM_CLASSES_GET[metrics->style_class->writing_system]; + + if ( writing_system_class->style_metrics_getstdw ) + writing_system_class->style_metrics_getstdw( metrics, + &stdHW, + &stdVW ); + else + goto After_Emboldening; + + + if ( size_changed || + ( stdVW > 0 && stdVW != globals->standard_vertical_width ) ) + { + FT_Fixed darken_by_font_units_x, darken_x; + + + darken_by_font_units_x = + af_intToFixed( af_loader_compute_darkening( loader, + face, + stdVW ) ); + darken_x = FT_DivFix( FT_MulFix( darken_by_font_units_x, + face->size->metrics.x_scale ), + em_ratio ); + + globals->standard_vertical_width = stdVW; + globals->stem_darkening_for_ppem = face->size->metrics.x_ppem; + globals->darken_x = af_fixedToInt( darken_x ); + } + + if ( size_changed || + ( stdHW > 0 && stdHW != globals->standard_horizontal_width ) ) + { + FT_Fixed darken_by_font_units_y, darken_y; + + + darken_by_font_units_y = + af_intToFixed( af_loader_compute_darkening( loader, + face, + stdHW ) ); + darken_y = FT_DivFix( FT_MulFix( darken_by_font_units_y, + face->size->metrics.y_scale ), + em_ratio ); + + globals->standard_horizontal_width = stdHW; + globals->stem_darkening_for_ppem = face->size->metrics.x_ppem; + globals->darken_y = af_fixedToInt( darken_y ); + + /* + * Scale outlines down on the Y-axis to keep them inside their blue + * zones. The stronger the emboldening, the stronger the + * downscaling (plus heuristical padding to prevent outlines still + * falling out their zones due to rounding). + * + * Reason: `FT_Outline_Embolden' works by shifting the rightmost + * points of stems farther to the right, and topmost points farther + * up. This positions points on the Y-axis outside their + * pre-computed blue zones and leads to distortion when applying the + * hints in the code further below. Code outside this emboldening + * block doesn't know we are presenting it with modified outlines + * the analyzer didn't see! + * + * An unfortunate side effect of downscaling is that the emboldening + * effect is slightly decreased. The loss becomes more pronounced + * versus the CFF driver at smaller sizes, e.g., at 9ppem and below. + */ + globals->scale_down_factor = + FT_DivFix( em_size - ( darken_by_font_units_y + af_intToFixed( 8 ) ), + em_size ); + } + + FT_Outline_EmboldenXY( &slot->outline, + globals->darken_x, + globals->darken_y ); + + scale_down_matrix.yy = globals->scale_down_factor; + FT_Outline_Transform( &slot->outline, &scale_down_matrix ); + } + + After_Emboldening: loader->transformed = internal->glyph_transformed; if ( loader->transformed ) { @@ -405,4 +543,134 @@ } + /* + * Compute amount of font units the face should be emboldened by, in + * analogy to the CFF driver's `cf2_computeDarkening' function. See there + * for details of the algorithm. + * + * XXX: Currently a crude adaption of the original algorithm. Do better? + */ + FT_LOCAL_DEF( FT_Int32 ) + af_loader_compute_darkening( AF_Loader loader, + FT_Face face, + FT_Pos standard_width ) + { + AF_Module module = loader->globals->module; + + FT_UShort units_per_EM; + FT_Fixed ppem, em_ratio; + FT_Fixed stem_width, stem_width_per_1000, scaled_stem, darken_amount; + FT_Int log_base_2; + FT_Int x1, y1, x2, y2, x3, y3, x4, y4; + + + ppem = FT_MAX( af_intToFixed( 4 ), + af_intToFixed( face->size->metrics.x_ppem ) ); + units_per_EM = face->units_per_EM; + + em_ratio = FT_DivFix( af_intToFixed( 1000 ), + af_intToFixed ( units_per_EM ) ); + if ( em_ratio < af_floatToFixed( .01 ) ) + { + /* If something goes wrong, don't embolden. */ + return 0; + } + + x1 = module->darken_params[0]; + y1 = module->darken_params[1]; + x2 = module->darken_params[2]; + y2 = module->darken_params[3]; + x3 = module->darken_params[4]; + y3 = module->darken_params[5]; + x4 = module->darken_params[6]; + y4 = module->darken_params[7]; + + if ( standard_width <= 0 ) + { + stem_width = af_intToFixed( 75 ); /* taken from cf2font.c */ + stem_width_per_1000 = stem_width; + } + else + { + stem_width = af_intToFixed( standard_width ); + stem_width_per_1000 = FT_MulFix( stem_width, em_ratio ); + } + + log_base_2 = FT_MSB( (FT_UInt32)stem_width_per_1000 ) + + FT_MSB( (FT_UInt32)ppem ); + + if ( log_base_2 >= 46 ) + { + /* possible overflow */ + scaled_stem = af_intToFixed( x4 ); + } + else + scaled_stem = FT_MulFix( stem_width_per_1000, ppem ); + + /* now apply the darkening parameters */ + if ( scaled_stem < af_intToFixed( x1 ) ) + darken_amount = FT_DivFix( af_intToFixed( y1 ), ppem ); + + else if ( scaled_stem < af_intToFixed( x2 ) ) + { + FT_Int xdelta = x2 - x1; + FT_Int ydelta = y2 - y1; + FT_Int x = stem_width_per_1000 - + FT_DivFix( af_intToFixed( x1 ), ppem ); + + + if ( !xdelta ) + goto Try_x3; + + darken_amount = FT_MulDiv( x, ydelta, xdelta ) + + FT_DivFix( af_intToFixed( y1 ), ppem ); + } + + else if ( scaled_stem < af_intToFixed( x3 ) ) + { + Try_x3: + { + FT_Int xdelta = x3 - x2; + FT_Int ydelta = y3 - y2; + FT_Int x = stem_width_per_1000 - + FT_DivFix( af_intToFixed( x2 ), ppem ); + + + if ( !xdelta ) + goto Try_x4; + + darken_amount = FT_MulDiv( x, ydelta, xdelta ) + + FT_DivFix( af_intToFixed( y2 ), ppem ); + } + } + + else if ( scaled_stem < af_intToFixed( x4 ) ) + { + Try_x4: + { + FT_Int xdelta = x4 - x3; + FT_Int ydelta = y4 - y3; + FT_Int x = stem_width_per_1000 - + FT_DivFix( af_intToFixed( x3 ), ppem ); + + + if ( !xdelta ) + goto Use_y4; + + darken_amount = FT_MulDiv( x, ydelta, xdelta ) + + FT_DivFix( af_intToFixed( y3 ), ppem ); + } + } + + else + { + Use_y4: + darken_amount = FT_DivFix( af_intToFixed( y4 ), ppem ); + } + + /* Convert darken_amount from per 1000 em to true character space. */ + return af_fixedToInt( FT_DivFix( darken_amount, em_ratio ) ); + } + + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afloader.h b/reactos/lib/3rdparty/freetype/src/autofit/afloader.h index 37cfd142393..4c4affcd2ce 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afloader.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afloader.h @@ -75,6 +75,11 @@ FT_BEGIN_HEADER FT_UInt gindex, FT_Int32 load_flags ); + FT_LOCAL_DEF( FT_Int32 ) + af_loader_compute_darkening( AF_Loader loader, + FT_Face face, + FT_Pos standard_width ); + /* */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afmodule.c b/reactos/lib/3rdparty/freetype/src/autofit/afmodule.c index f19a295b9f2..9a48e153d41 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afmodule.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afmodule.c @@ -177,6 +177,46 @@ 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 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]; + + + if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 || + y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 || + x1 > x2 || x2 > x3 || x3 > x4 || + y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 ) + return FT_THROW( Invalid_Argument ); + + module->darken_params[0] = x1; + module->darken_params[1] = y1; + module->darken_params[2] = x2; + module->darken_params[3] = y2; + module->darken_params[4] = x3; + module->darken_params[5] = y3; + module->darken_params[6] = x4; + module->darken_params[7] = y4; + + return error; + } + else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) + { + FT_Bool* no_stem_darkening = (FT_Bool*)value; + + + module->no_stem_darkening = *no_stem_darkening; + + return error; + } FT_TRACE0(( "af_property_set: missing property `%s'\n", property_name )); @@ -253,6 +293,33 @@ return error; } #endif /* AF_CONFIG_OPTION_USE_WARPER */ + else if ( !ft_strcmp( property_name, "darkening-parameters" ) ) + { + FT_Int* darken_params = module->darken_params; + FT_Int* val = (FT_Int*)value; + + + val[0] = darken_params[0]; + val[1] = darken_params[1]; + val[2] = darken_params[2]; + val[3] = darken_params[3]; + val[4] = darken_params[4]; + val[5] = darken_params[5]; + val[6] = darken_params[6]; + val[7] = darken_params[7]; + + return error; + } + else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) + { + FT_Bool no_stem_darkening = module->no_stem_darkening; + FT_Bool* val = (FT_Bool*)value; + + + *val = no_stem_darkening; + + return error; + } FT_TRACE0(( "af_property_get: missing property `%s'\n", property_name )); @@ -262,8 +329,8 @@ FT_DEFINE_SERVICE_PROPERTIESREC( af_service_properties, - (FT_Properties_SetFunc)af_property_set, - (FT_Properties_GetFunc)af_property_get ) + (FT_Properties_SetFunc)af_property_set, /* set_property */ + (FT_Properties_GetFunc)af_property_get ) /* get_property */ FT_DEFINE_SERVICEDESCREC1( @@ -299,11 +366,21 @@ AF_Module module = (AF_Module)ft_module; - module->fallback_style = AF_STYLE_FALLBACK; - module->default_script = AF_SCRIPT_DEFAULT; + module->fallback_style = AF_STYLE_FALLBACK; + module->default_script = AF_SCRIPT_DEFAULT; #ifdef AF_CONFIG_OPTION_USE_WARPER - module->warping = 0; + module->warping = 0; #endif + module->no_stem_darkening = TRUE; + + module->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1; + module->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1; + module->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2; + module->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2; + module->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3; + module->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3; + module->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4; + module->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4; return FT_Err_Ok; } diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afmodule.h b/reactos/lib/3rdparty/freetype/src/autofit/afmodule.h index b9c2fd8a2d0..3c61d895674 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afmodule.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afmodule.h @@ -41,6 +41,8 @@ FT_BEGIN_HEADER #ifdef AF_CONFIG_OPTION_USE_WARPER FT_Bool warping; #endif + FT_Bool no_stem_darkening; + FT_Int darken_params[8]; } AF_ModuleRec, *AF_Module; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h b/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h index 43b38006c2c..cbe8bc23b1b 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h @@ -211,6 +211,11 @@ extern void* _af_debug_hints; typedef void (*AF_WritingSystem_DoneMetricsFunc)( AF_StyleMetrics metrics ); + typedef void + (*AF_WritingSystem_GetStdWidthsFunc)( AF_StyleMetrics metrics, + FT_Pos* stdHW, + FT_Pos* stdVW ); + typedef FT_Error (*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints hints, @@ -276,6 +281,7 @@ extern void* _af_debug_hints; AF_WritingSystem_InitMetricsFunc style_metrics_init; AF_WritingSystem_ScaleMetricsFunc style_metrics_scale; AF_WritingSystem_DoneMetricsFunc style_metrics_done; + AF_WritingSystem_GetStdWidthsFunc style_metrics_getstdw; AF_WritingSystem_InitHintsFunc style_hints_init; AF_WritingSystem_ApplyHintsFunc style_hints_apply; @@ -489,6 +495,7 @@ extern void* _af_debug_hints; m_init, \ m_scale, \ m_done, \ + m_stdw, \ h_init, \ h_apply ) \ FT_CALLBACK_TABLE_DEF \ @@ -501,6 +508,7 @@ extern void* _af_debug_hints; m_init, \ m_scale, \ m_done, \ + m_stdw, \ \ h_init, \ h_apply \ @@ -570,16 +578,17 @@ extern void* _af_debug_hints; FT_LOCAL_DEF( void ) \ FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \ { \ - ac->writing_system = system; \ + ac->writing_system = system; \ \ - ac->style_metrics_size = m_size; \ + ac->style_metrics_size = m_size; \ \ - ac->style_metrics_init = m_init; \ - ac->style_metrics_scale = m_scale; \ - ac->style_metrics_done = m_done; \ + ac->style_metrics_init = m_init; \ + ac->style_metrics_scale = m_scale; \ + ac->style_metrics_done = m_done; \ + ac->style_metrics_getstdw = m_stdw; \ \ - ac->style_hints_init = h_init; \ - ac->style_hints_apply = h_apply; \ + ac->style_hints_init = h_init; \ + ac->style_hints_apply = h_apply; \ } diff --git a/reactos/lib/3rdparty/freetype/src/base/ftdbgmem.c b/reactos/lib/3rdparty/freetype/src/base/ftdbgmem.c index 6f20313b345..02eeb01d669 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftdbgmem.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftdbgmem.c @@ -462,7 +462,7 @@ (FT_UInt32)( 5 * _ft_debug_lineno ); pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS]; - for ( ;; ) + for (;;) { node = *pnode; if ( node == NULL ) diff --git a/reactos/lib/3rdparty/freetype/src/base/ftglyph.c b/reactos/lib/3rdparty/freetype/src/base/ftglyph.c index cb7fc37787e..2778743aeff 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftglyph.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftglyph.c @@ -125,10 +125,10 @@ FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph; - cbox->xMin = glyph->left << 6; - cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width << 6 ); - cbox->yMax = glyph->top << 6; - cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows << 6 ); + cbox->xMin = glyph->left * 64; + cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width * 64 ); + cbox->yMax = glyph->top * 64; + cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows * 64 ); } @@ -403,9 +403,9 @@ if ( error ) goto Exit; - /* copy advance while converting it to 16.16 format */ - glyph->advance.x = slot->advance.x << 10; - glyph->advance.y = slot->advance.y << 10; + /* copy advance while converting 26.6 to 16.16 format */ + glyph->advance.x = slot->advance.x * 1024; + glyph->advance.y = slot->advance.y * 1024; /* now import the image from the glyph slot */ error = clazz->glyph_init( glyph, slot ); diff --git a/reactos/lib/3rdparty/freetype/src/base/ftlcdfil.c b/reactos/lib/3rdparty/freetype/src/base/ftlcdfil.c index ff6f7e98ceb..5ee7e0aa2bb 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftlcdfil.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftlcdfil.c @@ -305,12 +305,10 @@ FT_Library_SetLcdFilter( FT_Library library, FT_LcdFilter filter ) { + static const FT_Byte default_filter[5] = + { 0x08, 0x4d, 0x56, 0x4d, 0x08 }; static const FT_Byte light_filter[5] = { 0x00, 0x55, 0x56, 0x55, 0x00 }; - /* the values here sum up to a value larger than 256, */ - /* providing a cheap gamma correction */ - static const FT_Byte default_filter[5] = - { 0x10, 0x40, 0x70, 0x40, 0x10 }; if ( !library ) @@ -354,6 +352,7 @@ #ifdef USE_LEGACY case FT_LCD_FILTER_LEGACY: + case FT_LCD_FILTER_LEGACY1: library->lcd_filter_func = _ft_lcd_filter_legacy; library->lcd_extra = 0; break; diff --git a/reactos/lib/3rdparty/freetype/src/base/ftobjs.c b/reactos/lib/3rdparty/freetype/src/base/ftobjs.c index f0c2e77fccf..ea40396413e 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftobjs.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftobjs.c @@ -55,7 +55,18 @@ #pragma warning( disable : 4244 ) #endif /* _MSC_VER */ - /* it's easiest to include `md5.c' directly */ + /* It's easiest to include `md5.c' directly. However, since OpenSSL */ + /* also provides the same functions, there might be conflicts if */ + /* both FreeType and OpenSSL are built as static libraries. For */ + /* this reason, we put the MD5 stuff into the `FT_' namespace. */ +#define MD5_u32plus FT_MD5_u32plus +#define MD5_CTX FT_MD5_CTX +#define MD5_Init FT_MD5_Init +#define MD5_Update FT_MD5_Update +#define MD5_Final FT_MD5_Final + +#undef HAVE_OPENSSL + #include "md5.c" #if defined( _MSC_VER ) @@ -675,7 +686,8 @@ /* check the size of the `fpgm' and `prep' tables, too -- */ /* the assumption is that there don't exist real TTFs where */ /* both `fpgm' and `prep' tables are missing */ - if ( mode == FT_RENDER_MODE_LIGHT || + if ( ( mode == FT_RENDER_MODE_LIGHT && + !FT_DRIVER_HINTS_LIGHTLY( driver ) ) || face->internal->ignore_unpatented_hinter || ( FT_IS_SFNT( face ) && ttface->num_locations && @@ -4156,39 +4168,50 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_bitmap - /* we convert to a single bitmap format for computing the checksum */ - if ( !error ) + /* + * Computing the MD5 checksum is expensive, unnecessarily distorting a + * possible profiling of FreeType if compiled with tracing support. For + * this reason, we execute the following code only if explicitly + * requested. + */ + + /* we use FT_TRACE3 in this block */ + if ( ft_trace_levels[trace_bitmap] >= 3 ) { - FT_Bitmap bitmap; - FT_Error err; + /* we convert to a single bitmap format for computing the checksum */ + if ( !error ) + { + FT_Bitmap bitmap; + FT_Error err; - FT_Bitmap_Init( &bitmap ); + FT_Bitmap_Init( &bitmap ); - /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */ - err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 ); - if ( !err ) - { - MD5_CTX ctx; - unsigned char md5[16]; - int i; - unsigned int rows = bitmap.rows; - unsigned int pitch = (unsigned int)bitmap.pitch; - - - MD5_Init( &ctx ); - MD5_Update( &ctx, bitmap.buffer, rows * pitch ); - MD5_Final( md5, &ctx ); - - FT_TRACE3(( "MD5 checksum for %dx%d bitmap:\n" - " ", - rows, pitch )); - for ( i = 0; i < 16; i++ ) - FT_TRACE3(( "%02X", md5[i] )); - FT_TRACE3(( "\n" )); - } + /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */ + err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 ); + if ( !err ) + { + MD5_CTX ctx; + unsigned char md5[16]; + int i; + unsigned int rows = bitmap.rows; + unsigned int pitch = (unsigned int)bitmap.pitch; + + + MD5_Init( &ctx ); + MD5_Update( &ctx, bitmap.buffer, rows * pitch ); + MD5_Final( md5, &ctx ); + + FT_TRACE3(( "MD5 checksum for %dx%d bitmap:\n" + " ", + rows, pitch )); + for ( i = 0; i < 16; i++ ) + FT_TRACE3(( "%02X", md5[i] )); + FT_TRACE3(( "\n" )); + } - FT_Bitmap_Done( library, &bitmap ); + FT_Bitmap_Done( library, &bitmap ); + } } #undef FT_COMPONENT diff --git a/reactos/lib/3rdparty/freetype/src/base/ftoutln.c b/reactos/lib/3rdparty/freetype/src/base/ftoutln.c index 35cc9f55692..201ceabc681 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftoutln.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftoutln.c @@ -942,6 +942,9 @@ l_in = 0; last = outline->contours[c]; + /* pacify compiler */ + in.x = in.y = anchor.x = anchor.y = 0; + /* Counter j cycles though the points; counter i advances only */ /* when points are moved; anchor k marks the first moved point. */ for ( i = last, j = first, k = -1; @@ -1074,13 +1077,16 @@ FT_Int last = outline->contours[c]; - v_prev = points[last]; + v_prev.x = points[last].x >> xshift; + v_prev.y = points[last].y >> yshift; for ( n = first; n <= last; n++ ) { - v_cur = points[n]; - area += ( ( v_cur.y - v_prev.y ) >> yshift ) * - ( ( v_cur.x + v_prev.x ) >> xshift ); + v_cur.x = points[n].x >> xshift; + v_cur.y = points[n].y >> yshift; + + area += ( v_cur.y - v_prev.y ) * ( v_cur.x + v_prev.x ); + v_prev = v_cur; } diff --git a/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c b/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c index 404af517e57..a381cf68f5a 100644 --- a/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c @@ -824,8 +824,8 @@ THE SOFTWARE. static const FT_Service_BDFRec bdf_service_bdf = { - (FT_BDF_GetCharsetIdFunc)bdf_get_charset_id, - (FT_BDF_GetPropertyFunc) bdf_get_bdf_property + (FT_BDF_GetCharsetIdFunc)bdf_get_charset_id, /* get_charset_id */ + (FT_BDF_GetPropertyFunc) bdf_get_bdf_property /* get_property */ }; @@ -866,32 +866,32 @@ THE SOFTWARE. 0x10000L, 0x20000L, - 0, + 0, /* module-specific interface */ - 0, /* FT_Module_Constructor */ - 0, /* FT_Module_Destructor */ - bdf_driver_requester + 0, /* FT_Module_Constructor module_init */ + 0, /* FT_Module_Destructor module_done */ + bdf_driver_requester /* FT_Module_Requester get_interface */ }, sizeof ( BDF_FaceRec ), sizeof ( FT_SizeRec ), sizeof ( FT_GlyphSlotRec ), - BDF_Face_Init, - BDF_Face_Done, - 0, /* FT_Size_InitFunc */ - 0, /* FT_Size_DoneFunc */ - 0, /* FT_Slot_InitFunc */ - 0, /* FT_Slot_DoneFunc */ + BDF_Face_Init, /* FT_Face_InitFunc init_face */ + BDF_Face_Done, /* FT_Face_DoneFunc done_face */ + 0, /* FT_Size_InitFunc init_size */ + 0, /* FT_Size_DoneFunc done_size */ + 0, /* FT_Slot_InitFunc init_slot */ + 0, /* FT_Slot_DoneFunc done_slot */ - BDF_Glyph_Load, + BDF_Glyph_Load, /* FT_Slot_LoadFunc load_glyph */ - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ + 0, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + 0, /* FT_Face_GetAdvancesFunc get_advances */ - BDF_Size_Request, - BDF_Size_Select + BDF_Size_Request, /* FT_Size_RequestFunc request_size */ + BDF_Size_Select /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/lib/3rdparty/freetype/src/bdf/bdflib.c b/reactos/lib/3rdparty/freetype/src/bdf/bdflib.c index 414deb58ad7..7b40f42ff77 100644 --- a/reactos/lib/3rdparty/freetype/src/bdf/bdflib.c +++ b/reactos/lib/3rdparty/freetype/src/bdf/bdflib.c @@ -201,6 +201,7 @@ #define ACMSG14 "Glyph %ld extra columns removed.\n" #define ACMSG15 "Incorrect glyph count: %ld indicated but %ld found.\n" #define ACMSG16 "Glyph %ld missing columns padded with zero bits.\n" +#define ACMSG17 "Adjusting number of glyphs to %ld.\n" /* Error messages. */ #define ERRMSG1 "[line %ld] Missing `%s' line.\n" @@ -432,6 +433,7 @@ _bdf_list_t list; FT_Memory memory; + unsigned long size; /* the stream size */ } _bdf_parse_t; @@ -1579,6 +1581,13 @@ goto Exit; p->cnt = font->glyphs_size = _bdf_atoul( p->list.field[1], 0, 10 ); + /* We need at least 20 bytes per glyph. */ + if ( p->cnt > p->size / 20 ) + { + p->cnt = font->glyphs_size = p->size / 20; + FT_TRACE2(( "_bdf_parse_glyphs: " ACMSG17, p->cnt )); + } + /* Make sure the number of glyphs is non-zero. */ if ( p->cnt == 0 ) font->glyphs_size = 64; @@ -1641,6 +1650,14 @@ /* Check for the STARTCHAR field. */ if ( _bdf_strncmp( line, "STARTCHAR", 9 ) == 0 ) { + if ( p->flags & _BDF_GLYPH_BITS ) + { + /* Missing ENDCHAR field. */ + FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" )); + error = FT_THROW( Missing_Startchar_Field ); + goto Exit; + } + /* Set the character name in the parse info first until the */ /* encoding can be checked for an unencoded character. */ FT_FREE( p->glyph_name ); @@ -1773,11 +1790,16 @@ glyph = font->unencoded + font->unencoded_used; glyph->name = p->glyph_name; glyph->encoding = (long)font->unencoded_used++; + + /* Reset the initial glyph info. */ + p->glyph_name = NULL; } else + { /* Free up the glyph name if the unencoded shouldn't be */ /* kept. */ FT_FREE( p->glyph_name ); + } p->glyph_name = NULL; } @@ -2447,6 +2469,7 @@ memory = NULL; p->opts = (bdf_options_t*)( ( opts != 0 ) ? opts : &_bdf_opts ); p->minlb = 32767; + p->size = stream->size; p->memory = extmemory; /* only during font creation */ _bdf_list_init( &p->list, extmemory ); @@ -2531,14 +2554,14 @@ /* Error happened while parsing header. */ FT_ERROR(( "bdf_load_font: " ERRMSG2, lineno )); error = FT_THROW( Corrupted_Font_Header ); - goto Exit; + goto Fail; } else { /* Error happened when parsing glyphs. */ FT_ERROR(( "bdf_load_font: " ERRMSG3, lineno )); error = FT_THROW( Corrupted_Font_Glyphs ); - goto Exit; + goto Fail; } } @@ -2569,6 +2592,7 @@ memory = extmemory; + FT_FREE( p->glyph_name ); FT_FREE( p ); } diff --git a/reactos/lib/3rdparty/freetype/src/cache/ftccache.c b/reactos/lib/3rdparty/freetype/src/cache/ftccache.c index d8c5b996819..b82a7890277 100644 --- a/reactos/lib/3rdparty/freetype/src/cache/ftccache.c +++ b/reactos/lib/3rdparty/freetype/src/cache/ftccache.c @@ -576,7 +576,7 @@ FTC_Node* pnode = bucket; - for ( ;; ) + for (;;) { FTC_Node node = *pnode; FT_Bool list_changed = FALSE; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c index d2544a23451..55f3206ac25 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c @@ -544,14 +544,17 @@ /* return 0 on success */ FT_LOCAL_DEF( CF2_Int ) cf2_initGlobalRegionBuffer( CFF_Decoder* decoder, - CF2_UInt idx, + CF2_Int subrNum, CF2_Buffer buf ) { + CF2_UInt idx; + + FT_ASSERT( decoder ); FT_ZERO( buf ); - idx += (CF2_UInt)decoder->globals_bias; + idx = (CF2_UInt)( subrNum + decoder->globals_bias ); if ( idx >= decoder->num_globals ) return TRUE; /* error */ @@ -628,14 +631,17 @@ FT_LOCAL_DEF( CF2_Int ) cf2_initLocalRegionBuffer( CFF_Decoder* decoder, - CF2_UInt idx, + CF2_Int subrNum, CF2_Buffer buf ) { + CF2_UInt idx; + + FT_ASSERT( decoder ); FT_ZERO( buf ); - idx += (CF2_UInt)decoder->locals_bias; + idx = (CF2_UInt)( subrNum + decoder->locals_bias ); if ( idx >= decoder->num_locals ) return TRUE; /* error */ diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.h b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.h index 3073df382f7..98105111b86 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.h +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.h @@ -99,7 +99,7 @@ FT_BEGIN_HEADER FT_LOCAL( CF2_Int ) cf2_initGlobalRegionBuffer( CFF_Decoder* decoder, - CF2_UInt idx, + CF2_Int subrNum, CF2_Buffer buf ); FT_LOCAL( FT_Error ) cf2_getSeacComponent( CFF_Decoder* decoder, @@ -110,7 +110,7 @@ FT_BEGIN_HEADER CF2_Buffer buf ); FT_LOCAL( CF2_Int ) cf2_initLocalRegionBuffer( CFF_Decoder* decoder, - CF2_UInt idx, + CF2_Int subrNum, CF2_Buffer buf ); FT_LOCAL( CF2_Fixed ) diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c index 0e27000210d..bbbe8e3c32a 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c @@ -587,8 +587,9 @@ } /* paired edges must be in proper order */ - FT_ASSERT( !isPair || - topHintEdge->csCoord >= bottomHintEdge->csCoord ); + if ( isPair && + topHintEdge->csCoord < bottomHintEdge->csCoord ) + return; /* linear search to find index value of insertion point */ indexInsert = 0; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c b/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c index ed481092969..fe9d96d075d 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2intrp.c @@ -184,7 +184,7 @@ return; FT_ASSERT( hintmask->byteCount > 0 ); - FT_ASSERT( hintmask->byteCount < + FT_ASSERT( hintmask->byteCount <= sizeof ( hintmask->mask ) / sizeof ( hintmask->mask[0] ) ); /* set mask to all ones */ @@ -752,7 +752,7 @@ case cf2_cmdCALLGSUBR: case cf2_cmdCALLSUBR: { - CF2_UInt subrIndex; + CF2_Int subrNum; FT_TRACE4(( op1 == cf2_cmdCALLGSUBR ? " callgsubr" @@ -772,17 +772,17 @@ (size_t)charstringIndex + 1 ); /* set up the new CFF region and pointer */ - subrIndex = (CF2_UInt)cf2_stack_popInt( opStack ); + subrNum = cf2_stack_popInt( opStack ); switch ( op1 ) { case cf2_cmdCALLGSUBR: FT_TRACE4(( " (idx %d, entering level %d)\n", - subrIndex + (CF2_UInt)decoder->globals_bias, + subrNum + decoder->globals_bias, charstringIndex + 1 )); if ( cf2_initGlobalRegionBuffer( decoder, - subrIndex, + subrNum, charstring ) ) { lastError = FT_THROW( Invalid_Glyph_Format ); @@ -793,11 +793,11 @@ default: /* cf2_cmdCALLSUBR */ FT_TRACE4(( " (idx %d, entering level %d)\n", - subrIndex + (CF2_UInt)decoder->locals_bias, + subrNum + decoder->locals_bias, charstringIndex + 1 )); if ( cf2_initLocalRegionBuffer( decoder, - subrIndex, + subrNum, charstring ) ) { lastError = FT_THROW( Invalid_Glyph_Format ); diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c b/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c index a718b7a0024..9a06b7c8322 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c @@ -358,8 +358,8 @@ FT_DEFINE_SERVICE_GLYPHDICTREC( cff_service_glyph_dict, - (FT_GlyphDict_GetNameFunc) cff_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)cff_get_name_index + (FT_GlyphDict_GetNameFunc) cff_get_glyph_name, /* get_name */ + (FT_GlyphDict_NameIndexFunc)cff_get_name_index /* name_index */ ) @@ -421,11 +421,13 @@ FT_DEFINE_SERVICE_PSINFOREC( cff_service_ps_info, - (PS_GetFontInfoFunc) cff_ps_get_font_info, - (PS_GetFontExtraFunc) NULL, - (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, - (PS_GetFontPrivateFunc)NULL, /* unsupported with CFF fonts */ - (PS_GetFontValueFunc) NULL /* not implemented */ + (PS_GetFontInfoFunc) cff_ps_get_font_info, /* ps_get_font_info */ + (PS_GetFontExtraFunc) NULL, /* ps_get_font_extra */ + (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, /* ps_has_glyph_names */ + /* unsupported with CFF fonts */ + (PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */ + /* not implemented */ + (PS_GetFontValueFunc) NULL /* ps_get_font_value */ ) @@ -444,7 +446,7 @@ /* following the OpenType specification 1.7, we return the name stored */ /* in the `name' table for a CFF wrapped into an SFNT container */ - if ( sfnt ) + if ( FT_IS_SFNT( FT_FACE( face ) ) && sfnt ) { FT_Library library = FT_FACE_LIBRARY( face ); FT_Module sfnt_module = FT_Get_Module( library, "sfnt" ); @@ -464,7 +466,7 @@ FT_DEFINE_SERVICE_PSFONTNAMEREC( cff_service_ps_name, - (FT_PsName_GetFunc)cff_get_ps_name + (FT_PsName_GetFunc)cff_get_ps_name /* get_ps_font_name */ ) @@ -511,7 +513,7 @@ FT_DEFINE_SERVICE_TTCMAPSREC( cff_service_get_cmap_info, - (TT_CMap_Info_GetFunc)cff_get_cmap_info + (TT_CMap_Info_GetFunc)cff_get_cmap_info /* get_cmap_info */ ) @@ -641,9 +643,12 @@ FT_DEFINE_SERVICE_CIDREC( cff_service_cid_info, - (FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros, - (FT_CID_GetIsInternallyCIDKeyedFunc) cff_get_is_cid, - (FT_CID_GetCIDFromGlyphIndexFunc) cff_get_cid_from_glyph_index + (FT_CID_GetRegistryOrderingSupplementFunc) + cff_get_ros, /* get_ros */ + (FT_CID_GetIsInternallyCIDKeyedFunc) + cff_get_is_cid, /* get_is_cid */ + (FT_CID_GetCIDFromGlyphIndexFunc) + cff_get_cid_from_glyph_index /* get_cid_from_glyph_index */ ) @@ -776,8 +781,8 @@ FT_DEFINE_SERVICE_PROPERTIESREC( cff_service_properties, - (FT_Properties_SetFunc)cff_property_set, - (FT_Properties_GetFunc)cff_property_get ) + (FT_Properties_SetFunc)cff_property_set, /* set_property */ + (FT_Properties_GetFunc)cff_property_get ) /* get_property */ /*************************************************************************/ @@ -865,9 +870,10 @@ FT_DEFINE_DRIVER( cff_driver_class, - FT_MODULE_FONT_DRIVER | - FT_MODULE_DRIVER_SCALABLE | - FT_MODULE_DRIVER_HAS_HINTER, + FT_MODULE_FONT_DRIVER | + FT_MODULE_DRIVER_SCALABLE | + FT_MODULE_DRIVER_HAS_HINTER | + FT_MODULE_DRIVER_HINTS_LIGHTLY, sizeof ( CFF_DriverRec ), "cff", @@ -876,31 +882,29 @@ 0, /* module-specific interface */ - cff_driver_init, - cff_driver_done, - cff_get_interface, + cff_driver_init, /* FT_Module_Constructor module_init */ + cff_driver_done, /* FT_Module_Destructor module_done */ + cff_get_interface, /* FT_Module_Requester get_interface */ - /* now the specific driver fields */ sizeof ( TT_FaceRec ), sizeof ( CFF_SizeRec ), sizeof ( CFF_GlyphSlotRec ), - cff_face_init, - cff_face_done, - cff_size_init, - cff_size_done, - cff_slot_init, - cff_slot_done, - - cff_glyph_load, + cff_face_init, /* FT_Face_InitFunc init_face */ + cff_face_done, /* FT_Face_DoneFunc done_face */ + cff_size_init, /* FT_Size_InitFunc init_size */ + cff_size_done, /* FT_Size_DoneFunc done_size */ + cff_slot_init, /* FT_Slot_InitFunc init_slot */ + cff_slot_done, /* FT_Slot_DoneFunc done_slot */ - cff_get_kerning, - 0, /* FT_Face_AttachFunc */ - cff_get_advances, + cff_glyph_load, /* FT_Slot_LoadFunc load_glyph */ - cff_size_request, + cff_get_kerning, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + cff_get_advances, /* FT_Face_GetAdvancesFunc get_advances */ - CFF_SIZE_SELECT + cff_size_request, /* FT_Size_RequestFunc request_size */ + CFF_SIZE_SELECT /* FT_Size_SelectFunc select_size */ ) diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c b/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c index 0e0d5b034b6..d628b68db7c 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c @@ -1052,7 +1052,7 @@ driver->hinting_engine = FT_CFF_HINTING_ADOBE; #endif - driver->no_stem_darkening = FALSE; + driver->no_stem_darkening = TRUE; driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1; driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1; diff --git a/reactos/lib/3rdparty/freetype/src/cid/cidgload.c b/reactos/lib/3rdparty/freetype/src/cid/cidgload.c index 8b15b8a241e..754f7707eec 100644 --- a/reactos/lib/3rdparty/freetype/src/cid/cidgload.c +++ b/reactos/lib/3rdparty/freetype/src/cid/cidgload.c @@ -100,7 +100,7 @@ /* and charstring offset from the CIDMap. */ { FT_UInt entry_len = (FT_UInt)( cid->fd_bytes + cid->gd_bytes ); - FT_ULong off1; + FT_ULong off1, off2; if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset + @@ -108,18 +108,23 @@ FT_FRAME_ENTER( 2 * entry_len ) ) goto Exit; - p = (FT_Byte*)stream->cursor; - fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes ); - off1 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ); - p += cid->fd_bytes; - glyph_length = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1; + p = (FT_Byte*)stream->cursor; + fd_select = cid_get_offset( &p, (FT_Byte)cid->fd_bytes ); + off1 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ); + p += cid->fd_bytes; + off2 = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ); FT_FRAME_EXIT(); - if ( fd_select >= (FT_ULong)cid->num_dicts ) + if ( fd_select >= (FT_ULong)cid->num_dicts || + off2 > stream->size || + off1 > off2 ) { + FT_TRACE0(( "cid_load_glyph: invalid glyph stream offsets\n" )); error = FT_THROW( Invalid_Offset ); goto Exit; } + + glyph_length = off2 - off1; if ( glyph_length == 0 ) goto Exit; if ( FT_ALLOC( charstring, glyph_length ) ) @@ -152,6 +157,12 @@ /* Adjustment for seed bytes. */ cs_offset = decoder->lenIV >= 0 ? (FT_UInt)decoder->lenIV : 0; + if ( cs_offset > glyph_length ) + { + FT_TRACE0(( "cid_load_glyph: invalid glyph stream offsets\n" )); + error = FT_THROW( Invalid_Offset ); + goto Exit; + } /* Decrypt only if lenIV >= 0. */ if ( decoder->lenIV >= 0 ) @@ -162,8 +173,6 @@ glyph_length - cs_offset ); } - FT_FREE( charstring ); - #ifdef FT_CONFIG_OPTION_INCREMENTAL /* Incremental fonts can optionally override the metrics. */ @@ -188,6 +197,8 @@ #endif /* FT_CONFIG_OPTION_INCREMENTAL */ Exit: + FT_FREE( charstring ); + return error; } diff --git a/reactos/lib/3rdparty/freetype/src/cid/cidload.c b/reactos/lib/3rdparty/freetype/src/cid/cidload.c index e23b82f6738..382e3c03cc1 100644 --- a/reactos/lib/3rdparty/freetype/src/cid/cidload.c +++ b/reactos/lib/3rdparty/freetype/src/cid/cidload.c @@ -215,6 +215,7 @@ { CID_FaceInfo cid = &face->cid; FT_Memory memory = face->root.memory; + FT_Stream stream = parser->stream; FT_Error error = FT_Err_Ok; FT_Long num_dicts; @@ -227,6 +228,31 @@ goto Exit; } + /* + * A single entry in the FDArray must (at least) contain the following + * structure elements. + * + * %ADOBeginFontDict 18 + * X dict begin 13 + * /FontMatrix [X X X X] 22 + * /Private X dict begin 22 + * end 4 + * end 4 + * %ADOEndFontDict 16 + * + * This needs 18+13+22+22+4+4+16=99 bytes or more. Normally, you also + * need a `dup X' at the very beginning and a `put' at the end, so a + * rough guess using 100 bytes as the minimum is justified. + */ + if ( (FT_ULong)num_dicts > stream->size / 100 ) + { + FT_TRACE0(( "parse_fd_array: adjusting FDArray size" + " (from %d to %d)\n", + num_dicts, + stream->size / 100 )); + num_dicts = (FT_Long)( stream->size / 100 ); + } + if ( !cid->font_dicts ) { FT_Int n; @@ -395,7 +421,14 @@ cur = parser->root.cursor; } + + if ( !face->cid.num_dicts ) + { + FT_ERROR(( "cid_parse_dict: No font dictionary found\n" )); + return FT_THROW( Invalid_File_Format ); + } } + return parser->root.error; } @@ -428,13 +461,6 @@ FT_Byte* p; - /* Check for possible overflow. */ - if ( num_subrs == FT_UINT_MAX ) - { - error = FT_THROW( Syntax_Error ); - goto Fail; - } - /* reallocate offsets array if needed */ if ( num_subrs + 1 > max_offsets ) { @@ -467,14 +493,25 @@ /* offsets must be ordered */ for ( count = 1; count <= num_subrs; count++ ) if ( offsets[count - 1] > offsets[count] ) + { + FT_ERROR(( "cid_read_subrs: offsets are not ordered\n" )); + error = FT_THROW( Invalid_File_Format ); goto Fail; + } + + if ( offsets[num_subrs] > stream->size - cid->data_offset ) + { + FT_ERROR(( "cid_read_subrs: too large `subrs' offsets\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } /* now, compute the size of subrs charstrings, */ /* allocate, and read them */ data_len = offsets[num_subrs] - offsets[0]; if ( FT_NEW_ARRAY( subr->code, num_subrs + 1 ) || - FT_ALLOC( subr->code[0], data_len ) ) + FT_ALLOC( subr->code[0], data_len ) ) goto Fail; if ( FT_STREAM_SEEK( cid->data_offset + offsets[0] ) || @@ -654,6 +691,12 @@ CID_Parser* parser; FT_Memory memory = face->root.memory; FT_Error error; + FT_Int n; + + CID_FaceInfo cid = &face->cid; + + FT_ULong binary_length; + FT_ULong entry_len; cid_init_loader( &loader, face ); @@ -678,6 +721,17 @@ if ( parser->binary_length ) { + if ( parser->binary_length > + face->root.stream->size - parser->data_offset ) + { + FT_TRACE0(( "cid_face_open: adjusting length of binary data\n" + " (from %d to %d bytes)\n", + parser->binary_length, + face->root.stream->size - parser->data_offset )); + parser->binary_length = face->root.stream->size - + parser->data_offset; + } + /* we must convert the data section from hexadecimal to binary */ if ( FT_ALLOC( face->binary_data, parser->binary_length ) || cid_hex_to_binary( face->binary_data, parser->binary_length, @@ -686,14 +740,95 @@ FT_Stream_OpenMemory( face->cid_stream, face->binary_data, parser->binary_length ); - face->cid.data_offset = 0; + cid->data_offset = 0; } else { - *face->cid_stream = *face->root.stream; - face->cid.data_offset = loader.parser.data_offset; + *face->cid_stream = *face->root.stream; + cid->data_offset = loader.parser.data_offset; + } + + /* sanity tests */ + + if ( cid->fd_bytes < 0 || cid->gd_bytes < 1 ) + { + FT_ERROR(( "cid_parse_dict:" + " Invalid `FDBytes' or `GDBytes' value\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + /* allow at most 32bit offsets */ + if ( cid->fd_bytes > 4 || cid->gd_bytes > 4 ) + { + FT_ERROR(( "cid_parse_dict:" + " Values of `FDBytes' or `GDBytes' larger than 4\n" + " " + " are not supported\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + binary_length = face->cid_stream->size - cid->data_offset; + entry_len = (FT_ULong)( cid->fd_bytes + cid->gd_bytes ); + + for ( n = 0; n < cid->num_dicts; n++ ) + { + CID_FaceDict dict = cid->font_dicts + n; + + + if ( dict->sd_bytes < 0 ) + { + FT_ERROR(( "cid_parse_dict: Invalid `SDBytes' value\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + if ( dict->sd_bytes > 4 ) + { + FT_ERROR(( "cid_parse_dict:" + " Values of `SDBytes' larger than 4" + " are not supported\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + if ( dict->subrmap_offset > binary_length ) + { + FT_ERROR(( "cid_parse_dict: Invalid `SubrMapOffset' value\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + /* `num_subrs' is scanned as a signed integer */ + if ( (FT_Int)dict->num_subrs < 0 || + ( dict->sd_bytes && + dict->num_subrs > ( binary_length - dict->subrmap_offset ) / + (FT_UInt)dict->sd_bytes ) ) + { + FT_ERROR(( "cid_parse_dict: Invalid `SubrCount' value\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + } + + if ( cid->cidmap_offset > binary_length ) + { + FT_ERROR(( "cid_parse_dict: Invalid `CIDMapOffset' value\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + if ( entry_len && + cid->cid_count > + ( binary_length - cid->cidmap_offset ) / entry_len ) + { + FT_ERROR(( "cid_parse_dict: Invalid `CIDCount' value\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; } + /* we can now safely proceed */ error = cid_read_subrs( face ); Exit: diff --git a/reactos/lib/3rdparty/freetype/src/cid/cidriver.c b/reactos/lib/3rdparty/freetype/src/cid/cidriver.c index 07c4cc410ba..17935d0d46a 100644 --- a/reactos/lib/3rdparty/freetype/src/cid/cidriver.c +++ b/reactos/lib/3rdparty/freetype/src/cid/cidriver.c @@ -59,7 +59,7 @@ static const FT_Service_PsFontNameRec cid_service_ps_name = { - (FT_PsName_GetFunc) cid_get_postscript_name + (FT_PsName_GetFunc)cid_get_postscript_name /* get_ps_font_name */ }; @@ -88,11 +88,14 @@ static const FT_Service_PsInfoRec cid_service_ps_info = { - (PS_GetFontInfoFunc) cid_ps_get_font_info, - (PS_GetFontExtraFunc) cid_ps_get_font_extra, - (PS_HasGlyphNamesFunc) NULL, /* unsupported with CID fonts */ - (PS_GetFontPrivateFunc)NULL, /* unsupported */ - (PS_GetFontValueFunc) NULL /* not implemented */ + (PS_GetFontInfoFunc) cid_ps_get_font_info, /* ps_get_font_info */ + (PS_GetFontExtraFunc) cid_ps_get_font_extra, /* ps_get_font_extra */ + /* unsupported with CID fonts */ + (PS_HasGlyphNamesFunc) NULL, /* ps_has_glyph_names */ + /* unsupported */ + (PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */ + /* not implemented */ + (PS_GetFontValueFunc) NULL /* ps_get_font_value */ }; @@ -155,9 +158,12 @@ static const FT_Service_CIDRec cid_service_cid_info = { - (FT_CID_GetRegistryOrderingSupplementFunc)cid_get_ros, - (FT_CID_GetIsInternallyCIDKeyedFunc) cid_get_is_cid, - (FT_CID_GetCIDFromGlyphIndexFunc) cid_get_cid_from_glyph_index + (FT_CID_GetRegistryOrderingSupplementFunc) + cid_get_ros, /* get_ros */ + (FT_CID_GetIsInternallyCIDKeyedFunc) + cid_get_is_cid, /* get_is_cid */ + (FT_CID_GetCIDFromGlyphIndexFunc) + cid_get_cid_from_glyph_index /* get_cid_from_glyph_index */ }; @@ -190,46 +196,42 @@ FT_CALLBACK_TABLE_DEF const FT_Driver_ClassRec t1cid_driver_class = { - /* first of all, the FT_Module_Class fields */ { FT_MODULE_FONT_DRIVER | FT_MODULE_DRIVER_SCALABLE | FT_MODULE_DRIVER_HAS_HINTER, - sizeof ( FT_DriverRec ), + "t1cid", /* module name */ 0x10000L, /* version 1.0 of driver */ 0x20000L, /* requires FreeType 2.0 */ - 0, + 0, /* module-specific interface */ - cid_driver_init, - cid_driver_done, - cid_get_interface + cid_driver_init, /* FT_Module_Constructor module_init */ + cid_driver_done, /* FT_Module_Destructor module_done */ + cid_get_interface /* FT_Module_Requester get_interface */ }, - /* then the other font drivers fields */ sizeof ( CID_FaceRec ), sizeof ( CID_SizeRec ), sizeof ( CID_GlyphSlotRec ), - cid_face_init, - cid_face_done, - - cid_size_init, - cid_size_done, - cid_slot_init, - cid_slot_done, - - cid_slot_load_glyph, + cid_face_init, /* FT_Face_InitFunc init_face */ + cid_face_done, /* FT_Face_DoneFunc done_face */ + cid_size_init, /* FT_Size_InitFunc init_size */ + cid_size_done, /* FT_Size_DoneFunc done_size */ + cid_slot_init, /* FT_Slot_InitFunc init_slot */ + cid_slot_done, /* FT_Slot_DoneFunc done_slot */ - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ + cid_slot_load_glyph, /* FT_Slot_LoadFunc load_glyph */ - 0, /* FT_Face_GetAdvancesFunc */ + 0, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + 0, /* FT_Face_GetAdvancesFunc get_advances */ - cid_size_request, - 0 /* FT_Size_SelectFunc */ + cid_size_request, /* FT_Size_RequestFunc request_size */ + 0 /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmod.c b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmod.c index 17a02e7b8b3..fe8efdf3d93 100644 --- a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmod.c +++ b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmod.c @@ -235,14 +235,14 @@ static const FT_Service_GXvalidateRec gxvalid_interface = { - gxv_validate + gxv_validate /* validate */ }; static const FT_Service_CKERNvalidateRec ckernvalid_interface = { - classic_kern_validate + classic_kern_validate /* validate */ }; diff --git a/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c b/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c index 422035c00b5..27c625420a7 100644 --- a/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c +++ b/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c @@ -691,9 +691,13 @@ } error = FT_Err_Ok; } + + if ( zip_size ) + stream->size = zip_size; + else + stream->size = 0x7FFFFFFFL; /* don't know the real size! */ } - stream->size = 0x7FFFFFFFL; /* don't know the real size! */ stream->pos = 0; stream->base = NULL; stream->read = ft_gzip_stream_io; diff --git a/reactos/lib/3rdparty/freetype/src/otvalid/otvmod.c b/reactos/lib/3rdparty/freetype/src/otvalid/otvmod.c index 92f851398d9..5eb691aa74a 100644 --- a/reactos/lib/3rdparty/freetype/src/otvalid/otvmod.c +++ b/reactos/lib/3rdparty/freetype/src/otvalid/otvmod.c @@ -240,7 +240,7 @@ static const FT_Service_OTvalidateRec otvalid_interface = { - otv_validate + otv_validate /* validate */ }; diff --git a/reactos/lib/3rdparty/freetype/src/pcf/pcf.h b/reactos/lib/3rdparty/freetype/src/pcf/pcf.h index c0da503412c..253a33f7314 100644 --- a/reactos/lib/3rdparty/freetype/src/pcf/pcf.h +++ b/reactos/lib/3rdparty/freetype/src/pcf/pcf.h @@ -226,8 +226,9 @@ FT_BEGIN_HEADER #define GLYPHPADOPTIONS 4 /* I'm not sure about this */ FT_LOCAL( FT_Error ) - pcf_load_font( FT_Stream, - PCF_Face ); + pcf_load_font( FT_Stream stream, + PCF_Face face, + FT_Long face_index ); FT_END_HEADER diff --git a/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c b/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c index 8d2ed7cf4db..0996d107933 100644 --- a/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c @@ -271,7 +271,7 @@ THE SOFTWARE. FT_TRACE2(( "PCF driver\n" )); - error = pcf_load_font( stream, face ); + error = pcf_load_font( stream, face, face_index ); if ( error ) { PCF_Face_Done( pcfface ); @@ -332,7 +332,7 @@ THE SOFTWARE. stream = pcfface->stream; - error = pcf_load_font( stream, face ); + error = pcf_load_font( stream, face, face_index ); if ( error ) goto Fail; @@ -351,7 +351,9 @@ THE SOFTWARE. * an invalid argument error when the font could be * opened by the specified driver. */ - if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 ) + if ( face_index < 0 ) + goto Exit; + else if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 ) { FT_ERROR(( "PCF_Face_Init: invalid face index\n" )); PCF_Face_Done( pcfface ); @@ -657,8 +659,8 @@ THE SOFTWARE. static const FT_Service_BDFRec pcf_service_bdf = { - (FT_BDF_GetCharsetIdFunc)pcf_get_charset_id, - (FT_BDF_GetPropertyFunc) pcf_get_bdf_property + (FT_BDF_GetCharsetIdFunc)pcf_get_charset_id, /* get_charset_id */ + (FT_BDF_GetPropertyFunc) pcf_get_bdf_property /* get_property */ }; @@ -698,32 +700,32 @@ THE SOFTWARE. 0x10000L, 0x20000L, - 0, + 0, /* module-specific interface */ - 0, /* FT_Module_Constructor */ - 0, /* FT_Module_Destructor */ - pcf_driver_requester + 0, /* FT_Module_Constructor module_init */ + 0, /* FT_Module_Destructor module_done */ + pcf_driver_requester /* FT_Module_Requester get_interface */ }, sizeof ( PCF_FaceRec ), sizeof ( FT_SizeRec ), sizeof ( FT_GlyphSlotRec ), - PCF_Face_Init, - PCF_Face_Done, - 0, /* FT_Size_InitFunc */ - 0, /* FT_Size_DoneFunc */ - 0, /* FT_Slot_InitFunc */ - 0, /* FT_Slot_DoneFunc */ + PCF_Face_Init, /* FT_Face_InitFunc init_face */ + PCF_Face_Done, /* FT_Face_DoneFunc done_face */ + 0, /* FT_Size_InitFunc init_size */ + 0, /* FT_Size_DoneFunc done_size */ + 0, /* FT_Slot_InitFunc init_slot */ + 0, /* FT_Slot_DoneFunc done_slot */ - PCF_Glyph_Load, + PCF_Glyph_Load, /* FT_Slot_LoadFunc load_glyph */ - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ + 0, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + 0, /* FT_Face_GetAdvancesFunc get_advances */ - PCF_Size_Request, - PCF_Size_Select + PCF_Size_Request, /* FT_Size_RequestFunc request_size */ + PCF_Size_Select /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c b/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c index afa14807711..fca677f4fb5 100644 --- a/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c +++ b/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c @@ -102,11 +102,22 @@ THE SOFTWARE. FT_STREAM_READ_FIELDS( pcf_toc_header, toc ) ) return FT_THROW( Cannot_Open_Resource ); - if ( toc->version != PCF_FILE_VERSION || - toc->count > FT_ARRAY_MAX( face->toc.tables ) || - toc->count == 0 ) + if ( toc->version != PCF_FILE_VERSION || + toc->count == 0 ) return FT_THROW( Invalid_File_Format ); + if ( stream->size < 16 ) + return FT_THROW( Invalid_File_Format ); + + /* we need 16 bytes per TOC entry */ + if ( toc->count > stream->size >> 4 ) + { + FT_TRACE0(( "pcf_read_TOC: adjusting number of tables" + " (from %d to %d)\n", + toc->count, stream->size >> 4 )); + toc->count = stream->size >> 4; + } + if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) ) return FT_THROW( Out_Of_Memory ); @@ -1173,8 +1184,10 @@ THE SOFTWARE. FT_LOCAL_DEF( FT_Error ) pcf_load_font( FT_Stream stream, - PCF_Face face ) + PCF_Face face, + FT_Long face_index ) { + FT_Face root = FT_FACE( face ); FT_Error error; FT_Memory memory = FT_FACE( face )->memory; FT_Bool hasBDFAccelerators; @@ -1184,6 +1197,13 @@ THE SOFTWARE. if ( error ) goto Exit; + root->num_faces = 1; + root->face_index = 0; + + /* If we are performing a simple font format check, exit immediately. */ + if ( face_index < 0 ) + return FT_Err_Ok; + error = pcf_get_properties( stream, face ); if ( error ) goto Exit; @@ -1226,13 +1246,9 @@ THE SOFTWARE. /* now construct the face object */ { - FT_Face root = FT_FACE( face ); PCF_Property prop; - root->num_faces = 1; - root->face_index = 0; - root->face_flags |= FT_FACE_FLAG_FIXED_SIZES | FT_FACE_FLAG_HORIZONTAL | FT_FACE_FLAG_FAST_GLYPHS; diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c index 88ff55a8064..686edf15f86 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c @@ -130,7 +130,7 @@ } if ( gchar->char_code < char_code ) - min = mid+1; + min = mid + 1; else max = mid; } diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrdrivr.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrdrivr.c index 875374889ce..b0794161dd5 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrdrivr.c @@ -139,9 +139,9 @@ static const FT_Service_PfrMetricsRec pfr_metrics_service_rec = { - pfr_get_metrics, - pfr_face_get_kerning, - pfr_get_advance + pfr_get_metrics, /* get_metrics */ + pfr_face_get_kerning, /* get_kerning */ + pfr_get_advance /* get_advance */ }; @@ -181,31 +181,32 @@ 0x10000L, 0x20000L, - NULL, + 0, /* module-specific interface */ - 0, /* FT_Module_Constructor */ - 0, /* FT_Module_Destructor */ - pfr_get_service + 0, /* FT_Module_Constructor module_init */ + 0, /* FT_Module_Destructor module_done */ + pfr_get_service /* FT_Module_Requester get_interface */ }, sizeof ( PFR_FaceRec ), sizeof ( PFR_SizeRec ), sizeof ( PFR_SlotRec ), - pfr_face_init, - pfr_face_done, - 0, /* FT_Size_InitFunc */ - 0, /* FT_Size_DoneFunc */ - pfr_slot_init, - pfr_slot_done, + pfr_face_init, /* FT_Face_InitFunc init_face */ + pfr_face_done, /* FT_Face_DoneFunc done_face */ + 0, /* FT_Size_InitFunc init_size */ + 0, /* FT_Size_DoneFunc done_size */ + pfr_slot_init, /* FT_Slot_InitFunc init_slot */ + pfr_slot_done, /* FT_Slot_DoneFunc done_slot */ - pfr_slot_load, + pfr_slot_load, /* FT_Slot_LoadFunc load_glyph */ - pfr_get_kerning, - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ - 0, /* FT_Size_RequestFunc */ - 0, /* FT_Size_SelectFunc */ + pfr_get_kerning, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + 0, /* FT_Face_GetAdvancesFunc get_advances */ + + 0, /* FT_Size_RequestFunc request_size */ + 0, /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c index 88df06a03d9..e07c21a0e16 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c @@ -92,8 +92,8 @@ if ( outline->n_contours > 0 ) first = outline->contours[outline->n_contours - 1]; - /* if the last point falls on the same location than the first one */ - /* we need to delete it */ + /* if the last point falls on the same location as the first one */ + /* we need to delete it */ if ( last > first ) { FT_Vector* p1 = outline->points + first; @@ -215,8 +215,10 @@ /* check that there is space for a new contour and a new point */ error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 1 ); if ( !error ) + { /* add new start point */ error = pfr_glyph_line_to( glyph, to ); + } return error; } @@ -304,8 +306,8 @@ glyph->y_control = glyph->x_control + x_count; - mask = 0; - x = 0; + mask = 0; + x = 0; for ( i = 0; i < count; i++ ) { @@ -331,9 +333,9 @@ mask >>= 1; } - /* XXX: for now we ignore the secondary stroke and edge definitions */ - /* since we don't want to support native PFR hinting */ - /* */ + /* XXX: we ignore the secondary stroke and edge definitions */ + /* since we don't support native PFR hinting */ + /* */ if ( flags & PFR_GLYPH_EXTRA_ITEMS ) { error = pfr_extra_items_skip( &p, limit ); @@ -366,27 +368,27 @@ switch ( format >> 4 ) { - case 0: /* end glyph */ + case 0: /* end glyph */ FT_TRACE6(( "- end glyph" )); args_count = 0; break; - case 1: /* general line operation */ + case 1: /* general line operation */ FT_TRACE6(( "- general line" )); goto Line1; - case 4: /* move to inside contour */ + case 4: /* move to inside contour */ FT_TRACE6(( "- move to inside" )); goto Line1; - case 5: /* move to outside contour */ + case 5: /* move to outside contour */ FT_TRACE6(( "- move to outside" )); Line1: args_format = format_low; args_count = 1; break; - case 2: /* horizontal line to */ + case 2: /* horizontal line to */ FT_TRACE6(( "- horizontal line to cx.%d", format_low )); if ( format_low >= x_count ) goto Failure; @@ -396,7 +398,7 @@ args_count = 0; break; - case 3: /* vertical line to */ + case 3: /* vertical line to */ FT_TRACE6(( "- vertical line to cy.%d", format_low )); if ( format_low >= y_count ) goto Failure; @@ -406,19 +408,19 @@ args_count = 0; break; - case 6: /* horizontal to vertical curve */ + case 6: /* horizontal to vertical curve */ FT_TRACE6(( "- hv curve " )); args_format = 0xB8E; args_count = 3; break; - case 7: /* vertical to horizontal curve */ + case 7: /* vertical to horizontal curve */ FT_TRACE6(( "- vh curve" )); args_format = 0xE2B; args_count = 3; break; - default: /* general curve to */ + default: /* general curve to */ FT_TRACE6(( "- general curve" )); args_count = 4; args_format = format_low; @@ -439,14 +441,14 @@ { case 0: /* 8-bit index */ PFR_CHECK( 1 ); - idx = PFR_NEXT_BYTE( p ); + idx = PFR_NEXT_BYTE( p ); if ( idx >= x_count ) goto Failure; cur->x = glyph->x_control[idx]; FT_TRACE7(( " cx#%d", idx )); break; - case 1: /* 16-bit value */ + case 1: /* 16-bit absolute value */ PFR_CHECK( 2 ); cur->x = PFR_NEXT_SHORT( p ); FT_TRACE7(( " x.%d", cur->x )); @@ -516,22 +518,22 @@ /* */ switch ( format >> 4 ) { - case 0: /* end glyph => EXIT */ + case 0: /* end glyph => EXIT */ pfr_glyph_end( glyph ); goto Exit; - case 1: /* line operations */ + case 1: /* line operations */ case 2: case 3: error = pfr_glyph_line_to( glyph, pos ); goto Test_Error; - case 4: /* move to inside contour */ - case 5: /* move to outside contour */ + case 4: /* move to inside contour */ + case 5: /* move to outside contour */ error = pfr_glyph_move_to( glyph, pos ); goto Test_Error; - default: /* curve operations */ + default: /* curve operations */ error = pfr_glyph_curve_to( glyph, pos, pos + 1, pos + 2 ); Test_Error: /* test error condition */ @@ -580,7 +582,8 @@ if ( flags & PFR_GLYPH_EXTRA_ITEMS ) { error = pfr_extra_items_skip( &p, limit ); - if (error) goto Exit; + if ( error ) + goto Exit; } /* we can't rely on the FT_GlyphLoader to load sub-glyphs, because */ diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrload.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrload.c index ec7311df56e..ed8327af8e7 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrload.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrload.c @@ -26,6 +26,93 @@ #define FT_COMPONENT trace_pfr + /* + * The overall structure of a PFR file is as follows. + * + * PFR header + * 58 bytes (contains nPhysFonts) + * + * Logical font directory (size at most 2^16 bytes) + * 2 bytes (nLogFonts) + * + nLogFonts * 5 bytes + * + * ==> nLogFonts <= 13106 + * + * Logical font section (size at most 2^24 bytes) + * nLogFonts * logFontRecord + * + * logFontRecord (size at most 2^16 bytes) + * 12 bytes (fontMatrix) + * + 1 byte (flags) + * + 0-5 bytes (depending on `flags') + * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags') + * + 5 bytes (physical font info) + * + 0-1 bytes (depending on PFR header) + * + * ==> minimum size 18 bytes + * + * Physical font section (size at most 2^24 bytes) + * nPhysFonts * (physFontRecord + * + nBitmapSizes * nBmapChars * bmapCharRecord) + * + * physFontRecord (size at most 2^24 bytes) + * 14 bytes (font info) + * + 1 byte (flags) + * + 0-2 (depending on `flags') + * + 0-? (structure too complicated to be shown here; depending on + * `flags'; contains `nBitmapSizes' and `nBmapChars') + * + 3 bytes (nAuxBytes) + * + nAuxBytes + * + 1 byte (nBlueValues) + * + 2 * nBlueValues + * + 6 bytes (hinting data) + * + 2 bytes (nCharacters) + * + nCharacters * (4-10 bytes) (depending on `flags') + * + * ==> minimum size 27 bytes + * + * bmapCharRecord + * 4-7 bytes + * + * Glyph program strings (three possible types: simpleGps, compoundGps, + * and bitmapGps; size at most 2^24 bytes) + * simpleGps (size at most 2^16 bytes) + * 1 byte (flags) + * 1-2 bytes (n[XY]orus, depending on `flags') + * 0-(64+512*2) = 0-1088 bytes (depending on `n[XY]orus') + * 0-? (structure too complicated to be shown here; depending on + * `flags') + * 1-? glyph data (faintly resembling PS Type 1 charstrings) + * + * ==> minimum size 3 bytes + * + * compoundGps (size at most 2^16 bytes) + * 1 byte (nElements <= 63, flags) + * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags') + * + nElements * (6-14 bytes) + * + * bitmapGps (size at most 2^16 bytes) + * 1 byte (flags) + * 3-13 bytes (position info, depending on `flags') + * 0-? bitmap data + * + * ==> minimum size 4 bytes + * + * PFR trailer + * 8 bytes + * + * + * ==> minimum size of a valid PFR: + * 58 (header) + * + 2 (nLogFonts) + * + 27 (1 physFontRecord) + * + 8 (trailer) + * ----- + * 95 bytes + * + */ + + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -75,7 +162,8 @@ if ( extra->type == item_type ) { error = extra->parser( p, p + item_size, item_data ); - if ( error ) goto Exit; + if ( error ) + goto Exit; break; } @@ -183,7 +271,8 @@ { result = 0; } - return result; + + return result; } @@ -206,8 +295,19 @@ FT_UInt result = 0; - if ( FT_STREAM_SEEK( section_offset ) || FT_READ_USHORT( count ) ) + if ( FT_STREAM_SEEK( section_offset ) || + FT_READ_USHORT( count ) ) + goto Exit; + + /* check maximum value and a rough minimum size */ + if ( count > ( ( 1 << 16 ) - 2 ) / 5 || + 2 + count * 5 >= stream->size - section_offset ) + { + FT_ERROR(( "pfr_log_font_count:" + " invalid number of logical fonts\n" )); + error = FT_THROW( Invalid_Table ); goto Exit; + } result = count; @@ -254,13 +354,14 @@ FT_UInt local; - if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) + if ( FT_STREAM_SEEK( offset ) || + FT_FRAME_ENTER( size ) ) goto Exit; p = stream->cursor; limit = p + size; - PFR_CHECK(13); + PFR_CHECK( 13 ); log_font->matrix[0] = PFR_NEXT_LONG( p ); log_font->matrix[1] = PFR_NEXT_LONG( p ); @@ -308,10 +409,11 @@ if ( flags & PFR_LOG_EXTRA_ITEMS ) { error = pfr_extra_items_skip( &p, limit ); - if (error) goto Fail; + if ( error ) + goto Fail; } - PFR_CHECK(5); + PFR_CHECK( 5 ); log_font->phys_size = PFR_NEXT_USHORT( p ); log_font->phys_offset = PFR_NEXT_ULONG( p ); if ( size_increment ) @@ -358,7 +460,7 @@ PFR_CHECK( 5 ); - p += 3; /* skip bctSize */ + p += 3; /* skip bctSize */ flags0 = PFR_NEXT_BYTE( p ); count = PFR_NEXT_BYTE( p ); @@ -434,12 +536,12 @@ } - /* Load font ID. This is a so-called "unique" name that is rather - * long and descriptive (like "Tiresias ScreenFont v7.51"). + /* Load font ID. This is a so-called `unique' name that is rather + * long and descriptive (like `Tiresias ScreenFont v7.51'). * * Note that a PFR font's family name is contained in an *undocumented* - * string of the "auxiliary data" portion of a physical font record. This - * may also contain the "real" style name! + * string of the `auxiliary data' portion of a physical font record. This + * may also contain the `real' style name! * * If no family name is present, the font ID is used instead for the * family. @@ -525,8 +627,6 @@ FT_Memory memory = phy_font->memory; - FT_TRACE2(( "pfr_extra_item_load_kerning_pairs()\n" )); - if ( FT_NEW( item ) ) goto Exit; @@ -612,7 +712,6 @@ } - static const PFR_ExtraItemRec pfr_phy_font_extra_items[] = { { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info }, @@ -623,7 +722,8 @@ }; - /* Loads a name from the auxiliary data. Since this extracts undocumented + /* + * Load a name from the auxiliary data. Since this extracts undocumented * strings from the font file, we need to be careful here. */ static FT_Error @@ -729,7 +829,8 @@ phy_font->kern_items = NULL; phy_font->kern_items_tail = &phy_font->kern_items; - if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) ) + if ( FT_STREAM_SEEK( offset ) || + FT_FRAME_ENTER( size ) ) goto Exit; phy_font->cursor = stream->cursor; @@ -757,16 +858,16 @@ /* load the extra items when present */ if ( flags & PFR_PHY_EXTRA_ITEMS ) { - error = pfr_extra_items_parse( &p, limit, - pfr_phy_font_extra_items, phy_font ); + error = pfr_extra_items_parse( &p, limit, + pfr_phy_font_extra_items, phy_font ); if ( error ) goto Fail; } - /* In certain fonts, the auxiliary bytes contain interesting */ - /* information. These are not in the specification but can be */ - /* guessed by looking at the content of a few PFR0 fonts. */ + /* In certain fonts, the auxiliary bytes contain interesting */ + /* information. These are not in the specification but can be */ + /* guessed by looking at the content of a few PFR0 fonts. */ PFR_CHECK( 3 ); num_aux = PFR_NEXT_ULONG( p ); @@ -776,7 +877,7 @@ FT_Byte* q2; - PFR_CHECK( num_aux ); + PFR_CHECK_SIZE( num_aux ); p += num_aux; while ( num_aux > 0 ) @@ -797,9 +898,8 @@ switch ( type ) { case 1: - /* this seems to correspond to the font's family name, - * padded to 16-bits with one zero when necessary - */ + /* this seems to correspond to the font's family name, padded to */ + /* an even number of bytes with a zero byte appended if needed */ error = pfr_aux_name_load( q, length - 4U, memory, &phy_font->family_name ); if ( error ) @@ -817,9 +917,8 @@ break; case 3: - /* this seems to correspond to the font's style name, - * padded to 16-bits with one zero when necessary - */ + /* this seems to correspond to the font's style name, padded to */ + /* an even number of bytes with a zero byte appended if needed */ error = pfr_aux_name_load( q, length - 4U, memory, &phy_font->style_name ); if ( error ) @@ -867,9 +966,6 @@ phy_font->num_chars = count = PFR_NEXT_USHORT( p ); phy_font->chars_offset = offset + (FT_Offset)( p - stream->cursor ); - if ( FT_NEW_ARRAY( phy_font->chars, count ) ) - goto Fail; - Size = 1 + 1 + 2; if ( flags & PFR_PHY_2BYTE_CHARCODE ) Size += 1; @@ -886,7 +982,10 @@ if ( flags & PFR_PHY_3BYTE_GPS_OFFSET ) Size += 1; - PFR_CHECK( count * Size ); + PFR_CHECK_SIZE( count * Size ); + + if ( FT_NEW_ARRAY( phy_font->chars, count ) ) + goto Fail; for ( n = 0; n < count; n++ ) { diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrload.h b/reactos/lib/3rdparty/freetype/src/pfr/pfrload.h index 0a512346b63..867e6324090 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrload.h +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrload.h @@ -25,14 +25,19 @@ FT_BEGIN_HEADER + /* some size checks should be always done (mainly to prevent */ + /* excessive allocation for malformed data), ... */ +#define PFR_CHECK_SIZE( x ) do \ + { \ + if ( p + (x) > limit ) \ + goto Too_Short; \ + } while ( 0 ) + + /* ... and some only if intensive checking is explicitly requested */ #ifdef PFR_CONFIG_NO_CHECKS #define PFR_CHECK( x ) do { } while ( 0 ) #else -#define PFR_CHECK( x ) do \ - { \ - if ( p + (x) > limit ) \ - goto Too_Short; \ - } while ( 0 ) +#define PFR_CHECK PFR_CHECK_SIZE #endif #define PFR_NEXT_BYTE( p ) FT_NEXT_BYTE( p ) diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c index b854b00ba83..20d316d6f04 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c @@ -118,9 +118,11 @@ /* load the face */ error = pfr_log_font_load( - &face->log_font, stream, (FT_UInt)( face_index & 0xFFFF ), - face->header.log_dir_offset, - FT_BOOL( face->header.phy_font_max_size_high != 0 ) ); + &face->log_font, + stream, + (FT_UInt)( face_index & 0xFFFF ), + face->header.log_dir_offset, + FT_BOOL( face->header.phy_font_max_size_high != 0 ) ); if ( error ) goto Exit; @@ -141,8 +143,8 @@ pfrface->face_flags |= FT_FACE_FLAG_SCALABLE; - /* if all characters point to the same gps_offset 0, we */ - /* assume that the font only contains bitmaps */ + /* if gps_offset == 0 for all characters, we */ + /* assume that the font only contains bitmaps */ { FT_UInt nn; @@ -164,7 +166,7 @@ } } - if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 ) + if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 ) pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; if ( phy_font->flags & PFR_PHY_VERTICAL ) @@ -178,7 +180,7 @@ if ( phy_font->num_kern_pairs > 0 ) pfrface->face_flags |= FT_FACE_FLAG_KERNING; - /* If no family name was found in the "undocumented" auxiliary + /* If no family name was found in the `undocumented' auxiliary * data, use the font ID instead. This sucks but is better than * nothing. */ @@ -187,7 +189,7 @@ pfrface->family_name = phy_font->font_id; /* note that the style name can be NULL in certain PFR fonts, - * probably meaning "Regular" + * probably meaning `Regular' */ pfrface->style_name = phy_font->style_name; @@ -264,13 +266,13 @@ error = FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL ); #if 0 - /* Select default charmap */ + /* select default charmap */ if ( pfrface->num_charmaps ) pfrface->charmap = pfrface->charmaps[0]; #endif } - /* check whether we've loaded any kerning pairs */ + /* check whether we have loaded any kerning pairs */ if ( phy_font->num_kern_pairs ) pfrface->face_flags |= FT_FACE_FLAG_KERNING; } @@ -402,7 +404,7 @@ pfrslot->linearHoriAdvance = metrics->horiAdvance; pfrslot->linearVertAdvance = metrics->vertAdvance; - /* make-up vertical metrics(?) */ + /* make up vertical metrics(?) */ metrics->vertBearingX = 0; metrics->vertBearingY = 0; @@ -596,4 +598,5 @@ return error; } + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrsbit.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrsbit.c index bb5df5c9f9c..a2196364664 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrsbit.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrsbit.c @@ -37,11 +37,11 @@ typedef struct PFR_BitWriter_ { - FT_Byte* line; /* current line start */ - FT_Int pitch; /* line size in bytes */ - FT_UInt width; /* width in pixels/bits */ - FT_UInt rows; /* number of remaining rows to scan */ - FT_UInt total; /* total number of bits to draw */ + FT_Byte* line; /* current line start */ + FT_Int pitch; /* line size in bytes */ + FT_UInt width; /* width in pixels/bits */ + FT_UInt rows; /* number of remaining rows to scan */ + FT_UInt total; /* total number of bits to draw */ } PFR_BitWriterRec, *PFR_BitWriter; @@ -341,8 +341,8 @@ } - /* load bitmap metrics. "*padvance" must be set to the default value */ - /* before calling this function... */ + /* load bitmap metrics. `*padvance' must be set to the default value */ + /* before calling this function */ /* */ static FT_Error pfr_load_bitmap_metrics( FT_Byte** pdata, @@ -510,8 +510,7 @@ break; default: - FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" )); - error = FT_THROW( Invalid_File_Format ); + ; } } @@ -544,7 +543,7 @@ character = &phys->chars[glyph_index]; - /* Look-up a bitmap strike corresponding to the current */ + /* look up a bitmap strike corresponding to the current */ /* character dimensions */ { FT_UInt n; @@ -555,9 +554,7 @@ { if ( strike->x_ppm == (FT_UInt)size->root.metrics.x_ppem && strike->y_ppm == (FT_UInt)size->root.metrics.y_ppem ) - { goto Found_Strike; - } strike++; } @@ -568,7 +565,7 @@ Found_Strike: - /* Now lookup the glyph's position within the file */ + /* now look up the glyph's position within the file */ { FT_UInt char_len; @@ -578,7 +575,7 @@ if ( strike->flags & 2 ) char_len += 1; if ( strike->flags & 4 ) char_len += 1; - /* Access data directly in the frame to speed lookups */ + /* access data directly in the frame to speed lookups */ if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) || FT_FRAME_ENTER( char_len * strike->num_bitmaps ) ) goto Exit; @@ -595,7 +592,7 @@ if ( gps_size == 0 ) { - /* Could not find a bitmap program string for this glyph */ + /* could not find a bitmap program string for this glyph */ error = FT_THROW( Invalid_Argument ); goto Exit; } @@ -617,8 +614,8 @@ glyph->root.linearHoriAdvance = advance; - /* compute default advance, i.e., scaled advance. This can be */ - /* overridden in the bitmap header of certain glyphs. */ + /* compute default advance, i.e., scaled advance; this can be */ + /* overridden in the bitmap header of certain glyphs */ advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8, character->advance, (FT_Long)phys->metrics_resolution ); @@ -634,6 +631,53 @@ &xsize, &ysize, &advance, &format ); + /* + * Before allocating the target bitmap, we check whether the given + * bitmap dimensions are valid, depending on the image format. + * + * Format 0: We have a stream of pixels (with 8 pixels per byte). + * + * (xsize * ysize + 7) / 8 <= gps_size + * + * Format 1: Run-length encoding; the high nibble holds the number of + * white bits, the low nibble the number of black bits. In + * other words, a single byte can represent at most 15 + * pixels. + * + * xsize * ysize <= 15 * gps_size + * + * Format 2: Run-length encoding; the high byte holds the number of + * white bits, the low byte the number of black bits. In + * other words, two bytes can represent at most 255 pixels. + * + * xsize * ysize <= 255 * (gps_size + 1) / 2 + */ + switch ( format ) + { + case 0: + if ( ( (FT_ULong)xsize * ysize + 7 ) / 8 > gps_size ) + error = FT_THROW( Invalid_Table ); + break; + case 1: + if ( (FT_ULong)xsize * ysize > 15 * gps_size ) + error = FT_THROW( Invalid_Table ); + break; + case 2: + if ( (FT_ULong)xsize * ysize > 255 * ( ( gps_size + 1 ) / 2 ) ) + error = FT_THROW( Invalid_Table ); + break; + default: + FT_ERROR(( "pfr_slot_load_bitmap: invalid image type\n" )); + error = FT_THROW( Invalid_Table ); + } + + if ( error ) + { + if ( FT_ERR_EQ( error, Invalid_Table ) ) + FT_ERROR(( "pfr_slot_load_bitmap: invalid bitmap dimensions\n" )); + goto Exit; + } + /* * XXX: on 16bit systems we return an error for huge bitmaps * that cause size truncation, because truncated @@ -684,14 +728,12 @@ error = ft_glyphslot_alloc_bitmap( &glyph->root, len ); if ( !error ) - { error = pfr_load_bitmap_bits( p, stream->limit, format, FT_BOOL(face->header.color_flags & 2), &glyph->root.bitmap ); - } } } @@ -702,4 +744,5 @@ return error; } + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/psaux/t1decode.c b/reactos/lib/3rdparty/freetype/src/psaux/t1decode.c index 2e199286f6e..5811fcb49cb 100644 --- a/reactos/lib/3rdparty/freetype/src/psaux/t1decode.c +++ b/reactos/lib/3rdparty/freetype/src/psaux/t1decode.c @@ -512,7 +512,7 @@ break; case 12: - if ( ip > limit ) + if ( ip >= limit ) { FT_ERROR(( "t1_decoder_parse_charstrings:" " invalid escape (12+EOF)\n" )); @@ -669,7 +669,7 @@ if ( large_int ) FT_TRACE4(( " %ld", value )); else - FT_TRACE4(( " %ld", Fix2Int( value ) )); + FT_TRACE4(( " %ld", value / 65536 )); #endif *top++ = value; diff --git a/reactos/lib/3rdparty/freetype/src/psnames/psmodule.c b/reactos/lib/3rdparty/freetype/src/psnames/psmodule.c index 0f04c2fa7d2..5406098db33 100644 --- a/reactos/lib/3rdparty/freetype/src/psnames/psmodule.c +++ b/reactos/lib/3rdparty/freetype/src/psnames/psmodule.c @@ -525,31 +525,31 @@ FT_DEFINE_SERVICE_PSCMAPSREC( pscmaps_interface, - (PS_Unicode_ValueFunc) ps_unicode_value, - (PS_Unicodes_InitFunc) ps_unicodes_init, - (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, - (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, + (PS_Unicode_ValueFunc) ps_unicode_value, /* unicode_value */ + (PS_Unicodes_InitFunc) ps_unicodes_init, /* unicodes_init */ + (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index, /* unicodes_char_index */ + (PS_Unicodes_CharNextFunc) ps_unicodes_char_next, /* unicodes_char_next */ - (PS_Macintosh_NameFunc) ps_get_macintosh_name, - (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, + (PS_Macintosh_NameFunc) ps_get_macintosh_name, /* macintosh_name */ + (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, /* adobe_std_strings */ - t1_standard_encoding, - t1_expert_encoding ) + t1_standard_encoding, /* adobe_std_encoding */ + t1_expert_encoding ) /* adobe_expert_encoding */ #else FT_DEFINE_SERVICE_PSCMAPSREC( pscmaps_interface, - NULL, - NULL, - NULL, - NULL, + NULL, /* unicode_value */ + NULL, /* unicodes_init */ + NULL, /* unicodes_char_index */ + NULL, /* unicodes_char_next */ - (PS_Macintosh_NameFunc) ps_get_macintosh_name, - (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, + (PS_Macintosh_NameFunc) ps_get_macintosh_name, /* macintosh_name */ + (PS_Adobe_Std_StringsFunc) ps_get_standard_strings, /* adobe_std_strings */ - t1_standard_encoding, - t1_expert_encoding ) + t1_standard_encoding, /* adobe_std_encoding */ + t1_expert_encoding ) /* adobe_expert_encoding */ #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c b/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c index 6a3f0d99333..5dd84492dee 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c @@ -139,9 +139,9 @@ FT_DEFINE_SERVICE_SFNT_TABLEREC( sfnt_service_sfnt_table, - (FT_SFNT_TableLoadFunc)tt_face_load_any, - (FT_SFNT_TableGetFunc) get_sfnt_table, - (FT_SFNT_TableInfoFunc)sfnt_table_info ) + (FT_SFNT_TableLoadFunc)tt_face_load_any, /* load_table */ + (FT_SFNT_TableGetFunc) get_sfnt_table, /* get_table */ + (FT_SFNT_TableInfoFunc)sfnt_table_info ) /* table_info */ #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES @@ -205,8 +205,8 @@ FT_DEFINE_SERVICE_GLYPHDICTREC( sfnt_service_glyph_dict, - (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index ) + (FT_GlyphDict_GetNameFunc) sfnt_get_glyph_name, /* get_name */ + (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index ) /* name_index */ #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */ @@ -330,7 +330,7 @@ FT_DEFINE_SERVICE_PSFONTNAMEREC( sfnt_service_ps_name, - (FT_PsName_GetFunc)sfnt_get_ps_name ) + (FT_PsName_GetFunc)sfnt_get_ps_name ) /* get_ps_font_name */ /* @@ -338,7 +338,7 @@ */ FT_DEFINE_SERVICE_TTCMAPSREC( tt_service_get_cmap_info, - (TT_CMap_Info_GetFunc)tt_get_cmap_info ) + (TT_CMap_Info_GetFunc)tt_get_cmap_info ) /* get_cmap_info */ #ifdef TT_CONFIG_OPTION_BDF @@ -381,8 +381,8 @@ FT_DEFINE_SERVICE_BDFRec( sfnt_service_bdf, - (FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id, - (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop ) + (FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id, /* get_charset_id */ + (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop ) /* get_property */ #endif /* TT_CONFIG_OPTION_BDF */ diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c b/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c index 14d3adef212..de030eafe16 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c @@ -451,10 +451,14 @@ woff.metaOrigLength != 0 ) ) || ( woff.metaLength != 0 && woff.metaOrigLength == 0 ) || ( woff.privOffset == 0 && woff.privLength != 0 ) ) + { + FT_ERROR(( "woff_font_open: invalid WOFF header\n" )); return FT_THROW( Invalid_Table ); + } - if ( FT_ALLOC( sfnt, woff.totalSfntSize ) || - FT_NEW( sfnt_stream ) ) + /* Don't trust `totalSfntSize' before thorough checks. */ + if ( FT_ALLOC( sfnt, 12 + woff.num_tables * 16UL ) || + FT_NEW( sfnt_stream ) ) goto Exit; sfnt_header = sfnt; @@ -521,6 +525,8 @@ if ( table->Tag <= old_tag ) { FT_FRAME_EXIT(); + + FT_ERROR(( "woff_font_open: table tags are not sorted\n" )); error = FT_THROW( Invalid_Table ); goto Exit; } @@ -555,6 +561,7 @@ sfnt_offset > woff.totalSfntSize - table->OrigLength || table->CompLength > table->OrigLength ) { + FT_ERROR(( "woff_font_open: invalid table offsets\n" )); error = FT_THROW( Invalid_Table ); goto Exit; } @@ -580,6 +587,8 @@ if ( woff.metaOffset != woff_offset || woff.metaOffset + woff.metaLength > woff.length ) { + FT_ERROR(( "woff_font_open:" + " invalid `metadata' offset or length\n" )); error = FT_THROW( Invalid_Table ); goto Exit; } @@ -596,6 +605,7 @@ if ( woff.privOffset != woff_offset || woff.privOffset + woff.privLength > woff.length ) { + FT_ERROR(( "woff_font_open: invalid `private' offset or length\n" )); error = FT_THROW( Invalid_Table ); goto Exit; } @@ -607,10 +617,19 @@ if ( sfnt_offset != woff.totalSfntSize || woff_offset != woff.length ) { + FT_ERROR(( "woff_font_open: invalid `sfnt' table structure\n" )); error = FT_THROW( Invalid_Table ); goto Exit; } + /* Now use `totalSfntSize'. */ + if ( FT_REALLOC( sfnt, + 12 + woff.num_tables * 16UL, + woff.totalSfntSize ) ) + goto Exit; + + sfnt_header = sfnt + 12; + /* Write the tables. */ for ( nn = 0; nn < woff.num_tables; nn++ ) @@ -651,6 +670,7 @@ goto Exit; if ( output_len != table->OrigLength ) { + FT_ERROR(( "woff_font_open: compressed table length mismatch\n" )); error = FT_THROW( Invalid_Table ); goto Exit; } @@ -883,9 +903,17 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT { - FT_ULong fvar_len; + FT_ULong fvar_len; + + FT_ULong version; + FT_ULong offset; + + FT_UShort num_axes; + FT_UShort axis_size; FT_UShort num_instances; - FT_Int instance_index; + FT_UShort instance_size; + + FT_Int instance_index; instance_index = FT_ABS( face_instance_index ) >> 16; @@ -893,8 +921,32 @@ /* test whether current face is a GX font with named instances */ if ( face->goto_table( face, TTAG_fvar, stream, &fvar_len ) || fvar_len < 20 || - FT_STREAM_SKIP( 12 ) || - FT_READ_USHORT( num_instances ) ) + FT_READ_ULONG( version ) || + FT_READ_USHORT( offset ) || + FT_STREAM_SKIP( 2 ) || + FT_READ_USHORT( num_axes ) || + FT_READ_USHORT( axis_size ) || + FT_READ_USHORT( num_instances ) || + FT_READ_USHORT( instance_size ) ) + { + version = 0; + offset = 0; + num_axes = 0; + axis_size = 0; + num_instances = 0; + instance_size = 0; + } + + /* check that the data is bound by the table length; */ + /* based on similar code in function `TT_Get_MM_Var' */ + if ( version != 0x00010000UL || + axis_size != 20 || + num_axes > 0x3FFE || + instance_size != 4 + 4 * num_axes || + num_instances > 0x7EFF || + offset + + axis_size * num_axes + + instance_size * num_instances > fvar_len ) num_instances = 0; /* we support at most 2^15 - 1 instances */ diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c index c4d9abdfe68..2b1337f11be 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c @@ -774,7 +774,7 @@ if ( charcode < cmap->cur_start ) charcode = cmap->cur_start; - for ( ;; ) + for (;;) { FT_Byte* values = cmap->cur_values; FT_UInt end = cmap->cur_end; @@ -1891,7 +1891,10 @@ /* if `gindex' is invalid, the remaining values */ /* in this group are invalid, too */ if ( gindex >= (FT_UInt)face->num_glyphs ) + { + gindex = 0; continue; + } result = char_code; break; @@ -2277,7 +2280,10 @@ /* if `gindex' is invalid, the remaining values */ /* in this group are invalid, too */ if ( gindex >= (FT_UInt)face->num_glyphs ) + { + gindex = 0; continue; + } cmap->cur_charcode = char_code; cmap->cur_gindex = gindex; @@ -2962,12 +2968,17 @@ /* through the normal Unicode cmap, no GIDs, just check order) */ if ( defOff != 0 ) { - FT_Byte* defp = table + defOff; - FT_ULong numRanges = TT_NEXT_ULONG( defp ); + FT_Byte* defp = table + defOff; + FT_ULong numRanges; FT_ULong i; - FT_ULong lastBase = 0; + FT_ULong lastBase = 0; + if ( defp + 4 > valid->limit ) + FT_INVALID_TOO_SHORT; + + numRanges = TT_NEXT_ULONG( defp ); + /* defp + numRanges * 4 > valid->limit ? */ if ( numRanges > (FT_ULong)( valid->limit - defp ) / 4 ) FT_INVALID_TOO_SHORT; @@ -2991,13 +3002,18 @@ /* and the non-default table (these glyphs are specified here) */ if ( nondefOff != 0 ) { - FT_Byte* ndp = table + nondefOff; - FT_ULong numMappings = TT_NEXT_ULONG( ndp ); - FT_ULong i, lastUni = 0; + FT_Byte* ndp = table + nondefOff; + FT_ULong numMappings; + FT_ULong i, lastUni = 0; + + + if ( ndp + 4 > valid->limit ) + FT_INVALID_TOO_SHORT; + numMappings = TT_NEXT_ULONG( ndp ); - /* numMappings * 4 > (FT_ULong)( valid->limit - ndp ) ? */ - if ( numMappings > ( (FT_ULong)( valid->limit - ndp ) ) / 4 ) + /* numMappings * 5 > (FT_ULong)( valid->limit - ndp ) ? */ + if ( numMappings > ( (FT_ULong)( valid->limit - ndp ) ) / 5 ) FT_INVALID_TOO_SHORT; for ( i = 0; i < numMappings; ++i ) @@ -3442,7 +3458,7 @@ ni = 1; i = 0; - for ( ;; ) + for (;;) { if ( nuni > duni + dcnt ) { diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c index 3b351ecfce4..09260b8e33e 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c @@ -104,7 +104,8 @@ version = FT_NEXT_LONG( p ); num_strikes = FT_NEXT_ULONG( p ); - if ( ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00020000UL ) + if ( ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00020000UL && + ( (FT_ULong)version & 0xFFFF0000UL ) != 0x00030000UL ) { error = FT_THROW( Unknown_File_Format ); goto Exit; @@ -247,6 +248,8 @@ case TT_SBIT_TABLE_TYPE_CBLC: { FT_Byte* strike; + FT_Char max_before_bl; + FT_Char min_after_bl; strike = face->sbit_table + 8 + strike_index * 48; @@ -256,7 +259,64 @@ metrics->ascender = (FT_Char)strike[16] * 64; /* hori.ascender */ metrics->descender = (FT_Char)strike[17] * 64; /* hori.descender */ - metrics->height = metrics->ascender - metrics->descender; + + /* Due to fuzzy wording in the EBLC documentation, we find both */ + /* positive and negative values for `descender'. Additionally, */ + /* many fonts have both `ascender' and `descender' set to zero */ + /* (which is definitely wrong). MS Windows simply ignores all */ + /* those values... For these reasons we apply some heuristics */ + /* to get a reasonable, non-zero value for the height. */ + + max_before_bl = (FT_Char)strike[24]; + min_after_bl = (FT_Char)strike[25]; + + if ( metrics->descender > 0 ) + { + /* compare sign of descender with `min_after_bl' */ + if ( min_after_bl < 0 ) + metrics->descender = -metrics->descender; + } + + else if ( metrics->descender == 0 ) + { + if ( metrics->ascender == 0 ) + { + FT_TRACE2(( "tt_face_load_strike_metrics:" + " sanitizing invalid ascender and descender\n" + " " + " values for strike (%d, %d)\n", + metrics->x_ppem, metrics->y_ppem )); + + /* sanitize buggy ascender and descender values */ + if ( max_before_bl || min_after_bl ) + { + metrics->ascender = max_before_bl * 64; + metrics->descender = min_after_bl * 64; + } + else + { + metrics->ascender = metrics->y_ppem * 64; + metrics->descender = 0; + } + } + } + +#if 0 + else + ; /* if we have a negative descender, simply use it */ +#endif + + metrics->height = metrics->ascender - metrics->descender; + if ( metrics->height == 0 ) + { + FT_TRACE2(( "tt_face_load_strike_metrics:" + " sanitizing invalid height value\n" + " " + " for strike (%d, %d)\n", + metrics->x_ppem, metrics->y_ppem )); + metrics->height = metrics->y_ppem * 64; + metrics->descender = metrics->ascender - metrics->height; + } /* Is this correct? */ metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */ @@ -269,11 +329,11 @@ case TT_SBIT_TABLE_TYPE_SBIX: { FT_Stream stream = face->root.stream; - FT_UInt offset, upem; - FT_UShort ppem, resolution; + FT_UInt offset; + FT_UShort upem, ppem, resolution; TT_HoriHeader *hori; FT_ULong table_size; - FT_Pos ppem_, upem_; /* to reduce casts */ + FT_Pos ppem_; /* to reduce casts */ FT_Error error; FT_Byte* p; @@ -307,14 +367,16 @@ metrics->y_ppem = ppem; ppem_ = (FT_Pos)ppem; - upem_ = (FT_Pos)upem; - metrics->ascender = ppem_ * hori->Ascender * 64 / upem_; - metrics->descender = ppem_ * hori->Descender * 64 / upem_; - metrics->height = ppem_ * ( hori->Ascender - - hori->Descender + - hori->Line_Gap ) * 64 / upem_; - metrics->max_advance = ppem_ * hori->advance_Width_Max * 64 / upem_; + metrics->ascender = + FT_MulDiv( hori->Ascender, ppem_ * 64, upem ); + metrics->descender = + FT_MulDiv( hori->Descender, ppem_ * 64, upem ); + metrics->height = + FT_MulDiv( hori->Ascender - hori->Descender + hori->Line_Gap, + ppem_ * 64, upem ); + metrics->max_advance = + FT_MulDiv( hori->advance_Width_Max, ppem_ * 64, upem ); return error; } @@ -547,13 +609,16 @@ tt_sbit_decoder_load_image( TT_SBitDecoder decoder, FT_UInt glyph_index, FT_Int x_pos, - FT_Int y_pos ); + FT_Int y_pos, + FT_UInt recurse_count ); - typedef FT_Error (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder decoder, - FT_Byte* p, - FT_Byte* plimit, - FT_Int x_pos, - FT_Int y_pos ); + typedef FT_Error (*TT_SBitDecoder_LoadFunc)( + TT_SBitDecoder decoder, + FT_Byte* p, + FT_Byte* plimit, + FT_Int x_pos, + FT_Int y_pos, + FT_UInt recurse_count ); static FT_Error @@ -561,7 +626,8 @@ FT_Byte* p, FT_Byte* limit, FT_Int x_pos, - FT_Int y_pos ) + FT_Int y_pos, + FT_UInt recurse_count ) { FT_Error error = FT_Err_Ok; FT_Byte* line; @@ -569,6 +635,8 @@ FT_UInt bit_height, bit_width; FT_Bitmap* bitmap; + FT_UNUSED( recurse_count ); + /* check that we can write the glyph into the bitmap */ bitmap = decoder->bitmap; @@ -700,7 +768,8 @@ FT_Byte* p, FT_Byte* limit, FT_Int x_pos, - FT_Int y_pos ) + FT_Int y_pos, + FT_UInt recurse_count ) { FT_Error error = FT_Err_Ok; FT_Byte* line; @@ -709,6 +778,8 @@ FT_Bitmap* bitmap; FT_UShort rval; + FT_UNUSED( recurse_count ); + /* check that we can write the glyph into the bitmap */ bitmap = decoder->bitmap; @@ -738,6 +809,12 @@ goto Exit; } + if ( !line_bits || !height ) + { + /* nothing to do */ + goto Exit; + } + /* now do the blit */ /* adjust `line' to point to the first byte of the bitmap */ @@ -824,7 +901,8 @@ FT_Byte* p, FT_Byte* limit, FT_Int x_pos, - FT_Int y_pos ) + FT_Int y_pos, + FT_UInt recurse_count ) { FT_Error error = FT_Err_Ok; FT_UInt num_components, nn; @@ -858,8 +936,11 @@ /* NB: a recursive call */ - error = tt_sbit_decoder_load_image( decoder, gindex, - x_pos + dx, y_pos + dy ); + error = tt_sbit_decoder_load_image( decoder, + gindex, + x_pos + dx, + y_pos + dy, + recurse_count + 1 ); if ( error ) break; } @@ -891,11 +972,14 @@ FT_Byte* p, FT_Byte* limit, FT_Int x_pos, - FT_Int y_pos ) + FT_Int y_pos, + FT_UInt recurse_count ) { FT_Error error = FT_Err_Ok; FT_ULong png_len; + FT_UNUSED( recurse_count ); + if ( limit - p < 4 ) { @@ -937,7 +1021,8 @@ FT_ULong glyph_start, FT_ULong glyph_size, FT_Int x_pos, - FT_Int y_pos ) + FT_Int y_pos, + FT_UInt recurse_count ) { FT_Error error; FT_Stream stream = decoder->stream; @@ -947,7 +1032,8 @@ /* seek into the EBDT table now */ - if ( glyph_start + glyph_size > decoder->ebdt_size ) + if ( !glyph_size || + glyph_start + glyph_size > decoder->ebdt_size ) { error = FT_THROW( Invalid_Argument ); goto Exit; @@ -1063,7 +1149,7 @@ goto Fail; } - error = loader( decoder, p, p_limit, x_pos, y_pos ); + error = loader( decoder, p, p_limit, x_pos, y_pos, recurse_count ); } Fail: @@ -1078,13 +1164,9 @@ tt_sbit_decoder_load_image( TT_SBitDecoder decoder, FT_UInt glyph_index, FT_Int x_pos, - FT_Int y_pos ) + FT_Int y_pos, + FT_UInt recurse_count ) { - /* - * First, we find the correct strike range that applies to this - * glyph index. - */ - FT_Byte* p = decoder->eblc_base + decoder->strike_index_array; FT_Byte* p_limit = decoder->eblc_limit; FT_ULong num_ranges = decoder->strike_index_count; @@ -1092,6 +1174,17 @@ FT_ULong image_start = 0, image_end = 0, image_offset; + /* arbitrary recursion limit */ + if ( recurse_count > 100 ) + { + FT_TRACE4(( "tt_sbit_decoder_load_image:" + " recursion depth exceeded\n" )); + goto Failure; + } + + + /* First, we find the correct strike range that applies to this */ + /* glyph index. */ for ( ; num_ranges > 0; num_ranges-- ) { start = FT_NEXT_USHORT( p ); @@ -1256,7 +1349,8 @@ image_start, image_end, x_pos, - y_pos ); + y_pos, + recurse_count ); Failure: return FT_THROW( Invalid_Table ); @@ -1419,6 +1513,7 @@ error = tt_sbit_decoder_load_image( decoder, glyph_index, 0, + 0, 0 ); tt_sbit_decoder_done( decoder ); } diff --git a/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c b/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c index 56d2b553319..9d6dec6e8ed 100644 --- a/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c +++ b/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c @@ -135,8 +135,10 @@ #include #include #include -#define FT_UINT_MAX UINT_MAX -#define FT_INT_MAX INT_MAX +#define FT_CHAR_BIT CHAR_BIT +#define FT_UINT_MAX UINT_MAX +#define FT_INT_MAX INT_MAX +#define FT_ULONG_MAX ULONG_MAX #define ft_memset memset @@ -366,6 +368,15 @@ typedef ptrdiff_t FT_PtrDist; #endif /* __arm__ */ + /* These macros speed up repetitive divisions by replacing them */ + /* with multiplications and right shifts. */ +#define FT_UDIVPREP( b ) \ + long b ## _r = (long)( FT_ULONG_MAX >> PIXEL_BITS ) / ( b ) +#define FT_UDIV( a, b ) \ + ( ( (unsigned long)( a ) * (unsigned long)( b ## _r ) ) >> \ + ( sizeof( long ) * FT_CHAR_BIT - PIXEL_BITS ) ) + + /*************************************************************************/ /* */ /* TYPE DEFINITIONS */ @@ -678,6 +689,7 @@ typedef ptrdiff_t FT_PtrDist; gray_set_cell( RAS_VAR_ ex, ey ); } +#if 0 /*************************************************************************/ /* */ @@ -910,6 +922,143 @@ typedef ptrdiff_t FT_PtrDist; ras.y = to_y; } +#else + + /*************************************************************************/ + /* */ + /* Render a straight line across multiple cells in any direction. */ + /* */ + static void + gray_render_line( RAS_ARG_ TPos to_x, + TPos to_y ) + { + TPos dx, dy, fx1, fy1, fx2, fy2; + TCoord ex1, ex2, ey1, ey2; + + + ex1 = TRUNC( ras.x ); + ex2 = TRUNC( to_x ); + ey1 = TRUNC( ras.y ); + ey2 = TRUNC( to_y ); + + /* perform vertical clipping */ + if ( ( ey1 >= ras.max_ey && ey2 >= ras.max_ey ) || + ( ey1 < ras.min_ey && ey2 < ras.min_ey ) ) + goto End; + + dx = to_x - ras.x; + dy = to_y - ras.y; + + fx1 = ras.x - SUBPIXELS( ex1 ); + fy1 = ras.y - SUBPIXELS( ey1 ); + + if ( ex1 == ex2 && ey1 == ey2 ) /* inside one cell */ + ; + else if ( dy == 0 ) /* ex1 != ex2 */ /* any horizontal line */ + { + ex1 = ex2; + gray_set_cell( RAS_VAR_ ex1, ey1 ); + } + else if ( dx == 0 ) + { + if ( dy > 0 ) /* vertical line up */ + do + { + fy2 = ONE_PIXEL; + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * fx1 * 2; + fy1 = 0; + ey1++; + gray_set_cell( RAS_VAR_ ex1, ey1 ); + } while ( ey1 != ey2 ); + else /* vertical line down */ + do + { + fy2 = 0; + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * fx1 * 2; + fy1 = ONE_PIXEL; + ey1--; + gray_set_cell( RAS_VAR_ ex1, ey1 ); + } while ( ey1 != ey2 ); + } + else /* any other line */ + { + TArea prod = dx * fy1 - dy * fx1; + FT_UDIVPREP( dx ); + FT_UDIVPREP( dy ); + + + /* The fundamental value `prod' determines which side and the */ + /* exact coordinate where the line exits current cell. It is */ + /* also easily updated when moving from one cell to the next. */ + do + { + if ( prod <= 0 && + prod - dx * ONE_PIXEL > 0 ) /* left */ + { + fx2 = 0; + fy2 = (TPos)FT_UDIV( -prod, -dx ); + prod -= dy * ONE_PIXEL; + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); + fx1 = ONE_PIXEL; + fy1 = fy2; + ex1--; + } + else if ( prod - dx * ONE_PIXEL <= 0 && + prod - dx * ONE_PIXEL + dy * ONE_PIXEL > 0 ) /* up */ + { + prod -= dx * ONE_PIXEL; + fx2 = (TPos)FT_UDIV( -prod, dy ); + fy2 = ONE_PIXEL; + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); + fx1 = fx2; + fy1 = 0; + ey1++; + } + else if ( prod - dx * ONE_PIXEL + dy * ONE_PIXEL <= 0 && + prod + dy * ONE_PIXEL >= 0 ) /* right */ + { + prod += dy * ONE_PIXEL; + fx2 = ONE_PIXEL; + fy2 = (TPos)FT_UDIV( prod, dx ); + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); + fx1 = 0; + fy1 = fy2; + ex1++; + } + else /* ( prod + dy * ONE_PIXEL < 0 && + prod > 0 ) down */ + { + fx2 = (TPos)FT_UDIV( prod, -dy ); + fy2 = 0; + prod += dx * ONE_PIXEL; + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); + fx1 = fx2; + fy1 = ONE_PIXEL; + ey1--; + } + + gray_set_cell( RAS_VAR_ ex1, ey1 ); + } while ( ex1 != ex2 || ey1 != ey2 ); + } + + fx2 = to_x - SUBPIXELS( ex2 ); + fy2 = to_y - SUBPIXELS( ey2 ); + + ras.cover += ( fy2 - fy1 ); + ras.area += ( fy2 - fy1 ) * ( fx1 + fx2 ); + + End: + ras.x = to_x; + ras.y = to_y; + } + +#endif static void gray_split_conic( FT_Vector* base ) diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py index 1961878a7d6..2f60ce6f4f6 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py @@ -46,9 +46,26 @@ re_code_end = re.compile( r"(\s*)}\s*$" ) # -# A regular expression to isolate identifiers from other text. +# A regular expression to isolate identifiers from other text. Two syntax +# forms are supported: # -re_identifier = re.compile( r'((?:\w|-)*)' ) +# +# [] +# +# where both `' and `' consist of alphanumeric characters, `_', +# and `-'. Use `' if there are multiple, valid `' entries; in the +# index, `' will be appended in parentheses. +# +# For example, +# +# stem_darkening[autofit] +# +# becomes `stem_darkening (autofit)' in the index. +# +re_identifier = re.compile( r""" + ((?:\w|-)+ + (?:\[(?:\w|-)+\])?) + """, re.VERBOSE ) # diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/formatter.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/formatter.py index f0a8808c474..866973919ce 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/formatter.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/formatter.py @@ -56,6 +56,11 @@ class Formatter: self.block_index = self.identifiers.keys() self.block_index.sort( key = index_key ) + # also add section names to dictionary (without making them appear + # in the index) + for section in self.sections: + self.add_identifier( section.name, section ) + def add_identifier( self, name, block ): if name in self.identifiers: # duplicate name! diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py index be38132d1df..9a4777d3ceb 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py @@ -138,12 +138,24 @@ re_markup_tags = [re_markup_tag1, re_markup_tag2] # # A regular expression to detect a cross reference, after markup tags have -# been stripped off. Group 1 is the reference, group 2 the rest of the -# line. +# been stripped off. # -# A cross reference consists of letters, digits, or characters `-' and `_'. +# Two syntax forms are supported: # -re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) # @foo +# @ +# @[] +# +# where both `' and `' consist of alphanumeric characters, `_', +# and `-'. Use `' if there are multiple, valid `' entries. +# +# Example: @foo[bar] +# +re_crossref = re.compile( r""" + @ + (?P(?:\w|-)+ + (?:\[(?:\w|-)+\])?) + (?P.*) + """, re.VERBOSE ) # # Two regular expressions to detect italic and bold markup, respectively. diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py index bc6bcf05110..a7206f5e8a2 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py @@ -164,7 +164,8 @@ html_footer = """\ """ # The header and footer used for each section. -section_title_header = "

" +section_title_header1 = '

' section_title_footer = "

" # The header and footer used for code segments. @@ -309,7 +310,14 @@ class HtmlFormatter( Formatter ): def make_block_url( self, block, name = None ): if name == None: name = block.name - return self.make_section_url( block.section ) + "#" + name + + try: + section_url = self.make_section_url( block.section ) + except: + # we already have a section + section_url = self.make_section_url( block ) + + return section_url + "#" + name def make_html_word( self, word ): """Analyze a simple word to detect cross-references and markup.""" @@ -317,11 +325,27 @@ class HtmlFormatter( Formatter ): m = re_crossref.match( word ) if m: try: - name = m.group( 1 ) - rest = m.group( 2 ) + name = m.group( 'name' ) + rest = m.group( 'rest' ) block = self.identifiers[name] url = self.make_block_url( block ) - return '' + name + '' + rest + # display `foo[bar]' as `foo' + name = re.sub( r'\[.*\]', '', name ) + # normalize url, following RFC 3986 + url = string.replace( url, "[", "(" ) + url = string.replace( url, "]", ")" ) + + try: + # for sections, display title + url = ( '‘' + + block.title + '’' + + rest ) + except: + url = ( '' + + name + '' + + rest ) + + return url except: # we detected a cross-reference to an unknown item sys.stderr.write( "WARNING: undefined cross reference" @@ -417,16 +441,22 @@ class HtmlFormatter( Formatter ): id = block.name # link to a field ID if possible - for markup in block.markups: - if markup.tag == 'values': - for field in markup.fields: - if field.name: - id = name + try: + for markup in block.markups: + if markup.tag == 'values': + for field in markup.fields: + if field.name: + id = name + + result = ( result + prefix + + '' + name + '' ) + except: + # sections don't have `markups'; however, we don't + # want references to sections here anyway + result = result + html_quote( line[:length] ) - result = ( result + prefix - + '' + name + '' ) else: result = result + html_quote( line[:length] ) @@ -490,6 +520,12 @@ class HtmlFormatter( Formatter ): if i < count: bname = self.block_index[r + c * rows] url = self.index_items[bname] + # display `foo[bar]' as `foo (bar)' + bname = string.replace( bname, "[", " (" ) + bname = string.replace( bname, "]", ")" ) + # normalize url, following RFC 3986 + url = string.replace( url, "[", "(" ) + url = string.replace( url, "]", ")" ) line = ( line + '
' ) else: @@ -564,7 +600,9 @@ class HtmlFormatter( Formatter ): def section_enter( self, section ): print self.html_header - print section_title_header + section.title + section_title_footer + print ( section_title_header1 + section.name + section_title_header2 + + section.title + + section_title_footer ) maxwidth = 0 for b in section.blocks.values(): @@ -601,7 +639,13 @@ class HtmlFormatter( Formatter ): # even omit it completely) line = line + " " else: - line = ( line + '' + url = name + # display `foo[bar]' as `foo' + name = re.sub( r'\[.*\]', '', name ) + # normalize url, following RFC 3986 + url = string.replace( url, "[", "(" ) + url = string.replace( url, "]", ")" ) + line = ( line + '' + name + '' ) line = line + '' @@ -620,7 +664,13 @@ class HtmlFormatter( Formatter ): # place html anchor if needed if block.name: - print( '

' + block.name + '

' ) + url = block.name + # display `foo[bar]' as `foo' + name = re.sub( r'\[.*\]', '', block.name ) + # normalize url, following RFC 3986 + url = string.replace( url, "[", "(" ) + url = string.replace( url, "]", ")" ) + print( '

' + name + '

' ) # dump the block C source lines now if block.code: diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c b/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c index 08b30c95ad0..1ba71f0ebd4 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c @@ -117,8 +117,8 @@ FT_DEFINE_SERVICE_PROPERTIESREC( tt_service_properties, - (FT_Properties_SetFunc)tt_property_set, - (FT_Properties_GetFunc)tt_property_get ) + (FT_Properties_SetFunc)tt_property_set, /* set_property */ + (FT_Properties_GetFunc)tt_property_get ) /* get_property */ /*************************************************************************/ @@ -417,13 +417,14 @@ #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_DEFINE_SERVICE_MULTIMASTERSREC( tt_service_gx_multi_masters, - (FT_Get_MM_Func) NULL, - (FT_Set_MM_Design_Func) NULL, - (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, - (FT_Get_MM_Var_Func) TT_Get_MM_Var, - (FT_Set_Var_Design_Func)TT_Set_Var_Design ) + (FT_Get_MM_Func) NULL, /* get_mm */ + (FT_Set_MM_Design_Func) NULL, /* set_mm_design */ + (FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */ + (FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */ + (FT_Set_Var_Design_Func)TT_Set_Var_Design ) /* set_var_design */ #endif + static const FT_Service_TrueTypeEngineRec tt_service_truetype_engine = { #ifdef TT_USE_BYTECODE_INTERPRETER @@ -441,9 +442,11 @@ #endif /* TT_USE_BYTECODE_INTERPRETER */ }; + FT_DEFINE_SERVICE_TTGLYFREC( tt_service_truetype_glyf, - (TT_Glyf_GetLocationFunc)tt_face_get_location ) + (TT_Glyf_GetLocationFunc)tt_face_get_location ) /* get_location */ + #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT FT_DEFINE_SERVICEDESCREC5( @@ -534,31 +537,31 @@ 0x10000L, /* driver version == 1.0 */ 0x20000L, /* driver requires FreeType 2.0 or above */ - (void*)0, /* driver specific interface */ + 0, /* module-specific interface */ - tt_driver_init, - tt_driver_done, - tt_get_interface, + tt_driver_init, /* FT_Module_Constructor module_init */ + tt_driver_done, /* FT_Module_Destructor module_done */ + tt_get_interface, /* FT_Module_Requester get_interface */ sizeof ( TT_FaceRec ), sizeof ( TT_SizeRec ), sizeof ( FT_GlyphSlotRec ), - tt_face_init, - tt_face_done, - tt_size_init, - tt_size_done, - tt_slot_init, - 0, /* FT_Slot_DoneFunc */ + tt_face_init, /* FT_Face_InitFunc init_face */ + tt_face_done, /* FT_Face_DoneFunc done_face */ + tt_size_init, /* FT_Size_InitFunc init_size */ + tt_size_done, /* FT_Size_DoneFunc done_size */ + tt_slot_init, /* FT_Slot_InitFunc init_slot */ + 0, /* FT_Slot_DoneFunc done_slot */ - tt_glyph_load, + tt_glyph_load, /* FT_Slot_LoadFunc load_glyph */ - tt_get_kerning, - 0, /* FT_Face_AttachFunc */ - tt_get_advances, + tt_get_kerning, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + tt_get_advances, /* FT_Face_GetAdvancesFunc get_advances */ - tt_size_request, - TT_SIZE_SELECT + tt_size_request, /* FT_Size_RequestFunc request_size */ + TT_SIZE_SELECT /* FT_Size_SelectFunc select_size */ ) diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c index a792ad44a06..d94fc92a5b9 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c @@ -24,6 +24,7 @@ #include FT_TRUETYPE_TAGS_H #include FT_OUTLINE_H #include FT_TRUETYPE_DRIVER_H +#include FT_LIST_H #include "ttgload.h" #include "ttpload.h" @@ -659,6 +660,7 @@ } while ( subglyph->flags & MORE_COMPONENTS ); gloader->current.num_subglyphs = num_subglyphs; + FT_TRACE5(( " %d components\n", num_subglyphs )); #ifdef TT_USE_BYTECODE_INTERPRETER @@ -1395,6 +1397,11 @@ #endif +#ifdef FT_DEBUG_LEVEL_TRACE + if ( recurse_count ) + 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 && @@ -1627,11 +1634,40 @@ /* otherwise, load a composite! */ else if ( loader->n_contours == -1 ) { + FT_Memory memory = face->root.memory; + FT_UInt start_point; FT_UInt start_contour; FT_ULong ins_pos; /* position of composite instructions, if any */ + /* + * We store the glyph index directly in the `node->data' pointer, + * following the glib solution (cf. macro `GUINT_TO_POINTER') with a + * double cast to make this portable. Note, however, that this needs + * pointers with a width of at least 32 bits. + */ + + /* check whether we already have a composite glyph with this index */ + if ( FT_List_Find( &loader->composites, + (void*)(unsigned long)glyph_index ) ) + { + FT_TRACE1(( "TT_Load_Composite_Glyph:" + " infinite recursion detected\n" )); + error = FT_THROW( Invalid_Composite ); + goto Exit; + } + else + { + FT_ListNode node = NULL; + + + if ( FT_NEW( node ) ) + goto Exit; + node->data = (void*)(unsigned long)glyph_index; + FT_List_Add( &loader->composites, node ); + } + start_point = (FT_UInt)gloader->base.outline.n_points; start_contour = (FT_UInt)gloader->base.outline.n_contours; @@ -1659,8 +1695,6 @@ char* tags = NULL; short* contours = NULL; - FT_Memory memory = face->root.memory; - limit = (short)gloader->current.num_subglyphs; @@ -2393,10 +2427,23 @@ loader->glyph = (FT_GlyphSlot)glyph; loader->stream = stream; + loader->composites.head = NULL; + loader->composites.tail = NULL; + return FT_Err_Ok; } + static void + tt_loader_done( TT_Loader loader ) + { + FT_List_Finalize( &loader->composites, + NULL, + loader->face->root.memory, + NULL ); + } + + /*************************************************************************/ /* */ /* */ @@ -2453,6 +2500,7 @@ /* for the bbox we need the header only */ (void)tt_loader_init( &loader, size, glyph, load_flags, TRUE ); (void)load_truetype_glyph( &loader, glyph_index, 0, TRUE ); + tt_loader_done( &loader ); glyph->linearHoriAdvance = loader.linear; glyph->linearVertAdvance = loader.vadvance; @@ -2548,6 +2596,8 @@ error = compute_glyph_metrics( &loader, glyph_index ); } + tt_loader_done( &loader ); + /* Set the `high precision' bit flag. */ /* This is _critical_ to get correct output for monochrome */ /* TrueType glyphs at all sizes using the bytecode interpreter. */ diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.c b/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.c index dd9e250c941..5d4384eabb2 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.c @@ -112,6 +112,8 @@ /* */ /* stream :: The data stream. */ /* */ + /* size :: The size of the table holding the data. */ + /* */ /* */ /* point_cnt :: The number of points read. A zero value means that */ /* all points in the glyph will be affected, without */ @@ -123,6 +125,7 @@ /* */ static FT_UShort* ft_var_readpackedpoints( FT_Stream stream, + FT_ULong size, FT_UInt *point_cnt ) { FT_UShort *points = NULL; @@ -149,6 +152,12 @@ n |= FT_GET_BYTE(); } + if ( n > size ) + { + FT_TRACE1(( "ft_var_readpackedpoints: number of points too large\n" )); + return NULL; + } + if ( FT_NEW_ARRAY( points, n ) ) return NULL; @@ -212,6 +221,8 @@ /* */ /* stream :: The data stream. */ /* */ + /* size :: The size of the table holding the data. */ + /* */ /* delta_cnt :: The number of deltas to be read. */ /* */ /* */ @@ -222,6 +233,7 @@ /* */ static FT_Short* ft_var_readpackeddeltas( FT_Stream stream, + FT_ULong size, FT_UInt delta_cnt ) { FT_Short *deltas = NULL; @@ -233,6 +245,12 @@ FT_UNUSED( error ); + if ( delta_cnt > size ) + { + FT_TRACE1(( "ft_var_readpackeddeltas: number of points too large\n" )); + return NULL; + } + if ( FT_NEW_ARRAY( deltas, delta_cnt ) ) return NULL; @@ -341,7 +359,8 @@ FT_TRACE5(( " axis %d:\n", i )); segment->pairCount = FT_GET_USHORT(); - if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) ) + if ( (FT_ULong)segment->pairCount * 4 > table_len || + FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) ) { /* Failure. Free everything we have done so far. We must do */ /* it right now since loading the `avar' table is optional. */ @@ -447,10 +466,6 @@ if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) ) goto Exit; - blend->tuplecount = gvar_head.globalCoordCount; - blend->gv_glyphcnt = gvar_head.glyphCount; - offsetToData = gvar_start + gvar_head.offsetToData; - if ( gvar_head.version != 0x00010000L ) { FT_TRACE1(( "bad table version\n" )); @@ -458,8 +473,6 @@ goto Exit; } - FT_TRACE2(( "loaded\n" )); - if ( gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis ) { FT_TRACE1(( "ft_var_load_gvar: number of axes in `gvar' and `cvar'\n" @@ -468,6 +481,33 @@ goto Exit; } + /* rough sanity check, ignoring offsets */ + if ( (FT_ULong)gvar_head.globalCoordCount * gvar_head.axisCount > + table_len / 2 ) + { + FT_TRACE1(( "ft_var_load_gvar:" + " invalid number of global coordinates\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* rough sanity check: offsets can be either 2 or 4 bytes, */ + /* and a single variation needs at least 4 bytes per glyph */ + if ( (FT_ULong)gvar_head.glyphCount * + ( ( gvar_head.flags & 1 ) ? 8 : 6 ) > table_len ) + { + FT_TRACE1(( "ft_var_load_gvar: invalid number of glyphs\n" )); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + FT_TRACE2(( "loaded\n" )); + + blend->gvar_size = table_len; + blend->tuplecount = gvar_head.globalCoordCount; + blend->gv_glyphcnt = gvar_head.glyphCount; + offsetToData = gvar_start + gvar_head.offsetToData; + FT_TRACE5(( "gvar: there are %d shared coordinates:\n", blend->tuplecount )); @@ -1353,13 +1393,25 @@ goto FExit; tupleCount = FT_GET_USHORT(); - offsetToData = table_start + FT_GET_USHORT(); + offsetToData = FT_GET_USHORT(); + + /* rough sanity test */ + if ( offsetToData + tupleCount * 4 > table_len ) + { + FT_TRACE2(( "tt_face_vary_cvt:" + " invalid CVT variation array header\n" )); + + error = FT_THROW( Invalid_Table ); + goto FExit; + } - /* The documentation implies there are flags packed into the */ - /* tuplecount, but John Jenkins says that shared points don't apply */ - /* to `cvar', and no other flags are defined. */ + offsetToData += table_start; - FT_TRACE5(( "cvar: there are %d tuples:\n", tupleCount )); + /* The documentation implies there are flags packed into */ + /* `tupleCount', but John Jenkins says that shared points don't apply */ + /* to `cvar', and no other flags are defined. */ + + FT_TRACE5(( "cvar: there are %d tuples:\n", tupleCount & 0xFFF )); for ( i = 0; i < ( tupleCount & 0xFFF ); i++ ) { @@ -1421,8 +1473,11 @@ FT_Stream_SeekSet( stream, offsetToData ); - localpoints = ft_var_readpackedpoints( stream, &point_count ); + localpoints = ft_var_readpackedpoints( stream, + table_len, + &point_count ); deltas = ft_var_readpackeddeltas( stream, + table_len, point_count == 0 ? face->cvt_size : point_count ); if ( localpoints == NULL || deltas == NULL ) @@ -1819,7 +1874,19 @@ goto Fail2; tupleCount = FT_GET_USHORT(); - offsetToData = glyph_start + FT_GET_USHORT(); + offsetToData = FT_GET_USHORT(); + + /* rough sanity test */ + if ( offsetToData + tupleCount * 4 > blend->gvar_size ) + { + FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" + " invalid glyph variation array header\n" )); + + error = FT_THROW( Invalid_Table ); + goto Fail2; + } + + offsetToData += glyph_start; if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS ) { @@ -1827,13 +1894,16 @@ FT_Stream_SeekSet( stream, offsetToData ); - sharedpoints = ft_var_readpackedpoints( stream, &spoint_count ); + sharedpoints = ft_var_readpackedpoints( stream, + blend->gvar_size, + &spoint_count ); offsetToData = FT_Stream_FTell( stream ); FT_Stream_SeekSet( stream, here ); } - FT_TRACE5(( "gvar: there are %d tuples:\n", tupleCount )); + FT_TRACE5(( "gvar: there are %d tuples:\n", + tupleCount & GX_TC_TUPLE_COUNT_MASK )); for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ ) { @@ -1855,6 +1925,9 @@ } else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount ) { + FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:" + " invalid tuple index\n" )); + error = FT_THROW( Invalid_Table ); goto Fail2; } @@ -1890,7 +1963,9 @@ { FT_Stream_SeekSet( stream, offsetToData ); - localpoints = ft_var_readpackedpoints( stream, &point_count ); + localpoints = ft_var_readpackedpoints( stream, + blend->gvar_size, + &point_count ); points = localpoints; } else @@ -1900,9 +1975,11 @@ } deltas_x = ft_var_readpackeddeltas( stream, + blend->gvar_size, point_count == 0 ? n_points : point_count ); deltas_y = ft_var_readpackeddeltas( stream, + blend->gvar_size, point_count == 0 ? n_points : point_count ); @@ -1950,6 +2027,9 @@ #endif } + else if ( localpoints == NULL ) + ; /* failure, ignore it */ + else { #ifdef FT_DEBUG_LEVEL_TRACE @@ -2021,6 +2101,8 @@ FT_TRACE5(( "\n" )); Fail2: + if ( sharedpoints != ALL_POINTS ) + FT_FREE( sharedpoints ); FT_FREE( tuple_coords ); FT_FREE( im_start_coords ); FT_FREE( im_end_coords ); diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.h b/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.h index 060d4d60eaf..dd1411f0d88 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.h +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttgxvar.h @@ -95,6 +95,8 @@ FT_BEGIN_HEADER FT_UInt gv_glyphcnt; FT_ULong* glyphoffsets; + FT_ULong gvar_size; + } GX_BlendRec; diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c b/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c index ae2a82adc5e..1c1d7de6483 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c @@ -45,15 +45,6 @@ #define FT_COMPONENT trace_ttinterp - /*************************************************************************/ - /* */ - /* In order to detect infinite loops in the code, we set up a counter */ - /* within the run loop. A single stroke of interpretation is now */ - /* limited to a maximum number of opcodes defined below. */ - /* */ -#define MAX_RUNNABLE_OPCODES 1000000L - - #define SUBPIXEL_HINTING \ ( ((TT_Driver)FT_FACE_DRIVER( exc->face ))->interpreter_version == \ TT_INTERPRETER_VERSION_38 ) @@ -7565,7 +7556,7 @@ ? 2 : 12 - ( *opcode_name[exc->opcode] - '0' ), "#" )); - for ( n = 0; n < cnt; n++ ) + for ( n = 1; n <= cnt; n++ ) FT_TRACE7(( " %d", exc->stack[exc->top - n] )); FT_TRACE6(( "\n" )); } @@ -8230,7 +8221,7 @@ /* increment instruction counter and check if we didn't */ /* run this program for too long (e.g. infinite loops). */ - if ( ++ins_counter > MAX_RUNNABLE_OPCODES ) + if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES ) return FT_THROW( Execution_Too_Long ); LSuiteLabel_: diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c b/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c index 6060d6f5d1e..fdfcc91485d 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c @@ -1078,7 +1078,15 @@ } /* Fine, now run the font program! */ + + /* In case of an error while executing `fpgm', we intentionally don't */ + /* clean up immediately – bugs in the `fpgm' are so fundamental that */ + /* all following hinting calls should fail. Additionally, `fpgm' is */ + /* to be executed just once; calling it again is completely useless */ + /* and might even lead to extremely slow behaviour if it is malformed */ + /* (containing an infinite loop, for example). */ error = tt_size_run_fpgm( size, pedantic ); + return error; Exit: if ( error ) diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttpload.c b/reactos/lib/3rdparty/freetype/src/truetype/ttpload.c index 4647c938aea..9bf67f9632d 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttpload.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttpload.c @@ -124,8 +124,9 @@ TT_Table entry = face->dir_tables; TT_Table limit = entry + face->num_tables; - FT_Long pos = (FT_Long)FT_STREAM_POS(); - FT_Long dist = 0x7FFFFFFFL; + FT_Long pos = (FT_Long)FT_STREAM_POS(); + FT_Long dist = 0x7FFFFFFFL; + FT_Bool found = 0; /* compute the distance to next table in font file */ @@ -135,10 +136,13 @@ if ( diff > 0 && diff < dist ) - dist = diff; + { + dist = diff; + found = 1; + } } - if ( entry == limit ) + if ( !found ) { /* `loca' is the last table */ dist = (FT_Long)stream->size - pos; @@ -222,7 +226,8 @@ if ( pos1 > face->glyf_len ) { FT_TRACE1(( "tt_face_get_location:" - " too large offset=0x%08lx found for gid=0x%04lx," + " too large offset=0x%08lx found for gid=0x%04lx,\n" + " " " exceeding the end of glyf table (0x%08lx)\n", pos1, gindex, face->glyf_len )); *asize = 0; @@ -232,7 +237,8 @@ if ( pos2 > face->glyf_len ) { FT_TRACE1(( "tt_face_get_location:" - " too large offset=0x%08lx found for gid=0x%04lx," + " too large offset=0x%08lx found for gid=0x%04lx,\n" + " " " truncate at the end of glyf table (0x%08lx)\n", pos2, gindex + 1, face->glyf_len )); pos2 = face->glyf_len; diff --git a/reactos/lib/3rdparty/freetype/src/type1/t1afm.c b/reactos/lib/3rdparty/freetype/src/type1/t1afm.c index 7f32059f850..7a7bf824c0f 100644 --- a/reactos/lib/3rdparty/freetype/src/type1/t1afm.c +++ b/reactos/lib/3rdparty/freetype/src/type1/t1afm.c @@ -239,9 +239,17 @@ AFM_ParserRec parser; AFM_FontInfo fi = NULL; FT_Error error = FT_ERR( Unknown_File_Format ); - T1_Font t1_font = &( (T1_Face)t1_face )->type1; + T1_Face face = (T1_Face)t1_face; + T1_Font t1_font = &face->type1; + if ( face->afm_data ) + { + FT_TRACE1(( "T1_Read_Metrics:" + " Freeing previously attached metrics data.\n" )); + T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data ); + } + if ( FT_NEW( fi ) || FT_FRAME_ENTER( stream->size ) ) goto Exit; @@ -250,7 +258,7 @@ fi->Ascender = t1_font->font_bbox.yMax; fi->Descender = t1_font->font_bbox.yMin; - psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux; + psaux = (PSAux_Service)face->psaux; if ( psaux->afm_parser_funcs ) { error = psaux->afm_parser_funcs->init( &parser, @@ -298,7 +306,7 @@ if ( fi->NumKernPair ) { t1_face->face_flags |= FT_FACE_FLAG_KERNING; - ( (T1_Face)t1_face )->afm_data = fi; + face->afm_data = fi; fi = NULL; } } diff --git a/reactos/lib/3rdparty/freetype/src/type1/t1driver.c b/reactos/lib/3rdparty/freetype/src/type1/t1driver.c index 571f2d2f8cd..716dd55e4a2 100644 --- a/reactos/lib/3rdparty/freetype/src/type1/t1driver.c +++ b/reactos/lib/3rdparty/freetype/src/type1/t1driver.c @@ -87,8 +87,8 @@ static const FT_Service_GlyphDictRec t1_service_glyph_dict = { - (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)t1_get_name_index + (FT_GlyphDict_GetNameFunc) t1_get_glyph_name, /* get_name */ + (FT_GlyphDict_NameIndexFunc)t1_get_name_index /* name_index */ }; @@ -106,7 +106,7 @@ static const FT_Service_PsFontNameRec t1_service_ps_name = { - (FT_PsName_GetFunc)t1_get_ps_name + (FT_PsName_GetFunc)t1_get_ps_name /* get_ps_font_name */ }; @@ -118,11 +118,11 @@ #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT static const FT_Service_MultiMastersRec t1_service_multi_masters = { - (FT_Get_MM_Func) T1_Get_Multi_Master, - (FT_Set_MM_Design_Func) T1_Set_MM_Design, - (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, - (FT_Get_MM_Var_Func) T1_Get_MM_Var, - (FT_Set_Var_Design_Func)T1_Set_Var_Design + (FT_Get_MM_Func) T1_Get_Multi_Master, /* get_mm */ + (FT_Set_MM_Design_Func) T1_Set_MM_Design, /* set_mm_design */ + (FT_Set_MM_Blend_Func) T1_Set_MM_Blend, /* set_mm_blend */ + (FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */ + (FT_Set_Var_Design_Func)T1_Set_Var_Design /* set_var_design */ }; #endif @@ -567,18 +567,18 @@ static const FT_Service_PsInfoRec t1_service_ps_info = { - (PS_GetFontInfoFunc) t1_ps_get_font_info, - (PS_GetFontExtraFunc) t1_ps_get_font_extra, - (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names, - (PS_GetFontPrivateFunc)t1_ps_get_font_private, - (PS_GetFontValueFunc) t1_ps_get_font_value, + (PS_GetFontInfoFunc) t1_ps_get_font_info, /* ps_get_font_info */ + (PS_GetFontExtraFunc) t1_ps_get_font_extra, /* ps_get_font_extra */ + (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names, /* ps_has_glyph_names */ + (PS_GetFontPrivateFunc)t1_ps_get_font_private, /* ps_get_font_private */ + (PS_GetFontValueFunc) t1_ps_get_font_value, /* ps_get_font_value */ }; #ifndef T1_CONFIG_OPTION_NO_AFM static const FT_Service_KerningRec t1_service_kerning = { - T1_Get_Track_Kerning, + T1_Get_Track_Kerning, /* get_track */ }; #endif @@ -689,36 +689,37 @@ 0x10000L, 0x20000L, - 0, /* format interface */ + 0, /* module-specific interface */ - T1_Driver_Init, - T1_Driver_Done, - Get_Interface, + T1_Driver_Init, /* FT_Module_Constructor module_init */ + T1_Driver_Done, /* FT_Module_Destructor module_done */ + Get_Interface, /* FT_Module_Requester get_interface */ }, sizeof ( T1_FaceRec ), sizeof ( T1_SizeRec ), sizeof ( T1_GlyphSlotRec ), - T1_Face_Init, - T1_Face_Done, - T1_Size_Init, - T1_Size_Done, - T1_GlyphSlot_Init, - T1_GlyphSlot_Done, + T1_Face_Init, /* FT_Face_InitFunc init_face */ + T1_Face_Done, /* FT_Face_DoneFunc done_face */ + T1_Size_Init, /* FT_Size_InitFunc init_size */ + T1_Size_Done, /* FT_Size_DoneFunc done_size */ + T1_GlyphSlot_Init, /* FT_Slot_InitFunc init_slot */ + T1_GlyphSlot_Done, /* FT_Slot_DoneFunc done_slot */ - T1_Load_Glyph, + T1_Load_Glyph, /* FT_Slot_LoadFunc load_glyph */ #ifdef T1_CONFIG_OPTION_NO_AFM - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ + 0, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ #else - Get_Kerning, - T1_Read_Metrics, + Get_Kerning, /* FT_Face_GetKerningFunc get_kerning */ + T1_Read_Metrics, /* FT_Face_AttachFunc attach_file */ #endif - T1_Get_Advances, - T1_Size_Request, - 0 /* FT_Size_SelectFunc */ + T1_Get_Advances, /* FT_Face_GetAdvancesFunc get_advances */ + + T1_Size_Request, /* FT_Size_RequestFunc request_size */ + 0 /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/lib/3rdparty/freetype/src/type1/t1load.c b/reactos/lib/3rdparty/freetype/src/type1/t1load.c index dbf4eafd716..4ce1e35aeb8 100644 --- a/reactos/lib/3rdparty/freetype/src/type1/t1load.c +++ b/reactos/lib/3rdparty/freetype/src/type1/t1load.c @@ -336,6 +336,9 @@ mmvar->axis[i].strid = ~0U; /* Does not apply */ mmvar->axis[i].tag = ~0U; /* Does not apply */ + if ( !mmvar->axis[i].name ) + continue; + if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 ) mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' ); else if ( ft_strcmp( mmvar->axis[i].name, "Width" ) == 0 ) @@ -1420,6 +1423,21 @@ } num_subrs = (FT_Int)T1_ToInt( parser ); + if ( num_subrs < 0 ) + { + parser->root.error = FT_THROW( Invalid_File_Format ); + return; + } + + /* we certainly need more than 8 bytes per subroutine */ + if ( num_subrs > ( parser->root.limit - parser->root.cursor ) >> 3 ) + { + FT_TRACE0(( "parse_subrs: adjusting number of subroutines" + " (from %d to %d)\n", + num_subrs, + ( parser->root.limit - parser->root.cursor ) >> 3 )); + num_subrs = ( parser->root.limit - parser->root.cursor ) >> 3; + } /* position the parser right before the `dup' of the first subr */ T1_Skip_PS_Token( parser ); /* `array' */ diff --git a/reactos/lib/3rdparty/freetype/src/type42/t42drivr.c b/reactos/lib/3rdparty/freetype/src/type42/t42drivr.c index 2907096c9f1..45ad0df7cc4 100644 --- a/reactos/lib/3rdparty/freetype/src/type42/t42drivr.c +++ b/reactos/lib/3rdparty/freetype/src/type42/t42drivr.c @@ -90,8 +90,8 @@ static const FT_Service_GlyphDictRec t42_service_glyph_dict = { - (FT_GlyphDict_GetNameFunc) t42_get_glyph_name, - (FT_GlyphDict_NameIndexFunc)t42_get_name_index + (FT_GlyphDict_GetNameFunc) t42_get_glyph_name, /* get_name */ + (FT_GlyphDict_NameIndexFunc)t42_get_name_index /* name_index */ }; @@ -110,7 +110,7 @@ static const FT_Service_PsFontNameRec t42_service_ps_font_name = { - (FT_PsName_GetFunc)t42_get_ps_font_name + (FT_PsName_GetFunc)t42_get_ps_font_name /* get_ps_font_name */ }; @@ -161,11 +161,12 @@ static const FT_Service_PsInfoRec t42_service_ps_info = { - (PS_GetFontInfoFunc) t42_ps_get_font_info, - (PS_GetFontExtraFunc) t42_ps_get_font_extra, - (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names, - (PS_GetFontPrivateFunc)t42_ps_get_font_private, - (PS_GetFontValueFunc) NULL /* not implemented */ + (PS_GetFontInfoFunc) t42_ps_get_font_info, /* ps_get_font_info */ + (PS_GetFontExtraFunc) t42_ps_get_font_extra, /* ps_get_font_extra */ + (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names, /* ps_has_glyph_names */ + (PS_GetFontPrivateFunc)t42_ps_get_font_private, /* ps_get_font_private */ + /* not implemented */ + (PS_GetFontValueFunc) NULL /* ps_get_font_value */ }; @@ -212,32 +213,32 @@ 0x10000L, 0x20000L, - 0, /* format interface */ + 0, /* module-specific interface */ - T42_Driver_Init, - T42_Driver_Done, - T42_Get_Interface, + T42_Driver_Init, /* FT_Module_Constructor module_init */ + T42_Driver_Done, /* FT_Module_Destructor module_done */ + T42_Get_Interface, /* FT_Module_Requester get_interface */ }, sizeof ( T42_FaceRec ), sizeof ( T42_SizeRec ), sizeof ( T42_GlyphSlotRec ), - T42_Face_Init, - T42_Face_Done, - T42_Size_Init, - T42_Size_Done, - T42_GlyphSlot_Init, - T42_GlyphSlot_Done, + T42_Face_Init, /* FT_Face_InitFunc init_face */ + T42_Face_Done, /* FT_Face_DoneFunc done_face */ + T42_Size_Init, /* FT_Size_InitFunc init_size */ + T42_Size_Done, /* FT_Size_DoneFunc done_size */ + T42_GlyphSlot_Init, /* FT_Slot_InitFunc init_slot */ + T42_GlyphSlot_Done, /* FT_Slot_DoneFunc done_slot */ - T42_GlyphSlot_Load, + T42_GlyphSlot_Load, /* FT_Slot_LoadFunc load_glyph */ - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ + 0, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + 0, /* FT_Face_GetAdvancesFunc get_advances */ - 0, /* FT_Face_GetAdvancesFunc */ - T42_Size_Request, - T42_Size_Select + T42_Size_Request, /* FT_Size_RequestFunc request_size */ + T42_Size_Select /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/lib/3rdparty/freetype/src/type42/t42parse.c b/reactos/lib/3rdparty/freetype/src/type42/t42parse.c index 003b63ed775..04eba8e1206 100644 --- a/reactos/lib/3rdparty/freetype/src/type42/t42parse.c +++ b/reactos/lib/3rdparty/freetype/src/type42/t42parse.c @@ -575,6 +575,9 @@ while ( parser->root.cursor < limit ) { + FT_ULong size; + + cur = parser->root.cursor; if ( *cur == ']' ) @@ -637,7 +640,7 @@ string_buf = parser->root.cursor + 1; /* one space after `RD' */ - if ( (FT_ULong)( limit - parser->root.cursor ) < string_size ) + if ( (FT_ULong)( limit - parser->root.cursor ) <= string_size ) { FT_ERROR(( "t42_parse_sfnts: too much binary data\n" )); error = FT_THROW( Invalid_File_Format ); @@ -666,6 +669,11 @@ goto Fail; } + /* The whole TTF is now loaded into `string_buf'. We are */ + /* checking its contents while copying it to `ttf_data'. */ + + size = (FT_ULong)( limit - parser->root.cursor ); + for ( n = 0; n < string_size; n++ ) { switch ( status ) @@ -683,7 +691,7 @@ status = BEFORE_TABLE_DIR; face->ttf_size = 12 + 16 * num_tables; - if ( (FT_Long)( limit - parser->root.cursor ) < face->ttf_size ) + if ( (FT_Long)size < face->ttf_size ) { FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" )); error = FT_THROW( Invalid_File_Format ); @@ -714,6 +722,14 @@ len = FT_PEEK_ULONG( p ); + if ( len > size || + face->ttf_size > (FT_Long)( size - len ) ) + { + FT_ERROR(( "t42_parse_sfnts:" + " invalid data in sfnts array\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } /* Pad to a 4-byte boundary length */ face->ttf_size += (FT_Long)( ( len + 3 ) & ~3U ); @@ -721,7 +737,6 @@ status = OTHER_TABLES; - /* there are no more than 256 tables, so no size check here */ if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables, face->ttf_size + 1 ) ) goto Fail; @@ -795,6 +810,17 @@ error = FT_THROW( Invalid_File_Format ); goto Fail; } + + /* we certainly need more than 4 bytes per glyph */ + if ( loader->num_glyphs > ( limit - parser->root.cursor ) >> 2 ) + { + FT_TRACE0(( "t42_parse_charstrings: adjusting number of glyphs" + " (from %d to %d)\n", + loader->num_glyphs, + ( limit - parser->root.cursor ) >> 2 )); + loader->num_glyphs = ( limit - parser->root.cursor ) >> 2; + } + } else if ( *parser->root.cursor == '<' ) { diff --git a/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c b/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c index 4bfa55a4296..acd31b1cf13 100644 --- a/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c +++ b/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c @@ -1121,7 +1121,7 @@ static const FT_Service_WinFntRec winfnt_service_rec = { - winfnt_get_header + winfnt_get_header /* get_header */ }; /* @@ -1161,32 +1161,32 @@ 0x10000L, 0x20000L, - 0, + 0, /* module-specific interface */ - 0, /* FT_Module_Constructor */ - 0, /* FT_Module_Destructor */ - winfnt_get_service + 0, /* FT_Module_Constructor module_init */ + 0, /* FT_Module_Destructor module_done */ + winfnt_get_service /* FT_Module_Requester get_interface */ }, sizeof ( FNT_FaceRec ), sizeof ( FT_SizeRec ), sizeof ( FT_GlyphSlotRec ), - FNT_Face_Init, - FNT_Face_Done, - 0, /* FT_Size_InitFunc */ - 0, /* FT_Size_DoneFunc */ - 0, /* FT_Slot_InitFunc */ - 0, /* FT_Slot_DoneFunc */ + FNT_Face_Init, /* FT_Face_InitFunc init_face */ + FNT_Face_Done, /* FT_Face_DoneFunc done_face */ + 0, /* FT_Size_InitFunc init_size */ + 0, /* FT_Size_DoneFunc done_size */ + 0, /* FT_Slot_InitFunc init_slot */ + 0, /* FT_Slot_DoneFunc done_slot */ - FNT_Load_Glyph, + FNT_Load_Glyph, /* FT_Slot_LoadFunc load_glyph */ - 0, /* FT_Face_GetKerningFunc */ - 0, /* FT_Face_AttachFunc */ - 0, /* FT_Face_GetAdvancesFunc */ + 0, /* FT_Face_GetKerningFunc get_kerning */ + 0, /* FT_Face_AttachFunc attach_file */ + 0, /* FT_Face_GetAdvancesFunc get_advances */ - FNT_Size_Request, - FNT_Size_Select + FNT_Size_Request, /* FT_Size_RequestFunc request_size */ + FNT_Size_Select /* FT_Size_SelectFunc select_size */ }; diff --git a/reactos/media/doc/3rd Party Files.txt b/reactos/media/doc/3rd Party Files.txt index eeafa2501d6..45b1befe62d 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.1 +Used Version: 2.6.2 Website: http://www.freetype.org Title: Mesa3D -- 2.17.1
' + bname + '