summaryrefslogtreecommitdiffstats
path: root/src/cff/cffcmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cff/cffcmap.c')
-rw-r--r--src/cff/cffcmap.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/cff/cffcmap.c b/src/cff/cffcmap.c
index 46d603e..1298371 100644
--- a/src/cff/cffcmap.c
+++ b/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 );
}