* src/autohint/ahtypes.h, src/autohint/ahhint.c, src/pshinter/pshalgo3.h, src/pshinter/pshalgo3.c: implemented the FT_RENDER_MODE_LIGHT hinting mode in the auto and postscript hinters
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
diff --git a/ChangeLog b/ChangeLog
index 23363b1..8dadbf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-01-08 Owen Taylor <owen@redhat.com>
+
+ * src/autohint/ahtypes.h, src/autohint/ahhint.c, src/pshinter/pshalgo3.h,
+ src/pshinter/pshalgo3.c: implemented the FT_RENDER_MODE_LIGHT hinting
+ mode in the auto and postscript hinters
+
2003-01-08 David Turner <david@freetype.org>
* src/base/ftobjs.c (find_unicode_charmap): fixed the error code
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index 689f4b9..1e2b7b3 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -104,8 +104,12 @@
sign = 1;
}
- if ( ( vertical && !hinter->do_vert_snapping ) ||
- ( !vertical && !hinter->do_horz_snapping ) )
+ if ( !hinter->do_stem_adjust )
+ {
+ /* leave stem widths unchanged */
+ }
+ else if ( ( vertical && !hinter->do_vert_snapping ) ||
+ ( !vertical && !hinter->do_horz_snapping ) )
{
/* smooth hinting process, very lightly quantize the stem width */
/* */
@@ -1427,6 +1431,8 @@
hinter->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO ||
hint_mode == FT_RENDER_MODE_LCD_V );
+ hinter->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT );
+
#if 1
load_flags = FT_LOAD_NO_SCALE
| FT_LOAD_IGNORE_TRANSFORM ;
diff --git a/src/autohint/ahtypes.h b/src/autohint/ahtypes.h
index 50d0f86..c9fbf27 100644
--- a/src/autohint/ahtypes.h
+++ b/src/autohint/ahtypes.h
@@ -496,6 +496,7 @@ FT_BEGIN_HEADER
FT_Bool do_vert_hints; /* disable Y hinting */
FT_Bool do_horz_snapping; /* disable X stem size snapping */
FT_Bool do_vert_snapping; /* disable Y stem size snapping */
+ FT_Bool do_stem_adjust; /* disable light stem snapping */
} AH_HinterRec, *AH_Hinter;
diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c
index 4ee0171..12a0f16 100644
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -516,17 +516,20 @@
hint->cur_pos = pos;
hint->cur_len = fit_len;
- if ( len <= 64 )
+ if ( glyph->do_stem_adjust )
{
- /* the stem is less than one pixel, we will center it */
- /* around the nearest pixel center */
- /* */
- pos = ( pos + ( (len >> 1) & -64 ) );
- len = 64;
- }
- else
- {
- len = psh3_dimension_quantize_len( dim, len, 0 );
+ if ( len <= 64 )
+ {
+ /* the stem is less than one pixel, we will center it */
+ /* around the nearest pixel center */
+ /* */
+ pos = ( pos + ( (len >> 1) & -64 ) );
+ len = 64;
+ }
+ else
+ {
+ len = psh3_dimension_quantize_len( dim, len, 0 );
+ }
}
/* now that we have a good hinted stem width, try to position */
@@ -1720,6 +1723,8 @@
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 );
+
for ( dimension = 0; dimension < 2; dimension++ )
{
/* load outline coordinates into glyph */
diff --git a/src/pshinter/pshalgo3.h b/src/pshinter/pshalgo3.h
index 18f5374..7b69bb0 100644
--- a/src/pshinter/pshalgo3.h
+++ b/src/pshinter/pshalgo3.h
@@ -221,6 +221,7 @@ FT_BEGIN_HEADER
FT_Bool do_vert_hints;
FT_Bool do_horz_snapping;
FT_Bool do_vert_snapping;
+ FT_Bool do_stem_adjust;
} PSH3_GlyphRec, *PSH3_Glyph;