diff options
Diffstat (limited to 'freetype/src/type42')
-rw-r--r-- | freetype/src/type42/Jamfile | 2 | ||||
-rw-r--r-- | freetype/src/type42/module.mk | 2 | ||||
-rw-r--r-- | freetype/src/type42/rules.mk | 7 | ||||
-rw-r--r-- | freetype/src/type42/t42drivr.c | 6 | ||||
-rw-r--r-- | freetype/src/type42/t42drivr.h | 3 | ||||
-rw-r--r-- | freetype/src/type42/t42error.h | 2 | ||||
-rw-r--r-- | freetype/src/type42/t42objs.c | 20 | ||||
-rw-r--r-- | freetype/src/type42/t42objs.h | 4 | ||||
-rw-r--r-- | freetype/src/type42/t42parse.c | 71 | ||||
-rw-r--r-- | freetype/src/type42/t42parse.h | 7 | ||||
-rw-r--r-- | freetype/src/type42/t42types.h | 5 | ||||
-rw-r--r-- | freetype/src/type42/type42.c | 2 |
12 files changed, 71 insertions, 60 deletions
diff --git a/freetype/src/type42/Jamfile b/freetype/src/type42/Jamfile index 00371d54f..e0db3cca8 100644 --- a/freetype/src/type42/Jamfile +++ b/freetype/src/type42/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 src/type42 Jamfile # -# Copyright 2002 by +# Copyright 2002-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/type42/module.mk b/freetype/src/type42/module.mk index b3f10a8d3..af7e651d9 100644 --- a/freetype/src/type42/module.mk +++ b/freetype/src/type42/module.mk @@ -3,7 +3,7 @@ # -# Copyright 2002, 2006 by +# Copyright 2002-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/type42/rules.mk b/freetype/src/type42/rules.mk index eac1081eb..4a8efca50 100644 --- a/freetype/src/type42/rules.mk +++ b/freetype/src/type42/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 2002, 2003, 2008 by +# Copyright 2002-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 @@ T42_DIR := $(SRC_DIR)/type42 # compilation flags for the driver # -T42_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T42_DIR)) +T42_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(T42_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) # Type42 driver source diff --git a/freetype/src/type42/t42drivr.c b/freetype/src/type42/t42drivr.c index e3a52d772..d2b53300b 100644 --- a/freetype/src/type42/t42drivr.c +++ b/freetype/src/type42/t42drivr.c @@ -4,7 +4,7 @@ /* */ /* High-level Type 42 driver interface (body). */ /* */ -/* Copyright 2002-2004, 2006, 2007, 2009, 2011, 2013 by */ +/* Copyright 2002-2015 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -41,7 +41,7 @@ #include "t42error.h" #include <internal/ftdebug.h> -#include FT_SERVICE_XFREE86_NAME_H +#include FT_SERVICE_FONT_FORMAT_H #include FT_SERVICE_GLYPH_DICT_H #include FT_SERVICE_POSTSCRIPT_NAME_H #include <internal/services/svpsinfo.h> @@ -180,7 +180,7 @@ { FT_SERVICE_ID_GLYPH_DICT, &t42_service_glyph_dict }, { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name }, { FT_SERVICE_ID_POSTSCRIPT_INFO, &t42_service_ps_info }, - { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_42 }, + { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TYPE_42 }, { NULL, NULL } }; diff --git a/freetype/src/type42/t42drivr.h b/freetype/src/type42/t42drivr.h index fca34d03f..86983552c 100644 --- a/freetype/src/type42/t42drivr.h +++ b/freetype/src/type42/t42drivr.h @@ -4,7 +4,8 @@ /* */ /* High-level Type 42 driver interface (specification). */ /* */ -/* Copyright 2002 by Roberto Alameda. */ +/* Copyright 2002-2015 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 */ diff --git a/freetype/src/type42/t42error.h b/freetype/src/type42/t42error.h index 217ae8bd5..cddaf9e9c 100644 --- a/freetype/src/type42/t42error.h +++ b/freetype/src/type42/t42error.h @@ -4,7 +4,7 @@ /* */ /* Type 42 error codes (specification only). */ /* */ -/* Copyright 2002, 2003, 2012 by */ +/* Copyright 2002-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/type42/t42objs.c b/freetype/src/type42/t42objs.c index 66bdb6907..b0ad95581 100644 --- a/freetype/src/type42/t42objs.c +++ b/freetype/src/type42/t42objs.c @@ -4,8 +4,8 @@ /* */ /* Type 42 objects manager (body). */ /* */ -/* Copyright 2002-2009, 2011, 2013 */ -/* by Roberto Alameda. */ +/* Copyright 2002-2015 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 */ @@ -92,8 +92,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 ) @@ -285,7 +285,7 @@ /* no embedded bitmap support */ root->num_fixed_sizes = 0; - root->available_sizes = 0; + root->available_sizes = NULL; /* Load the TTF font embedded in the T42 font */ { @@ -461,8 +461,8 @@ FT_FREE( face->unicode_map.maps ); face->unicode_map.num_maps = 0; - face->root.family_name = 0; - face->root.style_name = 0; + face->root.family_name = NULL; + face->root.style_name = NULL; } @@ -632,10 +632,10 @@ slot->bitmap_left = 0; slot->bitmap_top = 0; slot->num_subglyphs = 0; - slot->subglyphs = 0; - slot->control_data = 0; + slot->subglyphs = NULL; + slot->control_data = NULL; slot->control_len = 0; - slot->other = 0; + slot->other = NULL; slot->format = FT_GLYPH_FORMAT_NONE; slot->linearHoriAdvance = 0; diff --git a/freetype/src/type42/t42objs.h b/freetype/src/type42/t42objs.h index 0fad19adb..9e0cd8745 100644 --- a/freetype/src/type42/t42objs.h +++ b/freetype/src/type42/t42objs.h @@ -4,7 +4,8 @@ /* */ /* Type 42 objects manager (specification). */ /* */ -/* Copyright 2002, 2003, 2006, 2007, 2011 by Roberto Alameda. */ +/* Copyright 2002-2015 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 */ @@ -55,7 +56,6 @@ FT_BEGIN_HEADER { FT_DriverRec root; FT_Driver_Class ttclazz; - void* extension_component; } T42_DriverRec, *T42_Driver; diff --git a/freetype/src/type42/t42parse.c b/freetype/src/type42/t42parse.c index 1be13d3f4..09d88c20f 100644 --- a/freetype/src/type42/t42parse.c +++ b/freetype/src/type42/t42parse.c @@ -4,7 +4,7 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002-2014 by */ +/* Copyright 2002-2015 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -104,12 +104,6 @@ #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 \ { \ @@ -148,11 +142,11 @@ FT_Long 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->in_memory = 0; /*******************************************************************/ @@ -184,7 +178,7 @@ if ( error || FT_STREAM_SEEK( 0 ) ) goto Exit; - size = stream->size; + size = (FT_Long)stream->size; /* now, try to load `size' bytes of the `base' dictionary we */ /* found previously */ @@ -433,7 +427,7 @@ if ( cur + 2 < limit && *cur == '/' && n < count ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -445,7 +439,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 ); @@ -524,9 +518,9 @@ FT_Byte* limit = parser->root.limit; FT_Error error; FT_Int num_tables = 0; - FT_ULong count; + FT_Long count; - FT_Long n, string_size, old_string_size, real_size; + FT_ULong n, string_size, old_string_size, real_size; FT_Byte* string_buf = NULL; FT_Bool allocated = 0; @@ -579,7 +573,7 @@ goto Exit; /* don't include delimiters */ - string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 ); + string_size = (FT_ULong)( ( parser->root.cursor - cur - 2 + 1 ) / 2 ); if ( !string_size ) { FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" )); @@ -594,11 +588,14 @@ parser->root.cursor = cur; (void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 ); old_string_size = string_size; - string_size = real_size; + string_size = real_size; } else if ( ft_isdigit( *cur ) ) { + FT_Long tmp; + + if ( allocated ) { FT_ERROR(( "t42_parse_sfnts: " @@ -607,13 +604,15 @@ goto Fail; } - string_size = T1_ToInt( parser ); - if ( string_size < 0 ) + tmp = T1_ToInt( parser ); + if ( tmp < 0 ) { FT_ERROR(( "t42_parse_sfnts: invalid string size\n" )); error = FT_THROW( Invalid_File_Format ); goto Fail; } + else + string_size = (FT_ULong)tmp; T1_Skip_PS_Token( parser ); /* `RD' */ if ( parser->root.error ) @@ -621,7 +620,7 @@ string_buf = parser->root.cursor + 1; /* one space after `RD' */ - if ( limit - parser->root.cursor < string_size ) + if ( (FT_ULong)( limit - parser->root.cursor ) < string_size ) { FT_ERROR(( "t42_parse_sfnts: too much binary data\n" )); error = FT_THROW( Invalid_File_Format ); @@ -667,7 +666,7 @@ status = BEFORE_TABLE_DIR; face->ttf_size = 12 + 16 * num_tables; - if ( (FT_ULong)( limit - parser->root.cursor ) < face->ttf_size ) + if ( (FT_Long)( limit - parser->root.cursor ) < face->ttf_size ) { FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" )); error = FT_THROW( Invalid_File_Format ); @@ -700,7 +699,7 @@ len = FT_PEEK_ULONG( p ); /* Pad to a 4-byte boundary length */ - face->ttf_size += ( len + 3 ) & ~3; + face->ttf_size += (FT_Long)( ( len + 3 ) & ~3U ); } status = OTHER_TABLES; @@ -754,8 +753,8 @@ FT_Byte* cur; FT_Byte* limit = parser->root.limit; - FT_UInt n; - FT_UInt notdef_index = 0; + FT_Int n; + FT_Int notdef_index = 0; FT_Byte notdef_found = 0; @@ -770,15 +769,21 @@ if ( ft_isdigit( *parser->root.cursor ) ) { - loader->num_glyphs = (FT_UInt)T1_ToInt( parser ); + loader->num_glyphs = T1_ToInt( parser ); if ( parser->root.error ) return; + if ( loader->num_glyphs < 0 ) + { + FT_ERROR(( "t42_parse_encoding: invalid number of glyphs\n" )); + error = FT_THROW( Invalid_File_Format ); + goto Fail; + } } else if ( *parser->root.cursor == '<' ) { /* We have `<< ... >>'. Count the number of `/' in the dictionary */ /* to get its size. */ - FT_UInt count = 0; + FT_Int count = 0; T1_Skip_PS_Token( parser ); @@ -873,7 +878,7 @@ if ( *cur == '/' ) { - FT_PtrDist len; + FT_UInt len; if ( cur + 2 >= limit ) @@ -884,7 +889,7 @@ } cur++; /* skip `/' */ - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); error = T1_Add_Table( name_table, n, cur, len + 1 ); if ( error ) @@ -914,7 +919,7 @@ goto Fail; } - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); error = T1_Add_Table( code_table, n, cur, len + 1 ); if ( error ) @@ -1135,7 +1140,7 @@ /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -1145,7 +1150,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 ) { @@ -1164,9 +1169,9 @@ if ( !name ) continue; - 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! */ parser->root.error = t42_load_keyword( face, diff --git a/freetype/src/type42/t42parse.h b/freetype/src/type42/t42parse.h index f1ae1fcad..9e5b7be8d 100644 --- a/freetype/src/type42/t42parse.h +++ b/freetype/src/type42/t42parse.h @@ -4,7 +4,8 @@ /* */ /* Type 42 font parser (specification). */ /* */ -/* Copyright 2002, 2003 by Roberto Alameda. */ +/* Copyright 2002-2015 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 */ @@ -42,11 +43,11 @@ FT_BEGIN_HEADER { T42_ParserRec parser; /* parser used to read the stream */ - FT_UInt num_chars; /* number of characters in encoding */ + FT_Int num_chars; /* number of characters in encoding */ PS_TableRec encoding_table; /* PS_Table used to store the */ /* encoding character names */ - FT_UInt num_glyphs; + FT_Int num_glyphs; PS_TableRec glyph_names; PS_TableRec charstrings; PS_TableRec swap_table; /* For moving .notdef glyph to index 0. */ diff --git a/freetype/src/type42/t42types.h b/freetype/src/type42/t42types.h index cfe1cb192..b48971ecb 100644 --- a/freetype/src/type42/t42types.h +++ b/freetype/src/type42/t42types.h @@ -4,7 +4,8 @@ /* */ /* Type 42 font data types (specification only). */ /* */ -/* Copyright 2002, 2003, 2006, 2008 by Roberto Alameda. */ +/* Copyright 2002-2015 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 */ @@ -39,7 +40,7 @@ FT_BEGIN_HEADER const void* afm_data; #endif FT_Byte* ttf_data; - FT_ULong ttf_size; + FT_Long ttf_size; FT_Face ttf_face; FT_CharMapRec charmaprecs[2]; FT_CharMap charmaps[2]; diff --git a/freetype/src/type42/type42.c b/freetype/src/type42/type42.c index d13df56b1..3332b7b7e 100644 --- a/freetype/src/type42/type42.c +++ b/freetype/src/type42/type42.c @@ -4,7 +4,7 @@ /* */ /* FreeType Type 42 driver component. */ /* */ -/* Copyright 2002 by */ +/* Copyright 2002-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ |