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/type42/t42drivr.c | 21 +++++++++------------ freetype/src/type42/t42objs.c | 25 ++++++++++++++----------- freetype/src/type42/t42parse.c | 40 ++++++++++++++++++++-------------------- 3 files changed, 43 insertions(+), 43 deletions(-) (limited to 'freetype/src/type42') diff --git a/freetype/src/type42/t42drivr.c b/freetype/src/type42/t42drivr.c index 9b93209ad..3ad1bde79 100644 --- a/freetype/src/type42/t42drivr.c +++ b/freetype/src/type42/t42drivr.c @@ -4,7 +4,8 @@ /* */ /* High-level Type 42 driver interface (body). */ /* */ -/* Copyright 2002-2004, 2006, 2007, 2009, 2011 by Roberto Alameda. */ +/* Copyright 2002-2004, 2006, 2007, 2009, 2011, 2013 by */ +/* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ @@ -63,7 +64,7 @@ { FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max ); - return T42_Err_Ok; + return FT_Err_Ok; } @@ -71,13 +72,13 @@ t42_get_name_index( T42_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 ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) ) return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] ); @@ -125,7 +126,7 @@ { *afont_info = ((T42_Face)face)->type1.font_info; - return T42_Err_Ok; + return FT_Err_Ok; } @@ -135,7 +136,7 @@ { *afont_extra = ((T42_Face)face)->type1.font_extra; - return T42_Err_Ok; + return FT_Err_Ok; } @@ -154,7 +155,7 @@ { *afont_private = ((T42_Face)face)->type1.private_dict; - return T42_Err_Ok; + return FT_Err_Ok; } @@ -229,10 +230,6 @@ T42_GlyphSlot_Init, T42_GlyphSlot_Done, -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - ft_stub_set_char_sizes, - ft_stub_set_pixel_sizes, -#endif T42_GlyphSlot_Load, 0, /* FT_Face_GetKerningFunc */ diff --git a/freetype/src/type42/t42objs.c b/freetype/src/type42/t42objs.c index c6053afed..18e2c0b62 100644 --- a/freetype/src/type42/t42objs.c +++ b/freetype/src/type42/t42objs.c @@ -4,7 +4,7 @@ /* */ /* Type 42 objects manager (body). */ /* */ -/* Copyright 2002-2009, 2011 */ +/* Copyright 2002-2009, 2011, 2013 */ /* by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -63,7 +63,7 @@ { FT_ERROR(( "T42_Open_Face: cannot handle FontType %d\n", type1->font_type )); - error = T42_Err_Unknown_File_Format; + error = FT_THROW( Unknown_File_Format ); goto Exit; } @@ -74,7 +74,7 @@ if ( !loader.charstrings.init ) { FT_ERROR(( "T42_Open_Face: no charstrings array in face\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); } loader.charstrings.init = 0; @@ -93,7 +93,6 @@ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) { FT_Int charcode, idx, min_char, max_char; - FT_Byte* char_name; FT_Byte* glyph_name; @@ -109,6 +108,9 @@ charcode = 0; for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) { + FT_Byte* char_name; + + type1->encoding.char_index[charcode] = 0; type1->encoding.char_name [charcode] = (char *)".notdef"; @@ -185,7 +187,7 @@ if ( !psaux ) { FT_ERROR(( "T42_Face_Init: cannot access `psaux' module\n" )); - error = T42_Err_Missing_Module; + error = FT_THROW( Missing_Module ); goto Exit; } @@ -204,7 +206,7 @@ if ( face_index > 0 ) { FT_ERROR(( "T42_Face_Init: invalid face index\n" )); - error = T42_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); goto Exit; } @@ -347,7 +349,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; @@ -481,12 +484,12 @@ if ( !ttmodule ) { FT_ERROR(( "T42_Driver_Init: cannot access `truetype' module\n" )); - return T42_Err_Missing_Module; + return FT_THROW( Missing_Module ); } driver->ttclazz = (FT_Driver_Class)ttmodule->clazz; - return T42_Err_Ok; + return FT_Err_Ok; } @@ -504,7 +507,7 @@ FT_Face face = size->face; T42_Face t42face = (T42_Face)face; FT_Size ttsize; - FT_Error error = T42_Err_Ok; + FT_Error error = FT_Err_Ok; error = FT_New_Size( t42face->ttf_face, &ttsize ); @@ -580,7 +583,7 @@ FT_Face face = t42slot->face; T42_Face t42face = (T42_Face)face; FT_GlyphSlot ttslot; - FT_Error error = T42_Err_Ok; + FT_Error error = FT_Err_Ok; if ( face->glyph == NULL ) diff --git a/freetype/src/type42/t42parse.c b/freetype/src/type42/t42parse.c index 2b2824030..3cdd8a1ac 100644 --- a/freetype/src/type42/t42parse.c +++ b/freetype/src/type42/t42parse.c @@ -4,7 +4,7 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002-2012 by */ +/* Copyright 2002-2013 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -144,7 +144,7 @@ FT_Memory memory, PSAux_Service psaux ) { - FT_Error error = T42_Err_Ok; + FT_Error error = FT_Err_Ok; FT_Long size; @@ -176,7 +176,7 @@ if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 ) { FT_TRACE2(( " not a Type42 font\n" )); - error = T42_Err_Unknown_File_Format; + error = FT_THROW( Unknown_File_Format ); } FT_FRAME_EXIT(); @@ -305,7 +305,7 @@ if ( cur >= limit ) { FT_ERROR(( "t42_parse_encoding: out of bounds\n" )); - parser->root.error = T42_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); return; } @@ -473,7 +473,7 @@ else { FT_ERROR(( "t42_parse_encoding: invalid token\n" )); - parser->root.error = T42_Err_Invalid_File_Format; + parser->root.error = FT_THROW( Invalid_File_Format ); } } } @@ -526,7 +526,7 @@ if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' ) { FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -571,7 +571,7 @@ { FT_ERROR(( "t42_parse_sfnts: " "can't handle mixed binary and hex strings\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -579,7 +579,7 @@ if ( string_size < 0 ) { FT_ERROR(( "t42_parse_sfnts: invalid string size\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -592,7 +592,7 @@ if ( limit - parser->root.cursor < string_size ) { FT_ERROR(( "t42_parse_sfnts: too many binary data\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } else @@ -602,7 +602,7 @@ if ( !string_buf ) { FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -614,7 +614,7 @@ if ( !string_size ) { FT_ERROR(( "t42_parse_sfnts: invalid string\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -679,7 +679,7 @@ if ( count >= ttf_size ) { FT_ERROR(( "t42_parse_sfnts: too many binary data\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } face->ttf_data[count++] = string_buf[n]; @@ -690,7 +690,7 @@ } /* if control reaches this point, the format was not valid */ - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); Fail: parser->root.error = error; @@ -726,7 +726,7 @@ if ( parser->root.cursor >= limit ) { FT_ERROR(( "t42_parse_charstrings: out of bounds\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -768,14 +768,14 @@ else { FT_ERROR(( "t42_parse_charstrings: invalid token\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } if ( parser->root.cursor >= limit ) { FT_ERROR(( "t42_parse_charstrings: out of bounds\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -835,7 +835,7 @@ if ( cur + 1 >= limit ) { FT_ERROR(( "t42_parse_charstrings: out of bounds\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -866,7 +866,7 @@ if ( parser->root.cursor >= limit ) { FT_ERROR(( "t42_parse_charstrings: out of bounds\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -889,7 +889,7 @@ if ( !notdef_found ) { FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph\n" )); - error = T42_Err_Invalid_File_Format; + error = FT_THROW( Invalid_File_Format ); goto Fail; } @@ -1033,7 +1033,7 @@ parser->root.cursor = base; parser->root.limit = base + size; - parser->root.error = T42_Err_Ok; + parser->root.error = FT_Err_Ok; limit = parser->root.limit; -- cgit v1.2.3