From fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 26 Jun 2014 09:46:14 +0200 Subject: Updated to freetype 2.5.3 --- freetype/src/cid/cidgload.c | 2 +- freetype/src/cid/cidload.c | 25 ++++++++++++++++++------- freetype/src/cid/cidobjs.c | 7 ++++--- freetype/src/cid/cidparse.c | 4 +--- freetype/src/cid/cidparse.h | 22 +++++++++++----------- 5 files changed, 35 insertions(+), 25 deletions(-) (limited to 'freetype/src/cid') diff --git a/freetype/src/cid/cidgload.c b/freetype/src/cid/cidgload.c index a1a865869..7febab81c 100644 --- a/freetype/src/cid/cidgload.c +++ b/freetype/src/cid/cidgload.c @@ -58,7 +58,7 @@ #endif - FT_TRACE4(( "cid_load_glyph: glyph index %d\n", glyph_index )); + FT_TRACE1(( "cid_load_glyph: glyph index %d\n", glyph_index )); #ifdef FT_CONFIG_OPTION_INCREMENTAL diff --git a/freetype/src/cid/cidload.c b/freetype/src/cid/cidload.c index f2a18ea51..1cda0eee7 100644 --- a/freetype/src/cid/cidload.c +++ b/freetype/src/cid/cidload.c @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 font loader (body). */ /* */ -/* Copyright 1996-2006, 2009, 2011-2013 by */ +/* Copyright 1996-2006, 2009, 2011-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -150,8 +150,6 @@ cid_parse_font_matrix( CID_Face face, CID_Parser* parser ) { - FT_Matrix* matrix; - FT_Vector* offset; CID_FaceDict dict; FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; @@ -160,14 +158,28 @@ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts ) { + FT_Matrix* matrix; + FT_Vector* offset; + FT_Int result; + + dict = face->cid.font_dicts + parser->num_dict; matrix = &dict->font_matrix; offset = &dict->font_offset; - (void)cid_parser_to_fixed_array( parser, 6, temp, 3 ); + result = cid_parser_to_fixed_array( parser, 6, temp, 3 ); + + if ( result < 6 ) + return FT_THROW( Invalid_File_Format ); temp_scale = FT_ABS( temp[3] ); + if ( temp_scale == 0 ) + { + FT_ERROR(( "cid_parse_font_matrix: invalid font matrix\n" )); + return FT_THROW( Invalid_File_Format ); + } + /* Set Units per EM based on FontMatrix values. We set the value to */ /* 1000 / temp_scale, because temp_scale was already multiplied by */ /* 1000 (in t1_tofixed, from psobjs.c). */ @@ -182,7 +194,7 @@ temp[2] = FT_DivFix( temp[2], temp_scale ); temp[4] = FT_DivFix( temp[4], temp_scale ); temp[5] = FT_DivFix( temp[5], temp_scale ); - temp[3] = 0x10000L; + temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L; } matrix->xx = temp[0]; @@ -195,8 +207,7 @@ offset->y = temp[5] >> 16; } - return FT_Err_Ok; /* this is a callback function; */ - /* we must return an error code */ + return FT_Err_Ok; } diff --git a/freetype/src/cid/cidobjs.c b/freetype/src/cid/cidobjs.c index 46555e2dc..5932ffa97 100644 --- a/freetype/src/cid/cidobjs.c +++ b/freetype/src/cid/cidobjs.c @@ -355,9 +355,10 @@ cidface->num_charmaps = 0; cidface->face_index = face_index; - cidface->face_flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */ - FT_FACE_FLAG_HORIZONTAL | /* horizontal data */ - FT_FACE_FLAG_HINTER; /* has native hinter */ + + cidface->face_flags |= FT_FACE_FLAG_SCALABLE | /* scalable outlines */ + FT_FACE_FLAG_HORIZONTAL | /* horizontal data */ + FT_FACE_FLAG_HINTER; /* has native hinter */ if ( info->is_fixed_pitch ) cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; diff --git a/freetype/src/cid/cidparse.c b/freetype/src/cid/cidparse.c index 53df3155d..d8476cdae 100644 --- a/freetype/src/cid/cidparse.c +++ b/freetype/src/cid/cidparse.c @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 parser (body). */ /* */ -/* Copyright 1996-2007, 2009, 2013 by */ +/* Copyright 1996-2007, 2009, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -178,8 +178,6 @@ if ( ft_strncmp( (char*)arg1, "(Hex)", 5 ) == 0 ) parser->binary_length = ft_atol( (const char *)arg2 ); - limit = parser->root.limit; - cur = parser->root.cursor; goto Exit; } else if ( cur[1] == 's' && ft_strncmp( (char*)cur, "/sfnts", 6 ) == 0 ) diff --git a/freetype/src/cid/cidparse.h b/freetype/src/cid/cidparse.h index ca37deab9..f27be65a6 100644 --- a/freetype/src/cid/cidparse.h +++ b/freetype/src/cid/cidparse.h @@ -4,7 +4,7 @@ /* */ /* CID-keyed Type1 parser (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004 by */ +/* Copyright 1996-2004, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -92,26 +92,26 @@ FT_BEGIN_HEADER /* */ /*************************************************************************/ -#define cid_parser_skip_spaces( p ) \ +#define cid_parser_skip_spaces( p ) \ (p)->root.funcs.skip_spaces( &(p)->root ) -#define cid_parser_skip_PS_token( p ) \ +#define cid_parser_skip_PS_token( p ) \ (p)->root.funcs.skip_PS_token( &(p)->root ) -#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) -#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) +#define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root ) +#define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t ) -#define cid_parser_to_coord_array( p, m, c ) \ +#define cid_parser_to_coord_array( p, m, c ) \ (p)->root.funcs.to_coord_array( &(p)->root, m, c ) -#define cid_parser_to_fixed_array( p, m, f, t ) \ +#define cid_parser_to_fixed_array( p, m, f, t ) \ (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t ) -#define cid_parser_to_token( p, t ) \ +#define cid_parser_to_token( p, t ) \ (p)->root.funcs.to_token( &(p)->root, t ) -#define cid_parser_to_token_array( p, t, m, c ) \ +#define cid_parser_to_token_array( p, t, m, c ) \ (p)->root.funcs.to_token_array( &(p)->root, t, m, c ) -#define cid_parser_load_field( p, f, o ) \ +#define cid_parser_load_field( p, f, o ) \ (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 ) -#define cid_parser_load_field_table( p, f, o ) \ +#define cid_parser_load_field_table( p, f, o ) \ (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 ) -- cgit v1.2.3