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.
This commit is contained in:
suzuki toshiya 2010-07-09 11:36:00 +09:00
parent 603d121872
commit b8ca6de365
7 changed files with 32 additions and 5 deletions

View File

@ -1,3 +1,25 @@
2010-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
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 <ken.sharp@artifex.com>
Make ftraster.c compile in stand-alone mode with MSVC compiler.

View File

@ -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 */

View File

@ -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,

View File

@ -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 */

View File

@ -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
{

View File

@ -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 */

View File

@ -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 */