From fa791414601df61d20d860299dba80fdb62565df Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 21 Jun 2013 10:45:51 +0200 Subject: Upgraded freetype to 2.5.0.1 --- freetype/src/type1/t1afm.c | 22 ++++---- freetype/src/type1/t1driver.c | 42 +++++++------- freetype/src/type1/t1gload.c | 12 ++-- freetype/src/type1/t1load.c | 128 +++++++++++++++++++++--------------------- freetype/src/type1/t1objs.c | 17 +++--- freetype/src/type1/t1parse.c | 22 ++++---- 6 files changed, 121 insertions(+), 122 deletions(-) (limited to 'freetype/src/type1') diff --git a/freetype/src/type1/t1afm.c b/freetype/src/type1/t1afm.c index 1fff15d73..de9c1997c 100644 --- a/freetype/src/type1/t1afm.c +++ b/freetype/src/type1/t1afm.c @@ -4,7 +4,7 @@ /* */ /* AFM support for Type 1 fonts (body). */ /* */ -/* Copyright 1996-2011 by */ +/* Copyright 1996-2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,9 +18,10 @@ #include #include "t1afm.h" -#include "t1errors.h" +#include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_POSTSCRIPT_AUX_H +#include "t1errors.h" /*************************************************************************/ @@ -107,7 +108,7 @@ FT_Stream stream, AFM_FontInfo fi ) { - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; FT_Memory memory = stream->memory; FT_Byte* start; FT_Byte* limit; @@ -121,14 +122,13 @@ start = (FT_Byte*)stream->cursor; limit = (FT_Byte*)stream->limit; - p = start; /* Figure out how long the width table is. */ /* This info is a little-endian short at offset 99. */ p = start + 99; if ( p + 2 > limit ) { - error = T1_Err_Unknown_File_Format; + error = FT_THROW( Unknown_File_Format ); goto Exit; } width_table_length = FT_PEEK_USHORT_LE( p ); @@ -148,7 +148,7 @@ if ( p + 2 > limit ) { - error = T1_Err_Unknown_File_Format; + error = FT_THROW( Unknown_File_Format ); goto Exit; } @@ -156,7 +156,7 @@ p += 2; if ( p + 4 * fi->NumKernPair > limit ) { - error = T1_Err_Unknown_File_Format; + error = FT_THROW( Unknown_File_Format ); goto Exit; } @@ -238,7 +238,7 @@ FT_Memory memory = stream->memory; AFM_ParserRec parser; AFM_FontInfo fi = NULL; - FT_Error error = T1_Err_Unknown_File_Format; + FT_Error error = FT_ERR( Unknown_File_Format ); T1_Font t1_font = &( (T1_Face)t1_face )->type1; @@ -269,7 +269,7 @@ } } - if ( error == T1_Err_Unknown_File_Format ) + if ( FT_ERR_EQ( error, Unknown_File_Format ) ) { FT_Byte* start = stream->cursor; @@ -366,7 +366,7 @@ if ( !fi ) - return T1_Err_Invalid_Argument; + return FT_THROW( Invalid_Argument ); for ( i = 0; i < fi->NumTrackKern; i++ ) { @@ -389,7 +389,7 @@ } } - return T1_Err_Ok; + return FT_Err_Ok; } diff --git a/freetype/src/type1/t1driver.c b/freetype/src/type1/t1driver.c index e35d7b11d..697288d66 100644 --- a/freetype/src/type1/t1driver.c +++ b/freetype/src/type1/t1driver.c @@ -4,7 +4,7 @@ /* */ /* Type 1 driver interface (body). */ /* */ -/* Copyright 1996-2004, 2006, 2007, 2009, 2011 by */ +/* Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -61,7 +61,7 @@ { FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); - return T1_Err_Ok; + return FT_Err_Ok; } @@ -69,13 +69,13 @@ t1_get_name_index( T1_Face face, FT_String* glyph_name ) { - FT_Int i; - FT_String* gname; + FT_Int i; for ( i = 0; i < face->type1.num_glyphs; i++ ) { - gname = face->type1.glyph_names[i]; + FT_String* gname = face->type1.glyph_names[i]; + if ( !ft_strcmp( glyph_name, gname ) ) return (FT_UInt)i; @@ -138,7 +138,7 @@ { *afont_info = ((T1_Face)face)->type1.font_info; - return T1_Err_Ok; + return FT_Err_Ok; } @@ -148,7 +148,7 @@ { *afont_extra = ((T1_Face)face)->type1.font_extra; - return T1_Err_Ok; + return FT_Err_Ok; } @@ -167,7 +167,7 @@ { *afont_private = ((T1_Face)face)->type1.private_dict; - return T1_Err_Ok; + return FT_Err_Ok; } @@ -258,7 +258,7 @@ break; case PS_DICT_FONT_NAME: - retval = ft_strlen( type1->font_name ) + 1; + retval = (FT_Long)( ft_strlen( type1->font_name ) + 1 ); if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_name ), retval ); break; @@ -278,7 +278,7 @@ case PS_DICT_CHAR_STRING_KEY: if ( idx < (FT_UInt)type1->num_glyphs ) { - retval = ft_strlen( type1->glyph_names[idx] ) + 1; + retval = (FT_Long)( ft_strlen( type1->glyph_names[idx] ) + 1 ); if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval ); @@ -290,7 +290,7 @@ case PS_DICT_CHAR_STRING: if ( idx < (FT_UInt)type1->num_glyphs ) { - retval = type1->charstrings_len[idx] + 1; + retval = (FT_Long)( type1->charstrings_len[idx] + 1 ); if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->charstrings[idx] ), @@ -310,7 +310,7 @@ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY && idx < (FT_UInt)type1->encoding.num_chars ) { - retval = ft_strlen( type1->encoding.char_name[idx] ) + 1; + retval = (FT_Long)( ft_strlen( type1->encoding.char_name[idx] ) + 1 ); if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->encoding.char_name[idx] ), @@ -329,7 +329,7 @@ case PS_DICT_SUBR: if ( idx < (FT_UInt)type1->num_subrs ) { - retval = type1->subrs_len[idx] + 1; + retval = (FT_Long)( type1->subrs_len[idx] + 1 ); if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->subrs[idx] ), retval - 1 ); @@ -523,31 +523,31 @@ break; case PS_DICT_VERSION: - retval = ft_strlen( type1->font_info.version ) + 1; + retval = (FT_Long)( ft_strlen( type1->font_info.version ) + 1 ); if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_info.version ), retval ); break; case PS_DICT_NOTICE: - retval = ft_strlen( type1->font_info.notice ) + 1; + retval = (FT_Long)( ft_strlen( type1->font_info.notice ) + 1 ); if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_info.notice ), retval ); break; case PS_DICT_FULL_NAME: - retval = ft_strlen( type1->font_info.full_name ) + 1; + retval = (FT_Long)( ft_strlen( type1->font_info.full_name ) + 1 ); if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_info.full_name ), retval ); break; case PS_DICT_FAMILY_NAME: - retval = ft_strlen( type1->font_info.family_name ) + 1; + retval = (FT_Long)( ft_strlen( type1->font_info.family_name ) + 1 ); if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_info.family_name ), retval ); break; case PS_DICT_WEIGHT: - retval = ft_strlen( type1->font_info.weight ) + 1; + retval = (FT_Long)( ft_strlen( type1->font_info.weight ) + 1 ); if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_info.weight ), retval ); break; @@ -669,7 +669,7 @@ right_glyph, kerning ); - return T1_Err_Ok; + return FT_Err_Ok; } @@ -708,10 +708,6 @@ T1_GlyphSlot_Init, T1_GlyphSlot_Done, -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif T1_Load_Glyph, #ifdef T1_CONFIG_OPTION_NO_AFM diff --git a/freetype/src/type1/t1gload.c b/freetype/src/type1/t1gload.c index 80e545331..23478d128 100644 --- a/freetype/src/type1/t1gload.c +++ b/freetype/src/type1/t1gload.c @@ -4,7 +4,7 @@ /* */ /* Type 1 Glyph Loader (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 by */ +/* Copyright 1996-2006, 2008-2010, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -61,7 +61,7 @@ { T1_Face face = (T1_Face)decoder->builder.face; T1_Font type1 = &face->type1; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; #ifdef FT_CONFIG_OPTION_INCREMENTAL FT_Incremental_InterfaceRec *inc = @@ -203,7 +203,7 @@ psaux->t1_decoder_funcs->done( &decoder ); - return T1_Err_Ok; + return FT_Err_Ok; } @@ -227,7 +227,7 @@ for ( nn = 0; nn < count; nn++ ) advances[nn] = 0; - return T1_Err_Ok; + return FT_Err_Ok; } error = psaux->t1_decoder_funcs->init( &decoder, @@ -261,7 +261,7 @@ advances[nn] = 0; } - return T1_Err_Ok; + return FT_Err_Ok; } @@ -296,7 +296,7 @@ if ( glyph_index >= (FT_UInt)face->root.num_glyphs ) #endif /* FT_CONFIG_OPTION_INCREMENTAL */ { - error = T1_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); goto Exit; } diff --git a/freetype/src/type1/t1load.c b/freetype/src/type1/t1load.c index cc21b1154..1c834a17b 100644 --- a/freetype/src/type1/t1load.c +++ b/freetype/src/type1/t1load.c @@ -4,7 +4,7 @@ /* */ /* Type 1 font loader (body). */ /* */ -/* Copyright 1996-2012 by */ +/* Copyright 1996-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -72,7 +72,7 @@ #ifdef FT_CONFIG_OPTION_INCREMENTAL -#define IS_INCREMENTAL ( face->root.internal->incremental_interface != 0 ) +#define IS_INCREMENTAL (FT_Bool)( face->root.internal->incremental_interface != 0 ) #else #define IS_INCREMENTAL 0 #endif @@ -106,7 +106,7 @@ { PS_Blend blend; FT_Memory memory = face->root.memory; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; blend = face->blend; @@ -130,8 +130,8 @@ /* allocate the blend `private' and `font_info' dictionaries */ if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs ) || - FT_NEW_ARRAY( blend->privates[1], num_designs ) || - FT_NEW_ARRAY( blend->bboxes[1], num_designs ) || + FT_NEW_ARRAY( blend->privates [1], num_designs ) || + FT_NEW_ARRAY( blend->bboxes [1], num_designs ) || FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) ) goto Exit; @@ -143,12 +143,12 @@ for ( nn = 2; nn <= num_designs; nn++ ) { - blend->privates[nn] = blend->privates [nn - 1] + 1; blend->font_infos[nn] = blend->font_infos[nn - 1] + 1; - blend->bboxes[nn] = blend->bboxes [nn - 1] + 1; + blend->privates [nn] = blend->privates [nn - 1] + 1; + blend->bboxes [nn] = blend->bboxes [nn - 1] + 1; } - blend->num_designs = num_designs; + blend->num_designs = num_designs; } else if ( blend->num_designs != num_designs ) goto Fail; @@ -182,7 +182,7 @@ return error; Fail: - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -196,7 +196,7 @@ FT_Error error; - error = T1_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); if ( blend ) { @@ -214,7 +214,7 @@ axis->maximum = map->design_points[map->num_points - 1]; } - error = T1_Err_Ok; + error = FT_Err_Ok; } return error; @@ -320,7 +320,7 @@ mmvar->num_axis = mmaster.num_axis; mmvar->num_designs = mmaster.num_designs; - mmvar->num_namedstyles = ~0; /* Does not apply */ + mmvar->num_namedstyles = ~0U; /* Does not apply */ mmvar->axis = (FT_Var_Axis*)&mmvar[1]; /* Point to axes after MM_Var struct */ mmvar->namedstyle = NULL; @@ -333,8 +333,8 @@ mmvar->axis[i].def = ( mmvar->axis[i].minimum + mmvar->axis[i].maximum ) / 2; /* Does not apply. But this value is in range */ - mmvar->axis[i].strid = ~0; /* Does not apply */ - mmvar->axis[i].tag = ~0; /* Does not apply */ + mmvar->axis[i].strid = ~0U; /* Does not apply */ + mmvar->axis[i].tag = ~0U; /* Does not apply */ if ( ft_strcmp( mmvar->axis[i].name, "Weight" ) == 0 ) mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' ); @@ -372,12 +372,12 @@ FT_UInt n, m; - error = T1_Err_Invalid_Argument; + error = FT_ERR( Invalid_Argument ); if ( blend && blend->num_axis == num_coords ) { /* recompute the weight vector from the blend coordinates */ - error = T1_Err_Ok; + error = FT_Err_Ok; for ( n = 0; n < blend->num_designs; n++ ) { @@ -391,8 +391,10 @@ /* get current blend axis position */ factor = coords[m]; - if ( factor < 0 ) factor = 0; - if ( factor > 0x10000L ) factor = 0x10000L; + if ( factor < 0 ) + factor = 0; + if ( factor > 0x10000L ) + factor = 0x10000L; if ( ( n & ( 1 << m ) ) == 0 ) factor = 0x10000L - factor; @@ -402,7 +404,7 @@ blend->weight_vector[n] = result; } - error = T1_Err_Ok; + error = FT_Err_Ok; } return error; @@ -419,7 +421,7 @@ FT_UInt n, p; - error = T1_Err_Invalid_Argument; + error = FT_ERR( Invalid_Argument ); if ( blend && blend->num_axis == num_coords ) { /* compute the blend coordinates through the blend design map */ @@ -495,7 +497,7 @@ FT_Error error; - error = T1_Err_Invalid_Argument; + error = FT_ERR( Invalid_Argument ); if ( num_coords <= 4 && num_coords > 0 ) { for ( i = 0; i < num_coords; ++i ) @@ -524,7 +526,7 @@ /* release design pos table */ FT_FREE( blend->design_pos[0] ); for ( n = 1; n < num_designs; n++ ) - blend->design_pos[n] = 0; + blend->design_pos[n] = NULL; /* release blend `private' and `font info' dictionaries */ FT_FREE( blend->privates[1] ); @@ -533,14 +535,14 @@ for ( n = 0; n < num_designs; n++ ) { - blend->privates [n] = 0; - blend->font_infos[n] = 0; - blend->bboxes [n] = 0; + blend->privates [n] = NULL; + blend->font_infos[n] = NULL; + blend->bboxes [n] = NULL; } /* release weight vectors */ FT_FREE( blend->weight_vector ); - blend->default_weight_vector = 0; + blend->default_weight_vector = NULL; /* release axis names */ for ( n = 0; n < num_axis; n++ ) @@ -567,7 +569,7 @@ { T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; FT_Int n, num_axis; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; PS_Blend blend; FT_Memory memory; @@ -577,14 +579,14 @@ T1_MAX_MM_AXIS, &num_axis ); if ( num_axis < 0 ) { - error = T1_Err_Ignore; + error = FT_ERR( Ignore ); goto Exit; } if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS ) { FT_ERROR(( "parse_blend_axis_types: incorrect number of axes: %d\n", num_axis )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -611,7 +613,7 @@ len = token->limit - token->start; if ( len == 0 ) { - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -620,7 +622,7 @@ name = (FT_Byte*)blend->axis_names[n]; FT_MEM_COPY( name, token->start, len ); - name[len] = 0; + name[len] = '\0'; } Exit: @@ -637,7 +639,7 @@ FT_Int num_axis; T1_Parser parser = &loader->parser; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; PS_Blend blend; @@ -646,7 +648,7 @@ T1_MAX_MM_DESIGNS, &num_designs ); if ( num_designs < 0 ) { - error = T1_Err_Ignore; + error = FT_ERR( Ignore ); goto Exit; } if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS ) @@ -654,7 +656,7 @@ FT_ERROR(( "parse_blend_design_positions:" " incorrect number of designs: %d\n", num_designs )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -687,7 +689,7 @@ FT_ERROR(( "parse_blend_design_positions:" " invalid number of axes: %d\n", n_axis )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -700,7 +702,7 @@ else if ( n_axis != num_axis ) { FT_ERROR(( "parse_blend_design_positions: incorrect table\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -729,7 +731,7 @@ parse_blend_design_map( T1_Face face, T1_Loader loader ) { - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; T1_Parser parser = &loader->parser; PS_Blend blend; T1_TokenRec axis_tokens[T1_MAX_MM_AXIS]; @@ -743,14 +745,14 @@ T1_MAX_MM_AXIS, &num_axis ); if ( num_axis < 0 ) { - error = T1_Err_Ignore; + error = FT_ERR( Ignore ); goto Exit; } if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS ) { FT_ERROR(( "parse_blend_design_map: incorrect number of axes: %d\n", num_axis )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -781,7 +783,7 @@ if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS ) { FT_ERROR(( "parse_blend_design_map: incorrect table\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -821,7 +823,7 @@ { T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS]; FT_Int num_designs; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; T1_Parser parser = &loader->parser; PS_Blend blend = face->blend; T1_Token token; @@ -834,7 +836,7 @@ T1_MAX_MM_DESIGNS, &num_designs ); if ( num_designs < 0 ) { - error = T1_Err_Ignore; + error = FT_ERR( Ignore ); goto Exit; } if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS ) @@ -842,7 +844,7 @@ FT_ERROR(( "parse_weight_vector:" " incorrect number of designs: %d\n", num_designs )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -859,7 +861,7 @@ " /BlendDesignPosition and /WeightVector have\n" " " " different number of elements\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } @@ -1020,7 +1022,7 @@ " which is not valid at this point\n" " (probably due to missing keywords)\n", field->ident )); - error = T1_Err_Ok; + error = FT_Err_Ok; } Exit: @@ -1080,7 +1082,7 @@ if( !incremental ) { FT_ERROR(( "read_binary_data: invalid size field\n" )); - parser->root.error = T1_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); } return 0; @@ -1107,7 +1109,7 @@ if ( result < 0 ) { - parser->root.error = T1_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); return; } @@ -1116,7 +1118,7 @@ if ( temp_scale == 0 ) { FT_ERROR(( "t1_parse_font_matrix: invalid font matrix\n" )); - parser->root.error = T1_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); return; } @@ -1164,7 +1166,7 @@ if ( cur >= limit ) { FT_ERROR(( "parse_encoding: out of bounds\n" )); - parser->root.error = T1_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); return; } @@ -1310,7 +1312,7 @@ /* specification (it might be an encoding for a CID type1 */ /* font, however), so we conclude that this font is NOT a */ /* type1 font. */ - parser->root.error = FT_Err_Unknown_File_Format; + parser->root.error = FT_THROW( Unknown_File_Format ); return; } } @@ -1345,7 +1347,7 @@ face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1; else - parser->root.error = T1_Err_Ignore; + parser->root.error = FT_ERR( Ignore ); } } @@ -1373,7 +1375,7 @@ T1_Skip_Spaces ( parser ); if ( parser->root.cursor >= parser->root.limit || *parser->root.cursor != ']' ) - parser->root.error = T1_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); return; } @@ -1452,7 +1454,7 @@ /* least contain a `return'), but we support them anyway */ if ( size < face->type1.private_dict.lenIV ) { - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -1508,7 +1510,7 @@ num_glyphs = (FT_Int)T1_ToInt( parser ); if ( num_glyphs < 0 ) { - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -1599,7 +1601,7 @@ if ( cur + 1 >= limit ) { - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -1639,7 +1641,7 @@ if ( size <= face->type1.private_dict.lenIV ) { - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -1843,7 +1845,7 @@ parser->root.cursor = base; parser->root.limit = base + size; - parser->root.error = T1_Err_Ok; + parser->root.error = FT_Err_Ok; limit = parser->root.limit; @@ -1896,7 +1898,7 @@ parser->root.cursor = start_binary; if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) ) - return T1_Err_Invalid_File_Format; + return FT_THROW( Invalid_File_Format ); have_integer = 0; } @@ -1909,7 +1911,7 @@ parser->root.cursor = start_binary; if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) ) - return T1_Err_Invalid_File_Format; + return FT_THROW( Invalid_File_Format ); have_integer = 0; } @@ -1994,10 +1996,10 @@ parser->root.error = t1_load_keyword( face, loader, keyword ); - if ( parser->root.error != T1_Err_Ok ) + if ( parser->root.error != FT_Err_Ok ) { - if ( FT_ERROR_BASE( parser->root.error ) == FT_Err_Ignore ) - parser->root.error = T1_Err_Ok; + if ( FT_ERR_EQ( parser->root.error, Ignore ) ) + parser->root.error = FT_Err_Ok; else return parser->root.error; } @@ -2188,7 +2190,7 @@ if ( !loader.charstrings.init ) { FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); } loader.charstrings.init = 0; diff --git a/freetype/src/type1/t1objs.c b/freetype/src/type1/t1objs.c index b685f2f1b..837b7911d 100644 --- a/freetype/src/type1/t1objs.c +++ b/freetype/src/type1/t1objs.c @@ -4,7 +4,7 @@ /* */ /* Type 1 objects manager (body). */ /* */ -/* Copyright 1996-2009, 2011 by */ +/* Copyright 1996-2009, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -95,7 +95,7 @@ T1_Size_Init( FT_Size t1size ) /* T1_Size */ { T1_Size size = (T1_Size)t1size; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); @@ -131,7 +131,7 @@ size->root.metrics.y_scale, 0, 0 ); - return T1_Err_Ok; + return FT_Err_Ok; } @@ -326,7 +326,7 @@ if ( !psaux ) { FT_ERROR(( "T1_Face_Init: cannot access `psaux' module\n" )); - error = T1_Err_Missing_Module; + error = FT_THROW( Missing_Module ); goto Exit; } @@ -348,7 +348,7 @@ if ( face_index > 0 ) { FT_ERROR(( "T1_Face_Init: invalid face index\n" )); - error = T1_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); goto Exit; } @@ -489,7 +489,7 @@ if ( !error ) root->max_advance_width = (FT_Short)FIXED_TO_INT( max_advance ); else - error = T1_Err_Ok; /* clear error */ + error = FT_Err_Ok; /* clear error */ } root->max_advance_height = root->height; @@ -517,7 +517,8 @@ charmap.encoding = FT_ENCODING_UNICODE; error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); - if ( error && FT_Err_No_Unicode_Glyph_Name != error ) + if ( error && + FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) ) goto Exit; error = FT_Err_Ok; @@ -590,7 +591,7 @@ { FT_UNUSED( driver ); - return T1_Err_Ok; + return FT_Err_Ok; } diff --git a/freetype/src/type1/t1parse.c b/freetype/src/type1/t1parse.c index b48651a01..106e4e7ec 100644 --- a/freetype/src/type1/t1parse.c +++ b/freetype/src/type1/t1parse.c @@ -4,7 +4,7 @@ /* */ /* Type 1 parser (body). */ /* */ -/* Copyright 1996-2005, 2008, 2009, 2012 by */ +/* Copyright 1996-2005, 2008, 2009, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -119,10 +119,10 @@ if ( !FT_FRAME_ENTER( header_length ) ) { - error = T1_Err_Ok; + error = FT_Err_Ok; if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 ) - error = T1_Err_Unknown_File_Format; + error = FT_THROW( Unknown_File_Format ); FT_FRAME_EXIT(); } @@ -158,7 +158,7 @@ error = check_type1_format( stream, "%!PS-AdobeFont", 14 ); if ( error ) { - if ( error != T1_Err_Unknown_File_Format ) + if ( FT_ERR_NEQ( error, Unknown_File_Format ) ) goto Exit; error = check_type1_format( stream, "%!FontType", 10 ); @@ -263,7 +263,7 @@ { FT_Stream stream = parser->stream; FT_Memory memory = parser->root.memory; - FT_Error error = T1_Err_Ok; + FT_Error error = FT_Err_Ok; FT_ULong size; @@ -299,7 +299,7 @@ { FT_ERROR(( "T1_Get_Private_Dict:" " invalid private dictionary section\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -313,7 +313,7 @@ error = read_pfb_tag( stream, &tag, &size ); if ( error || tag != 0x8002U ) { - error = T1_Err_Ok; + error = FT_Err_Ok; break; } @@ -355,7 +355,7 @@ { FT_ERROR(( "T1_Get_Private_Dict:" " could not find `eexec' keyword\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } } @@ -414,11 +414,11 @@ { FT_ERROR(( "T1_Get_Private_Dict:" " `eexec' not properly terminated\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Exit; } - size = parser->base_len - ( cur - parser->base_dict ); + size = (FT_ULong)( parser->base_len - ( cur - parser->base_dict ) ); if ( parser->in_memory ) { @@ -474,7 +474,7 @@ { FT_ERROR(( "T1_Get_Private_Dict:" " invalid private dictionary section\n" )); - error = T1_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } -- cgit v1.2.3