forked from minhngoc25a/freetype2
* 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:
parent
3e19d85dd4
commit
fed59b7cc2
|
@ -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>
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue