[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.
This commit is contained in:
Werner Lemberg 2017-05-02 12:32:19 +02:00
parent 7abf0cb758
commit ba40054c2d
14 changed files with 131 additions and 100 deletions

View File

@ -1,3 +1,35 @@
2017-05-02 Werner Lemberg <wl@gnu.org>
[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.
2017-04-30 Werner Lemberg <wl@gnu.org> 2017-04-30 Werner Lemberg <wl@gnu.org>
[autofit] Fix metrics computation. [autofit] Fix metrics computation.

View File

@ -3,7 +3,9 @@ CHANGES BETWEEN 2.7.1 and 2.8
I. IMPORTANT CHANGES I. IMPORTANT CHANGES
- Support for OpenType Variation Fonts is now complete. - Support for OpenType Variation Fonts is now complete. The last
missing part was handling the `VVAR' and `MVAR' tables, which is
available with this release.
- A new function `FT_Face_Properties' allows the control of some - A new function `FT_Face_Properties' allows the control of some
module and library properties per font. Currently, the module and library properties per font. Currently, the
@ -19,12 +21,21 @@ CHANGES BETWEEN 2.7.1 and 2.8
FREETYPE_PROPERTIES=pcf:no-long-family-names=1 FREETYPE_PROPERTIES=pcf:no-long-family-names=1
- Variations font support now takes care of the `VVAR' and `MVAR'
tables also.
II. IMPORTANT BUG FIXES II. IMPORTANT BUG FIXES
- `Light' auto-hinting mode no longer uses TrueType metrics for
TrueType fonts. This bug was introduced in version 2.4.6,
causing horizontal scaling also. Almost all GNU/Linux
distributions (with Fedora as a notable exception) disabled the
corresponding patch for good reasons; chances are thus high that
you won't notice a difference.
If optical backward compatibility for legacy applications is
necessary, you might enable the AF_CONFIG_OPTION_TT_SIZE_METRICS
configuration option. However, it is strongly recommended to
avoid that, adjusting font sizes instead.
- If a TrueType font gets loaded with FT_LOAD_NO_HINTING, FreeType - If a TrueType font gets loaded with FT_LOAD_NO_HINTING, FreeType
now scales the font linearly again (bug introduced in version now scales the font linearly again (bug introduced in version
2.4.6). 2.4.6).

View File

@ -909,11 +909,15 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Use TrueType-like size metrics for `light' auto-hinting. This option */ /* Use TrueType-like size metrics for `light' auto-hinting. */
/* exists mainly for backwards compatibility with GNU/Linux */ /* */
/* distributions like Fedora that did not un-patch the following change */ /* It is strongly recommended to avoid this option, which exists only to */
/* (which was present in FreeType between versions 2.4.6 and 2.7.1, */ /* help some legacy applications retain its appearance and behaviour */
/* inclusive). */ /* with respect to auto-hinted TrueType fonts. */
/* */
/* The very reason this option exists at all are GNU/Linux distributions */
/* like Fedora that did not un-patch the following change (which was */
/* present in FreeType between versions 2.4.6 and 2.7.1, inclusive). */
/* */ /* */
/* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */ /* 2011-07-16 Steven Chu <steven.f.chu@gmail.com> */
/* */ /* */

View File

@ -221,7 +221,6 @@ FT_BEGIN_HEADER
/* */ /* */
/* FT_LOAD_TARGET_NORMAL */ /* FT_LOAD_TARGET_NORMAL */
/* FT_LOAD_TARGET_LIGHT */ /* FT_LOAD_TARGET_LIGHT */
/* FT_LOAD_TARGET_SLIGHT */
/* FT_LOAD_TARGET_MONO */ /* FT_LOAD_TARGET_MONO */
/* FT_LOAD_TARGET_LCD */ /* FT_LOAD_TARGET_LCD */
/* FT_LOAD_TARGET_LCD_V */ /* FT_LOAD_TARGET_LCD_V */
@ -1756,12 +1755,37 @@ FT_BEGIN_HEADER
/* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */
/* */ /* */
/* Here is a small pseudo code fragment that shows how to use */ /* Here is a small pseudo code fragment that shows how to use */
/* `lsb_delta' and `rsb_delta' to improve (integer) positioning of */ /* `lsb_delta' and `rsb_delta' to do fractional positioning of */
/* glyphs: */ /* glyphs: */
/* */ /* */
/* { */ /* { */
/* FT_Pos origin_x = 0; */ /* FT_GlyphSlot slot = face->glyph; */
/* FT_Pos prev_rsb_delta = 0; */ /* FT_Pos origin_x = 0; */
/* */
/* */
/* for all glyphs do */
/* <load glyph with `FT_Load_Glyph'> */
/* */
/* FT_Outline_Translate( slot->outline, origin_x & 63, 0 ); */
/* */
/* <save glyph image, or render glyph, or ...> */
/* */
/* <compute kern between current and next glyph */
/* and add it to `origin_x'> */
/* */
/* origin_x += slot->advance.x; */
/* origin_x += slot->rsb_delta - slot->lsb_relta; */
/* endfor */
/* } */
/* */
/* Here is another small pseudo code fragment that shows how to use */
/* `lsb_delta' and `rsb_delta' to improve integer positioning of */
/* glyphs: */
/* */
/* { */
/* FT_GlyphSlot slot = face->glyph; */
/* FT_Pos origin_x = 0; */
/* FT_Pos prev_rsb_delta = 0; */
/* */ /* */
/* */ /* */
/* for all glyphs do */ /* for all glyphs do */
@ -1770,16 +1794,16 @@ FT_BEGIN_HEADER
/* */ /* */
/* <load glyph with `FT_Load_Glyph'> */ /* <load glyph with `FT_Load_Glyph'> */
/* */ /* */
/* if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 ) */ /* if ( prev_rsb_delta - slot->lsb_delta >= 32 ) */
/* origin_x -= 64; */ /* origin_x -= 64; */
/* else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 ) */ /* else if ( prev_rsb_delta - slot->lsb_delta < -32 ) */
/* origin_x += 64; */ /* origin_x += 64; */
/* */ /* */
/* prev_rsb_delta = face->glyph->rsb_delta; */ /* prev_rsb_delta = slot->rsb_delta; */
/* */ /* */
/* <save glyph image, or render glyph, or ...> */ /* <save glyph image, or render glyph, or ...> */
/* */ /* */
/* origin_x += face->glyph->advance.x; */ /* origin_x += slot->advance.x; */
/* endfor */ /* endfor */
/* } */ /* } */
/* */ /* */
@ -2937,8 +2961,8 @@ FT_BEGIN_HEADER
* rendering. For monochrome output, use @FT_LOAD_TARGET_MONO * rendering. For monochrome output, use @FT_LOAD_TARGET_MONO
* instead. * instead.
* *
* FT_LOAD_TARGET_SLIGHT :: * FT_LOAD_TARGET_LIGHT ::
* A slight hinting algorithm for gray-level modes. Many generated * A lighter hinting algorithm for gray-level modes. Many generated
* glyphs are fuzzier but better resemble their original shape. This * glyphs are fuzzier but better resemble their original shape. This
* is achieved by snapping glyphs to the pixel grid only vertically * is achieved by snapping glyphs to the pixel grid only vertically
* (Y-axis), as is done by FreeType's new CFF engine or Microsoft's * (Y-axis), as is done by FreeType's new CFF engine or Microsoft's
@ -2947,25 +2971,16 @@ FT_BEGIN_HEADER
* driver, if the driver itself and the font support it, or by the * driver, if the driver itself and the font support it, or by the
* auto-hinter. * auto-hinter.
* *
* Advance widths are not rounded to integer values; instead, metrics * Advance widths are rounded to integer values; however, using the
* are based on linearly scaled values. In particular this implies * `lsb_delta' and `rsb_delta' fields of @FT_GlyphSlotRec, it is
* that you have to apply sub-pixel rendering. * possible to get fractional advance widths for sub-pixel positioning
* * (which is recommended to use).
* FT_LOAD_TARGET_LIGHT ::
* This is similar to @FT_LOAD_TARGET_SLIGHT with a main difference:
* It uses integer advance widths.
* *
* If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active, * If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active,
* TrueType-like metrics are used to make this mode behave similarly * TrueType-like metrics are used to make this mode behave similarly
* as in unpatched FreeType versions between 2.4.6 and 2.7.1 * as in unpatched FreeType versions between 2.4.6 and 2.7.1
* (inclusive). * (inclusive).
* *
* This hinting mode is deprecated. In general,
* @FT_LOAD_TARGET_SLIGHT always yields better results; additionally,
* FT_LOAD_TARGET_LIGHT suffers from backwards compatibility issues
* (see the documentation of AF_CONFIG_OPTION_TT_SIZE_METRICS in
* `ftoption.h' for more details).
*
* FT_LOAD_TARGET_MONO :: * FT_LOAD_TARGET_MONO ::
* Strong hinting algorithm that should only be used for monochrome * Strong hinting algorithm that should only be used for monochrome
* output. The result is probably unpleasant if the glyph is rendered * output. The result is probably unpleasant if the glyph is rendered
@ -3001,18 +3016,17 @@ FT_BEGIN_HEADER
* } * }
* *
* In general, you should stick with one rendering mode. For example, * In general, you should stick with one rendering mode. For example,
* switching between @FT_LOAD_TARGET_LIGHT and @FT_LOAD_TARGET_SLIGHT * switching between @FT_LOAD_TARGET_NORMAL and @FT_LOAD_TARGET_MONO
* enforces a lot of recomputation, which is slow. Another reason is * enforces a lot of recomputation for TrueType fonts, which is slow.
* caching: Selecting a different mode usually causes changes in both * Another reason is caching: Selecting a different mode usually causes
* the outlines and the rasterized bitmaps; it is thus necessary to * changes in both the outlines and the rasterized bitmaps; it is thus
* empty the cache after a mode switch to avoid false hits. * necessary to empty the cache after a mode switch to avoid false hits.
* *
*/ */
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
#define FT_LOAD_TARGET_SLIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_SLIGHT )
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
@ -3093,12 +3107,6 @@ FT_BEGIN_HEADER
/* indirectly to define hinting algorithm selectors. See */ /* indirectly to define hinting algorithm selectors. See */
/* @FT_LOAD_TARGET_XXX for details. */ /* @FT_LOAD_TARGET_XXX for details. */
/* */ /* */
/* FT_RENDER_MODE_SLIGHT :: */
/* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only */
/* defined as a separate value because render modes are also used */
/* indirectly to define hinting algorithm selectors. See */
/* @FT_LOAD_TARGET_XXX for details. */
/* */
/* FT_RENDER_MODE_MONO :: */ /* FT_RENDER_MODE_MONO :: */
/* This mode corresponds to 1-bit bitmaps (with 2~levels of */ /* This mode corresponds to 1-bit bitmaps (with 2~levels of */
/* opacity). */ /* opacity). */
@ -3134,7 +3142,6 @@ FT_BEGIN_HEADER
FT_RENDER_MODE_MONO, FT_RENDER_MODE_MONO,
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD,
FT_RENDER_MODE_LCD_V, FT_RENDER_MODE_LCD_V,
FT_RENDER_MODE_SLIGHT,
FT_RENDER_MODE_MAX FT_RENDER_MODE_MAX

View File

@ -1398,12 +1398,9 @@
other_flags |= AF_LATIN_HINTS_VERT_SNAP; other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/* /*
* We adjust stems to full pixels unless in `light', `slight', * We adjust stems to full pixels unless in `light' or `lcd' mode.
* or `lcd' mode.
*/ */
if ( mode != FT_RENDER_MODE_LIGHT && if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
mode != FT_RENDER_MODE_SLIGHT &&
mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST; other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO ) if ( mode == FT_RENDER_MODE_MONO )

View File

@ -2577,9 +2577,7 @@
/* /*
* We adjust stems to full pixels unless in `light' or `lcd' mode. * We adjust stems to full pixels unless in `light' or `lcd' mode.
*/ */
if ( mode != FT_RENDER_MODE_LIGHT && if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
mode != FT_RENDER_MODE_SLIGHT &&
mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST; other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO ) if ( mode == FT_RENDER_MODE_MONO )
@ -2592,10 +2590,8 @@
* However, if warping is enabled (which only works in `light' hinting * However, if warping is enabled (which only works in `light' hinting
* mode), advance widths get adjusted, too. * mode), advance widths get adjusted, too.
*/ */
if ( mode == FT_RENDER_MODE_LIGHT || if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
mode == FT_RENDER_MODE_SLIGHT || ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
mode == FT_RENDER_MODE_LCD ||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL; scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
#ifdef AF_CONFIG_OPTION_USE_WARPER #ifdef AF_CONFIG_OPTION_USE_WARPER

View File

@ -1560,9 +1560,7 @@
/* /*
* We adjust stems to full pixels unless in `light' or `lcd' mode. * We adjust stems to full pixels unless in `light' or `lcd' mode.
*/ */
if ( mode != FT_RENDER_MODE_LIGHT && if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
mode != FT_RENDER_MODE_SLIGHT &&
mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST; other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO ) if ( mode == FT_RENDER_MODE_MONO )
@ -1572,10 +1570,8 @@
* In `light' or `lcd' mode we disable horizontal hinting completely. * In `light' or `lcd' mode we disable horizontal hinting completely.
* We also do it if the face is italic. * We also do it if the face is italic.
*/ */
if ( mode == FT_RENDER_MODE_LIGHT || if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
mode == FT_RENDER_MODE_SLIGHT || ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
mode == FT_RENDER_MODE_LCD ||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL; scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
#ifdef AF_CONFIG_OPTION_USE_WARPER #ifdef AF_CONFIG_OPTION_USE_WARPER

View File

@ -245,15 +245,14 @@
if ( !size_internal->autohint_metrics.x_scale || if ( !size_internal->autohint_metrics.x_scale ||
size_internal->autohint_mode != FT_LOAD_TARGET_MODE( load_flags ) ) size_internal->autohint_mode != FT_LOAD_TARGET_MODE( load_flags ) )
{ {
/* switching between LIGHT and SLIGHT (and vice versa) usually means */ /* switching between hinting modes usually means different scaling */
/* different scaling values; this later on enforces recomputation of */ /* values; this later on enforces recomputation of everything */
/* everything related to the current size */ /* related to the current size */
size_internal->autohint_mode = FT_LOAD_TARGET_MODE( load_flags ); size_internal->autohint_mode = FT_LOAD_TARGET_MODE( load_flags );
size_internal->autohint_metrics = size->metrics; size_internal->autohint_metrics = size->metrics;
#ifdef AF_CONFIG_OPTION_TT_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; FT_Size_Metrics* size_metrics = &size_internal->autohint_metrics;
@ -382,12 +381,11 @@
* *
*/ */
/* stem darkening only works well in `light' and `slight' modes */ /* stem darkening only works well in `light' mode */
if ( ( scaler.render_mode == FT_RENDER_MODE_LIGHT || if ( scaler.render_mode == FT_RENDER_MODE_LIGHT &&
scaler.render_mode == FT_RENDER_MODE_SLIGHT ) &&
( !face->internal->no_stem_darkening || ( !face->internal->no_stem_darkening ||
( face->internal->no_stem_darkening < 0 && ( face->internal->no_stem_darkening < 0 &&
!module->no_stem_darkening ) ) ) !module->no_stem_darkening ) ) )
af_loader_embolden_glyph_in_slot( loader, face, style_metrics ); af_loader_embolden_glyph_in_slot( loader, face, style_metrics );
loader->transformed = slot_internal->glyph_transformed; loader->transformed = slot_internal->glyph_transformed;
@ -435,8 +433,7 @@
/* we now need to adjust the metrics according to the change in */ /* we now need to adjust the metrics according to the change in */
/* width/positioning that occurred during the hinting process */ /* width/positioning that occurred during the hinting process */
if ( scaler.render_mode != FT_RENDER_MODE_LIGHT && if ( scaler.render_mode != FT_RENDER_MODE_LIGHT )
scaler.render_mode != FT_RENDER_MODE_SLIGHT )
{ {
FT_Pos old_rsb, old_lsb, new_lsb; FT_Pos old_rsb, old_lsb, new_lsb;
FT_Pos pp1x_uh, pp2x_uh; FT_Pos pp1x_uh, pp2x_uh;
@ -494,9 +491,8 @@
} }
} }
/* `light' mode uses integer advance widths */ /* `light' mode uses integer advance widths */
/* (but sets `lsb_delta' and `rsb_delta'), */ /* but sets `lsb_delta' and `rsb_delta' */
/* `slight' mode uses fractional values */ else
else if ( scaler.render_mode == FT_RENDER_MODE_LIGHT )
{ {
FT_Pos pp1x = loader->pp1.x; FT_Pos pp1x = loader->pp1.x;
FT_Pos pp2x = loader->pp2.x; FT_Pos pp2x = loader->pp2.x;
@ -508,11 +504,6 @@
slot->lsb_delta = loader->pp1.x - pp1x; slot->lsb_delta = loader->pp1.x - pp1x;
slot->rsb_delta = loader->pp2.x - pp2x; slot->rsb_delta = loader->pp2.x - pp2x;
} }
else
{
slot->lsb_delta = 0;
slot->rsb_delta = 0;
}
break; break;
@ -563,7 +554,6 @@
/* to keep the original rounded advance width; ditto for */ /* to keep the original rounded advance width; ditto for */
/* digits if all have the same advance width */ /* digits if all have the same advance width */
if ( scaler.render_mode != FT_RENDER_MODE_LIGHT && if ( scaler.render_mode != FT_RENDER_MODE_LIGHT &&
scaler.render_mode != FT_RENDER_MODE_SLIGHT &&
( FT_IS_FIXED_WIDTH( slot->face ) || ( FT_IS_FIXED_WIDTH( slot->face ) ||
( af_face_globals_is_digit( loader->globals, glyph_index ) && ( af_face_globals_is_digit( loader->globals, glyph_index ) &&
style_metrics->digits_have_same_width ) ) ) style_metrics->digits_have_same_width ) ) )
@ -587,8 +577,7 @@
slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance, slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
style_metrics->scaler.y_scale ); 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->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
slot->format = FT_GLYPH_FORMAT_OUTLINE; slot->format = FT_GLYPH_FORMAT_OUTLINE;

