FT_Error FX_Activate_Stream( FT_Face face ) { FT_ULong ulPos; FT_Error error; ulPos = face->stream->pos; if ( ! STREAM_FILE( face->stream )) { error = FT_Stream_Open( face->stream, face->stream->pathname.pointer ); if ( !error ) DosSetFilePtr( STREAM_FILE( face->stream ), ulPos, FILE_BEGIN, &(face->stream->pos)); } else error = FT_Err_Ok; return error; }
int main( int argc, char** argv ) { FT_Library library; FT_StreamRec stream; FT_Error error = FT_Err_Ok; AFM_FontInfoRec fi; if ( argc < 2 ) return FT_ERR( Invalid_Argument ); error = FT_Init_FreeType( &library ); if ( error ) return error; FT_ZERO( &stream ); error = FT_Stream_Open( &stream, argv[1] ); if ( error ) goto Exit; stream.memory = library->memory; FT_ZERO( &fi ); error = parse_afm( library, &stream, &fi ); if ( !error ) { FT_Memory memory = library->memory; dump_fontinfo( &fi ); if ( fi.KernPairs ) FT_FREE( fi.KernPairs ); if ( fi.TrackKerns ) FT_FREE( fi.TrackKerns ); } else printf( "parse error\n" ); FT_Stream_Close( &stream ); Exit: FT_Done_FreeType( library ); return error; }