diff -ur ft2demos-2.1.10.old/src/ftview.c ft2demos-2.1.10/src/ftview.c --- ft2demos-2.1.10.old/src/ftview.c 2005-05-26 02:31:14.000000000 +0800 +++ ft2demos-2.1.10/src/ftview.c 2006-03-18 09:32:41.000000000 +0800 @@ -84,6 +84,7 @@ FTC_ScalerRec scaler; FT_Stroker stroker = NULL; int i; + FT_ULong gindex; grBitmap bit3; @@ -117,20 +118,18 @@ y = start_y; i = first_index; - i = first_index; - while ( i < face->num_glyphs ) + while ( i < num_indices) { int left, top, x_advance, y_advance, x_top, y_top; FT_GlyphSlot slot = size->face->glyph; FT_Glyph glyphp; -#if 0 - gindex = *(unsigned char*)p; - if ( encoding == FT_ENCODING_NONE ) + gindex = i; + if ( encoding != FT_ENCODING_NONE ) gindex = get_glyph_index( gindex ); -#endif - error = FT_Load_Glyph( size->face, i, FT_LOAD_NO_BITMAP ); + + error = FT_Load_Glyph( size->face, gindex, FT_LOAD_NO_BITMAP ); if ( !error && slot->format == FT_GLYPH_FORMAT_OUTLINE ) { FT_Glyph glyphb; @@ -199,6 +198,7 @@ FT_F26Dot6 start_x, start_y, step_x, step_y, x, y; FTC_ScalerRec scaler; int i; + FT_ULong gindex; grBitmap bit3; @@ -222,20 +222,18 @@ y = start_y; i = first_index; - i = first_index; - while ( i < face->num_glyphs ) + while ( i < num_indices) { int left, top, x_advance, y_advance, x_top, y_top; FT_GlyphSlot slot = size->face->glyph; FT_Glyph glyphp; -#if 0 - gindex = *(unsigned char*)p; - if ( encoding == FT_ENCODING_NONE ) + gindex = i; + if ( encoding != FT_ENCODING_NONE ) gindex = get_glyph_index( gindex ); -#endif - error = FT_Load_Glyph( size->face, i, FT_LOAD_DEFAULT ); + + error = FT_Load_Glyph( size->face, gindex, FT_LOAD_DEFAULT ); if ( !error ) { FT_Glyph glyphb;