diff options
Diffstat (limited to 'freetype/src/type1')
-rw-r--r-- | freetype/src/type1/Jamfile | 2 | ||||
-rw-r--r-- | freetype/src/type1/module.mk | 2 | ||||
-rw-r--r-- | freetype/src/type1/rules.mk | 7 | ||||
-rw-r--r-- | freetype/src/type1/t1afm.c | 8 | ||||
-rw-r--r-- | freetype/src/type1/t1afm.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/t1driver.c | 36 | ||||
-rw-r--r-- | freetype/src/type1/t1driver.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/t1errors.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/t1gload.c | 10 | ||||
-rw-r--r-- | freetype/src/type1/t1gload.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/t1load.c | 237 | ||||
-rw-r--r-- | freetype/src/type1/t1load.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/t1objs.c | 10 | ||||
-rw-r--r-- | freetype/src/type1/t1objs.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/t1parse.c | 24 | ||||
-rw-r--r-- | freetype/src/type1/t1parse.h | 8 | ||||
-rw-r--r-- | freetype/src/type1/t1tokens.h | 2 | ||||
-rw-r--r-- | freetype/src/type1/type1.c | 2 |
18 files changed, 181 insertions, 179 deletions
diff --git a/freetype/src/type1/Jamfile b/freetype/src/type1/Jamfile index 8e366baae..5d7b62c49 100644 --- a/freetype/src/type1/Jamfile +++ b/freetype/src/type1/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 src/type1 Jamfile # -# Copyright 2001 by +# Copyright 2001-2015 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/freetype/src/type1/module.mk b/freetype/src/type1/module.mk index ade0210d7..feb3459d8 100644 --- a/freetype/src/type1/module.mk +++ b/freetype/src/type1/module.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2000, 2006 by +# Copyright 1996-2015 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/freetype/src/type1/rules.mk b/freetype/src/type1/rules.mk index 15087b030..fbd054353 100644 --- a/freetype/src/type1/rules.mk +++ b/freetype/src/type1/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2000, 2001, 2003 by +# Copyright 1996-2015 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -20,7 +20,10 @@ T1_DIR := $(SRC_DIR)/type1 # compilation flags for the driver # -T1_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T1_DIR)) +T1_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(T1_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) # Type1 driver sources (i.e., C files) diff --git a/freetype/src/type1/t1afm.c b/freetype/src/type1/t1afm.c index de9c1997c..7f32059f8 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, 2013 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -169,8 +169,8 @@ goto Exit; /* now, read each kern pair */ - kp = fi->KernPairs; - limit = p + 4 * fi->NumKernPair; + kp = fi->KernPairs; + limit = p + 4 * fi->NumKernPair; /* PFM kerning data are stored by encoding rather than glyph index, */ /* so find the PostScript charmap of this font and install it */ @@ -362,7 +362,7 @@ FT_Fixed* kerning ) { AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data; - FT_Int i; + FT_UInt i; if ( !fi ) diff --git a/freetype/src/type1/t1afm.h b/freetype/src/type1/t1afm.h index 8eb1764de..0f42f3e3a 100644 --- a/freetype/src/type1/t1afm.h +++ b/freetype/src/type1/t1afm.h @@ -4,7 +4,7 @@ /* */ /* AFM support for Type 1 fonts (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2006 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/t1driver.c b/freetype/src/type1/t1driver.c index 2602bdb6f..571f2d2f8 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, 2013, 2014 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -32,7 +32,7 @@ #include FT_SERVICE_MULTIPLE_MASTERS_H #include FT_SERVICE_GLYPH_DICT_H -#include FT_SERVICE_XFREE86_NAME_H +#include FT_SERVICE_FONT_FORMAT_H #include FT_SERVICE_POSTSCRIPT_NAME_H #include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_SERVICE_POSTSCRIPT_INFO_H @@ -176,9 +176,11 @@ PS_Dict_Keys key, FT_UInt idx, void *value, - FT_Long value_len ) + FT_Long value_len_ ) { - FT_Long retval = -1; + FT_ULong retval = 0; /* always >= 1 if valid */ + FT_ULong value_len = value_len_ < 0 ? 0 : (FT_ULong)value_len_; + T1_Face t1face = (T1_Face)face; T1_Font type1 = &t1face->type1; @@ -225,7 +227,7 @@ if ( idx < sizeof ( type1->font_bbox ) / sizeof ( type1->font_bbox.xMin ) ) { - FT_Fixed val = 0; + FT_Fixed val = 0; retval = sizeof ( val ); @@ -258,7 +260,7 @@ break; case PS_DICT_FONT_NAME: - retval = (FT_Long)( ft_strlen( type1->font_name ) + 1 ); + retval = ft_strlen( type1->font_name ) + 1; if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_name ), retval ); break; @@ -278,7 +280,7 @@ case PS_DICT_CHAR_STRING_KEY: if ( idx < (FT_UInt)type1->num_glyphs ) { - retval = (FT_Long)( ft_strlen( type1->glyph_names[idx] ) + 1 ); + retval = ft_strlen( type1->glyph_names[idx] ) + 1; if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval ); @@ -290,7 +292,7 @@ case PS_DICT_CHAR_STRING: if ( idx < (FT_UInt)type1->num_glyphs ) { - retval = (FT_Long)( type1->charstrings_len[idx] + 1 ); + retval = type1->charstrings_len[idx] + 1; if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->charstrings[idx] ), @@ -310,7 +312,7 @@ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY && idx < (FT_UInt)type1->encoding.num_chars ) { - retval = (FT_Long)( ft_strlen( type1->encoding.char_name[idx] ) + 1 ); + retval = ft_strlen( type1->encoding.char_name[idx] ) + 1; if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->encoding.char_name[idx] ), @@ -329,7 +331,7 @@ case PS_DICT_SUBR: if ( idx < (FT_UInt)type1->num_subrs ) { - retval = (FT_Long)( type1->subrs_len[idx] + 1 ); + retval = type1->subrs_len[idx] + 1; if ( value && value_len >= retval ) { ft_memcpy( value, (void *)( type1->subrs[idx] ), retval - 1 ); @@ -523,31 +525,31 @@ break; case PS_DICT_VERSION: - retval = (FT_Long)( ft_strlen( type1->font_info.version ) + 1 ); + retval = 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_Long)( ft_strlen( type1->font_info.notice ) + 1 ); + retval = 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_Long)( ft_strlen( type1->font_info.full_name ) + 1 ); + retval = 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_Long)( ft_strlen( type1->font_info.family_name ) + 1 ); + retval = 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_Long)( ft_strlen( type1->font_info.weight ) + 1 ); + retval = ft_strlen( type1->font_info.weight ) + 1; if ( value && value_len >= retval ) ft_memcpy( value, (void *)( type1->font_info.weight ), retval ); break; @@ -559,7 +561,7 @@ break; } - return retval; + return retval == 0 ? -1 : (FT_Long)retval; } @@ -590,7 +592,7 @@ { { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name }, { FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 }, + { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TYPE_1 }, { FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info }, #ifndef T1_CONFIG_OPTION_NO_AFM diff --git a/freetype/src/type1/t1driver.h b/freetype/src/type1/t1driver.h index 639cd4a7a..34bcf81cc 100644 --- a/freetype/src/type1/t1driver.h +++ b/freetype/src/type1/t1driver.h @@ -4,7 +4,7 @@ /* */ /* High-level Type 1 driver interface (specification). */ /* */ -/* Copyright 1996-2001, 2002 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/t1errors.h b/freetype/src/type1/t1errors.h index 8740530ee..fc7a9bd64 100644 --- a/freetype/src/type1/t1errors.h +++ b/freetype/src/type1/t1errors.h @@ -4,7 +4,7 @@ /* */ /* Type 1 error codes (specification only). */ /* */ -/* Copyright 2001, 2012 by */ +/* Copyright 2001-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/t1gload.c b/freetype/src/type1/t1gload.c index af102fd85..829e8743a 100644 --- a/freetype/src/type1/t1gload.c +++ b/freetype/src/type1/t1gload.c @@ -4,7 +4,7 @@ /* */ /* Type 1 Glyph Loader (body). */ /* */ -/* Copyright 1996-2006, 2008-2010, 2013, 2014 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -54,7 +54,7 @@ /*************************************************************************/ - FT_LOCAL_DEF( FT_Error ) + static FT_Error T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder, FT_UInt glyph_index, FT_Data* char_string ) @@ -92,7 +92,7 @@ if ( !error ) error = decoder->funcs.parse_charstrings( decoder, (FT_Byte*)char_string->pointer, - char_string->length ); + (FT_UInt)char_string->length ); #ifdef FT_CONFIG_OPTION_INCREMENTAL @@ -194,7 +194,7 @@ for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ ) { /* now get load the unscaled outline */ - (void)T1_Parse_Glyph( &decoder, glyph_index ); + (void)T1_Parse_Glyph( &decoder, (FT_UInt)glyph_index ); if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance ) *max_advance = decoder.builder.advance.x; @@ -504,7 +504,7 @@ /* Set the control data to null - it is no longer available if */ /* loaded incrementally. */ - t1glyph->control_data = 0; + t1glyph->control_data = NULL; t1glyph->control_len = 0; } #endif diff --git a/freetype/src/type1/t1gload.h b/freetype/src/type1/t1gload.h index 0bdea3a8d..05f60d586 100644 --- a/freetype/src/type1/t1gload.h +++ b/freetype/src/type1/t1gload.h @@ -4,7 +4,7 @@ /* */ /* Type 1 Glyph Loader (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2008, 2011 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/t1load.c b/freetype/src/type1/t1load.c index 22b3f6b31..376c90ce2 100644 --- a/freetype/src/type1/t1load.c +++ b/freetype/src/type1/t1load.c @@ -4,7 +4,7 @@ /* */ /* Type 1 font loader (body). */ /* */ -/* Copyright 1996-2014 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -226,7 +226,7 @@ /* Given a normalized (blend) coordinate, figure out the design */ /* coordinate appropriate for that value. */ /* */ - FT_LOCAL_DEF( FT_Fixed ) + static FT_Fixed mm_axis_unmap( PS_DesignMap axismap, FT_Fixed ncv ) { @@ -255,7 +255,7 @@ /* Given a vector of weights, one for each design, figure out the */ /* normalized axis coordinates which gave rise to those weights. */ /* */ - FT_LOCAL_DEF( void ) + static void mm_weights_unmap( FT_Fixed* weights, FT_Fixed* axiscoords, FT_UInt axis_count ) @@ -368,44 +368,43 @@ FT_Fixed* coords ) { PS_Blend blend = face->blend; - FT_Error error; FT_UInt n, m; - error = FT_ERR( Invalid_Argument ); + if ( !blend ) + return FT_THROW( Invalid_Argument ); + + if ( num_coords > blend->num_axis ) + num_coords = blend->num_axis; - if ( blend && blend->num_axis == num_coords ) + /* recompute the weight vector from the blend coordinates */ + for ( n = 0; n < blend->num_designs; n++ ) { - /* recompute the weight vector from the blend coordinates */ - for ( n = 0; n < blend->num_designs; n++ ) - { - FT_Fixed result = 0x10000L; /* 1.0 fixed */ + FT_Fixed result = 0x10000L; /* 1.0 fixed */ - for ( m = 0; m < blend->num_axis; m++ ) - { - FT_Fixed factor; + for ( m = 0; m < blend->num_axis; m++ ) + { + FT_Fixed factor; - /* get current blend axis position */ - factor = coords[m]; - if ( factor < 0 ) - factor = 0; - if ( factor > 0x10000L ) - factor = 0x10000L; + /* get current blend axis position; */ + /* use a default value if we don't have a coordinate */ + factor = m < num_coords ? coords[m] : 0x8000; + if ( factor < 0 ) + factor = 0; + if ( factor > 0x10000L ) + factor = 0x10000L; - if ( ( n & ( 1 << m ) ) == 0 ) - factor = 0x10000L - factor; + if ( ( n & ( 1 << m ) ) == 0 ) + factor = 0x10000L - factor; - result = FT_MulFix( result, factor ); - } - blend->weight_vector[n] = result; + result = FT_MulFix( result, factor ); } - - error = FT_Err_Ok; + blend->weight_vector[n] = result; } - return error; + return FT_Err_Ok; } @@ -415,68 +414,72 @@ FT_Long* coords ) { PS_Blend blend = face->blend; - FT_Error error; FT_UInt n, p; + FT_Fixed final_blends[T1_MAX_MM_DESIGNS]; - error = FT_ERR( Invalid_Argument ); - if ( blend && blend->num_axis == num_coords ) - { - /* compute the blend coordinates through the blend design map */ - FT_Fixed final_blends[T1_MAX_MM_DESIGNS]; + if ( !blend ) + return FT_THROW( Invalid_Argument ); + if ( num_coords > blend->num_axis ) + num_coords = blend->num_axis; - for ( n = 0; n < blend->num_axis; n++ ) - { - FT_Long design = coords[n]; - FT_Fixed the_blend; - PS_DesignMap map = blend->design_map + n; - FT_Long* designs = map->design_points; - FT_Fixed* blends = map->blend_points; - FT_Int before = -1, after = -1; + /* compute the blend coordinates through the blend design map */ + for ( n = 0; n < blend->num_axis; n++ ) + { + FT_Long design; + FT_Fixed the_blend; + PS_DesignMap map = blend->design_map + n; + FT_Long* designs = map->design_points; + FT_Fixed* blends = map->blend_points; + FT_Int before = -1, after = -1; - for ( p = 0; p < (FT_UInt)map->num_points; p++ ) - { - FT_Long p_design = designs[p]; + /* use a default value if we don't have a coordinate */ + if ( n < num_coords ) + design = coords[n]; + else + design = ( designs[map->num_points - 1] - designs[0] ) / 2; - /* exact match? */ - if ( design == p_design ) - { - the_blend = blends[p]; - goto Found; - } + for ( p = 0; p < (FT_UInt)map->num_points; p++ ) + { + FT_Long p_design = designs[p]; - if ( design < p_design ) - { - after = p; - break; - } - before = p; + /* exact match? */ + if ( design == p_design ) + { + the_blend = blends[p]; + goto Found; } - /* now interpolate if necessary */ - if ( before < 0 ) - the_blend = blends[0]; + if ( design < p_design ) + { + after = (FT_Int)p; + break; + } - else if ( after < 0 ) - the_blend = blends[map->num_points - 1]; + before = (FT_Int)p; + } - else - the_blend = FT_MulDiv( design - designs[before], - blends [after] - blends [before], - designs[after] - designs[before] ); + /* now interpolate if necessary */ + if ( before < 0 ) + the_blend = blends[0]; - Found: - final_blends[n] = the_blend; - } + else if ( after < 0 ) + the_blend = blends[map->num_points - 1]; + + else + the_blend = FT_MulDiv( design - designs[before], + blends [after] - blends [before], + designs[after] - designs[before] ); - error = T1_Set_MM_Blend( face, num_coords, final_blends ); + Found: + final_blends[n] = the_blend; } - return error; + return T1_Set_MM_Blend( face, blend->num_axis, final_blends ); } @@ -490,20 +493,17 @@ FT_UInt num_coords, FT_Fixed* coords ) { - FT_Long lcoords[4]; /* maximum axis count is 4 */ - FT_UInt i; - FT_Error error; + FT_Long lcoords[T1_MAX_MM_AXIS]; + FT_UInt i; + + if ( num_coords > T1_MAX_MM_AXIS ) + num_coords = T1_MAX_MM_AXIS; - error = FT_ERR( Invalid_Argument ); - if ( num_coords <= 4 && num_coords > 0 ) - { - for ( i = 0; i < num_coords; ++i ) - lcoords[i] = FIXED_TO_INT( coords[i] ); - error = T1_Set_MM_Design( face, num_coords, lcoords ); - } + for ( i = 0; i < num_coords; ++i ) + lcoords[i] = FIXED_TO_INT( coords[i] ); - return error; + return T1_Set_MM_Design( face, num_coords, lcoords ); } @@ -599,23 +599,23 @@ /* each token is an immediate containing the name of the axis */ for ( n = 0; n < num_axis; n++ ) { - T1_Token token = axis_tokens + n; - FT_Byte* name; - FT_PtrDist len; + T1_Token token = axis_tokens + n; + FT_Byte* name; + FT_UInt len; /* skip first slash, if any */ if ( token->start[0] == '/' ) token->start++; - len = token->limit - token->start; + len = (FT_UInt)( token->limit - token->start ); if ( len == 0 ) { error = FT_THROW( Invalid_File_Format ); goto Exit; } - if ( FT_ALLOC( blend->axis_names[n], (FT_Long)( len + 1 ) ) ) + if ( FT_ALLOC( blend->axis_names[n], len + 1 ) ) goto Exit; name = (FT_Byte*)blend->axis_names[n]; @@ -692,7 +692,9 @@ } num_axis = n_axis; - error = t1_allocate_blend( face, num_designs, num_axis ); + error = t1_allocate_blend( face, + (FT_UInt)num_designs, + (FT_UInt)num_axis ); if ( error ) goto Exit; blend = face->blend; @@ -757,7 +759,7 @@ old_cursor = parser->root.cursor; old_limit = parser->root.limit; - error = t1_allocate_blend( face, 0, num_axis ); + error = t1_allocate_blend( face, 0, (FT_UInt)num_axis ); if ( error ) goto Exit; blend = face->blend; @@ -848,7 +850,7 @@ if ( !blend || !blend->num_designs ) { - error = t1_allocate_blend( face, num_designs, 0 ); + error = t1_allocate_blend( face, (FT_UInt)num_designs, 0 ); if ( error ) goto Exit; blend = face->blend; @@ -890,8 +892,8 @@ parse_buildchar( T1_Face face, T1_Loader loader ) { - face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 ); - + face->len_buildchar = (FT_UInt)T1_ToFixedArray( &loader->parser, + 0, NULL, 0 ); return; } @@ -1038,9 +1040,11 @@ } + /* return 1 in case of success */ + static int read_binary_data( T1_Parser parser, - FT_Long* size, + FT_ULong* size, FT_Byte** base, FT_Bool incremental ) { @@ -1072,7 +1076,7 @@ if ( s >= 0 && s < limit - *base ) { parser->root.cursor += s + 1; - *size = s; + *size = (FT_ULong)s; return !parser->root.error; } } @@ -1285,7 +1289,7 @@ if ( cur + 2 < limit && *cur == '/' && n < count ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -1297,7 +1301,7 @@ if ( parser->root.error ) return; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); parser->root.error = T1_Add_Table( char_table, charcode, cur, len + 1 ); @@ -1407,7 +1411,8 @@ /* */ for (;;) { - FT_Long idx, size; + FT_Long idx; + FT_ULong size; FT_Byte* base; @@ -1457,7 +1462,7 @@ /* some fonts define empty subr records -- this is not totally */ /* compliant to the specification (which says they should at */ /* least contain a `return'), but we support them anyway */ - if ( size < face->type1.private_dict.lenIV ) + if ( size < (FT_ULong)face->type1.private_dict.lenIV ) { error = FT_THROW( Invalid_File_Format ); goto Fail; @@ -1468,7 +1473,7 @@ goto Fail; FT_MEM_COPY( temp, base, size ); psaux->t1_decrypt( temp, size, 4330 ); - size -= face->type1.private_dict.lenIV; + size -= (FT_ULong)face->type1.private_dict.lenIV; error = T1_Add_Table( table, (FT_Int)idx, temp + face->type1.private_dict.lenIV, size ); FT_FREE( temp ); @@ -1508,7 +1513,7 @@ FT_Byte* cur; FT_Byte* limit = parser->root.limit; FT_Int n, num_glyphs; - FT_UInt notdef_index = 0; + FT_Int notdef_index = 0; FT_Byte notdef_found = 0; @@ -1555,7 +1560,7 @@ for (;;) { - FT_Long size; + FT_ULong size; FT_Byte* base; @@ -1606,7 +1611,7 @@ if ( *cur == '/' ) { - FT_PtrDist len; + FT_UInt len; if ( cur + 2 >= limit ) @@ -1616,7 +1621,7 @@ } cur++; /* skip `/' */ - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) ) return; @@ -1649,7 +1654,7 @@ FT_Byte* temp; - if ( size <= face->type1.private_dict.lenIV ) + if ( size <= (FT_ULong)face->type1.private_dict.lenIV ) { error = FT_THROW( Invalid_File_Format ); goto Fail; @@ -1660,7 +1665,7 @@ goto Fail; FT_MEM_COPY( temp, base, size ); psaux->t1_decrypt( temp, size, 4330 ); - size -= face->type1.private_dict.lenIV; + size -= (FT_ULong)face->type1.private_dict.lenIV; error = T1_Add_Table( code_table, n, temp + face->type1.private_dict.lenIV, size ); FT_FREE( temp ); @@ -1838,15 +1843,11 @@ }; -#define T1_FIELD_COUNT \ - ( sizeof ( t1_keywords ) / sizeof ( t1_keywords[0] ) ) - - static FT_Error parse_dict( T1_Face face, T1_Loader loader, FT_Byte* base, - FT_Long size ) + FT_ULong size ) { T1_Parser parser = &loader->parser; FT_Byte *limit, *start_binary = NULL; @@ -1902,7 +1903,7 @@ else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' && have_integer ) { - FT_Long s; + FT_ULong s; FT_Byte* b; @@ -1915,7 +1916,7 @@ else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' && have_integer ) { - FT_Long s; + FT_ULong s; FT_Byte* b; @@ -1928,7 +1929,7 @@ /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -1938,7 +1939,7 @@ if ( parser->root.error ) goto Exit; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); if ( len > 0 && len < 22 && parser->root.cursor < limit ) { @@ -1955,9 +1956,9 @@ if ( !name ) break; - if ( cur[0] == name[0] && - len == (FT_PtrDist)ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + if ( cur[0] == name[0] && + len == ft_strlen( (const char *)name ) && + ft_memcmp( cur, name, len ) == 0 ) { /* We found it -- run the parsing callback! */ /* We record every instance of every field */ @@ -2212,8 +2213,8 @@ /* the `lengths' field must be released later */ type1->glyph_names_block = loader.glyph_names.block; type1->glyph_names = (FT_String**)loader.glyph_names.elements; - loader.glyph_names.block = 0; - loader.glyph_names.elements = 0; + loader.glyph_names.block = NULL; + loader.glyph_names.elements = NULL; /* we must now build type1.encoding when we have a custom array */ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) diff --git a/freetype/src/type1/t1load.h b/freetype/src/type1/t1load.h index 546fc3353..de422e7ec 100644 --- a/freetype/src/type1/t1load.h +++ b/freetype/src/type1/t1load.h @@ -4,7 +4,7 @@ /* */ /* Type 1 font loader (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2006, 2007 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/t1objs.c b/freetype/src/type1/t1objs.c index e11770fee..af8988855 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, 2013 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -86,7 +86,7 @@ if ( funcs ) funcs->destroy( (PSH_Globals)size->root.internal ); - size->root.internal = 0; + size->root.internal = NULL; } } @@ -144,7 +144,7 @@ FT_LOCAL_DEF( void ) T1_GlyphSlot_Done( FT_GlyphSlot slot ) { - slot->internal->glyph_hints = 0; + slot->internal->glyph_hints = NULL; } @@ -224,7 +224,7 @@ } T1_Done_Blend( face ); - face->blend = 0; + face->blend = NULL; #endif /* release font info strings */ @@ -457,7 +457,7 @@ /* no embedded bitmap support */ root->num_fixed_sizes = 0; - root->available_sizes = 0; + root->available_sizes = NULL; root->bbox.xMin = type1->font_bbox.xMin >> 16; root->bbox.yMin = type1->font_bbox.yMin >> 16; diff --git a/freetype/src/type1/t1objs.h b/freetype/src/type1/t1objs.h index 54ccbb996..6b4f3cb56 100644 --- a/freetype/src/type1/t1objs.h +++ b/freetype/src/type1/t1objs.h @@ -4,7 +4,7 @@ /* */ /* Type 1 objects manager (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2006, 2011 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/t1parse.c b/freetype/src/type1/t1parse.c index ccf9f4cc5..c73b2b25d 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-2014 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -143,13 +143,13 @@ FT_ULong size; - psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory ); + psaux->ps_parser_funcs->init( &parser->root, NULL, NULL, memory ); parser->stream = stream; parser->base_len = 0; - parser->base_dict = 0; + parser->base_dict = NULL; parser->private_len = 0; - parser->private_dict = 0; + parser->private_dict = NULL; parser->in_pfb = 0; parser->in_memory = 0; parser->single_block = 0; @@ -273,7 +273,7 @@ /* made of several segments. We thus first read the number of */ /* segments to compute the total size of the private dictionary */ /* then re-read them into memory. */ - FT_Long start_pos = FT_STREAM_POS(); + FT_ULong start_pos = FT_STREAM_POS(); FT_UShort tag; @@ -411,9 +411,11 @@ /* fine that are violating this limitation, so we add a heuristic */ /* test to stop at \r only if it is not used for EOL. */ - pos_lf = ft_memchr( cur, '\n', limit - cur ); - test_cr = FT_BOOL( !pos_lf || - pos_lf > ft_memchr( cur, '\r', limit - cur ) ); + pos_lf = ft_memchr( cur, '\n', (size_t)( limit - cur ) ); + test_cr = FT_BOOL( !pos_lf || + pos_lf > ft_memchr( cur, + '\r', + (size_t)( limit - cur ) ) ); while ( cur < limit && ( *cur == ' ' || @@ -429,7 +431,7 @@ goto Exit; } - size = (FT_ULong)( parser->base_len - ( cur - parser->base_dict ) ); + size = parser->base_len - (FT_ULong)( cur - parser->base_dict ); if ( parser->in_memory ) { @@ -443,7 +445,7 @@ parser->single_block = 1; parser->private_dict = parser->base_dict; parser->private_len = size; - parser->base_dict = 0; + parser->base_dict = NULL; parser->base_len = 0; } @@ -459,7 +461,7 @@ ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) ) { /* ASCII hexadecimal encoding */ - FT_Long len; + FT_ULong len; parser->root.cursor = cur; diff --git a/freetype/src/type1/t1parse.h b/freetype/src/type1/t1parse.h index fb1c8a883..93b02e3d3 100644 --- a/freetype/src/type1/t1parse.h +++ b/freetype/src/type1/t1parse.h @@ -4,7 +4,7 @@ /* */ /* Type 1 parser (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2008 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -77,12 +77,6 @@ FT_BEGIN_HEADER #define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l ) -#define T1_Done_Table( p ) \ - do \ - { \ - if ( (p)->funcs.done ) \ - (p)->funcs.done( p ); \ - } while ( 0 ) #define T1_Release_Table( p ) \ do \ { \ diff --git a/freetype/src/type1/t1tokens.h b/freetype/src/type1/t1tokens.h index e37276b90..399265243 100644 --- a/freetype/src/type1/t1tokens.h +++ b/freetype/src/type1/t1tokens.h @@ -4,7 +4,7 @@ /* */ /* Type 1 tokenizer (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/freetype/src/type1/type1.c b/freetype/src/type1/type1.c index ccc12be10..4c70ea763 100644 --- a/freetype/src/type1/type1.c +++ b/freetype/src/type1/type1.c @@ -4,7 +4,7 @@ /* */ /* FreeType Type 1 driver component (body only). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ |