diff options
author | marha <marha@users.sourceforge.net> | 2012-03-12 10:33:22 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-12 10:33:22 +0100 |
commit | 41bd254198b8b879a562a85f7dc868c3c0f7fbc1 (patch) | |
tree | 3db49b4d73b8c4c734c1382ab5469a4f9f8baf93 /freetype/src/type42 | |
parent | b91444584a64f4f7b3eaeee05ef36ac53691fb24 (diff) | |
download | vcxsrv-41bd254198b8b879a562a85f7dc868c3c0f7fbc1.tar.gz vcxsrv-41bd254198b8b879a562a85f7dc868c3c0f7fbc1.tar.bz2 vcxsrv-41bd254198b8b879a562a85f7dc868c3c0f7fbc1.zip |
Updated to freetype-2.4.9
Diffstat (limited to 'freetype/src/type42')
-rw-r--r-- | freetype/src/type42/t42drivr.c | 36 | ||||
-rw-r--r-- | freetype/src/type42/t42error.h | 3 | ||||
-rw-r--r-- | freetype/src/type42/t42objs.c | 81 | ||||
-rw-r--r-- | freetype/src/type42/t42objs.h | 22 | ||||
-rw-r--r-- | freetype/src/type42/t42parse.c | 9 |
5 files changed, 90 insertions, 61 deletions
diff --git a/freetype/src/type42/t42drivr.c b/freetype/src/type42/t42drivr.c index f56d6e773..9b93209ad 100644 --- a/freetype/src/type42/t42drivr.c +++ b/freetype/src/type42/t42drivr.c @@ -184,11 +184,11 @@ }; - static FT_Module_Interface - T42_Get_Interface( FT_Driver driver, + FT_CALLBACK_DEF( FT_Module_Interface ) + T42_Get_Interface( FT_Module module, const FT_String* t42_interface ) { - FT_UNUSED( driver ); + FT_UNUSED( module ); return ft_service_list_lookup( t42_services, t42_interface ); } @@ -213,34 +213,34 @@ 0, /* format interface */ - (FT_Module_Constructor)T42_Driver_Init, - (FT_Module_Destructor) T42_Driver_Done, - (FT_Module_Requester) T42_Get_Interface, + T42_Driver_Init, + T42_Driver_Done, + T42_Get_Interface, }, sizeof ( T42_FaceRec ), sizeof ( T42_SizeRec ), sizeof ( T42_GlyphSlotRec ), - (FT_Face_InitFunc) T42_Face_Init, - (FT_Face_DoneFunc) T42_Face_Done, - (FT_Size_InitFunc) T42_Size_Init, - (FT_Size_DoneFunc) T42_Size_Done, - (FT_Slot_InitFunc) T42_GlyphSlot_Init, - (FT_Slot_DoneFunc) T42_GlyphSlot_Done, + T42_Face_Init, + T42_Face_Done, + T42_Size_Init, + T42_Size_Done, + T42_GlyphSlot_Init, + T42_GlyphSlot_Done, #ifdef FT_CONFIG_OPTION_OLD_INTERNALS ft_stub_set_char_sizes, ft_stub_set_pixel_sizes, #endif - (FT_Slot_LoadFunc) T42_GlyphSlot_Load, + T42_GlyphSlot_Load, - (FT_Face_GetKerningFunc) 0, - (FT_Face_AttachFunc) 0, + 0, /* FT_Face_GetKerningFunc */ + 0, /* FT_Face_AttachFunc */ - (FT_Face_GetAdvancesFunc) 0, - (FT_Size_RequestFunc) T42_Size_Request, - (FT_Size_SelectFunc) T42_Size_Select + 0, /* FT_Face_GetAdvancesFunc */ + T42_Size_Request, + T42_Size_Select }; diff --git a/freetype/src/type42/t42error.h b/freetype/src/type42/t42error.h index b23091001..217ae8bd5 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 by */ +/* Copyright 2002, 2003, 2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -29,6 +29,7 @@ #undef __FTERRORS_H__ +#undef FT_ERR_PREFIX #define FT_ERR_PREFIX T42_Err_ #define FT_ERR_BASE FT_Mod_Err_Type42 diff --git a/freetype/src/type42/t42objs.c b/freetype/src/type42/t42objs.c index a5e0ee5e8..c6053afed 100644 --- a/freetype/src/type42/t42objs.c +++ b/freetype/src/type42/t42objs.c @@ -4,7 +4,7 @@ /* */ /* Type 42 objects manager (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 */ +/* Copyright 2002-2009, 2011 */ /* by Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -21,7 +21,7 @@ #include "t42error.h" #include FT_INTERNAL_DEBUG_H #include FT_LIST_H -#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_IDS_H #undef FT_COMPONENT @@ -61,6 +61,8 @@ if ( type1->font_type != 42 ) { + FT_ERROR(( "T42_Open_Face: cannot handle FontType %d\n", + type1->font_type )); error = T42_Err_Unknown_File_Format; goto Exit; } @@ -152,11 +154,12 @@ FT_LOCAL_DEF( FT_Error ) T42_Face_Init( FT_Stream stream, - T42_Face face, + FT_Face t42face, /* T42_Face */ FT_Int face_index, FT_Int num_params, FT_Parameter* params ) { + T42_Face face = (T42_Face)t42face; FT_Error error; FT_Service_PsCMaps psnames; PSAux_Service psaux; @@ -179,6 +182,14 @@ face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ), "psaux" ); psaux = (PSAux_Service)face->psaux; + if ( !psaux ) + { + FT_ERROR(( "T42_Face_Init: cannot access `psaux' module\n" )); + error = T42_Err_Missing_Module; + goto Exit; + } + + FT_TRACE2(( "Type 42 driver\n" )); /* open the tokenizer, this will also check the font format */ error = T42_Open_Face( face ); @@ -321,7 +332,7 @@ root->face_flags |= FT_FACE_FLAG_VERTICAL; { - if ( psnames && psaux ) + if ( psnames ) { FT_CharMapRec charmap; T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes; @@ -390,8 +401,9 @@ FT_LOCAL_DEF( void ) - T42_Face_Done( T42_Face face ) + T42_Face_Done( FT_Face t42face ) { + T42_Face face = (T42_Face)t42face; T1_Font type1; PS_FontInfo info; FT_Memory memory; @@ -459,12 +471,19 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - T42_Driver_Init( T42_Driver driver ) + T42_Driver_Init( FT_Module module ) /* T42_Driver */ { - FT_Module ttmodule; + T42_Driver driver = (T42_Driver)module; + FT_Module ttmodule; - ttmodule = FT_Get_Module( FT_MODULE(driver)->library, "truetype" ); + ttmodule = FT_Get_Module( module->library, "truetype" ); + if ( !ttmodule ) + { + FT_ERROR(( "T42_Driver_Init: cannot access `truetype' module\n" )); + return T42_Err_Missing_Module; + } + driver->ttclazz = (FT_Driver_Class)ttmodule->clazz; return T42_Err_Ok; @@ -472,23 +491,24 @@ FT_LOCAL_DEF( void ) - T42_Driver_Done( T42_Driver driver ) + T42_Driver_Done( FT_Module module ) { - FT_UNUSED( driver ); + FT_UNUSED( module ); } FT_LOCAL_DEF( FT_Error ) - T42_Size_Init( T42_Size size ) + T42_Size_Init( FT_Size size ) /* T42_Size */ { - FT_Face face = size->root.face; + T42_Size t42size = (T42_Size)size; + FT_Face face = size->face; T42_Face t42face = (T42_Face)face; FT_Size ttsize; FT_Error error = T42_Err_Ok; error = FT_New_Size( t42face->ttf_face, &ttsize ); - size->ttsize = ttsize; + t42size->ttsize = ttsize; FT_Activate_Size( ttsize ); @@ -497,10 +517,11 @@ FT_LOCAL_DEF( FT_Error ) - T42_Size_Request( T42_Size size, + T42_Size_Request( FT_Size t42size, /* T42_Size */ FT_Size_Request req ) { - T42_Face face = (T42_Face)size->root.face; + T42_Size size = (T42_Size)t42size; + T42_Face face = (T42_Face)t42size->face; FT_Error error; @@ -508,17 +529,18 @@ error = FT_Request_Size( face->ttf_face, req ); if ( !error ) - ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; + t42size->metrics = face->ttf_face->size->metrics; return error; } FT_LOCAL_DEF( FT_Error ) - T42_Size_Select( T42_Size size, + T42_Size_Select( FT_Size t42size, /* T42_Size */ FT_ULong strike_index ) { - T42_Face face = (T42_Face)size->root.face; + T42_Size size = (T42_Size)t42size; + T42_Face face = (T42_Face)t42size->face; FT_Error error; @@ -526,7 +548,7 @@ error = FT_Select_Size( face->ttf_face, (FT_Int)strike_index ); if ( !error ) - ( (FT_Size)size )->metrics = face->ttf_face->size->metrics; + t42size->metrics = face->ttf_face->size->metrics; return error; @@ -534,9 +556,10 @@ FT_LOCAL_DEF( void ) - T42_Size_Done( T42_Size size ) + T42_Size_Done( FT_Size t42size ) /* T42_Size */ { - FT_Face face = size->root.face; + T42_Size size = (T42_Size)t42size; + FT_Face face = t42size->face; T42_Face t42face = (T42_Face)face; FT_ListNode node; @@ -551,12 +574,13 @@ FT_LOCAL_DEF( FT_Error ) - T42_GlyphSlot_Init( T42_GlyphSlot slot ) + T42_GlyphSlot_Init( FT_GlyphSlot t42slot ) /* T42_GlyphSlot */ { - FT_Face face = slot->root.face; - T42_Face t42face = (T42_Face)face; - FT_GlyphSlot ttslot; - FT_Error error = T42_Err_Ok; + T42_GlyphSlot slot = (T42_GlyphSlot)t42slot; + FT_Face face = t42slot->face; + T42_Face t42face = (T42_Face)face; + FT_GlyphSlot ttslot; + FT_Error error = T42_Err_Ok; if ( face->glyph == NULL ) @@ -575,8 +599,11 @@ FT_LOCAL_DEF( void ) - T42_GlyphSlot_Done( T42_GlyphSlot slot ) + T42_GlyphSlot_Done( FT_GlyphSlot t42slot ) /* T42_GlyphSlot */ { + T42_GlyphSlot slot = (T42_GlyphSlot)t42slot; + + FT_Done_GlyphSlot( slot->ttslot ); } diff --git a/freetype/src/type42/t42objs.h b/freetype/src/type42/t42objs.h index 289dedcc6..02d13259b 100644 --- a/freetype/src/type42/t42objs.h +++ b/freetype/src/type42/t42objs.h @@ -4,7 +4,7 @@ /* */ /* Type 42 objects manager (specification). */ /* */ -/* Copyright 2002, 2003, 2006, 2007 by Roberto Alameda. */ +/* Copyright 2002, 2003, 2006, 2007, 2011 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 */ @@ -65,36 +65,36 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) T42_Face_Init( FT_Stream stream, - T42_Face face, + FT_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ); FT_LOCAL( void ) - T42_Face_Done( T42_Face face ); + T42_Face_Done( FT_Face face ); FT_LOCAL( FT_Error ) - T42_Size_Init( T42_Size size ); + T42_Size_Init( FT_Size size ); FT_LOCAL( FT_Error ) - T42_Size_Request( T42_Size size, + T42_Size_Request( FT_Size size, FT_Size_Request req ); FT_LOCAL( FT_Error ) - T42_Size_Select( T42_Size size, + T42_Size_Select( FT_Size size, FT_ULong strike_index ); FT_LOCAL( void ) - T42_Size_Done( T42_Size size ); + T42_Size_Done( FT_Size size ); FT_LOCAL( FT_Error ) - T42_GlyphSlot_Init( T42_GlyphSlot slot ); + T42_GlyphSlot_Init( FT_GlyphSlot slot ); FT_LOCAL( FT_Error ) @@ -104,14 +104,14 @@ FT_BEGIN_HEADER FT_Int32 load_flags ); FT_LOCAL( void ) - T42_GlyphSlot_Done( T42_GlyphSlot slot ); + T42_GlyphSlot_Done( FT_GlyphSlot slot ); FT_LOCAL( FT_Error ) - T42_Driver_Init( T42_Driver driver ); + T42_Driver_Init( FT_Module module ); FT_LOCAL( void ) - T42_Driver_Done( T42_Driver driver ); + T42_Driver_Done( FT_Module module ); /* */ diff --git a/freetype/src/type42/t42parse.c b/freetype/src/type42/t42parse.c index 577426917..468b46334 100644 --- a/freetype/src/type42/t42parse.c +++ b/freetype/src/type42/t42parse.c @@ -4,7 +4,7 @@ /* */ /* Type 42 font parser (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */ +/* Copyright 2002-2012 by */ /* Roberto Alameda. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -175,7 +175,7 @@ if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 ) { - FT_TRACE2(( "not a Type42 font\n" )); + FT_TRACE2(( " not a Type42 font\n" )); error = T42_Err_Unknown_File_Format; } @@ -607,8 +607,9 @@ goto Fail; } - /* A string can have a trailing zero byte for padding. Ignore it. */ - if ( string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) + /* A string can have a trailing zero (odd) byte for padding. */ + /* Ignore it. */ + if ( ( string_size & 1 ) && string_buf[string_size - 1] == 0 ) string_size--; if ( !string_size ) |