summaryrefslogtreecommitdiff
path: root/src/autofit/afcjk.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/autofit/afcjk.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/autofit/afcjk.c')
-rw-r--r--src/autofit/afcjk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 61e29cded..86b8b4067 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -1398,9 +1398,12 @@
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/*
- * We adjust stems to full pixels unless in `light' or `lcd' mode.
+ * We adjust stems to full pixels unless in `light', `slight',
+ * or `lcd' mode.
*/
- if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
+ if ( mode != FT_RENDER_MODE_LIGHT &&
+ mode != FT_RENDER_MODE_SLIGHT &&
+ mode != FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO )