Problem reported by Ralf S. Engelschall <rse@engelschall.com>.
* src/autofit/afhints.c (af_glyph_hints_reload): Fix threshold for
finding first non-near point.
Properly initialize non-near point deltas.
This essentially moves the Devanagari script from the `Indic' hinter
to the `Latin' hinter. Thanks to Girish Dalvi
<girish.dalvi@gmail.com> for guidance with blue zone characters!
* src/autofit/afblue.dat: Add blue zone data for Devanagari.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afscript.h: Add Devanagari standard characters and
move data out of AF_CONFIG_OPTION_INDIC block.
* src/autofit/afranges.c: Move Devanagari data out of
AF_CONFIG_OPTION_INDIC block.
Move U+20B9, (new) Rupee sign, from Latin to Devanagari.
* src/autofit/afstyles.h: Update Devanagari data; in particular, use
AF_WRITING_SYSTEM_LATIN.
* src/autofit/afhints.h (AF_Edge_Flags): New value
`AF_EDGE_NEUTRAL'.
* src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace
neutral blue zones with AF_EDGE_NEUTRAL.
(af_latin_hint_edges): Skip neutral blue zones if necessary.
Such blue zones match either the top or the bottom of a contour. We
need them for scripts where accent-like elements directly touch the
base character (for example, some vowel signs in Devanagari, cf.
U+0913 or U+0914).
* src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New
property.
* src/autofit/afblue.h: Regenerated.
* src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro.
(AF_LATIN_BLUE_NEUTRAL): New enumeration value.
* src/autofit/aflatin.c (af_latin_metrics_init_blues,
af_latin_hints_compute_blue_edges): Handle neutral blue zones.
This spot has been missed while introducing support for various
drop-out modes years ago (including no drop-out mode, which this
commit fixes).
Problem reported by Patrick Thomas <pthomas505@gmail.com>.
The adaptation of the cjk auto-hinter module to blue stringsets in
2013-08-25 had three severe bugs. Mea culpa.
1. Contrary to the latin auto-hinter, characters for reference and
overshoot values of a blue zone are specified separately. Due to
the screwed-up change it didn't work at all.
2. A boolean comparison was erroneously replaced with a cast,
causing invalid results with the `^' operator later on. The
visual artifact caused by this problem is the topic of the bug
report.
3. Two flag values were inverted, causing incorrect assignment of
reference and overshoot values.
* src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new
syntax to have both reference and overshoot characters in a single
string. This is error #1.
Add extensive comments.
* src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no
longer used.
(AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values.
This is error #3.
* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
* src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1.
Use character `|' to separate characters for reference and overshoot
values.
Improve tracing messages, synchronizing them with the latin
auto-hinter.
(af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'.
This is error #2.
(af_cjk_align_linked_edge): Add tracing message.
* src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer
used.
* src/autofit/hbshim.c (af_get_coverage): Merge input glyph coverage
of GSUB lookups into output coverage. Otherwise, ligatures are not
handled properly.
Don't check blue zone characters for default coverage.
In particular, local extrema without horizontal or vertical segments
are better recognized:
+ A + D
\ /
\ /
\ /
\ /
\ + C
\ /
B +/
If the distances AB and CD are large, point B wasn't previously
detected as an extremum since the `ft_corner_is_flat' function
`swallowed' BC regardless of its direction, tagging point B as weak.
The next iteration started at B and made `ft_corner_is_flat' swallow
point C, tagging it as weak also, et voilà.
To improve that, another pass gets now performed before calling
`ft_corner_is_flat' to improve the `topology' of an outline: A
sequence of non-horizontal or non-vertical vectors that point into
the same quadrant are handled as a single, large vector.
Additionally, distances of near points are now accumulated, which
makes the auto-hinter handle them as if they were prepended to the
next non-near vector.
This generally improves the auto-hinter's rendering results.
* src/autofit/afhints.c (af_glyph_hints_reload): Implement it.
* src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag
`AF_FLAG_NEAR'.
Problem reported by Karsten Lücke <karsten.luecke@kltf.de>.
The new algorithm takes care of the width of stems: If the distance
between two segments is larger than the largest stem width, the
demerits quickly increase for larger distances. This improves
hinting of slanted fonts (especially if the inner parts of serifs
have non-horizontal `shoulders'), avoiding false stem links.
* src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest
stem width (if available) to compute better demerits for distances
between stems.
(af_latin_hints_detect_features): Pass stem width array and array
size.
(af_latin_metrics_init_widths): Updated to use original algorithm.
(af_latin_hints_apply): Updated to use new algorithm.
* src/autofit/aflatin.h: Updated.
* src/autofit/afcjk.c: Updated.
Work around a bug in pkg-config version 0.28 and earlier: If a
variable value gets surrounded by doublequotes (in particular values
for the `prefix' variable), the prefix override mechanism fails.
* builds/unix/freetype2.in: Don't use doublequotes.
* builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
names with backslashes.
Based on a patch from Marek Kašík <mkasik@redhat.com>.
* builds/unix/configure.raw (LIBS_CONFIG): Remove.
* builds/unix/freetype-config.in (libs): Hard-code value.
* builds/unix/unix-def.in: Updated.
This works around a problem with HarfBuzz (<= 0.9.26), which doesn't
validate glyph indices returned by
`hb_ot_layout_lookup_collect_glyphs'.
* src/autofit/hbshim.c (af_get_coverage): Guard `idx'.
* docs/CHANGES: Updated.
=========================
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.
* 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).
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.
Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
* 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.