diff --git a/ChangeLog b/ChangeLog index 75c7f0595..7e313a260 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2010-07-09 suzuki toshiya + + Fix Savannah bug #30373. + Too serious check of errors by `FT_CMap_New' since 2010-07-04 + is fixed. Reported by Tor Andersson. + + * include/freetype/fterrdef.h + (PSnames_Err_No_Unicode_Glyph_Name): New error code to + indicate the Unicode charmap synthesis failed because + no Unicode glyph name is found. + + * src/psnames/psmodule.c (ps_unicodes_init): Return + PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name + is found in the font. + * src/cff/cffcmap.c (cff_cmap_unicode_init): Return + CFF_Err_No_Unicode_Glyph_Name when no SID is available. + + * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New' + is failed by the lack of Unicode glyph name. + * src/type42/t42objs.c (T42_Face_Init): Ditto. + * src/cff/cffobjs.c (cff_face_init): Ditto. + 2010-07-09 Ken Sharp Make ftraster.c compile in stand-alone mode with MSVC compiler. diff --git a/include/freetype/fterrdef.h b/include/freetype/fterrdef.h index ceda1a9c2..bf5222060 100644 --- a/include/freetype/fterrdef.h +++ b/include/freetype/fterrdef.h @@ -211,6 +211,9 @@ "argument stack underflow" ) FT_ERRORDEF_( Ignore, 0xA2, \ "ignore" ) + FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ + "no Unicode glyph name found" ) + /* BDF errors */ diff --git a/src/cff/cffcmap.c b/src/cff/cffcmap.c index 6a9890713..129837110 100644 --- a/src/cff/cffcmap.c +++ b/src/cff/cffcmap.c @@ -143,8 +143,9 @@ /* 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, diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 3d50ddec6..334ec59b6 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -899,7 +899,7 @@ error = FT_CMap_New( &FT_CFF_CMAP_UNICODE_CLASS_REC_GET, NULL, &cmaprec, NULL ); - if ( error ) + if ( error && FT_Err_No_Unicode_Glyph_Name != error ) goto Exit; /* if no Unicode charmap was previously selected, select this one */ diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c index fb3b29ce4..752869693 100644 --- a/src/psnames/psmodule.c +++ b/src/psnames/psmodule.c @@ -366,9 +366,10 @@ if ( count == 0 ) { + /* No unicode chars here! */ FT_FREE( table->maps ); if ( !error ) - error = PSnames_Err_Invalid_Argument; /* No unicode chars here! */ + error = PSnames_Err_No_Unicode_Glyph_Name; } else { diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c index 1183b426b..52df90cc0 100644 --- a/src/type1/t1objs.c +++ b/src/type1/t1objs.c @@ -499,7 +499,7 @@ charmap.encoding = FT_ENCODING_UNICODE; error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); - if ( error ) + if ( error && FT_Err_No_Unicode_Glyph_Name != error ) goto Exit; /* now, generate an Adobe Standard encoding when appropriate */ diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c index de88465bf..00b5c1af6 100644 --- a/src/type42/t42objs.c +++ b/src/type42/t42objs.c @@ -335,7 +335,7 @@ charmap.encoding = FT_ENCODING_UNICODE; error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL ); - if ( error ) + if ( error && FT_Err_No_Unicode_Glyph_Name != error ) goto Exit; /* now, generate an Adobe Standard encoding when appropriate */