summaryrefslogtreecommitdiff
path: root/src/smooth/ftsmooth.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2017-04-22 13:27:21 +0200
committerWerner Lemberg <wl@gnu.org>2017-04-26 11:39:53 +0200
commit5aa6716a5eb8409f606886b5d4e63476d85a3519 (patch)
tree9e802a4bd0e221dceb162c98fc7c0a02413fa8d3 /src/smooth/ftsmooth.c
parent69da54cacc0056a40fc7f88278c4c60fd35e7bb9 (diff)
downloadfreetype2-5aa6716a5eb8409f606886b5d4e63476d85a3519.tar.gz
Add new `slight' auto-hinting mode.
This mode uses fractional advance widths and doesn't scale glyphs horizontally, only applying vertical scaling and hinting. At the same time, the behaviour of the `light' auto-hinter gets restored for backwards compatibility: Both vertical and horizontal scaling is again based on rounded metrics values (this was changed in a commit from 2017-03-30 as a side effect). To be more precise, the behaviour is restored for TrueType fonts only; for other font formats like Type 1, this is a new feature of the `light' hinting mode. * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT): New macro. (FT_RENDER_MODE_SLIGHT): New render mode. * include/freetype/internal/ftobjs.h (FT_Size_InternalRec): Add `autohint_mode' and `autohint_metrics' fields. * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c (af_latin_hints_init), src/autofit/aflatin2 (af_latin2_hints_init): Updated. * src/autofit/afloader.c (af_loader_embolden_glyph_in_slot): Use `autohint_metrics'. (af_loader_load_glyph): s/internal/slot_internal/. Initialize `autohint_metrics' and `autohint_mode' depending on current auto-hint mode. Use `autohint_metrics'. Updated. * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Updated. * src/base/ftobjs.c (FT_Load_Glyph): Updated. (FT_New_Size): Allocate `internal' object. * src/pshinter/pshalgo.c (ps_hints_apply): Updated. * src/smooth/ftsmooth.c (ft_smooth_render): Updated.
Diffstat (limited to 'src/smooth/ftsmooth.c')
-rw-r--r--src/smooth/ftsmooth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 435854e67..52e61e559 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -433,7 +433,8 @@
FT_Render_Mode mode,
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;
return ft_smooth_render_generic( render, slot, mode, origin,