* src/pshinter/{pshalgo2.c, pshalgo1.c}: fixed stupid bug in sorting
routine that created nasty alignment artefacts. * src/pshinter/pshrec.c, tests/gview.c: debugging updates.. * src/smooth/ftgrays.c: de-activated experimental gamme support, apparently, "optimal" gamma tables depend on the monitor type, resolution and general karma, so it's better to compute them outside of the rasterizer itself..
This commit is contained in:
parent
adf07a930c
commit
f2c56515f5
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2001-11-20 David Turner <david@freetype.org>
|
||||
|
||||
* src/pshinter/{pshalgo2.c, pshalgo1.c}: fixed stupid bug in sorting
|
||||
routine that created nasty alignment artefacts.
|
||||
|
||||
* src/pshinter/pshrec.c, tests/gview.c: debugging updates..
|
||||
|
||||
* src/smooth/ftgrays.c: de-activated experimental gamme support,
|
||||
apparently, "optimal" gamma tables depend on the monitor type,
|
||||
resolution and general karma, so it's better to compute them outside
|
||||
of the rasterizer itself..
|
||||
|
||||
|
||||
2001-10-29 David Turner <david@freetype.org>
|
||||
|
||||
* src/smooth/ftgrays.c: adding experimental "gamma" support. This
|
||||
|
|
|
@ -285,7 +285,7 @@
|
|||
if ( hint2->org_pos < hint1->org_pos )
|
||||
break;
|
||||
|
||||
sort[i1] = hint2;
|
||||
sort[i2+1] = hint2;
|
||||
sort[i2] = hint1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,10 +282,11 @@
|
|||
for ( i2 = i1-1; i2 >= 0; i2-- )
|
||||
{
|
||||
hint2 = sort[i2];
|
||||
|
||||
if ( hint2->org_pos < hint1->org_pos )
|
||||
break;
|
||||
|
||||
sort[i1] = hint2;
|
||||
sort[i2+1] = hint2;
|
||||
sort[i2] = hint1;
|
||||
}
|
||||
}
|
||||
|
@ -1013,6 +1014,8 @@
|
|||
}
|
||||
|
||||
|
||||
#define PSH2_STRONG_THRESHOLD 10
|
||||
|
||||
static void
|
||||
psh2_hint_table_find_strong_point( PSH2_Hint_Table table,
|
||||
PSH2_Point point,
|
||||
|
@ -1031,7 +1034,7 @@
|
|||
FT_Pos d;
|
||||
|
||||
d = point->org_u - hint->org_pos;
|
||||
if ( ABS(d) < 3 )
|
||||
if ( ABS(d) < PSH2_STRONG_THRESHOLD )
|
||||
{
|
||||
Is_Strong:
|
||||
psh2_point_set_strong(point);
|
||||
|
@ -1040,7 +1043,7 @@
|
|||
}
|
||||
|
||||
d -= hint->org_len;
|
||||
if ( ABS(d) < 3 )
|
||||
if ( ABS(d) < PSH2_STRONG_THRESHOLD )
|
||||
goto Is_Strong;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} PSH2_Hint_TableRec, *PSH2_Hint_Table;
|
||||
|
||||
|
||||
typedef struct PSH2_PointRec_* PSH2_Point;
|
||||
typedef struct PSH2_ContourRec_* PSH2_Contour;
|
||||
|
||||
|
@ -128,6 +129,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} PSH2_PointRec;
|
||||
|
||||
|
||||
#define psh2_point_is_strong(p) ((p)->flags & PSH2_POINT_STRONG)
|
||||
#define psh2_point_is_fitted(p) ((p)->flags & PSH2_POINT_FITTED)
|
||||
#define psh2_point_is_smooth(p) ((p)->flags & PSH2_POINT_SMOOTH)
|
||||
|
|
|
@ -1009,9 +1009,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_VIEW
|
||||
#ifdef DEBUG_HINTER
|
||||
if (!error)
|
||||
the_ps_hints = hints;
|
||||
ps_debug_hints = hints;
|
||||
#endif
|
||||
return error;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
|
||||
/* experimental support for gamma correction within the rasterizer */
|
||||
#define GRAYS_USE_GAMMA
|
||||
#define xxxGRAYS_USE_GAMMA
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
|
|
@ -74,6 +74,7 @@ static int option_show_blues = 0;
|
|||
static int option_show_edges = 0;
|
||||
static int option_show_segments = 1;
|
||||
static int option_show_links = 1;
|
||||
static int option_show_indices = 0;
|
||||
|
||||
static int option_show_ps_hints = 1;
|
||||
static int option_show_horz_hints = 1;
|
||||
|
@ -607,6 +608,44 @@ ps2_draw_control_points( void )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ps_print_hints( void )
|
||||
{
|
||||
if ( ps_debug_hints )
|
||||
{
|
||||
FT_Int dimension;
|
||||
PSH_Dimension dim;
|
||||
|
||||
for ( dimension = 1; dimension >= 0; dimension-- )
|
||||
{
|
||||
PS_Dimension dim = &ps_debug_hints->dimension[ dimension ];
|
||||
PS_Mask mask = dim->masks.masks;
|
||||
FT_UInt count = dim->masks.num_masks;
|
||||
|
||||
printf( "%s hints -------------------------\n",
|
||||
dimension ? "vertical" : "horizontal" );
|
||||
|
||||
for ( ; count > 0; count--, mask++ )
|
||||
{
|
||||
FT_UInt index;
|
||||
|
||||
printf( "mask -> %d\n", mask->end_point );
|
||||
for ( index = 0; index < mask->num_bits; index++ )
|
||||
{
|
||||
if ( mask->bytes[ index >> 3 ] & (0x80 >> (index & 7)) )
|
||||
{
|
||||
PS_Hint hint = dim->hints.hints + index;
|
||||
|
||||
printf( "%c [%3d %3d (%4d)]\n", dimension ? "v" : "h",
|
||||
hint->pos, hint->pos + hint->len, hint->len );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -988,6 +1027,14 @@ draw_glyph( int glyph_index )
|
|||
nv_painter_set_color( painter, color, 256 );
|
||||
nv_painter_fill_path( painter, &trans, 0, symbol_dot );
|
||||
|
||||
if ( option_show_indices )
|
||||
{
|
||||
char temp[5];
|
||||
|
||||
sprintf( temp, "%d", m );
|
||||
nv_pixmap_cell_text( target, vec->x/64 + 4, vec->y/64 - 4,
|
||||
temp, TEXT_COLOR );
|
||||
}
|
||||
}
|
||||
|
||||
first = last + 1;
|
||||
|
@ -1126,12 +1173,19 @@ handle_event( NVV_EventRec* ev )
|
|||
case NVV_KEY('S'):
|
||||
TOGGLE_OPTION( option_show_smooth, "smooth points display" );
|
||||
|
||||
case NVV_KEY('i'):
|
||||
TOGGLE_OPTION( option_show_indices, "point index display" );
|
||||
|
||||
case NVV_KEY('b'):
|
||||
TOGGLE_OPTION( option_show_blues, "blue zones display" );
|
||||
|
||||
case NVV_KEY('h'):
|
||||
TOGGLE_OPTION( option_hinting, "hinting" )
|
||||
|
||||
case NVV_KEY('H'):
|
||||
ps_print_hints();
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue