Index: lib/3rdparty/freetype/ChangeLog =================================================================== --- lib/3rdparty/freetype/ChangeLog (revision 62563) +++ lib/3rdparty/freetype/ChangeLog (working copy) @@ -1,3 +1,1048 @@ +2014-03-06 Werner Lemberg + + * Version 2.5.3 released. + ========================= + + + Tag sources with `VER-2-5-3'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.5.3. + + * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, + builds/windows/vc2005/index.html, + builds/windows/vc2008/freetype.vcproj, + builds/windows/vc2008/index.html, + builds/windows/vc2010/freetype.vcxproj, + builds/windows/vc2010/index.html, + builds/windows/visualc/freetype.dsp, + builds/windows/visualc/freetype.vcproj, + builds/windows/visualc/index.html, + builds/windows/visualce/freetype.dsp, + builds/windows/visualce/freetype.vcproj, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.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. + * builds/doc/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. + +2014-02-28 Alexei Podtelezhnikov + + [cff] Math simplifications. + + * src/cf2blues.c (cf2_blues_init): Use `FT_MulDiv'. + * src/cf2ft.c (cf2_getScaleAndHintFlag): Use simple division. + +2014-02-28 Dave Arnold + + [cff] Fix Savannah bug #41697, part 2. + + * 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. + +2014-02-28 Dave Arnold + + [cff] Fix Savannah bug #41697, part 1. + + * 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'. + +2014-02-26 Werner Lemberg + + [sfnt] Fix Savannah bug #41696. + + * src/sfnt/ttcmap.c (tt_cmap0_validate, tt_cmap2_validate, + tt_cmap4_validate, tt_cmap14_validate): Fix limit tests. + +2014-02-26 Werner Lemberg + + [winfnt] Fix Savannah bug #41694. + + * src/winfonts/winfnt.c (FNT_Load_Glyph): Check glyph offset. + +2014-02-26 Werner Lemberg + + [cff] Fix Savannah bug #41693. + + * src/cff/cffload.c (CFF_Load_FD_Select): Reject empty array. + +2014-02-26 Werner Lemberg + + [bdf] Fix Savannah bug #41692. + + 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. + + 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. + + * src/bdf/bdflib.c: s/ft_memcmp/ft_strncmp/ to make comparisons + stop at string ends. + +2014-02-17 suzuki toshiya + + [autofit] Fix `make multi' compilation. + + * src/autofit/hbshim.c: Include `afglobal.h' and `aftypes.h'. + +2014-02-19 Werner Lemberg + Simon Bünzli + + Fix Savannah bug #32902. + + Patch taken from + + https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/_patches/freetype2.patch?spec=svn8620&r=8620#87 + + with slight modifications. + + * 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. + +2014-02-19 Simon Bünzli + + Fix Savannah bug #41590. + + * src/type1/t1load.c (parse_encoding): Protect against invalid + number. + +2014-02-12 Dave Arnold + + [cff] Optimize by using `FT_MulDiv'. + Suggested by Alexei. + + * src/cff/cf2font.c (cf2_computeDarkening): Do it. + +2014-02-12 Werner Lemberg + + Fix Savannah bug #41465. + + * builds/unix/unix-def.in (CLEAN): Add `freetype-config'. + (DISTCLEAN): Remove `freetype-config'. + +2014-02-08 Sean McBride + + Fix clang static analyzer and compiler warnings. + + * 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. + + * 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. + + * src/base/ftobjs.c (ft_remove_renderer): Protect against + library == NULL. + (ft_property_do): Make function static. + + * src/base/ftrfork.c: Include `ftbase.h'. + + * 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. + + * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of + variable. + +2014-02-08 Werner Lemberg + + Fix Windows build directories. + + The build target is now `windows' instead of `win32'. + + Problem reported by Nickolas George . + + * builds/modules.mk: Don't use `win32' and `win16' (!) but + `windows'. + + * builds/windows/detect.mk, builds/windows/win32-def.mk: + s/win32/windows/. + +2014-02-08 Eugen Sawin + + Fix Savannah bug #41507. + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) + [!FT_CONFIG_OPTION_USE_PNG] <17, 17, 19>: Fix error handling. + +2014-02-08 Dave Arnold + + [cff] Fix minor performance bug. + + * src/cff/cf2font.c (cf2_font_setup): Darkening amount and blue zone + calculations are now cached and not recomputed on each glyph. + +2014-02-05 Werner Lemberg + + Fix problems with perl 5.8.8 as distributed with current MinGW. + + * src/tools/afblue.pl: Work-around for Perl bug #63402. + (string_re): Avoid `possessive quantifiers', which have been + introduced in Perl version 5.10. + +2014-02-04 Werner Lemberg + + Fix compilation with MinGW. + + 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. + + https://sourceforge.net/p/mingw/bugs/2024/ + https://sourceforge.net/p/mingw/bugs/2046/ + + * builds/unix/configure.raw: Don't set `-ansi' flag for MinGW. + +2014-02-04 Werner Lemberg + + [autofit] Minor fix. + + * 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. + +2014-02-03 Werner Lemberg + + [cff] Fix Savannah bug #41363. + + * 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. + +2014-01-26 Werner Lemberg + + [autofit] Introduce two more slots for standard characters. + + 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. + + * src/autofit/afscript.h: Add more standard characters. + + * src/autofit/aftypes.h: Update use of `SCRIPT' macro. + (AF_ScriptClassRec): Add members to hold two more standard + characters. + (AF_DEFINE_SCRIPT_CLASS): Updated. + + * 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/autofit/afcjk.c (af_cjk_metrics_init_widths), + src/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more + standard characters. + +2014-01-24 Werner Lemberg + + Fix Savannah bug #41320. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues) + : Avoid negative index of `last'. + +2014-01-23 Werner Lemberg + + Fix Savannah bug #41310. + + * 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. + +2014-01-23 Werner Lemberg + + Fix Savannah bug #41309. + + * src/type1/t1load.c (t1_parse_font_matrix): Properly handle result + of `T1_ToFixedArray'. + + * src/cid/cidload.c (cid_parse_font_matrix): Synchronize with + `t1_parse_font_matrix'. + + * src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with + `t1_parse_font_matrix'. + (t42_parse_encoding): Synchronize with `t1_parse_encoding'. + + * src/psaux/psobjs.c (ps_parser_load_field) , + : Properly handle result of `ps_tofixedarray'. + +2014-01-22 Werner Lemberg + + * src/autofit/hbshim.c (af_get_coverage): Fix memory leaks. + +2014-01-16 Werner Lemberg + + [autofit] Improve tracing of style coverages. + + * include/internal/fttrace.h: Add `afglobal' for tracing style + coverages. + + * src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H. + (FT_COMPONENT): Define. + (af_face_globals_compute_style_coverage): Trace `gstyles' array + data. + +2014-01-09 Werner Lemberg + + Fix Savannah bug #41158. + + * builds/unix/install.mk (install): Create man page directory. + +2014-01-08 Chongyu Zhu + + [arm] Fix Savannah bug #41138, part 2. + + * 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'. + +2014-01-08 Werner Lemberg + + [autofit] Fix Savannah bug #41138, part 1. + + * src/tools/afblue.pl : Produce correct auxiliary + enumeration names for generated `#else'. + + * src/autofit/afblue.h: Regenerated. + +2014-01-06 Werner Lemberg + + Add manual page for `freetype-config'. + Contributed by Nis Martensen . + + * docs/freetype-config.1: New file. + + * builds/unix/unix-def.in (mandir): Define. + * builds/unix/install.mk (install, uninstall): Handle manpage. + +2014-01-05 Werner Lemberg + + [autofit] Minor fixes for `afblue.pl'. + + * src/tools/afblue.pl (aux_name): Don't use `reverse'. + : Use proper indentation for generated `#else'. + + * src/autofit/afblue.h: Regenerated. + +2014-01-04 Werner Lemberg + + [autofit] Fix Indic scripts. + + 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. + + * src/autofit/afscript.h: Updated, using AF_CONFIG_OPTION_INDIC and + AF_CONFIG_OPTION_CJK. + + * 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. + + * src/autofit/afranges.c [AF_CONFIG_OPTION_INDIC]: Updated. + [!AF_CONFIG_OPTION_INDIC, !AF_CONFIG_OPTION_CJK]: Removed. + Sort entries by tags. + +2014-01-03 Werner Lemberg + + [autofit] Thinko. + + * src/autofit/hbshim.c (af_get_char_index): Similar to + `af_get_coverage', reject glyphs which are not substituted. + +2014-01-03 Werner Lemberg + + [autofit] Fix handling of default coverages. + + With this commit, the implementation of coverage handling is + completed. + + * src/autofit/hbshim.c (af_get_coverage): Exit early if nothing to + do. + Reject coverages which don't contain appropriate glyphs for blue + zones. + +2014-01-03 Werner Lemberg + + [autofit] Fix handling of default coverages. + + * 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. + +2014-01-03 Werner Lemberg + + [autofit] Fix scaling of HarfBuzz shaping. + + * src/autofit/hbshim.c (af_get_char_index): Scale to units per EM. + +2014-01-03 Werner Lemberg + + [autofit] Better ftgrid support. + + * src/autofit/afhints.c (af_glyph_hints_get_segment_offset): Add + parameters `is_blue' and `blue_offset'. + +2014-01-01 Werner Lemberg + + [autofit] Remove some styles. + + * src/autofit/afcover.h: Remove coverages for alternative fractions, + denominators, numerators, and fractions. + + * src/autofit/afstyles.h (META_STYLE_LATIN): Updated. + +2014-01-01 Werner Lemberg + + [autofit] Add more styles. + + * src/autofit/afstyles.h (STYLE_LATIN, META_STYLE_LATIN): New + auxiliary macros; use them to define styles for Cyrillic, Greek, and + Latin. + + * 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. + + * src/autofit/afglobal.c (af_face_globals_get_metrics): Don't limit + `options' parameter to 4 bits. + +2014-01-01 Werner Lemberg + + [autofit] Fix style assignments to glyphs. + + * 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. + +2014-01-01 Werner Lemberg + + * src/autofit/hbshim.c: s/{lookups,glyphs}/gsub_{lookups,glyphs}/. + +2014-01-01 Werner Lemberg + + [autofit] Implement and use `af_get_char_index' with HarfBuzz. + + * 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. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Use + `y_offset' to adjust `best_y'. + +2013-12-31 Werner Lemberg + + [autofit] s/AF_STYLE_...._DEFAULT/AF_STYLE_...._DFLT/i. + +2013-12-31 Werner Lemberg + + [autofit] Fix interface of `af_get_char_index'. + + * 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/autofit/hbshim.h, src/autofit/afcjk.c, + src/autofit/aflatin.c: Updated. + +2013-12-30 Werner Lemberg + + [autofit] Don't combine multiple features into one set. + + 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. + + * 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'. + + * src/autofit/aftypes.h: Updated. + * src/autofit/hbshim.c: Updated. + +2013-12-28 Werner Lemberg + + [autofit] Code shuffling to reduce use of cpp macros. + + * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): + Call `af_get_coverage' unconditionally. + + * src/autofit/autofit.c: Include `hbshim.c' unconditionally. + + * src/autofit/hbshim.c (af_get_coverage) + [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function. + + * src/autofit/hbshim.h: Provide function declarations + unconditionally. + +2013-12-28 Werner Lemberg + + [autofit] Add wrapper function for `FT_Get_Char_Index'. + + Yet-to-come changes will provide HarfBuzz functionality for the new + function. + + * src/autofit/hbshim.c (af_get_char_index): New function. + * src/autofit/hbshim.h: Updated. + + * src/autofit/afcjk.c (af_cjk_metrics_init_widths, + af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated. + + * src/autofit/aflatin.c (af_latin_metrics_init_widths, + af_latin_metrics_init_blues, af_latin_metrics_check_digits): + Updated. + +2013-12-28 Werner Lemberg + + [autofit] Use `global' HarfBuzz font object. + + We now use `hb_font' instead of `hb_face' since yet-to-come changes + need this. + + * src/autofit/afglobal.h: Include `hbshim.h'. + (AF_FaceGlobalsRec) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New member + `hb_font'. + + * 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'. + + * src/autofit/hbshim.h: Include HarfBuzz headers. + + * src/autofit/hbshim.c: Include `hbshim.h' instead of HarfBuzz + headers. + (af_get_coverage): Updated. + +2013-12-27 Werner Lemberg + + [autofit] Handle `DFLT' OpenType script for coverages. + + * include/ftautoh.h: Document new `default-script' property. + + * 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. + + * src/autofit/hbshim.h: Updated. + + * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): + Updated. + + * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT): New macro. + + * src/autofit/afmodule.h (AF_ModuleRec): New `default_script' + member. + + * src/autofit/afmodule.c (af_property_set, af_property_get): Handle + `default-script' property. + (af_autofitter_init): Updated. + +2013-12-27 suzuki toshiya + + [ftrfork] Fix the face order difference between POSIX and Carbon. + + 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. + + http://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.html + http://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html + + * 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. + +2013-12-25 Werner Lemberg + + Fix Savannah bug #40997. + + * 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. + +2013-12-21 Werner Lemberg + + [autofit] Introduce `coverages'. + + Coverages are the interface to the HarfBuzz library to acces + OpenType features for handling glyphs not addressable by the cmap. + + 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. + + 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. + + * devel/ftoption.h, include/config/ftoption.h + (FT_CONFIG_OPTION_USE_HARFBUZZ): New macro. + + * src/autofit/hbshim.c, src/autofit/hbshim.h, src/autofit/afcover.h: + New files. + + * src/autofit/afscript.h: Add HarfBuzz script name tags. + + * src/autofit/afstyles.h: Add default coverage enumeration values. + + * 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. + + * include/internal/fttrace.h: Add `afharfbuzz' for tracing coverage + data. + + * src/autofit/afglobal.h: Update use of `SCRIPT' and `STYLE' macros. + (AF_SCRIPT_FALLBACK): Renamed to ... + (AF_STYLE_FALLBACK): ... this. + + * 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. + + * src/autofit/afmodule.h (AF_ModuleRec): + s/fallback_script/fallback_style/. + + * 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. + + * src/autofit/afpic.c: Update use of `SCRIPT' and `STYLE' macros. + + * src/autofit/afranges.h: Update use of `SCRIPT' macro. + + * src/autofit/autofit.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include + `hbshim.c'. + + * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `hbshim.c'. + (AUTOF_DRV_H): Add `afcover.h'. + + * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Use pkg-config for + all libraries needed by FreeType. + +2013-12-21 Werner Lemberg + + Fix Savannah bug #40975 (sort of). + + * src/truetype/ttinterp.c (Ins_IP): Fix sign typo to make FreeType + behave the same as the Windows TrueType engine for the invalid case. + +2013-12-21 Werner Lemberg + + [autofit] Make PIC mode work actually. + + * src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the + enumeration values automatically generated by including `afscript.h' + and friends. + + * src/autofit/afpic.c (autofit_module_class_pic_init): Updated. + +2013-12-21 Werner Lemberg + + Fix PIC linking. + + * include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix + generated function name. + + * 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/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so + that PIC functions are compiled also. + +2013-12-21 Werner Lemberg + + [base] Add missing dependencies to Makefile. + + * src/base/rules.mk (BASE_SRC): Add `basepic.c' and `ftpic.c'. + (BASE_H): Add `basepic.h'. + +2013-12-20 Werner Lemberg + + [autofit] Fix PIC compilation. + + * src/autofit/afcjk.c (af_cjk_metrics_init_widths), + src/autofit/aflatin.c (af_latin_metrics_init_widths) + [FT_CONFIG_OPTION_PIC]: Declare `globals'. + + * src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and + AF_DEFINE_STYLE_CLASS. + + * src/autofit/afpic.c: Include `afglobal.h'. + (autofit_module_class_pic_init): Typo. + + * src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS, + AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro + parameter and structure member. + +2013-12-20 Werner Lemberg + + [autofit] Introduce `styles'. + + This is the new top-level structure for handling glyph input data; + scripts are now defined separately. + + * 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. + + * src/autofit/afstyles.h: New file, using data from `afscript.h'. + * src/autofit/afscript.h: Updated. + + * src/autofit/afcjk.c (af_cjk_metrics_init_widths, + af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated. + + * 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. + + * 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/autofit/aflatin.c (af_latin_metrics_init_widths, + af_latin_metrics_init_blues, af_latin_metrics_scale_dim, + af_latin_hint_edges): Updated. + + * src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated. + (af_ltn2_uniranges): Removed. + + * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): + Updated. + + * 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. + + * src/autofit/afranges.h: Updated. + + * src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'. + +2013-12-19 Werner Lemberg + + [autofit] Factor scripts and uniranges out of writing system files. + + * src/autofit/afranges.c, src/autofit/afranges.h: New files. + + * src/autofit/afscript.h: Extend `SCRIPT' macro with more + parameters, taking data from the writing system files. + + * src/autofit/aftypes.h: Updated. + + * 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. + + * 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. + + * src/autofit/afpic.c: Updated. + + * src/autofir/autofit.c: Include `afranges.c'. + * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'. + +2013-12-18 Werner Lemberg + + [autofit] More code orthogonality. + + * 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. + + * src/autofit/afcjk.c: Include `afpic.h'. + (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, + af_cjk_hint_edges): Updated. + + * 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. + + * src/autofit/afglobal.c (af_face_globals_get_metrics): Updated. + + * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): + Updated. + +2013-12-18 Werner Lemberg + + [autofit] s/ScriptMetrics/StyleMetrics/. + +2013-12-18 Werner Lemberg + + [autofit] s/script_{metrics,hints}/style_{metrics,hints}/ + +2013-12-18 Werner Lemberg + + [autofit] s/gscripts/gstyles/. + +2013-12-18 Werner Lemberg + + [autofit] s/glyph_scripts/glyph_styles/. + + 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. + +2013-12-17 Werner Lemberg + + [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate. + +2013-12-11 Infinality + + [truetype] Simplify logic of rendering modes. + + This patch unifies the subpixel and non-subpixel cases. + + * 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/ttgload.c (TT_LOADER_SET_PP): Updated. + (tt_loader_init): Updated. + + * src/truetype/ttinterp.c (Ins_GETINFO): Simplify. + Updated. + +2013-12-11 Werner Lemberg + + [documentation] Add section how to include FreeType header files. + Problem reported by David Kastrup . + + Surprisingly, a description how to do that was completely missing in + the API reference. + + * include/freetype.h, include/ftchapters.h: New documentation + section `header_inclusion'. + +2013-12-10 Werner Lemberg + + [autofit] s/DFLT/NONE/, s/dflt/none/. + +2013-12-10 Werner Lemberg + + [autofit] s/AF_SCRIPT_NONE/AF_SCRIPT_UNASSIGNED/. + +2013-12-10 Werner Lemberg + + [truetype] Fix scaling of vertical phantom points. + + * src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and + pp4.x also. + +2013-12-10 Werner Lemberg + + [truetype] Fix positioning of composite glyphs. + Problem reported by Nigel Tao . + + * 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. + 2013-12-08 Werner Lemberg * Version 2.5.2 released. @@ -26,9 +1071,10 @@ builds/wince/vc2008-ce/freetype.vcproj, builds/wince/vc2008-ce/index.html: s/2.5.1/2.5.2/, s/251/252/. - * 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 17:1:11. + * CMakeLists.txt (VERSION_PATCH): Set to 2. * docs/CHANGES: Updated. 2013-12-07 Werner Lemberg @@ -136,7 +1182,7 @@ * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. * builds/unix/configure.raw (version_info): Set to 17:0:11. - * CMakeLists.txt (VERSION_PATCH): Set to 2. + * CMakeLists.txt (VERSION_PATCH): Set to 1. * docs/CHANGES, docs/release: Updated. 2013-11-23 Werner Lemberg @@ -2138,6353 +3184,9 @@ */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code. -2013-05-08 Werner Lemberg - - * Version 2.4.12 released. - ========================== - - - Tag sources with `VER-2-4-12'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.12. - - * 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.11/2.4.12/, s/2411/2412/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 12. - - * builds/unix/configure.raw (version_info): Set to 16:1:10. - -2013-05-08 Werner Lemberg - - * docs/CHANGES: Updated. - -2013-05-08 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Typo. - -2013-05-05 Werner Lemberg - - Synchronize `ftconfig.h'. - - * builds/unix/ftconfig.in: Updated. - -2013-05-05 Werner Lemberg - - Fix compilation with C++. - - * src/base/md5.c (body): Use proper cast. - -2013-05-05 Werner Lemberg - - Fix 64bit compilation issues. - - * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef - `FT_Int64' here. - - * src/base/ftcalc.c: Remove typedef of `FT_Int64'. - (FT_DivFix): Fix cast. - * src/base/fttrigon.c: Remove typedef of `FT_Int64'. - -2013-05-05 Werner Lemberg - - [raster] Fix clang issues. - - Fix suggested by . - - * src/raster/ftraster.c (ULong): New typedef. - (SCALED): Add proper cast. - -2013-05-04 Werner Lemberg - - Fix clang fixes. - - * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate): Use - correct types. - - * src/cff/cf2intrp.c (cf2_interpT2CharString) : Force - unsigned for computations. - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Ditto. - * src/cff/cffparse.c (cff_parse_integer): Ditto. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. - -2013-05-04 Werner Lemberg - - [cff] Make Adobe CFF engine work correctly on 64bit hosts. - - Reported by numerous people on the `freetype-devel' list. Without - this fix, glyphs aren't properly aligned on a common baseline. - - On 64bit systems, `FT_Pos' expands to `long int', having a width of - 64bit. `CF2_Fixed' expands to `int' which is normally 32bit wide on - 64bit hosts also. Wrong casts filled up the blues arrays with - incorrect values. Note that all blues values are accessed with the - `cf2_blueToFixed' macro which handles the 64bit to 32bit conversion. - - * src/cff/cf2ft.h (cf2_getBlueValues, cf2_getOtherBlues, - cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Use `FT_Pos' for - `data', not `CF2_Fixed'. - * src/cff/cf2ft.c (cf2_getBlueValues, cf2_getOtherBlues, - cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated. - * src/cff/cf2blues.c (cf2_blues_init): Updated. - -2013-05-04 Werner Lemberg - - More fixes for clang's `sanitize' feature. - - * src/base/ftcalc.c (FT_DivFix): Use unsigned values for - computations which use the left shift operator and convert to signed - as the last step. - * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate, - FT_Vector_Length, FT_Vector_Polarize): Ditto. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify. - * src/cff/cffload.c (cff_subfont_load): Fix constant. - * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed, - cff_parse_fixed_dynamic): Use unsigned values for computations which - use the left shift operator and convert to signed as the last step. - - * src/cid/cidload.c (cid_get_offset): Ditto. - - * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto. - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. - - * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto. - -2013-05-04 Werner Lemberg - - Fix errors reported by clang's `sanitize' feature. - - * include/freetype/internal/ftstream.h: Simplify and fix integer - extraction macros. - (FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32, - FT_INT8_I32, FT_INT8_U32): Removed. - (FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE, - FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for - computations and convert to signed as the last step. - - * src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt, - cf2_fracToFixed): Avoid shifts of negative values. - (cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed, - unused. - - * src/cff/cf2intrp.c (cf2_interpT2CharString) : Use unsigned values for computations and convert to signed - as the last step. - Use proper types in tracing messages. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned - values for computation of operands and convert to signed as the last - step. - Use proper type in tracing message. - -2013-05-03 Werner Lemberg - - * src/cff/cf2blues.c: Remove dead code. - -2013-05-02 Chris Liddell - - * src/cff/cffgload.c: Include FT_CFF_DRIVER_H. - -2013-04-27 Werner Lemberg - - * docs/CHANGES: Updated. - * README: Improved. - -2013-04-13 Werner Lemberg - - [cff] Add a new Type 2 interpreter and hinter. - - This work, written by Dave Arnold and fully - integrated into FreeType by me, is a donation by Adobe in - collaboration with Google. It is vastly superior to the old CFF - engine, and it will replace it soon. Right now, it is still off by - default, and you have to explicitly select it using the new - `hinting-engine' property of the cff driver. - - For convenience, (most of) the new files are committed separately. - - * include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro. - * include/freetype/ftcffdrv.h: New file to access CFF driver - properties. - * include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error - code. - * include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints', - and `cf2interp'. - - * src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'. - * src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine' - and `no_stem_darkening'. - * src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'. - - * src/cff/cff.c: Include new files. - * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle - `hinting-engine' and `no-stem-darkening' properties (only the Adobe - engine listens to them). - * src/cff/cffgload.c: Include `cf2ft.h'. - (cff_decoder_prepare): Initialize `current_subfont'. - (cff_build_add_point): Handle Adobe engine which uses 16.16 - coordinates. - (cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING - separately. - Choose rendering engine based on `hinting_engine' property. - * src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe - engine. - * src/cff/cffobjs.c: Include FT_CFF_DRIVER_H. - (cff_driver_init): Set default property values. - - * src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files. - - * src/cff/cf2*.*: New files, containing the Adobe engine. - -2013-04-12 Werner Lemberg - - [cff] Minor code administration issues. - - * src/cff/cffgload.c (check_points): Rename to... - (cff_check_points): ...this and make it FT_LOCAL. - (cff_builder_add_point, cff_builder_add_point1, - cff_builder_start_point, cff_builder_close_contour, - cff_lookup_glyph_by_stdcharcode, cff_get_glyph_data, - cff_free_glyph_data): Make them FT_LOCAL. - - * src/cff/cffgload.h: Updated. - -2013-04-12 Werner Lemberg - - Add output bitmap checksums. - - Use `FT2_DEBUG=bitmap:3' for tracing. - - * src/base/md5.c, src/base/md5.h: New files, taken from - - http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 - - * include/freetype/internal/fttrace.h: Add `bitmap'. - - * src/base/ftobjs.c [FT_DEBUG_LEVEL_TRACE]: Include `md5.c' - - (FT_Render_Glyph_Internal) [FT_DEBUG_LEVEL_TRACE]: For tracing, - convert resulting bitmap to a uniform format and compute a checksum. - Use `bitmap' category for the tracing message. - - * src/base/rules.mk (BASE_H): Updated. - - * docs/LICENSE.TXT: Updated. - -2013-04-12 Werner Lemberg - - [cff] Add framework for CFF properties. - - * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC7): - New macro. - - * src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H. - (cff_property_set, cff_property_get): New functions, still empty. - Define `cff_service_properties' service. - Update `cff_services'. - - * src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H. - (CFF_SERVICE_PROPERTIES_GET): New macro. - (CffModulePIC): Add `cff_service_properties'. - -2013-04-03 Werner Lemberg - - [bdf] Fix Savannah bug #38589. - - * src/bdf/bdflib.c (_bdf_readstream): Thinko. - -2013-03-31 Werner Lemberg - - * configure: Use egrep, not grep. - - Problem reported Mojca Miklavec . - -2013-03-29 Werner Lemberg - - * include/freetype/ftlcdfil.h: Add description of color filtering. - - Based on a contribution from Antti S. Lankila - (Savannah bug #38607). - -2013-03-23 Werner Lemberg - - [autofit] Minor. - - * src/autofit/afmodule.c (af_property_set): Typo. - (af_autofitter_init, af_autofitter_done): Use cast. - -2013-03-21 Werner Lemberg - - * configure: Automatically test for `gmake' also. - - Suggested by Mojca Miklavec . - -2013-03-21 Peter Breitenlohner - - Respect CONFIG_SHELL from the environment. - - Some large packages using FreeType have to use a broken (deficient) - /bin/sh. The configure scripts (as generated by Autoconf) are - clever enough to find a better shell and put that one into the - environment variable CONFIG_SHELL. If that environment variable is - already set the script skips the test and assumes to be already - running under a good shell. - - * builds/unix/detect.mk: Honour CONFIG_SHELL. - * builds/unix/unix-def.in (SHELL): Define. - -2013-03-21 Werner Lemberg - - Fix Savannah patch #7971. - - * configure: Handle MAKE environment variable also. - -2013-03-17 Werner Lemberg - - Fix Savannah bug #38538. - - * builds/amiga/src/base/ftdebug.c, builds/win32/ftdebug.c, - builds/wince/ftdebug.c (FT_Throw): Add function. - -2013-03-17 Werner Lemberg - - [raster] Remove dead code. - - * src/raster/rastpic.c (ft_raster1_renderer_class_pic_init) - src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init): Do it. - -2013-03-17 Werner Lemberg - - * src/pshinter/pshpic.h (GET_PIC): Use correct container. - -2013-03-15 Werner Lemberg - - * include/freetype/ftmoderr.h: Fix commit from 2013-03-11. - - The previous version was not backwards compatible. Reported by - Behdad. - -2013-03-14 Werner Lemberg - - */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. - - FT_Err_XXX and friends are no longer directly used in the source - code. - -2013-03-14 Werner Lemberg - - New error management macros. - - * include/freetype/fterrors.h (FT_ERR_XCAT, FT_ERR_CAT): Move to... - * include/freetype/fttypes.h: ... this file. - (FT_ERR, FT_ERR_EQ, FT_ERR_NEQ, FT_MODERR_EQ, FT_MODERR_NEQ): New - macros. - - * include/freetype/freetype.h: Updated. - -2013-03-14 Werner Lemberg - - */*: Use FT_Err_Ok only. - - This is a purely mechanical conversion. - -2013-03-14 Werner Lemberg - - */*: Use `FT_THROW'. - - This is essentially a mechanical conversion, adding inclusion of - `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for - stand-alone compiling modes of the rasterizer modules. - - To convert the remaining occurrences of FT_Err_XXX and friends it is - necessary to rewrite the code. Note, however, that it doesn't harm - if some cases are not handled since FT_THROW is a no-op. - -2013-03-13 Werner Lemberg - - Introduce `FT_THROW' macro. - - The idea is to replace code like - - return FT_Err_Foo_Bar; - - or - - return CFF_Err_Foo_Bar; - - with - - return FT_THROW( Foo_Bar ); - - The FT_THROW macro has two functions: - - . It hides the module specific prefix. - - . In debug mode, it calls the empty function `FT_Throw' which can - be thus used to set a breakpoint. - - * include/freetype/internal/ftdebug.h (FT_THROW): New macro. - (FT_Throw): New prototype. - * src/base/ftdebug.c (FT_Throw): New function. - -2013-03-12 Werner Lemberg - - Remove `FT_KEEP_ERR_PREFIX'. - - The idea is to always have FT_ERR_PREFIX available internally. - - * include/freetype/fterrors.h: Use FT2_BUILD_LIBRARY to guard - undefinition of FT_ERR_PREFIX - - * src/gxvalid/gxverror.h, src/otvalid/otverror.h, - src/sfnt/sferrors.h: Updated. - -2013-03-11 Werner Lemberg - - [gxvalid] Fix module error. - - * src/gxvalid/gxverror.h (FT_ERR_BASE): Define as - FT_Mod_Err_GXvalid. - * include/freetype/ftmoderr.h: Add module error for `GXvalid'. - -2013-03-11 Werner Lemberg - - Always use module related error codes. - - * src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c - (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use - `FT_ERROR_BASE'. - - * src/type1/t1load.c (parse_encoding): Use - T1_Err_Unknown_File_Format. - -2013-03-08 Werner Lemberg - - [cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also. - - Problem reported by Khaled Hosny . - - * src/cff/cffgload.c (cff_slot_load): Implement it. - -2013-02-23 Alexei Podtelezhnikov - - [base] Fix commit ab02d9e8. - - * src/base/ftbbox.c (BBox_Cubic_Check): Change scaling to msb of 22. - -2013-02-19 Alexei Podtelezhnikov - - [base] New bisecting BBox_Cubic_Check (disabled). - - * src/base/ftbbox.c (BBox_Cubic_Check): New bisecting algorithm - for extremum search built around simple condition that defines - which half contains the extremum. - -2013-02-18 Alexei Podtelezhnikov - - [tools] Update BBox testing tool. - - * src/tools/test_bbox.c: Add another cubic outline with exact BBox. - (REPEAT): Increase the number of benchmarking cycles. - (profile_outline): Tweak output formatting. - -2013-02-02 Werner Lemberg - - Fix Savannah bug #38235. - - * builds/unix/configure.raw: Don't generate `freetype-config' and - `freetype.pc'. - - * builds/unix/unix-def.in (FT2_EXTRA_LIBS, LIBBZ2, LIBZ, - build_libtool_libs, ft_version): New variables to be substituted. - (freetype-config, freetype.pc): New rules to generate those files. - - * builds/unix/freetype-config.in: Remove code for handling `rpath'. - The use of $rpath has been accidentally removed in a patch from - 2009-12-22, and apparently noone has missed it since. - Use `%' instead of `@' as a variable substitution marker. - Use quotes. - - * builds/unix/freetype.in: Use `%' instead of `@' as a variable - substitution marker. - Use quotes. - -2013-02-07 Werner Lemberg - - * src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables. - - BTW, Greg agrees that the OpenType specification is missing the list - of GS variables which will always be reset to the default values - after the `prep' table has been executed. - -2013-02-06 Werner Lemberg - - * src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points. - - Up to now, we simply took a snapshot of the Graphics State after the - `prep' table has been executed, and right before a glyph's bytecode - was run it got reloaded. However, as Greg Hitchcock has told us in - private communication, reference points get reset to zero in the MS - rasterizer and we follow in due course. While reasonable, this is - undocumented behaviour. - - Most notably, this fixes the rendering of Arial's `x' glyph in - subpixel hinting mode. - -2013-02-05 Werner Lemberg - - [truetype] A better fix for Savannah bug #38211. - - * src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to - MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock). - -2013-02-01 Alexei Podtelezhnikov - - [pcf] Streamline parsing of PCF encoding table. - - * src/pcf/pcfread.c (pcf_get_encodings): Use simpler double for-loop. - Reallocate array instead of using temporary storage. - -2013-02-01 Werner Lemberg - - Fix Savannah bug #38227. - - * builds/unix/freetype-config.in: Set LC_ALL. - -2013-02-01 Werner Lemberg - - Fix Savannah bug #38221. - - This complements commit 83c0ebab. - - * src/base/ftcalc.c (FT_MulDiv_No_Round): Don't enclose with - `TT_USE_BYTECODE_INTERPRETER'. - -2013-02-01 Werner Lemberg - - [truetype] Fix Savannah bug #38211. - - * src/truetype/ttinterp.c (Ins_IP): Make FreeType behave identical - to other interpreters if rp1 == rp2 (which is invalid). - -2013-01-28 Alexei Podtelezhnikov - - [base] Small optimization of BBox calculation. - - * src/base/ftbbox.c (BBox_Cubic_Check): Use FT_MSB function in - scaling algorithm. - -2013-01-26 Infinality - - [truetype] Minor formatting fix. - - * src/truetype/ttinterp.c: Updated. - (DO_RS): Fix indentation. - -2013-01-26 Infinality - - [truetype] Fix rasterizer_version logic in sph. - - * src/truetype/ttsubpix.c: Updated. - (ALWAYS_SKIP_DELTAP_Rules): Remove rule for Trebuchet MS. - (sph_set_tweaks): Fix `rasterizer_version' logic. - -2013-01-26 Infinality - - [truetype] Align more to ClearType whitepaper for sph. - - * include/freetype/internal/tttypes.h (TT_FaceRec): Add flags - for detected opcode patterns and compatibility mode. - - * src/truetype/ttgload.c (tt_loader_init): Complete conditional. - - * src/truetype/ttinterp.c: Updated. - Remove SPH_DEBUG and replace with FT_TRACE7. - (DO_RS): More conditions. - (Ins_FDEF): Add more opcode detection patterns. - More specific conditions when flagging an fdef. - Make compatibility mode only turn on when delta fdefs are found. - (Ins_CALL, Ins_LOOPCALL): Set flags for currently executed fdef. - (Ins_SHPIX): Remove logic to handle ttfautohinted fonts. - Simplify conditionals where possible. - Use `&' instead of `%' operator for dumb compilers. - (Ins_MIAP): Adjust twilight zone conditional. - Ensure `ignore_x_mode' is on when testing sph conditionals. - (Ins_MIRP): Ensure `ignore_x_mode' is on when testing sph - conditionals. - Do cvt cutin always when `ignore_x_mode' is active. - Remove test for ttfautohinted fonts. - (Ins_DELTAP): Ensure `ignore_x_mode' is on when testing sph - conditionals. - Do cvt cutin always when `ignore_x_mode' is active. - Remove test for ttfautohinted fonts. - Use `&' instead of `%' operator for dumb compilers. - (Ins_GETINFO): Remove SPH_DEBUG and replace with FT_TRACE7. - - * src/truetype/ttinterp.h: Updated. - (TT_ExecContextRec): Remove compatibility_mode variable. - Add variable to indicate when executing in special fdefs for sph. - - * src/truetype/ttobjs.h: Updated. - (TT_DefRecord): Add flags to identify special fdefs for sph. - (TT_SizeRec): Remove unnecessary ttfautohinted variable. - - * src/truetype/ttsubpix.c: Updated. - (COMPATIBILITY_MODE_Rules): Remove all. Auto-detected now. - (PIXEL_HINTING_Rules): Remove all. Unnecessary after fixes. - (SKIP_NONPIXEL_Y_MOVES_Rules): Remove Ubuntu. - (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Arial Bold `N'. - (SKIP_OFFPIXEL_Y_MOVES_Rules): Remove all. Happens automatically - now. - (ROUND_NONPIXEL_Y_MOVES_Rules): Remove Ubuntu. - (ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions): Remove all. - (NORMAL_ROUND_Rules): Remove Verdana. - (NO_DELTAP_AFTER_IUP_Rules): Remove all. - (sph_set_tweaks): Performance fix. Don't run prep always. - Adjust conditional for sph_compatibility_mode. - - * src/truetype/ttsubpix.h: Add new fdef flags for sph. - -2013-01-23 Alexei Podtelezhnikov - - [base] Fix broken emboldening at small sizes. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to - normalize zero-length vectors. - -2013-01-25 Werner Lemberg - - Fix Savannah bug #38167. - - This fixes commit 83c0ebab from 2012-06-27. - - * src/truetype/ttinterp.h: - s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/. - -2013-01-25 Xi Wang - - [sfnt] Fix broken pointer overflow checks. - - Many compilers such as gcc and clang optimize away pointer overflow - checks `p + n < p', because pointer overflow is undefined behavior. - Use a safe form `n > p_limit - p' instead. - - Also avoid possible integer overflow issues, for example, using - `num_glyphs > ( p_limit - p ) / 2' rather than `num_glyphs * 2' - given a large `num_glyphs'. - - * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Implement it. - -2013-01-25 Werner Lemberg - - [base] Fix `make multi'. - - * src/base/ftoutln.c, src/base/fttrigon.c: Include - FT_INTERNAL_CALC_H. - -2013-01-25 David 'Digit' Turner - - [truetype] Fix C++ compilation. - - * src/truetype/ttsubpix.h: Updated. - (SPH_X_SCALING_RULES_SIZE): Moved and renamed to... - * src/truetype/ttsubpix.c (X_SCALING_RULES_SIZE): This. - (sph_X_SCALING_Rules): Removed. - (scale_test_tweak): Make function static. - (sph_test_tweak_x_scaling): New function. - - * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Updated. - -2013-01-23 Werner Lemberg - - [base] Make `FT_Hypot' really internal. - - * include/freetype/fttrigon.h (FT_Hypot): Move to... - * include/freetype/internal/ftcalc.h: This file. - - * src/base/fttrigon.c (FT_Hypot): Move to... - * src/base/ftcalc.c: This file. - Include FT_TRIGONOMETRY_H. - - * src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H. - -2013-01-23 Werner Lemberg - - [truetype] Revert change from 2013-01-22. - - FreeType's `height' value is the baseline-to-baseline distance... - - * src/truetype/ttobjs.c (tt_size_reset): Undo. - -2013-01-23 Alexei Podtelezhnikov - - [base, truetype] New internal `FT_Hypot' function. - - * include/freetype/fttrigon.h (FT_Hypot): Declare it. - * src/base/fttrigon.c (FT_Hypot): Define it. - * src/truetype/ttgload.c (TT_Process_Composite_Component): Use it - instead of explicit expressions. - * src/truetype/ttinterp.c (Current_Ratio, Normalize): Use it instead - of TT_VecLen. - (TT_VecLen): Removed. - -2013-01-23 Alexei Podtelezhnikov - - [base] Fix integer overflow. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and - outgoing vectors and use fixed point arithmetic. - -2013-01-23 Alexei Podtelezhnikov - - [base] Fix integer overflow. - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Scale the - coordinates down to avoid overflow. - -2013-01-23 Alexei Podtelezhnikov - - [base] Split out MSB function. - - * src/base/fttrigon.c (ft_trig_prenorm): Borrow from here. - * include/freetype/internal/ftcalc.h (FT_MSB): Declare here. - * src/base/ftcalc.c (FT_MSB): Define here. - -2013-01-22 Werner Lemberg - - [truetype] Fix font height. - - * src/truetype/ttobjs.c (tt_size_reset): The Windows rendering - engine uses rounded values of the ascender and descender to compute - the TrueType font height. - -2013-01-16 Behdad Esfahbod - - [sfnt] Fix optimized sbit loader. - - It was not taking bit_depth into consideration when blitting! - - * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_byte_aligned, - * tt_sbit_decoder_load_bit_aligned): Handle bit - depth. - -2013-01-16 David 'Digit' Turner - - [truetype] Improve sub-pixel code. - - This patches fixes many issues with the ttsubpix implementation. - - 1. Data tables are defined, instead of declared, in the header, and - thus copied into each source file that includes it. - - 2. These tables were defined as global, mutable, visible variables, - and thus costing private RAM to every process that loads the - library (> 50 KB / process, this is huge!). - - Additionally, this also made the library export the symbols - completely needlessly. - - 3. Missing `sph_' and `SPH_' prefixes to some of the definitions. - - Note that this doesn't try to fix the incredibly inefficient storage - format for the data tables used by the code. This one will require - another pass in the future. - - * src/truetype/ttinterp.h (MAX_NAME_SIZE, MAX_CLASS_MEMBERS): - Renamed to... - (SPH_MAX_NAME_SIZE, SPH_MAX_CLASS_MEMBERS): This. - Update all users. - - (SPH_TweakRule, SPH_ScaleRule): Decorate with `const' where - appropriate. - - (Font_Class): Rename to... - (SPH_Font_Class): This. Decorate with `const' where appropriate. - - * src/truetype/ttsubpix.h (scale_test_tweak, sph_test_tweak): - Decorate arguments with `const' where appropriate. - - Move font tweaking tables to... - - * src/truetype/ttsubpic.c: This file and decorate them with `static' - and `const' where appropriate. - - (X_SCALING_Rules, X_SCALING_RULES_SIZE): Renamed to... - (spu_X_SCALING_Rules, SPH_X_SCALING_RULES_SIZE): This. - Update all users. - -2013-01-12 Alexei Podtelezhnikov - - [truetype] Improve accuracy of normalization of short vectors. - - Unit vector components are stored as 2.14 fixed-point numbers. In - order to calculate all 14 bits accurately, a short vector to be - normalized has to be upscaled to at least 14 bits before its length - is calculated. This has been safe since accurate CORDIC algorithms - were adopted. - - * src/truetype/ttinterp.c (Normalize): Scale short vectors by 0x4000. - -2013-01-12 Alexei Podtelezhnikov - - [truetype] Kill very old vector normalization hacks. - - Back in the days, vector length calculations were not very accurate - and the vector normalization function, Normalize, had to meticulously - correct the errors for long vectors [commit b7ef2b096867]. It was no - longer necessary after accurate CORDIC algorithms were adopted, but - the code remained. It is time to kill it. - - * src/truetype/ttinterp.c (Normalize): Remove error compensation. - (TT_VecLen): Remove any mention of old less accurate implementation. - -2013-01-11 Werner Lemberg - - Disable FT_CONFIG_OPTION_OLD_INTERNALS. - - After the next release we are going to remove the code completely. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (FT_CONFIG_OPTION_OLD_INTERNALS): Comment out. - * docs/CHANGES: Document it. - -2013-01-10 Alexei Podtelezhnikov - - [base] Update the overflow protection bit. - - The recent optimizations of CORDIC iterations drastically reduce the - expansion factor. Vector components with MSB of 29 are now safe - from overflow. - - * src/base/fttrigon.c (FT_TRIG_SAFE_MSB): New macro. - (ft_trig_prenorm): Use it and remove dead code. - -2013-01-09 Alexei Podtelezhnikov - - [base, pshinter] Use FT_ABS, FT_MIN, and FT_MAX for readability. - - * src/base/ftbbox.c: Updated. - * src/base/ftobjs.c: Updated. - * src/base/fttrigon.c: Updated. - * src/pshinter/pshalgo.c: Updated. - * src/pshinter/pshrec.c: Updated. - -2013-01-08 Alexei Podtelezhnikov - - [base] Clean up trigonometric core. - - * src/base/fttrigon.c: Document the algorithm in a large comment. - (FT_TRIG_COSCALE): Remove macro. - (FT_Tan: Use `FT_TRIG_SCALE' instead. - (FT_Cos, FT_Vector_Unit): Ditto and round the return values. - -2013-01-02 Alexei Podtelezhnikov - - [base] Use rounding in CORDIC iterations. - - * src/base/fttrigon.c (ft_trig_pseudo_rotate, - ft_trig_pseudo_polarize): Improve accuracy by rounding. - -2013-01-02 Alexei Podtelezhnikov - - [base] Reduce trigonometric algorithms. - - After we get within 45 degrees by means of true 90-degree rotations, - we can remove initial 45-degree CORDIC iteration and start from - atan(1/2) pseudorotation, reducing expansion factor thereby. - - * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macros. - (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Update. - - * src/tools/cordic.py: Bring up to date with trigonometric core. - - * docs/CHANGES: Old typo. - -2013-01-02 Alexei Podtelezhnikov - - * src/pshinter/pshalgo.h: Remove unused code. - -2012-12-27 Werner Lemberg - - * src/truetype/ttgload.c (tt_loader_init): Add more tracing. - -2012-12-23 Werner Lemberg - - [type1] Fix handling of /FontBBox in MM fonts. - Problem reported by Del Merritt - - If we have - - /FontBBox { { 11 12 13 14 15 16 17 18 } - { 21 22 23 24 25 26 27 28 } - { 31 32 33 34 35 36 37 38 } - { 41 42 43 44 45 46 47 48 } } - - in the /Blend dictionary, then the first BBox is { 11 21 31 41 }, - the second { 12 22 32 42 }, etc. - - * include/freetype/internal/psaux.h (T1_FieldType): Add - `T1_FIELD_TYPE_MM_BBOX' (for temporary use). - - * src/psaux/psobjs.c (ps_parser_load_field) : - Implement it. - -2012-12-21 Alexei Podtelezhnikov - - * src/tools/cordic.py: Bring up to date with trigonometric core. - -2012-12-21 Werner Lemberg - - Check parameters of `FT_Outline_New'. - Problem reported by Robin Watts . - - * src/base/ftoutln.c (FT_Outline_New_Internal): Ensure that - `numContours' and `numPoints' fit into FT_Outline's `n_points' and - `n_contours', respectively. - -2012-12-20 Werner Lemberg - - * Version 2.4.11 released. - ========================== - - - Tag sources with `VER-2-4-11'. - - * docs/CHANGES, docs/release: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.11. - - * 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.10/2.4.11/, s/2410/2411/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11. - - * builds/unix/configure.raw (version_info): Set to 16:0:10. - - * builds/toplevel.mk (dist): Don't include `.mailmap'. - -2012-12-20 Alexei Podtelezhnikov - - [base] Improve trigonometric core. - - FreeType used to rely on a 24-step iteration CORDIC algorithm to - calculate trigonometric functions and rotate vectors. It turns out - that once the vector is in the right half-plane, the initial rotation - by 63 degrees is not necessary. The algorithm is perfectly capable - to converge to any angle starting from the second 45 degree rotation. - This patch removes the first rotation and makes it a 23-step CORDIC - algorithm. - - * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macro - values. - (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Remove initial - rotation. - -2012-12-19 Werner Lemberg - - * src/base/ftobjs.c (ft_property_do): Fix compiler warning. - -2012-12-19 Alexei Podtelezhnikov - - * src/base/ftrfork.c (FT_Raccess_Guess): Switch to FT_Int counters. - -2012-12-19 Alexei Podtelezhnikov - - [base] Clean up trigonometric core. - - * src/base/fttrrigon.c (ft_trig_pseudo_polarize): Align algorithm - with `ft_trig_pseudo_rotate'. - -2012-12-18 Infinality - - [truetype] Minor performance enhancement. - - * src/truetype/ttgload.c: (TT_Process_Simple_Glyph): Use FT_MulFix - instead of FT_MulDiv. - -2012-12-17 Infinality - - [truetype] Remove unusued code and variables. - - * src/truetype/ttinterp.c: Updated. - (Ins_FDEF): Remove opcode patterns that are not being used. - -2012-12-16 Werner Lemberg - - Various compiler warning fixes. - - * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Use - `logical not' operator instead of negation. The idea is that `~' - returns exactly the data type enforced by the cast to a pointer (be - it 32bit or 64bit or whatever), while a negative integer has not - this flexibility. - * src/cache/ftccmap.c (FTC_CMAP_UNKNOWN): Ditto. - * src/truetype/ttgxvar.c (ALL_POINTS, TT_Get_MM_Var): Ditto. - * src/type/t1load.c (T1_Get_MM_Var): Ditto. - (parse_blend_axis_types): Use cast. - * src/bdf/bdflib.c (_bdf_readstream): Use cast. - -2012-12-16 Infinality - - [truetype] Remove unusued code and variables. Add minor fixes. - - * src/truetype/ttsubpix.h: Updated. - (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Trebuchet MS. - (ALLOW_X_DMOVEX_Rules): Remove Arial characters. - (ALLOW_X_DMOVE_Rules): Remove Arial characters. - (RASTERIZER_35_Rules): Verdana no longer needs to be here. - (SKIP_IUP_Rules): Formatting fix. - (DELTAP_SKIP_EXAGGERATED_VALUES_Rules): Remove Segoe UI. - (COMPATIBLE_WIDTHS_Rules): Add Monaco and Trebuchet MS. - (X_SCALING_Rules): Add misc. corrective fixes. - - * src/truetype/ttgload.c: (TT_Process_Simple_Glyph): Adjust correction - factor for emboldening during scaling. - - * src/truetype/ttinterp.h: Updated. - (TT_ExecContextRec): Remove unused variables. - - * src/truetype/ttobjs.h: Updated. - (TT_SizeRec): Add ttfautohinted variable. - - * src/truetype/ttinterp.c: Updated. - (Ins_FDEF): Rework code to fix bugs and add more detection. - (Ins_CALL): Remove unused code. - (Ins_LOOPCALL): Remove unused code. - (TT_RunIns): Remove unusued code. - (Ins_SHPIX): Add logic to handle ttfautohinted fonts. - (Ins_MIRP): Don't round x in cut-in calculation. Add logic to handle - ttfautohinted fonts. - -2012-12-16 Werner Lemberg - - [sfnt] Fix Savannah bug #37936. - - * src/sfnt/ttload.c (tt_face_load_gasp): Avoid memory leak. - -2012-12-15 Alexei Podtelezhnikov - - [base] Fix 11-year old bug. - - Since the initial commit (ebe85f59) the value of FT_TRIG_SCALE has - always been slightly less than the correct value, which has been - given in the comment as a hexadecimal. As a result, vector lengths - were underestimated and rotated vectors were shortened. - - * src/base/fttrigon.c (FT_TRIG_SCALE): Fix macro value. - -2012-12-15 Werner Lemberg - - [bdf] Fix Savannah bug #37907. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Normalize - negative second parameter of `ENCODING' field also. - -2012-12-15 Werner Lemberg - - [bdf] Fix Savannah bug #37906. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Use correct array - size for checking `glyph_enc'. - -2012-12-15 Werner Lemberg - - [bdf] Fix Savannah bug #37905. - - * src/bdf/bdflib.c (_bdf_parse_start) : Reset - `props_size' to zero in case of allocation error; this value gets - used in a loop in `bdf_free_font'. - -2012-12-10 Alexei Podtelezhnikov - - [truetype] Scale F_dot_P down. - - The dot product between freeVector and projVector or cosine of - the angle between these FT_F2Dot14 unit vectors used to be scaled up - by 4 and routinely occupied 32 bits in an FT_Long field F_dot_P. - This patch scales the value down by 2^14 instead, which simplifies - its use throughout the bytecode interpreter. - - This does not lead to the loss of precision because the lower bits - are unreliable anyway. Consider two unit vectors (1,0) and (.6,.8) - for which the true value of F_dot_P is .6 * 0x40000000 = 0x26666666. - These vectors are stored as (0x4000,0) and (0x2666,0x3333) after - rounding and F_dot_P is assigned 0x26660000. The lower bits were - already lost while rounding the unit vector components. - - Besides code simplification, this change can lead to better - performance when FT_MulDiv with the scaled-down F_dot_P is less - likely to use the costly 64-bit path. We are not changing the type - of F_dot_P to FT_F2Dot14 at this point. - - * src/truetype/ttinterp.c (Compute_Funcs): Scale F_dot_P down by 14 - bits and modify its use accordingly. - (Direct_Move, Direct_Move_Orig, Compute_Point_Displacement): Modify - the use of F_dot_P field. - * src/truetype/ttobjs.c (tt_size_run_fpgm): Change arbitrary - assignment of F_dot_P to its theoretical maximum in case we decide - to scale back its type later. - -2012-12-09 Johnson Y. Yan - - [type1] Another fix for 2012-09-17 commit. - - * src/type1/t1parse.c (T1_Get_Private_Dict) : Correctly set - `limit' value. - -2012-12-06 Alexei Podtelezhnikov - - [truetype] Tweak the previous commit. - - * src/truetype/ttinterp.c (Current_Ratio): Put unit vector - components as the second TT_MulFix14 arguments. This is required - on 16-bit systems. - -2012-12-06 Alexei Podtelezhnikov - - [truetype] Microoptimizations in bytecode interpreter. - - * src/truetype/ttinterp.c (TT_DivFix14): New macro. - (Normalize): Use it here. - (Current_Ratio): Use TT_MulFix14 instead of FT_MulDiv. - (Ins_SHPIX): Cancel out two TT_MulFix14 calls. - -2012-12-05 Alexei Podtelezhnikov - - [truetype] Cosmetic improvement in bytecode interpreter. - - * src/truetype/ttinterp.c: Use explicit calls to FT_MulDiv, - FT_MulFix, and FT_DivFix instead of macros. - -2012-12-03 John Tytgat - - [pshinter] Clamp BlueScale value. - - This is Savannah bug #37856. - - * src/pshinter/pshglob.c (psh_calc_max_height): New function. - (psh_globals_new): Use it to limit BlueScale value to - `1 / max_of_blue_zone_heights'. - -2012-12-01 Alexei Podtelezhnikov - - [truetype, type1] Revise the use of FT_MulDiv. - - * src/truetype/ttgxvar.c: Updated. - * src/truetype/ttobjs.c: Updated. - * src/type1/t1load.c: Updated. - -2012-11-30 Werner Lemberg - - [configure] Preserve customized `ftoption.h'. - - Problem reported by Del Merritt . - - * builds/unix/configure.raw : Don't - remove existing FreeType configuration files. - -2012-11-29 John Tytgat - - [type1] Fix Savannah bug #37831. - - The bug report also contains a patch. - - * src/type1/t1parse.c (T1_Get_Private_Dict) : Really fix - change from 2012-09-17. - -2012-11-28 Alexei Podtelezhnikov - - [truetype] Fix formatting and typo. - -2012-11-27 Alexei Podtelezhnikov - - [cid, type1, type42] Clean up units_per_EM calculations. - - * src/cid/cidload.c (cid_parse_font_matrix): Updated. - * src/type1/t1load.c (t1_parse_font_matrix): Updated. - * src/type42/t42parse.c (t42_parse_font_matrix): Updated. - -2012-11-27 Alexei Podtelezhnikov - - [ftstroke] Minor improvement. - - * src/base/ftstroke.c: Replace nested FT_DivFix and FT_MulFix with - FT_MulDiv. - -2012-11-17 Werner Lemberg - - * src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work. - -2012-11-15 Alexei Podtelezhnikov - - [base] Fix integer overflows in dd5718c7d67a. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use FT_MulDiv. - -2012-11-15 Werner Lemberg - - [autofit] Trace stem widths. - - * src/autofit/aflatin.c (af_latin_metrics_init_widths): Add some - FT_TRACE calls. - -2012-11-13 Werner Lemberg - - [cff] Add support for OpenType Collections (OTC). - - * src/cff/cffload.c (cff_font_load): Separate subfont and face - index handling to load both pure CFFs with multiple subfonts and - OTCs (with multiple faces where each face holds exactly one - subfont). - * src/cff/cffobjs.c (cff_face_init): Updated. - -2012-11-12 Werner Lemberg - - [autofit] Minor improvement. - - * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Fix - loop. - -2012-11-10 Werner Lemberg - - [autofit] Improve tracing. - - * src/autofit/aflatin.c (af_latin_hint_edges) - [FT_DEBUG_LEVEL_TRACE]: Count number of actions and emit something - if there weren't any. - -2012-11-04 Alexei Podtelezhnikov - - [base] Fortify emboldening code against egregious distortions. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Threshold emboldening - strength when it leads to segment collapse. - -2012-11-03 Alexei Podtelezhnikov - - [base] Clean up emboldening code and improve comments there. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Replace sequential - calls to FT_MulFix and FT_DivFix with FT_MulDiv. - Mention that bisectors are used to figure out the shift direction. - -2012-10-24 Werner Lemberg - - [autofit] Add standard character to `AF_ScriptClassRec' structure. - - * src/autofit/aftypes.h (AF_ScriptClassRec): Add `standard_char' - member. - (AF_DEFINE_SCRIPT_CLASS): Updated. - - * src/autofit/aflatin.c (af_latin_metrics_init_widths): Use it. - (af_latin_metrics_init, af_latin_script_class): Updated. - - * src/autofit/aflatin.c (af_latin2_metrics_init_widths): Use it. - (af_latin2_metrics_init, af_latin2_script_class): Updated. - - * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Use it. - (af_cjk_metrics_init, af_cjk_script_class): Updated. - - * src/autofit/afindic.c (af_indic_metrics_init, - af_indic_script_class): Updated. - - * src/autofit/afcjk.h, src/autofit/aflatin.h: Updated. - - * src/autofit/afdummy.c: Updated. - -2012-10-24 Werner Lemberg - - [autofit] Only use Unicode CMap. - - * src/autofit/aflatin.c (af_latin_metrics_init): Implement it, to be - in sync with `af_face_globals_compute_script_coverage'. - -2012-10-21 Werner Lemberg - - [psaux] Improve parsing of invalid numbers. - - * src/psaux/psconv.c (PS_Conv_Strtol): Always parse complete number, - even in case of overflow. - (PS_Conv_ToInt): Only increase cursor if parsing was successful. - (PS_Conv_ToFixed): Ditto. - Trace underflow and data error. - -2012-10-21 Werner Lemberg - - [smooth] Improve tracing. - - * src/smooth/ftgrays.c (gray_sweep): Trace last sweep line of - current band also. - -2012-10-20 Alexei Podtelezhnikov - - [truetype] Cheaper way to threshold angles between vectors. - - * src/truetype/ttinterp.c (Ins_ISECT): Thresholding tangent is a lot - cheaper than thresholding sine. - -2012-10-20 Werner Lemberg - - [cff] Improve parsing of invalid real numbers. - - * src/cff/cffparse.c (cff_parse_real): Always parse complete number, - even in case of overflow or underflow. - Also trace one more underflow. - -2012-10-20 Andreas Pehnack - - [sfnt] Load pure CFF fonts wrapped in SFNT container. - - Such fonts only have a `cmap' and a `CFF' table. - - * src/sfnt/ttload.c (tt_face_load_font_dir): Don't call - `check_table_dir' if font signature is `OTTO'. - -2012-10-20 Werner Lemberg - - [psaux] Fix some value overflows and improve tracing. - - * src/psaux/psconv.c: Include FT_INTERNAL_DEBUG_H. - (FT_COMPONENT): Define. - (PS_Conv_Strtol): Return FT_Long. - Handle bad data and overflow. - Emit some tracing messages in case of error. - (PS_Conv_ToInt): Return FT_Long. - (PS_Conv_ToFixed): Updated. - * src/psaux/psconv.h: Updated. - - * include/freetype/internal/fttrace.h: Add `psconv'. - -2012-10-20 Werner Lemberg - - [autofit] Fix `make multi CC=c++'. - - * src/autofit/aflatin.c, src/autofit/aflatin2.c: Include - `afglobal.h'. - * src/autofit/afloader.c: Fix order of header files. - * src/autofit/afmodule.c: Include `afglobal.h' and `aferrors.h'. - -2012-10-19 Werner Lemberg - - [cff] Fix more value errors and improve tracing. - - * src/cff/cffparse.c (cff_parse_integer): Emit tracing message in - case of error. - (cff_parse_real): Handle and trace overflow, underflow, and bad data - consistently. - (do_fixed): New helper function, handling and tracing overflow. - (cff_parse_fixed, cff_parse_fixed_scaled): Use `do_fixed'. - -2012-10-17 Werner Lemberg - - [psaux] Fix some value overflows. - - * src/psaux/psconv.c (PS_Conv_ToFixed): Implement it. - -2012-10-17 Bram Tassyns - - [cff] Fix value overflow. - - * src/cff/cffparse.c (cff_parse_fixed_scaled): Implement it. - -2012-10-17 Werner Lemberg - - [truetype] Fix Savannah bug #37572. - - * src/truetype/ttinterp.c (Ins_ISECT): Use angle between vectors to - avoid grazing intersections. The previous threshold was too coarse, - incorrectly rejecting short but valid vectors. - -2012-09-30 Gilles Espinasse - - Remove useless `rm' detection. - - `rm -f' is directly used in the `configure' script created by - autoconf, thus no availability test is necessary. - - * builds/unix/configure.raw (RMF): Remove test. - * builds/unix/unix-def.in (DELETE): Updated. - -2012-09-29 Werner Lemberg - - [autofit] Minor optimization. - - * src/autofit/afglobals.c (af_face_globals_compute_script_coverage): - Add loop condition. - -2012-09-29 Werner Lemberg - - [autofit] Fix thinko. - - * src/autofit/aftypes.h (AF_SCRIPT): - s/AF_SCRIPT_NONE/AF_SCRIPT_DUMMY/. We already use `AF_SCRIPT_NONE' - as a bit mask. - - * src/autofit/afdummy.c: Updated. - -2012-09-18 Werner Lemberg - - [autofit] Implement `increase-x-height' property. - - * include/freetype/ftautoh.h (FT_Prop_IncreaseXHeight): New - structure. - - * include/autofit/afmodule.c (af_property_get_face_globals): New - function, re-using code from `af_property_get'. - (af_property_set, af_property_get): Handle `increase-x-height'. - Updated. - -2012-09-18 Werner Lemberg - - [autofit] Implement Infinality's `increase glyph heights'. - - This is an improved version of a similar fix contained in the - so-called `Infinality patch', taken from - - http://www.infinality.net/fedora/linux/zips/freetype-infinality-2.4.10-20120616_01-x86_64.tar.bz2 - - which addresses various enhancements of the auto-hinter. Without - properties to control a module's metadata it wasn't possible to - adapt the patches because everything was originally controlled by - environment variables which I consider not suitable in general. - - A patch to control `increase_x_height' follows. - - * src/autofit/afglobal.h (AF_PROP_INCREASE_X_HEIGHT_MIN, - AF_PROP_INCREASE_X_HEIGHT_MAX): New macros. - (AF_FaceGlobalsRec): Add `increase_x_height' member. - * src/autofit/afglobal.c (af_face_globals_new): Initialize it. - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim), - * src/autofit/aflatin2.c (af_latin2_metrics_scale_dim): Implement - handling of `increase_x_height'. - -2012-09-18 Werner Lemberg - - [autofit] Add hierarchical property access to some structures. - - * src/autofit/afglobal.h: Include `afmodule.h'. - (AF_FaceGlobalsRec): Add `module' member. - (AF_FaceGlobals): Typedef moved to... - * src/autofit/aftypes.h: Here. - (AF_ScriptMetricsRec): Add `globals' member. - - * src/autofit/afglobal.c (af_face_globals_new, - af_face_globals_compute_script_coverage, - af_face_globals_get_metrics): Updated. - - * src/autofit/afloader.c (af_loader_reset), src/autofit/afmodule.c - (af_property_get): Updated. - -2012-09-17 Werner Lemberg - - [type1] Fix Savannah bug #37350. - - * src/type1/t1parse.c (T1_Get_Private_Dict) : Check for ASCII - storage only if we actually have at least four bytes. - -2012-09-15 Werner Lemberg - - [autofit] Implement `fallback-script' property. - - * src/autofit/afglobal.c: s/default_script/fallback_script/. - * src/autofit/afglobal.h: s/AF_SCRIPT_DEFAULT/AF_SCRIPT_FALLBACK/. - - * src/autofit/afmodule.c: s/default_script/fallback_script/. - (af_property_set, af_property_get): Implement `fallback-script'. - * src/autofit/afmodule.h: s/default_script/fallback_script/. - - * include/freetype/ftautoh.h: Document it. - -2012-09-15 Werner Lemberg - - [autofit] Correct previous Unicode 6.1.0 change. - - The auto-hinter's latin module only handles latin ligatures in the - `Alphabetical Presentation Forms' block. - - * src/autofit/aflatin.c (af_latin_uniranges): Fix it. - -2012-09-15 Werner Lemberg - - * src/autofit/afmodule.c: s/FT_Err_/AF_Err_/. - -2012-09-15 Werner Lemberg - - [autofit] Make default script a global property. - - * src/autofit/afmodule.h (AF_ModuleRec): Add `default_script' field. - - * src/autofit/afglobal.c (af_face_globals_compute_script_coverage, - af_face_globals_new), src/autofit/afloader.c (af_loader_reset), - src/autofit/afmodule.c (af_property_get) , - af_autofitter_init: - Handle default script. - - * src/autofit/afglobal.h: Updated. - -2012-09-15 Werner Lemberg - - Use `FT_Module' instead of `FT_Library' argument in property funcs. - - This internal change simplifies access to global module data. - - * include/freetype/internal/services/svprop.h - (FT_Properties_SetFunc, FT_Properties_GetFunc): Change accordingly. - - * src/base/ftobjs.c (ft_property_do), src/autofit/afmodule.c - (af_property_set, af_property_get): Updated. - -2012-09-14 Werner Lemberg - - [autofit] Update to Unicode 6.1.0. - - * src/autofit/afcjk.c (af_cjk_uniranges), src/autofit/aflatin.c - (af_latin_uniranges): Add and fix ranges. - -2012-09-14 Werner Lemberg - - [autofit] Pass `AF_Module' instead of `AF_Loader'. - - We want to access the (not yet existing) module's global data later - on. - - * src/autofit/afloader.c: Include `afmodule.h'. - (af_loader_init, af_loader_reset, af_loader_done, - af_loader_load_glyph): Change accordingly. - * src/autofit/afmodule.c (AF_ModuleRec): Move to `afmodule.h'. - Updated. - - * src/autofit/afmodule.h: Include `afloader.h'. - (AF_ModuleRec): Define here. - * src/autofit/afloader.h (AF_Module): Define here. - Updated. - -2012-09-14 Werner Lemberg - - [autofit] Fix `make multi'. - - * include/freetype/internal/fttrace.h: Add `afmodule'. - * src/autofit/afmodule.c: Include FT_INTERNAL_DEBUG_H. - (FT_COMPONENT): Define. - -2012-09-14 Werner Lemberg - - * src/autofit/afmodule.c: s/FT_Autofitter/AF_Module/. - -2012-09-12 Werner Lemberg - - [autofit] Minor reorganization. - - * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT, - AF_SCRIPT_LIST_NONE, AF_DIGIT): Move to... - * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT, AF_SCRIPT_LIST_NONE, - AF_DIGIT): This and update code. - -2012-09-01 Werner Lemberg - - [autofit] Implement `glyph-to-script-map' property. - - * include/freetype/ftautoh.h: New public header file. - * include/freetype/config/ftheader.h (FT_AUTOHINTER_H): New macro. - - * src/autofit/afglobal.c (AF_FaceGlobalsRec): Move structure to... - * src/autofit/afglobal.h: This header file. - * src/autofit/afmodule.c: Include FT_AUTOHINTER_H. - (af_property_get): Handle `glyph-to-script-map'. - -2012-08-31 Werner Lemberg - - [autofit] Implement properties service framework. - - No properties are added yet. - - * src/autofit/afmodule.c: Include FT_SERVICE_PROPERTIES_H. - (af_property_set, af_property_get): New dummy functions. - (af_service_properties, af_services, af_get_interface): Provide - service setup. - (autofit_moduleclass): Add service interface. - - * src/autofit/afpic.c: Add necessary forward declarations. - (autofit_module_class_pic_init): Add code for service addition. - (autofit_module_pic_free): Add code for service removal. - * src/autofit/afpic.h (AF_SERVICES_GET, AF_SERVICE_PROPERTIES_GET): - New macros which provide necessary syntactical sugar for PIC - support. - -2012-08-30 Werner Lemberg - - Implement properties to control FreeType modules. - - * include/freetype/fterrdef.h (FT_Err_Missing_Property): New error - code. - * include/freetype/ftmodapi.h (FT_Property_Set, FT_Property_Get): - New API. - - * include/freetype/internal/services/svprop.h: New file. - * include/freetype/internal/ftserv.h (FT_SERVICE_PROPERTIES_H): New - macro. - - * src/base/ftobjs.c: Include FT_SERVICE_PROPERTIES_H. - (ft_property_do, FT_Property_Set, FT_Property_Get): New functions. - -2012-08-29 Werner Lemberg - - [docmaker] Allow `-' in tags and identifiers. - - * src/tools/docmaker/content.py (re_identifier), - src/tools/docmaker/sources.py (re_markup_tag1, re_markup_tag2, - re_crossref): Add `-' in patterns. - -2012-08-27 Werner Lemberg - - [FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings. - - * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER), - include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, - FT_DEFINE_MODULE), include/freetype/internal/ftserv.h - (FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2, - FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4, - FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6), - src/autofit/afpic.c (autofit_module_class_pic_init), - src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c - (ft_create_default_module_classes), src/cff/cffparse.c - (FT_Create_Class_cff_field_handlers), src/cff/cffpic.c - (cff_driver_class_pic_init), src/pshinter/pshpic.c - (pshinter_module_class_pic_init), src/psnames/pspic.c - (psnames_module_class_pic_init), src/raster/rastpic.c - (ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c - (sfnt_module_class_pic_init), src/sfnt/ttcmap.c - (FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c - (ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c - (tt_driver_class_pic_init): Initialize allocation variable. - -2012-08-27 Werner Lemberg - - [truetype] Fix compilation warning. - - * src/truetype/ttgload.c (IS_HINTED): Move macro to... - * src/truetype/ttobjs.h: This header file. - -2012-08-27 Werner Lemberg - - [autofit, cff, pshinter, psnames] More renamings for orthogonality. - - * src/autofit/afmodule.c, src/autofit/afpic.h: - s/AF_AUTOFITTER_/AF_/. - - * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffparse.c, - src/cff/cffpic.h: s/FT_CFF_/CFF_/. - - * src/pshinter/pshmod.c, src/pshinter/pshpic.h: - s/FT_PSHINTER_/PSHINTER_/. - - * src/psnames/psmodule.c, src/psnames/pspic.h: - s/FT_PSCMAPS/PSCMAPS_/. - -2012-08-27 Werner Lemberg - - [sfnt, truetype] More renamings for orthogonality. - - * src/sfnt/sfdriver.c, src/sfnt/sfntpic.h, src/sfnt/ttcmap.c, - src/truetype/ttdriver.c, src/truetype/ttpic.h: s/FT_SFNT_/SFNT_/, - s/FT_TT_/TT_/, s/GET_CMAP_INFO_GET/CMAP_INFO_GET/. - -2012-08-27 Werner Lemberg - - [autofit] Some macro and variable renamings for orthogonality. - - * include/freetype/internal/autohint.h, src/base/ftobjs.c, - src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h: - s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/. - -2012-08-26 Werner Lemberg - - Fix Savannah bug #37178. - - * src/base/ftobjs.c (FT_Open_Face): Initialize `error' with - `FT_Err_Missing_Module' before loop to indicate `no valid drivers'. - -2012-08-17 Werner Lemberg - - * src/base/ftsynth.c (FT_GlyphSlot_Oblique): Fix shear angle. - - The old value was far too large (more than 20°). The new one - corresponds to 12°, quite common in typography. - -2012-08-12 Alexei Podtelezhnikov - - [smooth] Fix Savannah bug #37017. - - * src/smooth/ftgrays.c (gray_render_cubic): Use a different set of - checks when detecting super curvy splines to be split. - -2012-08-05 Werner Lemberg - - [autofit] Improve recognition of flat segments. - - Problem reported by Brad Dunzer . - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): We have - a flat segment if the horizontal distance of best on-points is - larger than a given threshold. - -2012-08-05 Werner Lemberg - - [autofit] Variable renamings. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues): Replace - `glyph' with `outline'. - s/best_first/best_contour_first/. - s/best_last/best_contour_last/. - -2012-07-31 Werner Lemberg - - [type1] Fix Savannah bug #37000. - - * src/type1/t1load.c (parse_encoding): Fix order of checks. - -2012-07-17 Werner Lemberg - - [psaux] Fix Savannah bug #36833. - - * src/psaux/t1decode.c (t1operator_seac): `seac' is not a valid - operator if we want metrics only. - -2012-07-16 Werner Lemberg - - [type1] Fix Savannah bug #36832. - - * src/type1/t1load.c (parse_charstrings): Reject negative number of - glyphs. - -2012-07-13 Werner Lemberg - - [type1] Fix Savannah bug #36829. - - * src/type1/t1load.c (parse_encoding): Check cursor position after - call to T1_Skip_PS_Token. - -2012-07-12 Alexei Podtelezhnikov - - Revert the last commit 45337b07. - - * src/base/ftstroke.c (FT_Stroker_New): Revert the previous change. - -2012-07-11 Alexei Podtelezhnikov - - [ftstroke] Fix uninitialized return value. - - * src/base/ftstroke.c (FT_Stroker_New): Return FT_Err_Ok instead. - -2012-07-11 Werner Lemberg - - [smooth] Avoid memory leak in case of failure. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use flags to - indicate what to clean up after finishing the function, with and - without errors. - -2012-07-09 Werner Lemberg - - Fix compilation with MSVC 5.0. - - Problem reported by Peter Breitenlohner and Akira Kakuto. - - * include/freetype/config/ftstdlib.h (ft_setjmp): Updated. - * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove cast. - -2012-07-09 Werner Lemberg - - [autofit] Improve debugging messages; do some code cleanup. - - * src/autofit/aflatin.c (af_latin_align_linked_edge, - af_latin_hint_edges): Synchronize with formatting used in the - ttfautohint project. - -2012-07-07 Gilles Espinasse - - Fix strict-aliasing warning. - - * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Avoid double cast. - -2012-07-07 Dave Thomas - - [ARM] Fix FT_MulFix_arm. - - * include/freetype/config/ftconfig.h (FT_MulFix_arm) [__arm__]: - Avoid ADDS instruction to clobber condition codes. - -2012-07-06 Werner Lemberg - - [autofit] Do some code cleanup. - - * src/autofit/afglobal.c (af_face_globals_new): Simplify. - - * src/autofit/afhints.c: Use `FT_TRACE7' instead of `printf' - everywhere. - (FT_COMPONENT): New macro. - (af_glyph_hints_done): Simplify. - - * include/freetype/internal/fttrace.h: Updated. - -2012-07-05 Werner Lemberg - - [autofit] Improve output of debugging information. - - * src/autofit/afhints.c (af_glyph_hints_dump_segments): Print more - data; report no data. - (af_glyph_hints_dump_edges): Report no data. - -2012-07-04 Werner Lemberg - - [autofit] Fix Savannah bug #36091. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues), - src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Change the - constraint for testing round vs. flat segment: Accept either a - small distance or a small angle. - -2012-07-04 Werner Lemberg - - [autofit] Beautify blue zone tracing. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues), - src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Implement it. - -2012-07-03 Werner Lemberg - - [autofit] Quantize stem widths. - - * src/autofit/afangles.c (af_sort_widths): Rename to... - (af_sort_and_quantize_widths): This. - Add code to avoid stem widths which are almost identical. - * src/autofit/aftypes.h, src/autofit/aflatin.c, src/autofit/afcjk.c: - Updated. - -2012-07-03 Werner Lemberg - - [autofit] Minor speed-up. - - * src/autofit/afangles (af_sort_pos, af_sort_widths): Don't swap - elements if they are equal. - -2012-06-30 Gilles Espinasse - - Fix `checking if gcc static flag -static works' test. - - On my linux build tree, I receive yes answer in in every package I - build except freetype for this test checking if gcc static flag - `-static' works - - On freetype, no is received, unless bzip2 and zlib are disabled using - - ./configure --without-bzip2 --without-zlib - - The reason is that bzip2 and zlib tests add `-lz' and `-lbz2' to - LDFLAGS and this broke static flag test. - - * builds/unix/configure.raw: Update CFLAGS and LDFLAGS only after - LT_INIT has run. - -2012-06-28 Infinality - - [truetype] Fix various artifacts. - - Verdana was broken in the original Infinality commit. Also - includes other minor fixes. - - * src/truetype/ttsubpix.h: Updated. Removed unused macros. - (RASTERIZER_35_Rules): Add Verdana. - (SKIP_NONPIXEL_Y_MOVES_Rules): Add Tahoma `s'. - (MIRP_CVT_ZERO_Rules): Remove Verdana. - (ALWAYS_SKIP_DELTAP_Rules): Add Russian char 0x438. - (COMPATIBLE_WIDTHS_Rules): Rearrange some rules. - (X_SCALING_Rules): Adjust Verdana `a' at 12 and 13 ppem. - - * src/truetype/ttsubpix.c: Updated. - (sph_set_tweaks): Re-execute fpgm always. - -2012-06-28 Gilles Espinasse - - Fix CFLAGS and LDFLAGS share configure test. - - * builds/unix/configure.raw: Fix typo. - -2012-06-28 Werner Lemberg - - [truetype] Set the `subpixel_positioned' flag unconditionally. - - This is how the code currently behaves. - - * src/truetype/ttgload.c (tt_loader_init): Do it. - -2012-06-27 Werner Lemberg - - Fix conditional compilation. - - * src/base/basepic.c: Use FT_CONFIG_OPTION_MAC_FONTS. - -2012-06-27 Werner Lemberg - - Fix conditional compilation. - - * include/freetype/internal/ftcalc.h (FT_MulDiv_No_Round): Don't - enclose with `TT_USE_BYTECODE_INTERPRETER'; we now need the function - elsewhere also. - - * src/autofit/afcjk.h: Use AF_CONFIG_OPTION_CJK. - - * src/truetype/ttgload.c (tt_loader_init): Fix compiler warning. - - * src/truetype/ttinterp.c (Ins_MSIRP): Fix compiler warning. - - * src/truetype/ttinterp.h: Use - TT_CONFIG_OPTION_BYTECODE_INTERPRETER. - -2012-06-26 Infinality - - [truetype] Remove unused rounding functionality. - - The subpixel hinting patch contained the concept of an adjustable - number of gridlines per pixel. This is no longer used due to x - being completely ignored instead. This will return some of the - code to its existing state prior to the original Infinality - commit. - - * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID, - FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): Removed. - - * src/truetype/ttinterp.c: Updated. - (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid, - Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45, - SetSuperRound): Remove parameter to handle the number of grid lines per - pixel. - (SET_SuperRound, ROUND_None, CUR_Func_round): Updated. - (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated. - (DO_ROUND, DO_NROUND): Updated. - (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP, - Ins_MDRP, Ins_MIRP): Perform Round_None instead of calling a modified - rounding function. Remove gridlines_per_pixel. Create a local - variable to store control value cutin. Simplify the conditional for - ignore_x_mode. Adjust rounding calls to pass only two values. - -2012-06-25 Werner Lemberg - - [cff] Fix Savannah bug #36705. - - Handle numbers like 2.001 correctly. - - * src/cff/cffparse.c (cff_parse_real): Avoid negative values for - `shift'. - -2012-06-18 Infinality - - [truetype] Support subpixel hinting. - - This is the large, famous `Infinality' patch to support ClearType - bytecode which has been available from - http://www.infinality.net/blog/ for some time, and which has been - refined over the last years. While still experimental, it is now - mature enough to be included directly into FreeType. - - Most of the code is based on the ClearType whitepaper written by - Greg Hitchcock - - http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx - - which gives a detailed overview of the necessary changes to the - Microsoft rasterizer so that older fonts are supported. However, a - lot of details are still missing, and this patches provides a - framework to easily handle rendering issues down to the glyph level - of certain fonts. - - Note that ClearType support is not completely implemented! In - particular, full support for the options `compatible_widths', - `symmetrical_smoothing, and `bgr' (via the GETINFO bytecode - instruction) is missing. - - * src/truetype/ttsubpix.c: New file, providing code to handle - `tweaks', this is, rules for certain glyphs in certain fonts - (including wildcards) which need a special treatment. - - * src/truetype/ttsubpix.h: New file, holding the tweaking rules. - - * include/freetype/config/ftoption.h, src/devel/ftoption.h - (TT_CONFIG_OPTION_SUBPIXEL_HINTING): New macro. - - * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID, - FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): New macros. - - * src/truetype/truetype.c [TT_USE_BYTECODE_INTERPRETER]: Include - `ttsubpix.c'. - - * src/truetype/ttgload.c: Include `ttsubpix.h'. - [All changes below are guarded by TT_CONFIG_OPTION_SUBPIXEL_HINTING.] - - (tt_get_metrics): Set tweak flags. - (TT_Hint_Glyph): Call `FT_Outline_EmboldenXY' if necessary. - (TT_Process_Simple_Glyph): Compensate emboldening if necessary. - (compute_glyph_metrics): Handle `compatible widths' option. - (tt_loader_init): Handle ClearType GETINFO information bits. - - * src/truetype/rules.mk (TT_DRC_SRC): Updated. - - * src/truetype/ttinterp.c: Include `ttsubpix.h'. - [Where necessary, changes below are guarded by - TT_CONFIG_OPTION_SUBPIXEL_HINTING.] - - (Direct_Move, Direct_Move_X): Extended. - (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid, - Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45, - SetSuperRound): Add parameter to handle the number of grid lines per - pixel. - (SET_SuperRound, ROUND_None, CUR_Func_round): Updated. - (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated. - (DO_ROUND, DO_NROUND): Updated. - (DO_RS): Take care of `Typeman' bytecode patterns. - (Ins_FDEF): Add some debugging code. Commented out. - (Ins_ENDF): Restore state. - (Ins_CALL, Ins_LOOPCALL): Handle inline delta functions. - (Ins_MD): Handle `Vacuform' rounds. - (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP, - Ins_MDRP, Ins_MIRP): Handle tweaks. - (Ins_ALIGNRP): Add tweak guard. - (Ins_IUP, Ins_DELTAP): Handle tweaks. - (Ins_GETINFO): Handle new ClearType bits. - (TT_RunIns): Handle tweaks. - - * src/truetype/ttinterp.h: Updated. - (SPH_TweakRule, SPH_ScaleRule): New structures for tweaks. - (TT_ExecContextRec): Add members for subpixel hinting support. - - * src/truetype/ttobjs.h (TT_DefRecord): Add `inline_delta' member. - -2012-06-15 Werner Lemberg - - * Version 2.4.10 released. - ========================= - - - Tag sources with `VER-2-4-10'. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.10. - - * 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.9/2.4.10/, s/249/2410/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10. - - * builds/unix/configure.raw (version_info): Set to 15:0:9. - -2012-06-15 Alexei Podtelezhnikov - - * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing. - - * docs/CHANGES: Updated. - -2012-06-14 suzuki toshiya - - * builds/exports.mk: Add CCexe_CFLAGS and CCexe_LDFLAGS. - - to pass special compiler/linker flags under cross development. - Suggested by Savannah bug #36367. - - ChangeLog on 2010-07-15 saying as they were removed was wrong - for the official trunk of FreeType2. This commit is the first - introduction of them. - -2012-06-14 Werner Lemberg - - * docs/CHANGES: Updated. - -2012-06-14 suzuki toshiya - - [truetype] Add new versions of NEC FA family to tricky font list. - - NEC FA family dated in 1996 have different checksum. - Reported by Johnson Y. Yan ; see - - http://lists.gnu.org/archive/html/freetype-devel/2012-06/msg00023.html - - * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): 4 sets - of fpgm & prep table checksums for FA-Gothic, FA-Minchou, - FA-RoundedGothicM, FA-RoundedGothicB are added. The family - names in sample PDF are truncated, thus the list of the - family names in tt_check_trickyness_family() is not updated yet. - -2012-06-06 Werner Lemberg - - [ftraster] Fix rounding issue causing visual artifacts. - - Problem reported by jola ; see - - http://lists.gnu.org/archive/html/freetype-devel/2012-05/msg00036.html - - * src/raster/ftraster.c (SMulDiv_No_Round): New macro. - (Line_Up): Use it. - * src/raster/ftmisc.h (FT_MulDiv_No_Round): Copied from `ftcalc.c'. - -2012-05-28 Alexei Podtelezhnikov - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Simplify. - - We now use the cross product of the direction vectors to compute the - outline's orientation. - -2012-05-28 Werner Lemberg - - * docs/CHANGES: Updated. - -2012-05-28 Alexei Podtelezhnikov - - New function FT_Outline_EmboldenXY. - - * include/freetype/ftoutln.h (FT_Outline_EmboldenXY): Define it. - - * src/base/ftoutln.c (FT_Outline_EmboldenXY): Implement it, using a - simplified embolding algorithm. - (FT_Outline_Embolden): Make it a special case of - `FT_Outline_EmboldenXY' - -2012-05-07 Werner Lemberg - - [type1] Fix Savannah bug #36386. - - * src/type1/t1load.c (t1_load_keyword): Ignore keyword if context is - not valid. - -2012-04-07 Werner Lemberg - - Remove compiler warning. - - * src/truetype/ttgload.c (TT_Load_Glyph) - [!TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Access `glyph->face' directly. - -2012-03-28 Werner Lemberg - - [autofit] Properly copy scaler flags to script metrics object. - - Without this patch, only the dummy and cjk autohinter modules get - them (since they copy the whole scaler object). - - * src/autofit/aflatin.c (af_latin_metrics_scale), - src/autofit/aflatin2.c (af_latin2_metrics_scale): Implement it. - -2012-03-22 Alexei Podtelezhnikov - - [bdflib] Remove redundant macro. - - * src/bdf/bdflib.c (isdigok): Remove and replace with sbitset, which - is exactly the same. - -2012-03-20 suzuki toshiya - - [configure] Fix Savannah bug #35644. - - * builds/unix/configure.raw: Check `-ansi' flag works even if gcc - is used. Bionic libc headers for Android lose the consistency - when they are parsed with __STDC_VERSION__ older than 199901L or - __STRICT_ANSI__. - -2012-03-20 Werner Lemberg - - [bdf] Improvement to Savannah bug #35656. - - * src/bdf/bdflib.c (isdigok): Add cast, as suggested in report. - -2012-03-17 Chris Liddell - - [type1] Fix Savannah bug #35847. - - * src/type1/t1load.c (parse_subrs): Fix the loop exit condition; - we want to exit when we have run out of data. - -2012-03-16 Werner Lemberg - - [bdf] Really fix Savannah bug #35658. - - * src/bdf/bdflib.c (_bdf_list_split): Add one more `field' initializer. - -2012-03-14 Yann Droneaud - - [sfnt] Make arrays static like all others. - - * src/sfnt/ttload.c (tt_face_load_maxp, tt_face_load_os2), - src/sfnt/ttmtx.c (tt_face_load_hhea): Add `static' keyword to frame - fields. - -2012-03-14 Huw Davies - - [sfnt] A refinement of the previous commit. - - * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16, - tt_name_entry_ascii_from_other): Stop at null byte. - -2012-03-14 Huw Davies - - [sfnt] Add `name' table compatibility to MS Windows. - - * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16, - tt_name_entry_ascii_from_other): Don't replace `\0' with question - marks when converting strings. - -2012-03-14 Werner Lemberg - - [type1] Fix Savannah bug #35833. - - Based on the patch given in the bug report. - - * src/type1/t1load.c (IS_INCREMENTAL): New macro. - (read_binary_data): Add parameter `incremental'. - Update all callers using `IS_INCREMENTAL'. - -2012-03-11 Werner Lemberg - - [autofit] Return correct linear advance width values. - - This was quite a subtle bug which accidentally showed up with glyph - `afii10023' of arial.ttf (version 2.76). This glyph is a composite; - the first component, `E', has an advance width of 1366 font units, - while the advance width of the composite itself (which looks like - uppercase `E' with dieresis) is 1367 font units. I think this is - actually a bug in the font itself, because there is no reason that - this glyph has not the same width as uppercase `E' without the - dieresis. Anyway, it helped identify this problem. - - Using the TrueType hinter, the correct value (1367) of `afii10023' - was returned, but the autohinter mysteriously returned 1366. - - Digging in the code showed that the autohinter recursively calls - FT_Load_Glyph to load the glyph, adding the FT_LOAD_NO_SCALE load - flag. However, the `linearHoriAdvance' field is still returned as a - scaled value. To avoid scaling twice, the old code in autofit reset - `linearHoriAdvance', using the `horiAdvance' field. This seemed to - work since FT_LOAD_NO_SCALE was in use, but it failed actually, - because `horiAdvance' is defined as the distance of the first - subglyph's phantom points, which in turn are initialized using the - advance width of the first subglyph. And as the given example - shows, these widths can differ. - - * src/autofit/afloader.c (af_loader_load_g): Temporarily set - FT_LOAD_LINEAR_DESIGN while calling FT_Load_Glyph to get unscaled - values for the linear advance widths. - -2012-03-10 Werner Lemberg - - [truetype] Fix SSW instruction. - - * src/truetype/ttinterp.c (DO_SSW): SSW *does* use font units. For - verification, it took some time to find a font which actually uses - this instruction. - -2012-03-09 Vinnie Falco - - Prepare source code for amalgamation. - - * include/freetype/freetype.h: Swap order of preprocessor blocks. - -2012-03-08 Werner Lemberg - - * Version 2.4.9 released. - ========================= - - - Tag sources with `VER-2-4-9'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.9. - - * 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.8/2.4.9/, s/248/249/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 9. - - * builds/unix/configure.raw (version_info): Set to 14:1:8. - -2012-03-08 Werner Lemberg - - [bdf] Add missing overflow check. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Add threshold for - `glyph->bpr'. - -2012-03-07 Vinnie Falco - - Prepare source code for amalgamation. - - * src/autofit/aferrors.h, src/bdf/bdferror.h, src/bzip2/ftbzip2.c, - src/cache/ftcerror.h, src/cff/cfferrs.h, src/cid/ciderrs.h, - src/gxvalid/gxverror.h, src/gzip/ftgzip.c, src/lzw/ftlzw.c, - src/otvalid/otverror.h, src/pcf/pcferror.h, src/pfr/pfrerror.h, - src/psaux/psauxerr.h, src/pshinter/pshnterr.h, - src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h, - src/smooth/ftsmerrs.h, src/truetype/tterrors.h, - src/type1/t1errors.h, src/type42/t42error.h, src/winfonts/fnterrs.h: - Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX. - -2012-03-03 Werner Lemberg - - Fix Savannah bug #35660. - - For some divisions, we use casts to 32bit entities. Always guard - against division by zero with these casts also. - - * src/base/ftcalc.c (ft_div64by32): Remove redundant cast. - (FT_MulDiv, FT_MulDiv_No_Round): Add 32bit cast. - (FT_DivFix): Add 32bit cast (this omission triggered the bug). - -2012-03-03 Werner Lemberg - - [psaux] Fix handling of track kerning. - - * src/psaux/afmparse.c (afm_parse_track_kern): Don't inverse sign - for `min_kern'. It is indeed quite common that track kerning - *increases* spacing for very small sizes. - -2012-03-02 Werner Lemberg - - [truetype] Fix Savannah bug #35689. - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check first outline - point. - -2012-03-01 Werner Lemberg - - [bdf] Fix Savannah bug #35656. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) <_BDF_BITMAP>: Check validity - of nibble characters instead of accessing `a2i' array. - -2012-03-01 Werner Lemberg - - [winfonts] Fix Savannah bug #35659. - - * src/winfonts/winfnt.c (FNT_Face_Init): Check number of glyphs. - -2012-03-01 Werner Lemberg - - [bdf] Fix Savannah bug #35658. - - * src/bdf/bdflib.c (_bdf_list_split): Initialize `field' elements - properly. - -2012-03-01 Werner Lemberg - - [psaux] Fix Savannah bug #35657. - - If in function `skip_spaces' the routine `skip_comment' comes to the - end of buffer, `cur' is still increased by one, so we need to check - for `p >= limit' and not `p == limit'. - - * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed, - PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Fix boundary checking. - -2012-03-01 Werner Lemberg - - [truetype] Fix Savannah bug #35646. - - * src/truetype/ttinterp.c (Ins_MIRP): Typo, present since ages. The - code is now in sync with the other operators (e.g. MSIRP) which - modify twilight points. - -2012-03-01 Werner Lemberg - - [bdf] Fix Savannah bug #35643. - - * src/bdf/bdflib.c (_bdf_list_ensure): Bring code in sync with - comment before `_bdf_list_split', this is, really allocate at least - five `field' elements. - -2012-03-01 Werner Lemberg - - [bdf] Fix Savannah bug #35641. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Abort if - _BDF_ENCODING isn't set. We need this because access to the `glyph' - variable might be undefined otherwise. - -2012-03-01 Werner Lemberg - - [truetype] Fix Savannah bug #35640. - - * src/truetype/ttinterp.c (SkipCode, TT_RunIns): Fix boundary check - for NPUSHB and NPUSHW instructions. - -2012-02-29 Werner Lemberg - - [truetype] Fix Savannah bug #35601. - - * src/truetype/ttinterp.c (Ins_SHZ): Use number of points instead of - last point for loop. - Also remove redundant boundary check. - -2012-02-29 Werner Lemberg - - [truetype] Remove redundant check. - - * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant - second check for ordered contour start points. - -2012-02-29 Werner Lemberg - - [truetype] Make SHC instruction behave similar to MS rasterizer. - - * src/truetype/ttinterp.c (Ins_SHC): Handle virtual contour in - twilight zone. - -2012-02-29 Alexei Podtelezhnikov - - Avoid modulo operators against a power-of-two denominator. - - * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c - (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings) - , - src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE), - src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with - `&' operator. - -2012-02-29 Werner Lemberg - - [autofit] Don't synchronize digit widths for light rendering mode. - - We don't hint horizontally in this mode. - - * src/autofit/afloader.c (af_loader_load_g) : - Implement it. - -2012-02-26 Alexei Podtelezhnikov - - [type42] Minor code optimization (again). - - * src/type42/t42parse.c (t42_parse_sfnts): Simplify previous change. - -2012-02-26 Mateusz Jurczyk - Werner Lemberg - - [smooth] Fix Savannah bug #35604. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `FT_Pos' - instead of `FT_UInt' for some variables and update comparisons - accordingly. A detailed analysis can be found in the bug report. - -2012-02-26 Alexei Podtelezhnikov - - [type42] Minor code optimization. - - * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of - modulo operator. - -2012-02-26 Werner Lemberg - - * docs/CHANGES: Updated. - -2012-02-26 Werner Lemberg - - [type1] Fix Savannah bug #35608. - - * src/type1/t1parse.c (T1_Get_Private_Dict): Reject too short - dictionaries. - -2012-02-26 Werner Lemberg - - [bdf] Support `ENCODING -1 ' format. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Implement it. - -2012-02-26 Werner Lemberg - - [bdf] Fix Savannah bug #35607. - - * src/bdf/bdflib.c (_bdf_parse_glyphs) : Normalize - negative encoding values. - -2012-02-26 Werner Lemberg - - [type1] Fix Savannah bug #35606. - - * src/type1/t1load.c (parse_subrs): Add proper guards for `strncmp'. - - * src/psaux/psobjs.c (ps_parser_skip_PS_token): Emit error message - only if cur < limit. - -2012-02-25 Werner Lemberg - - [pcf] Fix Savannah bug #35603. - - * src/pcf/pcfread.c (pcf_get_properties): Assure final zero byte in - `strings' array. - -2012-02-25 Werner Lemberg - - [type42] Fix Savannah bug #35602. - - * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more - thoroughly. - -2012-02-25 Werner Lemberg - - [bdf] Fix Savannah bugs #35599 and #35600. - - * src/bdf/bdflib.c (ACMSG16): New warning message. - (_bdf_parse_glyphs) <_BDF_BITMAP>: Check line length. - -2012-02-24 Werner Lemberg - - [bdf] Fix Savannah bugs #35597 and #35598. - - * src/bdf/bdflib.c (_bdf_is_atom): Fix handling of property value. - -2012-02-24  Vinnie Falco - - Prepare source code for amalgamation (6/6). - - * src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/. - - * src/cid/cidload.c: s/parse_font_matrix/cid_parse_font_matrix/. - s/t1_init_loader/cid_init_loader/. - s/t1_done_loader/cid_done_loader/. - - * src/pxaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/. - - * src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/. - - * src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/. - -2012-02-24  Vinnie Falco - - Prepare source code for amalgamation (5/6). - - * include/freetype/fterrors.h: Undefine FT_KEEP_ERR_PREFIX after - using it. - -2012-02-22  Vinnie Falco - - Prepare source code for amalgamation (4/6). - - * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG, - RAS_ARGS, RAS_VAR, and RAS_VARS before defining it. - - * src/smooth/ftgrays.c: s/TRaster/black_TRaster/, - s/PRaster/black_PRaster/. - * src/raster/ftraster.c: s/TRaster/gray_TRaster/, - s/PRaster/gray_PRaster/. - -2012-02-20  Vinnie Falco - - Prepare source code for amalgamation (3/6). - - * src/smooth/ftgrays.c: s/TWorker/black_TWorker/, - s/PWorker/black_PWorker/. - * src/raster/ftraster.c: s/TWorker/gray_TWorker/, - s/PWorker/gray_PWorker/. - -2012-02-20  Vinnie Falco - - Prepare source code for amalgamation (2/6). - - * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine FLOOR, - CEILING, TRUNC, and SCALED before defining it. - -2012-02-20  Vinnie Falco - - Prepare source code for amalgamation (1/6). - - See discussion starting at - - http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00037.html - - * src/smooth/ftgrays.c: s/TBand/gray_TBand/. - * src/raster/ftraster.c: s/TBand/black_TBand/. - -2012-02-17 Alexei Podtelezhnikov - - [autofit] Fix outline flags. - - * src/autofit/afloader.c (af_loader_load_g): Don't reassign - `outline.flags' so that this information is preserved. See - discussion starting at - - http://lists.gnu.org/archive/html/freetype-devel/2012-02/msg00046.html - -2012-02-11 Werner Lemberg - - [truetype] Fix Savannah bug #35466. - - Jump instructions are now bound to the current function. The MS - Windows rasterizer behaves the same, as confirmed by Greg Hitchcock. - - * src/truetype/ttinterp.h (TT_CallRec): Add `Cur_End' element. - * src/truetype/ttobjs.h (TT_DefRecord): Add `end' element. - - * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Check upper - bound of jump address. - (Ins_FDEF, Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns): Updated. - -2012-02-11 Werner Lemberg - - We don't use `extensions'. - - * include/freetype/internal/ftobjs.h (FT_DriverRec): Remove - `extensions' field. - -2012-02-11 Werner Lemberg - - Clean up `generic' fields. - - * include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec): - Remove `generic' field since users can't access it. - - * src/base/ftobjs.c (FT_Done_GlyphSlot): Call `generic.finalizer' as - advertised in the documentation of FT_Generic. - (Destroy_Module, FT_Done_Library): Updated to changes in `ftobjs.h'. - -2012-02-07 Werner Lemberg - - [autofit] Harmonize function arguments. - - * src/autofit/afloader.c, src/autofit/afloader.h: Use `FT_Int32' for - `load_flags'. - -2012-02-07 Werner Lemberg - - * src/cff/cffobjs.c (cff_face_init): Remove unnecessary casts. - -2012-01-17 suzuki toshiya - - [gxvalid] Fix Savannah bug #35286. - - Patch submitted by anonymous reporter. - - * src/gxvalid/gxvcommn.c (gxv_XStateTable_subtable_setup): - gxv_set_length_by_ulong_offset() must be called with 3, not 4, - the number of the subtables in the state tables; classTable, - stateArray, entryTable. - -2012-01-17 suzuki toshiya - - [raccess] Modify for PIC build. - - Based on the patch provided by Erik Dahlstrom , - http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html - - Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()' - are renamed with `ft_' suffixes. - - * src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed - to `ft_raccess_rule_by_darwin_vfs()'. - * src/base/ftobjs.c: Ditto. - - * src/base/ftrfork.c: Declarations of FT_RFork_Rule, - raccess_guess_rec, are moved to... - * include/freetype/internal/ftrfork.h: Here. - - * include/freetype/internal/ftrfork.h: - FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END} macros are defined - to replace raccess_guess_table[] in both of PIC and non-PIC - modes. - * src/base/ftrfork.c: raccess_guess_table[] array is rewritten - by FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END}. - - * src/base/basepic.h (BasePIC): Add `ft_raccess_guess_table' - storage. (FT_RACCESS_GUESS_TABLE_GET): New macro to retrieve - the function pointer from `ft_raccess_guess_table' storage in - `BasePIC' structure. - * src/base/ftrfork.c (FT_Raccess_Guess): Rewritten with - FT_RACCESS_GUESS_TABLE_GET. - (raccess_get_rule_type_from_rule_index): Add `library' as the - first argument to the function, to retrieve the storage of - `ft_raccess_guess_table' from it. Also `raccess_guess_table' - is replaced by FT_RACCESS_GUESS_TABLE_GET. - (ft_raccess_rule_by_darwin_vfs): Ditto. - -2012-01-16 suzuki toshiya - - Remove trailing spaces. - -2012-01-16 suzuki toshiya - - Formatting PIC related sources. - - * src/autofit/afpic.c: Harmonize to FT2 coding conventions. - * src/base/basepic.c: Ditto. - * src/base/ftpic.c: Ditto. - * src/cff/cffpic.c: Ditto. - * src/pshinter/pshpic.c: Ditto. - * src/psnames/pspic.c: Ditto. - * src/raster/rastpic.c: Ditto. - * src/sfnt/sfntpic.c: Ditto. - * src/smooth/ftspic.c: Ditto. - * src/truetype/ttpic.c: Ditto. - -2012-01-16 suzuki toshiya - - [autofit] Fix the inclusion of `aflatin2.h' in PIC file. - - * src/autofit/afpic.c: Include `aflatin2.h' when - FT_OPTION_AUTOFIT2 is defined, as afglobal.c does so. - Unconditionally inclusion causes declared but unimplemented - warning by GCC 4.6. - -2012-01-16 suzuki toshiya - - [cff] Remove redundant declarations of cff_cmap_XXX_class_rec. - - * src/cff/cffpic.c: The declarations of - FT_Init_Class_cff_cmap_encoding_class_rec() and - FT_Init_Class_cff_cmap_unicode_class_rec() are removed. - They can be obtained by the inclusion of cffcmap.h. - cffcmap.h invokes FT_DECLARE_CMAP_CLASS() and it declares - FT_Init_Class_cff_cmap_encoding_class_rec() etc in PIC mode. - -2012-01-15 suzuki toshiya - - Fix redundant declaration warning in PIC mode. - - Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were - designed to declare xxx_pic_{free,init} by themselves. - Because these macros are used at the end of the module - interface (e.g. ttdriver.c) and the wrapper source to build - a module as a single object (e.g. truetype.c) includes - the PIC file (e.g. ttpic.c) before the module interface, - these macros are expanded AFTER xxx_pic_{free,init} body - when the modules are built as single object. - The declaration after the implementation causes the redundant - declaration warnings, so the declarations are moved to module - PIC headers (e.g. ttpic.h). Separating to other header files - are needed for multi build. - - * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER): - Remove class_##_pic_free and class_##_pic_init declarations. - * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, - FT_DEFINE_MODULE): Ditto. - - * src/base/basepic.h: Insert a comment and fix coding style. - * src/autofit/afpic.h: Declare autofit_module_class_pic_{free, - init}. - * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}. - * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free, - init}. - * src/psnames/pspic.h: Declare psnames_module_class_pic_{free, - init}. - * src/raster/rastpic.h: Declare - ft_raster{1,5}_renderer_class_pic_{free,init} - * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}. - * src/smooth/ftspic.h: Declare - ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}. - * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}. - -2012-01-15 suzuki toshiya - - Make pspic.c to include module error header to fix multi build. - - * src/psnames/pspic.c: Include `psnamerr.h'. - -2012-01-14 suzuki toshiya - - [base] Fix a dereference of uninitialized variable in PIC mode. - - * src/base/ftglyph.c (FT_Glyph_To_Bitmap): `glyph' must be - set before derefering to obtain `library'. The initialization - of `clazz', `glyph', `library' and NULL pointer check are - reordered to minimize PIC conditonals. - -2012-01-14 suzuki toshiya - - [base] Insert explicit cast for GCC 4.6 in PIC mode. - - * src/base/ftinit.c (FT_Add_Default_Modules): Under PIC - configuration, FT_DEFAULT_MODULES_GET returns - FT_Module_Class** pointer, GCC 4.6 warns that - const FT_Module_Class* const* variable is warned as - inappropriate to store it. To calm it, explicit cast is - inserted. Also `library' is checked to prevent the NULL - pointer dereference in FT_DEFAULT_MODULES_GET. - -2012-01-13 suzuki toshiya - - Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6. - - Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET - take no arguments but derefer the variable named `library' - internally. - - * src/cff/cffdrivr.c (cff_get_interface): Declare `library' and - set it if non-NULL driver is passed. - * src/truetype/ttdriver.c (tt_get_interface): Ditto. - - * src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library' - under PIC configuration, and set it if non-NULL module is given. - * src/psnames/psmodule.c (psnames_get_interface): Ditto. - -2012-01-13 suzuki toshiya - - Make PIC files include module error headers, to use the error codes - with per-module prefix. - - * src/autofit/afpic.c: Include `aferrors.h'. - * src/cff/cffpic.c: Include `cfferrs.h'. - * src/pshinter/pshpic.c: Include `pshnterr.h'. - * src/raster/rastpic.c: Include `rasterrs.h'. - * src/sfnt/sfntpic.c: Include `sferrors.h'. - * src/smooth/ftspic.c: Include `ftsmerrs.h'. - * src/truetype/ttpic.c: Include `tterrors.h'. - -2012-01-04 Tobias Ringström - - [truetype] Fix IP instruction if x_ppem != y_ppem. - - * src/truetype/ttinterp.c (Ins_IP): Scale `orus' coordinates - properly. - -2012-01-02 Werner Lemberg - - Fix tracing message for `loca' table. - - * src/truetype/ttpload.c (tt_face_get_location): Don't emit a - warning message if the last `loca' entry references an empty glyph. - -2011-12-10 Werner Lemberg - - Add some variable initializations. - Reported by Richard COOK . - - * src/type1/t1driver.c (t1_ps_get_font_value): Initialize `val'. - * src/smooth/ftgrays.c (gray_render_conic): Initialize `levels' - earlier. - -2011-12-08 Werner Lemberg - - Fix serious scaling bug in `FT_Get_Advances'. - - * src/base/ftadvanc.c (FT_Get_Advances): Advance values returned by - `FT_Load_Glyph' must be simply multiplied by 1024. - -2011-12-08 Werner Lemberg - - * src/bdf/bdflib.c (_bdf_parse_start): Drop redundant error tracing. - -2011-12-02 suzuki toshiya - - [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH. - - Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON - was a configurable macro to disable Carbon-dependent code. Because - now configure script sets DARWIN_NO_CARBON by default and disables - Darwin & Carbon-dependent codes, these macros can be unified. - FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON - (defined by default) is removed, because DARWIN_NO_CARBON violates - FT_XXX naming convention of public macros, and a macro configured by - default is not portable for the building without configure (e.g. - make devel). - - * builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based - old Mac font support is requested and Carbon is available. - * builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support - for Mac OS X without Carbon (e.g. Mac OS X 10.4 for ppc64) is - requested. - * include/freetype/config/ftconfig.in: Ditto. - * builds/vms/ftconfig.h: Ditto. - - * src/base/ftbase.h: Remove DARWIN_NO_CARBON. - * src/base/ftbase.c: Ditto. - * src/base/ftobjs.c: Ditto. - * src/base/ftrfork.c: Ditto. - - * src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined - (same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c). - * builds/mac/ftmac.c: Ditto. - - * builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH. - * builds/mac/FreeType.m68k_far.make.txt: Ditto. - * builds/mac/FreeType.ppc_classic.make.txt: Ditto. - * builds/mac/FreeType.ppc_carbon.make.txt: Ditto. - -2011-11-30 suzuki toshiya - - Fix Savannah bug #34728 (`make devel' on Mac OS X). - - * builds/toplevel.mk: Check `/dev/null' to identify the Unix- - like systems without `init' nor `hurd' (e.g. Mac OS X >= 10.4). - * builds/unix/detect.mk: Ditto. - -2011-11-30 suzuki toshiya - - [apinames] Fix the overflow of signed integer hash. - - * src/tools/apinames.c (names_add): Change the type of `h' from - int to unsigned int, to prevent undefined behaviour in the - overflow of signed integers (overflow of unsigned int is defined - to be wrap around). Found by clang test suggested by Sean - McBride. - -2011-11-30 Werner Lemberg - - [winfonts] Remove casts. - - * src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and - update affected functions. - (FNT_Size_Select): Fix number of arguments. - -2011-11-30 Werner Lemberg - - [type42] Remove casts. - - * src/type42/t42driver.c (t42_driver_class): Remove all casts and - update affected functions. - - * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42driver - changes. - -2011-11-30 Werner Lemberg - - [type1] Remove casts. - - * src/type1/t1driver.c (t1_driver_class): Remove all casts and - update affected functions. - - * src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1objs.c: - Updated for t1driver changes. - src/type1/t1objs.h (T1_Driver): Remove unused typedef. - Updated for t1driver changes. - -2011-11-27 Werner Lemberg - - [bdf] Fix Savannah bug #34896. - - ENCODING now covers the whole Unicode range. - - Note, however, that this change is quite expensive since it - increases the size of three arrays by almost 400kByte in total. The - right fix is to replace the logic with something smarter. - Additionally, there exist very old BDFs for three-byte CCCII - encoding which exceeds the range of Unicode (another reason to have - a smarter logic). - - * src/bdf/bdf.h (bdf_font_t): Increase size of `nmod' and `umod' - arrays. - * src/bdf/bdflib.c (bdf_parse_t): Increase size of `have' array. - -2011-11-27 Werner Lemberg - - [bdf] Improve tracing. - - * src/bdf/bdflib.c (DBGMSG1, DBGMSG2): New macros. - (_bdf_parse_glyphs): Use them. - -2011-11-26 Werner Lemberg - - Improve tracing. - - * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c - (PCF_Face_Done): Remove tracing message. - - * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c - (cff_face_init), src/cid/cidobjs.c (cid_face_init), - src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c - (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), - src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c - (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add - `greeting' message. - - * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c - (T42_Open_Face): Improve tracing. - -2011-11-26 Werner Lemberg - - [cid] Fix error code. - - * src/cid/cidparse.c (cid_parser_new): Do it. - -2011-11-26 Werner Lemberg - - [cff] Fix error code. - - * src/cff/cffload.c (cff_font_load): Do it. - -2011-11-26 Werner Lemberg - - Add new error code FT_Err_Missing_Module. - - Previously, FreeType misleadingly returned - FT_Err_Unknown_File_Format if a module was missing (or a test was - missing completely). - - * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define. - - * src/cff/cffobjs.c (cff_face_init), src/cff/cffdrivr.c - (cff_get_glyph_name), src/cid/cidobjs.c (cid_face_init), - src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c - (tt_face_init), src/type1/t1objs.c (T1_Face_Init), - src/type42/t42objs.c (T42_Face_Init, T42_Driver_Init): Updated. - - * src/type1/t1afm.c (T1_Read_Metrics), src/type/t1objs.c - (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Remove now - redundant test for `psaux'. - -2011-11-25 Werner Lemberg - - [bdf] Add more error messages. - - * src/bdf/bdflib.c (_bdf_set_default_spacing, _bdf_add_property): - Add line number argument. - Update all callers. - (ERRMSG5, ERRMSG6, ERRMSG7, ERRMSG8, ERRMSG9): New macros. - (_bdf_readstream, _bdf_set_default_spacing, _bdf_add_property, - _bdf_parse_glyphs, _bdf_parse_start): Add error messages. - -2011-11-24 Werner Lemberg - - * include/freetype/fterrors.h: Remove dead code. - -2011-11-15 Werner Lemberg - - * docs/releases: Updated. - -2011-11-15 Werner Lemberg - - * Version 2.4.8 released. - ========================= - - - Tag sources with `VER-2-4-8'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.8. - - * 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.7/2.4.8/, s/247/248/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8. - - * builds/unix/configure.raw (version_info): Set to 14:0:8. - -2011-11-13 Chris Liddell - - Add FT_Get_PS_Font_Value() API. - - This allows a Type 1 font face to be interrogated to retrieve most - of the dictionary keys (keys not relevant to FreeType's Type 1 - interpreter are not available). - - * include/freetype/internal/services/svpsinfo.h - (PS_GetFontValueFunc): New typedef. - (PSInfo): Add `ps_get_font_value'. - (FT_DEFINE_SERVICE_PSINFOREC): Updated. - - * include/freetype/internal/t1types.h (T1_EncodingType): Moved to... - * include/freetype/t1tables.h: Here. - (PS_Dict_Keys): New enumeration. - (FT_Get_PS_Font_Value): New declaration. - - * src/base/fttype1.c (FT_Get_PS_Font_Value): New function. - - * src/type1/t1driver.c (t1_ps_get_font_value): This new function - does the real job. - (t1_service_ps_info): Add it. - - * src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c - (cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info): - Updated. - -2011-11-08 Braden Thomas - - [cid] Various loading fixes. - - * src/cid/cidload.c (cid_load_keyword) , - (parse_font_matrix, parse_expansion_factor): Correctly check number - of dictionaries. - (cid_read_subrs): Protect against invalid values of `num_subrs'. - Assure that the elements of the `offsets' array are ascending. - -2011-11-05 Werner Lemberg - - * README: We use copyright ranges also. - - According to - - http://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html - - this should be mentioned explicitly. - -2011-10-30 suzuki toshiya - - [raccess] Supplement for previous fix. - - * src/base/ftbase.h (raccess_rule_by_darwin_vfs): Do not declare - it on native Mac OS X. - * src/base/ftrfork.c (raccess_get_rule_type_from_rule_index): - Hide raccess_get_rule_type_from_rule_index() on native Mac OS X - too. - -2011-10-30 suzuki toshiya - - [raccess] Hide raccess_rule_by_darwin_vfs() on native Mac OS X. - - * src/base/ftrfork.c (raccess_rule_by_darwin_vfs): Do not - compile on native Mac OS X because it is not used. - -2011-10-25 Werner Lemberg - - [truetype] Fix MD instruction for twilight zone. - - * src/truetype/ttinterp.c (Ins_MD): Without this fix, the MD - instruction applied to original coordinates of twilight points - always returns zero. - -2011-10-18 Werner Lemberg - - * Version 2.4.7 released. - ========================= - - - Tag sources with `VER-2-4-7'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.7. - - * 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.6/2.4.7/, s/246/247/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7. - - * builds/unix/configure.raw (version_info): Set to 13:2:7. - -2011-10-15 Kal Conley - - Fix handling of transformations if no renderer is present. - - * src/base/ftobjs.c (FT_Load_Glyph): Thinko. - -2011-10-15 Kal Conley - - Fix conditions for autohinting. - - * src/base/ftobjs.c (FT_Load_Glyph): Handle - FT_LOAD_IGNORE_TRANSFORM. - -2011-10-07 suzuki toshiya - - [gxvalid] Fix a bug to detect too large offset in morx table. - - * src/gxvalid/gxvmorx2.c - (gxv_morx_subtable_type2_ligActionIndex_validate): Fix a bug - that too large positive offset cannot be detected. - -2011-10-01 Braden Thomas - - Handle some border cases. - - * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro. - - * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid - value of `target->rows'. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for - flex start. - - * src/raster/ftrend1.c (ft_raster1_render): Check `width' and - `height'. - - * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against - invalid values in `localpoints' array. - -2011-10-01 Werner Lemberg - - [psnames] Handle zapfdingbats. - Problem reported by Nicolas Rougier . - - * src/tools/glnames.py (adobe_glyph_list): Add data from AGL's - `zapfdingbats.txt' file. - - * src/psnames/pstables.h: Regenerated. - -2011-09-27 Simon Bünzli - - [type1] Fix Savannah bug #34189. - - * src/type1/t1load.c (T1_Open_Face): Initialize - `face->len_buildchar'. - -2011-09-26 Werner Lemberg - - [cff] Dump SIDs while tracing. - - * src/cff/cffobjs.c (cff_face_init): Do it. - - * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE] - : Identify as SID. - -2011-09-17 Werner Lemberg - - Remove unused FT_ALIGNMENT macro. - - * builds/unix/ftconfig.in, builds/vms/ftconfig.h, - include/freetype/config/ftconfig.h: Do it. - -2011-09-17 Alexei Podtelezhnikov - - [smooth] Slightly optimize conic and cubic flatterners. - - * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move - out some code from the main loop to speed it up. - -2011-09-11 Tomas Hoger - - Slightly improve LZW_CLEAR handling. - - * src/lzw/ftzopen.c (ft_lzwstate_io) : - Ensure that subsequent (modulo garbage byte(s)) LZW_CLEAR codes are - handled as clear codes. This also re-sets old_code and old_char to - predictable values, which is a little better than using `random' - ones if the code following LZW_CLEAR is invalid. - -2011-09-11 Tomas Hoger - - Add explicit LZW decompression stack size limit. - - Stack larger than 1<prefix[code - 256] - when traversing prefix table. Such check is less efficient and - should not be required if prefix table is constructed correctly in - the first place. - - * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Implement it. - -2011-09-11 Tomas Hoger - - Protect against loops in the prefix table. - - LZW decompressor did not sufficiently check codes read from the - input LZW stream. A specially-crafted or corrupted input could - create a loop in the prefix table, which leads to memory usage - spikes, as there's no decompression stack size limit. - - * src/lzw/ftzopen.c (ft_lzwstate_io) : First - code in valid LZW stream must be 0..255. - : In the special KwKwK case, code == free_ent, - code > free_ent is invalid. - -2011-09-09 Werner Lemberg - - Better tracing of metrics. - - * src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with - FT_TRACE. - -2011-09-07 Werner Lemberg - - [cff] Fix Savannah bug #33816. - - * src/cff/cfftypes.h (CFF_FontRecDictRec): New member - `has_font_matrix'. - * src/cff/cffparse.c (cff_parse_font_matrix): Set it. - Update tracing output. - * src/cff/cffobjs.c (cff_face_init): Use it so that the heuristics - can be removed. - -2011-08-30 Werner Lemberg - - Better tracing of metrics. - - * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): - Decorate with FT_TRACE. - -2011-08-25 Werner Lemberg - - [cff] Better tracing of the parsing process. - - * src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with - FT_TRACE. - - * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox, - cff_parse_private_dict, cff_parse_cid_ros): Updated. - (CFF_FIELD_NUM, CFF_FIELD_FIXED, CFF_FIELD_FIXED_1000, - CFF_FIELD_STRING, CFF_FIELD_BOOL, CFF_FIELD_CALLBACK, CFF_FIELD, - CFF_FIELD_DELTA): Add argument for ID. - (cff_parser_run): Decorate with FT_TRACE. - - * src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add - `id' member. - - * src/cff/cfftoken.h: Add IDs to all fields. - -2011-08-16 Werner Lemberg - - Fix Savannah bug #34022. - - * README, docs/INSTALL: Remove references to UPGRADE.UNIX. - -2011-08-15 Werner Lemberg - - Fix Savannah bug #34018. - - * docs/UPGRADE.UNIX: Removed. Obsolete. - -2011-08-15 David Bevan - - Fix Savannah bug #33992. - - * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case. - -2011-08-12 Werner Lemberg - - [cff] Fix Savannah bug #33975. - - * src/cff/cffparse.c (cff_parse_font_matrix): Fix typo. - -2011-07-29 Werner Lemberg - - * Version 2.4.6 released. - ========================= - - - Tag sources with `VER-2-4-6'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.6. - - * 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.5/2.4.6/, s/245/246/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6. - - * builds/unix/configure.raw (version_info): Set to 13:1:7. - -2011-07-29 Werner Lemberg - - [cff] Add some more tracing infos. - - * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox, - cff_parse_cid_ros): Add tracing. - -2011-07-22 Dirk Müller - - [psaux, type1] Fix null pointer dereferences. - - Found with font fuzzying. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check - `decoder->buildchar'. - - * src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'. - -2011-07-20 Chris Morgan - - Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT. - - Useful for embedded systems which don't need file stream support. - - * src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement - it. - -2011-07-20 Elton Chung - - * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo. - -2011-07-16 Steven Chu - - [truetype] Fix metrics on size request for scalable fonts. - - * src/truetype/ttdriver.c (tt_size_request): Fix copying metrics - from TT_Size to FT_Size if scalable font. - - See - - http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00049.html - - for some comparison images. - -2011-07-14 Matthias Drochner . - - [psaux] Fix potential sign extension problems. - - When shifting right a signed value, it is not defined by the - C standard whether one gets a sign extension or not. Use a macro to - do an explicit cast from a signed short (assuming that this is - 16bit) to an int. - - * src/psaux/t1decode.c (Fix2Int): New macro. - Use it where appropriate. - -2011-07-14 Werner Lemberg - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - : Better handling of subroutine index 0. - From Matthias Drochner . - -2011-07-10 Алексей Подтележников - - [psaux] Optimize previous commit. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - : Move error check down to avoid testing twice for - good cases. - -2011-07-08 Werner Lemberg - - [psaux] Add better argument check for `callothersubr'. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings) - : Reject negative arguments. - -2011-07-07 Werner Lemberg - - [sfnt] Try harder to find non-zero values for ascender and descender. - - * src/sfnt/sfobjs.c (sfnt_load_face): Consult `OS/2' table in case - the `hhea' table's values are zero. - -2011-07-03 Werner Lemberg - - Fix previous commit. - - We want to unset FT_FACE_FLAG_SCALABLE only if there are bitmap - strikes in the font. - - * src/truetype/ttobjs.c (tt_face_init): Implement it. - - * docs/CHANGES: Updated. - -2011-07-02 Just Fill Bugs - - [truetype] Fix Savannah bug #33246. - - * src/truetype/ttobjs.c (tt_check_single_notdef): New function. - (tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE. - -2011-07-02 Werner Lemberg - - * docs/CHANGES: Updated. - -2011-07-02 David Bevan - - [ftstroke] Major revision. - - The main problems - ----------------- - - o If FT_STROKER_LINEJOIN_BEVEL was specified, unlimited miter - joins (not bevel joins) were generated. Indeed, the meanings of - `miter' and `bevel' were incorrectly reversed (consistently) in - both the code and comments. - - o The way bevel joins were constructed (whether specified - explicitly, or created as a result of exceeding the miter limit) - did not match what is required for stroked text in PostScript or - PDF. - - The main fixes - -------------- - - o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected. - - o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been - introduced to support PostScript and PDF miter joins. - - o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an - alias for FT_STROKER_LINEJOIN_MITER. - - Additionally, a variety of stroking errors have been fixed. These - would cause various artifacts (including points `at infinity'), - especially when stroking poor quality fonts. - - See - - http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html - - for example documents. The FreeType stroker now produces results - very similar to that produced by GhostScript and Distiller for these - fonts. - - Other problems - -------------- - - The following problems have been resolved: - - o Inside corners could be generated incorrectly. Intersecting the - inside corner could cause a missing triangular area and other - effects. - - The intersection point can only be used if the join is between - two lines and both lines are long enough. The `optimization' - condition in `ft_stroker_inside' has been corrected; this - requires the line length to be passed into various functions and - stored in `FT_StrokerRec'. - - o Incorrect cubic curves could be generated. The angle - calculations in `FT_Stroker_CubicTo' have been corrected to - handle the case of the curve crossing the +/-PI direction. - - o If the border radius was greater than the radius of curvature of - a curve, then the negative sector would end up outside (not - inside) the border. This situation is now recognized and the - negative sector is circumnavigated in the opposite direction. - (If round line joins are being used, this code is disabled - because the line join will always cover the negative sector.) - - o When a curve is split, the arcs may not join smoothly (especially - if the curve turns sharply back on itself). Changes in - direction between adjacent arcs were not handled. A round - corner is now added if the deviation from one arc to the next is - greater than a suitable threshold. - - o The current direction wasn't retained if a the outline contained - a zero length lineto or a curve that was determined to be - `basically a point'. This could cause a spurious join to be - added. - - o Cubics with close control points could be mishandled. All eight - cases are now distinguished correctly. - - Other improvements - ------------------ - - o Borders for cubic curves could be too `flat'. - FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent - this. - - o The handling and use of movable points has been simplified a - little. - - o Various values are now computed only if the results are actually - needed. - - o The directions of the outer and inner borders have been swapped, - as recommended by Graham Asher. - - * src/base/ftstroke.c: Revised. - * include/freetype/ftstroke.h: Updated. - -2011-06-30 İsmail Dönmez - - * builds/toplevel.mk: We use git, not CVS, thus skip `.gitignore'. - -2011-06-29 Werner Lemberg - - [bdf] Fix Savannah bug #33663. - - * src/bdf/bdflib.c (_bdf_parse_glyphs): Handle negative values for - ENCODING correctly. - - * docs/CHANGES: Document it. - -2011-06-24 Werner Lemberg - - * Version 2.4.5 released. - ========================= - - - Tag sources with `VER-2-4-5'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.5 - - * 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.4/2.4.5/, s/244/245/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5. - - * builds/unix/configure.raw (version_info): Set to 13:0:7. - -2011-06-20 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix change - from 2011-05-04. - -2011-06-19 suzuki toshiya - - [gxvalid] make the `prop' validation tracing verbose. - - * src/gxvalid/gxvprop.c: Add tracing messages for errors. - -2011-06-19 suzuki toshiya - - [autogen.sh] Reflect environment variable LIBTOOLIZE. - -2011-06-18 Werner Lemberg - - Update license documentation. - - * docs/GPL.TXT: Renamed to... - * docs/GPLv2.TXT: This. - - * docs/LICENSE.TXT: Updated. - -2011-06-14 suzuki toshiya - - Fix g++4.6 compiler warnings in module drivers. - - The background is same with previous commit. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): - Init `points'. (TT_Vary_Get_Glyph_Deltas): Init - `delta_xy'. (TT_Get_MM_Var): Init `mmvar'. - * src/type1/t1load.c (T1_Get_MM_Var): Ditto. - * src/cff/cffdrivr.c (cff_ps_get_font_info): Init - `font_info'. - * src/cff/cffload.c (cff_index_get_pointers): Init `t'. - (cff_font_load): Init `sub'. - * src/cff/cffobjs.c (cff_size_init): Init `internal'. - (cff_face_init): Init `cff'. - * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps): - Init `snaps'. - * src/pcf/pcfread.c (pcf_get_properties): Init `properties'. - (pcf_get_bitmaps): Init `offsets'. (pcf_get_encodings): - Init `tmpEncoding'. - * src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'. - * src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'. - * src/cache/ftcmru.c (FTC_MruList_New): Init `node'. - * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and - `zip_buff'. - * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'. - * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'. - -2011-06-14 suzuki toshiya - - [base] Fix g++4.6 compiler warnings in src/base/*.c. - - Passing uninitialized pointer to FT_NEW() families is - not problematic theoretically (as far as the returned - pointer is checked before writing), but g++4.6 dislikes - it and warns by -Wuninitialized. Initialize them by NULL. - - * src/base/ftobjs.c (FT_Stream_New): Init `stream'. - (new_memory_stream): Ditto. - (FT_New_GlyphSlot): Init `slot'. - (FT_CMap_New): Init `cmap'. - (open_face_PS_from_sfnt_stream): Init `sfnt_ps'. - (Mac_Read_POST_Resource): Init `pfb_data'. - (Mac_Read_sfnt_Resource): Init `sfnt_data'. - * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): - Init `offsets_internal' and `ref'. - (raccess_guess_darwin_hfsplus): Init `newpath'. - (raccess_guess_darwin_newvfs): Ditto. - * src/base/ftbitmap.c (ft_bitmap_assure_buffer): - Init `buffer'. - * src/base/ftstroke.c (FT_Stroker_New): Init `stroker'. - -2011-06-14 suzuki toshiya - - [gxvalid] Cleanup. - - Some invalid, overrunning, unrecommended non-zero values - are cared in paranoid validation mode only. There are - many lines looking like: - - if ( valid->root->level >= FT_VALIDATE_PARANOID ) - FT_INVALID_xxx; - - To simplify them, GXV_SET_ERR_IF_PARANOID( err ) is - introduced for more paranoid validation in future. - - * src/gxvalid/gxvcommn.h (IS_PARANOID_VALIDATION): - New macro to assure valid->root->level is more or - equal to FT_VALIDATE_PARANOID. (GXV_SET_ERR_IF_PARANOID): - New macro to raise an error if in paranoid validation. - * src/gxvalid/gxvcommn.c: Use GXV_SET_ERR_IF_PARANOID(). - * src/gxvalid/gxvfeat.c: Ditto. - * src/gxvalid/gxvjust.c: Ditto. - * src/gxvalid/gxvkern.c: Ditto. - * src/gxvalid/gxvmort.c: Ditto. - * src/gxvalid/gxvmort0.c: Ditto. - * src/gxvalid/gxvmort1.c: Ditto. - * src/gxvalid/gxvmort2.c: Ditto. - * src/gxvalid/gxvmorx1.c: Ditto. - * src/gxvalid/gxvmorx2.c: Ditto. - -2011-06-14 suzuki toshiya - - [gxvalid] Fix gcc4.6 compiler warnings in gxvtrak.c. - - * src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): - Check different entries pointing same traking value. - (gxv_trak_validate): Remove unused variable `table_size'. - -2011-06-14 suzuki toshiya - - [gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c. - - * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate): - Conditionalize unvalidated variable `subFeatureFlags'. - (gxv_morx_chain_validate): Conditionalize unvalidated - variable `defaultFlags'. - - * src/gxvalid/gxmorx0.c - (gxv_morx_subtable_type0_entry_validate): - Conditionalize unvalidated variables; `markFirst', - `dontAdvance', `markLast', `verb'. - - * src/gxvalid/gxmorx1.c - (gxv_morx_subtable_type1_entry_validate): Conditionalize - unvalidated variables; `setMark', `dontAdvance'. - - * src/gxvalid/gxvmorx2.c - (gxv_morx_subtable_type2_ligActionOffset_validate): - Conditionalize unvalidated variables; `last', `store'. - Checking for overrunning offset is added. - (gxv_morx_subtable_type2_entry_validate): - Conditionalize unvalidated variables; `setComponent', - `dontAdvance', `performAction'. - (gxv_morx_subtable_type2_ligatureTable_validate): - Check if the GID for ligature does not exceed the - max GID in `maxp' table. - - * src/gxvalid/gxvmort5.c - (gxv_morx_subtable_type5_InsertList_validate): - Conditionalize unvalidated loading of `insert_glyphID' - array. (gxv_morx_subtable_type5_entry_validate): - Conditionalize unvalidated variables; `setMark', - `dontAdvance', `currentIsKashidaLike', - `markedIsKashidaLike', `currentInsertBefore', - `markedInsertBefore'. - -2011-06-14 suzuki toshiya - - [gxvalid] Fix gcc4.6 compiler warnings in gxvmort*.c. - - * src/gxvalid/gxvmort.c (gxv_mort_subtables_validate): - Conditionalize unvalidated variable `subFeatureFlags'. - (gxv_mort_chain_validate): Conditionalize unvalidated - variable `defaultFlags'. - - * src/gxvalid/gxmort0.c - (gxv_mort_subtable_type0_entry_validate): Check the - conflict of the marks for the glyphs. - - * src/gxvalid/gxmort1.c - (gxv_mort_subtable_type1_offset_to_subst_validate): - Local variables `min_gid', `max_gid' are replaced by - variables in the validator. - (gxv_mort_subtable_type1_entry_validate): Conditionalize - unvalidated variables; `setMark', `dontAdvance'. - (gxv_mort_subtable_type1_substTable_validate): - Validate the GID by the min/max GIDs in the validator. - - * src/gxvalid/gxvmort2.c - (gxv_mort_subtable_type2_ligActionOffset_validate): - Conditionalize unvalidated variables; `last', `store'. - Checking for overrunning offset is added. - (gxv_mort_subtable_type2_entry_validate): - Conditionalize unvalidated variables; `setComponent', - `dontAdvance'. - (gxv_mort_subtable_type2_ligatureTable_validate): - Check if the GID for ligature does not exceed the - max GID in `maxp' table. - - * src/gxvalid/gxvmort5.c - (gxv_mort_subtable_type5_InsertList_validate): - Conditionalize unvalidated loading of `insert_glyphID' - array. (gxv_mort_subtable_type5_entry_validate): - Conditionalize unvalidated variables; `setMark', - `dontAdvance', `currentIsKashidaLike', - `markedIsKashidaLike', `currentInsertBefore', - `markedInsertBefore'. - -2011-06-14 suzuki toshiya - - [gxvalid] Fix gcc4.6 compiler warnings in gxvkern.c. - - * src/gxvalid/gxvkern.c - (gxv_kern_subtable_fmt0_pairs_validate): Conditionalize - unvalidated variable `kernValue'. - (gxv_kern_subtable_fmt1_entry_validate): Conditionalize - unvalidated variables; `push', `dontAdvance', `kernAction', - `kernValue'. - (gxv_kern_coverage_new_apple_validate): Conditionalize - trace-only variables; `kernVertical', `kernCrossStream', - `kernVariation'. - (gxv_kern_coverage_classic_apple_validate): Conditionalize - trace-only variables; `horizontal', `cross_stream'. - (gxv_kern_coverage_classic_microsoft_validate): - Conditionalize trace-only variables; `horizontal', - `minimum', `cross_stream', `override'. - (gxv_kern_subtable_validate): Conditionalize trace-only - variables; `version', `tupleIndex'. - -2011-06-14 suzuki toshiya - - [gxvalid] Fix gcc4.6 compiler warnings in gxvjust.c. - - * src/gxvalid/gxvjust.c (gxv_just_check_max_gid): - New function to unify the checks of too large GID. - (gxv_just_wdp_entry_validate): Conditionalize unvalidated - variables; `beforeGrowLimit', `beforeShrinkGrowLimit', - `afterGrowLimit', `afterShrinkGrowLimit', `growFlags', - `shrinkFlags'. Additional check for non-zero values in - unused storage `justClass' is added. - (gxv_just_actSubrecord_type0_validate): Conditionalize - unvalidated variable `order'. GID is checked by - gxv_just_check_max_gid(). Additional check for upside-down - relationship between `lowerLimit' and `upperLimit' is added. - (gxv_just_actSubrecord_type1_validate): GID is checked by - gxv_just_check_max_gid(). - (gxv_just_actSubrecord_type2_validate): Conditionalize - unvalidated variable `substThreshhold'. GID is checked by - gxv_just_check_max_gid(). - (gxv_just_actSubrecord_type5_validate): GID is checked by - gxv_just_check_max_gid(). - (gxv_just_classTable_entry_validate): Conditionalize - unvalidated variables; `setMark', `dontAdvance', - `markClass', `currentClass'. - -2011-06-14 suzuki toshiya - - [gxvalid] Preparation to fix gcc4.6 compiler warnings. - - * src/gxvalid/gxvcommn.h (GXV_LOAD_TRACE_VARS): New macro to - conditionalize the variable which is only used for trace messages. - Automatically set by FT_DEBUG_LEVEL_TRACE. - (GXV_LOAD_UNUSED_VARS): New macro to conditionalize the loading of - unvalidated variables. Undefined by default to calm gcc4.6 warning. - (GXV_ValidatorRec.{min_gid,max_gid}): New variables to hold defined - GID ranges, for the comparison of GID ranges in different subtables. - -2011-06-08 Werner Lemberg - - [autofit] Remove unused structure member. - - * src/autofit/afhints.h (AF_SegmentRec): Remove `contour'. - * src/autofit/aflatin.c (af_latin_hints_compute_segments), - src/autofit/aflatin2.c (af_latin2_hints_compute_segments): Updated. - -2011-05-30 Werner Lemberg - - Fix g++ 4.6 compilation. - - * src/autofit/afhints.c (af_glyph_hints_dump_segments, - af_glyph_hints_dump_edges): Use cast. - -2011-05-30 Werner Lemberg - - Fix gcc 4.6 compiler warnings. - - * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and - remove unused variables. - * src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out - `up_dir'. - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org' - and `width_org' conditionalized. - -2011-05-28 suzuki toshiya - - [mac] Conditionalize the inclusion of `AvailabilityMacros.h'. - - The native SDK on earliest Mac OS X (10.0-10.1) did not have - `AvailabilityMacros.h'. To prevent the inclusion of missing - header file, ECANCELED (introduced in 10.2) in POSIX header - file is checked to detect the system version. - - * include/freetype/config/ftconfig.h: Conditionalize the - inclusion of `AvailabilityMacros.h'. - * builds/unix/ftconfig.in: Ditto. - * builds/vms/ftconfig.h: Ditto. - -2011-05-27 Werner Lemberg - - [autofit] Improve tracing of hinting process. - - * src/autofit/aflatin.c (af_latin_hint_edges): Add tracing message - `ADJUST'. - -2011-05-26 Werner Lemberg - - [autofit] Fix trace message. - - * src/autofit/aflatin.c (af_latin_hint_edges): Show correct value in - tracing message. - -2011-05-24 Daniel Zimmermann - - Reduce warnings for MS Visual Studio 2010. - - * src/autofit/afhints.c (af_glyph_hints_get_num_segments, - af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide - return value. - * src/cff/cffgload.c (cff_slot_load): Add cast. - * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper - loop variable type. - -2011-05-16 suzuki toshiya - - Automake component `builds/unix/install-sh' is removed. - - * builds/unix/install-sh: Removed. It is not needed to - include repository, because autogen.sh installs it. - * builds/unix/.gitignore: Register install-sh. - -2011-05-12 suzuki toshiya - - [autofit] Make trace message for CJK bluezone more verbose. - -2011-05-08 Just Fill Bugs - suzuki toshiya - - [autofit] Add bluezones for CJK Ideographs. - - To remove extremas of vertical strokes of CJK Ideographs at - low resolution and make the top and bottom horizontal stems - aligned, bluezones for CJK Ideographs are calculated from - sample glyphs. At present, vertical bluezones (bluezones - to align vertical stems) are disabled by default. For detail, see - http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html - http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html - http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html - - * include/freetype/internal/fttrace.h: New trace component `afcjk'. - * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version - for AF_Latin{Blue,Axis,Metric}Rec. - (af_cjk_metrics_check_digits): Ditto, shared with Indic module. - (af_cjk_metrics_init_widths): Ditto. - (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. - (af_cjk_metrics_scale): Ditto (declaration). - (af_cjk_hints_init): Ditto (declaration). - (af_cjk_hints_apply): Ditto (declaration). - * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). - (af_cjk_hints_init): Ditto (body). - (af_cjk_hints_apply): Ditto (body). - (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. - (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. - (af_cjk_metrics_init): Call CJK bluezone initializer. - (af_cjk_metrics_scale_dim): Add code to scale bluezones. - (af_cjk_hints_compute_blue_edges): New function, CJK version of - af_latin_hints_compute_blue_edges. - (af_cjk_metrics_init_blues): New function, CJK version of - af_latin_metrics_init_blues. - (af_cjk_hints_edges): Add code to align the edge stems to blue zones. - - * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric - instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. - However bluezones are not initialized. - (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. - (af_indic_hints_init): Ditto. - (af_indic_hints_apply): Ditto. - - * docs/CHANGES: Note about CJK bluezone support. - -2011-05-06 Werner Lemberg - - [autofit] Remove unused struct member. - - * src/autofit/aflatin.h (AF_LatinAxis): Remove `control_overshoot'. - -2011-05-04 Werner Lemberg - - * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Simplify. - -2011-05-01 Just Fill Bugs - Werner Lemberg - - [autofit] Add more debugging functions. - - * src/autofit/afhints.c (af_glyph_hints_get_num_segments, - af_glyph_hints_get_segment_offset): New functions. - -2011-05-01 suzuki toshiya - - Add new option `--disable-mmap' to configure script. - - * builds/unix/configure.raw: New option `--disable-mmap' - is added. It is for the developers to simulate the systems - without mmap() (like 4.3BSD, minix etc) on POSIX systems. - -2011-04-30 suzuki toshiya - - [truetype] Always recalculate the sfnt table checksum. - - * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate - the sfnt table checksum even if non-zero value is written in - the TrueType font header. Some bad PDF generators write - wrong values. For details see examples and benchmark tests - of the latency by recalculation: - http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html - http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html - -2011-04-30 suzuki toshiya - - [truetype] Register a set of tricky fonts, NEC FA family. - - * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): - Add 8 checksum sets for NEC FA family. For the tricky fonts - without some tables (e.g. NEC FA fonts lack cvt table), - extra check is added to assure that a zero-length table in the - registry is not included in the font. - -2011-04-29 suzuki toshiya - - [truetype] Fix a bug in the sfnt table checksum getter. - - * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the - return value of face->goto_table() correctly. - -2011-04-28 Werner Lemberg - - [autofit] Improve tracing messages. - - * src/autofit/aflatin.c (af_latin_metrics_init_blues, - af_latin_align_linked_edge, af_latin_hint_edges): Do it. - -2011-04-25 Kan-Ru Chen - - [truetype] Always check the checksum to identify tricky fonts. - - Because some PDF generators mangle the family name badly, - the trickyness check by the checksum should be invoked always. - For sample PDF, see - http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html - - * src/truetype/ttobjs.c (tt_check_trickyness): Even when - tt_check_trickyness_family() finds no trickyness, - tt_check_trickyness_sfnt_ids() is invoked. - -2011-04-22 suzuki toshiya - - [autofit] Add more Indic scripts with hanging baseline. - - * src/autofit/afindic.c (af_indic_uniranges): Tibetan, Limbu, - Sundanese, Meetei Mayak, Syloti Nagri and Sharada scripts are - added. - -2011-04-21 Behdad Esfahbod - - Always ignore global advance. - - This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant, - deprecated, and ignored. The new behavior is what every major user - of FreeType has been requesting. Global advance is broken in many - CJK fonts. Just ignoring it by default makes most sense. - - * src/truetype/ttdriver.c (tt_get_advances), - src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics, - tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph), - src/truetype/ttgload.h: Implement it. - - * docs/CHANGES: Updated. - -2011-04-21 rainy6144 - - [autofit] Blur CJK stems if too many to preserve their gaps. - - When there are too many stems to preserve their gaps in the - rasterization of CJK Ideographs at a low resolution, blur the - stems instead of showing clumped stems. See - http://lists.gnu.org/archive/html/freetype-devel/2011-02/msg00011.html - http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00046.html - for details. - - * src/autofit/afcjk.c (af_cjk_hint_edges): Store the position of - the previous stem by `has_last_stem' and `last_stem_pos', and skip - a stem if the current and previous stem are too near to preserve - the gap. - -2011-04-18 Werner Lemberg - - Integrate autofitter debugging stuff. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (FT_DEBUG_AUTOFIT): New macro. - - * include/freetype/internal/fttrace.h: Add trace components for - autofitter. - - * src/autofit/aftypes.h (AF_LOG): Removed. - (_af_debug): Removed. - - * src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/. - s/AF_LOG/FT_TRACE5/. - Define FT_COMPONENT where necessary. - -2011-04-18 Werner Lemberg - - Synchronize config files. - - * builds/unix/ftconfig.in: Copy missing assembler routines from - include/freetype/config/ftconfig.h. - -2011-04-13 Werner Lemberg - - [psaux] Fix Savannah bug #33047. - - Patch submitted by anonymous reporter. - - * src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer - difference. - -2011-04-11 Kan-Ru Chen - - Fix reading of signed integers from files on 64bit platforms. - - Previously, signed integers were converted to unsigned integers, but - this can fail because of sign extension. For example, 0xa344a1eb - becomes 0xffffffffa344a1eb. - - We now do the reverse which is always correct because the integer - size is the same during the cast from unsigned to signed. - - * include/freetype/internal/ftstream.h, src/base/ftstream.c - (FT_Stream_Get*): Replace with... - (FT_Stream_GetU*): Functions which read unsigned integers. - Update all macros accordingly. - - * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated. - -2011-04-07 Werner Lemberg - - Update Unicode ranges for CJK autofitter; in particular, add Hangul. - - * src/autofit/afcjk.c (af_cjk_uniranges): Update to Unicode 6.0. - -2011-04-04 Werner Lemberg - - Fix formatting of autofit debug dumps. - - * src/autofit/afhints.c (af_glyph_hints_dump_points, - af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Adjust - column widths. - -2011-03-30 Werner Lemberg - - * src/autofit/aftypes.h (AF_OutlineRec): Removed, unused. - -2011-03-24 Werner Lemberg - - * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256. - This limit is given on p. 37 of Adobe Technical Note #5014. - -2011-03-23 Werner Lemberg - - * src/truetype/ttpload.c (tt_face_load_loca): Fix mismatch warning. - -2011-03-20 Werner Lemberg - - * src/sfnt/sfobjs.c (sfnt_open_font): Check number of TTC subfonts. - -2011-03-19 Werner Lemberg - - More C++ compilation fixes. - - * src/autofit/afhints.c (af_glyph_hints_dump_points, - af_glyph_hints_dump_segments, af_glyph_hints_dump_edges) - [__cplusplus]: Protect with `extern "C"'. - -2011-03-18 Werner Lemberg - - C++ compilation fixes. - - * src/autofit/aflatin.c (af_latin_hints_apply), src/autofit/afcjk.c - (af_cjk_hints_apply): Use cast for `dim'. - -2011-03-17 Alexei Podtelezhnikov - - A better fix for Savannah bug #32671. - - * src/smooth/ftgrays.c (gray_render_conic): Clean up code and - replace WHILE loop with a more natural DO-WHILE construct. - -2011-03-16 Werner Lemberg . - - * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field. - Suggested by Graham Asher. - -2011-03-09 Werner Lemberg - - Make FT_Sfnt_Table_Info return the number of SFNT tables. - - * src/sfnt/sfdriver.c (sfnt_table_info): Implement it. - * include/freetype/tttables.h: Update documentation. - * docs/CHANGES: Updated. - -2011-03-07 Bram Tassyns - - [cff] Fix Savannah bug #27988. - - * src/cff/cffobjs.c (remove_style): New function. - (cff_face_init): Use it to strip off the style part of the family - name. - -2011-03-07 Werner Lemberg - - * docs/CHANGES: Updated. - -2011-03-07 Alexei Podtelezhnikov - - Quick fix for Savannah bug #32671. - - This isn't the optimal solution yet, but it restores the previous - rendering quality (more or less). - - * src/smooth/ftgrays.c (gray_render_conic): Do more splitting. - -2011-03-06 Werner Lemberg - - Fix autohinting fallback. - - * src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs, - ignoring CFF-based OTFs. - -2011-02-27 Werner Lemberg - - Add AF_CONFIG_OPTION_USE_WARPER to control the autofit warper. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (AF_CONFIG_OPTION_USE_WARPER): New macro. - * src/autofit/aftypes.h (AF_USE_WARPER): Remove. - - * src/autofit/*: s/AF_USE_WARPER/AF_CONFIG_OPTION_USE_WARPER/. - - * src/autofit/afwarp.c [!AF_CONFIG_OPTION_USE_WARPER]: Replace dummy - variable assignment with a typedef. - -2011-02-26 Werner Lemberg - - [autofit] Slight simplifications. - - * src/autofit/aflatin.c (af_latin_hints_link_segments): Remove - test which always returns false. - (af_latin_hints_compute_blue_edges): Remove redundant assignment. - -2011-02-24 Werner Lemberg - - * docs/PROBLEMS: Mention rendering differences on different - platforms. - Suggested and worded by Jason Owen . - -2011-02-24 Werner Lemberg - - [autofit] Comment out unused code. - - * src/autofit/aflatin.c, src/autofit/aflatin2.c - (af_latin_hints_compute_edges): Do it. - -2011-02-24 Werner Lemberg - - * src/autofit/afhints.h (AF_GlyphHints): Remove unused field. - -2011-02-20 suzuki toshiya - - [cache] Fix an off-by-one bug in `FTC_Manager_RemoveFaceID'. - Found by , see detail in - - http://lists.gnu.org/archive/html/freetype/2011-01/msg00023.html - - * src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Check the node - buckets[cache->p + cache->mask] too. - -2011-02-19 Kevin Kofler - - Fall back to autohinting if a TTF/OTF doesn't contain any bytecode. - This is Savannah patch #7471. - - * src/base/ftobjs.c (FT_Load_Glyph): Implement it. - -2011-02-19 John Tytgat - - [cff] Fix subset prefix removal. - This is Savannah patch #7465. - - * src/cff/cffobjs.c (remove_subset_prefix): Update length after - subset prefix removal. - -2011-02-13 Bradley Grainger - - Add inline assembly version of FT_MulFix for MSVC. - - * include/freetype/config/ftconfig.h: Ported the FT_MulFix_i386 - function from GNU inline assembly syntax (see #ifdef __GNUC__ block - above) to MASM syntax for Microsoft Visual C++. - -2011-02-13 Bradley Grainger - - Add project and solution files in Visual Studio 2010 format. - - * builds/win32/.gitignore: Ignore user-specific cache files. - * builds/win32/vc2010/: Add VS2010 project & solution files, created - by upgrading builds/win32/vc2008/freetype.vcproj. - * objs/.gitignore: Ignore Visual Studio output files. - -2011-02-01 Werner Lemberg - - * src/autofit/afdummy.c: Include `aferrors.h'. - Problem reported by Chris Liddell . - -2011-02-01 Werner Lemberg - - [cff] Ignore unknown operators in charstrings. - Patch suggested by Miles.Lau . - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing - message for unknown operators and continue instead of exiting with a - syntax error. - -2011-02-01 Werner Lemberg - - [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also. - - * src/truetype/ttgload.c (tt_loader_init): Handle - `FT_LOAD_PEDANTIC'. - * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep, - tt_size_init_bytecode, tt_size_ready_bytecode): New argument to - handle pedantic mode. - * src/truetype/ttobjs.h: Updated. - -2011-01-31 Werner Lemberg - - [truetype] Protect jump instructions against endless loops. - - * src/truetype/interp.c (DO_JROT, DO_JMPR, DO_JROF): Exit with error - if offset is zero. - -2011-01-31 Werner Lemberg - - [truetype] Improve handling of invalid references. - - * src/truetype/interp.c: Set even more TT_Err_Invalid_Reference - error codes only if pedantic hinting is active. At the same time, - try to provide sane values which hopefully allow useful - continuation. Exception to this is CALL and LOOPCALL – due to - possible stack corruption it is necessary to bail out. - -2011-01-31 Werner Lemberg - - [truetype] Improve handling of stack underflow. - - * src/truetype/ttinterp.c (TT_RunIns, Ins_FLIPPT, Ins_DELTAP, - Ins_DELTAC): Exit with error only if `pedantic_hinting' is set. - Otherwise, try to do something sane. - -2011-01-30 Werner Lemberg - - * src/sfnt/ttmtx.c (tt_face_load_hmtx): Fix tracing message. - -2011-01-30 LIU Sun-Liang - - [truetype]: Fix behaviour of MIAP for invalid arguments. - - * src/truetype/ttinterp.c (Ins_MIAP): Set reference points even in - case of error. - -2011-01-18 Werner Lemberg - - [truetype] Fix handling of MIRP instruction. - - Thanks to Greg Hitchcock who explained the issue. - - * src/truetype/ttinterp.c (Ins_MIRP): Replace a `>=' operator with - `>' since the description in the specification is incorrect. - This fixes, for example, glyph `two' in font `Helvetica Neue LT Com - 65 medium' at 15ppem. - -2011-01-15 suzuki toshiya - - Fix ARM assembly code in include/freetype/config/ftconfig.h. - - * include/freetype/config/ftconfig.h (FT_MulFix_arm): - Copy the maintained code from builds/unix/ftconfig.in. - Old GNU binutils could not accept the reduced syntax - `orr %0, %2, lsl #16'. Un-omitted syntax like RVCT, - `orr %0, %0, %2, lsl #16' is better. Reported by - Johnson Y. Yan. The bug report by Qt developers is - considered too. - - http://bugreports.qt.nokia.com/browse/QTBUG-6521 - -2011-01-15 Werner Lemberg - - [raster] Make bbox handling the same as with Microsoft's rasterizer. - - Right before B/W rasterizing, the bbox gets simply rounded to - integers. This fixes, for example, glyph `three' in font `Helvetica - Neue LT Com 65 Medium' at 11ppem. - - Thanks to Greg Hitchcock who explained this behaviour. - - * src/raster/ftrend1.c (ft_raster1_render): Implement it. - -2011-01-15 suzuki toshiya - - Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS. - - * builds/unix/configure.raw: Consider recent gcc-standard - flags to specify architecture in CFLAGS & LDFLAGS - harmonization. Requested by Savannah bug #32114, to - support multilib feature of BuildRoot SDK correctly. - -2011-01-15 suzuki toshiya - - Fix off-by-one bug in CFLAGS & LDFLAGS harmonizer. - - * builds/unix/configure.raw: Some important options that - included in CFLAGS but not in LDFLAGS are copied to - LDFLAGS, but the last option in CFLAGS was not checked. - -2011-01-13 Werner Lemberg - - [raster] Add undocumented drop-out rule to the other bbox side also. - - * src/raster/ftraster.c (Vertical_Sweep_Drop, - Horizontal_Sweep_Drop): Implement it. - -2011-01-13 Werner Lemberg - - [raster] Reduce jitter value. - - This catches a rendering problem with glyph `x' from Tahoma at - 10ppem. It seems that the increase of the precision in the change - from 2009-06-11 makes a larger jitter value unnecessary. - - * src/raster/ftraster.c (Set_High_Precision): Implement it. - -2011-01-13 Werner Lemberg - - [raster] Handle drop-outs at glyph borders according to Microsoft. - - If a drop-out rule would switch on a pixel outside of the glyph's - bounding box, use the right (or top) pixel instead. This is an - undocumented feature, but some fonts like `Helvetica Neue LT Com 65 - Medium' heavily rely on it. - - Thanks to Greg Hitchcock who explained this behaviour. - - * src/raster/ftraster.c (Vertical_Sweep_Drop, - Horizontal_Sweep_Drop): Implement it. - -2011-01-09 suzuki toshiya - - [cache] Fix Savannah bug #31923, patch drafted by Harsha. - - When a node comparator changes the cached nodes during the - search of a node matching with queried properties, the - pointers obtained before the function should be updated to - prevent the dereference to freed or reallocated nodes. - To minimize the rescan of the linked list, the update is - executed when the comparator notifies the change of cached - nodes. This change depends previous change: - 38b272ffbbdaae276d636aec4ef84af407d16181 - - * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Rescan the - top node if the cached nodes are changed. - * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto. - -2011-01-09 suzuki toshiya - - [cache] Notice if a cache query induced the node list change. - - Some node comparators (comparing the cache node contents and the - properties specified by the query) can flush the cache node to - prevent the cache inflation. The change may invalidate the pointers - to the node obtained before the node comparison, so it should be - noticed to the caller. The problem caused by the cache node - changing is reported by Harsha, see Savannah bug #31923. - - * src/cache/ftccache.h (FTC_Node_CompareFunc): Add new argument - `FT_Bool* list_changed' to indicate the change of the cached nodes - to the caller. - (FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes by - `_list_changed'. - (FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed' - and update it when `FTC_Manager_FlushN' flushes any nodes. - - * src/cache/ftccback.h (ftc_snode_compare): Updated to fit with new - FTC_Node_CompareFunc type. - (ftc_gnode_compare): Ditto. - - * src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to use - TRUE/FALSE macros. - (ftc_basic_gnode_compare_faceid): New argument `FT_Bool* - list_changed' to indicate the change of the cache nodes (anyway, it - is always FALSE). - - * src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to use - TRUE/FALSE macros. - (ftc_cmap_node_compare): New argument `FT_Bool* list_changed' to - indicate the change of the cache nodes (anyway, it is always FALSE). - (ftc_cmap_node_remove_faceid): Ditto. - - * src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL pointer to - `FTC_CACHE_TRYLOOP_END', because the result is not needed. - (FTC_Cache_Lookup): Watch the change of the cache nodes by - `list_changed'. - (FTC_Cache_RemoveFaceID): Ditto. - - * src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to use - TRUE/FALSE macros. - (ftc_gnode_compare): New argument `FT_Bool* list_changed' to - indicate the change of the cache nodes (anyway, it is always FALSE). - (FTC_GNode_Compare): New argument `FT_Bool* list_changed' to be - passed to `ftc_gnode_compare'. - * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto. - - * src/cache/ftcsbits.c (ftc_snode_compare): New argument `FT_Bool* - list_changed' to indicate the change of the cache nodes, anyway. It - is updated by `FTC_CACHE_TRYLOOP'. - (FTC_SNode_Compare): New argument `FT_Bool* list_changed' to be - passed to `ftc_snode_compare'. - * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto. - -2011-01-09 suzuki toshiya - - [cache] Fit `FTC_GNode_Compare' to `FTC_Node_CompareFunc'. - - * src/cache/ftcglyph.h (FTC_GNode_Compare): Add the 3rd - argument `FTC_Cache cache' to fit FTC_Node_CompareFunc - prototype. - * src/cache/ftcglyph.c (FTC_GNode_Compare): Ditto. Anyway, - `cache' is not used by its child `ftc_gnode_compare'. - -2011-01-09 suzuki toshiya - - [cache] Deduplicate the code to get the top node by a hash. - - There are several duplicated code fragments getting the top node - from a cache by a given hash, like: - - idx = hash & cache->mask; - if ( idx < cache->p ) - idx = hash & ( cache->mask * 2 + 1 ); - pnode = cache->buckets + idx; - - To remove duplication, a cpp-macro to do same work - `FTC_NODE__TOP_FOR_HASH' is introduced. For non-inlined - configuration, non-`ftc_get_top_node_for_hash' is also introduced. - - * src/cache/ftccache.h (FTC_NODE__TOP_FOR_HASH): Declare - and implement inlined version. - (FTC_CACHE_LOOKUP_CMP): Use `FTC_NODE__TOP_FOR_HASH'. - * src/cache/ftccache.c (ftc_get_top_node_for_hash): Non-inlined - version. - (ftc_node_hash_unlink): Use `FTC_NODE__TOP_FOR_HASH'. - (ftc_node_hash_link): Ditto. - (FTC_Cache_Lookup): Ditto. - -2011-01-09 suzuki toshiya - - [cache] inline-specific functions are conditionalized. - - * src/cache/ftcglyph.c (FTC_GNode_Compare): Conditionalized for - inlined configuration. This function is a thin wrapper of - `ftc_gnode_compare' for inlined `FTC_CACHE_LOOKUP_CMP' (see - `nodecmp' argument). Under non-inlined configuration, - `ftc_gnode_compare' is invoked by `FTC_Cache_Lookup', via - `FTC_Cache->clazz.node_compare'. - - * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto. - * src/cache/ftcsbits.c (FTC_SNode_Compare): Ditto, for - `ftc_snode_compare'. - * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto. - -2011-01-09 suzuki toshiya - - [cache] Correct a type mismatch under non-inlined config. - - * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): `FTC_GCache_Lookup' - takes the node via a pointer `FTC_Node*', differently from cpp-macro - `FTC_CACHE_LOOKUP_CMP'. - -2011-01-06 suzuki toshiya - - Update Jamfile to include Bzip2 support. - - * Jamfile: Include src/bzip2 to project. - Comments for lzw, gzip, bzip2 are changed to clarify that - they are for compressed PCF fonts, not others. - (e.g. compressed BDF fonts are not supported yet) - -2011-01-05 suzuki toshiya - - Update Symbian project files to include Bzip2 support. - - Currently, it provides `FT_Stream_OpenBzip2' that returns - unimplemented error always, to prevent unresolved symbol - error for the applications designed for Unix systems. - - * builds/symbian/bld.inf: Include ftbzip2.h. - * builds/symbian/freetype.mmp: Include ftbzip2.c. - -2011-01-05 suzuki toshiya - - Update classic MacOS makefiles to include Bzip2 support. - - Currently, it provides `FT_Stream_OpenBzip2' that returns - unimplemented error always, to prevent unresolved symbol - error for the applications designed for Unix systems. - - * builds/mac/FreeType.m68k_cfm.make.txt: Include ftbzip2.c.o. - * builds/mac/FreeType.m68k_far.make.txt: Ditto. - * builds/mac/FreeType.ppc_carbon.make.txt: Include ftbzip2.c.x. - * builds/mac/FreeType.ppc_classic.make.txt: Ditto. - -2011-01-05 suzuki toshiya - - Update Amiga makefiles to include Bzip2 support. - - Currently, it provides `FT_Stream_OpenBzip2' that returns - unimplemented error always, to prevent unresolved symbol - error for the applications designed for Unix systems. - - * builds/amiga/makefile: Include bzip2.ppc.o built from ftbzip2.c. - * builds/amiga/makefile.os4: Include bzip2.o built from ftbzip2.c. - * builds/amiga/smakefile: Ditto. - -2011-01-05 suzuki toshiya - - Update pkg-config tools to reflect Bzip2 support. - - * builds/unix/freetype-config.in: Include `-lbz2' to - --libs output, if built with Bzip2 support. - * builds/unix/freetype2.in: Ditto. - -2011-01-05 suzuki toshiya - - * builds/unix/configure.raw: Remove `SYSTEM_BZ2LIB' macro. - - SYSTEM_ZLIB is used to switch the builtin zlib source - or system zlib source out of FreeType2. But ftbzip2 - module has no builtin bzip2 library and always requires - system bzip2 library. Thus SYSTEM_BZ2LIB is always yes, - it is not used. - -2011-01-03 Werner Lemberg - - */rules.mk: Handle `*pic.c' files. - -2010-12-31 Werner Lemberg - - * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64. - Problem reported by Tom Bishop . - -2010-12-31 Werner Lemberg - - Improve bzip2 support. - - * include/freetype/ftmoderr.h: Add bzip2. - - * docs/INSTALL.ANY, docs/CHANGES: Updated. - - * src/pcf/README: Updated. - * include/freetype/internal/pcftypes.h: Obsolete, removed. - -2010-12-31 Joel Klinghed - - Add bzip2 compression support to handle *.pcf.bz2 files. - - * builds/unix/configure.raw: Test for libbz2 library. - - * devel/ftoption.h, include/freetype/config/ftoption.h - (FT_CONFIG_OPTION_USE_BZIP2): Define. - * include/freetype/config/ftheader.h (FT_BZIP2_H): Define. - - * include/freetype/ftbzip2.h: New file. - - * src/bzip2/*: New files. - - * src/pcf/pcf.h: s/gzip_/comp_/. - * src/pcf/pcfdrvr.c: Include FT_BZIP2_H. - s/gzip_/comp_/. - (PCF_Face_Init): Handle bzip2 compressed files. - - * docs/formats.txt, modules.cfg: Updated. - -2010-12-25 Harsha - - Apply Savannah patch #7422. - - If we encounter a space in a string then the sbit buffer is NULL, - height and width are 0s. So the check in ftc_snode_compare will - always pass for spaces (comparision with 255). Here the comments - above the condition are proper but the implementation is not. When - we create an snode I think it is the proper way to initialize the - width to 255 and then put a check for being equal to 255 in snode - compare function. - - * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with - value 255. - (ftc_snode_compare): Fix condition. - -2010-12-13 Werner Lemberg - - Fix parameter handling of `FT_Set_Renderer'. - Reported by Kirill Tishin . - - * src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'. - -2010-12-09 Werner Lemberg - - [cff] Allow `hlineto' and `vlineto' without arguments. - - We simply ignore such instructions. This is invalid, but it doesn't - harm; and indeed, there exist such subsetted fonts in PDFs. - - Reported by Albert Astals Cid . - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - [cff_op_hlineto]: Ignore instruction if there aren't any arguments - on the stack. - -2010-11-28 Werner Lemberg - - * Version 2.4.4 released. - ========================= - - - Tag sources with `VER-2-4-4'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.4 - - * 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/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.3/2.4.4/, s/243/244/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4. - - * builds/unix/configure.raw (version_info): Set to 12:2:6. - -2010-11-28 Alexei Podtelezhnikov - - [ftsmooth]: Minor code simplification. - - * src/smooth/ftgrays (gray_render_cubic): Do only one comparison - instead of two. - -2010-11-26 Johnson Y. Yan - - [truetype] Better multi-threading support. - - * src/truetype/ttinterp.c (TT_Load_Context): Reset glyph zone - references. - -2010-11-23 John Tytgat - - * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand - start_point, check_points, add_point, add_point1, close_contour - macros. - Remove add_contour macro. - Return error code from t1_builder_start_point and - t1_builder_check_points when there was one (instead of returning 0). - -2010-11-22 suzuki toshiya - - [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums. - Some Latin TrueType fonts are still expected to be unhinted. - Fix Savannah bug #31645. - - * src/truetype/ttobjs.c (tt_check_trickyness): Divided to... - (tt_check_trickyness_family): this checking family name, and - (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep. - (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum - for specified subtable even if cleared by lazy PDF generators. - (tt_synth_sfnt_checksum): Function to calculate the checksum. - -2010-11-18 Werner Lemberg - - [truetype] Fix `loca' handling for inconsistent number of glyphs. - Reported by Johnson Y. Yan . - - * src/truetype/ttpload.c (tt_face_load_loca): While sanitizing, - handle case where `loca' is the last table in the font. - -2010-11-18 Werner Lemberg - - [sfnt] Ignore all errors while loading `OS/2' table. - Suggested by Johnson Y. Yan . - - * src/sfnt/sfobjs.c (sfnt_load_face): Do it. - -2010-11-18 Johnson Y. Yan - - [type1] Fix matrix normalization. - - * src/type1/t1load.c (parse_font_matrix): Handle sign of scaling - factor. - -2010-11-18 Werner Lemberg - - [type1] Improve guard against malformed data. - Based on a patch submitted by Johnson Y. Yan - - - * src/type1/t1load.c (read_binary_data): Check `size'. - -2010-11-17 Werner Lemberg - - [sfnt] While tracing, output table checksums also. - - * src/sfnt/ttload.c (tt_face_load_font_dir): Do it. - -2010-11-04 suzuki toshiya - - [UVS] Fix `find_variant_selector_charmap', Savannah bug #31545. - - Since 2010-07-04, `find_variant_selector_charmap' returns - the first cmap subtable always under rogue-compatible - configuration, it causes NULL pointer dereference and - make UVS-related functions crashed. - - * src/base/ftobjs.c (Fix find_variant_selector_charmap): - Returns UVS cmap correctly. - -2010-11-01 Alexei Podtelezhnikov - - [ftsmooth] Improve rendering. - - * src/smooth/ftsmooth.c (gray_render_conic): Since version 2.4.3, - cubic deviations have been estimated _after_ UPSCALE, whereas - conic ones have been evaluated _before_ UPSCALE, which produces - inferior rendering results. Fix this. - Partially undo change from 2010-10-15 by using ONE_PIXEL/4; this has - been tested with demo images sent to the mailing list. See - - http://lists.gnu.org/archive/html/freetype-devel/2010-10/msg00055.html - - and later mails in this thread. - -2010-10-28 Werner Lemberg - - [ftraster] Minor fixes. - - Reported by Tom Bishop . - - * src/raster/ftraster.c (ULong): Remove unused typedef. - (TWorker): Remove unused variable `precision_mask'. - -2010-10-28 Werner Lemberg - - [ftraster] Fix rendering. - - Problem reported by Tom Bishop ; see - thread starting with - - http://lists.gnu.org/archive/html/freetype/2010-10/msg00049.html - - * src/raster/ftraster.c (Line_Up): Replace FMulDiv with SMulDiv - since the involved multiplication exceeds 32 bits. - -2010-10-25 suzuki toshiya - - Revert a change of `_idx' type in `FTC_CACHE_LOOKUP_CMP'. - - * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert - the type of `_idx' from FT_PtrDist (by previous change) - to original FT_UFast, to match with FT_CacheRec. - -2010-10-24 suzuki toshiya - - [cache] Change the hash types to FT_PtrDist. - - On LLP64 platforms (e.g. Win64), FT_ULong (32-bit) - variables are inappropriate to calculate hash values - from the memory address (64-bit). The hash variables - are extended from FT_ULong to FT_PtrDist and new - hashing macro functions are introduced. The hash - values on 16-bit memory platforms are changed, but - ILP32 and LP64 are not changed. The hash value in - the cache subsystem is not reverted to the memory - address, so using signed type FT_PtrDist is safe. - - * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash - function to replace `FTC_FACE_ID_HASH' for portability. - * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace - `FTC_FACE_ID_HASH' by `_FTC_FACE_ID_HASH'. - * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto. - - * src/cache/ftccache.h (FTC_NodeRec): The type of the - member `hash' is changed from FT_UInt32 to FT_PtrDist. - - * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the - argument `hash' is changed from FT_UInt32 to FT_PtrDist. - (FTC_Cache_NewNode): Ditto. - * src/cache/ftccache.c (ftc_cache_add): Ditto. - (FTC_Cache_Lookup): Ditto. (FTC_Cache_NewNode): Ditto. - * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto. - * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto. - - * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type - of the internal variable `hash' is changed to FT_PtrDist - from FT_UInt32. (FTC_ImageCache_LookupScaler): Ditto. - (FTC_SBitCache_Lookup): Ditto. - (FTC_SBitCache_LookupScaler): Ditto. - * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto. - * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto. - Also the type of the internal variable `_idx' is changed to - FT_PtrDist from FT_UFast for better pointer calculation. - -2010-10-24 suzuki toshiya - - [cache] Hide internal macros incompatible with LLP64. - - `FT_POINTER_TO_ULONG', `FTC_FACE_ID_HASH', and - `FTC_IMAGE_TYPE_HASH' are enclosed by - FT_CONFIG_OPTION_OLD_INTERNALS and hidden from - normal clients. - - For the history of these macros, see the investigation: - http://lists.gnu.org/archive/html/freetype/2010-10/msg00022.html - -2010-10-24 suzuki toshiya - - Change the type of `FT_MEM_VAL' from FT_ULong to FT_PtrDist. - - On LLP64 platforms (e.g. Win64), unsigned long (32-bit) - cannot cover the memory address (64-bit). `FT_MEM_VAL' is - used for hashing only and not dereferred, so using signed - type FT_PtrDist is safe. - - * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the - return value from FT_ULong to FT_PtrDist. - (ft_mem_table_resize): The type of hash is changed to - FT_PtrDist. (ft_mem_table_get_nodep): Ditto. - -2010-10-24 suzuki toshiya - - Replace "%lx" for memory address by "%p", LLP64 platforms. - - On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover - the memory address (64-bit). Also the casts from the pointer - type to long int should be removed to preserve the address - correctly. - - * src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p". - (End_Profile) Ditto. - * src/truetype/ttinterp.c (Init_Context): Ditto. - -2010-10-15 Alexei Podtelezhnikov - - Fix thinko in spline flattening. - - FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL. - - * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and - replace it everywhere with ONE_PIXEL/8. - -2010-10-13 suzuki toshiya - - [raccess] Skip unrequired resource access rules by Darwin VFS. - - When a resource fork access rule by Darwin VFS could open the - resource fork but no font is found in it, the rest of rules - by Darwin VFS are skipped. It reduces the warnings of the - deprecated resource fork access method by recent Darwin kernel. - Fix MacPorts ticket #18859: - http://trac.macports.org/ticket/18859 - - * src/base/ftobjs.c (load_face_in_embedded_rfork): - When `FT_Stream_New' returns FT_Err_Cannot_Open_Stream, it - means that the file is possible to be `fopen'-ed but zero-sized. - Also there is a case that the resource fork is not zero-sized, - but no supported font exists in it. If a rule by Darwin VFS - falls into such cases, there is no need to try other Darwin VFS - rules anymore. Such cases are marked by vfs_rfork_has_no_font. - If it is TRUE, the Darwin VFS rules are skipped. - -2010-10-13 suzuki toshiya - - [raccess] Grouping resource access rules based on Darwin VFS. - - MacOS X/Darwin kernel supports a few tricky methods to access - a resource fork via ANSI C or POSIX interface. Current resource - fork accessor tries all possible methods to support all kernels. - But if a method could open a resource fork but no font is found, - there is no need to try other methods older than tested method. - To determine whether the rule index is for Darwin VFS, a local - function `ftrfork.c::raccess_rule_by_darwin_vfs' is introduced. - To use this function in ftobjs.c etc but it should be inlined, - it is exposed by ftbase.h. - - * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify - the rules to access the resource fork. - (raccess_guess_rec): New structure to bind the rule function and - rule enum type. - (FT_Raccess_Guess): The list of the rule functions is replaced by - (raccess_guess_table): This. This is exposed to be used by other - intra module functions. - (raccess_rule_by_darwin_vfs): A function to return a boolean - if the rule specified by the rule index is based on Darwin VFS. - -2010-10-13 suzuki toshiya - - Prevent to open a FT_Stream for zero-sized file on non-Unix. - - builds/unix/ftsystem.c prevents to open an useless stream from - zero-sized file and returns FT_Err_Cannot_Open_Stream, but the - stream drivers for ANSI C, Amiga and VMS return useless streams. - For cross-platform consistency, all stream drivers should act - same. - - * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened - file is zero, FT_Err_Cannot_Open_Stream is returned. - * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto. - * src/vms/ftsystem.c (FT_Stream_Open): Ditto. - -2010-10-12 Werner Lemberg - - [truetype] Fix Savannah bug #31310. - - * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against - invalid `runcnt' values. - -2010-10-08 Chris Liddell - - [sfnt] Fix Savannah bug #31275. - - * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H. - -2010-10-06 Werner Lemberg - - [truetype] Improve error handling of `SHZ' bytecode instruction. - Problem reported by Chris Evans . - - * src/truetype/ttinterp.c (Ins_SHZ): Check `last_point'. - -2010-10-05 Werner Lemberg - - Fix Savannah bug #31253. - Patch submitted by an anonymous reporter. - - * configure: Use `awk' instead of `sed' to manipulate output of `ls - -id'. - -2010-10-03 Werner Lemberg - - * Version 2.4.3 released. - ========================= - - - Tag sources with `VER-2-4-3'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.3 - - * 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/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.2/2.4.3/, s/242/243/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3. - - * builds/unix/configure.raw (version_info): Set to 12:1:6. - -2010-10-03 Werner Lemberg - - Avoid `configure' issues with symbolic links. - Based on a patch from Alexander Stohr . - - * configure: Compare directories using `ls -id'. - Check existence of `reference' subdirectory before creating it. - -2010-10-02 Werner Lemberg - - [sfnt] Fix Savannah bug #31088 (sort of). - - * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64 - function entries. - -2010-10-02 Werner Lemberg - - [smooth] Fix splitting of cubics for negative values. - - Reported by Róbert Márki ; see - http://lists.gnu.org/archive/html/freetype/2010-09/msg00019.html. - - * src/smooth/ftgrays.c (gray_render_cubic): Fix thinko. - -2010-10-01 suzuki toshiya - - [truetype] Fix Savannah bug #31040. - - * src/truetype/ttinterp.c (free_buffer_in_size): Remove. - (TT_RunIns): Updated. - -2010-09-20 suzuki toshiya - - [sfnt] Make error message filling NULL names less verbose. - - * src/sfnt/ttpost.c (load_format_20): Showing 1 summary message - when we fill `post' names by NULL, instead of per-entry message. - -2010-09-20 Graham Asher - David Bevan - - [smooth] Fix and improve spline flattening. - - This fixes the flattening of cubic, S-shaped curves and speeds up - the handling of both the conic and cubic arcs. - - See the discussions on the freetype-devel mailing list in late - August and September 2010 for details. - - * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): New macro. - (TWorker): Remove `conic_level' and `cubic_level' elements. - (gray_render_conic): Simplify algorithm. - (gray_render_cubic): New algorithm; details are given in the code - comments. - (gray_convert_glyph): Remove heuristics. - -2010-09-19 Werner Lemberg - - Minor fixes. - - * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]' - is `FT_UShort'. - (cff_index_access_element): Don't use additions in comparison. - * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type - `FT_Long'. - Don't use additions in comparison. - Improve tracing messages. - (load_format_25, load_post_names): Make `post_limit' of type - `FT_Long'. - -2010-09-19 suzuki toshiya - - [cff] Truncate the element length at the end of the stream. - See Savannah bug #30975. - - * src/cff/cffload.c (cff_index_access_element): `off2', the offset - to the next element is truncated at the end of the stream to prevent - invalid I/O. As `off1', the offset to the requested element has - been checked by `FT_STREAM_SEEK', `off2' should be checked - similarly. - -2010-09-19 suzuki toshiya - - [cff] Ignore CID > 0xFFFFU. - See Savannah bug #30975. - - * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if - greater than 0xFFFFU. CFF font spec does not mention maximum CID in - the font, but PostScript and PDF spec define that maximum CID is - 0xFFFFU. - -2010-09-19 suzuki toshiya - - [cff] Make trace message in` cff_charset_load' verbose. - See Savannah bug #30975. - - * src/cff/cffload.c (cff_charset_load): Report the original `nleft' - and truncated `nleft'. - -2010-09-19 suzuki toshiya - - [cff] Correct `max_cid' from CID array length to max CID. - See Savannah bug #30975. - - * src/cff/cffload.c (cff_charset_compute_cids): Don't increment - max_cid after detecting max CID. The array CFF_Charset->cids is - allocated by max_cid + 1. - (cff_charset_cid_to_gindex): Permit CID is less than or equal to - CFF_Charset->max_cid. - * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is - calculated as CFF_Charset->max_cid + 1. - -2010-09-19 suzuki toshiya - - [truetype] Sanitize the broken offsets in `loca'. - See Savannah bug #31040. - - * src/truetype/ttpload.c (tt_face_get_location): If `pos1', the - offset to the requested entry in `glyf' exceeds the end of the - table, return offset=0, length=0. If `pos2', the offset to the next - entry in `glyf' exceeds the end of the table, truncate the entry - length at the end of `glyf' table. - -2010-09-19 suzuki toshiya - - [sfnt] Prevent overrunning in `post' table parser. - See Savannah bug #31040. - - * src/sfnt/ttpost.c (load_post_names): Get the length of `post' - table and pass the limit of `post' table to `load_format_20' and - `load_format_25'. - (load_format_20): Stop the parsing when we reached at the limit of - `post' table. If more glyph names are required, they are filled by - NULL names. - -2010-09-17 suzuki toshiya - - [truetype] Don't duplicate size->twilight structure to be freed. - See Savannah bug #31040 for detail. - - * src/truetype/ttinterp.c (free_buffer_in_size): Don't duplicate - FT_GlyphZoneRec size->twilight to be freed. If duplicated, - `FT_FREE' erases the duplicated pointers only and leave original - pointers. They can cause the double-free crash when the burst - errors occur in TrueType interpreter and `free_buffer_in_size' is - invoked repeatedly. - -2010-09-15 Werner Lemberg - - Make bytecode debugging with FontForge work again. - - * src/truetype/ttinterp.c (TT_RunIns): Don't call - `free_buffer_in_size' in case of error if a debugger is active. - -2010-09-14 Werner Lemberg - - Improve tracing messages. - - * src/truetype/ttinterp.c (TT_RunIns): Improve wording of tracing - message. - * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Add - tracing message. - * src/truetype/ttgload.c (tt_loader_init): Add tracing message. - * src/cache/ftcsbits.c (ftc_snode_load): Emit tracing message if - glyph doesn't fit into a small bitmap container. - -2010-09-13 Werner Lemberg - - Fix minor issues reported by . - - * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove - redundant conditional check. - * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto. - * src/cff/cffload.c (cff_encoding_load): Remove conditional check - which always evaluates to `true'. - * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points): - Ditto. - * src/truetype/ttinterp.c (Ins_IUP): Ditto. - * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if - value is already dereferenced. - * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'. - -2010-08-31 suzuki toshiya - - Ignore the environmental setting of LIBTOOL. - Patch is suggested by Adrian Bunk, to prevent unexpected - reflection of environmental LIBTOOL. See: - http://savannah.nongnu.org/patch/?7290 - - * builds/unix/unix-cc.in: LIBTOOL is unconditionally set to - $(FT_LIBTOOL_DIR)/libtool. FT_LIBTOOL_DIR is set to $(BUILD_DIR) - by default. - * configure: When configured for the building out of source tee, - FT_LIBTOOL_DIR is set to $(OBJ_DIR). - -2010-08-31 suzuki toshiya - - [truetype] Decrease the trace level catching the interpreter error. - - * src/truetype/ttinterp.c (TT_RunIns): Decrease the trace level - showing the error when the interpreter returns with an error, - from` FT_TRACE7' to `FT_TRACE1'. - -2010-08-30 suzuki toshiya - - [truetype] Prevent bytecode reuse after the interpretation error. - - * src/truetype/ttinterp.c (free_buffer_in_size): New function to - free the buffer allocated during the interpretation of this glyph. - (TT_RunIns): Unset FT_Face->size->{cvt_ready,bytecode_ready} if - an error occurs in the bytecode interpretation. The interpretation - of invalid bytecode may break the function definitions and referring - them in later interpretation is danger. By unsetting these flags, - `fpgm' and `prep' tables are executed again in next interpretation. - - This fixes Savannah bug #30798, reported by Robert Święcki. - -2010-08-29 Werner Lemberg - - [ftraster] Pacify compiler. - - * src/raster/ftraster.c (ft_black_new) [_STANDALONE_]: `memory' is - not used. - -2010-08-29 Werner Lemberg - - [cff] Allow SIDs >= 65000. - - * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20: - The threshold for SIDs is not applicable here. I misinterpreted the - `SID values 65000 and above are available for implementation use' - sentence in the CFF specification. - - Problem reported by Ivan Ninčić . - -2010-08-28 suzuki toshiya - - Force hinting when the font lacks its familyname. - - In Type42 or Type11 font embedded in PostScript & PDF, TrueType sfnt - stream may lack `name' table because they are not required. Hinting - for nameless fonts is safer for PDFs including embedded Chinese - fonts. Written by David Bevan, see: - - http://lists.gnu.org/archive/html/freetype-devel/2010-08/msg00021.html - http://lists.freedesktop.org/archives/poppler/2010-August/006310.html - - * src/truetype/ttobjs.c (tt_check_trickyness): If a NULL pointer by - nameless font is given, TRUE is returned to enable hinting. - -2010-08-28 suzuki toshiya - - Register yet another tricky TrueType font. - - * src/truetype/ttobjs.c (tt_check_trickyness): Add `HuaTianKaiTi?', - a Kaishu typeface paired with `HuaTianSongTi?' by Huatian - Information Industry. - -2010-08-17 Teijo Kinnunen - - [cache] Fix Savannah bug #30788. - - * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for - NULL too. - -2010-08-10 Werner Lemberg - - Try to fix Savannah bug #30717 (and probably #30719 too). - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add another - overflow test for `width' and `height'. - -2010-08-06 Werner Lemberg - - * Version 2.4.2 released. - ========================= - - - Tag sources with `VER-2-4-2'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.2 - - * 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/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.1/2.4.2/, s/241/242/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2. - - * builds/unix/configure.raw (version_info): Set to 12:0:6. - -2010-08-06 suzuki toshiya - - Fix Savannah bug #30648. - - * src/base/ftobjs.c (FT_Done_Library): Specify the order of font - drivers during the face closing process. Type42 faces should be - closed before TrueType faces, because a Type42 face refers to - another internal TrueType face which is created from sfnt[] array on - the memory. - -2010-08-06 Yuriy Kaminskiy - - [raster] Fix valgrind warning. - - * src/raster/ftraster.c (Decompose_Curve) : Access point[0] - only if we don't hit `limit'. - -2010-08-06 suzuki toshiya - - Fix Savannah bug #30658. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Check that the total - length of collected POST segments does not overrun the allocated - buffer. - -2010-08-06 Yuriy Kaminskiy - - Fix conditional usage of FT_MulFix_i386. - With -ansi flag, gcc does not define `i386', only `__i386__'. - - * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: - s/i386/__i386__/. - -2010-08-05 Werner Lemberg - - [truetype] Fix Savannah bug #30657. - - * src/truetype/ttinterp.c (BOUNDSL): New macro. - Change `BOUNDS' to `BOUNDSL' where appropriate. - - * src/truetype/ttinterp.h (TT_ExecContextRec): Fix type of - `cvtSize'. - -2010-08-05 Werner Lemberg - - [type42] Fix Savannah bug #30656. - - * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative - string_size. - Fix comparison. - -2010-08-05 suzuki toshiya - - [cff] Don't use any values in decoder after parsing error. - - * src/cff/cffgload.c (cff_slot_load): Skip the evaluations - of the values in decoder, if `cff_decoder_parse_charstrings' - returns any error. - -2010-08-04 Werner Lemberg - - Fix Savannah bug #30644. - - * src/base/ftstream.c (FT_Stream_EnterFrame): Fix comparison. - -2010-08-04 Werner Lemberg - - `make devel' fails if FT_CONFIG_OPTION_OLD_INTERNALS is set. - - * devel/ftoption.h: Synchronize with - include/freetype/config/ftoption.h. - -2010-08-04 suzuki toshiya - - [cff] Improve stack overflow test. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack - after execution of operations too. - -2010-07-18 Werner Lemberg - - Add reference counters and to FT_Library and FT_Face objects. - - * include/freetype/freetype.h (FT_Reference_Face): New function. - * include/freetype/ftmodapi.h (FT_Rererence_Library): New function. - - * include/freetype/internal/ftobjs.h (FT_Face_InternalRec, - FT_LibraryRec): New field `refcount'. - - * src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle - `refcount'. - (FT_Reference_Face, FT_Reference_Library): Implement new functions. - (FT_Done_Face, FT_Done_Library): Handle `refcount'. - - * docs/CHANGES: Updated. - -2010-07-18 Werner Lemberg - - * Version 2.4.1 released. - ========================= - - - Tag sources with `VER-2-4-1'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.1. - - * 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/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.0/2.4.1/, s/240/241/. - - * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. - - * builds/unix/configure.raw (version_info): Set to 11:1:5. - -2010-07-17 Werner Lemberg - - [cff] Final try to fix `hintmask' and `cntrmask' limit check. - - Problem reported by Tobias Wolf . - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Sigh. I'm apparently too silly to fix this - correctly in less than three tries. - -2010-07-12 Werner Lemberg - - * Version 2.4.0 released. - ========================= - - - Tag sources with `VER-2-4-0'. - - * docs/CHANGES: Updated. - - * docs/VERSION.DLL: Update documentation and bump version number to - 2.4.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/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.3.12/2.4.0/, s/2312/240/. - - * include/freetype/freetype.h (FREETYPE_MINOR): Set to 4. - (FREETYPE_PATCH): Set to 0. - - * builds/unix/configure.raw (version_info): Set to 11:0:5. - -2010-07-12 Werner Lemberg - - Remove C++ warnings. - - */*: Initialize pointers where necessary to make g++ happy. - -2010-07-12 malc - Richard Henderson - - Fix type-punning issues with C++. - - * include/freetype/internal/ftmemory.h (FT_ASSIGNP) [__cplusplus]: - Emulate a `typeof' operator with an inline template which uses - `static_cast'. - -2010-07-11 Werner Lemberg - - Fix C++ compilation issue. - - * src/tools/apinames.c (names_dump) : Fix - type of `dot' variable. - -2010-07-10 suzuki toshiya - - Fix another case reported in Savannah bug #30373. - Permit a face for Type1, Type42 and CFF without charmap, - patch by Tor Andersson. - - * src/type1/t1objs.c (T1_Face_Init): Reset the error if it - is FT_Err_No_Unicode_Glyph_Name. - * src/type42/t42objs.c (T42_Face_Init): Ditto. - * src/cff/cffobjs.c (cff_face_init): Ditto. - -2010-07-09 suzuki toshiya - - Use defined macros to set {platform,encoding}_id. - - * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to - set charmap.{platfom,encoding}_id. - * src/pcf/pcfdrivr.c: Ditto. - * src/winfonts/winfnt.c: Ditto. - * src/type1/t1objs.c: Ditto. - * src/type42/t42objs.c: Ditto. - * src/cff/cffobjs.c: Ditto. - * src/pfr/pfrobjs.c: Ditto. - -2010-07-09 suzuki toshiya - - Fix Savannah bug #30373. - Too serious check of errors by `FT_CMap_New' since 2010-07-04 - is fixed. Reported by Tor Andersson. - - * include/freetype/fterrdef.h - (PSnames_Err_No_Unicode_Glyph_Name): New error code to - indicate the Unicode charmap synthesis failed because - no Unicode glyph name is found. - - * src/psnames/psmodule.c (ps_unicodes_init): Return - PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name - is found in the font. - * src/cff/cffcmap.c (cff_cmap_unicode_init): Return - CFF_Err_No_Unicode_Glyph_Name when no SID is available. - - * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New' - is failed by the lack of Unicode glyph name. - * src/type42/t42objs.c (T42_Face_Init): Ditto. - * src/cff/cffobjs.c (cff_face_init): Ditto. - -2010-07-09 Ken Sharp - - Make ftraster.c compile in stand-alone mode with MSVC compiler. - - * src/raster/ftmisc.h (FT_Int64) [_WIN32, _WIN64]: Fix typedef - since there is no `inttypes.h' for MSVC. - -2010-07-08 Werner Lemberg - - [truetype] Fix Savannah bug #30361. - - * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check. - -2010-07-06 Werner Lemberg - - Pacify compiler. - - * src/cff/cffload.c (cff_index_get_pointers): Initialize - `new_bytes'. - -2010-07-05 Eugene A. Shatokhin - - Fix Savannah bug #27648. - - * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call - `raster_done' only if we have an outline glyph format. - -2010-07-05 Werner Lemberg - - Fix Savannah bug #30030. - - * builds/win32/*/freetype.vcproj: Add ftxf86.c. - -2010-07-05 Werner Lemberg - - [cff] Next try to fix `hintmask' and `cntrmask' limit check. - - Problem reported by malc . - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : It is possible that there is just a single byte - after the `hintmask' or `cntrmask', e.g., a `return' instruction. - -2010-07-04 suzuki toshiya - - Restrict the number of the charmaps in a rogue-compatible mode. - Fix for Savannah bug #30059. - - * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the - minimum character code passed by a legacy rogue client by... - * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE): - This. It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is - undefined (thus the rogue client compatibility is not required). - - * src/cff/cffobjs.c (cff_face_init): Abort the automatic - selection or synthesis of Unicode cmap subtable when the charmap - index exceeds FT_MAX_CHARMAP_CACHEABLE. - * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message - when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. - - * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap - is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search - earlier one. - (find_variant_selector_charmap): When UVS charmap is found after - FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. - (FT_Select_Charmap): When a charmap matching with requested - encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search - earlier one. - (FT_Set_Charmap): When a charmap matching with requested - charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search - earlier one. - (FT_Get_Charmap_Index): When a requested charmap is found - after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap - index. - -2010-07-04 Werner Lemberg - - TrueType hinting is no longer patented. - - * include/freetype/config/ftoption.h, devel/ftoption.h - (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Define. - (TT_CONFIG_OPTION_UNPATENTED_HINTING): Undefine. - - * docs/CHANGES, docs/INSTALL, include/freetype/freetype.h: Updated. - * docs/TRUETYPE, docs/PATENTS: Removed. - -2010-07-04 suzuki toshiya - - Check error value by `FT_CMap_New'. - - * src/cff/cffobjs.c (cff_face_init): Check error value by - `FT_CMap_New'. - * src/pfr/pfrobjs.c (pfr_face_init): Ditto. - * src/type1/t1jobjs.c (T1_Face_Init): Ditto. - * src/type42/t42jobjs.c (T42_Face_Init): Ditto. - -2010-07-03 Werner Lemberg - - Make ftgrays.c compile stand-alone again. - - * src/smooth/ftgrays.c [_STANDALONE_]: Include `stddef.h'. - (FT_INT_MAX, FT_PtrDist)[_STANDALONE_]: Define. - -2010-07-02 suzuki toshiya - - Additional fix for Savannah bug #30306. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): If the type of the - POST fragment is 0, the segment is completely ignored. The declared - length of the segment is not cared at all. According to Adobe - Technical Note 5040, type 0 segment is a comment only and should not - be loaded for the interpreter. Reported by Robert Święcki. - -2010-07-01 Werner Lemberg - - [truetype] Protect against code range underflow. - - * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Don't allow - negative IP values. - -2010-07-01 Werner Lemberg - - [truetype] Add rudimentary tracing for bytecode instructions. - - * src/truetype/ttinterp.c (opcode_name) [FT_DEBUG_LEVEL_TRACE]: New - array. - (TT_RunIns): Trace opcodes. - -2010-06-30 Werner Lemberg - - [smooth] Fix Savannah bug #30263. - - * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned - int' to avoid integer overflow. - - * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use smaller - threshold values for `width' and `height'. This is not directly - related to the bug fix but makes sense anyway. - -2010-07-01 suzuki toshiya - - Initial fix for Savannah bug #30306. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen', the - length of fragment declared in the POST fragment header, and prevent - an underflow in length calculation. Some fonts set the length to - zero in spite of the existence of a following 16bit `type'. - Reported by Robert Święcki. - -2010-07-01 suzuki toshiya - - Additional fix for Savannah bug #30248 and #30249. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer size - during gathering PFB fragments embedded in LaserWriter PS font for - Macintosh. Reported by Robert Święcki. - -2010-06-30 Alexei Podtelezhnikov - - Minor optimizations by avoiding divisions. - - * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): - Replace divisions with multiplication in comparisons. - -2010-06-29 Werner Lemberg - - Fix minor tracing issues. - - * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels. - -2010-06-27 Werner Lemberg - - [cff] Really fix `hintmask' and `cntrmask' limit check. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Fix thinko and handle tracing also. - -2010-06-27 Werner Lemberg - - Fix valgrind warning. - - * src/base/ftoutln.c (FT_Outline_Get_Orientation): Initialize - `result' array. - -2010-06-27 Werner Lemberg - - [cff] Fix memory leak. - - * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in - case of errors. - -2010-06-27 Werner Lemberg - - [cff] Protect against invalid `hintmask' and `cntrmask' operators. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Ensure that we don't exceed `limit' while parsing - the bit masks of the `hintmask' and `cntrmask' operators. - -2010-06-26 Werner Lemberg - - Fix PFR change 2010-06-24. - - * src/pfr/pfrgload.c (pfr_glyph_load_simple): Really protect against - invalid indices. - -2010-06-26 Werner Lemberg - - Improve PFR tracing messages. - - * src/pfr/pfrgload.c (pfr_glyph_load_rec): Emit tracing messages for - simple and compound glyph offsets. - -2010-06-26 Werner Lemberg - - Fix last PFR change. - - * src/pfr/pfrobjs.c (pfr_face_init): Fix rejection logic. - -2010-06-26 Werner Lemberg - - [sfnt] Fix Savannah bug #30262. - - * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth' - arbitrarily to 100 to avoid stack exhaustion. - -2010-06-26 Werner Lemberg - - Add some memory checks (mainly for debugging). - - * src/base/ftstream.c (FT_Stream_EnterFrame): Exit with error - if the frame size is larger than the stream size. - - * src/base/ftsystem.c (ft_ansi_stream_io): Exit with error if - seeking a position larger than the stream size. - -2010-06-25 Werner Lemberg - - [pfr] Fix Savannah bug #30261. - - * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain - neither outline nor bitmap glyphs. - -2010-06-25 Werner Lemberg - - [cff] Fix Savannah bug #30254. - - * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for - first offset also. - -2010-06-25 suzuki toshiya - - Initial fix for Savannah bug #30248 and #30249. - - * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during - reading a PFB fragment embedded in LaserWriter PS font for Macintosh. - Reported by Robert Święcki. - -2010-06-24 Werner Lemberg - - [pcf] Fix Savannah bug #30247. - - * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with - zero metrics. - -2010-06-24 Graham Asher - - * src/smooth/ftgrays.c (gray_render_cubic): Fix algorithm. - The previous version was too aggressive, as demonstrated in - http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00020.html. - -2010-06-24 Werner Lemberg - - */*: Use module specific error names where appropriate. - -2010-06-24 Werner Lemberg - - [sfnt] Fix Savannah bug #30236. - - * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer - to `cmap_table'. - -2010-06-24 Werner Lemberg - - [pfr] Fix Savannah bug #30235. - - * src/pfr/pfrgload.c (pfr_glyph_load_simple): Protect against - invalid indices if there aren't any coordinates for indexing. - -2010-06-24 Werner Lemberg - - [bdf]: Font properties are optional. - - * src/bdf/bdflib.c (_bdf_readstream): Use special error code to - indicate a redo operation. - (_bdf_parse_start): Handle `CHARS' keyword here too and pass current - input line to `_bdf_parse_glyph'. - -2010-06-23 Werner Lemberg - - [bdf] Fix Savannah bug #30220. - - * include/freetype/fterrdef.h - (BDF_Err_Missing_Fontboundingbox_Field): New error code. - - * src/bdf/bdflib.c (_bdf_parse_start): Check for missing - `FONTBOUNDINGBOX' field. - Avoid memory leak if there are multiple `FONT' lines (which is - invalid but doesn't hurt). - -2010-06-21 Werner Lemberg - - [pfr] Fix Savannah bug #30168. - - * src/pfr/pfrgload.c (pfr_glyph_load_compound): Limit the number of - subglyphs to avoid endless recursion. - -2010-06-20 Werner Lemberg - - [psaux] Fix Savannah bug #30145. - - * src/psaux/psobjs.c (t1_builder_add_contour): Protect against - `outline == NULL' which might happen in invalid fonts. - -2010-06-19 Werner Lemberg - - [bdf] Fix Savannah bug #30135. - - * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static - string `empty'. - (_bdf_parse_glyph): Avoid memory leak in case of error. - -2010-06-15 Werner Lemberg - - [autofit] Fix Savannah bug #30108. - - * src/autofit/afglobal.c (af_face_globals_compute_script_coverage): - Properly mask AF_DIGIT bit in comparison. - -2010-06-11 Werner Lemberg - - [pshinter] Fix Savannah bug #30106. - - Point numbers for FreeType's implementation of hinting masks are - collected before the final number of points of a glyph has been - determined; in particular, the code for handling the `endchar' - opcode can reduce the number of points. - - * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Assure that - `end_point' is not larger than `glyph->num_points'. - -2010-06-11 Werner Lemberg - - [cff]: Improve debugging output. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Implement it. - -2010-06-10 Graham Asher - - ftgrays: Speed up rendering of small cubic splines. - - * src/smooth/ftgrays.c (gray_render_cubic): Implement new, - simplified algorithm to find out whether the spline can be replaced - with two straight lines. See this thread for more: - - http://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00000.html - -2010-06-09 Werner Lemberg - - [cff] Fix Savannah bug #30082. - - * src/cff/cffgload.c (cff_decoder_parse_charstrings) - : Protect against stack underflow. - -2010-06-08 Werner Lemberg - - [cff] Fix Savannah bug #30053. - - * src/cff/cffparse.c (cff_parse_real): Handle border case where - `fraction_length' has value 10. - -2010-06-07 Werner Lemberg - - Fix Savannah bug #30052. - This bug has been introduced with commit 2415cbf3. - - * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect - against endless loop in case of corrupted font header data. - -2010-05-26 Werner Lemberg - - Remove unused variable. - Found by Graham. - - * src/autofit/afhints.c (af_glyph_hints_reload): Remove unused - variable `first' in first block. - -2010-05-22 Werner Lemberg - - Fix various memory problems found by linuxtesting.org. - - * src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free), - src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c - (ft_pfr_check): Check `face'. - - * src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and - `charmap->face'. - (FT_Render_Glyph): Check `slot->face'. - (FT_Get_SubGlyph_Info): Check `glyph->subglyphs'. - -2010-05-22 Werner Lemberg - - autofit: Remove dead code. - Suggested by Graham. - - * src/autofit/afhints.c (af_glyph_hints_compute_inflections): - Removed. - (af_glyph_hints_reload): Remove third argument. - Update all callers. - -2010-05-21 Bram Tassyns - - [cff] Fix Savannah bug #27987. - - * src/cff/cffobjs.c (remove_subset_prefix): New function. - (cff_face_init): Use it to adjust `cffface->family_name'. - -2010-05-20 Werner Lemberg - - TrueType: Make FreeType ignore maxSizeOfInstructions in `maxp'. - - Acroread does the same. - - * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Call - `Update_Max' to adjust size of instructions array if necessary and - add a rough safety check. - - (load_truetype_glyph): Save `loader->byte_len' before recursive - call. - - * src/truetype/ttinterp.h, src/truetype/ttinterp.c (Update_Max): - Declare it as FT_LOCAL. - -2010-05-18 Hongbo Ni - - Apply Savannah patch #7196. - - * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont - index is out of range. - -2010-05-11 Werner Lemberg - - * docs/formats.txt: Give pointer to PCF documentation. - Information provided by Alan Coopersmith - . - -2010-05-10 Ken Sharp - - [psaux] Fix Savannah bug #29846. - - Previously we discovered fonts which used `setcurrentpoint' to set - the initial point of a contour to 0,0. This caused FreeType to - raise an error, because the `setcurrentpoint' operator is only - supposed to be used with the results from an OtherSubr subroutine. - - This was fixed by simply ignoring the error and carrying on. - - Now we have found a font which uses setcurrentpoint to actually - establish a non-zero point for a contour during the course of a - glyph program. FWIW, these files may be produced by an application - called `Intaglio' on the Mac, when converting TrueType fonts to - Type 1. - - The fix allows the new invalid behaviour, the old invalid behaviour - and real proper usage of the operator to work the same way as Adobe - interpreters apparently do. - - * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make - `setcurrentpoint' use the top two elements of the stack to establish - unconditionally the current x and y coordinates. - - Make the `flex' subroutine handling (OtherSubr 0) put the current - x,y coordinates onto the stack, instead of two dummy uninitialised - values. - -2010-04-14 Ken Sharp - - [psaux] Fix Savannah bug #29444. - - * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid) - `lineto' immediately after `hsbw', in accordance with Acrobat, GS, - and others. - -2010-04-14 Michał Cichoń - - [psaux] Fix Savannah bug #27999. - - * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): Only remove - selected entry, not all. - -2010-04-06 Jonathan Kew - - [truetype] Add overflow check to `fvar' table. - - * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance - count. - -2010-04-05 Ken Sharp - - [raster] Fix Savannah bug #29335. - - * src/raster/ftraster.c (Line_Up): Use slow multiplication to - prevent overflow. This shouldn't have any serious impact on speed, - however. - -2010-04-05 Werner Lemberg - - Add new function `FT_Library_SetLcdFilterWeights'. - - This is based on code written by Lifter - . It fixes - FreeDesktop bug #27386. - - * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): New - function. - - * include/freetype/ftlcdfil.h: Updated. - - * docs/CHANGES: Updated. - -2010-04-01 John Tytgat - - [truetype] Fix Savannah bug #29404. - - * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1 - of `head' table of TrueType fonts). - -2010-03-14 suzuki toshiya - - Fix `multi build' for Tytgat's CFF driver improvement. - - * src/base/cffload.h (cff_index_get_name): Added. - -2010-03-12 suzuki toshiya - - Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c. - - * src/base/ftobjs.c: Remove 2nd inclusion of `FT_OUTLINE_H'. - -2010-03-11 Chris Liddell - - [raster] Fix Savannah bug #27442. - - * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'. - -2010-03-09 Werner Lemberg - - [cff] Remove unused variable. - Reported by Graham. - - * src/cff/cffparse.c (cff_parse_real): Remove `rest'. - -2010-03-02 John Tytgat - - [cff] Improve CFF string (especially glyphname) lookup performance. - - We do this by avoiding memory allocation and file I/O. This is - Savannah patch #7104. - - * src/cff/cfftypes.h: Include PS cmaps service and - FT_INTERNAL_POSTSCRIPT_HINTS_H. - (CFF_SubFontRec): Remove `num_local_subrs'. - (CFF_FontRec): Add `num_strings', `strings', and `string_pool' - fields. - Remove `string_index' and `num_global_subrs' fields. - Use real types instead of `void' for `pshinter' and `psnames' fields. - - * src/cff/cffload.c: Don't include PS cmaps service. - (cff_index_get_pointers): Add `pool' parameter which allows to - insert an extra NUL character for each String INDEX entry. - (cff_index_get_name): Make it a local function. - (cff_index_get_string): New function. - (cff_subfont_load): Updated. - (cff_font_load): Initialize `num_strings', `strings', and - `string_pool' fields in the `CFF_FontRec' structure. - (cff_index_get_sid_string): Use `cff_index_get_string' instead of - `cff_index_get_name'. - (cff_font_done): Updated. - - * src/cff/cffload.h: Don't include PS cmaps service. - (cff_index_get_string): Added. - (cff_index_get_sid_string): Updated. - - * src/cff/cffobjs.c: Don't include PS cmaps service and - FT_INTERNAL_POSTSCRIPT_HINTS_H. - (cff_size_get_globals_funcs, cff_slot_init): Updated. - (cff_face_init): Follow `cff_index_get_name', - `cff_index_get_string', and `cff_index_get_sid_string' changes. - - * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed. - (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'. - (cff_cmap_unicode_init): Updated. - - * src/cff/cffdrivr.c: Don't include PS cmap service. - (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS - service. - (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API - `cff_index_get_sid_string' change. - (cff_get_name_index): Use `cff_index_get_string' instead of - `cff_index_get_name'. - - * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H. - (cff_decoder_init, cff_decoder_prepare): Updated. - -2010-02-27 Werner Lemberg - - Simplify code. - Suggested by Behdad. - - * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we - call FT_Get_Next_Char anyway if necessary. - -2010-02-26 Behdad Esfahbod - - Improve handling of invalid glyph indices in char->index functions. - - * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a - loop. - -2010-02-18 Chris Liddell - - [truetype] Fix Savannah bug #28905. - - Initialize phantom points before calling the incremental interface - to update glyph metrics. - - * src/truetype/ttgload.c (tt_get_metrics_incr_overrides) - [FT_CONFIG_OPTION_INCREMENTAL]: New function, split off from... - (tt_get_metrics): This. - Updated. - (load_truetype_glyph): Use tt_get_metrics_incr_overrides. - ---------------------------------------------------------------------------- -Copyright 2010-2013 by +Copyright 2013-2014 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, modified, Index: lib/3rdparty/freetype/devel/ftoption.h =================================================================== --- lib/3rdparty/freetype/devel/ftoption.h (revision 62563) +++ lib/3rdparty/freetype/devel/ftoption.h (working copy) @@ -219,6 +219,19 @@ /*************************************************************************/ /* */ + /* HarfBuzz support. */ + /* */ + /* FreeType uses the HarfBuzz library to improve auto-hinting of */ + /* OpenType fonts. If available, many glyphs not directly addressable */ + /* by a font's character map will be hinted also. */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +#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 */ Index: lib/3rdparty/freetype/include/config/ftconfig.h =================================================================== --- lib/3rdparty/freetype/include/config/ftconfig.h (revision 62563) +++ lib/3rdparty/freetype/include/config/ftconfig.h (working copy) @@ -4,7 +4,7 @@ /* */ /* ANSI-specific configuration file (specification only). */ /* */ -/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by */ +/* Copyright 1996-2004, 2006-2008, 2010-2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -386,7 +386,7 @@ __asm__ __volatile__ ( "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ -#ifdef __clang__ +#if defined( __clang__ ) && defined( __thumb2__ ) "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ #else "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ Index: lib/3rdparty/freetype/include/config/ftoption.h =================================================================== --- lib/3rdparty/freetype/include/config/ftoption.h (revision 62563) +++ lib/3rdparty/freetype/include/config/ftoption.h (working copy) @@ -230,6 +230,19 @@ /*************************************************************************/ /* */ + /* HarfBuzz support. */ + /* */ + /* FreeType uses the HarfBuzz library to improve auto-hinting of */ + /* OpenType fonts. If available, many glyphs not directly addressable */ + /* by a font's character map will be hinted also. */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */ + + + /*************************************************************************/ + /* */ /* DLL export compilation */ /* */ /* When compiling FreeType as a DLL, some systems/compilers need a */ Index: lib/3rdparty/freetype/include/freetype.h =================================================================== --- lib/3rdparty/freetype/include/freetype.h (revision 62563) +++ lib/3rdparty/freetype/include/freetype.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType high-level API and common types (specification only). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -42,6 +42,38 @@ /*************************************************************************/ /* */ /*
*/ + /* header_inclusion */ + /* */ + /* */ + /* FreeType's header inclusion scheme */ + /* */ + /* <Abstract> */ + /* How client applications should include FreeType header files. */ + /* */ + /* <Description> */ + /* To be as flexible as possible (and for historical reasons), */ + /* FreeType uses a very special inclusion scheme to load header */ + /* files, for example */ + /* */ + /* { */ + /* #include <ft2build.h> */ + /* */ + /* #include FT_FREETYPE_H */ + /* #include FT_OUTLINE_H */ + /* } */ + /* */ + /* A compiler and its preprocessor only needs an include path to find */ + /* the file `ft2build.h'; the exact locations and names of the other */ + /* FreeType header files are hidden by preprocessor macro names, */ + /* loaded by `ft2build.h'. The API documentation always gives the */ + /* header macro name needed for a particular function. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Section> */ /* user_allocation */ /* */ /* <Title> */ @@ -2273,6 +2305,8 @@ /* glyph relative to this size. For more information refer to */ /* `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html' */ /* */ + /* Don't use this function if you are using the FreeType cache API. */ + /* */ FT_EXPORT( FT_Error ) FT_Request_Size( FT_Face face, FT_Size_Request req ); @@ -2347,6 +2381,8 @@ /* constrained, to this pixel size. Refer to @FT_Request_Size to */ /* understand how requested sizes relate to actual sizes. */ /* */ + /* Don't use this function if you are using the FreeType cache API. */ + /* */ FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes( FT_Face face, FT_UInt pixel_width, @@ -2839,6 +2875,10 @@ /* <Return> */ /* FreeType error code. 0~means success. */ /* */ + /* <Note> */ + /* To get meaningful results, font scaling values must be set with */ + /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */ + /* */ FT_EXPORT( FT_Error ) FT_Render_Glyph( FT_GlyphSlot slot, FT_Render_Mode render_mode ); @@ -3925,7 +3965,7 @@ */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 5 -#define FREETYPE_PATCH 2 +#define FREETYPE_PATCH 3 /*************************************************************************/ Index: lib/3rdparty/freetype/include/ftautoh.h =================================================================== --- lib/3rdparty/freetype/include/ftautoh.h (revision 62563) +++ lib/3rdparty/freetype/include/ftautoh.h (working copy) @@ -287,7 +287,7 @@ * face-specific property like @glyph-to-script-map, or by auto-hinting * any glyph from that face. In particular, if you have already created * an @FT_Face structure but not loaded any glyph (using the - * auto-hinter), a change of the fallback glyph will affect this face. + * auto-hinter), a change of the fallback script will affect this face. * */ @@ -295,6 +295,51 @@ /************************************************************************** * * @property: + * default-script + * + * @description: + * *Experimental* *only* + * + * If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make + * the HarfBuzz library access OpenType features for getting better + * glyph coverages, this property sets the (auto-fitter) script to be + * used for the default (OpenType) script data of a font's GSUB table. + * Features for the default script are intended for all scripts not + * explicitly handled in GSUB; an example is a `dlig' feature, + * containing the combination of the characters `T', `E', and `L' to + * form a `TEL' ligature. + * + * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the + * `default-script' property, this default value can be changed. + * + * { + * FT_Library library; + * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE; + * + * + * FT_Init_FreeType( &library ); + * + * FT_Property_Set( library, "autofitter", + * "default-script", &default_script ); + * } + * + * @note: + * This property can be used with @FT_Property_Get also. + * + * It's important to use the right timing for changing this value: The + * creation of the glyph-to-script map that eventually uses the + * default script value gets triggered either by setting or reading a + * face-specific property like @glyph-to-script-map, or by auto-hinting + * any glyph from that face. In particular, if you have already created + * an @FT_Face structure but not loaded any glyph (using the + * auto-hinter), a change of the default script will affect this face. + * + */ + + + /************************************************************************** + * + * @property: * increase-x-height * * @description: Index: lib/3rdparty/freetype/include/ftbdf.h =================================================================== --- lib/3rdparty/freetype/include/ftbdf.h (revision 62563) +++ lib/3rdparty/freetype/include/ftbdf.h (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType API for accessing BDF-specific strings (specification). */ /* */ -/* Copyright 2002, 2003, 2004, 2006, 2009 by */ +/* Copyright 2002-2004, 2006, 2009, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -106,7 +106,8 @@ * The property type. * * u.atom :: - * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. + * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. May be + * NULL, indicating an empty string. * * u.integer :: * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. Index: lib/3rdparty/freetype/include/ftchapters.h =================================================================== --- lib/3rdparty/freetype/include/ftchapters.h (revision 62563) +++ lib/3rdparty/freetype/include/ftchapters.h (working copy) @@ -15,6 +15,7 @@ /* General Remarks */ /* */ /* <Sections> */ +/* header_inclusion */ /* user_allocation */ /* */ /***************************************************************************/ Index: lib/3rdparty/freetype/include/ftoutln.h =================================================================== --- lib/3rdparty/freetype/include/ftoutln.h (revision 62563) +++ lib/3rdparty/freetype/include/ftoutln.h (working copy) @@ -5,7 +5,7 @@ /* Support for the FT_Outline type used to store glyph shapes of */ /* most scalable font formats (specification). */ /* */ -/* Copyright 1996-2003, 2005-2013 by */ +/* Copyright 1996-2003, 2005-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -355,6 +355,9 @@ /* FT_Outline_Embolden( &face->slot->outline, strength ); */ /* } */ /* */ + /* To get meaningful results, font scaling values must be set with */ + /* functions like @FT_Set_Char_Size before calling FT_Render_Glyph. */ + /* */ FT_EXPORT( FT_Error ) FT_Outline_Embolden( FT_Outline* outline, FT_Pos strength ); Index: lib/3rdparty/freetype/include/internal/ftrfork.h =================================================================== --- lib/3rdparty/freetype/include/internal/ftrfork.h (revision 62563) +++ lib/3rdparty/freetype/include/internal/ftrfork.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Embedded resource forks accessor (specification). */ /* */ -/* Copyright 2004, 2006, 2007, 2012 by */ +/* Copyright 2004, 2006, 2007, 2012, 2013 by */ /* Masatake YAMATO and Redhat K.K. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -94,7 +94,7 @@ /* this array is a function in PIC mode, so no ; is needed in END */ #define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type ) \ void \ - FT_Init_ ## name( type* storage ) \ + FT_Init_Table_ ## name( type* storage ) \ { \ type* local = storage; \ \ @@ -224,6 +224,13 @@ /* tag :: */ /* The resource tag. */ /* */ + /* sort_by_res_id :: */ + /* A Boolean to sort the fragmented resource by their ids. */ + /* The fragmented resources for `POST' resource should be sorted */ + /* to restore Type1 font properly. For `snft' resources, sorting */ + /* may induce a different order of the faces in comparison to that */ + /* by QuickDraw API. */ + /* */ /* <Output> */ /* offsets :: */ /* The stream offsets for the resource data specified by `tag'. */ @@ -246,6 +253,7 @@ FT_Long map_offset, FT_Long rdata_pos, FT_Long tag, + FT_Bool sort_by_res_id, FT_Long **offsets, FT_Long *count ); Index: lib/3rdparty/freetype/include/internal/fttrace.h =================================================================== --- lib/3rdparty/freetype/include/internal/fttrace.h (revision 62563) +++ lib/3rdparty/freetype/include/internal/fttrace.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Tracing handling (specification only). */ /* */ -/* Copyright 2002, 2004-2007, 2009, 2011-2013 by */ +/* Copyright 2002, 2004-2007, 2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -148,5 +148,7 @@ FT_TRACE_DEF( aflatin ) FT_TRACE_DEF( aflatin2 ) FT_TRACE_DEF( afwarp ) +FT_TRACE_DEF( afharfbuzz ) +FT_TRACE_DEF( afglobal ) /* END */ Index: lib/3rdparty/freetype/README =================================================================== --- lib/3rdparty/freetype/README (revision 62563) +++ lib/3rdparty/freetype/README (working copy) @@ -1,4 +1,4 @@ - FreeType 2.5.2 + FreeType 2.5.3 ============== Homepage: http://www.freetype.org @@ -16,7 +16,7 @@ the file `docs/LICENSE.TXT' for the available licenses. The FreeType 2 API reference is located in `docs/reference'; use the - file `ft2-doc.html' as the top entry point. Additional + file `ft2-toc.html' as the top entry point. Additional documentation is available as a separate package from our sites. Go to @@ -24,9 +24,9 @@ and download one of the following files. - freetype-doc-2.5.2.tar.bz2 - freetype-doc-2.5.2.tar.gz - ftdoc252.zip + freetype-doc-2.5.3.tar.bz2 + freetype-doc-2.5.3.tar.gz + ftdoc253.zip To view the documentation online, go to @@ -70,7 +70,7 @@ ---------------------------------------------------------------------- -Copyright 2006-2013 by +Copyright 2006-2014 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, Index: lib/3rdparty/freetype/src/autofit/afblue.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afblue.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afblue.c (working copy) @@ -108,7 +108,7 @@ }; - /* stringsets are specific to scripts */ + /* stringsets are specific to styles */ FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec ) af_blue_stringsets[] = { Index: lib/3rdparty/freetype/src/autofit/afblue.cin =================================================================== --- lib/3rdparty/freetype/src/autofit/afblue.cin (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afblue.cin (working copy) @@ -27,7 +27,7 @@ }; - /* stringsets are specific to scripts */ + /* stringsets are specific to styles */ FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec ) af_blue_stringsets[] = { Index: lib/3rdparty/freetype/src/autofit/afblue.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afblue.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afblue.h (working copy) @@ -103,13 +103,13 @@ AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77, AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153, AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229, - af_blue_1_2_1 = af_blue_1_1_1 + 304, + af_blue_1_1_2 = af_blue_1_1_1 + 304, #else - af_blue_1_2_1 = af_blue_1_1_1 + 0, + af_blue_1_1_2 = af_blue_1_1_1 + 0, #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - af_blue_1_2 = af_blue_1_2_1 + 0, + af_blue_1_2 = af_blue_1_1_2 + 0, #else - af_blue_1_2 = af_blue_1_2_1 + 0, + af_blue_1_2 = af_blue_1_1 + 0, #endif /* AF_CONFIG_OPTION_CJK */ @@ -130,7 +130,7 @@ /*************************************************************************/ /*************************************************************************/ - /* The next level is to group blue strings into script-specific sets. */ + /* The next level is to group blue strings into style-specific sets. */ /* Properties are specific to a writing system. We assume that a given */ @@ -162,13 +162,13 @@ AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, af_blue_2_1_1 = af_blue_2_1 + 4, #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - af_blue_2_2_1 = af_blue_2_1_1 + 4, + af_blue_2_1_2 = af_blue_2_1_1 + 4, #else - af_blue_2_2_1 = af_blue_2_1_1 + 0, + af_blue_2_1_2 = af_blue_2_1_1 + 0, #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - af_blue_2_2 = af_blue_2_2_1 + 1, + af_blue_2_2 = af_blue_2_1_2 + 1, #else - af_blue_2_2 = af_blue_2_2_1 + 0, + af_blue_2_2 = af_blue_2_1 + 0, #endif /* AF_CONFIG_OPTION_CJK */ Index: lib/3rdparty/freetype/src/autofit/afblue.hin =================================================================== --- lib/3rdparty/freetype/src/autofit/afblue.hin (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afblue.hin (working copy) @@ -90,7 +90,7 @@ /*************************************************************************/ /*************************************************************************/ - /* The next level is to group blue strings into script-specific sets. */ + /* The next level is to group blue strings into style-specific sets. */ /* Properties are specific to a writing system. We assume that a given */ Index: lib/3rdparty/freetype/src/autofit/afcjk.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afcjk.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afcjk.c (working copy) @@ -2,7 +2,7 @@ /* */ /* afcjk.c */ /* */ -/* Auto-fitter hinting routines for CJK script (body). */ +/* Auto-fitter hinting routines for CJK writing system (body). */ /* */ /* Copyright 2006-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -27,6 +27,7 @@ #include FT_INTERNAL_DEBUG_H #include "afglobal.h" +#include "afpic.h" #include "aflatin.h" @@ -74,10 +75,10 @@ FT_TRACE5(( "\n" - "cjk standard widths computation (script `%s')\n" - "===============================================\n" + "cjk standard widths computation (style `%s')\n" + "===================================================\n" "\n", - af_script_names[metrics->root.script_class->script] )); + af_style_names[metrics->root.style_class->style] )); af_glyph_hints_init( hints, face->memory ); @@ -86,20 +87,59 @@ { FT_Error error; - FT_UInt glyph_index; + FT_ULong glyph_index; + FT_Long y_offset; int dim; AF_CJKMetricsRec dummy[1]; AF_Scaler scaler = &dummy->root.scaler; +#ifdef FT_CONFIG_OPTION_PIC + AF_FaceGlobals globals = metrics->root.globals; +#endif - glyph_index = FT_Get_Char_Index( - face, - metrics->root.script_class->standard_char ); - if ( glyph_index == 0 ) - goto Exit; + AF_StyleClass style_class = metrics->root.style_class; + AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET + [style_class->script]; + FT_UInt32 standard_char; + + + standard_char = script_class->standard_char1; + af_get_char_index( &metrics->root, + standard_char, + &glyph_index, + &y_offset ); + if ( !glyph_index ) + { + if ( script_class->standard_char2 ) + { + standard_char = script_class->standard_char2; + af_get_char_index( &metrics->root, + standard_char, + &glyph_index, + &y_offset ); + if ( !glyph_index ) + { + if ( script_class->standard_char3 ) + { + standard_char = script_class->standard_char3; + af_get_char_index( &metrics->root, + standard_char, + &glyph_index, + &y_offset ); + if ( !glyph_index ) + goto Exit; + } + else + goto Exit; + } + } + else + goto Exit; + } + FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", - metrics->root.script_class->standard_char, glyph_index )); + standard_char, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); if ( error || face->glyph->outline.n_points <= 0 ) @@ -118,7 +158,7 @@ scaler->render_mode = FT_RENDER_MODE_NORMAL; scaler->flags = 0; - af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy ); + af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy ); error = af_glyph_hints_reload( hints, &face->glyph->outline ); if ( error ) @@ -226,7 +266,9 @@ AF_CJKAxis axis; FT_Outline outline; - AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset; + AF_StyleClass sc = metrics->root.style_class; + + AF_Blue_Stringset bss = sc->blue_stringset; const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; #ifdef FT_DEBUG_LEVEL_TRACE @@ -246,9 +288,9 @@ #endif - /* we walk over the blue character strings as specified in the */ - /* script's entry in the `af_blue_stringset' array, computing its */ - /* extremum points (depending on the string properties) */ + /* we walk over the blue character strings as specified in the */ + /* style's entry in the `af_blue_stringset' array, computing its */ + /* extremum points (depending on the string properties) */ FT_TRACE5(( "cjk blue zones computation\n" "==========================\n" @@ -279,7 +321,8 @@ while ( *p ) { FT_ULong ch; - FT_UInt glyph_index; + FT_ULong glyph_index; + FT_Long y_offset; FT_Pos best_pos; /* same as points.y or points.x, resp. */ FT_Int best_point; FT_Vector* points; @@ -288,7 +331,7 @@ GET_UTF8_CHAR( ch, p ); /* load the character in the face -- skip unknown or empty ones */ - glyph_index = FT_Get_Char_Index( face, ch ); + af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset ); if ( glyph_index == 0 ) { FT_TRACE5(( " U+%04lX unavailable\n", ch )); @@ -467,10 +510,11 @@ /* digit `0' is 0x30 in all supported charmaps */ for ( i = 0x30; i <= 0x39; i++ ) { - FT_UInt glyph_index; + FT_ULong glyph_index; + FT_Long y_offset; - glyph_index = FT_Get_Char_Index( face, i ); + af_get_char_index( &metrics->root, i, &glyph_index, &y_offset ); if ( glyph_index == 0 ) continue; @@ -1234,7 +1278,7 @@ FT_UInt32 scaler_flags, other_flags; - af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics ); + af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics ); /* * correct x_scale and y_scale when needed, since they may have @@ -1665,9 +1709,9 @@ #endif - FT_TRACE5(( "cjk %s edge hinting (script `%s')\n", + FT_TRACE5(( "cjk %s edge hinting (style `%s')\n", dim == AF_DIMENSION_VERT ? "horizontal" : "vertical", - af_script_names[hints->metrics->script_class->script] )); + af_style_names[hints->metrics->style_class->style] )); /* we begin by aligning all stems relative to the blue zone */ @@ -2210,60 +2254,18 @@ sizeof ( AF_CJKMetricsRec ), - (AF_Script_InitMetricsFunc) af_cjk_metrics_init, - (AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init, + (AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) af_cjk_hints_init, - (AF_Script_ApplyHintsFunc) af_cjk_hints_apply + (AF_WritingSystem_InitHintsFunc) af_cjk_hints_init, + (AF_WritingSystem_ApplyHintsFunc) af_cjk_hints_apply ) - /* this corresponds to Unicode 6.0 */ +#else /* !AF_CONFIG_OPTION_CJK */ - /* XXX: this should probably fine tuned to differentiate better between */ - /* scripts... */ - static const AF_Script_UniRangeRec af_hani_uniranges[] = - { - AF_UNIRANGE_REC( 0x1100UL, 0x11FFUL ), /* Hangul Jamo */ - AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */ - AF_UNIRANGE_REC( 0x2F00UL, 0x2FDFUL ), /* Kangxi Radicals */ - AF_UNIRANGE_REC( 0x2FF0UL, 0x2FFFUL ), /* Ideographic Description Characters */ - AF_UNIRANGE_REC( 0x3000UL, 0x303FUL ), /* CJK Symbols and Punctuation */ - AF_UNIRANGE_REC( 0x3040UL, 0x309FUL ), /* Hiragana */ - AF_UNIRANGE_REC( 0x30A0UL, 0x30FFUL ), /* Katakana */ - AF_UNIRANGE_REC( 0x3100UL, 0x312FUL ), /* Bopomofo */ - AF_UNIRANGE_REC( 0x3130UL, 0x318FUL ), /* Hangul Compatibility Jamo */ - AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ), /* Kanbun */ - AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */ - AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */ - AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */ - AF_UNIRANGE_REC( 0x3200UL, 0x32FFUL ), /* Enclosed CJK Letters and Months */ - AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */ - AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */ - AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */ - AF_UNIRANGE_REC( 0x4E00UL, 0x9FFFUL ), /* CJK Unified Ideographs */ - AF_UNIRANGE_REC( 0xA960UL, 0xA97FUL ), /* Hangul Jamo Extended-A */ - AF_UNIRANGE_REC( 0xAC00UL, 0xD7AFUL ), /* Hangul Syllables */ - AF_UNIRANGE_REC( 0xD7B0UL, 0xD7FFUL ), /* Hangul Jamo Extended-B */ - AF_UNIRANGE_REC( 0xF900UL, 0xFAFFUL ), /* CJK Compatibility Ideographs */ - AF_UNIRANGE_REC( 0xFE10UL, 0xFE1FUL ), /* Vertical forms */ - AF_UNIRANGE_REC( 0xFE30UL, 0xFE4FUL ), /* CJK Compatibility Forms */ - AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */ - AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ), /* Kana Supplement */ - AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ), /* Tai Xuan Hing Symbols */ - AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ), /* Enclosed Ideographic Supplement */ - AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */ - AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ), /* CJK Unified Ideographs Extension C */ - AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ), /* CJK Unified Ideographs Extension D */ - AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ), /* CJK Compatibility Ideographs Supplement */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - -#else /* !AF_CONFIG_OPTION_CJK */ - AF_DEFINE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class, @@ -2271,33 +2273,16 @@ sizeof ( AF_CJKMetricsRec ), - (AF_Script_InitMetricsFunc) NULL, - (AF_Script_ScaleMetricsFunc)NULL, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) NULL, + (AF_WritingSystem_ScaleMetricsFunc)NULL, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) NULL, - (AF_Script_ApplyHintsFunc) NULL + (AF_WritingSystem_InitHintsFunc) NULL, + (AF_WritingSystem_ApplyHintsFunc) NULL ) - static const AF_Script_UniRangeRec af_hani_uniranges[] = - { - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - #endif /* !AF_CONFIG_OPTION_CJK */ - AF_DEFINE_SCRIPT_CLASS( - af_hani_script_class, - - AF_SCRIPT_HANI, - AF_BLUE_STRINGSET_HANI, - AF_WRITING_SYSTEM_CJK, - - af_hani_uniranges, - 0x7530 /* 田 */ - ) - - /* END */ Index: lib/3rdparty/freetype/src/autofit/afcjk.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afcjk.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afcjk.h (working copy) @@ -2,7 +2,7 @@ /* */ /* afcjk.h */ /* */ -/* Auto-fitter hinting routines for CJK script (specification). */ +/* Auto-fitter hinting routines for CJK writing system (specification). */ /* */ /* Copyright 2006, 2007, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -31,11 +31,6 @@ AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class ) - /* the CJK-specific script classes */ - - AF_DECLARE_SCRIPT_CLASS( af_hani_script_class ) - - /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -105,9 +100,9 @@ typedef struct AF_CJKMetricsRec_ { - AF_ScriptMetricsRec root; - FT_UInt units_per_em; - AF_CJKAxisRec axis[AF_DIMENSION_MAX]; + AF_StyleMetricsRec root; + FT_UInt units_per_em; + AF_CJKAxisRec axis[AF_DIMENSION_MAX]; } AF_CJKMetricsRec, *AF_CJKMetrics; Index: lib/3rdparty/freetype/src/autofit/afcover.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afcover.h (revision 0) +++ lib/3rdparty/freetype/src/autofit/afcover.h (working copy) @@ -0,0 +1,105 @@ +/***************************************************************************/ +/* */ +/* afcover.h */ +/* */ +/* Auto-fitter coverages (specification only). */ +/* */ +/* Copyright 2013, 2014 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /* This header file can be included multiple times. */ + /* Define `COVERAGE' as needed. */ + + + /* Add new coverages here. The first and second arguments are the */ + /* coverage name in lowercase and uppercase, respectively, followed */ + /* by a description string. The last four arguments are the four */ + /* characters defining the corresponding OpenType feature. */ + +#if 0 + /* XXX: It's not possible to define blue zone characters in advance. */ + COVERAGE( alternative_fractions, ALTERNATIVE_FRACTIONS, + "alternative fractions", + 'a', 'f', 'r', 'c' ) +#endif + + COVERAGE( petite_capitals_from_capitals, PETITE_CAPITALS_FROM_CAPITALS, + "petite capitals from capitals", + 'c', '2', 'c', 'p' ) + + COVERAGE( small_capitals_from_capitals, SMALL_CAPITALS_FROM_CAPITALS, + "small capitals from capitals", + 'c', '2', 's', 'c' ) + +#if 0 + /* XXX: Only digits are in this coverage, however, both normal style */ + /* and oldstyle representation forms are possible. */ + COVERAGE( denominators, DENOMINATORS, + "denominators", + 'd', 'n', 'o', 'm' ) +#endif + +#if 0 + /* XXX: It's not possible to define blue zone characters in advance. */ + COVERAGE( fractions, FRACTIONS, + "fractions", + 'f', 'r', 'a', 'c' ) +#endif + +#if 0 + /* XXX: Only digits are in this coverage, however, both normal style */ + /* and oldstyle representation forms are possible. */ + COVERAGE( numerators, NUMERATORS, + "numerators", + 'n', 'u', 'm', 'r' ) +#endif + + COVERAGE( ordinals, ORDINALS, + "ordinals", + 'o', 'r', 'd', 'n' ) + + COVERAGE( petite_capitals, PETITE_CAPITALS, + "petite capitals", + 'p', 'c', 'a', 'p' ) + + COVERAGE( ruby, RUBY, + "ruby", + 'r', 'u', 'b', 'y' ) + + COVERAGE( scientific_inferiors, SCIENTIFIC_INFERIORS, + "scientific inferiors", + 's', 'i', 'n', 'f' ) + + COVERAGE( small_capitals, SMALL_CAPITALS, + "small capitals", + 's', 'm', 'c', 'p' ) + + COVERAGE( subscript, SUBSCRIPT, + "subscript", + 's', 'u', 'b', 's' ) + + COVERAGE( superscript, SUPERSCRIPT, + "superscript", + 's', 'u', 'p', 's' ) + + COVERAGE( titling, TITLING, + "titling", + 't', 'i', 't', 'l' ) + +#if 0 + /* to be always excluded */ + COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */ + COVERAGE(ornm, 'o', 'r', 'n', 'm'); /* Ornaments (?) */ +#endif + + +/* END */ Index: lib/3rdparty/freetype/src/autofit/afdummy.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afdummy.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afdummy.c (working copy) @@ -23,8 +23,8 @@ static FT_Error - af_dummy_hints_init( AF_GlyphHints hints, - AF_ScriptMetrics metrics ) + af_dummy_hints_init( AF_GlyphHints hints, + AF_StyleMetrics metrics ) { af_glyph_hints_rescale( hints, metrics ); @@ -57,27 +57,15 @@ AF_WRITING_SYSTEM_DUMMY, - sizeof ( AF_ScriptMetricsRec ), + sizeof ( AF_StyleMetricsRec ), - (AF_Script_InitMetricsFunc) NULL, - (AF_Script_ScaleMetricsFunc)NULL, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) NULL, + (AF_WritingSystem_ScaleMetricsFunc)NULL, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) af_dummy_hints_init, - (AF_Script_ApplyHintsFunc) af_dummy_hints_apply + (AF_WritingSystem_InitHintsFunc) af_dummy_hints_init, + (AF_WritingSystem_ApplyHintsFunc) af_dummy_hints_apply ) - AF_DEFINE_SCRIPT_CLASS( - af_dflt_script_class, - - AF_SCRIPT_DFLT, - (AF_Blue_Stringset)0, - AF_WRITING_SYSTEM_DUMMY, - - NULL, - '\0' - ) - - /* END */ Index: lib/3rdparty/freetype/src/autofit/afdummy.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afdummy.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afdummy.h (working copy) @@ -25,14 +25,10 @@ FT_BEGIN_HEADER - /* A dummy writing system and script class used when no hinting should be - * performed. - */ + /* A dummy writing system used when no hinting should be performed. */ AF_DECLARE_WRITING_SYSTEM_CLASS( af_dummy_writing_system_class ) - AF_DECLARE_SCRIPT_CLASS( af_dflt_script_class ) - /* */ FT_END_HEADER Index: lib/3rdparty/freetype/src/autofit/afglobal.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afglobal.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afglobal.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter routines to compute global hinting values (body). */ /* */ -/* Copyright 2003-2013 by */ +/* Copyright 2003-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,7 +17,21 @@ #include "afglobal.h" +#include "afranges.h" +#include "hbshim.h" +#include FT_INTERNAL_DEBUG_H + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_afglobal + + /* get writing system specific header files */ #undef WRITING_SYSTEM #define WRITING_SYSTEM( ws, WS ) /* empty */ @@ -27,6 +41,30 @@ #include "afpic.h" +#undef SCRIPT +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ + AF_DEFINE_SCRIPT_CLASS( \ + af_ ## s ## _script_class, \ + AF_SCRIPT_ ## S, \ + af_ ## s ## _uniranges, \ + sc1, sc2, sc3 ) + +#include "afscript.h" + + +#undef STYLE +#define STYLE( s, S, d, ws, sc, ss, c ) \ + AF_DEFINE_STYLE_CLASS( \ + af_ ## s ## _style_class, \ + AF_STYLE_ ## S, \ + ws, \ + sc, \ + ss, \ + c ) + +#include "afstyles.h" + + #ifndef FT_CONFIG_OPTION_PIC #undef WRITING_SYSTEM @@ -44,7 +82,7 @@ #undef SCRIPT -#define SCRIPT( s, S, d ) \ +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ &af_ ## s ## _script_class, FT_LOCAL_ARRAY_DEF( AF_ScriptClass ) @@ -56,19 +94,33 @@ NULL /* do not remove */ }; + +#undef STYLE +#define STYLE( s, S, d, ws, sc, ss, c ) \ + &af_ ## s ## _style_class, + + FT_LOCAL_ARRAY_DEF( AF_StyleClass ) + af_style_classes[] = + { + +#include "afstyles.h" + + NULL /* do not remove */ + }; + #endif /* !FT_CONFIG_OPTION_PIC */ #ifdef FT_DEBUG_LEVEL_TRACE -#undef SCRIPT -#define SCRIPT( s, S, d ) #s, +#undef STYLE +#define STYLE( s, S, d, ws, sc, ss, c ) #s, FT_LOCAL_ARRAY_DEF( char* ) - af_script_names[] = + af_style_names[] = { -#include "afscript.h" +#include "afstyles.h" }; @@ -75,39 +127,43 @@ #endif /* FT_DEBUG_LEVEL_TRACE */ - /* Compute the script index of each glyph within a given face. */ + /* Compute the style index of each glyph within a given face. */ static FT_Error - af_face_globals_compute_script_coverage( AF_FaceGlobals globals ) + af_face_globals_compute_style_coverage( AF_FaceGlobals globals ) { FT_Error error; FT_Face face = globals->face; FT_CharMap old_charmap = face->charmap; - FT_Byte* gscripts = globals->glyph_scripts; + FT_Byte* gstyles = globals->glyph_styles; FT_UInt ss; FT_UInt i; + FT_UInt dflt = -1; - /* the value AF_SCRIPT_NONE means `uncovered glyph' */ - FT_MEM_SET( globals->glyph_scripts, - AF_SCRIPT_NONE, + /* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */ + FT_MEM_SET( globals->glyph_styles, + AF_STYLE_UNASSIGNED, globals->glyph_count ); error = FT_Select_Charmap( face, FT_ENCODING_UNICODE ); if ( error ) { - /* - * Ignore this error; we simply use the fallback script. - * XXX: Shouldn't we rather disable hinting? - */ + /* + * Ignore this error; we simply use the fallback style. + * XXX: Shouldn't we rather disable hinting? + */ error = FT_Err_Ok; goto Exit; } - /* scan each script in a Unicode charmap */ - for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ ) + /* scan each style in a Unicode charmap */ + for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ ) { - AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET[ss]; + AF_StyleClass style_class = + AF_STYLE_CLASSES_GET[ss]; + AF_ScriptClass script_class = + AF_SCRIPT_CLASSES_GET[style_class->script]; AF_Script_UniRange range; @@ -116,37 +172,61 @@ /* * Scan all Unicode points in the range and set the corresponding - * glyph script index. + * glyph style index. */ - for ( range = script_class->script_uni_ranges; - range->first != 0; - range++ ) + if ( style_class->coverage == AF_COVERAGE_DEFAULT ) { - FT_ULong charcode = range->first; - FT_UInt gindex; + if ( style_class->script == globals->module->default_script ) + dflt = ss; + for ( range = script_class->script_uni_ranges; + range->first != 0; + range++ ) + { + FT_ULong charcode = range->first; + FT_UInt gindex; - gindex = FT_Get_Char_Index( face, charcode ); - if ( gindex != 0 && - gindex < (FT_ULong)globals->glyph_count && - gscripts[gindex] == AF_SCRIPT_NONE ) - gscripts[gindex] = (FT_Byte)ss; + gindex = FT_Get_Char_Index( face, charcode ); - for (;;) - { - charcode = FT_Get_Next_Char( face, charcode, &gindex ); + if ( gindex != 0 && + gindex < (FT_ULong)globals->glyph_count && + gstyles[gindex] == AF_STYLE_UNASSIGNED ) + gstyles[gindex] = (FT_Byte)ss; - if ( gindex == 0 || charcode > range->last ) - break; + for (;;) + { + charcode = FT_Get_Next_Char( face, charcode, &gindex ); - if ( gindex < (FT_ULong)globals->glyph_count && - gscripts[gindex] == AF_SCRIPT_NONE ) - gscripts[gindex] = (FT_Byte)ss; + if ( gindex == 0 || charcode > range->last ) + break; + + if ( gindex < (FT_ULong)globals->glyph_count && + gstyles[gindex] == AF_STYLE_UNASSIGNED ) + gstyles[gindex] = (FT_Byte)ss; + } } } + else + { + /* get glyphs not directly addressable by cmap */ + af_get_coverage( globals, style_class, gstyles ); + } } + /* handle the default OpenType features of the default script ... */ + af_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles ); + + /* ... and the remaining default OpenType features */ + for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ ) + { + AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss]; + + + if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT ) + af_get_coverage( globals, style_class, gstyles ); + } + /* mark ASCII digits */ for ( i = 0x30; i <= 0x39; i++ ) { @@ -154,15 +234,15 @@ if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count ) - gscripts[gindex] |= AF_DIGIT; + gstyles[gindex] |= AF_DIGIT; } Exit: /* - * By default, all uncovered glyphs are set to the fallback script. + * By default, all uncovered glyphs are set to the fallback style. * XXX: Shouldn't we disable hinting or do something similar? */ - if ( globals->module->fallback_script != AF_SCRIPT_NONE ) + if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED ) { FT_Long nn; @@ -169,14 +249,53 @@ for ( nn = 0; nn < globals->glyph_count; nn++ ) { - if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_NONE ) + if ( ( gstyles[nn] & ~AF_DIGIT ) == AF_STYLE_UNASSIGNED ) { - gscripts[nn] &= ~AF_SCRIPT_NONE; - gscripts[nn] |= globals->module->fallback_script; + gstyles[nn] &= ~AF_STYLE_UNASSIGNED; + gstyles[nn] |= globals->module->fallback_style; } } } +#ifdef FT_DEBUG_LEVEL_TRACE + + FT_TRACE4(( "\n" + "style coverage\n" + "==============\n" + "\n" )); + + for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ ) + { + AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss]; + FT_UInt count = 0; + FT_Long idx; + + + FT_TRACE4(( "%s:\n", af_style_names[style_class->style] )); + + for ( idx = 0; idx < globals->glyph_count; idx++ ) + { + if ( ( gstyles[idx] & ~AF_DIGIT ) == style_class->style ) + { + if ( !( count % 10 ) ) + FT_TRACE4(( " " )); + + FT_TRACE4(( " %d", idx )); + count++; + + if ( !( count % 10 ) ) + FT_TRACE4(( "\n" )); + } + } + + if ( !count ) + FT_TRACE4(( " (none)\n" )); + if ( count % 10 ) + FT_TRACE4(( "\n" )); + } + +#endif /* FT_DEBUG_LEVEL_TRACE */ + FT_Set_Charmap( face, old_charmap ); return error; } @@ -198,12 +317,16 @@ face->num_glyphs * sizeof ( FT_Byte ) ) ) goto Exit; - globals->face = face; - globals->glyph_count = face->num_glyphs; - globals->glyph_scripts = (FT_Byte*)( globals + 1 ); - globals->module = module; + globals->face = face; + globals->glyph_count = face->num_glyphs; + globals->glyph_styles = (FT_Byte*)( globals + 1 ); + globals->module = module; - error = af_face_globals_compute_script_coverage( globals ); +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + globals->hb_font = hb_ft_font_create( face, NULL ); +#endif + + error = af_face_globals_compute_style_coverage( globals ); if ( error ) { af_face_globals_free( globals ); @@ -227,27 +350,32 @@ FT_UInt nn; - for ( nn = 0; nn < AF_SCRIPT_MAX; nn++ ) + for ( nn = 0; nn < AF_STYLE_MAX; nn++ ) { if ( globals->metrics[nn] ) { - AF_ScriptClass script_class = - AF_SCRIPT_CLASSES_GET[nn]; + AF_StyleClass style_class = + AF_STYLE_CLASSES_GET[nn]; AF_WritingSystemClass writing_system_class = - AF_WRITING_SYSTEM_CLASSES_GET[script_class->writing_system]; + AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system]; - if ( writing_system_class->script_metrics_done ) - writing_system_class->script_metrics_done( globals->metrics[nn] ); + if ( writing_system_class->style_metrics_done ) + writing_system_class->style_metrics_done( globals->metrics[nn] ); FT_FREE( globals->metrics[nn] ); } } - globals->glyph_count = 0; - globals->glyph_scripts = NULL; /* no need to free this one! */ - globals->face = NULL; +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + hb_font_destroy( globals->hb_font ); + globals->hb_font = NULL; +#endif + globals->glyph_count = 0; + globals->glyph_styles = NULL; /* no need to free this one! */ + globals->face = NULL; + FT_FREE( globals ); } } @@ -254,16 +382,16 @@ FT_LOCAL_DEF( FT_Error ) - af_face_globals_get_metrics( AF_FaceGlobals globals, - FT_UInt gindex, - FT_UInt options, - AF_ScriptMetrics *ametrics ) + af_face_globals_get_metrics( AF_FaceGlobals globals, + FT_UInt gindex, + FT_UInt options, + AF_StyleMetrics *ametrics ) { - AF_ScriptMetrics metrics = NULL; + AF_StyleMetrics metrics = NULL; - AF_Script script = (AF_Script)( options & 15 ); + AF_Style style = (AF_Style)options; AF_WritingSystemClass writing_system_class; - AF_ScriptClass script_class; + AF_StyleClass style_class; FT_Error error = FT_Err_Ok; @@ -274,16 +402,17 @@ goto Exit; } - /* if we have a forced script (via `options'), use it, */ - /* otherwise look into `glyph_scripts' array */ - if ( script == AF_SCRIPT_DFLT || script + 1 >= AF_SCRIPT_MAX ) - script = (AF_Script)( globals->glyph_scripts[gindex] & AF_SCRIPT_NONE ); + /* if we have a forced style (via `options'), use it, */ + /* otherwise look into `glyph_styles' array */ + if ( style == AF_STYLE_NONE_DFLT || style + 1 >= AF_STYLE_MAX ) + style = (AF_Style)( globals->glyph_styles[gindex] & + AF_STYLE_UNASSIGNED ); - script_class = AF_SCRIPT_CLASSES_GET[script]; + style_class = AF_STYLE_CLASSES_GET[style]; writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET - [script_class->writing_system]; + [style_class->writing_system]; - metrics = globals->metrics[script]; + metrics = globals->metrics[style]; if ( metrics == NULL ) { /* create the global metrics object if necessary */ @@ -290,20 +419,20 @@ FT_Memory memory = globals->face->memory; - if ( FT_ALLOC( metrics, writing_system_class->script_metrics_size ) ) + if ( FT_ALLOC( metrics, writing_system_class->style_metrics_size ) ) goto Exit; - metrics->script_class = script_class; - metrics->globals = globals; + metrics->style_class = style_class; + metrics->globals = globals; - if ( writing_system_class->script_metrics_init ) + if ( writing_system_class->style_metrics_init ) { - error = writing_system_class->script_metrics_init( metrics, - globals->face ); + error = writing_system_class->style_metrics_init( metrics, + globals->face ); if ( error ) { - if ( writing_system_class->script_metrics_done ) - writing_system_class->script_metrics_done( metrics ); + if ( writing_system_class->style_metrics_done ) + writing_system_class->style_metrics_done( metrics ); FT_FREE( metrics ); goto Exit; @@ -310,7 +439,7 @@ } } - globals->metrics[script] = metrics; + globals->metrics[style] = metrics; } Exit: @@ -325,7 +454,7 @@ FT_UInt gindex ) { if ( gindex < (FT_ULong)globals->glyph_count ) - return (FT_Bool)( globals->glyph_scripts[gindex] & AF_DIGIT ); + return (FT_Bool)( globals->glyph_styles[gindex] & AF_DIGIT ); return (FT_Bool)0; } Index: lib/3rdparty/freetype/src/autofit/afglobal.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afglobal.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afglobal.h (working copy) @@ -5,7 +5,7 @@ /* Auto-fitter routines to compute global hinting values */ /* (specification). */ /* */ -/* Copyright 2003-2005, 2007, 2009, 2011-2013 by */ +/* Copyright 2003-2005, 2007, 2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -23,6 +23,7 @@ #include "aftypes.h" #include "afmodule.h" +#include "hbshim.h" FT_BEGIN_HEADER @@ -31,29 +32,50 @@ FT_LOCAL_ARRAY( AF_WritingSystemClass ) af_writing_system_classes[]; + +#undef SCRIPT +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ + AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class ) + +#include "afscript.h" + FT_LOCAL_ARRAY( AF_ScriptClass ) af_script_classes[]; + +#undef STYLE +#define STYLE( s, S, d, ws, sc, ss, c ) \ + AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class ) + +#include "afstyles.h" + + FT_LOCAL_ARRAY( AF_StyleClass ) + af_style_classes[]; + + #ifdef FT_DEBUG_LEVEL_TRACE FT_LOCAL_ARRAY( char* ) - af_script_names[]; + af_style_names[]; #endif + /* * Default values and flags for both autofitter globals (found in * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec). */ - /* index of fallback script in `af_script_classes' */ + /* index of fallback style in `af_style_classes' */ #ifdef AF_CONFIG_OPTION_CJK -#define AF_SCRIPT_FALLBACK AF_SCRIPT_HANI +#define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT #else -#define AF_SCRIPT_FALLBACK AF_SCRIPT_DFLT +#define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT #endif + /* default script for OpenType; ignored if HarfBuzz isn't used */ +#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN /* a bit mask indicating an uncovered glyph */ -#define AF_SCRIPT_NONE 0x7F +#define AF_STYLE_UNASSIGNED 0x7F /* if this flag is set, we have an ASCII digit */ -#define AF_DIGIT 0x80 +#define AF_DIGIT 0x80 /* `increase-x-height' property */ #define AF_PROP_INCREASE_X_HEIGHT_MIN 6 @@ -70,22 +92,26 @@ /* - * Note that glyph_scripts[] maps each glyph to an index into the - * `af_script_classes' array. + * Note that glyph_styles[] maps each glyph to an index into the + * `af_style_classes' array. * */ typedef struct AF_FaceGlobalsRec_ { - FT_Face face; - FT_Long glyph_count; /* same as face->num_glyphs */ - FT_Byte* glyph_scripts; + FT_Face face; + FT_Long glyph_count; /* same as face->num_glyphs */ + FT_Byte* glyph_styles; +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + hb_font_t* hb_font; +#endif + /* per-face auto-hinter properties */ - FT_UInt increase_x_height; + FT_UInt increase_x_height; - AF_ScriptMetrics metrics[AF_SCRIPT_MAX]; + AF_StyleMetrics metrics[AF_STYLE_MAX]; - AF_Module module; /* to access global properties */ + AF_Module module; /* to access global properties */ } AF_FaceGlobalsRec; @@ -92,7 +118,7 @@ /* * model the global hints data for a given face, decomposed into - * script-specific items + * style-specific items */ FT_LOCAL( FT_Error ) @@ -101,10 +127,10 @@ AF_Module module ); FT_LOCAL( FT_Error ) - af_face_globals_get_metrics( AF_FaceGlobals globals, - FT_UInt gindex, - FT_UInt options, - AF_ScriptMetrics *ametrics ); + af_face_globals_get_metrics( AF_FaceGlobals globals, + FT_UInt gindex, + FT_UInt options, + AF_StyleMetrics *ametrics ); FT_LOCAL( void ) af_face_globals_free( AF_FaceGlobals globals ); Index: lib/3rdparty/freetype/src/autofit/afhints.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afhints.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afhints.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003-2007, 2009-2013 by */ +/* Copyright 2003-2007, 2009-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -345,7 +345,9 @@ af_glyph_hints_get_segment_offset( AF_GlyphHints hints, FT_Int dimension, FT_Int idx, - FT_Pos* offset ) + FT_Pos *offset, + FT_Bool *is_blue, + FT_Pos *blue_offset ) { AF_Dimension dim; AF_AxisHints axis; @@ -362,10 +364,19 @@ if ( idx < 0 || idx >= axis->num_segments ) return FT_THROW( Invalid_Argument ); - seg = &axis->segments[idx]; - *offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox - : seg->first->oy; + seg = &axis->segments[idx]; + *offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox + : seg->first->oy; + if ( seg->edge ) + *is_blue = (FT_Bool)( seg->edge->blue_edge != 0 ); + else + *is_blue = FALSE; + if ( *is_blue ) + *blue_offset = seg->edge->blue_edge->cur; + else + *blue_offset = 0; + return FT_Err_Ok; } #ifdef __cplusplus @@ -533,8 +544,8 @@ /* Reset metrics. */ FT_LOCAL_DEF( void ) - af_glyph_hints_rescale( AF_GlyphHints hints, - AF_ScriptMetrics metrics ) + af_glyph_hints_rescale( AF_GlyphHints hints, + AF_StyleMetrics metrics ) { hints->metrics = metrics; hints->scaler_flags = metrics->scaler.flags; @@ -810,7 +821,6 @@ in_x = out_x; in_y = out_y; - prev = point; } } } @@ -1224,8 +1234,6 @@ } } - point = points; - for ( ; contour < contour_limit; contour++ ) { AF_Point first_touched, last_touched; @@ -1248,7 +1256,6 @@ } first_touched = point; - last_touched = point; for (;;) { Index: lib/3rdparty/freetype/src/autofit/afhints.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afhints.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afhints.h (working copy) @@ -27,7 +27,7 @@ /* * The definition of outline glyph hints. These are shared by all - * script analysis routines (until now). + * writing system analysis routines (until now). */ typedef enum AF_Dimension_ @@ -343,31 +343,31 @@ typedef struct AF_GlyphHintsRec_ { - FT_Memory memory; + FT_Memory memory; - FT_Fixed x_scale; - FT_Pos x_delta; + FT_Fixed x_scale; + FT_Pos x_delta; - FT_Fixed y_scale; - FT_Pos y_delta; + FT_Fixed y_scale; + FT_Pos y_delta; - FT_Int max_points; /* number of allocated points */ - FT_Int num_points; /* number of used points */ - AF_Point points; /* points array */ + FT_Int max_points; /* number of allocated points */ + FT_Int num_points; /* number of used points */ + AF_Point points; /* points array */ - FT_Int max_contours; /* number of allocated contours */ - FT_Int num_contours; /* number of used contours */ - AF_Point* contours; /* contours array */ + FT_Int max_contours; /* number of allocated contours */ + FT_Int num_contours; /* number of used contours */ + AF_Point* contours; /* contours array */ - AF_AxisHintsRec axis[AF_DIMENSION_MAX]; + AF_AxisHintsRec axis[AF_DIMENSION_MAX]; - FT_UInt32 scaler_flags; /* copy of scaler flags */ - FT_UInt32 other_flags; /* free for script-specific */ - /* implementations */ - AF_ScriptMetrics metrics; + FT_UInt32 scaler_flags; /* copy of scaler flags */ + FT_UInt32 other_flags; /* free for style-specific */ + /* implementations */ + AF_StyleMetrics metrics; - FT_Pos xmin_delta; /* used for warping */ - FT_Pos xmax_delta; + FT_Pos xmin_delta; /* used for warping */ + FT_Pos xmax_delta; } AF_GlyphHintsRec; @@ -429,8 +429,8 @@ FT_Memory memory ); FT_LOCAL( void ) - af_glyph_hints_rescale( AF_GlyphHints hints, - AF_ScriptMetrics metrics ); + af_glyph_hints_rescale( AF_GlyphHints hints, + AF_StyleMetrics metrics ); FT_LOCAL( FT_Error ) af_glyph_hints_reload( AF_GlyphHints hints, Index: lib/3rdparty/freetype/src/autofit/afindic.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afindic.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afindic.c (working copy) @@ -2,7 +2,7 @@ /* */ /* afindic.c */ /* */ -/* Auto-fitter hinting routines for Indic scripts (body). */ +/* Auto-fitter hinting routines for Indic writing system (body). */ /* */ /* Copyright 2007, 2011-2013 by */ /* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */ @@ -104,32 +104,18 @@ sizeof ( AF_CJKMetricsRec ), - (AF_Script_InitMetricsFunc) af_indic_metrics_init, - (AF_Script_ScaleMetricsFunc)af_indic_metrics_scale, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init, + (AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) af_indic_hints_init, - (AF_Script_ApplyHintsFunc) af_indic_hints_apply + (AF_WritingSystem_InitHintsFunc) af_indic_hints_init, + (AF_WritingSystem_ApplyHintsFunc) af_indic_hints_apply ) - /* XXX: this should probably fine tuned to differentiate better between */ - /* scripts... */ - static const AF_Script_UniRangeRec af_deva_uniranges[] = - { - AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL ), /* Indic Range */ - AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */ - AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */ - AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */ - AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL ), /* Meetei Mayak */ - AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */ - AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL ), /* Sharada */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; +#else /* !AF_CONFIG_OPTION_INDIC */ -#else /* !AF_CONFIG_OPTION_INDIC */ - AF_DEFINE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class, @@ -137,33 +123,16 @@ sizeof ( AF_CJKMetricsRec ), - (AF_Script_InitMetricsFunc) NULL, - (AF_Script_ScaleMetricsFunc)NULL, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) NULL, + (AF_WritingSystem_ScaleMetricsFunc)NULL, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) NULL, - (AF_Script_ApplyHintsFunc) NULL + (AF_WritingSystem_InitHintsFunc) NULL, + (AF_WritingSystem_ApplyHintsFunc) NULL ) - static const AF_Script_UniRangeRec af_deva_uniranges[] = - { - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - #endif /* !AF_CONFIG_OPTION_INDIC */ - AF_DEFINE_SCRIPT_CLASS( - af_deva_script_class, - - AF_SCRIPT_DEVA, - (AF_Blue_Stringset)0, /* XXX */ - AF_WRITING_SYSTEM_INDIC, - - af_deva_uniranges, - 'o' /* XXX */ - ) - - /* END */ Index: lib/3rdparty/freetype/src/autofit/afindic.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afindic.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afindic.h (working copy) @@ -2,7 +2,8 @@ /* */ /* afindic.h */ /* */ -/* Auto-fitter hinting routines for Indic scripts (specification). */ +/* Auto-fitter hinting routines for Indic writing system */ +/* (specification). */ /* */ /* Copyright 2007, 2012, 2013 by */ /* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */ @@ -30,11 +31,6 @@ AF_DECLARE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class ) - /* the indic-specific script classes */ - - AF_DECLARE_SCRIPT_CLASS( af_deva_script_class ) - - /* */ FT_END_HEADER Index: lib/3rdparty/freetype/src/autofit/aflatin.c =================================================================== --- lib/3rdparty/freetype/src/autofit/aflatin.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/aflatin.c (working copy) @@ -2,9 +2,9 @@ /* */ /* aflatin.c */ /* */ -/* Auto-fitter hinting routines for latin script (body). */ +/* Auto-fitter hinting routines for latin writing system (body). */ /* */ -/* Copyright 2003-2013 by */ +/* Copyright 2003-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,6 +21,7 @@ #include FT_INTERNAL_DEBUG_H #include "afglobal.h" +#include "afpic.h" #include "aflatin.h" #include "aferrors.h" @@ -61,10 +62,10 @@ FT_TRACE5(( "\n" - "latin standard widths computation (script `%s')\n" - "=================================================\n" + "latin standard widths computation (style `%s')\n" + "=====================================================\n" "\n", - af_script_names[metrics->root.script_class->script] )); + af_style_names[metrics->root.style_class->style] )); af_glyph_hints_init( hints, face->memory ); @@ -73,20 +74,66 @@ { FT_Error error; - FT_UInt glyph_index; + FT_ULong glyph_index; + FT_Long y_offset; int dim; AF_LatinMetricsRec dummy[1]; AF_Scaler scaler = &dummy->root.scaler; +#ifdef FT_CONFIG_OPTION_PIC + AF_FaceGlobals globals = metrics->root.globals; +#endif - glyph_index = FT_Get_Char_Index( - face, - metrics->root.script_class->standard_char ); - if ( glyph_index == 0 ) - goto Exit; + AF_StyleClass style_class = metrics->root.style_class; + AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET + [style_class->script]; + FT_UInt32 standard_char; + + + /* + * We check more than a single standard character to catch features + * like `c2sc' (small caps from caps) that don't contain lowercase + * letters by definition, or other features that mainly operate on + * numerals. + */ + + standard_char = script_class->standard_char1; + af_get_char_index( &metrics->root, + standard_char, + &glyph_index, + &y_offset ); + if ( !glyph_index ) + { + if ( script_class->standard_char2 ) + { + standard_char = script_class->standard_char2; + af_get_char_index( &metrics->root, + standard_char, + &glyph_index, + &y_offset ); + if ( !glyph_index ) + { + if ( script_class->standard_char3 ) + { + standard_char = script_class->standard_char3; + af_get_char_index( &metrics->root, + standard_char, + &glyph_index, + &y_offset ); + if ( !glyph_index ) + goto Exit; + } + else + goto Exit; + } + } + else + goto Exit; + } + FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", - metrics->root.script_class->standard_char, glyph_index )); + standard_char, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); if ( error || face->glyph->outline.n_points <= 0 ) @@ -105,7 +152,7 @@ scaler->render_mode = FT_RENDER_MODE_NORMAL; scaler->flags = 0; - af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy ); + af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy ); error = af_glyph_hints_reload( hints, &face->glyph->outline ); if ( error ) @@ -214,12 +261,14 @@ AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT]; FT_Outline outline; - AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset; + AF_StyleClass sc = metrics->root.style_class; + + AF_Blue_Stringset bss = sc->blue_stringset; const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; - /* we walk over the blue character strings as specified in the */ - /* script's entry in the `af_blue_stringset' array */ + /* we walk over the blue character strings as specified in the */ + /* style's entry in the `af_blue_stringset' array */ FT_TRACE5(( "latin blue zones computation\n" "============================\n" @@ -277,7 +326,8 @@ while ( *p ) { FT_ULong ch; - FT_UInt glyph_index; + FT_ULong glyph_index; + FT_Long y_offset; FT_Pos best_y; /* same as points.y */ FT_Int best_point, best_contour_first, best_contour_last; FT_Vector* points; @@ -287,7 +337,7 @@ GET_UTF8_CHAR( ch, p ); /* load the character in the face -- skip unknown or empty ones */ - glyph_index = FT_Get_Char_Index( face, ch ); + af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset ); if ( glyph_index == 0 ) { FT_TRACE5(( " U+%04lX unavailable\n", ch )); @@ -575,7 +625,10 @@ if ( FT_ABS( points[next].x - points[first].x ) <= 20 * dist ) { - last--; + if ( last > best_contour_first ) + last--; + else + last = best_contour_last; break; } @@ -606,6 +659,12 @@ } } + /* for computing blue zones, we add the y offset as returned */ + /* by the currently used OpenType feature -- for example, */ + /* superscript glyphs might be identical to subscript glyphs */ + /* with a vertical shift */ + best_y += y_offset; + FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y )); /* now set the `round' flag depending on the segment's kind: */ @@ -733,10 +792,11 @@ /* digit `0' is 0x30 in all supported charmaps */ for ( i = 0x30; i <= 0x39; i++ ) { - FT_UInt glyph_index; + FT_ULong glyph_index; + FT_Long y_offset; - glyph_index = FT_Get_Char_Index( face, i ); + af_get_char_index( &metrics->root, i, &glyph_index, &y_offset ); if ( glyph_index == 0 ) continue; @@ -879,11 +939,11 @@ FT_TRACE5(( "af_latin_metrics_scale_dim:" - " x height alignment (script `%s'):\n" + " x height alignment (style `%s'):\n" " " " vertical scaling changed from %.4f to %.4f (by %d%%)\n" "\n", - af_script_names[metrics->root.script_class->script], + af_style_names[metrics->root.style_class->style], axis->org_scale / 65536.0, scale / 65536.0, ( fitted - scaled ) * 100 / scaled )); @@ -906,9 +966,9 @@ metrics->root.scaler.y_delta = delta; } - FT_TRACE5(( "%s widths (script `%s')\n", + FT_TRACE5(( "%s widths (style `%s')\n", dim == AF_DIMENSION_HORZ ? "horizontal" : "vertical", - af_script_names[metrics->root.script_class->script] )); + af_style_names[metrics->root.style_class->style] )); /* scale the widths */ for ( nn = 0; nn < axis->width_count; nn++ ) @@ -933,15 +993,15 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( axis->extra_light ) - FT_TRACE5(( "`%s' script is extra light (at current resolution)\n" + FT_TRACE5(( "`%s' style is extra light (at current resolution)\n" "\n", - af_script_names[metrics->root.script_class->script] )); + af_style_names[metrics->root.style_class->style] )); #endif if ( dim == AF_DIMENSION_VERT ) { - FT_TRACE5(( "blue zones (script `%s')\n", - af_script_names[metrics->root.script_class->script] )); + FT_TRACE5(( "blue zones (style `%s')\n", + af_style_names[metrics->root.style_class->style] )); /* scale the blue zones */ for ( nn = 0; nn < axis->blue_count; nn++ ) @@ -1797,7 +1857,7 @@ FT_Face face = metrics->root.scaler.face; - af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics ); + af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics ); /* * correct x_scale and y_scale if needed, since they may have @@ -2148,9 +2208,9 @@ #endif - FT_TRACE5(( "latin %s edge hinting (script `%s')\n", + FT_TRACE5(( "latin %s edge hinting (style `%s')\n", dim == AF_DIMENSION_VERT ? "horizontal" : "vertical", - af_script_names[hints->metrics->script_class->script] )); + af_style_names[hints->metrics->style_class->style] )); /* we begin by aligning all stems relative to the blue zone */ /* if needed -- that's only for horizontal edges */ @@ -2709,112 +2769,13 @@ sizeof ( AF_LatinMetricsRec ), - (AF_Script_InitMetricsFunc) af_latin_metrics_init, - (AF_Script_ScaleMetricsFunc)af_latin_metrics_scale, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init, + (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) af_latin_hints_init, - (AF_Script_ApplyHintsFunc) af_latin_hints_apply + (AF_WritingSystem_InitHintsFunc) af_latin_hints_init, + (AF_WritingSystem_ApplyHintsFunc) af_latin_hints_apply ) - /* XXX: this should probably fine tuned to differentiate better between */ - /* scripts... */ - - static const AF_Script_UniRangeRec af_latn_uniranges[] = - { - AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ - AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ - AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ - AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ - AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ - AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ - AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ - AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ - AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ - AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ - AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ - AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ - AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ - AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ - AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ - AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ - AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ - AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ - AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ - AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ - AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ - AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - static const AF_Script_UniRangeRec af_grek_uniranges[] = - { - AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ - AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - static const AF_Script_UniRangeRec af_cyrl_uniranges[] = - { - AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ - AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ - AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ - AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - static const AF_Script_UniRangeRec af_hebr_uniranges[] = - { - AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */ - AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - - AF_DEFINE_SCRIPT_CLASS( - af_latn_script_class, - - AF_SCRIPT_LATN, - AF_BLUE_STRINGSET_LATN, - AF_WRITING_SYSTEM_LATIN, - - af_latn_uniranges, - 'o' - ) - - AF_DEFINE_SCRIPT_CLASS( - af_grek_script_class, - - AF_SCRIPT_GREK, - AF_BLUE_STRINGSET_GREK, - AF_WRITING_SYSTEM_LATIN, - - af_grek_uniranges, - 0x3BF /* ο */ - ) - - AF_DEFINE_SCRIPT_CLASS( - af_cyrl_script_class, - - AF_SCRIPT_CYRL, - AF_BLUE_STRINGSET_CYRL, - AF_WRITING_SYSTEM_LATIN, - - af_cyrl_uniranges, - 0x43E /* о */ - ) - - AF_DEFINE_SCRIPT_CLASS( - af_hebr_script_class, - - AF_SCRIPT_HEBR, - AF_BLUE_STRINGSET_HEBR, - AF_WRITING_SYSTEM_LATIN, - - af_hebr_uniranges, - 0x5DD /* ם */ - ) - - /* END */ Index: lib/3rdparty/freetype/src/autofit/aflatin.h =================================================================== --- lib/3rdparty/freetype/src/autofit/aflatin.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/aflatin.h (working copy) @@ -2,7 +2,8 @@ /* */ /* aflatin.h */ /* */ -/* Auto-fitter hinting routines for latin script (specification). */ +/* Auto-fitter hinting routines for latin writing system */ +/* (specification). */ /* */ /* Copyright 2003-2007, 2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -29,17 +30,6 @@ AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin_writing_system_class ) - /* the latin-specific script classes */ - - AF_DECLARE_SCRIPT_CLASS( af_cyrl_script_class ) - AF_DECLARE_SCRIPT_CLASS( af_grek_script_class ) - AF_DECLARE_SCRIPT_CLASS( af_latn_script_class ) - AF_DECLARE_SCRIPT_CLASS( af_hebr_script_class ) -#if 0 - AF_DECLARE_SCRIPT_CLASS( af_armn_script_class ) -#endif - - /* constants are given with units_per_em == 2048 in mind */ #define AF_LATIN_CONSTANT( metrics, c ) \ ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 ) @@ -56,8 +46,8 @@ /* * The following declarations could be embedded in the file `aflatin.c'; - * they have been made semi-public to allow alternate script hinters to - * re-use some of them. + * they have been made semi-public to allow alternate writing system + * hinters to re-use some of them. */ @@ -113,9 +103,9 @@ typedef struct AF_LatinMetricsRec_ { - AF_ScriptMetricsRec root; - FT_UInt units_per_em; - AF_LatinAxisRec axis[AF_DIMENSION_MAX]; + AF_StyleMetricsRec root; + FT_UInt units_per_em; + AF_LatinAxisRec axis[AF_DIMENSION_MAX]; } AF_LatinMetricsRec, *AF_LatinMetrics; @@ -171,7 +161,7 @@ /* * The next functions shouldn't normally be exported. However, other - * scripts might like to use these functions as-is. + * writing systems might like to use these functions as-is. */ FT_LOCAL( FT_Error ) af_latin_hints_compute_segments( AF_GlyphHints hints, Index: lib/3rdparty/freetype/src/autofit/aflatin2.c =================================================================== --- lib/3rdparty/freetype/src/autofit/aflatin2.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/aflatin2.c (working copy) @@ -2,7 +2,7 @@ /* */ /* aflatin2.c */ /* */ -/* Auto-fitter hinting routines for latin script (body). */ +/* Auto-fitter hinting routines for latin writing system (body). */ /* */ /* Copyright 2003-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -78,7 +78,7 @@ glyph_index = FT_Get_Char_Index( face, - metrics->root.script_class->standard_char ); + metrics->root.style_class->standard_char ); if ( glyph_index == 0 ) goto Exit; @@ -95,7 +95,7 @@ scaler->render_mode = FT_RENDER_MODE_NORMAL; scaler->flags = 0; - af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy ); + af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy ); error = af_glyph_hints_reload( hints, &face->glyph->outline ); if ( error ) @@ -1501,7 +1501,7 @@ FT_Face face = metrics->root.scaler.face; - af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics ); + af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics ); /* * correct x_scale and y_scale if needed, since they may have @@ -2387,62 +2387,13 @@ sizeof ( AF_LatinMetricsRec ), - (AF_Script_InitMetricsFunc) af_latin2_metrics_init, - (AF_Script_ScaleMetricsFunc)af_latin2_metrics_scale, - (AF_Script_DoneMetricsFunc) NULL, + (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init, + (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale, + (AF_WritingSystem_DoneMetricsFunc) NULL, - (AF_Script_InitHintsFunc) af_latin2_hints_init, - (AF_Script_ApplyHintsFunc) af_latin2_hints_apply + (AF_WritingSystem_InitHintsFunc) af_latin2_hints_init, + (AF_WritingSystem_ApplyHintsFunc) af_latin2_hints_apply ) - /* XXX: this should probably fine tuned to differentiate better between */ - /* scripts... */ - - static const AF_Script_UniRangeRec af_ltn2_uniranges[] = - { - AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ - AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ - AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ - AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ - AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ - AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ - AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ - AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ - AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ - AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ - AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ - AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ - AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ - AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ - AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ - AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ - AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ - AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ - AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ - AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ - AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ - AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ - AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ - AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ - AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ - AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ - AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ - AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - - AF_DEFINE_SCRIPT_CLASS( - af_ltn2_script_class, - - AF_SCRIPT_LTN2, - AF_BLUE_STRINGSET_LATN, - AF_WRITING_SYSTEM_LATIN2, - - af_ltn2_uniranges, - 'o' - ) - - /* END */ Index: lib/3rdparty/freetype/src/autofit/aflatin2.h =================================================================== --- lib/3rdparty/freetype/src/autofit/aflatin2.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/aflatin2.h (working copy) @@ -2,7 +2,8 @@ /* */ /* aflatin2.h */ /* */ -/* Auto-fitter hinting routines for latin script (specification). */ +/* Auto-fitter hinting routines for latin writing system */ +/* (specification). */ /* */ /* Copyright 2003-2007, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ @@ -30,17 +31,6 @@ AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class ) - /* the latin-specific script classes */ - - AF_DECLARE_SCRIPT_CLASS( af_ltn2_script_class ) /* XXX */ -#if 0 - AF_DECLARE_SCRIPT_CLASS( af_arm2_script_class ) - AF_DECLARE_SCRIPT_CLASS( af_cyr2_script_class ) - AF_DECLARE_SCRIPT_CLASS( af_grk2_script_class ) - AF_DECLARE_SCRIPT_CLASS( af_hbr2_script_class ) -#endif - - /* */ FT_END_HEADER Index: lib/3rdparty/freetype/src/autofit/afloader.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afloader.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afloader.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter glyph loading routines (body). */ /* */ -/* Copyright 2003-2009, 2011-2013 by */ +/* Copyright 2003-2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -109,7 +109,7 @@ FT_Error error; FT_Face face = loader->face; FT_GlyphLoader gloader = loader->gloader; - AF_ScriptMetrics metrics = loader->metrics; + AF_StyleMetrics metrics = loader->metrics; AF_GlyphHints hints = &loader->hints; FT_GlyphSlot slot = face->glyph; FT_Slot_Internal internal = slot->internal; @@ -183,17 +183,17 @@ /* automatic hinting process */ { #ifdef FT_CONFIG_OPTION_PIC - AF_FaceGlobals globals = loader->globals; + AF_FaceGlobals globals = loader->globals; #endif + AF_StyleClass style_class = metrics->style_class; AF_WritingSystemClass writing_system_class = - AF_WRITING_SYSTEM_CLASSES_GET - [metrics->script_class->writing_system]; + AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system]; - if ( writing_system_class->script_hints_apply ) - writing_system_class->script_hints_apply( hints, - &gloader->current.outline, - metrics ); + if ( writing_system_class->style_hints_apply ) + writing_system_class->style_hints_apply( hints, + &gloader->current.outline, + metrics ); } /* we now need to adjust the metrics according to the change in */ @@ -318,13 +318,8 @@ /* recompute subglyph pointer */ subglyph = gloader->base.subglyphs + num_base_subgs + nn; - if ( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) + if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) ) { - pp1 = loader->pp1; - pp2 = loader->pp2; - } - else - { loader->pp1 = pp1; loader->pp2 = pp2; } @@ -529,14 +524,14 @@ error = af_loader_reset( module, face ); if ( !error ) { - AF_ScriptMetrics metrics; - FT_UInt options = AF_SCRIPT_DFLT; + AF_StyleMetrics metrics; + FT_UInt options = AF_STYLE_NONE_DFLT; #ifdef FT_OPTION_AUTOFIT2 /* XXX: undocumented hook to activate the latin2 writing system */ if ( load_flags & ( 1UL << 20 ) ) - options = AF_SCRIPT_LTN2; + options = AF_STYLE_LTN2_DFLT; #endif error = af_face_globals_get_metrics( loader->globals, gindex, @@ -544,17 +539,17 @@ if ( !error ) { #ifdef FT_CONFIG_OPTION_PIC - AF_FaceGlobals globals = loader->globals; + AF_FaceGlobals globals = loader->globals; #endif + AF_StyleClass style_class = metrics->style_class; AF_WritingSystemClass writing_system_class = - AF_WRITING_SYSTEM_CLASSES_GET - [metrics->script_class->writing_system]; + AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system]; loader->metrics = metrics; - if ( writing_system_class->script_metrics_scale ) - writing_system_class->script_metrics_scale( metrics, &scaler ); + if ( writing_system_class->style_metrics_scale ) + writing_system_class->style_metrics_scale( metrics, &scaler ); else metrics->scaler = scaler; @@ -561,10 +556,10 @@ load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; load_flags &= ~FT_LOAD_RENDER; - if ( writing_system_class->script_hints_init ) + if ( writing_system_class->style_hints_init ) { - error = writing_system_class->script_hints_init( &loader->hints, - metrics ); + error = writing_system_class->style_hints_init( &loader->hints, + metrics ); if ( error ) goto Exit; } Index: lib/3rdparty/freetype/src/autofit/afloader.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afloader.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afloader.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter glyph loading routines (specification). */ /* */ -/* Copyright 2003-2005, 2011-2012 by */ +/* Copyright 2003-2005, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -44,7 +44,7 @@ /* current glyph data */ FT_GlyphLoader gloader; AF_GlyphHintsRec hints; - AF_ScriptMetrics metrics; + AF_StyleMetrics metrics; FT_Bool transformed; FT_Matrix trans_matrix; FT_Vector trans_delta; Index: lib/3rdparty/freetype/src/autofit/afmodule.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afmodule.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afmodule.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module implementation (body). */ /* */ -/* Copyright 2003-2006, 2009, 2011-2013 by */ +/* Copyright 2003-2006, 2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,7 +45,7 @@ #define FT_COMPONENT trace_afmodule - FT_Error + static FT_Error af_property_get_face_globals( FT_Face face, AF_FaceGlobals* aglobals, AF_Module module ) @@ -60,8 +60,8 @@ globals = (AF_FaceGlobals)face->autohint.data; if ( !globals ) { - /* trigger computation of the global script data */ - /* in case it hasn't been done yet */ + /* trigger computation of the global style data */ + /* in case it hasn't been done yet */ error = af_face_globals_new( face, &globals, module ); if ( !error ) { @@ -79,7 +79,7 @@ } - FT_Error + static FT_Error af_property_set( FT_Module ft_module, const char* property_name, const void* value ) @@ -92,11 +92,43 @@ { FT_UInt* fallback_script = (FT_UInt*)value; + FT_UInt ss; - module->fallback_script = *fallback_script; + /* We translate the fallback script to a fallback style that uses */ + /* `fallback-script' as its script and `AF_COVERAGE_NONE' as its */ + /* coverage value. */ + for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ ) + { + AF_StyleClass style_class = AF_STYLE_CLASSES_GET[ss]; + + + if ( style_class->script == *fallback_script && + style_class->coverage == AF_COVERAGE_DEFAULT ) + { + module->fallback_style = ss; + break; + } + } + + if ( !AF_STYLE_CLASSES_GET[ss] ) + { + FT_TRACE0(( "af_property_set: Invalid value %d for property `%s'\n", + fallback_script, property_name )); + return FT_THROW( Invalid_Argument ); + } + return error; } + else if ( !ft_strcmp( property_name, "default-script" ) ) + { + FT_UInt* default_script = (FT_UInt*)value; + + + module->default_script = *default_script; + + return error; + } else if ( !ft_strcmp( property_name, "increase-x-height" ) ) { FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value; @@ -116,14 +148,15 @@ } - FT_Error + static FT_Error af_property_get( FT_Module ft_module, const char* property_name, void* value ) { - FT_Error error = FT_Err_Ok; - AF_Module module = (AF_Module)ft_module; - FT_UInt fallback_script = module->fallback_script; + FT_Error error = FT_Err_Ok; + AF_Module module = (AF_Module)ft_module; + FT_UInt fallback_style = module->fallback_style; + FT_UInt default_script = module->default_script; if ( !ft_strcmp( property_name, "glyph-to-script-map" ) ) @@ -134,7 +167,7 @@ error = af_property_get_face_globals( prop->face, &globals, module ); if ( !error ) - prop->map = globals->glyph_scripts; + prop->map = globals->glyph_styles; return error; } @@ -142,11 +175,22 @@ { FT_UInt* val = (FT_UInt*)value; + AF_StyleClass style_class = AF_STYLE_CLASSES_GET[fallback_style]; - *val = fallback_script; + *val = style_class->script; + return error; } + else if ( !ft_strcmp( property_name, "default-script" ) ) + { + FT_UInt* val = (FT_UInt*)value; + + + *val = default_script; + + return error; + } else if ( !ft_strcmp( property_name, "increase-x-height" ) ) { FT_Prop_IncreaseXHeight* prop = (FT_Prop_IncreaseXHeight*)value; @@ -206,7 +250,8 @@ AF_Module module = (AF_Module)ft_module; - module->fallback_script = AF_SCRIPT_FALLBACK; + module->fallback_style = AF_STYLE_FALLBACK; + module->default_script = AF_SCRIPT_DEFAULT; return af_loader_init( module ); } Index: lib/3rdparty/freetype/src/autofit/afmodule.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afmodule.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afmodule.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module implementation (specification). */ /* */ -/* Copyright 2003, 2004, 2005 by */ +/* Copyright 2003-2005, 2009, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -40,7 +40,8 @@ { FT_ModuleRec root; - FT_UInt fallback_script; + FT_UInt fallback_style; + FT_UInt default_script; AF_LoaderRec loader[1]; Index: lib/3rdparty/freetype/src/autofit/afpic.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afpic.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afpic.c (working copy) @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009-2013 by */ +/* Copyright 2009-2014 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,6 +20,7 @@ #include FT_FREETYPE_H #include FT_INTERNAL_OBJECTS_H #include "afpic.h" +#include "afglobal.h" #include "aferrors.h" @@ -42,7 +43,7 @@ FT_AutoHinter_InterfaceRec* clazz ); - /* forward declaration of PIC init functions from script classes */ + /* forward declaration of PIC init functions from writing system classes */ #undef WRITING_SYSTEM #define WRITING_SYSTEM( ws, WS ) /* empty */ @@ -97,16 +98,21 @@ FT_Init_Class_af_service_properties( &container->af_service_properties ); - for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX - 1; ss++ ) + for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ ) container->af_writing_system_classes[ss] = &container->af_writing_system_classes_rec[ss]; - container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX - 1] = NULL; + container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL; - for ( ss = 0; ss < AF_SCRIPT_MAX - 1; ss++ ) + for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ ) container->af_script_classes[ss] = &container->af_script_classes_rec[ss]; - container->af_script_classes[AF_SCRIPT_MAX - 1] = NULL; + container->af_script_classes[AF_SCRIPT_MAX] = NULL; + for ( ss = 0; ss < AF_STYLE_MAX; ss++ ) + container->af_style_classes[ss] = + &container->af_style_classes_rec[ss]; + container->af_style_classes[AF_STYLE_MAX] = NULL; + #undef WRITING_SYSTEM #define WRITING_SYSTEM( ws, WS ) \ FT_Init_Class_af_ ## ws ## _writing_system_class( \ @@ -116,7 +122,7 @@ #include "afwrtsys.h" #undef SCRIPT -#define SCRIPT( s, S, d ) \ +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ FT_Init_Class_af_ ## s ## _script_class( \ &container->af_script_classes_rec[ss++] ); @@ -123,6 +129,14 @@ ss = 0; #include "afscript.h" +#undef STYLE +#define STYLE( s, S, d, ws, sc, bss, c ) \ + FT_Init_Class_af_ ## s ## _style_class( \ + &container->af_style_classes_rec[ss++] ); + + ss = 0; +#include "afstyles.h" + FT_Init_Class_af_autofitter_interface( library, &container->af_autofitter_interface ); Index: lib/3rdparty/freetype/src/autofit/afpic.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afpic.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afpic.h (working copy) @@ -32,6 +32,7 @@ #define AF_WRITING_SYSTEM_CLASSES_GET af_writing_system_classes #define AF_SCRIPT_CLASSES_GET af_script_classes +#define AF_STYLE_CLASSES_GET af_style_classes #define AF_INTERFACE_GET af_autofitter_interface #else /* FT_CONFIG_OPTION_PIC */ @@ -48,15 +49,20 @@ FT_Service_PropertiesRec af_service_properties; AF_WritingSystemClass af_writing_system_classes + [AF_WRITING_SYSTEM_MAX + 1]; + AF_WritingSystemClassRec af_writing_system_classes_rec [AF_WRITING_SYSTEM_MAX]; - AF_WritingSystemClassRec af_writing_system_classes_rec - [AF_WRITING_SYSTEM_MAX - 1]; AF_ScriptClass af_script_classes + [AF_SCRIPT_MAX + 1]; + AF_ScriptClassRec af_script_classes_rec [AF_SCRIPT_MAX]; - AF_ScriptClassRec af_script_classes_rec - [AF_SCRIPT_MAX - 1]; + AF_StyleClass af_style_classes + [AF_STYLE_MAX + 1]; + AF_StyleClassRec af_style_classes_rec + [AF_STYLE_MAX]; + FT_AutoHinter_InterfaceRec af_autofitter_interface; } AFModulePIC; @@ -74,6 +80,8 @@ ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes ) #define AF_SCRIPT_CLASSES_GET \ ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes ) +#define AF_STYLE_CLASSES_GET \ + ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_style_classes ) #define AF_INTERFACE_GET \ ( GET_PIC( library )->af_autofitter_interface ) Index: lib/3rdparty/freetype/src/autofit/afranges.c =================================================================== --- lib/3rdparty/freetype/src/autofit/afranges.c (revision 0) +++ lib/3rdparty/freetype/src/autofit/afranges.c (working copy) @@ -0,0 +1,208 @@ +/***************************************************************************/ +/* */ +/* afranges.c */ +/* */ +/* Auto-fitter Unicode script ranges (body). */ +/* */ +/* Copyright 2013, 2014 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "afranges.h" + + + const AF_Script_UniRangeRec af_cyrl_uniranges[] = + { + AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ + AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ + AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ + AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_grek_uniranges[] = + { + AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ + AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_hebr_uniranges[] = + { + AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */ + AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_latn_uniranges[] = + { + AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ + AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ + AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ + AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ + AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ + AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ + AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ + AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ + AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ + AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ + AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ + AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ + AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ + AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ + AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ + AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ + AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ + AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ + AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ + AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ + AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ + AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_none_uniranges[] = + { + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + +#ifdef AF_CONFIG_OPTION_INDIC + + const AF_Script_UniRangeRec af_beng_uniranges[] = + { + AF_UNIRANGE_REC( 0x0980UL, 0x09FFUL ), /* Bengali */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_deva_uniranges[] = + { + AF_UNIRANGE_REC( 0x0900UL, 0x097FUL ), /* Devanagari */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_gujr_uniranges[] = + { + AF_UNIRANGE_REC( 0x0A80UL, 0x0AFFUL ), /* Gujarati */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_guru_uniranges[] = + { + AF_UNIRANGE_REC( 0x0A00UL, 0x0A7FUL ), /* Gurmukhi */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_knda_uniranges[] = + { + AF_UNIRANGE_REC( 0x0C80UL, 0x0CFFUL ), /* Kannada */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_limb_uniranges[] = + { + AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_mlym_uniranges[] = + { + AF_UNIRANGE_REC( 0x0D00UL, 0x0D7FUL ), /* Malayalam */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_orya_uniranges[] = + { + AF_UNIRANGE_REC( 0x0B00UL, 0x0B7FUL ), /* Oriya */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_sinh_uniranges[] = + { + AF_UNIRANGE_REC( 0x0D80UL, 0x0DFFUL ), /* Sinhala */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_sund_uniranges[] = + { + AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_sylo_uniranges[] = + { + AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_taml_uniranges[] = + { + AF_UNIRANGE_REC( 0x0B80UL, 0x0BFFUL ), /* Tamil */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_telu_uniranges[] = + { + AF_UNIRANGE_REC( 0x0C00UL, 0x0C7FUL ), /* Telugu */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + const AF_Script_UniRangeRec af_tibt_uniranges[] = + { + AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + +#endif /* !AF_CONFIG_OPTION_INDIC */ + +#ifdef AF_CONFIG_OPTION_CJK + + /* this corresponds to Unicode 6.0 */ + + const AF_Script_UniRangeRec af_hani_uniranges[] = + { + AF_UNIRANGE_REC( 0x1100UL, 0x11FFUL ), /* Hangul Jamo */ + AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */ + AF_UNIRANGE_REC( 0x2F00UL, 0x2FDFUL ), /* Kangxi Radicals */ + AF_UNIRANGE_REC( 0x2FF0UL, 0x2FFFUL ), /* Ideographic Description Characters */ + AF_UNIRANGE_REC( 0x3000UL, 0x303FUL ), /* CJK Symbols and Punctuation */ + AF_UNIRANGE_REC( 0x3040UL, 0x309FUL ), /* Hiragana */ + AF_UNIRANGE_REC( 0x30A0UL, 0x30FFUL ), /* Katakana */ + AF_UNIRANGE_REC( 0x3100UL, 0x312FUL ), /* Bopomofo */ + AF_UNIRANGE_REC( 0x3130UL, 0x318FUL ), /* Hangul Compatibility Jamo */ + AF_UNIRANGE_REC( 0x3190UL, 0x319FUL ), /* Kanbun */ + AF_UNIRANGE_REC( 0x31A0UL, 0x31BFUL ), /* Bopomofo Extended */ + AF_UNIRANGE_REC( 0x31C0UL, 0x31EFUL ), /* CJK Strokes */ + AF_UNIRANGE_REC( 0x31F0UL, 0x31FFUL ), /* Katakana Phonetic Extensions */ + AF_UNIRANGE_REC( 0x3200UL, 0x32FFUL ), /* Enclosed CJK Letters and Months */ + AF_UNIRANGE_REC( 0x3300UL, 0x33FFUL ), /* CJK Compatibility */ + AF_UNIRANGE_REC( 0x3400UL, 0x4DBFUL ), /* CJK Unified Ideographs Extension A */ + AF_UNIRANGE_REC( 0x4DC0UL, 0x4DFFUL ), /* Yijing Hexagram Symbols */ + AF_UNIRANGE_REC( 0x4E00UL, 0x9FFFUL ), /* CJK Unified Ideographs */ + AF_UNIRANGE_REC( 0xA960UL, 0xA97FUL ), /* Hangul Jamo Extended-A */ + AF_UNIRANGE_REC( 0xAC00UL, 0xD7AFUL ), /* Hangul Syllables */ + AF_UNIRANGE_REC( 0xD7B0UL, 0xD7FFUL ), /* Hangul Jamo Extended-B */ + AF_UNIRANGE_REC( 0xF900UL, 0xFAFFUL ), /* CJK Compatibility Ideographs */ + AF_UNIRANGE_REC( 0xFE10UL, 0xFE1FUL ), /* Vertical forms */ + AF_UNIRANGE_REC( 0xFE30UL, 0xFE4FUL ), /* CJK Compatibility Forms */ + AF_UNIRANGE_REC( 0xFF00UL, 0xFFEFUL ), /* Halfwidth and Fullwidth Forms */ + AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ), /* Kana Supplement */ + AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ), /* Tai Xuan Hing Symbols */ + AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ), /* Enclosed Ideographic Supplement */ + AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ), /* CJK Unified Ideographs Extension B */ + AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ), /* CJK Unified Ideographs Extension C */ + AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ), /* CJK Unified Ideographs Extension D */ + AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ), /* CJK Compatibility Ideographs Supplement */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + +#endif /* !AF_CONFIG_OPTION_CJK */ + +/* END */ Index: lib/3rdparty/freetype/src/autofit/afranges.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afranges.h (revision 0) +++ lib/3rdparty/freetype/src/autofit/afranges.h (working copy) @@ -0,0 +1,41 @@ +/***************************************************************************/ +/* */ +/* afranges.h */ +/* */ +/* Auto-fitter Unicode script ranges (specification). */ +/* */ +/* Copyright 2013, 2014 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __AFRANGES_H__ +#define __AFRANGES_H__ + + +#include "aftypes.h" + + +FT_BEGIN_HEADER + +#undef SCRIPT +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ + extern const AF_Script_UniRangeRec af_ ## s ## _uniranges[]; + +#include "afscript.h" + + /* */ + +FT_END_HEADER + +#endif /* __AFRANGES_H__ */ + + +/* END */ Index: lib/3rdparty/freetype/src/autofit/afscript.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afscript.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afscript.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter scripts (specification only). */ /* */ -/* Copyright 2013 by */ +/* Copyright 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,18 +20,119 @@ /* Define `SCRIPT' as needed. */ - /* Add new scripts here. */ + /* Add new scripts here. The first and second arguments are the */ + /* script name in lowercase and uppercase, respectively, followed */ + /* by a description string. Then comes the corresponding HarfBuzz */ + /* script name tag, followed by a string of standard characters (to */ + /* derive the standard width and height of stems). */ - SCRIPT( cyrl, CYRL, "Cyrillic" ) - SCRIPT( deva, DEVA, "Indic scripts" ) - SCRIPT( dflt, DFLT, "no script" ) - SCRIPT( grek, GREK, "Greek" ) - SCRIPT( hani, HANI, "CJKV ideographs" ) - SCRIPT( hebr, HEBR, "Hebrew" ) - SCRIPT( latn, LATN, "Latin" ) -#ifdef FT_OPTION_AUTOFIT2 - SCRIPT( ltn2, LTN2, "Latin 2" ) -#endif + SCRIPT( cyrl, CYRL, + "Cyrillic", + HB_SCRIPT_CYRILLIC, + 0x43E, 0x41E, 0x0 ) /* оО */ + SCRIPT( grek, GREK, + "Greek", + HB_SCRIPT_GREEK, + 0x3BF, 0x39F, 0x0 ) /* οΟ */ + SCRIPT( hebr, HEBR, + "Hebrew", + HB_SCRIPT_HEBREW, + 0x5DD, 0x0, 0x0 ) /* ם */ + + SCRIPT( latn, LATN, + "Latin", + HB_SCRIPT_LATIN, + 'o', 'O', '0' ) + + SCRIPT( none, NONE, + "no script", + HB_SCRIPT_INVALID, + 0x0, 0x0, 0x0 ) + +#ifdef AF_CONFIG_OPTION_INDIC + + SCRIPT( beng, BENG, + "Bengali", + HB_SCRIPT_BENGALI, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( deva, DEVA, + "Devanagari", + HB_SCRIPT_DEVANAGARI, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( gujr, GUJR, + "Gujarati", + HB_SCRIPT_GUJARATI, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( guru, GURU, + "Gurmukhi", + HB_SCRIPT_GURMUKHI, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( knda, KNDA, + "Kannada", + HB_SCRIPT_KANNADA, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( limb, LIMB, + "Limbu", + HB_SCRIPT_LIMBU, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( mlym, MLYM, + "Malayalam", + HB_SCRIPT_MALAYALAM, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( orya, ORYA, + "Oriya", + HB_SCRIPT_ORIYA, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( sinh, SINH, + "Sinhala", + HB_SCRIPT_SINHALA, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( sund, SUND, + "Sundanese", + HB_SCRIPT_SUNDANESE, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( sylo, SYLO, + "Syloti Nagri", + HB_SCRIPT_SYLOTI_NAGRI, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( taml, TAML, + "Tamil", + HB_SCRIPT_TAMIL, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( telu, TELU, + "Telugu", + HB_SCRIPT_TELUGU, + 'o', 0x0, 0x0 ) /* XXX */ + + SCRIPT( tibt, TIBT, + "Tibetan", + HB_SCRIPT_TIBETAN, + 'o', 0x0, 0x0 ) /* XXX */ + +#endif /* AF_CONFIG_OPTION_INDIC */ + +#ifdef AF_CONFIG_OPTION_CJK + + SCRIPT( hani, HANI, + "CJKV ideographs", + HB_SCRIPT_HAN, + 0x7530, 0x56D7, 0x0 ) /* 田囗 */ + +#endif /* AF_CONFIG_OPTION_CJK */ + + /* END */ Index: lib/3rdparty/freetype/src/autofit/afstyles.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afstyles.h (revision 0) +++ lib/3rdparty/freetype/src/autofit/afstyles.h (working copy) @@ -0,0 +1,150 @@ +/***************************************************************************/ +/* */ +/* afstyles.h */ +/* */ +/* Auto-fitter styles (specification only). */ +/* */ +/* Copyright 2013, 2014 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /* The following part can be included multiple times. */ + /* Define `STYLE' as needed. */ + + + /* Add new styles here. The first and second arguments are the */ + /* style name in lowercase and uppercase, respectively, followed */ + /* by a description string. The next arguments are the */ + /* corresponding writing system, script, blue stringset, and */ + /* coverage. */ + /* */ + /* Note that styles using `AF_COVERAGE_DEFAULT' should always */ + /* come after styles with other coverages. */ + /* */ + /* Example: */ + /* */ + /* STYLE( cyrl_dflt, CYRL_DFLT, */ + /* "Cyrillic default style", */ + /* AF_WRITING_SYSTEM_LATIN, */ + /* AF_SCRIPT_CYRL, */ + /* AF_BLUE_STRINGSET_CYRL, */ + /* AF_COVERAGE_DEFAULT ) */ + +#undef STYLE_LATIN +#define STYLE_LATIN( s, S, f, F, ds, df, C ) \ + STYLE( s ## _ ## f, S ## _ ## F, \ + ds " " df " style", \ + AF_WRITING_SYSTEM_LATIN, \ + AF_SCRIPT_ ## S, \ + AF_BLUE_STRINGSET_ ## S, \ + AF_COVERAGE_ ## C ) + +#undef META_STYLE_LATIN +#define META_STYLE_LATIN( s, S, ds ) \ + STYLE_LATIN( s, S, c2cp, C2CP, ds, \ + "petite capticals from capitals", \ + PETITE_CAPITALS_FROM_CAPITALS ) \ + STYLE_LATIN( s, S, c2sc, C2SC, ds, \ + "small capticals from capitals", \ + SMALL_CAPITALS_FROM_CAPITALS ) \ + STYLE_LATIN( s, S, ordn, ORDN, ds, \ + "ordinals", \ + ORDINALS ) \ + STYLE_LATIN( s, S, pcap, PCAP, ds, \ + "petite capitals", \ + PETITE_CAPITALS ) \ + STYLE_LATIN( s, S, sinf, SINF, ds, \ + "scientific inferiors", \ + SCIENTIFIC_INFERIORS ) \ + STYLE_LATIN( s, S, smcp, SMCP, ds, \ + "small capitals", \ + SMALL_CAPITALS ) \ + STYLE_LATIN( s, S, subs, SUBS, ds, \ + "subscript", \ + SUBSCRIPT ) \ + STYLE_LATIN( s, S, sups, SUPS, ds, \ + "superscript", \ + SUPERSCRIPT ) \ + STYLE_LATIN( s, S, titl, TITL, ds, \ + "titling", \ + TITLING ) \ + STYLE_LATIN( s, S, dflt, DFLT, ds, \ + "default", \ + DEFAULT ) + + META_STYLE_LATIN( cyrl, CYRL, "Cyrillic" ) + META_STYLE_LATIN( grek, GREK, "Greek" ) + STYLE( hebr_dflt, HEBR_DFLT, + "Hebrew default style", + AF_WRITING_SYSTEM_LATIN, + AF_SCRIPT_HEBR, + AF_BLUE_STRINGSET_HEBR, + AF_COVERAGE_DEFAULT ) + META_STYLE_LATIN( latn, LATN, "Latin" ) + +#ifdef FT_OPTION_AUTOFIT2 + STYLE( ltn2_dflt, LTN2_DFLT, + "Latin 2 default style", + AF_WRITING_SYSTEM_LATIN2, + AF_SCRIPT_LATN, + AF_BLUE_STRINGSET_LATN, + AF_COVERAGE_DEFAULT ) +#endif + + STYLE( none_dflt, NONE_DFLT, + "no style", + AF_WRITING_SYSTEM_DUMMY, + AF_SCRIPT_NONE, + (AF_Blue_Stringset)0, + AF_COVERAGE_DEFAULT ) + +#ifdef AF_CONFIG_OPTION_INDIC + + /* no blue stringset support for the Indic writing system yet */ +#undef STYLE_DEFAULT_INDIC +#define STYLE_DEFAULT_INDIC( s, S, d ) \ + STYLE( s ## _dflt, S ## _DFLT, \ + d " default style", \ + AF_WRITING_SYSTEM_INDIC, \ + AF_SCRIPT_ ## S, \ + (AF_Blue_Stringset)0, \ + AF_COVERAGE_DEFAULT ) + + STYLE_DEFAULT_INDIC( beng, BENG, "Bengali" ) + STYLE_DEFAULT_INDIC( deva, DEVA, "Devanagari" ) + STYLE_DEFAULT_INDIC( gujr, GUJR, "Gujarati" ) + STYLE_DEFAULT_INDIC( guru, GURU, "Gurmukhi" ) + STYLE_DEFAULT_INDIC( knda, KNDA, "Kannada" ) + STYLE_DEFAULT_INDIC( limb, LIMB, "Limbu" ) + STYLE_DEFAULT_INDIC( mlym, MLYM, "Malayalam" ) + STYLE_DEFAULT_INDIC( orya, ORYA, "Oriya" ) + STYLE_DEFAULT_INDIC( sinh, SINH, "Sinhala" ) + STYLE_DEFAULT_INDIC( sund, SUND, "Sundanese" ) + STYLE_DEFAULT_INDIC( sylo, SYLO, "Syloti Nagri" ) + STYLE_DEFAULT_INDIC( taml, TAML, "Tamil" ) + STYLE_DEFAULT_INDIC( telu, TELU, "Telugu" ) + STYLE_DEFAULT_INDIC( tibt, TIBT, "Tibetan" ) + +#endif /* AF_CONFIG_OPTION_INDIC */ + +#ifdef AF_CONFIG_OPTION_CJK + + STYLE( hani_dflt, HANI_DFLT, + "CJKV ideographs default style", + AF_WRITING_SYSTEM_CJK, + AF_SCRIPT_HANI, + AF_BLUE_STRINGSET_HANI, + AF_COVERAGE_DEFAULT ) + +#endif /* AF_CONFIG_OPTION_CJK */ + + +/* END */ Index: lib/3rdparty/freetype/src/autofit/aftypes.h =================================================================== --- lib/3rdparty/freetype/src/autofit/aftypes.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/aftypes.h (working copy) @@ -4,7 +4,7 @@ /* */ /* Auto-fitter types (specification only). */ /* */ -/* Copyright 2003-2009, 2011-2013 by */ +/* Copyright 2003-2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,7 +20,7 @@ * * The auto-fitter is a complete rewrite of the old auto-hinter. * Its main feature is the ability to differentiate between different - * writing systems in order to apply script-specific rules. + * writing systems and scripts in order to apply specific rules. * * The code has also been compartmentized into several entities that * should make algorithmic experimentation easier than with the old @@ -197,55 +197,31 @@ (a)->y_delta == (b)->y_delta ) - /*************************************************************************/ - /*************************************************************************/ - /***** *****/ - /***** S C R I P T M E T R I C S *****/ - /***** *****/ - /*************************************************************************/ - /*************************************************************************/ + typedef struct AF_StyleMetricsRec_* AF_StyleMetrics; - /* This is the main structure which combines writing systems and script */ - /* data (for a given face object, see below). */ - - typedef struct AF_WritingSystemClassRec_ const* AF_WritingSystemClass; - typedef struct AF_ScriptClassRec_ const* AF_ScriptClass; - typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; - - typedef struct AF_ScriptMetricsRec_ - { - AF_ScriptClass script_class; - AF_ScalerRec scaler; - FT_Bool digits_have_same_width; - - AF_FaceGlobals globals; /* to access properties */ - - } AF_ScriptMetricsRec, *AF_ScriptMetrics; - - /* This function parses an FT_Face to compute global metrics for - * a specific script. + * a specific style. */ typedef FT_Error - (*AF_Script_InitMetricsFunc)( AF_ScriptMetrics metrics, - FT_Face face ); + (*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics metrics, + FT_Face face ); typedef void - (*AF_Script_ScaleMetricsFunc)( AF_ScriptMetrics metrics, - AF_Scaler scaler ); + (*AF_WritingSystem_ScaleMetricsFunc)( AF_StyleMetrics metrics, + AF_Scaler scaler ); typedef void - (*AF_Script_DoneMetricsFunc)( AF_ScriptMetrics metrics ); + (*AF_WritingSystem_DoneMetricsFunc)( AF_StyleMetrics metrics ); typedef FT_Error - (*AF_Script_InitHintsFunc)( AF_GlyphHints hints, - AF_ScriptMetrics metrics ); + (*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints hints, + AF_StyleMetrics metrics ); typedef void - (*AF_Script_ApplyHintsFunc)( AF_GlyphHints hints, - FT_Outline* outline, - AF_ScriptMetrics metrics ); + (*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints hints, + FT_Outline* outline, + AF_StyleMetrics metrics ); /*************************************************************************/ @@ -257,14 +233,14 @@ /*************************************************************************/ /* - * In FreeType, a writing system consists of multiple scripts which can - * be handled similarly *in a typographical way*; the relationship is not - * based on history. For example, both the Greek and the unrelated + * For the auto-hinter, a writing system consists of multiple scripts that + * can be handled similarly *in a typographical way*; the relationship is + * not based on history. For example, both the Greek and the unrelated * Armenian scripts share the same features like ascender, descender, * x-height, etc. Essentially, a writing system is covered by a * submodule of the auto-fitter; it contains * - * - a specific global analyzer which computes global metrics specific to + * - a specific global analyzer that computes global metrics specific to * the script (based on script-specific characters to identify ascender * height, x-height, etc.), * @@ -297,17 +273,19 @@ { AF_WritingSystem writing_system; - FT_Offset script_metrics_size; - AF_Script_InitMetricsFunc script_metrics_init; - AF_Script_ScaleMetricsFunc script_metrics_scale; - AF_Script_DoneMetricsFunc script_metrics_done; + FT_Offset style_metrics_size; + AF_WritingSystem_InitMetricsFunc style_metrics_init; + AF_WritingSystem_ScaleMetricsFunc style_metrics_scale; + AF_WritingSystem_DoneMetricsFunc style_metrics_done; - AF_Script_InitHintsFunc script_hints_init; - AF_Script_ApplyHintsFunc script_hints_apply; + AF_WritingSystem_InitHintsFunc style_hints_init; + AF_WritingSystem_ApplyHintsFunc style_hints_apply; } AF_WritingSystemClassRec; + typedef const AF_WritingSystemClassRec* AF_WritingSystemClass; + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -317,15 +295,15 @@ /*************************************************************************/ /* - * Each script is associated with a set of Unicode ranges which gets used - * to test whether the font face supports the script. It also references - * the writing system it belongs to. + * Each script is associated with a set of Unicode ranges that gets used + * to test whether the font face supports the script. * - * We use four-letter script tags from the OpenType specification. + * We use four-letter script tags from the OpenType specification, + * extended by `NONE', which indicates `no script'. */ #undef SCRIPT -#define SCRIPT( s, S, d ) \ +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \ AF_SCRIPT_ ## S, /* The list of known scripts. */ @@ -353,16 +331,148 @@ typedef struct AF_ScriptClassRec_ { - AF_Script script; - AF_Blue_Stringset blue_stringset; - AF_WritingSystem writing_system; + AF_Script script; AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */ - FT_UInt32 standard_char; /* for default width and height */ + FT_UInt32 standard_char1; /* for default width and height */ + FT_UInt32 standard_char2; /* ditto */ + FT_UInt32 standard_char3; /* ditto */ + } AF_ScriptClassRec; + typedef const AF_ScriptClassRec* AF_ScriptClass; + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** C O V E R A G E S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* + * Usually, a font contains more glyphs than can be addressed by its + * character map. + * + * In the PostScript font world, encoding vectors specific to a given + * task are used to select such glyphs, and these glyphs can be often + * recognized by having a suffix in its glyph names. For example, a + * superscript glyph `A' might be called `A.sup'. Unfortunately, this + * naming scheme is not standardized and thus unusable for us. + * + * In the OpenType world, a better solution was invented, namely + * `features', which cleanly separate a character's input encoding from + * the corresponding glyph's appearance, and which don't use glyph names + * at all. For our purposes, and slightly generalized, an OpenType + * feature is a name of a mapping that maps character codes to + * non-standard glyph indices (features get used for other things also). + * For example, the `sups' feature provides superscript glyphs, thus + * mapping character codes like `A' or `B' to superscript glyph + * representation forms. How this mapping happens is completely + * uninteresting to us. + * + * For the auto-hinter, a `coverage' represents all glyphs of an OpenType + * feature collected in a set (as listed below) that can be hinted + * together. To continue the above example, superscript glyphs must not + * be hinted together with normal glyphs because the blue zones + * completely differ. + * + * Note that FreeType itself doesn't compute coverages; it only provides + * the glyphs addressable by the default Unicode character map. Instead, + * we use the HarfBuzz library (if available), which has many functions + * exactly for this purpose. + * + * AF_COVERAGE_DEFAULT is special: It should cover everything that isn't + * listed separately (including the glyphs addressable by the character + * map). In case HarfBuzz isn't available, it exactly covers the glyphs + * addressable by the character map. + * + */ + +#undef COVERAGE +#define COVERAGE( name, NAME, description, \ + tag1, tag2, tag3, tag4 ) \ + AF_COVERAGE_ ## NAME, + + + typedef enum AF_Coverage_ + { +#include "afcover.h" + + AF_COVERAGE_DEFAULT + + } AF_Coverage; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** S T Y L E S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* + * The topmost structure for modelling the auto-hinter glyph input data + * is a `style class', grouping everything together. + */ + +#undef STYLE +#define STYLE( s, S, d, ws, sc, ss, c ) \ + AF_STYLE_ ## S, + + /* The list of known styles. */ + typedef enum AF_Style_ + { + +#include "afstyles.h" + + AF_STYLE_MAX /* do not remove */ + + } AF_Style; + + + typedef struct AF_StyleClassRec_ + { + AF_Style style; + + AF_WritingSystem writing_system; + AF_Script script; + AF_Blue_Stringset blue_stringset; + AF_Coverage coverage; + + } AF_StyleClassRec; + + typedef const AF_StyleClassRec* AF_StyleClass; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** S T Y L E M E T R I C S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; + + /* This is the main structure that combines everything. Autofit modules */ + /* specific to writing systems derive their structures from it, for */ + /* example `AF_LatinMetrics'. */ + + typedef struct AF_StyleMetricsRec_ + { + AF_StyleClass style_class; + AF_ScalerRec scaler; + FT_Bool digits_have_same_width; + + AF_FaceGlobals globals; /* to access properties */ + + } AF_StyleMetricsRec; + + /* Declare and define vtables for classes */ #ifndef FT_CONFIG_OPTION_PIC @@ -401,21 +511,43 @@ #define AF_DEFINE_SCRIPT_CLASS( \ script_class, \ - script_, \ - blue_stringset_, \ - writing_system_, \ + script, \ ranges, \ - std_char ) \ + std_char1, \ + std_char2, \ + std_char3 ) \ FT_CALLBACK_TABLE_DEF \ const AF_ScriptClassRec script_class = \ { \ - script_, \ - blue_stringset_, \ - writing_system_, \ + script, \ ranges, \ - std_char \ + std_char1, \ + std_char2, \ + std_char3 \ }; + +#define AF_DECLARE_STYLE_CLASS( style_class ) \ + FT_CALLBACK_TABLE const AF_StyleClassRec \ + style_class; + +#define AF_DEFINE_STYLE_CLASS( \ + style_class, \ + style, \ + writing_system, \ + script, \ + blue_stringset, \ + coverage ) \ + FT_CALLBACK_TABLE_DEF \ + const AF_StyleClassRec style_class = \ + { \ + style, \ + writing_system, \ + script, \ + blue_stringset, \ + coverage \ + }; + #else /* FT_CONFIG_OPTION_PIC */ #define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \ @@ -434,16 +566,16 @@ FT_LOCAL_DEF( void ) \ FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \ { \ - ac->writing_system = system; \ + ac->writing_system = system; \ \ - ac->script_metrics_size = m_size; \ + ac->style_metrics_size = m_size; \ \ - ac->script_metrics_init = m_init; \ - ac->script_metrics_scale = m_scale; \ - ac->script_metrics_done = m_done; \ + ac->style_metrics_init = m_init; \ + ac->style_metrics_scale = m_scale; \ + ac->style_metrics_done = m_done; \ \ - ac->script_hints_init = h_init; \ - ac->script_hints_apply = h_apply; \ + ac->style_hints_init = h_init; \ + ac->style_hints_apply = h_apply; \ } @@ -454,20 +586,42 @@ #define AF_DEFINE_SCRIPT_CLASS( \ script_class, \ script_, \ - blue_string_set_, \ - writing_system_, \ ranges, \ - std_char ) \ + std_char1, \ + std_char2, \ + std_char3 ) \ FT_LOCAL_DEF( void ) \ FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \ { \ ac->script = script_; \ - ac->blue_stringset = blue_stringset_; \ - ac->writing_system = writing_system_; \ ac->script_uni_ranges = ranges; \ - ac->standard_char = std_char; \ + ac->standard_char1 = std_char1; \ + ac->standard_char2 = std_char2; \ + ac->standard_char3 = std_char3; \ } + +#define AF_DECLARE_STYLE_CLASS( style_class ) \ + FT_LOCAL( void ) \ + FT_Init_Class_ ## style_class( AF_StyleClassRec* ac ); + +#define AF_DEFINE_STYLE_CLASS( \ + style_class, \ + style_, \ + writing_system_, \ + script_, \ + blue_stringset_, \ + coverage_ ) \ + FT_LOCAL_DEF( void ) \ + FT_Init_Class_ ## style_class( AF_StyleClassRec* ac ) \ + { \ + ac->style = style_; \ + ac->writing_system = writing_system_; \ + ac->script = script_; \ + ac->blue_stringset = blue_stringset_; \ + ac->coverage = coverage_; \ + } + #endif /* FT_CONFIG_OPTION_PIC */ Index: lib/3rdparty/freetype/src/autofit/afwrtsys.h =================================================================== --- lib/3rdparty/freetype/src/autofit/afwrtsys.h (revision 62563) +++ lib/3rdparty/freetype/src/autofit/afwrtsys.h (working copy) @@ -37,7 +37,8 @@ /* Define `WRITING_SYSTEM' as needed. */ - /* Add new writing systems here. */ + /* Add new writing systems here. The arguments are the writing system */ + /* name in lowercase and uppercase, respectively. */ WRITING_SYSTEM( dummy, DUMMY ) WRITING_SYSTEM( latin, LATIN ) Index: lib/3rdparty/freetype/src/autofit/autofit.c =================================================================== --- lib/3rdparty/freetype/src/autofit/autofit.c (revision 62563) +++ lib/3rdparty/freetype/src/autofit/autofit.c (working copy) @@ -24,6 +24,8 @@ #include "afglobal.c" #include "afhints.c" +#include "afranges.c" + #include "afdummy.c" #include "aflatin.c" #ifdef FT_OPTION_AUTOFIT2 @@ -32,6 +34,8 @@ #include "afcjk.c" #include "afindic.c" +#include "hbshim.c" + #include "afloader.c" #include "afmodule.c" Index: lib/3rdparty/freetype/src/autofit/hbshim.c =================================================================== --- lib/3rdparty/freetype/src/autofit/hbshim.c (revision 0) +++ lib/3rdparty/freetype/src/autofit/hbshim.c (working copy) @@ -0,0 +1,531 @@ +/***************************************************************************/ +/* */ +/* hbshim.c */ +/* */ +/* HarfBuzz interface for accessing OpenType features (body). */ +/* */ +/* Copyright 2013, 2014 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_FREETYPE_H +#include "afglobal.h" +#include "aftypes.h" +#include "hbshim.h" + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_afharfbuzz + + + /* + * We use `sets' (in the HarfBuzz sense, which comes quite near to the + * usual mathematical meaning) to manage both lookups and glyph indices. + * + * 1. For each coverage, collect lookup IDs in a set. Note that an + * auto-hinter `coverage' is represented by one `feature', and a + * feature consists of an arbitrary number of (font specific) `lookup's + * that actually do the mapping job. Please check the OpenType + * specification for more details on features and lookups. + * + * 2. Create glyph ID sets from the corresponding lookup sets. + * + * 3. The glyph set corresponding to AF_COVERAGE_DEFAULT is computed + * with all lookups specific to the OpenType script activated. It + * relies on the order of AF_DEFINE_STYLE_CLASS entries so that + * special coverages (like `oldstyle figures') don't get overwritten. + * + */ + + + /* load coverage tags */ +#undef COVERAGE +#define COVERAGE( name, NAME, description, \ + tag1, tag2, tag3, tag4 ) \ + static const hb_tag_t name ## _coverage[] = \ + { \ + HB_TAG( tag1, tag2, tag3, tag4 ), \ + HB_TAG_NONE \ + }; + + +#include "afcover.h" + + + /* define mapping between coverage tags and AF_Coverage */ +#undef COVERAGE +#define COVERAGE( name, NAME, description, \ + tag1, tag2, tag3, tag4 ) \ + name ## _coverage, + + + static const hb_tag_t* coverages[] = + { +#include "afcover.h" + + NULL /* AF_COVERAGE_DEFAULT */ + }; + + + /* load HarfBuzz script tags */ +#undef SCRIPT +#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) h, + + + static const hb_script_t scripts[] = + { +#include "afscript.h" + }; + + + FT_Error + af_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_Byte* gstyles ) + { + hb_face_t* face; + + hb_set_t* gsub_lookups; /* GSUB lookups for a given script */ + hb_set_t* gsub_glyphs; /* glyphs covered by GSUB lookups */ + hb_set_t* gpos_lookups; /* GPOS lookups for a given script */ + hb_set_t* gpos_glyphs; /* glyphs covered by GPOS lookups */ + + hb_script_t script; + const hb_tag_t* coverage_tags; + hb_tag_t script_tags[] = { HB_TAG_NONE, + HB_TAG_NONE, + HB_TAG_NONE, + HB_TAG_NONE }; + + hb_codepoint_t idx; +#ifdef FT_DEBUG_LEVEL_TRACE + int count; +#endif + + + if ( !globals || !style_class || !gstyles ) + return FT_THROW( Invalid_Argument ); + + face = hb_font_get_face( globals->hb_font ); + + gsub_lookups = hb_set_create(); + gsub_glyphs = hb_set_create(); + gpos_lookups = hb_set_create(); + gpos_glyphs = hb_set_create(); + + coverage_tags = coverages[style_class->coverage]; + script = scripts[style_class->script]; + + /* Convert a HarfBuzz script tag into the corresponding OpenType */ + /* tag or tags -- some Indic scripts like Devanagari have an old */ + /* and a new set of features. */ + hb_ot_tags_from_script( script, + &script_tags[0], + &script_tags[1] ); + + /* `hb_ot_tags_from_script' usually returns HB_OT_TAG_DEFAULT_SCRIPT */ + /* as the second tag. We change that to HB_TAG_NONE except for the */ + /* default script. */ + if ( style_class->script == globals->module->default_script && + style_class->coverage == AF_COVERAGE_DEFAULT ) + { + if ( script_tags[0] == HB_TAG_NONE ) + script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT; + else + { + if ( script_tags[1] == HB_TAG_NONE ) + script_tags[1] = HB_OT_TAG_DEFAULT_SCRIPT; + else if ( script_tags[1] != HB_OT_TAG_DEFAULT_SCRIPT ) + script_tags[2] = HB_OT_TAG_DEFAULT_SCRIPT; + } + } + else + { + if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT ) + script_tags[1] = HB_TAG_NONE; + } + + hb_ot_layout_collect_lookups( face, + HB_OT_TAG_GSUB, + script_tags, + NULL, + coverage_tags, + gsub_lookups ); + + if ( hb_set_is_empty( gsub_lookups ) ) + goto Exit; /* nothing to do */ + + hb_ot_layout_collect_lookups( face, + HB_OT_TAG_GPOS, + script_tags, + NULL, + coverage_tags, + gpos_lookups ); + + FT_TRACE4(( "GSUB lookups (style `%s'):\n" + " ", + af_style_names[style_class->style] )); + +#ifdef FT_DEBUG_LEVEL_TRACE + count = 0; +#endif + + for ( idx = -1; hb_set_next( gsub_lookups, &idx ); ) + { +#ifdef FT_DEBUG_LEVEL_TRACE + FT_TRACE4(( " %d", idx )); + count++; +#endif + + /* get output coverage of GSUB feature */ + hb_ot_layout_lookup_collect_glyphs( face, + HB_OT_TAG_GSUB, + idx, + NULL, + NULL, + NULL, + gsub_glyphs ); + } + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !count ) + FT_TRACE4(( " (none)" )); + FT_TRACE4(( "\n\n" )); +#endif + + FT_TRACE4(( "GPOS lookups (style `%s'):\n" + " ", + af_style_names[style_class->style] )); + +#ifdef FT_DEBUG_LEVEL_TRACE + count = 0; +#endif + + for ( idx = -1; hb_set_next( gpos_lookups, &idx ); ) + { +#ifdef FT_DEBUG_LEVEL_TRACE + FT_TRACE4(( " %d", idx )); + count++; +#endif + + /* get input coverage of GPOS feature */ + hb_ot_layout_lookup_collect_glyphs( face, + HB_OT_TAG_GPOS, + idx, + NULL, + gpos_glyphs, + NULL, + NULL ); + } + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !count ) + FT_TRACE4(( " (none)" )); + FT_TRACE4(( "\n\n" )); +#endif + + /* + * We now check whether we can construct blue zones, using glyphs + * covered by the feature only. In case there is not a single zone + * (this is, not a single character is covered), we skip this coverage. + * + */ + { + AF_Blue_Stringset bss = style_class->blue_stringset; + const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; + + FT_Bool found = 0; + + + for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) + { + const char* p = &af_blue_strings[bs->string]; + + + while ( *p ) + { + hb_codepoint_t ch; + + + GET_UTF8_CHAR( ch, p ); + + for ( idx = -1; hb_set_next( gsub_lookups, &idx ); ) + { + hb_codepoint_t gidx = FT_Get_Char_Index( globals->face, ch ); + + + if ( hb_ot_layout_lookup_would_substitute( face, idx, + &gidx, 1, 1 ) ) + { + found = 1; + break; + } + } + } + } + + if ( !found ) + { + FT_TRACE4(( " no blue characters found; style skipped\n" )); + goto Exit; + } + } + + /* + * Various OpenType features might use the same glyphs at different + * vertical positions; for example, superscript and subscript glyphs + * could be the same. However, the auto-hinter is completely + * agnostic of OpenType features after the feature analysis has been + * completed: The engine then simply receives a glyph index and returns a + * hinted and usually rendered glyph. + * + * Consider the superscript feature of font `pala.ttf': Some of the + * glyphs are `real', this is, they have a zero vertical offset, but + * most of them are small caps glyphs shifted up to the superscript + * position (this is, the `sups' feature is present in both the GSUB and + * GPOS tables). The code for blue zones computation actually uses a + * feature's y offset so that the `real' glyphs get correct hints. But + * later on it is impossible to decide whether a glyph index belongs to, + * say, the small caps or superscript feature. + * + * For this reason, we don't assign a style to a glyph if the current + * feature covers the glyph in both the GSUB and the GPOS tables. This + * is quite a broad condition, assuming that + * + * (a) glyphs that get used in multiple features are present in a + * feature without vertical shift, + * + * and + * + * (b) a feature's GPOS data really moves the glyph vertically. + * + * Not fulfilling condition (a) makes a font larger; it would also + * reduce the number of glyphs that could be addressed directly without + * using OpenType features, so this assumption is rather strong. + * + * Condition (b) is much weaker, and there might be glyphs which get + * missed. However, the OpenType features we are going to handle are + * primarily located in GSUB, and HarfBuzz doesn't provide an API to + * directly get the necessary information from the GPOS table. A + * possible solution might be to directly parse the GPOS table to find + * out whether a glyph gets shifted vertically, but this is something I + * would like to avoid if not really necessary. + * + */ + hb_set_subtract( gsub_glyphs, gpos_glyphs ); + +#ifdef FT_DEBUG_LEVEL_TRACE + FT_TRACE4(( " glyphs without GPOS data (`*' means already assigned)" )); + count = 0; +#endif + + for ( idx = -1; hb_set_next( gsub_glyphs, &idx ); ) + { +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !( count % 10 ) ) + FT_TRACE4(( "\n" + " " )); + + FT_TRACE4(( " %d", idx )); + count++; +#endif + + if ( gstyles[idx] == AF_STYLE_UNASSIGNED ) + gstyles[idx] = (FT_Byte)style_class->style; +#ifdef FT_DEBUG_LEVEL_TRACE + else + FT_TRACE4(( "*" )); +#endif + } + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !count ) + FT_TRACE4(( "\n" + " (none)" )); + FT_TRACE4(( "\n\n" )); +#endif + + Exit: + hb_set_destroy( gsub_lookups ); + hb_set_destroy( gsub_glyphs ); + hb_set_destroy( gpos_lookups ); + hb_set_destroy( gpos_glyphs ); + + return FT_Err_Ok; + } + + + /* construct HarfBuzz features */ +#undef COVERAGE +#define COVERAGE( name, NAME, description, \ + tag1, tag2, tag3, tag4 ) \ + static const hb_feature_t name ## _feature[] = \ + { \ + { \ + HB_TAG( tag1, tag2, tag3, tag4 ), \ + 1, 0, (unsigned int)-1 \ + } \ + }; + + +#include "afcover.h" + + + /* define mapping between HarfBuzz features and AF_Coverage */ +#undef COVERAGE +#define COVERAGE( name, NAME, description, \ + tag1, tag2, tag3, tag4 ) \ + name ## _feature, + + + static const hb_feature_t* features[] = + { +#include "afcover.h" + + NULL /* AF_COVERAGE_DEFAULT */ + }; + + + FT_Error + af_get_char_index( AF_StyleMetrics metrics, + FT_ULong charcode, + FT_ULong *codepoint, + FT_Long *y_offset ) + { + AF_StyleClass style_class; + + const hb_feature_t* feature; + + FT_ULong in_idx, out_idx; + + + if ( !metrics ) + return FT_THROW( Invalid_Argument ); + + in_idx = FT_Get_Char_Index( metrics->globals->face, charcode ); + + style_class = metrics->style_class; + + feature = features[style_class->coverage]; + + if ( feature ) + { + FT_UInt upem = metrics->globals->face->units_per_EM; + + hb_font_t* font = metrics->globals->hb_font; + hb_buffer_t* buf = hb_buffer_create(); + + uint32_t c = (uint32_t)charcode; + + hb_glyph_info_t* ginfo; + hb_glyph_position_t* gpos; + unsigned int gcount; + + + /* we shape at a size of units per EM; this means font units */ + hb_font_set_scale( font, upem, upem ); + + /* XXX: is this sufficient for a single character of any script? */ + hb_buffer_set_direction( buf, HB_DIRECTION_LTR ); + hb_buffer_set_script( buf, scripts[style_class->script] ); + + /* we add one character to `buf' ... */ + hb_buffer_add_utf32( buf, &c, 1, 0, 1 ); + + /* ... and apply one feature */ + hb_shape( font, buf, feature, 1 ); + + ginfo = hb_buffer_get_glyph_infos( buf, &gcount ); + gpos = hb_buffer_get_glyph_positions( buf, &gcount ); + + out_idx = ginfo[0].codepoint; + + /* getting the same index indicates no substitution, */ + /* which means that the glyph isn't available in the feature */ + if ( in_idx == out_idx ) + { + *codepoint = 0; + *y_offset = 0; + } + else + { + *codepoint = out_idx; + *y_offset = gpos[0].y_offset; + } + + hb_buffer_destroy( buf ); + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( gcount > 1 ) + FT_TRACE1(( "af_get_char_index:" + " input character mapped to multiple glyphs\n" )); +#endif + } + else + { + *codepoint = in_idx; + *y_offset = 0; + } + + return FT_Err_Ok; + } + + +#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + + + FT_Error + af_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_Byte* gstyles ) + { + FT_UNUSED( globals ); + FT_UNUSED( style_class ); + FT_UNUSED( gstyles ); + + return FT_Err_Ok; + } + + + FT_Error + af_get_char_index( AF_StyleMetrics metrics, + FT_ULong charcode, + FT_ULong *codepoint, + FT_Long *y_offset ) + { + FT_Face face; + + + if ( !metrics ) + return FT_THROW( Invalid_Argument ); + + face = metrics->globals->face; + + *codepoint = FT_Get_Char_Index( face, charcode ); + *y_offset = 0; + + return FT_Err_Ok; + } + + +#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + + +/* END */ Index: lib/3rdparty/freetype/src/autofit/hbshim.h =================================================================== --- lib/3rdparty/freetype/src/autofit/hbshim.h (revision 0) +++ lib/3rdparty/freetype/src/autofit/hbshim.h (working copy) @@ -0,0 +1,56 @@ +/***************************************************************************/ +/* */ +/* hbshim.h */ +/* */ +/* HarfBuzz interface for accessing OpenType features (specification). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __HBSHIM_H__ +#define __HBSHIM_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + + +#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ + +#include <hb.h> +#include <hb-ot.h> +#include <hb-ft.h> + +#endif + + +FT_BEGIN_HEADER + + FT_Error + af_get_coverage( AF_FaceGlobals globals, + AF_StyleClass style_class, + FT_Byte* gstyles ); + + FT_Error + af_get_char_index( AF_StyleMetrics metrics, + FT_ULong charcode, + FT_ULong *codepoint, + FT_Long *y_offset ); + + /* */ + +FT_END_HEADER + +#endif /* __HBSHIM_H__ */ + + +/* END */ Index: lib/3rdparty/freetype/src/autofit/rules.mk =================================================================== --- lib/3rdparty/freetype/src/autofit/rules.mk (revision 62563) +++ lib/3rdparty/freetype/src/autofit/rules.mk (working copy) @@ -36,13 +36,17 @@ $(AUTOF_DIR)/afloader.c \ $(AUTOF_DIR)/afmodule.c \ $(AUTOF_DIR)/afpic.c \ - $(AUTOF_DIR)/afwarp.c + $(AUTOF_DIR)/afranges.c \ + $(AUTOF_DIR)/afwarp.c \ + $(AUTOF_DIR)/hbshim.c # AUTOF driver headers # AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \ + $(AUTOF_DIR)/afcover.h \ $(AUTOF_DIR)/aferrors.h \ $(AUTOF_DIR)/afscript.h \ + $(AUTOF_DIR)/afstyles.h \ $(AUTOF_DIR)/aftypes.h \ $(AUTOF_DIR)/afwrtsys.h Index: lib/3rdparty/freetype/src/base/basepic.c =================================================================== --- lib/3rdparty/freetype/src/base/basepic.c (revision 62563) +++ lib/3rdparty/freetype/src/base/basepic.c (working copy) @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for base. */ /* */ -/* Copyright 2009, 2012 by */ +/* Copyright 2009, 2012, 2013 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -35,7 +35,7 @@ /* forward declaration of PIC init function from ftrfork.c */ /* (not modularized) */ void - FT_Init_Table_raccess_guess_table( ft_raccess_guess_rec* record ); + FT_Init_Table_ft_raccess_guess_table( ft_raccess_guess_rec* record ); #endif /* forward declaration of PIC init functions from ftinit.c */ @@ -92,7 +92,7 @@ FT_Init_Class_ft_bitmap_glyph_class( &container->ft_bitmap_glyph_class ); #ifdef FT_CONFIG_OPTION_MAC_FONTS - FT_Init_Table_raccess_guess_table( + FT_Init_Table_ft_raccess_guess_table( (ft_raccess_guess_rec*)&container->ft_raccess_guess_table ); #endif Index: lib/3rdparty/freetype/src/base/ftbitmap.c =================================================================== --- lib/3rdparty/freetype/src/base/ftbitmap.c (revision 62563) +++ lib/3rdparty/freetype/src/base/ftbitmap.c (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType utility functions for bitmaps (body). */ /* */ -/* Copyright 2004-2009, 2011, 2013 by */ +/* Copyright 2004-2009, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -375,7 +375,7 @@ } - FT_Byte + static FT_Byte ft_gray_for_premultiplied_srgb_bgra( const FT_Byte* bgra ) { FT_Long a = bgra[3]; @@ -519,15 +519,15 @@ { FT_Int val = ss[0]; /* avoid a byte->int cast on each line */ - tt[0] = (FT_Byte)( ( val & 0x80 ) ? 0xff : 0); - tt[1] = (FT_Byte)( ( val & 0x40 ) ? 0xff : 0); - tt[2] = (FT_Byte)( ( val & 0x20 ) ? 0xff : 0); - tt[3] = (FT_Byte)( ( val & 0x10 ) ? 0xff : 0); - tt[4] = (FT_Byte)( ( val & 0x08 ) ? 0xff : 0); - tt[5] = (FT_Byte)( ( val & 0x04 ) ? 0xff : 0); - tt[6] = (FT_Byte)( ( val & 0x02 ) ? 0xff : 0); - tt[7] = (FT_Byte)( ( val & 0x01 ) ? 0xff : 0); + tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7 ); + tt[1] = (FT_Byte)( ( val & 0x40 ) >> 6 ); + tt[2] = (FT_Byte)( ( val & 0x20 ) >> 5 ); + tt[3] = (FT_Byte)( ( val & 0x10 ) >> 4 ); + tt[4] = (FT_Byte)( ( val & 0x08 ) >> 3 ); + tt[5] = (FT_Byte)( ( val & 0x04 ) >> 2 ); + tt[6] = (FT_Byte)( ( val & 0x02 ) >> 1 ); + tt[7] = (FT_Byte)( val & 0x01 ); tt += 8; ss += 1; @@ -542,7 +542,7 @@ for ( ; j > 0; j-- ) { - tt[0] = (FT_Byte)( ( val & 0x80 ) ? 0xff : 0); + tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7); val <<= 1; tt += 1; } Index: lib/3rdparty/freetype/src/base/ftcalc.c =================================================================== --- lib/3rdparty/freetype/src/base/ftcalc.c (revision 62563) +++ lib/3rdparty/freetype/src/base/ftcalc.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Arithmetic computations (body). */ /* */ -/* Copyright 1996-2006, 2008, 2012-2013 by */ +/* Copyright 1996-2006, 2008, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -128,7 +128,7 @@ } if ( z >= ( 1L << 1 ) ) { - z >>= 1; + /* z >>= 1; */ shift += 1; } Index: lib/3rdparty/freetype/src/base/ftobjs.c =================================================================== --- lib/3rdparty/freetype/src/base/ftobjs.c (revision 62563) +++ lib/3rdparty/freetype/src/base/ftobjs.c (working copy) @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1801,9 +1801,10 @@ if ( error ) return error; + /* POST resources must be sorted to concatenate properly */ error = FT_Raccess_Get_DataOffsets( library, stream, map_offset, rdara_pos, - TTAG_POST, + TTAG_POST, TRUE, &data_offsets, &count ); if ( !error ) { @@ -1816,9 +1817,11 @@ return error; } + /* sfnt resources should not be sorted to preserve the face order by + QuickDraw API */ error = FT_Raccess_Get_DataOffsets( library, stream, map_offset, rdara_pos, - TTAG_sfnt, + TTAG_sfnt, FALSE, &data_offsets, &count ); if ( !error ) { @@ -3357,6 +3360,7 @@ FT_UInt gindex = 0; + /* only do something if we have a charmap, and we have glyphs at all */ if ( face && face->charmap && face->num_glyphs ) { gindex = FT_Get_Char_Index( face, 0 ); @@ -3943,11 +3947,17 @@ static void ft_remove_renderer( FT_Module module ) { - FT_Library library = module->library; - FT_Memory memory = library->memory; + FT_Library library; + FT_Memory memory; FT_ListNode node; + library = module->library; + if ( !library ) + return; + + memory = library->memory; + node = FT_List_Find( &library->renderers, module ); if ( node ) { @@ -4463,7 +4473,7 @@ } - FT_Error + static FT_Error ft_property_do( FT_Library library, const FT_String* module_name, const FT_String* property_name, Index: lib/3rdparty/freetype/src/base/ftoutln.c =================================================================== --- lib/3rdparty/freetype/src/base/ftoutln.c (revision 62563) +++ lib/3rdparty/freetype/src/base/ftoutln.c (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType outline management (body). */ /* */ -/* Copyright 1996-2008, 2010, 2012-2013 by */ +/* Copyright 1996-2008, 2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -128,7 +128,7 @@ v_start.x = ( v_start.x + v_last.x ) / 2; v_start.y = ( v_start.y + v_last.y ) / 2; - v_last = v_start; + /* v_last = v_start; */ } point--; tags--; Index: lib/3rdparty/freetype/src/base/ftrfork.c =================================================================== --- lib/3rdparty/freetype/src/base/ftrfork.c (revision 62563) +++ lib/3rdparty/freetype/src/base/ftrfork.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Embedded resource forks accessor (body). */ /* */ -/* Copyright 2004-2010, 2013 by */ +/* Copyright 2004-2010, 2013, 2014 by */ /* Masatake YAMATO and Redhat K.K. */ /* */ /* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */ @@ -29,6 +29,7 @@ #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_RFORK_H #include "basepic.h" +#include "ftbase.h" #undef FT_COMPONENT #define FT_COMPONENT trace_raccess @@ -151,6 +152,7 @@ FT_Long map_offset, FT_Long rdata_pos, FT_Long tag, + FT_Bool sort_by_res_id, FT_Long **offsets, FT_Long *count ) { @@ -163,6 +165,7 @@ FT_RFork_Ref *ref = NULL; + FT_TRACE3(( "\n" )); error = FT_Stream_Seek( stream, map_offset ); if ( error ) return error; @@ -183,6 +186,8 @@ (char)( 0xff & ( tag_internal >> 16 ) ), (char)( 0xff & ( tag_internal >> 8 ) ), (char)( 0xff & ( tag_internal >> 0 ) ) )); + FT_TRACE3(( " : subcount=%d, suboffset=0x%04x\n", + subcnt, rpos )); if ( tag_internal == tag ) { @@ -208,12 +213,25 @@ goto Exit; ref[j].offset = temp & 0xFFFFFFL; + FT_TRACE3(( " [%d]:" + " resource_id=0x%04x, offset=0x%08x\n", + j, ref[j].res_id, ref[j].offset )); } - ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ), - ( int(*)(const void*, const void*) ) - ft_raccess_sort_ref_by_id ); + if (sort_by_res_id) + { + ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ), + ( int(*)(const void*, const void*) ) + ft_raccess_sort_ref_by_id ); + FT_TRACE3(( " -- sort resources by their ids --\n" )); + for ( j = 0; j < *count; ++ j ) { + FT_TRACE3(( " [%d]:" + " resource_id=0x%04x, offset=0x%08x\n", + j, ref[j].res_id, ref[j].offset )); + } + } + if ( FT_NEW_ARRAY( offsets_internal, *count ) ) goto Exit; Index: lib/3rdparty/freetype/src/base/rules.mk =================================================================== --- lib/3rdparty/freetype/src/base/rules.mk (revision 62563) +++ lib/3rdparty/freetype/src/base/rules.mk (working copy) @@ -33,12 +33,14 @@ # All files listed here should be included in `ftbase.c' (for a `single' # build). # -BASE_SRC := $(BASE_DIR)/ftadvanc.c \ +BASE_SRC := $(BASE_DIR)/basepic.c \ + $(BASE_DIR)/ftadvanc.c \ $(BASE_DIR)/ftcalc.c \ $(BASE_DIR)/ftdbgmem.c \ $(BASE_DIR)/ftgloadr.c \ $(BASE_DIR)/ftobjs.c \ $(BASE_DIR)/ftoutln.c \ + $(BASE_DIR)/ftpic.c \ $(BASE_DIR)/ftrfork.c \ $(BASE_DIR)/ftsnames.c \ $(BASE_DIR)/ftstream.c \ @@ -51,8 +53,9 @@ endif # for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h') -BASE_H := $(BASE_DIR)/ftbase.h \ - $(BASE_DIR)/md5.c \ +BASE_H := $(BASE_DIR)/basepic.h \ + $(BASE_DIR)/ftbase.h \ + $(BASE_DIR)/md5.c \ $(BASE_DIR)/md5.h # Base layer `extensions' sources Index: lib/3rdparty/freetype/src/bdf/bdfdrivr.c =================================================================== --- lib/3rdparty/freetype/src/bdf/bdfdrivr.c (revision 62563) +++ lib/3rdparty/freetype/src/bdf/bdfdrivr.c (working copy) @@ -2,7 +2,7 @@ FreeType font driver for bdf files - Copyright (C) 2001-2008, 2011, 2013 by + Copyright (C) 2001-2008, 2011, 2013, 2014 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -243,8 +243,6 @@ !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) ) strings[0] = (char *)(prop->value.atom); - len = 0; - for ( len = 0, nn = 0; nn < 4; nn++ ) { lengths[nn] = 0; @@ -400,10 +398,11 @@ bdfface->num_faces = 1; bdfface->face_index = 0; - bdfface->face_flags = FT_FACE_FLAG_FIXED_SIZES | - FT_FACE_FLAG_HORIZONTAL | - FT_FACE_FLAG_FAST_GLYPHS; + bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_FAST_GLYPHS; + prop = bdf_get_font_property( font, "SPACING" ); if ( prop && prop->format == BDF_ATOM && prop->value.atom && Index: lib/3rdparty/freetype/src/bdf/bdflib.c =================================================================== --- lib/3rdparty/freetype/src/bdf/bdflib.c (revision 62563) +++ lib/3rdparty/freetype/src/bdf/bdflib.c (working copy) @@ -1,6 +1,6 @@ /* * Copyright 2000 Computing Research Labs, New Mexico State University - * Copyright 2001-2013 + * Copyright 2001-2014 * Francesco Zappa Nardelli * * Permission is hereby granted, free of charge, to any person obtaining a @@ -691,7 +691,6 @@ lineno = 1; buf[0] = 0; start = 0; - end = 0; avail = 0; cursor = 0; refill = 1; @@ -1409,7 +1408,7 @@ /* If the property happens to be a comment, then it doesn't need */ /* to be added to the internal hash table. */ - if ( ft_memcmp( name, "COMMENT", 7 ) != 0 ) + if ( ft_strncmp( name, "COMMENT", 7 ) != 0 ) { /* Add the property to the font property table. */ error = hash_insert( fp->name, @@ -1427,13 +1426,13 @@ /* FONT_ASCENT and FONT_DESCENT need to be assigned if they are */ /* present, and the SPACING property should override the default */ /* spacing. */ - if ( ft_memcmp( name, "DEFAULT_CHAR", 12 ) == 0 ) + if ( ft_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 ) font->default_char = fp->value.l; - else if ( ft_memcmp( name, "FONT_ASCENT", 11 ) == 0 ) + else if ( ft_strncmp( name, "FONT_ASCENT", 11 ) == 0 ) font->font_ascent = fp->value.l; - else if ( ft_memcmp( name, "FONT_DESCENT", 12 ) == 0 ) + else if ( ft_strncmp( name, "FONT_DESCENT", 12 ) == 0 ) font->font_descent = fp->value.l; - else if ( ft_memcmp( name, "SPACING", 7 ) == 0 ) + else if ( ft_strncmp( name, "SPACING", 7 ) == 0 ) { if ( !fp->value.atom ) { @@ -1491,7 +1490,7 @@ memory = font->memory; /* Check for a comment. */ - if ( ft_memcmp( line, "COMMENT", 7 ) == 0 ) + if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) { linelen -= 7; @@ -1508,7 +1507,7 @@ /* The very first thing expected is the number of glyphs. */ if ( !( p->flags & _BDF_GLYPHS ) ) { - if ( ft_memcmp( line, "CHARS", 5 ) != 0 ) + if ( ft_strncmp( line, "CHARS", 5 ) != 0 ) { FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "CHARS" )); error = FT_THROW( Missing_Chars_Field ); @@ -1542,7 +1541,7 @@ } /* Check for the ENDFONT field. */ - if ( ft_memcmp( line, "ENDFONT", 7 ) == 0 ) + if ( ft_strncmp( line, "ENDFONT", 7 ) == 0 ) { /* Sort the glyphs by encoding. */ ft_qsort( (char *)font->glyphs, @@ -1556,7 +1555,7 @@ } /* Check for the ENDCHAR field. */ - if ( ft_memcmp( line, "ENDCHAR", 7 ) == 0 ) + if ( ft_strncmp( line, "ENDCHAR", 7 ) == 0 ) { p->glyph_enc = 0; p->flags &= ~_BDF_GLYPH_BITS; @@ -1572,7 +1571,7 @@ goto Exit; /* Check for the STARTCHAR field. */ - if ( ft_memcmp( line, "STARTCHAR", 9 ) == 0 ) + if ( ft_strncmp( line, "STARTCHAR", 9 ) == 0 ) { /* Set the character name in the parse info first until the */ /* encoding can be checked for an unencoded character. */ @@ -1606,7 +1605,7 @@ } /* Check for the ENCODING field. */ - if ( ft_memcmp( line, "ENCODING", 8 ) == 0 ) + if ( ft_strncmp( line, "ENCODING", 8 ) == 0 ) { if ( !( p->flags & _BDF_GLYPH ) ) { @@ -1792,7 +1791,7 @@ } /* Expect the SWIDTH (scalable width) field next. */ - if ( ft_memcmp( line, "SWIDTH", 6 ) == 0 ) + if ( ft_strncmp( line, "SWIDTH", 6 ) == 0 ) { if ( !( p->flags & _BDF_ENCODING ) ) goto Missing_Encoding; @@ -1808,7 +1807,7 @@ } /* Expect the DWIDTH (scalable width) field next. */ - if ( ft_memcmp( line, "DWIDTH", 6 ) == 0 ) + if ( ft_strncmp( line, "DWIDTH", 6 ) == 0 ) { if ( !( p->flags & _BDF_ENCODING ) ) goto Missing_Encoding; @@ -1836,7 +1835,7 @@ } /* Expect the BBX field next. */ - if ( ft_memcmp( line, "BBX", 3 ) == 0 ) + if ( ft_strncmp( line, "BBX", 3 ) == 0 ) { if ( !( p->flags & _BDF_ENCODING ) ) goto Missing_Encoding; @@ -1904,7 +1903,7 @@ } /* And finally, gather up the bitmap. */ - if ( ft_memcmp( line, "BITMAP", 6 ) == 0 ) + if ( ft_strncmp( line, "BITMAP", 6 ) == 0 ) { unsigned long bitmap_size; @@ -1979,7 +1978,7 @@ p = (_bdf_parse_t *) client_data; /* Check for the end of the properties. */ - if ( ft_memcmp( line, "ENDPROPERTIES", 13 ) == 0 ) + if ( ft_strncmp( line, "ENDPROPERTIES", 13 ) == 0 ) { /* If the FONT_ASCENT or FONT_DESCENT properties have not been */ /* encountered yet, then make sure they are added as properties and */ @@ -2020,12 +2019,12 @@ } /* Ignore the _XFREE86_GLYPH_RANGES properties. */ - if ( ft_memcmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 ) + if ( ft_strncmp( line, "_XFREE86_GLYPH_RANGES", 21 ) == 0 ) goto Exit; /* Handle COMMENT fields and properties in a special way to preserve */ /* the spacing. */ - if ( ft_memcmp( line, "COMMENT", 7 ) == 0 ) + if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) { name = value = line; value += 7; @@ -2089,7 +2088,7 @@ /* Check for a comment. This is done to handle those fonts that have */ /* comments before the STARTFONT line for some reason. */ - if ( ft_memcmp( line, "COMMENT", 7 ) == 0 ) + if ( ft_strncmp( line, "COMMENT", 7 ) == 0 ) { if ( p->opts->keep_comments != 0 && p->font != 0 ) { @@ -2115,7 +2114,7 @@ { memory = p->memory; - if ( ft_memcmp( line, "STARTFONT", 9 ) != 0 ) + if ( ft_strncmp( line, "STARTFONT", 9 ) != 0 ) { /* we don't emit an error message since this code gets */ /* explicitly caught one level higher */ @@ -2163,7 +2162,7 @@ } /* Check for the start of the properties. */ - if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 ) + if ( ft_strncmp( line, "STARTPROPERTIES", 15 ) == 0 ) { if ( !( p->flags & _BDF_FONT_BBX ) ) { @@ -2192,7 +2191,7 @@ } /* Check for the FONTBOUNDINGBOX field. */ - if ( ft_memcmp( line, "FONTBOUNDINGBOX", 15 ) == 0 ) + if ( ft_strncmp( line, "FONTBOUNDINGBOX", 15 ) == 0 ) { if ( !( p->flags & _BDF_SIZE ) ) { @@ -2223,7 +2222,7 @@ } /* The next thing to check for is the FONT field. */ - if ( ft_memcmp( line, "FONT", 4 ) == 0 ) + if ( ft_strncmp( line, "FONT", 4 ) == 0 ) { error = _bdf_list_split( &p->list, (char *)" +", line, linelen ); if ( error ) @@ -2258,7 +2257,7 @@ } /* Check for the SIZE field. */ - if ( ft_memcmp( line, "SIZE", 4 ) == 0 ) + if ( ft_strncmp( line, "SIZE", 4 ) == 0 ) { if ( !( p->flags & _BDF_FONT_NAME ) ) { @@ -2312,7 +2311,7 @@ } /* Check for the CHARS field -- font properties are optional */ - if ( ft_memcmp( line, "CHARS", 5 ) == 0 ) + if ( ft_strncmp( line, "CHARS", 5 ) == 0 ) { char nbuf[128]; @@ -2376,8 +2375,8 @@ unsigned long lineno = 0; /* make compiler happy */ _bdf_parse_t *p = NULL; - FT_Memory memory = extmemory; - FT_Error error = FT_Err_Ok; + FT_Memory memory = extmemory; /* needed for FT_NEW */ + FT_Error error = FT_Err_Ok; if ( FT_NEW( p ) ) @@ -2399,7 +2398,6 @@ { /* If the font is not proportional, set the font's monowidth */ /* field to the width of the font bounding box. */ - memory = p->font->memory; if ( p->font->spacing != BDF_PROPORTIONAL ) p->font->monowidth = p->font->bbx.width; Index: lib/3rdparty/freetype/src/cff/cf2blues.c =================================================================== --- lib/3rdparty/freetype/src/cff/cf2blues.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cf2blues.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Adobe's code for handling Blue Zones (body). */ /* */ -/* Copyright 2009-2013 Adobe Systems Incorporated. */ +/* Copyright 2009-2014 Adobe Systems Incorporated. */ /* */ /* This software, and all works of authorship, whether in source or */ /* object code form as indicated by the copyright notice(s) included */ @@ -408,11 +408,10 @@ /* Note: constant changed from 0.5 to 0.6 to avoid a problem with */ /* 10ppem Arial */ - blues->boost = FT_MulFix( - cf2_floatToFixed( .6 ), - ( cf2_intToFixed( 1 ) - - FT_DivFix( blues->scale, - blues->blueScale ) ) ); + blues->boost = cf2_floatToFixed( .6 ) - + FT_MulDiv( cf2_floatToFixed ( .6 ), + blues->scale, + blues->blueScale ); if ( blues->boost > 0x7FFF ) { /* boost must remain less than 0.5, or baseline could go negative */ Index: lib/3rdparty/freetype/src/cff/cf2font.c =================================================================== --- lib/3rdparty/freetype/src/cff/cf2font.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cf2font.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Adobe's code for font instances (body). */ /* */ -/* Copyright 2007-2013 Adobe Systems Incorporated. */ +/* Copyright 2007-2014 Adobe Systems Incorporated. */ /* */ /* This software, and all works of authorship, whether in source or */ /* object code form as indicated by the copyright notice(s) included */ @@ -167,7 +167,7 @@ if ( !xdelta ) goto Try_x3; - *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) + FT_DivFix( cf2_intToFixed( y1 ), ppem ); } @@ -184,7 +184,7 @@ if ( !xdelta ) goto Try_x4; - *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) + FT_DivFix( cf2_intToFixed( y2 ), ppem ); } } @@ -202,7 +202,7 @@ if ( !xdelta ) goto Use_y4; - *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) + FT_DivFix( cf2_intToFixed( y3 ), ppem ); } } @@ -233,13 +233,14 @@ /* pointer to parsed font object */ CFF_Decoder* decoder = font->decoder; - FT_Bool needExtraSetup; + FT_Bool needExtraSetup = FALSE; /* character space units */ CF2_Fixed boldenX = font->syntheticEmboldeningAmountX; CF2_Fixed boldenY = font->syntheticEmboldeningAmountY; - CF2_Fixed ppem; + CFF_SubFont subFont; + CF2_Fixed ppem; /* clear previous error */ @@ -247,8 +248,12 @@ /* if a CID fontDict has changed, we need to recompute some cached */ /* data */ - needExtraSetup = - (FT_Bool)( font->lastSubfont != cf2_getSubfont( decoder ) ); + subFont = cf2_getSubfont( decoder ); + if ( font->lastSubfont != subFont ) + { + font->lastSubfont = subFont; + needExtraSetup = TRUE; + } /* if ppem has changed, we need to recompute some cached data */ /* note: because of CID font matrix concatenation, ppem and transform */ Index: lib/3rdparty/freetype/src/cff/cf2ft.c =================================================================== --- lib/3rdparty/freetype/src/cff/cf2ft.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cf2ft.c (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType Glue Component to Adobe's Interpreter (body). */ /* */ -/* Copyright 2013 Adobe Systems Incorporated. */ +/* Copyright 2013-2014 Adobe Systems Incorporated. */ /* */ /* This software, and all works of authorship, whether in source or */ /* object code form as indicated by the copyright notice(s) included */ @@ -61,7 +61,9 @@ FT_ASSERT( unitsPerEm > 0 ); - FT_ASSERT( transform->a > 0 && transform->d > 0 ); + if ( transform->a <= 0 || transform->d <= 0 ) + return FT_THROW( Invalid_Size_Handle ); + FT_ASSERT( transform->b == 0 && transform->c == 0 ); FT_ASSERT( transform->tx == 0 && transform->ty == 0 ); @@ -236,10 +238,8 @@ if ( *hinted ) { - *x_scale = FT_DivFix( decoder->builder.glyph->x_scale, - cf2_intToFixed( 64 ) ); - *y_scale = FT_DivFix( decoder->builder.glyph->y_scale, - cf2_intToFixed( 64 ) ); + *x_scale = ( decoder->builder.glyph->x_scale + 32 ) / 64; + *y_scale = ( decoder->builder.glyph->y_scale + 32 ) / 64; } else { @@ -357,9 +357,12 @@ /* also get units per em to validate scale */ font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder ); - error2 = cf2_checkTransform( &transform, font->unitsPerEm ); - if ( error2 ) - return error2; + if ( scaled ) + { + error2 = cf2_checkTransform( &transform, font->unitsPerEm ); + if ( error2 ) + return error2; + } error2 = cf2_getGlyphOutline( font, &buf, &transform, &glyphWidth ); if ( error2 ) @@ -389,8 +392,16 @@ FT_ASSERT( decoder && decoder->builder.face && decoder->builder.face->root.size ); - FT_ASSERT( decoder->builder.face->root.size->metrics.y_ppem ); + /* + * Note that `y_ppem' can be zero if there wasn't a call to + * `FT_Set_Char_Size' or something similar. However, this isn't a + * problem since we come to this place in the code only if + * FT_LOAD_NO_SCALE is set (the other case gets caught by + * `cf2_checkTransform'). The ppem value is needed to compute the stem + * darkening, which is disabled for getting the unscaled outline. + * + */ return cf2_intToFixed( decoder->builder.face->root.size->metrics.y_ppem ); } @@ -508,7 +519,7 @@ CF2_UInt idx, CF2_Buffer buf ) { - FT_ASSERT( decoder && decoder->globals ); + FT_ASSERT( decoder ); FT_ZERO( buf ); @@ -516,6 +527,8 @@ if ( idx >= decoder->num_globals ) return TRUE; /* error */ + FT_ASSERT( decoder->globals ); + buf->start = buf->ptr = decoder->globals[idx]; buf->end = decoder->globals[idx + 1]; @@ -581,7 +594,7 @@ CF2_UInt idx, CF2_Buffer buf ) { - FT_ASSERT( decoder && decoder->locals ); + FT_ASSERT( decoder ); FT_ZERO( buf ); @@ -589,6 +602,8 @@ if ( idx >= decoder->num_locals ) return TRUE; /* error */ + FT_ASSERT( decoder->locals ); + buf->start = buf->ptr = decoder->locals[idx]; buf->end = decoder->locals[idx + 1]; Index: lib/3rdparty/freetype/src/cff/cf2hints.c =================================================================== --- lib/3rdparty/freetype/src/cff/cf2hints.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cf2hints.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Adobe's code for handling CFF hints (body). */ /* */ -/* Copyright 2007-2013 Adobe Systems Incorporated. */ +/* Copyright 2007-2014 Adobe Systems Incorporated. */ /* */ /* This software, and all works of authorship, whether in source or */ /* object code form as indicated by the copyright notice(s) included */ @@ -781,6 +781,8 @@ cf2_hintmask_setAll( hintMask, cf2_arrstack_size( hStemHintArray ) + cf2_arrstack_size( vStemHintArray ) ); + if ( !cf2_hintmask_isValid( hintMask ) ) + return; /* too many stem hints */ } /* begin by clearing the map */ Index: lib/3rdparty/freetype/src/cff/cffload.c =================================================================== --- lib/3rdparty/freetype/src/cff/cffload.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cffload.c (working copy) @@ -4,7 +4,7 @@ /* */ /* OpenType and CFF data/program tables loader (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -689,6 +689,13 @@ if ( FT_READ_USHORT( num_ranges ) ) goto Exit; + if ( !num_ranges ) + { + FT_TRACE0(( "CFF_Load_FD_Select: empty FDSelect array\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + fdselect->data_size = num_ranges * 3 + 2; Load_Data: @@ -719,7 +726,7 @@ break; case 3: - /* first, compare to cache */ + /* first, compare to the cache */ if ( (FT_UInt)( glyph_index - fdselect->cache_first ) < fdselect->cache_count ) { @@ -727,7 +734,7 @@ break; } - /* then, lookup the ranges array */ + /* then, look up the ranges array */ { FT_Byte* p = fdselect->data; FT_Byte* p_limit = p + fdselect->data_size; @@ -750,7 +757,7 @@ /* update cache */ fdselect->cache_first = first; - fdselect->cache_count = limit-first; + fdselect->cache_count = limit - first; fdselect->cache_fd = fd2; break; } Index: lib/3rdparty/freetype/src/cff/cffobjs.c =================================================================== --- lib/3rdparty/freetype/src/cff/cffobjs.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cffobjs.c (working copy) @@ -866,7 +866,7 @@ flags |= FT_FACE_FLAG_KERNING; #endif - cffface->face_flags = flags; + cffface->face_flags |= flags; /*******************************************************************/ /* */ Index: lib/3rdparty/freetype/src/cff/cffparse.c =================================================================== --- lib/3rdparty/freetype/src/cff/cffparse.c (revision 62563) +++ lib/3rdparty/freetype/src/cff/cffparse.c (working copy) @@ -4,7 +4,7 @@ /* */ /* CFF token stream parser (body) */ /* */ -/* Copyright 1996-2004, 2007-2013 by */ +/* Copyright 1996-2004, 2007-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -66,7 +66,6 @@ goto Bad; val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] ); - p += 2; } else if ( v == 29 ) { @@ -77,7 +76,6 @@ ( (FT_ULong)p[1] << 16 ) | ( (FT_ULong)p[2] << 8 ) | (FT_ULong)p[3] ); - p += 4; } else if ( v < 247 ) { @@ -89,7 +87,6 @@ goto Bad; val = ( v - 247 ) * 256 + p[0] + 108; - p++; } else { @@ -97,7 +94,6 @@ goto Bad; val = -( v - 251 ) * 256 - p[0] - 108; - p++; } Exit: Index: lib/3rdparty/freetype/src/cid/cidload.c =================================================================== --- lib/3rdparty/freetype/src/cid/cidload.c (revision 62563) +++ lib/3rdparty/freetype/src/cid/cidload.c (working copy) @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 font loader (body). */ /* */ -/* Copyright 1996-2006, 2009, 2011-2013 by */ +/* Copyright 1996-2006, 2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -160,6 +160,7 @@ { FT_Matrix* matrix; FT_Vector* offset; + FT_Int result; dict = face->cid.font_dicts + parser->num_dict; @@ -166,10 +167,19 @@ matrix = &dict->font_matrix; offset = &dict->font_offset; - (void)cid_parser_to_fixed_array( parser, 6, temp, 3 ); + result = cid_parser_to_fixed_array( parser, 6, temp, 3 ); + if ( result < 6 ) + return FT_THROW( Invalid_File_Format ); + temp_scale = FT_ABS( temp[3] ); + if ( temp_scale == 0 ) + { + FT_ERROR(( "cid_parse_font_matrix: invalid font matrix\n" )); + return FT_THROW( Invalid_File_Format ); + } + /* Set Units per EM based on FontMatrix values. We set the value to */ /* 1000 / temp_scale, because temp_scale was already multiplied by */ /* 1000 (in t1_tofixed, from psobjs.c). */ @@ -184,7 +194,7 @@ temp[2] = FT_DivFix( temp[2], temp_scale ); temp[4] = FT_DivFix( temp[4], temp_scale ); temp[5] = FT_DivFix( temp[5], temp_scale ); - temp[3] = 0x10000L; + temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L; } matrix->xx = temp[0]; @@ -197,8 +207,7 @@ offset->y = temp[5] >> 16; } - return FT_Err_Ok; /* this is a callback function; */ - /* we must return an error code */ + return FT_Err_Ok; } Index: lib/3rdparty/freetype/src/cid/cidobjs.c =================================================================== --- lib/3rdparty/freetype/src/cid/cidobjs.c (revision 62563) +++ lib/3rdparty/freetype/src/cid/cidobjs.c (working copy) @@ -355,10 +355,11 @@ cidface->num_charmaps = 0; cidface->face_index = face_index; - cidface->face_flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */ - FT_FACE_FLAG_HORIZONTAL | /* horizontal data */ - FT_FACE_FLAG_HINTER; /* has native hinter */ + cidface->face_flags |= FT_FACE_FLAG_SCALABLE | /* scalable outlines */ + FT_FACE_FLAG_HORIZONTAL | /* horizontal data */ + FT_FACE_FLAG_HINTER; /* has native hinter */ + if ( info->is_fixed_pitch ) cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; Index: lib/3rdparty/freetype/src/cid/cidparse.c =================================================================== --- lib/3rdparty/freetype/src/cid/cidparse.c (revision 62563) +++ lib/3rdparty/freetype/src/cid/cidparse.c (working copy) @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 parser (body). */ /* */ -/* Copyright 1996-2007, 2009, 2013 by */ +/* Copyright 1996-2007, 2009, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -178,8 +178,6 @@ if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 ) parser->binary_length = ft_atol( (const char *)arg2 ); - limit = parser->root.limit; - cur = parser->root.cursor; goto Exit; } else if ( cur[1] == 's' && ft_strncmp( (char*)cur, "/sfnts", 6 ) == 0 ) Index: lib/3rdparty/freetype/src/cid/cidparse.h =================================================================== --- lib/3rdparty/freetype/src/cid/cidparse.h (revision 62563) +++ lib/3rdparty/freetype/src/cid/cidparse.h (working copy) @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 parser (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2004, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -92,26 +92,26 @@ /* */ /*************************************************************************/ -#define cid_parser_skip_spaces( p ) \ +#define cid_parser_skip_spaces( p ) \ (p)->root.funcs.skip_spaces( &(p)->root ) -#define cid_parser_skip_PS_token( p ) \ +#define cid_parser_skip_PS_token( p ) \ (p)->root.funcs.skip_PS_token( &(p)->root ) -#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) -#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) +#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) +#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) -#define cid_parser_to_coord_array( p, m, c ) \ +#define cid_parser_to_coord_array( p, m, c ) \ (p)->root.funcs.to_coord_array( &(p)->root, m, c ) -#define cid_parser_to_fixed_array( p, m, f, t ) \ +#define cid_parser_to_fixed_array( p, m, f, t ) \ (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) -#define cid_parser_to_token( p, t ) \ +#define cid_parser_to_token( p, t ) \ (p)->root.funcs.to_token( &(p)->root, t ) -#define cid_parser_to_token_array( p, t, m, c ) \ +#define cid_parser_to_token_array( p, t, m, c ) \ (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) -#define cid_parser_load_field( p, f, o ) \ +#define cid_parser_load_field( p, f, o ) \ (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 ) -#define cid_parser_load_field_table( p, f, o ) \ +#define cid_parser_load_field_table( p, f, o ) \ (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 ) Index: lib/3rdparty/freetype/src/pcf/pcfread.c =================================================================== --- lib/3rdparty/freetype/src/pcf/pcfread.c (revision 62563) +++ lib/3rdparty/freetype/src/pcf/pcfread.c (working copy) @@ -1153,10 +1153,11 @@ 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; + root->face_flags |= FT_FACE_FLAG_FIXED_SIZES | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_FAST_GLYPHS; + if ( face->accel.constantWidth ) root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; Index: lib/3rdparty/freetype/src/pfr/pfrload.c =================================================================== --- lib/3rdparty/freetype/src/pfr/pfrload.c (revision 62563) +++ lib/3rdparty/freetype/src/pfr/pfrload.c (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType PFR loader (body). */ /* */ -/* Copyright 2002-2005, 2007, 2009, 2010, 2013 by */ +/* Copyright 2002-2005, 2007, 2009, 2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -813,7 +813,6 @@ phy_font->ascent = PFR_NEXT_SHORT( q ); phy_font->descent = PFR_NEXT_SHORT( q ); phy_font->leading = PFR_NEXT_SHORT( q ); - q += 16; break; case 3: Index: lib/3rdparty/freetype/src/pfr/pfrobjs.c =================================================================== --- lib/3rdparty/freetype/src/pfr/pfrobjs.c (revision 62563) +++ lib/3rdparty/freetype/src/pfr/pfrobjs.c (working copy) @@ -137,8 +137,9 @@ pfrface->face_index = face_index; pfrface->num_glyphs = phy_font->num_chars + 1; - pfrface->face_flags = FT_FACE_FLAG_SCALABLE; + 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 */ { Index: lib/3rdparty/freetype/src/psaux/psobjs.c =================================================================== --- lib/3rdparty/freetype/src/psaux/psobjs.c (revision 62563) +++ lib/3rdparty/freetype/src/psaux/psobjs.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Auxiliary functions for PostScript fonts (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -847,6 +847,8 @@ /* first character must be a delimiter or a part of a number */ /* NB: `values' can be NULL if we just want to skip the */ /* array; in this case we ignore `max_values' */ + /* */ + /* return number of successfully parsed values */ static FT_Int ps_tofixedarray( FT_Byte* *acur, @@ -1200,7 +1202,7 @@ result = ps_tofixedarray( &cur, limit, 4, temp, 0 ); - if ( result < 0 ) + if ( result < 4 ) { FT_ERROR(( "ps_parser_load_field:" " expected four integers in bounding box\n" )); @@ -1230,7 +1232,7 @@ { result = ps_tofixedarray( &cur, limit, max_objects, temp + i * max_objects, 0 ); - if ( result < 0 ) + if ( result < 0 || (FT_UInt)result < max_objects ) { FT_ERROR(( "ps_parser_load_field:" " expected %d integers in the %s subarray\n" Index: lib/3rdparty/freetype/src/pshinter/pshalgo.c =================================================================== --- lib/3rdparty/freetype/src/pshinter/pshalgo.c (revision 62563) +++ lib/3rdparty/freetype/src/pshinter/pshalgo.c (working copy) @@ -4,7 +4,7 @@ /* */ /* PostScript hinting algorithm (body). */ /* */ -/* Copyright 2001-2010, 2012, 2013 by */ +/* Copyright 2001-2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -1406,7 +1406,6 @@ point = first; before = point; - after = point; do { @@ -2079,8 +2078,6 @@ start = first; do { - point = first; - /* skip consecutive fitted points */ for (;;) { Index: lib/3rdparty/freetype/src/psnames/rules.mk =================================================================== --- lib/3rdparty/freetype/src/psnames/rules.mk (revision 62563) +++ lib/3rdparty/freetype/src/psnames/rules.mk (working copy) @@ -3,7 +3,7 @@ # -# Copyright 1996-2000, 2001, 2003, 2011 by +# Copyright 1996-2001, 2003, 2011, 2013 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -46,7 +46,7 @@ # PSNames driver source file for single build # -PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c +PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c # PSNames driver - single object Index: lib/3rdparty/freetype/src/raster/ftraster.c =================================================================== --- lib/3rdparty/freetype/src/raster/ftraster.c (revision 62563) +++ lib/3rdparty/freetype/src/raster/ftraster.c (working copy) @@ -4,7 +4,7 @@ /* */ /* The FreeType glyph rasterizer (body). */ /* */ -/* Copyright 1996-2003, 2005, 2007-2013 by */ +/* Copyright 1996-2003, 2005, 2007-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1874,7 +1874,7 @@ v_start.x = ( v_start.x + v_last.x ) / 2; v_start.y = ( v_start.y + v_last.y ) / 2; - v_last = v_start; + /* v_last = v_start; */ } point--; tags--; Index: lib/3rdparty/freetype/src/sfnt/sfdriver.c =================================================================== --- lib/3rdparty/freetype/src/sfnt/sfdriver.c (revision 62563) +++ lib/3rdparty/freetype/src/sfnt/sfdriver.c (working copy) @@ -4,7 +4,7 @@ /* */ /* High-level SFNT driver interface (body). */ /* */ -/* Copyright 1996-2007, 2009-2013 by */ +/* Copyright 1996-2007, 2009-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -266,7 +266,7 @@ { FT_Stream stream = face->name_table.stream; FT_String* r = (FT_String*)result; - FT_Byte* p = (FT_Byte*)name->string; + FT_Byte* p; if ( FT_STREAM_SEEK( name->stringOffset ) || Index: lib/3rdparty/freetype/src/sfnt/ttcmap.c =================================================================== --- lib/3rdparty/freetype/src/sfnt/ttcmap.c (revision 62563) +++ lib/3rdparty/freetype/src/sfnt/ttcmap.c (working copy) @@ -4,7 +4,7 @@ /* */ /* TrueType character mapping table (cmap) support (body). */ /* */ -/* Copyright 2002-2010, 2012, 2013 by */ +/* Copyright 2002-2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -88,10 +88,16 @@ tt_cmap0_validate( FT_Byte* table, FT_Validator valid ) { - FT_Byte* p = table + 2; - FT_UInt length = TT_NEXT_USHORT( p ); + FT_Byte* p; + FT_UInt length; + if ( table + 2 + 2 > valid->limit ) + FT_INVALID_TOO_SHORT; + + p = table + 2; /* skip format */ + length = TT_NEXT_USHORT( p ); + if ( table + length > valid->limit || length < 262 ) FT_INVALID_TOO_SHORT; @@ -279,14 +285,21 @@ tt_cmap2_validate( FT_Byte* table, FT_Validator valid ) { - FT_Byte* p = table + 2; /* skip format */ - FT_UInt length = TT_PEEK_USHORT( p ); + FT_Byte* p; + FT_UInt length; + FT_UInt n, max_subs; - FT_Byte* keys; /* keys table */ - FT_Byte* subs; /* sub-headers */ - FT_Byte* glyph_ids; /* glyph ID array */ + FT_Byte* keys; /* keys table */ + FT_Byte* subs; /* sub-headers */ + FT_Byte* glyph_ids; /* glyph ID array */ + if ( table + 2 + 2 > valid->limit ) + FT_INVALID_TOO_SHORT; + + p = table + 2; /* skip format */ + length = TT_NEXT_USHORT( p ); + if ( table + length > valid->limit || length < 6 + 512 ) FT_INVALID_TOO_SHORT; @@ -818,13 +831,20 @@ tt_cmap4_validate( FT_Byte* table, FT_Validator valid ) { - FT_Byte* p = table + 2; /* skip format */ - FT_UInt length = TT_NEXT_USHORT( p ); + FT_Byte* p; + FT_UInt length; + FT_Byte *ends, *starts, *offsets, *deltas, *glyph_ids; FT_UInt num_segs; FT_Error error = FT_Err_Ok; + if ( table + 2 + 2 > valid->limit ) + FT_INVALID_TOO_SHORT; + + p = table + 2; /* skip format */ + length = TT_NEXT_USHORT( p ); + if ( length < 16 ) FT_INVALID_TOO_SHORT; @@ -2044,9 +2064,9 @@ tt_cmap12_validate( FT_Byte* table, FT_Validator valid ) { - FT_Byte* p; - FT_ULong length; - FT_ULong num_groups; + FT_Byte* p; + FT_ULong length; + FT_ULong num_groups; if ( table + 16 > valid->limit ) @@ -2110,8 +2130,6 @@ char_code = cmap->cur_charcode + 1; - n = cmap->cur_group; - for ( n = cmap->cur_group; n < cmap->num_groups; n++ ) { p = cmap->cmap.data + 16 + 12 * n; @@ -2434,8 +2452,6 @@ char_code = cmap->cur_charcode + 1; - n = cmap->cur_group; - for ( n = cmap->cur_group; n < cmap->num_groups; n++ ) { p = cmap->cmap.data + 16 + 12 * n; @@ -2758,11 +2774,18 @@ tt_cmap14_validate( FT_Byte* table, FT_Validator valid ) { - FT_Byte* p = table + 2; - FT_ULong length = TT_NEXT_ULONG( p ); - FT_ULong num_selectors = TT_NEXT_ULONG( p ); + FT_Byte* p; + FT_ULong length; + FT_ULong num_selectors; + if ( table + 2 + 4 + 4 > valid->limit ) + FT_INVALID_TOO_SHORT; + + p = table + 2; + length = TT_NEXT_ULONG( p ); + num_selectors = TT_NEXT_ULONG( p ); + if ( length > (FT_ULong)( valid->limit - table ) || length < 10 + 11 * num_selectors ) FT_INVALID_TOO_SHORT; Index: lib/3rdparty/freetype/src/sfnt/ttsbit.c =================================================================== --- lib/3rdparty/freetype/src/sfnt/ttsbit.c (revision 62563) +++ lib/3rdparty/freetype/src/sfnt/ttsbit.c (working copy) @@ -4,7 +4,7 @@ /* */ /* TrueType and OpenType embedded bitmap support (body). */ /* */ -/* Copyright 2005-2009, 2013 by */ +/* Copyright 2005-2009, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* Copyright 2013 by Google, Inc. */ @@ -967,7 +967,6 @@ break; case 2: - case 5: case 7: { /* Don't trust `glyph_format'. For example, Apple's main Korean */ @@ -997,6 +996,10 @@ } break; + case 5: + loader = tt_sbit_decoder_load_bit_aligned; + break; + case 8: if ( p + 1 > p_limit ) goto Fail; @@ -1013,10 +1016,11 @@ case 19: /* metrics in EBLC, PNG image data */ #ifdef FT_CONFIG_OPTION_USE_PNG loader = tt_sbit_decoder_load_png; + break; #else error = FT_THROW( Unimplemented_Feature ); + goto Fail; #endif /* FT_CONFIG_OPTION_USE_PNG */ - break; default: error = FT_THROW( Invalid_Table ); @@ -1243,11 +1247,11 @@ FT_Bitmap *map, TT_SBit_MetricsRec *metrics ) { - FT_UInt sbix_pos, strike_offset, glyph_start, glyph_end; - FT_ULong table_size, data_size; - FT_Int originOffsetX, originOffsetY; - FT_Tag graphicType; - FT_Int recurse_depth = 0; + FT_UInt sbix_pos, strike_offset, glyph_start, glyph_end; + FT_ULong table_size; + FT_Int originOffsetX, originOffsetY; + FT_Tag graphicType; + FT_Int recurse_depth = 0; FT_Error error; FT_Byte* p; @@ -1298,7 +1302,6 @@ originOffsetY = FT_GET_SHORT(); graphicType = FT_GET_TAG4(); - data_size = glyph_end - glyph_start - 8; switch ( graphicType ) { @@ -1322,7 +1325,7 @@ metrics, stream->memory, stream->cursor, - data_size, + glyph_end - glyph_start - 8, TRUE ); #else error = FT_THROW( Unimplemented_Feature ); Index: lib/3rdparty/freetype/src/smooth/ftgrays.c =================================================================== --- lib/3rdparty/freetype/src/smooth/ftgrays.c (revision 62563) +++ lib/3rdparty/freetype/src/smooth/ftgrays.c (working copy) @@ -4,7 +4,7 @@ /* */ /* A new `perfect' anti-aliasing renderer (body). */ /* */ -/* Copyright 2000-2003, 2005-2013 by */ +/* Copyright 2000-2003, 2005-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1364,7 +1364,6 @@ ras.num_gray_spans = 0; ras.span_y = (int)y; - count = 0; span = ras.gray_spans; } else Index: lib/3rdparty/freetype/src/tools/afblue.pl =================================================================== --- lib/3rdparty/freetype/src/tools/afblue.pl (revision 62563) +++ lib/3rdparty/freetype/src/tools/afblue.pl (working copy) @@ -5,7 +5,7 @@ # # Process a blue zone character data file. # -# Copyright 2013 by +# Copyright 2013, 2014 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, @@ -17,7 +17,7 @@ use strict; use warnings; use English '-no_match_vars'; -use open ':std', ':locale'; +use open ':std', ':encoding(UTF-8)'; my $prog = $PROGRAM_NAME; @@ -71,7 +71,7 @@ # [<ws>] '"' <string> '"' [<ws>] '\n' (<string> doesn't contain newlines) my $string_re = qr/ ^ \s* - " ( (?: [^"\\]++ | \\. )*+ ) " + " ( (?> (?: (?> [^"\\]+ ) | \\. )* ) ) " \s* $ /x; # [<ws>] '{' <block> '}' [<ws>] '\n' (<block> can contain newlines) @@ -194,7 +194,7 @@ sub aux_name { - return "af_blue_" . $num_sections. "_" . join('_', reverse @name_stack); + return "af_blue_" . $num_sections. "_" . join('_', @name_stack); } @@ -210,7 +210,7 @@ sub enum_val_string { - # Build string which holds code to save the current offset in an + # Build string that holds code to save the current offset in an # enumeration element. my $aux = shift; @@ -288,7 +288,7 @@ { # Having preprocessor conditionals complicates the computation of # correct offset values. We have to introduce auxiliary enumeration - # elements with the name `af_blue_<s>_<n1>_<n2>_...' which store + # elements with the name `af_blue_<s>_<n1>_<n2>_...' that store # offsets to be used in conditional clauses. `<s>' is the number of # sections seen so far, `<n1>' is the number of `#if' and `#endif' # conditionals seen so far in the topmost level, `<n2>' the number of @@ -344,24 +344,27 @@ $curr_offset = 0; } - elsif (/ ^ \# \s* endif /x) + elsif (/ ^ (\# \s*) endif /x) { my $prev_else = pop @else_stack; Die("unbalanced #endif") unless defined($prev_else); pop @name_stack; - $name_stack[$#name_stack]++; # If there is no else-clause for an if-clause, we add one. This is # necessary to have correct offsets. if (!$prev_else) { - push @{$diversions{$curr_enum}}, enum_val_string(aux_name()) - . "#else\n"; + # Use amount of whitespace from `endif'. + push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next()) + . $1 . "else\n"; + $last_aux = aux_name(); $curr_offset = 0; } + $name_stack[$#name_stack]++; + push @{$diversions{$curr_enum}}, enum_val_string(aux_name()); $last_aux = aux_name(); Index: lib/3rdparty/freetype/src/truetype/ttgload.c =================================================================== --- lib/3rdparty/freetype/src/truetype/ttgload.c (revision 62563) +++ lib/3rdparty/freetype/src/truetype/ttgload.c (working copy) @@ -738,7 +738,6 @@ #endif TT_GlyphZone zone = &loader->zone; - FT_Pos origin; #ifdef TT_USE_BYTECODE_INTERPRETER FT_UInt n_ins; @@ -755,14 +754,7 @@ loader->glyph->control_len )); } n_ins = (FT_UInt)( loader->glyph->control_len ); -#endif - origin = zone->cur[zone->n_points - 4].x; - origin = FT_PIX_ROUND( origin ) - origin; - if ( origin ) - translate_array( zone->n_points, zone->cur, origin, 0 ); - -#ifdef TT_USE_BYTECODE_INTERPRETER /* save original point position in org */ if ( n_ins > 0 ) FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points ); @@ -1083,9 +1075,9 @@ if ( !x && !y ) return FT_Err_Ok; - /* Use a default value dependent on */ - /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED. This is useful for old TT */ - /* fonts which don't set the xxx_COMPONENT_OFFSET bit. */ + /* Use a default value dependent on */ + /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED. This is useful for old */ + /* TT fonts which don't set the xxx_COMPONENT_OFFSET bit. */ if ( have_scale && #ifdef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED @@ -1097,10 +1089,10 @@ #if 0 - /*************************************************************************/ - /* */ - /* This algorithm is what Apple documents. But it doesn't work. */ - /* */ + /*******************************************************************/ + /* */ + /* This algorithm is what Apple documents. But it doesn't work. */ + /* */ int a = subglyph->transform.xx > 0 ? subglyph->transform.xx : -subglyph->transform.xx; int b = subglyph->transform.yx > 0 ? subglyph->transform.yx @@ -1120,12 +1112,12 @@ x = FT_MulFix( x, m ); y = FT_MulFix( y, n ); -#else /* 0 */ +#else /* 1 */ - /*************************************************************************/ - /* */ - /* This algorithm is a guess and works much better than the above. */ - /* */ + /*******************************************************************/ + /* */ + /* This algorithm is a guess and works much better than the above. */ + /* */ FT_Fixed mac_xscale = FT_Hypot( subglyph->transform.xx, subglyph->transform.xy ); FT_Fixed mac_yscale = FT_Hypot( subglyph->transform.yy, @@ -1135,7 +1127,7 @@ x = FT_MulFix( x, mac_xscale ); y = FT_MulFix( y, mac_yscale ); -#endif /* 0 */ +#endif /* 1 */ } @@ -1286,8 +1278,8 @@ * pp1 = (round(xmin - lsb), 0) , * pp2 = (round(pp1 + aw), 0) . * - * Note that the rounding to the grid is not documented currently in the - * specification. + * Note that the rounding to the grid (in the device space) is not + * documented currently in the specification. * * However, the specification lacks the precise definition of vertical * phantom points. Greg Hitchcock provided the following explanation. @@ -1360,12 +1352,10 @@ #define TT_LOADER_SET_PP( loader ) \ do \ { \ - FT_Bool subpixel_ = loader->exec \ - ? loader->exec->subpixel_hinting \ - : 0; \ - FT_Bool grayscale_ = loader->exec \ - ? loader->exec->grayscale_hinting \ - : 0; \ + FT_Bool subpixel_ = loader->exec ? loader->exec->subpixel \ + : 0; \ + FT_Bool grayscale_ = loader->exec ? loader->exec->grayscale \ + : 0; \ FT_Bool use_aw_2_ = (FT_Bool)( subpixel_ && grayscale_ ); \ \ \ @@ -1373,6 +1363,7 @@ (loader)->pp1.y = 0; \ (loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \ (loader)->pp2.y = 0; \ + \ (loader)->pp3.x = use_aw_2_ ? (loader)->advance / 2 : 0; \ (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing; \ (loader)->pp4.x = use_aw_2_ ? (loader)->advance / 2 : 0; \ @@ -1388,6 +1379,7 @@ (loader)->pp1.y = 0; \ (loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \ (loader)->pp2.y = 0; \ + \ (loader)->pp3.x = 0; \ (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing; \ (loader)->pp4.x = 0; \ @@ -1567,21 +1559,32 @@ if ( error ) goto Exit; - loader->pp1.x += deltas[0].x; loader->pp1.y += deltas[0].y; - loader->pp2.x += deltas[1].x; loader->pp2.y += deltas[1].y; - loader->pp3.x += deltas[2].x; loader->pp3.y += deltas[2].y; - loader->pp4.x += deltas[3].x; loader->pp4.y += deltas[3].y; + loader->pp1.x += deltas[0].x; + loader->pp1.y += deltas[0].y; + loader->pp2.x += deltas[1].x; + loader->pp2.y += deltas[1].y; + loader->pp3.x += deltas[2].x; + loader->pp3.y += deltas[2].y; + loader->pp4.x += deltas[3].x; + loader->pp4.y += deltas[3].y; + FT_FREE( deltas ); } -#endif +#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + /* scale phantom points, if necessary; */ + /* they get rounded in `TT_Hint_Glyph' */ if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) { loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); + /* pp1.y and pp2.y are always zero */ + + loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale ); loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); + loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale ); loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); } @@ -1589,8 +1592,8 @@ goto Exit; } - /* must initialize points before (possibly) overriding */ - /* glyph metrics from the incremental interface */ + /* must initialize phantom points before (possibly) overriding */ + /* glyph metrics from the incremental interface */ TT_LOADER_SET_PP( loader ); #ifdef FT_CONFIG_OPTION_INCREMENTAL @@ -1663,7 +1666,7 @@ face, glyph_index, &deltas, - gloader->current.num_subglyphs + 4 )) != 0 ) + gloader->current.num_subglyphs + 4 ) ) != 0 ) goto Exit; subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs; @@ -1681,21 +1684,32 @@ } } - loader->pp1.x += deltas[i + 0].x; loader->pp1.y += deltas[i + 0].y; - loader->pp2.x += deltas[i + 1].x; loader->pp2.y += deltas[i + 1].y; - loader->pp3.x += deltas[i + 2].x; loader->pp3.y += deltas[i + 2].y; - loader->pp4.x += deltas[i + 3].x; loader->pp4.y += deltas[i + 3].y; + loader->pp1.x += deltas[i + 0].x; + loader->pp1.y += deltas[i + 0].y; + loader->pp2.x += deltas[i + 1].x; + loader->pp2.y += deltas[i + 1].y; + loader->pp3.x += deltas[i + 2].x; + loader->pp3.y += deltas[i + 2].y; + loader->pp4.x += deltas[i + 3].x; + loader->pp4.y += deltas[i + 3].y; + FT_FREE( deltas ); } #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */ + /* scale phantom points, if necessary; */ + /* they get rounded in `TT_Hint_Glyph' */ if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ) { loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale ); loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale ); + /* pp1.y and pp2.y are always zero */ + + loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale ); loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale ); + loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale ); loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale ); } @@ -1755,6 +1769,7 @@ /* restore subglyph pointer */ subglyph = gloader->base.subglyphs + num_base_subgs + n; + /* restore phantom points if necessary */ if ( !( subglyph->flags & USE_MY_METRICS ) ) { loader->pp1 = pp[0]; @@ -2091,8 +2106,7 @@ #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); - FT_Bool subpixel_hinting = FALSE; - FT_Bool grayscale_hinting = TRUE; + FT_Bool subpixel = FALSE; #if 0 /* not used yet */ @@ -2125,24 +2139,24 @@ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) { - subpixel_hinting = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) - != FT_RENDER_MODE_MONO ) && - SPH_OPTION_SET_SUBPIXEL ); + subpixel = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) != + FT_RENDER_MODE_MONO ) && + SPH_OPTION_SET_SUBPIXEL ); - if ( subpixel_hinting ) - grayscale = grayscale_hinting = FALSE; + if ( subpixel ) + grayscale = FALSE; else if ( SPH_OPTION_SET_GRAYSCALE ) { - grayscale = grayscale_hinting = TRUE; - subpixel_hinting = FALSE; + grayscale = TRUE; + subpixel = FALSE; } else - grayscale = grayscale_hinting = FALSE; + grayscale = FALSE; if ( FT_IS_TRICKY( glyph->face ) ) - subpixel_hinting = grayscale_hinting = FALSE; + subpixel = FALSE; - exec->ignore_x_mode = subpixel_hinting || grayscale_hinting; + exec->ignore_x_mode = subpixel || grayscale; exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION; if ( exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 ) exec->rasterizer_version = TT_INTERPRETER_VERSION_35; @@ -2185,24 +2199,24 @@ { /* a change from mono to subpixel rendering (and vice versa) */ /* requires a re-execution of the CVT program */ - if ( subpixel_hinting != exec->subpixel_hinting ) + if ( subpixel != exec->subpixel ) { FT_TRACE4(( "tt_loader_init: subpixel hinting change," " re-executing `prep' table\n" )); - exec->subpixel_hinting = subpixel_hinting; - reexecute = TRUE; + exec->subpixel = subpixel; + reexecute = TRUE; } /* a change from mono to grayscale rendering (and vice versa) */ /* requires a re-execution of the CVT program */ - if ( grayscale != exec->grayscale_hinting ) + if ( grayscale != exec->grayscale ) { FT_TRACE4(( "tt_loader_init: grayscale hinting change," " re-executing `prep' table\n" )); - exec->grayscale_hinting = grayscale_hinting; - reexecute = TRUE; + exec->grayscale = grayscale; + reexecute = TRUE; } } else @@ -2332,8 +2346,6 @@ TT_LoaderRec loader; - error = FT_Err_Ok; - FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index )); #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS Index: lib/3rdparty/freetype/src/truetype/ttinterp.c =================================================================== --- lib/3rdparty/freetype/src/truetype/ttinterp.c (revision 62563) +++ lib/3rdparty/freetype/src/truetype/ttinterp.c (working copy) @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (body). */ /* */ -/* Copyright 1996-2013 */ +/* Copyright 1996-2014 */ /* by David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -796,16 +796,13 @@ FT_EXPORT_DEF( TT_ExecContext ) TT_New_Context( TT_Driver driver ) { - TT_ExecContext exec; - FT_Memory memory; + FT_Memory memory = driver->root.root.memory; - memory = driver->root.root.memory; - exec = driver->context; - if ( !driver->context ) { - FT_Error error; + FT_Error error; + TT_ExecContext exec; /* allocate object */ @@ -1470,7 +1467,7 @@ __asm__ __volatile__ ( "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ -#ifdef __clang__ +#if defined( __clang__ ) && defined( __thumb2__ ) "add.w %0, %0, #0x2000\n\t" /* %0 += 0x2000 */ #else "add %0, %0, #0x2000\n\t" /* %0 += 0x2000 */ @@ -7169,7 +7166,7 @@ org_dist = CUR_fast_dualproj( &vec ); } - cur_dist = CUR_Func_project ( &CUR.zp2.cur[point], cur_base ); + cur_dist = CUR_Func_project( &CUR.zp2.cur[point], cur_base ); if ( org_dist ) { @@ -7180,14 +7177,20 @@ /* This is the same as what MS does for the invalid case: */ /* */ /* delta = (Original_Pt - Original_RP1) - */ - /* (Current_Pt - Current_RP1) */ + /* (Current_Pt - Current_RP1) ; */ /* */ /* In FreeType speak: */ /* */ - /* new_dist = cur_dist - */ - /* org_dist - cur_dist; */ + /* delta = org_dist - cur_dist . */ + /* */ + /* We move `point' by `new_dist - cur_dist' after leaving */ + /* this block, thus we have */ + /* */ + /* new_dist - cur_dist = delta , */ + /* new_dist - cur_dist = org_dist - cur_dist , */ + /* new_dist = org_dist . */ - new_dist = -org_dist; + new_dist = org_dist; } } else @@ -7820,13 +7823,6 @@ CUR.ignore_x_mode && CUR.rasterizer_version >= TT_INTERPRETER_VERSION_35 ) { - /********************************/ - /* HINTING FOR GRAYSCALE */ - /* Selector Bit: 5 */ - /* Return Bit(s): 12 */ - /* */ - if ( ( args[0] & 32 ) != 0 && CUR.grayscale_hinting ) - K |= 1 << 12; if ( CUR.rasterizer_version >= 37 ) { @@ -7835,7 +7831,7 @@ /* Selector Bit: 6 */ /* Return Bit(s): 13 */ /* */ - if ( ( args[0] & 64 ) != 0 && CUR.subpixel_hinting ) + if ( ( args[0] & 64 ) != 0 && CUR.subpixel ) K |= 1 << 13; /********************************/ Index: lib/3rdparty/freetype/src/truetype/ttinterp.h =================================================================== --- lib/3rdparty/freetype/src/truetype/ttinterp.h (revision 62563) +++ lib/3rdparty/freetype/src/truetype/ttinterp.h (working copy) @@ -263,12 +263,10 @@ #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING TT_Round_Func func_round_sphn; /* subpixel rounding function */ - FT_Bool grayscale_hinting; /* Using grayscale hinting? */ - FT_Bool subpixel_hinting; /* Using subpixel hinting? */ - FT_Bool native_hinting; /* Using native hinting? */ + FT_Bool subpixel; /* Using subpixel hinting? */ FT_Bool ignore_x_mode; /* Standard rendering mode for */ /* subpixel hinting. On if gray */ - /* or subpixel hinting is on ) */ + /* or subpixel hinting is on. */ /* The following 4 aren't fully implemented but here for MS rasterizer */ /* compatibility. */ Index: lib/3rdparty/freetype/src/type1/t1gload.c =================================================================== --- lib/3rdparty/freetype/src/type1/t1gload.c (revision 62563) +++ lib/3rdparty/freetype/src/type1/t1gload.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Type 1 Glyph Loader (body). */ /* */ -/* Copyright 1996-2006, 2008-2010, 2013 by */ +/* Copyright 1996-2006, 2008-2010, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -194,7 +194,7 @@ for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ ) { /* now get load the unscaled outline */ - error = T1_Parse_Glyph( &decoder, glyph_index ); + (void)T1_Parse_Glyph( &decoder, glyph_index ); if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) *max_advance = decoder.builder.advance.x; Index: lib/3rdparty/freetype/src/type1/t1load.c =================================================================== --- lib/3rdparty/freetype/src/type1/t1load.c (revision 62563) +++ lib/3rdparty/freetype/src/type1/t1load.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Type 1 font loader (body). */ /* */ -/* Copyright 1996-2013 by */ +/* Copyright 1996-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -377,8 +377,6 @@ if ( blend && blend->num_axis == num_coords ) { /* recompute the weight vector from the blend coordinates */ - error = FT_Err_Ok; - for ( n = 0; n < blend->num_designs; n++ ) { FT_Fixed result = 0x10000L; /* 1.0 fixed */ @@ -1107,7 +1105,7 @@ result = T1_ToFixedArray( parser, 6, temp, 3 ); - if ( result < 0 ) + if ( result < 6 ) { parser->root.error = FT_THROW( Invalid_File_Format ); return; @@ -1274,6 +1272,13 @@ { charcode = (FT_Int)T1_ToInt( parser ); T1_Skip_Spaces( parser ); + + /* protect against invalid charcode */ + if ( cur == parser->root.cursor ) + { + parser->root.error = FT_THROW( Unknown_File_Format ); + return; + } } cur = parser->root.cursor; Index: lib/3rdparty/freetype/src/type1/t1objs.c =================================================================== --- lib/3rdparty/freetype/src/type1/t1objs.c (revision 62563) +++ lib/3rdparty/freetype/src/type1/t1objs.c (working copy) @@ -364,10 +364,10 @@ root->num_glyphs = type1->num_glyphs; root->face_index = 0; - root->face_flags = FT_FACE_FLAG_SCALABLE | - FT_FACE_FLAG_HORIZONTAL | - FT_FACE_FLAG_GLYPH_NAMES | - FT_FACE_FLAG_HINTER; + root->face_flags |= FT_FACE_FLAG_SCALABLE | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_GLYPH_NAMES | + FT_FACE_FLAG_HINTER; if ( info->is_fixed_pitch ) root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; Index: lib/3rdparty/freetype/src/type1/t1parse.c =================================================================== --- lib/3rdparty/freetype/src/type1/t1parse.c (revision 62563) +++ lib/3rdparty/freetype/src/type1/t1parse.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Type 1 parser (body). */ /* */ -/* Copyright 1996-2005, 2008, 2009, 2012, 2013 by */ +/* Copyright 1996-2005, 2008, 2009, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -332,9 +332,11 @@ /* dictionary block in the heap. */ /* first of all, look at the `eexec' keyword */ - FT_Byte* cur = parser->base_dict; - FT_Byte* limit = cur + parser->base_len; - FT_Byte c; + FT_Byte* cur = parser->base_dict; + FT_Byte* limit = cur + parser->base_len; + FT_Byte c; + FT_Pointer pos_lf; + FT_Bool test_cr; Again: @@ -400,15 +402,24 @@ cur = parser->root.cursor; limit = parser->root.limit; - /* according to the Type1 spec, the first cipher byte must not be */ + /* According to the Type 1 spec, the first cipher byte must not be */ /* an ASCII whitespace character code (blank, tab, carriage return */ /* or line feed). We have seen Type 1 fonts with two line feed */ /* characters... So skip now all whitespace character codes. */ - while ( cur < limit && - ( *cur == ' ' || - *cur == '\t' || - *cur == '\r' || - *cur == '\n' ) ) + /* */ + /* On the other hand, Adobe's Type 1 parser handles fonts just */ + /* fine that are violating this limitation, so we add a heuristic */ + /* test to stop at \r only if it is not used for EOL. */ + + pos_lf = ft_memchr( cur, '\n', limit - cur ); + test_cr = FT_BOOL( !pos_lf || + pos_lf > ft_memchr( cur, '\r', limit - cur ) ); + + while ( cur < limit && + ( *cur == ' ' || + *cur == '\t' || + (test_cr && *cur == '\r' ) || + *cur == '\n' ) ) ++cur; if ( cur >= limit ) { Index: lib/3rdparty/freetype/src/type42/t42objs.c =================================================================== --- lib/3rdparty/freetype/src/type42/t42objs.c (revision 62563) +++ lib/3rdparty/freetype/src/type42/t42objs.c (working copy) @@ -218,9 +218,9 @@ root->num_charmaps = 0; root->face_index = 0; - root->face_flags = FT_FACE_FLAG_SCALABLE | - FT_FACE_FLAG_HORIZONTAL | - FT_FACE_FLAG_GLYPH_NAMES; + root->face_flags |= FT_FACE_FLAG_SCALABLE | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_GLYPH_NAMES; if ( info->is_fixed_pitch ) root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; Index: lib/3rdparty/freetype/src/type42/t42parse.c =================================================================== --- lib/3rdparty/freetype/src/type42/t42parse.c (revision 62563) +++ lib/3rdparty/freetype/src/type42/t42parse.c (working copy) @@ -4,7 +4,7 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002-2013 by */ +/* Copyright 2002-2014 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -255,12 +255,26 @@ FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; FT_Fixed temp_scale; + FT_Int result; - (void)T1_ToFixedArray( parser, 6, temp, 3 ); + result = T1_ToFixedArray( parser, 6, temp, 3 ); + if ( result < 6 ) + { + parser->root.error = FT_THROW( Invalid_File_Format ); + return; + } + temp_scale = FT_ABS( temp[3] ); + if ( temp_scale == 0 ) + { + FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" )); + parser->root.error = FT_THROW( Invalid_File_Format ); + return; + } + /* Set Units per EM based on FontMatrix values. We set the value to */ /* 1000 / temp_scale, because temp_scale was already multiplied by */ /* 1000 (in t1_tofixed, from psobjs.c). */ @@ -275,7 +289,7 @@ temp[2] = FT_DivFix( temp[2], temp_scale ); temp[4] = FT_DivFix( temp[4], temp_scale ); temp[5] = FT_DivFix( temp[5], temp_scale ); - temp[3] = 0x10000L; + temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L; } matrix->xx = temp[0]; @@ -314,7 +328,7 @@ if ( ft_isdigit( *cur ) || *cur == '[' ) { T1_Encoding encode = &face->type1.encoding; - FT_UInt count, n; + FT_Int count, n; PS_Table char_table = &loader->encoding_table; FT_Memory memory = parser->root.memory; FT_Error error; @@ -329,7 +343,7 @@ parser->root.cursor++; } else - count = (FT_UInt)T1_ToInt( parser ); + count = (FT_Int)T1_ToInt( parser ); T1_Skip_Spaces( parser ); if ( parser->root.cursor >= limit ) @@ -417,7 +431,7 @@ cur = parser->root.cursor; - if ( *cur == '/' && cur + 2 < limit && n < count ) + if ( cur + 2 < limit && *cur == '/' && n < count ) { FT_PtrDist len; @@ -426,6 +440,8 @@ parser->root.cursor = cur; T1_Skip_PS_Token( parser ); + if ( parser->root.cursor >= limit ) + return; if ( parser->root.error ) return; @@ -439,6 +455,19 @@ n++; } + else if ( only_immediates ) + { + /* Since the current position is not updated for */ + /* immediates-only mode we would get an infinite loop if */ + /* we don't do anything here. */ + /* */ + /* This encoding array is not valid according to the type1 */ + /* specification (it might be an encoding for a CID type1 */ + /* font, however), so we conclude that this font is NOT a */ + /* type1 font. */ + parser->root.error = FT_THROW( Unknown_File_Format ); + return; + } } else { @@ -450,8 +479,8 @@ T1_Skip_Spaces( parser ); } - face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; - parser->root.cursor = cur; + face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY; + parser->root.cursor = cur; } /* Otherwise, we should have either `StandardEncoding', */ @@ -471,10 +500,7 @@ face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; else - { - FT_ERROR(( "t42_parse_encoding: invalid token\n" )); - parser->root.error = FT_THROW( Invalid_File_Format ); - } + parser->root.error = FT_THROW( Ignore ); } } Index: lib/3rdparty/freetype/src/winfonts/winfnt.c =================================================================== --- lib/3rdparty/freetype/src/winfonts/winfnt.c (revision 62563) +++ lib/3rdparty/freetype/src/winfonts/winfnt.c (working copy) @@ -4,7 +4,7 @@ /* */ /* FreeType font driver for Windows FNT/FON files */ /* */ -/* Copyright 1996-2004, 2006-2013 by */ +/* Copyright 1996-2004, 2006-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* Copyright 2003 Huw D M Davies for Codeweavers */ /* Copyright 2007 Dmitry Timoshkov for Codeweavers */ @@ -743,8 +743,8 @@ root->face_index = face_index; - root->face_flags = FT_FACE_FLAG_FIXED_SIZES | - FT_FACE_FLAG_HORIZONTAL; + root->face_flags |= FT_FACE_FLAG_FIXED_SIZES | + FT_FACE_FLAG_HORIZONTAL; if ( font->header.avg_width == font->header.max_width ) root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; @@ -977,7 +977,7 @@ font = face->font; - if ( !font || + if ( !font || glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) ) { error = FT_THROW( Invalid_Argument ); @@ -989,16 +989,26 @@ if ( glyph_index > 0 ) glyph_index--; /* revert to real index */ else - glyph_index = font->header.default_char; /* the .notdef glyph */ + glyph_index = font->header.default_char; /* the `.notdef' glyph */ new_format = FT_BOOL( font->header.version == 0x300 ); len = new_format ? 6 : 4; - /* jump to glyph entry */ - p = font->fnt_frame + ( new_format ? 148 : 118 ) + len * glyph_index; + /* get glyph width and offset */ + offset = ( new_format ? 148 : 118 ) + len * glyph_index; + if ( offset >= font->header.file_size - 2 - ( new_format ? 4 : 2 ) ) + { + FT_TRACE2(( "invalid FNT offset\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + p = font->fnt_frame + offset; + bitmap->width = FT_NEXT_SHORT_LE( p ); + /* jump to glyph entry */ if ( new_format ) offset = FT_NEXT_ULONG_LE( p ); else