diff options
author | Werner Lemberg <wl@gnu.org> | 2014-04-12 20:44:33 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2014-04-12 20:44:33 +0200 |
commit | 8a94b1efd6cfe76ffbd66e9315542c9438a34722 (patch) | |
tree | c80fa528f640f734e2c9849cc6dd457cf102b655 /src/autofit/afhints.h | |
parent | 71f53e122b83cbe3033f47a2f283d207492c87b0 (diff) | |
download | freetype2-8a94b1efd6cfe76ffbd66e9315542c9438a34722.tar.gz |
[autofit] Redesign the recognition algorithm of strong points.
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'.
Diffstat (limited to 'src/autofit/afhints.h')
-rw-r--r-- | src/autofit/afhints.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/autofit/afhints.h b/src/autofit/afhints.h index 5f1507f80..6e1b1ff99 100644 --- a/src/autofit/afhints.h +++ b/src/autofit/afhints.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (specification). */ /* */ -/* Copyright 2003-2008, 2010-2012 by */ +/* Copyright 2003-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, */ @@ -236,10 +236,7 @@ FT_BEGIN_HEADER AF_FLAG_WEAK_INTERPOLATION = 1 << 8, /* all inflection points in the outline have this flag set */ - AF_FLAG_INFLECTION = 1 << 9, - - /* the current point is very near to another one */ - AF_FLAG_NEAR = 1 << 10 + AF_FLAG_INFLECTION = 1 << 9 } AF_Flags; |