[autofit] Make autohint warping NORMAL option.

This moves warping option from LIGHT to NORMAL mode.  This makes LIGHT
truly void of hinting in x-direction, with left side bearing never
changed and right side bearing only altered by advance rounding.
Therefore, LIGHT is now ready to return fractional advance.  As a
NORMAL option, warping substitutes normal hinting.

* src/autofit/afcjk.c (af_cjk_hints_apply): Updated.
* src/autofit/aflatin.c (af_latin_hints_apply): Updated.
* src/autofit/aflatin2.c (af_latin2_hints_apply): Updated.

* src/autofit/afloader.c (af_loader_load_glyph): Handle warping
phantom points as normal.
This commit is contained in:
Alexei Podtelezhnikov 2017-05-15 00:25:37 -04:00
parent e99b26aada
commit a7f276a281
5 changed files with 30 additions and 31 deletions

View File

@ -1,3 +1,20 @@
2017-05-15 Alexei Podtelezhnikov <apodtele@gmail.com>
[autofit] Make autohint warping NORMAL option.
This moves warping option from LIGHT to NORMAL mode. This makes LIGHT
truly void of hinting in x-direction, with left side bearing never
changed and right side bearing only altered by advance rounding.
Therefore, LIGHT is now ready to return fractional advance. As a
NORMAL option, warping substitutes normal hinting.
* src/autofit/afcjk.c (af_cjk_hints_apply): Updated.
* src/autofit/aflatin.c (af_latin_hints_apply): Updated.
* src/autofit/aflatin2.c (af_latin2_hints_apply): Updated.
* src/autofit/afloader.c (af_loader_load_glyph): Handle warping
phantom points as normal.
2017-05-14 Werner Lemberg <wl@gnu.org>
Remove remnants of raster pool.

View File

@ -2272,13 +2272,7 @@
goto Exit;
/* analyze glyph outline */
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
AF_HINTS_DO_WARP( hints ) ) ||
AF_HINTS_DO_HORIZONTAL( hints ) )
#else
if ( AF_HINTS_DO_HORIZONTAL( hints ) )
#endif
{
error = af_cjk_hints_detect_features( hints, AF_DIMENSION_HORZ );
if ( error )
@ -2304,9 +2298,9 @@
{
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( dim == AF_DIMENSION_HORZ &&
metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
AF_HINTS_DO_WARP( hints ) )
if ( dim == AF_DIMENSION_HORZ &&
metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL &&
AF_HINTS_DO_WARP( hints ) )
{
AF_WarperRec warper;
FT_Fixed scale;

View File

@ -3492,13 +3492,7 @@
goto Exit;
/* analyze glyph outline */
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
AF_HINTS_DO_WARP( hints ) ) ||
AF_HINTS_DO_HORIZONTAL( hints ) )
#else
if ( AF_HINTS_DO_HORIZONTAL( hints ) )
#endif
{
axis = &metrics->axis[AF_DIMENSION_HORZ];
error = af_latin_hints_detect_features( hints,
@ -3528,9 +3522,9 @@
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
{
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( dim == AF_DIMENSION_HORZ &&
metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
AF_HINTS_DO_WARP( hints ) )
if ( dim == AF_DIMENSION_HORZ &&
metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL &&
AF_HINTS_DO_WARP( hints ) )
{
AF_WarperRec warper;
FT_Fixed scale;

View File

@ -2340,13 +2340,7 @@
goto Exit;
/* analyze glyph outline */
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
AF_HINTS_DO_WARP( hints ) ) ||
AF_HINTS_DO_HORIZONTAL( hints ) )
#else
if ( AF_HINTS_DO_HORIZONTAL( hints ) )
#endif
{
error = af_latin2_hints_detect_features( hints, AF_DIMENSION_HORZ );
if ( error )
@ -2366,9 +2360,9 @@
for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
{
#ifdef AF_CONFIG_OPTION_USE_WARPER
if ( dim == AF_DIMENSION_HORZ &&
metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT &&
AF_HINTS_DO_WARP( hints ) )
if ( dim == AF_DIMENSION_HORZ &&
metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL &&
AF_HINTS_DO_WARP( hints ) )
{
AF_WarperRec warper;
FT_Fixed scale;

View File

@ -483,8 +483,8 @@
FT_Pos pp2x = loader->pp2.x;
loader->pp1.x = FT_PIX_ROUND( pp1x );
loader->pp2.x = FT_PIX_ROUND( pp2x );
loader->pp1.x = FT_PIX_ROUND( pp1x + hints->xmin_delta );
loader->pp2.x = FT_PIX_ROUND( pp2x + hints->xmax_delta );
slot->lsb_delta = loader->pp1.x - pp1x;
slot->rsb_delta = loader->pp2.x - pp2x;
@ -498,8 +498,8 @@
FT_Pos pp2x = loader->pp2.x;
loader->pp1.x = FT_PIX_ROUND( pp1x + hints->xmin_delta );
loader->pp2.x = FT_PIX_ROUND( pp2x + hints->xmax_delta );
loader->pp1.x = FT_PIX_ROUND( pp1x );
loader->pp2.x = FT_PIX_ROUND( pp2x );
slot->lsb_delta = loader->pp1.x - pp1x;
slot->rsb_delta = loader->pp2.x - pp2x;