* src/autofit/aflatin.c, src/autofit/afhints.c: changed the implementation of the LIGHT hinting mode to completely disable horizontal hinting. This is an experimental effort to integrate David Chester's latest patch without fucking the other hinting modes as well. Note that this doesn't force auto-hinting for all fonts however.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
diff --git a/ChangeLog b/ChangeLog
index 801b05d..481c0f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-12-13 David Turner <david@freetype.org>
+
+ * src/autofit/aflatin.c, src/autofit/afhints.c: changed the
+ implementation of the LIGHT hinting mode to completely disable
+ horizontal hinting. This is an experimental effort to integrate
+ David Chester's latest patch without fucking the other hinting
+ modes as well.
+
+ Note that this doesn't force auto-hinting for all fonts however.
+
2005-12-07 Werner Lemberg <wl@gnu.org>
* src/sfnt/sfobjc.c (sfnt_init_face): Move tag check to...
@@ -33,11 +43,11 @@
segments for cmap format 4. For overlapping but sorted segments,
which is previously considered unsorted, we still use binary search.
- * src/sfnt/ttcmap.h (TT_CMapRec_): Replace `unsorted' by `flags'.
+ * src/sfnt/ttcmap.h (TT_CMapRec_): Replace `unsorted' by `flags'.
(TT_CMAP_FLAG_UNSORTED, TT_CMAP_FLAG_OVERLAPPED): New macros.
* src/sfnt/ttcmap.c (OPT_CMAP4): Removed as it is always defined.
- (TT_CMap4Rec_): Remove `old_charcode' and `table_length'.
+ (TT_CMap4Rec_): Remove `old_charcode' and `table_length'.
(tt_cmap4_reset): Removed.
(tt_cmap4_init): Updated accordingly.
(tt_cmap4_next): Updated accordingly.
diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c
index 0826571..b37ef0e 100644
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -509,7 +509,8 @@
af_glyph_hints_rescale( AF_GlyphHints hints,
AF_ScriptMetrics metrics )
{
- hints->metrics = metrics;
+ hints->metrics = metrics;
+ hints->scaler_flags = metrics->scaler.flags;
}
@@ -520,7 +521,6 @@
FT_Error error = AF_Err_Ok;
AF_Point points;
FT_UInt old_max, new_max;
- AF_Scaler scaler = &hints->metrics->scaler;
FT_Fixed x_scale = hints->x_scale;
FT_Fixed y_scale = hints->y_scale;
FT_Pos x_delta = hints->x_delta;
@@ -528,7 +528,6 @@
FT_Memory memory = hints->memory;
- hints->scaler_flags = scaler->flags;
hints->num_points = 0;
hints->num_contours = 0;
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index b7e04e3..8b62557 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1294,6 +1294,7 @@
AF_LatinMetrics metrics )
{
FT_Render_Mode mode;
+ FT_UInt32 scaler_flags, other_flags;
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)metrics );
@@ -1308,33 +1309,41 @@
hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;
/* compute flags depending on render mode, etc... */
-
mode = metrics->root.scaler.render_mode;
- hints->other_flags = 0;
+ scaler_flags = hints->scaler_flags;
+ other_flags = 0;
/*
* We snap the width of vertical stems for the monochrome and
* horizontal LCD rendering targets only.
*/
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
- hints->other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
+ other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
/*
* We snap the width of horizontal stems for the monochrome and
* vertical LCD rendering targets only.
*/
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
- hints->other_flags |= AF_LATIN_HINTS_VERT_SNAP;
+ other_flags |= AF_LATIN_HINTS_VERT_SNAP;
/*
* We adjust stems to full pixels only if we don't use the `light' mode.
*/
if ( mode != FT_RENDER_MODE_LIGHT )
- hints->other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
+ other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
if ( mode == FT_RENDER_MODE_MONO )
- hints->other_flags |= AF_LATIN_HINTS_MONO;
+ other_flags |= AF_LATIN_HINTS_MONO;
+
+ /* in 'light' hinting mode, we disable horizontal hinting completely
+ */
+ if ( mode == FT_RENDER_MODE_LIGHT )
+ scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
+
+ hints->scaler_flags = scaler_flags;
+ hints->other_flags = other_flags;
return 0;
}