View File

@ -59,15 +59,14 @@
/* */ /* */
/* - unscaled load */ /* - unscaled load */
/* - unhinted load */ /* - unhinted load */
/* - light-hinted and slight-hinted load */ /* - light-hinted load */
/* - if a variations font, it must have an `HVAR' or `VVAR' */ /* - if a variations font, it must have an `HVAR' or `VVAR' */
/* table (thus the old MM or GX fonts don't qualify; this */ /* table (thus the old MM or GX fonts don't qualify; this */
/* gets checked by the driver-specific functions) */ /* gets checked by the driver-specific functions) */
#define LOAD_ADVANCE_FAST_CHECK( face, flags ) \ #define LOAD_ADVANCE_FAST_CHECK( face, flags ) \
( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) || \ ( 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_LIGHT )
FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_SLIGHT ) )
/* documentation is in ftadvanc.h */ /* documentation is in ftadvanc.h */

View File

@ -668,8 +668,8 @@
* - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
* have a native font hinter. * have a native font hinter.
* *
* - Otherwise, auto-hint for LIGHT or SLIGHT hinting mode or if there * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't
* isn't any hinting bytecode in the TrueType/OpenType font. * any hinting bytecode in the TrueType/OpenType font.
* *
* - Exception: The font is `tricky' and requires the native hinter to * - Exception: The font is `tricky' and requires the native hinter to
* load properly. * load properly.
@ -702,9 +702,8 @@
/* check the size of the `fpgm' and `prep' tables, too -- */ /* check the size of the `fpgm' and `prep' tables, too -- */
/* the assumption is that there don't exist real TTFs where */ /* the assumption is that there don't exist real TTFs where */
/* both `fpgm' and `prep' tables are missing */ /* both `fpgm' and `prep' tables are missing */
if ( ( ( mode == FT_RENDER_MODE_LIGHT || if ( ( mode == FT_RENDER_MODE_LIGHT &&
mode == FT_RENDER_MODE_SLIGHT ) && !FT_DRIVER_HINTS_LIGHTLY( driver ) ) ||
!FT_DRIVER_HINTS_LIGHTLY( driver ) ) ||
( FT_IS_SFNT( face ) && ( FT_IS_SFNT( face ) &&
ttface->num_locations && ttface->num_locations &&
ttface->max_profile.maxSizeOfInstructions == 0 && ttface->max_profile.maxSizeOfInstructions == 0 &&

View File

@ -2149,8 +2149,7 @@
glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO || glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO ||
hint_mode == FT_RENDER_MODE_LCD_V ); hint_mode == FT_RENDER_MODE_LCD_V );
glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT && glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT );
hint_mode != FT_RENDER_MODE_SLIGHT );
for ( dimension = 0; dimension < 2; dimension++ ) for ( dimension = 0; dimension < 2; dimension++ )
{ {

View File

@ -433,8 +433,7 @@
FT_Render_Mode mode, FT_Render_Mode mode,
const FT_Vector* origin ) const FT_Vector* origin )
{ {
if ( mode == FT_RENDER_MODE_LIGHT || if ( mode == FT_RENDER_MODE_LIGHT )
mode == FT_RENDER_MODE_SLIGHT )
mode = FT_RENDER_MODE_NORMAL; mode = FT_RENDER_MODE_NORMAL;
return ft_smooth_render_generic( render, slot, mode, origin, return ft_smooth_render_generic( render, slot, mode, origin,

View File

@ -2737,7 +2737,7 @@
/* TrueType glyphs at all sizes using the bytecode interpreter. */ /* TrueType glyphs at all sizes using the bytecode interpreter. */
/* */ /* */
if ( !( load_flags & FT_LOAD_NO_SCALE ) && if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
size->metrics->y_ppem < 24 ) size->metrics->y_ppem < 24 )
glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION; glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
Exit: Exit:

View File

@ -1234,6 +1234,7 @@
/* */ /* */
if ( face->header.Flags & 8 ) if ( face->header.Flags & 8 )
{ {
/* the TT spec always asks for ROUND, not FLOOR or CEIL */
size_metrics->ascender = FT_PIX_ROUND( size_metrics->ascender = FT_PIX_ROUND(
FT_MulFix( face->root.ascender, FT_MulFix( face->root.ascender,
size_metrics->y_scale ) ); size_metrics->y_scale ) );
@ -1252,6 +1253,8 @@
if ( face->header.Flags & 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, size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
face->root.units_per_EM ); face->root.units_per_EM );
size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6, size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,