diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c index cc2aa95ea..6ce866575 100644 --- a/src/gf/gfdrivr.c +++ b/src/gf/gfdrivr.c @@ -133,8 +133,8 @@ FT_CALLBACK_DEF( void ) GF_Face_Done( FT_Face gfface ) /* GF_Face */ { - GF_Face face = (GF_Face)gfface; - FT_Memory memory= FT_FACE_MEMORY( gfface ); + GF_Face face = (GF_Face)gfface; + FT_Memory memory; if ( !face ) @@ -142,7 +142,10 @@ memory = FT_FACE_MEMORY( face ); - gf_free_font( gfface, memory ); + /*gf_free_font( face );*/ + + /*FT_FREE( gfface->available_sizes );*/ + } @@ -409,8 +412,8 @@ slot->bitmap_left = bm.off_x / go->hppp; slot->bitmap_top = ascent ; - slot->metrics.horiAdvance = (FT_Pos) bm.mv_x * 64; - slot->metrics.horiBearingX = (FT_Pos) bm.off_x * 64; + slot->metrics.horiAdvance = (FT_Pos) (bm.mv_x / go->hppp) * 64; + slot->metrics.horiBearingX = (FT_Pos) (bm.off_x / go->hppp) * 64; slot->metrics.horiBearingY = (FT_Pos) ascent * 64; slot->metrics.width = (FT_Pos) ( bitmap->width * 64 ); slot->metrics.height = (FT_Pos) ( bitmap->rows * 64 ); diff --git a/src/gf/gflib.c b/src/gf/gflib.c index ff6fe9099..c425401d5 100644 --- a/src/gf/gflib.c +++ b/src/gf/gflib.c @@ -133,7 +133,6 @@ unsigned char bit_table[] = { min_n = READ_INT4( stream ); max_n = READ_INT4( stream ); break; - case GF_BOC1: if ( FT_STREAM_SKIP( 1 ) ) return -1; @@ -144,7 +143,6 @@ unsigned char bit_table[] = { min_m = max_m - del_m; min_n = max_n - del_n; break; - default: return -1; } @@ -489,7 +487,6 @@ unsigned char bit_table[] = { return error; Exit: - printf("*ERROR\n"); if (go != NULL) { FT_FREE(go->bm_table); @@ -500,16 +497,22 @@ unsigned char bit_table[] = { FT_LOCAL_DEF( void ) - gf_free_font( FT_Face gfface, FT_Memory memory ) + gf_free_font( GF_Face face ) { - GF_Face gf = (GF_Face)gfface; - GF_Glyph go; - go = gf->gf_glyph; - if (go != NULL) + FT_Memory memory = FT_FACE( face )->memory; + GF_Glyph go = face->gf_glyph; + FT_UInt nchars = FT_FACE( face )->num_glyphs,i; + + if ( !go ) + return; + + if( go->bm_table ) { - FT_FREE(go->bm_table); - FT_FREE(go); + for (i = 0; i < nchars; i++) + FT_FREE(go->bm_table[i].bitmap); } + FT_FREE(go->bm_table); + FT_FREE(go); }