* src/sfnt/ttload.c (TT_Load_SFNT_Header): fixed a recent bug that prevented

OpenType fonts to be recognized by FreeType
This commit is contained in:
David Turner 2002-07-17 22:51:06 +00:00
parent 3e19d85dd4
commit fed59b7cc2
9 changed files with 41 additions and 9 deletions

View File

@ -8,8 +8,12 @@
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
FT_CONFIG_OPTION_USE_CMAPS is now the default
src/type42/t42objs.c, src/type42/t42objs.h, src/type42/t42drivr.c,
src/winfonts/winfnt.c: code cleanup, FT_CONFIG_OPTION_USE_CMAPS is now
the default
* src/sfnt/ttload.c (TT_Load_SFNT_Header): fixed a recent bug that prevented
OpenType fonts to be recognized by FreeType
2002-07-11 David Turner <david@freetype.org>

View File

@ -733,6 +733,26 @@
if ( error )
goto Fail;
/* select Unicode charmap by default */
{
FT_Int nn;
FT_CharMap unicmap = NULL, cmap;
for ( nn = 0; nn < face->num_charmaps; nn++ )
{
cmap = face->charmaps[nn];
if ( cmap->encoding == ft_encoding_unicode )
{
unicmap = cmap;
break;
}
}
if ( unicmap != NULL )
face->charmap = unicmap;
}
*aface = face;
Fail:

View File

@ -411,9 +411,11 @@ THE SOFTWARE.
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
#endif
}
goto Exit;

View File

@ -266,9 +266,11 @@ THE SOFTWARE.
error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL );
#if 0
/* Select default charmap */
if (face->root.num_charmaps)
face->root.charmap = face->root.charmaps[0];
#endif
}
}

View File

@ -167,18 +167,20 @@
/* create charmap */
{
FT_CharMapRec charmap;
charmap.face = root;
charmap.platform_id = 3;
charmap.encoding_id = 1;
charmap.encoding = ft_encoding_unicode;
FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
#endif
}
/* check whether we've loaded any kerning pairs */

View File

@ -595,12 +595,14 @@
charmap->encoding = sfnt_find_encoding( charmap->platform_id,
charmap->encoding_id );
#if 0
if ( root->charmap == NULL &&
charmap->encoding == ft_encoding_unicode )
{
/* set 'root->charmap' to the first Unicode encoding we find */
root->charmap = charmap;
}
#endif
}
}

View File

@ -228,7 +228,7 @@
/*************************************************************************/
/* */
/* <Function> */
/* TT_Load_SFNT_HeaderRec */
/* TT_Load_SFNT_Header */
/* */
/* <Description> */
/* Loads the header of a SFNT font file. Supports collections. */
@ -345,9 +345,6 @@
goto Exit;
}
if ( format_tag != 0x10000UL && format_tag != 0x74727565UL )
goto Bad_Format;
/* the format tag was read, now check the rest of the header */
sfnt->format_tag = format_tag;
sfnt->offset = offset;
@ -359,7 +356,6 @@
error = sfnt_dir_check( stream, offset, sfnt->num_tables );
if ( error )
{
Bad_Format:
FT_TRACE2(( "TT_Load_SFNT_Header: file is not SFNT!\n" ));
error = SFNT_Err_Unknown_File_Format;
}

View File

@ -484,9 +484,11 @@
if ( clazz )
FT_CMap_New( clazz, NULL, &charmap, NULL );
#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
#endif
}
}

View File

@ -337,9 +337,11 @@
if ( clazz )
FT_CMap_New( clazz, NULL, &charmap, NULL );
#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
#endif
}
}
Exit: