From 47ed6413ce8f2586b8d542dc46055e075a47022e Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 6 Aug 2010 10:14:25 +0000 Subject: Updated to freetype 2.4.1 --- freetype/src/cff/cffcmap.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'freetype/src/cff/cffcmap.c') diff --git a/freetype/src/cff/cffcmap.c b/freetype/src/cff/cffcmap.c index 46d603e3a..129837110 100644 --- a/freetype/src/cff/cffcmap.c +++ b/freetype/src/cff/cffcmap.c @@ -4,7 +4,7 @@ /* */ /* CFF character mapping table (cmap) support (body). */ /* */ -/* Copyright 2002, 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -120,27 +120,15 @@ /*************************************************************************/ FT_CALLBACK_DEF( const char* ) - cff_sid_to_glyph_name( TT_Face face, - FT_UInt idx ) + cff_sid_to_glyph_name( TT_Face face, + FT_UInt idx ) { - CFF_Font cff = (CFF_Font)face->extra.data; - CFF_Charset charset = &cff->charset; - FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; - FT_UInt sid = charset->sids[idx]; - - - return cff_index_get_sid_string( &cff->string_index, sid, psnames ); - } - - - FT_CALLBACK_DEF( void ) - cff_sid_free_glyph_name( TT_Face face, - const char* gname ) - { - FT_Memory memory = FT_FACE_MEMORY( face ); + CFF_Font cff = (CFF_Font)face->extra.data; + CFF_Charset charset = &cff->charset; + FT_UInt sid = charset->sids[idx]; - FT_FREE( gname ); + return cff_index_get_sid_string( cff, sid ); } @@ -155,14 +143,15 @@ /* can't build Unicode map for CID-keyed font */ + /* because we don't know glyph names. */ if ( !charset->sids ) - return CFF_Err_Invalid_Argument; + return CFF_Err_No_Unicode_Glyph_Name; return psnames->unicodes_init( memory, unicodes, cff->num_glyphs, (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name, - (PS_FreeGlyphNameFunc)&cff_sid_free_glyph_name, + (PS_FreeGlyphNameFunc)NULL, (FT_Pointer)face ); } -- cgit v1.2.3