* include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value
0x100 instead of 0x10000; the latter value is already occupied by FT_LOAD_TARGET_LIGHT. Bug reported by James Cloos. Handle SFNT with neither outlines nor bitmaps. This fixes Savannah bug #25010. * src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither outlines nor bitmaps. * src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there is no table with glyphs. * src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging message. Other minor cosmetics.
This commit is contained in:
parent
afe6016030
commit
76fffcd898
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
||||
2008-12-05 Werner Lemberg <wl@nu.org>
|
||||
|
||||
* include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value
|
||||
0x100 instead of 0x10000; the latter value is already occupied by
|
||||
FT_LOAD_TARGET_LIGHT. Bug reported by James Cloos.
|
||||
|
||||
|
||||
Handle SFNT with neither outlines nor bitmaps. This fixes Savannah
|
||||
bug #25010.
|
||||
|
||||
* src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither
|
||||
outlines nor bitmaps.
|
||||
|
||||
* src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there
|
||||
is no table with glyphs.
|
||||
|
||||
|
||||
* src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging
|
||||
message.
|
||||
|
||||
2008-12-01 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
GDEF tables need `glyph_count' too for validation. Problem reported
|
||||
|
@ -2429,11 +2429,11 @@ FT_BEGIN_HEADER
|
||||
#define FT_LOAD_MONOCHROME 0x1000
|
||||
#define FT_LOAD_LINEAR_DESIGN 0x2000
|
||||
#define FT_LOAD_NO_AUTOHINT 0x8000U
|
||||
#define FT_LOAD_ADVANCE_ONLY 0x10000UL
|
||||
|
||||
/* */
|
||||
|
||||
/* used internally only by certain font drivers! */
|
||||
#define FT_LOAD_ADVANCE_ONLY 0x100
|
||||
#define FT_LOAD_SBITS_ONLY 0x4000
|
||||
|
||||
|
||||
|
@ -559,6 +559,10 @@
|
||||
if ( !face || !face->size || !face->glyph )
|
||||
return FT_Err_Invalid_Face_Handle;
|
||||
|
||||
/* fonts with neither outlines nor bitmaps can be found in PDFs */
|
||||
if ( !FT_IS_SCALABLE( face ) && !FT_HAS_FIXED_SIZES( face ) )
|
||||
return FT_Err_Invalid_Glyph_Index;
|
||||
|
||||
/* The validity test for `glyph_index' is performed by the */
|
||||
/* font drivers. */
|
||||
|
||||
@ -702,7 +706,7 @@
|
||||
|
||||
/* compute the linear advance in 16.16 pixels */
|
||||
if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&
|
||||
( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
|
||||
( FT_IS_SCALABLE( face ) ) )
|
||||
{
|
||||
FT_Size_Metrics* metrics = &face->size->metrics;
|
||||
|
||||
|
@ -680,19 +680,20 @@
|
||||
|
||||
face->os2.version = 0xFFFFU;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* the optional tables */
|
||||
|
||||
/* embedded bitmap support. */
|
||||
/* embedded bitmap support */
|
||||
if ( sfnt->load_eblc )
|
||||
{
|
||||
LOAD_( eblc );
|
||||
if ( error )
|
||||
{
|
||||
/* return an error if this font file has no outlines */
|
||||
if ( error == SFNT_Err_Table_Missing && has_outline )
|
||||
/* a font which contains neither bitmaps nor outlines is */
|
||||
/* still valid (although rather useless in most cases); */
|
||||
/* however, you can find such stripped fonts in PDFs */
|
||||
if ( error == SFNT_Err_Table_Missing )
|
||||
error = SFNT_Err_Ok;
|
||||
else
|
||||
goto Exit;
|
||||
|
@ -58,6 +58,9 @@
|
||||
{
|
||||
TT_Table entry;
|
||||
TT_Table limit;
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_Bool zero_length = FALSE;
|
||||
#endif
|
||||
|
||||
|
||||
FT_TRACE4(( "tt_face_lookup_table: %08p, `%c%c%c%c' -- ",
|
||||
@ -72,17 +75,28 @@
|
||||
|
||||
for ( ; entry < limit; entry++ )
|
||||
{
|
||||
/* For compatibility with Windows, we consider 0-length */
|
||||
/* tables the same as missing tables. */
|
||||
if ( entry->Tag == tag && entry->Length != 0 )
|
||||
{
|
||||
FT_TRACE4(( "found table.\n" ));
|
||||
return entry;
|
||||
/* For compatibility with Windows, we consider */
|
||||
/* zero-length tables the same as missing tables. */
|
||||
if ( entry->Tag == tag ) {
|
||||
if ( entry->Length != 0 )
|
||||
{
|
||||
FT_TRACE4(( "found table.\n" ));
|
||||
return entry;
|
||||
}
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
zero_length = TRUE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
FT_TRACE4(( "could not find table!\n" ));
|
||||
return 0;
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if ( zero_length )
|
||||
FT_TRACE4(( "ignoring empty table!\n" ));
|
||||
else
|
||||
FT_TRACE4(( "could not find table!\n" ));
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2005 by George Williams */
|
||||
/* Copyright (C) 2005, 2007, 2008 by George Williams */
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@ -151,8 +151,8 @@
|
||||
int load_flags = FT_LOAD_DEFAULT;
|
||||
|
||||
|
||||
if ( check_outlines &&
|
||||
( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
|
||||
if ( check_outlines &&
|
||||
FT_IS_SCALABLE( face ) )
|
||||
load_flags = FT_LOAD_NO_BITMAP;
|
||||
|
||||
if ( nohints )
|
||||
@ -162,8 +162,8 @@
|
||||
|
||||
for ( gid = 0; gid < face->num_glyphs; ++gid )
|
||||
{
|
||||
if ( check_outlines &&
|
||||
( face->face_flags & FT_FACE_FLAG_SCALABLE ) )
|
||||
if ( check_outlines &&
|
||||
FT_IS_SCALABLE( face ) )
|
||||
{
|
||||
if ( !FT_Load_Glyph( face, gid, load_flags ) )
|
||||
FT_Outline_Decompose( &face->glyph->outline, &outlinefuncs, NULL );
|
||||
|
Loading…
Reference in New Issue
Block a user