summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2003-05-28 22:42:41 +0000
committerWerner Lemberg <wl@gnu.org>2003-05-28 22:42:41 +0000
commit0bdf608f3d79e7b45983b88a7733426c06eb5f49 (patch)
tree60ef4007a94151413158a501c529988d702d9eca /tests
parent26fb1bcd05afc1d61ad80cd7313aa5a88713e78b (diff)
downloadfreetype2-0bdf608f3d79e7b45983b88a7733426c06eb5f49.tar.gz
* src/pshinter/pshalgo1.[ch], src/pshinter/pshalgo2.[ch]: Removed.
* src/pshinter/pshalgo.h: Removed. * src/pshinter/pshalgo3.[ch]: Renamed to... * src/pshinter/pshalgo.[ch]: New files. s/PSH3/PSH/. s/psh3/psh/. s/ps3/ps/. * src/pshinter/pshrec.c, src/pshinter/pshinter.c: Updated. * src/pshinter/rules.mk, src/pshinter/Jamfile: Updated * src/pshinter/pshglob.[ch] (psh_dimension_snap_width): Commented out. * tests/gview.c: Remove code for pshalgo1 and pshalgo2. Updated.
Diffstat (limited to 'tests')
-rw-r--r--tests/gview.c293
1 files changed, 19 insertions, 274 deletions
diff --git a/tests/gview.c b/tests/gview.c
index 0e76e19ef..18d6c5a24 100644
--- a/tests/gview.c
+++ b/tests/gview.c
@@ -7,9 +7,7 @@
/* include FreeType internals to debug hints */
#include <../src/pshinter/pshrec.h>
-#include <../src/pshinter/pshalgo1.h>
-#include <../src/pshinter/pshalgo2.h>
-#include <../src/pshinter/pshalgo3.h>
+#include <../src/pshinter/pshalgo.h>
#include <../src/autohint/ahtypes.h>
@@ -358,271 +356,20 @@ draw_ps_blue_zones( void )
}
}
- /************************************************************************/
- /************************************************************************/
- /***** *****/
- /***** POSTSCRIPT HINTER ALGORITHM 1 ROUTINES *****/
- /***** *****/
- /************************************************************************/
- /************************************************************************/
-
-#include <../src/pshinter/pshalgo1.h>
-
-static int pshint_cpos = 0;
-static int pshint_vertical = -1;
-
-static void
-draw_ps1_hint( PSH1_Hint hint, FT_Bool vertical )
-{
- int x1, x2;
- NV_Vector v;
-
-
- if ( pshint_vertical != vertical )
- {
- if (vertical)
- pshint_cpos = 40;
- else
- pshint_cpos = 10;
-
- pshint_vertical = vertical;
- }
-
- if (vertical)
- {
- if ( !option_show_vert_hints )
- return;
-
- v.x = hint->cur_pos;
- v.y = 0;
- nv_vector_transform( &v, &size_transform );
- x1 = (int)(v.x + 0.5);
-
- v.x = hint->cur_pos + hint->cur_len;
- v.y = 0;
- nv_vector_transform( &v, &size_transform );
- x2 = (int)(v.x + 0.5);
-
- nv_pixmap_fill_rect( target, x1, 0, 1, target->height,
- psh1_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- if ( psh1_hint_is_ghost(hint) )
- {
- x1 --;
- x2 = x1 + 2;
- }
- else
- nv_pixmap_fill_rect( target, x2, 0, 1, target->height,
- psh1_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- nv_pixmap_fill_rect( target, x1, pshint_cpos, x2+1-x1, 1,
- STEM_JOIN_COLOR );
- }
- else
- {
- if (!option_show_horz_hints)
- return;
-
- v.y = hint->cur_pos;
- v.x = 0;
- nv_vector_transform( &v, &size_transform );
- x1 = (int)(v.y + 0.5);
-
- v.y = hint->cur_pos + hint->cur_len;
- v.x = 0;
- nv_vector_transform( &v, &size_transform );
- x2 = (int)(v.y + 0.5);
-
- nv_pixmap_fill_rect( target, 0, x1, target->width, 1,
- psh1_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- if ( psh1_hint_is_ghost(hint) )
- {
- x1 --;
- x2 = x1 + 2;
- }
- else
- nv_pixmap_fill_rect( target, 0, x2, target->width, 1,
- psh1_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- nv_pixmap_fill_rect( target, pshint_cpos, x2, 1, x1+1-x2,
- STEM_JOIN_COLOR );
- }
-
-#if 0
- printf( "[%7.3f %7.3f] %c\n", hint->cur_pos/64.0, (hint->cur_pos+hint->cur_len)/64.0, vertical ? 'v' : 'h' );
-#endif
-
- pshint_cpos += 10;
-}
-
-
-
- /************************************************************************/
- /************************************************************************/
- /***** *****/
- /***** POSTSCRIPT HINTER ALGORITHM 2 ROUTINES *****/
- /***** *****/
- /************************************************************************/
- /************************************************************************/
-
-#include <../src/pshinter/pshalgo2.h>
-
-static void
-draw_ps2_hint( PSH2_Hint hint, FT_Bool vertical )
-{
- int x1, x2;
- NV_Vector v;
-
- if ( pshint_vertical != vertical )
- {
- if (vertical)
- pshint_cpos = 40;
- else
- pshint_cpos = 10;
-
- pshint_vertical = vertical;
- }
-
- if (vertical)
- {
- if ( !option_show_vert_hints )
- return;
-
- v.x = hint->cur_pos;
- v.y = 0;
- nv_vector_transform( &v, &size_transform );
- x1 = (int)(v.x + 0.5);
-
- v.x = hint->cur_pos + hint->cur_len;
- v.y = 0;
- nv_vector_transform( &v, &size_transform );
- x2 = (int)(v.x + 0.5);
-
- nv_pixmap_fill_rect( target, x1, 0, 1, target->height,
- psh2_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- if ( psh2_hint_is_ghost(hint) )
- {
- x1 --;
- x2 = x1 + 2;
- }
- else
- nv_pixmap_fill_rect( target, x2, 0, 1, target->height,
- psh2_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- nv_pixmap_fill_rect( target, x1, pshint_cpos, x2+1-x1, 1,
- STEM_JOIN_COLOR );
- }
- else
- {
- if (!option_show_horz_hints)
- return;
-
- v.y = hint->cur_pos;
- v.x = 0;
- nv_vector_transform( &v, &size_transform );
- x1 = (int)(v.y + 0.5);
-
- v.y = hint->cur_pos + hint->cur_len;
- v.x = 0;
- nv_vector_transform( &v, &size_transform );
- x2 = (int)(v.y + 0.5);
-
- nv_pixmap_fill_rect( target, 0, x1, target->width, 1,
- psh2_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- if ( psh2_hint_is_ghost(hint) )
- {
- x1 --;
- x2 = x1 + 2;
- }
- else
- nv_pixmap_fill_rect( target, 0, x2, target->width, 1,
- psh2_hint_is_ghost(hint)
- ? GHOST_HINT_COLOR : STEM_HINT_COLOR );
-
- nv_pixmap_fill_rect( target, pshint_cpos, x2, 1, x1+1-x2,
- STEM_JOIN_COLOR );
- }
-
-#if 0
- printf( "[%7.3f %7.3f] %c\n", hint->cur_pos/64.0, (hint->cur_pos+hint->cur_len)/64.0, vertical ? 'v' : 'h' );
-#endif
-
- pshint_cpos += 10;
-}
-
-
-static void
-ps2_draw_control_points( void )
-{
- if ( ps2_debug_glyph )
- {
- PSH2_Glyph glyph = ps2_debug_glyph;
- PSH2_Point point = glyph->points;
- FT_UInt count = glyph->num_points;
- NV_Transform transform, *trans = &transform;
- NV_Path vert_rect;
- NV_Path horz_rect;
- NV_Path dot, circle;
-
- for ( ; count > 0; count--, point++ )
- {
- NV_Vector vec;
-
- vec.x = point->cur_x;
- vec.y = point->cur_y;
- nv_vector_transform( &vec, &size_transform );
-
- nv_transform_set_translate( trans, vec.x, vec.y );
-
- if ( option_show_smooth && !psh2_point_is_smooth(point) )
- {
- nv_painter_set_color( painter, SMOOTH_COLOR, 256 );
- nv_painter_fill_path( painter, trans, 0, symbol_circle );
- }
-
- if (option_show_horz_hints)
- {
- if ( point->flags_y & PSH2_POINT_STRONG )
- {
- nv_painter_set_color( painter, STRONG_COLOR, 256 );
- nv_painter_fill_path( painter, trans, 0, symbol_rect_h );
- }
- }
-
- if (option_show_vert_hints)
- {
- if ( point->flags_x & PSH2_POINT_STRONG )
- {
- nv_painter_set_color( painter, STRONG_COLOR, 256 );
- nv_painter_fill_path( painter, trans, 0, symbol_rect_v );
- }
- }
- }
- }
-}
/************************************************************************/
/************************************************************************/
/***** *****/
- /***** POSTSCRIPT HINTER ALGORITHM 3 ROUTINES *****/
+ /***** POSTSCRIPT HINTER ALGORITHM ROUTINES *****/
/***** *****/
/************************************************************************/
/************************************************************************/
-#include <../src/pshinter/pshalgo3.h>
+#include <../src/pshinter/pshalgo.h>
static void
-draw_ps3_hint( PSH3_Hint hint, FT_Bool vertical )
+draw_ps_hint( PSH_Hint hint,
+ FT_Bool vertical )
{
int x1, x2;
NV_Vector v;
@@ -653,17 +400,17 @@ draw_ps3_hint( PSH3_Hint hint, FT_Bool vertical )
x2 = (int)(v.x + 0.5);
nv_pixmap_fill_rect( target, x1, 0, 1, target->height,
- psh3_hint_is_ghost(hint)
+ psh_hint_is_ghost( hint )
? GHOST_HINT_COLOR : STEM_HINT_COLOR );
- if ( psh3_hint_is_ghost(hint) )
+ if ( psh_hint_is_ghost( hint ) )
{
x1 --;
x2 = x1 + 2;
}
else
nv_pixmap_fill_rect( target, x2, 0, 1, target->height,
- psh3_hint_is_ghost(hint)
+ psh_hint_is_ghost( hint )
? GHOST_HINT_COLOR : STEM_HINT_COLOR );
nv_pixmap_fill_rect( target, x1, pshint_cpos, x2+1-x1, 1,
@@ -685,17 +432,17 @@ draw_ps3_hint( PSH3_Hint hint, FT_Bool vertical )
x2 = (int)(v.y + 0.5);
nv_pixmap_fill_rect( target, 0, x1, target->width, 1,
- psh3_hint_is_ghost(hint)
+ psh_hint_is_ghost( hint )
? GHOST_HINT_COLOR : STEM_HINT_COLOR );
- if ( psh3_hint_is_ghost(hint) )
+ if ( psh_hint_is_ghost(hint) )
{
x1 --;
x2 = x1 + 2;
}
else
nv_pixmap_fill_rect( target, 0, x2, target->width, 1,
- psh3_hint_is_ghost(hint)
+ psh_hint_is_ghost(hint)
? GHOST_HINT_COLOR : STEM_HINT_COLOR );
nv_pixmap_fill_rect( target, pshint_cpos, x2, 1, x1+1-x2,
@@ -711,12 +458,12 @@ draw_ps3_hint( PSH3_Hint hint, FT_Bool vertical )
static void
-ps3_draw_control_points( void )
+ps_draw_control_points( void )
{
- if ( ps3_debug_glyph )
+ if ( ps_debug_glyph )
{
- PSH3_Glyph glyph = ps3_debug_glyph;
- PSH3_Point point = glyph->points;
+ PSH_Glyph glyph = ps_debug_glyph;
+ PSH_Point point = glyph->points;
FT_UInt count = glyph->num_points;
NV_Transform transform, *trans = &transform;
NV_Path vert_rect;
@@ -733,7 +480,7 @@ ps3_draw_control_points( void )
nv_transform_set_translate( trans, vec.x, vec.y );
- if ( option_show_smooth && !psh3_point_is_smooth(point) )
+ if ( option_show_smooth && !psh_point_is_smooth(point) )
{
nv_painter_set_color( painter, SMOOTH_COLOR, 256 );
nv_painter_fill_path( painter, trans, 0, symbol_circle );
@@ -741,7 +488,7 @@ ps3_draw_control_points( void )
if (option_show_horz_hints)
{
- if ( point->flags_y & PSH3_POINT_STRONG )
+ if ( point->flags_y & PSH_POINT_STRONG )
{
nv_painter_set_color( painter, STRONG_COLOR, 256 );
nv_painter_fill_path( painter, trans, 0, symbol_rect_h );
@@ -750,7 +497,7 @@ ps3_draw_control_points( void )
if (option_show_vert_hints)
{
- if ( point->flags_x & PSH3_POINT_STRONG )
+ if ( point->flags_x & PSH_POINT_STRONG )
{
nv_painter_set_color( painter, STRONG_COLOR, 256 );
nv_painter_fill_path( painter, trans, 0, symbol_rect_v );
@@ -1104,9 +851,7 @@ draw_glyph( int glyph_index )
pshint_vertical = -1;
- ps1_debug_hint_func = option_show_ps_hints ? draw_ps1_hint : 0;
- ps2_debug_hint_func = option_show_ps_hints ? draw_ps2_hint : 0;
- ps3_debug_hint_func = option_show_ps_hints ? draw_ps3_hint : 0;
+ ps_debug_hint_func = option_show_ps_hints ? draw_ps_hint : 0;
ah_debug_hinter = NULL;