diff options
author | Werner Lemberg <wl@gnu.org> | 2017-05-02 12:32:19 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2017-05-02 12:32:19 +0200 |
commit | ba40054c2dd9f5d3d8561de7106870ac6a920f6d (patch) | |
tree | 3395f6037193387a15bae12bcc082b3aa0fd9587 /src | |
parent | 7abf0cb758b4b470a0a0671e290669aeefbe0b90 (diff) | |
download | freetype2-ba40054c2dd9f5d3d8561de7106870ac6a920f6d.tar.gz |
[autofit] Remove `slight' auto-hint mode again.
A poll on freetype-devel favoured changes directly applied to
`light'.
* include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT,
FT_RENDER_MODE_SLIGHT): Removed.
* src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
(af_latin_hints_init), src/autofit/aflatin2.c
(af_latin2_hints_init): Revert change from 2017-04-22.
* src/autofit/afloader.c (af_loader_load_glyph) Remove references to
FT_RENDER_MODE_SLIGHT.
[AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics
unconditionally.
* src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from
2017-04-22.
* src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22.
* src/pshinter/pshalgo.c (ps_hints_apply): Revert change from
2017-04-22.
* src/smooth/ftsmooth.c (ft_smooth_render): Revert change from
2017-04-22.
* docs/CHANGES: Updated.
Diffstat (limited to 'src')
-rw-r--r-- | src/autofit/afcjk.c | 7 | ||||
-rw-r--r-- | src/autofit/aflatin.c | 10 | ||||
-rw-r--r-- | src/autofit/aflatin2.c | 10 | ||||
-rw-r--r-- | src/autofit/afloader.c | 31 | ||||
-rw-r--r-- | src/base/ftadvanc.c | 9 | ||||
-rw-r--r-- | src/base/ftobjs.c | 9 | ||||
-rw-r--r-- | src/pshinter/pshalgo.c | 3 | ||||
-rw-r--r-- | src/smooth/ftsmooth.c | 3 | ||||
-rw-r--r-- | src/truetype/ttgload.c | 2 | ||||
-rw-r--r-- | src/truetype/ttobjs.c | 3 |
10 files changed, 32 insertions, 55 deletions
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 86b8b4067..61e29cded 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -1398,12 +1398,9 @@ other_flags |= AF_LATIN_HINTS_VERT_SNAP; /* - * We adjust stems to full pixels unless in `light', `slight', - * or `lcd' mode. + * We adjust stems to full pixels unless in `light' or `lcd' mode. */ - if ( mode != FT_RENDER_MODE_LIGHT && - mode != FT_RENDER_MODE_SLIGHT && - mode != FT_RENDER_MODE_LCD ) + if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD ) other_flags |= AF_LATIN_HINTS_STEM_ADJUST; if ( mode == FT_RENDER_MODE_MONO ) diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index e03fdf01f..11fa523c8 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -2577,9 +2577,7 @@ /* * We adjust stems to full pixels unless in `light' or `lcd' mode. */ - if ( mode != FT_RENDER_MODE_LIGHT && - mode != FT_RENDER_MODE_SLIGHT && - mode != FT_RENDER_MODE_LCD ) + if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD ) other_flags |= AF_LATIN_HINTS_STEM_ADJUST; if ( mode == FT_RENDER_MODE_MONO ) @@ -2592,10 +2590,8 @@ * However, if warping is enabled (which only works in `light' hinting * mode), advance widths get adjusted, too. */ - if ( mode == FT_RENDER_MODE_LIGHT || - mode == FT_RENDER_MODE_SLIGHT || - mode == FT_RENDER_MODE_LCD || - ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 ) + if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD || + ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 ) scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL; #ifdef AF_CONFIG_OPTION_USE_WARPER diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c index 87ab91d8e..0607278b1 100644 --- a/src/autofit/aflatin2.c +++ b/src/autofit/aflatin2.c @@ -1560,9 +1560,7 @@ /* * We adjust stems to full pixels unless in `light' or `lcd' mode. */ - if ( mode != FT_RENDER_MODE_LIGHT && - mode != FT_RENDER_MODE_SLIGHT && - mode != FT_RENDER_MODE_LCD ) + if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD ) other_flags |= AF_LATIN_HINTS_STEM_ADJUST; if ( mode == FT_RENDER_MODE_MONO ) @@ -1572,10 +1570,8 @@ * In `light' or `lcd' mode we disable horizontal hinting completely. * We also do it if the face is italic. */ - if ( mode == FT_RENDER_MODE_LIGHT || - mode == FT_RENDER_MODE_SLIGHT || - mode == FT_RENDER_MODE_LCD || - ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 ) + if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD || + ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 ) scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL; #ifdef AF_CONFIG_OPTION_USE_WARPER diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c index b3269d10b..ddf47ebcf 100644 --- a/src/autofit/afloader.c +++ b/src/autofit/afloader.c @@ -245,15 +245,14 @@ if ( !size_internal->autohint_metrics.x_scale || size_internal->autohint_mode != FT_LOAD_TARGET_MODE( load_flags ) ) { - /* switching between LIGHT and SLIGHT (and vice versa) usually means */ - /* different scaling values; this later on enforces recomputation of */ - /* everything related to the current size */ + /* switching between hinting modes usually means different scaling */ + /* values; this later on enforces recomputation of everything */ + /* related to the current size */ size_internal->autohint_mode = FT_LOAD_TARGET_MODE( load_flags ); size_internal->autohint_metrics = size->metrics; #ifdef AF_CONFIG_OPTION_TT_SIZE_METRICS - if ( size_internal->autohint_mode != FT_RENDER_MODE_SLIGHT ) { FT_Size_Metrics* size_metrics = &size_internal->autohint_metrics; @@ -382,12 +381,11 @@ * */ - /* stem darkening only works well in `light' and `slight' modes */ - if ( ( scaler.render_mode == FT_RENDER_MODE_LIGHT || - scaler.render_mode == FT_RENDER_MODE_SLIGHT ) && + /* stem darkening only works well in `light' mode */ + if ( scaler.render_mode == FT_RENDER_MODE_LIGHT && ( !face->internal->no_stem_darkening || ( face->internal->no_stem_darkening < 0 && - !module->no_stem_darkening ) ) ) + !module->no_stem_darkening ) ) ) af_loader_embolden_glyph_in_slot( loader, face, style_metrics ); loader->transformed = slot_internal->glyph_transformed; @@ -435,8 +433,7 @@ /* we now need to adjust the metrics according to the change in */ /* width/positioning that occurred during the hinting process */ - if ( scaler.render_mode != FT_RENDER_MODE_LIGHT && - scaler.render_mode != FT_RENDER_MODE_SLIGHT ) + if ( scaler.render_mode != FT_RENDER_MODE_LIGHT ) { FT_Pos old_rsb, old_lsb, new_lsb; FT_Pos pp1x_uh, pp2x_uh; @@ -494,9 +491,8 @@ } } /* `light' mode uses integer advance widths */ - /* (but sets `lsb_delta' and `rsb_delta'), */ - /* `slight' mode uses fractional values */ - else if ( scaler.render_mode == FT_RENDER_MODE_LIGHT ) + /* but sets `lsb_delta' and `rsb_delta' */ + else { FT_Pos pp1x = loader->pp1.x; FT_Pos pp2x = loader->pp2.x; @@ -508,11 +504,6 @@ slot->lsb_delta = loader->pp1.x - pp1x; slot->rsb_delta = loader->pp2.x - pp2x; } - else - { - slot->lsb_delta = 0; - slot->rsb_delta = 0; - } break; @@ -563,7 +554,6 @@ /* to keep the original rounded advance width; ditto for */ /* digits if all have the same advance width */ if ( scaler.render_mode != FT_RENDER_MODE_LIGHT && - scaler.render_mode != FT_RENDER_MODE_SLIGHT && ( FT_IS_FIXED_WIDTH( slot->face ) || ( af_face_globals_is_digit( loader->globals, glyph_index ) && style_metrics->digits_have_same_width ) ) ) @@ -587,8 +577,7 @@ slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance, style_metrics->scaler.y_scale ); - if ( scaler.render_mode != FT_RENDER_MODE_SLIGHT ) - slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance ); + slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance ); slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance ); slot->format = FT_GLYPH_FORMAT_OUTLINE; diff --git a/src/base/ftadvanc.c b/src/base/ftadvanc.c index 5f2e0b167..1557607fc 100644 --- a/src/base/ftadvanc.c +++ b/src/base/ftadvanc.c @@ -59,15 +59,14 @@ /* */ /* - unscaled load */ /* - unhinted load */ - /* - light-hinted and slight-hinted load */ + /* - light-hinted load */ /* - if a variations font, it must have an `HVAR' or `VVAR' */ /* table (thus the old MM or GX fonts don't qualify; this */ /* gets checked by the driver-specific functions) */ -#define LOAD_ADVANCE_FAST_CHECK( face, flags ) \ - ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \ - ( FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT || \ - FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_SLIGHT ) ) +#define LOAD_ADVANCE_FAST_CHECK( face, flags ) \ + ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \ + FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT ) /* documentation is in ftadvanc.h */ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index cbc771322..539116e85 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -668,8 +668,8 @@ * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't * have a native font hinter. * - * - Otherwise, auto-hint for LIGHT or SLIGHT hinting mode or if there - * isn't any hinting bytecode in the TrueType/OpenType font. + * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't + * any hinting bytecode in the TrueType/OpenType font. * * - Exception: The font is `tricky' and requires the native hinter to * load properly. @@ -702,9 +702,8 @@ /* check the size of the `fpgm' and `prep' tables, too -- */ /* the assumption is that there don't exist real TTFs where */ /* both `fpgm' and `prep' tables are missing */ - if ( ( ( mode == FT_RENDER_MODE_LIGHT || - mode == FT_RENDER_MODE_SLIGHT ) && - !FT_DRIVER_HINTS_LIGHTLY( driver ) ) || + if ( ( mode == FT_RENDER_MODE_LIGHT && + !FT_DRIVER_HINTS_LIGHTLY( driver ) ) || ( FT_IS_SFNT( face ) && ttface->num_locations && ttface->max_profile.maxSizeOfInstructions == 0 && diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c index 27cb229eb..9ad1a3a02 100644 --- a/src/pshinter/pshalgo.c +++ b/src/pshinter/pshalgo.c @@ -2149,8 +2149,7 @@ glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || hint_mode == FT_RENDER_MODE_LCD_V ); - glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT && - hint_mode != FT_RENDER_MODE_SLIGHT ); + glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT ); for ( dimension = 0; dimension < 2; dimension++ ) { diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index 52e61e559..435854e67 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -433,8 +433,7 @@ FT_Render_Mode mode, const FT_Vector* origin ) { - if ( mode == FT_RENDER_MODE_LIGHT || - mode == FT_RENDER_MODE_SLIGHT ) + if ( mode == FT_RENDER_MODE_LIGHT ) mode = FT_RENDER_MODE_NORMAL; return ft_smooth_render_generic( render, slot, mode, origin, diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index c5d548f0b..9c1e109c3 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2737,7 +2737,7 @@ /* TrueType glyphs at all sizes using the bytecode interpreter. */ /* */ if ( !( load_flags & FT_LOAD_NO_SCALE ) && - size->metrics->y_ppem < 24 ) + size->metrics->y_ppem < 24 ) glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; Exit: diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 64011e86e..d20e3da07 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -1234,6 +1234,7 @@ /* */ if ( face->header.Flags & 8 ) { + /* the TT spec always asks for ROUND, not FLOOR or CEIL */ size_metrics->ascender = FT_PIX_ROUND( FT_MulFix( face->root.ascender, size_metrics->y_scale ) ); @@ -1252,6 +1253,8 @@ if ( face->header.Flags & 8 ) { + /* base scaling values on integer ppem values, */ + /* as mandated by the TrueType specification */ size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6, face->root.units_per_EM ); size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6, |