* 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.
This commit is contained in:
David Turner 2005-12-14 16:37:15 +00:00
parent 0779163ef9
commit 5b5f382b7d
3 changed files with 29 additions and 11 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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;
}