freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] RE: TTF font doesn't load in FT.


From: Ivan Nincic
Subject: [ft-devel] RE: TTF font doesn't load in FT.
Date: Fri, 21 Jul 2006 13:31:42 -0700

Werner,

I just commented out the lines 188-191 in ttload.c (check_table_dir
function):

/* if ( table.Offset + table.Length > stream->size &&
           table.Tag != glyx_tag                      &&
           table.Tag != locx_tag                      )
        return SFNT_Err_Unknown_File_Format;
*/

Instead of requiring that all table entries have correct values, maybe it is
better to check whether there is any table entry with the correct offsets.
If there is no table entry (or maybe 2-3 entries) with correct offsets than
the file is probably not a TrueType (or is completely corrupt).

Ivan


-----Original Message-----
From: Werner LEMBERG [mailto:address@hidden 
Sent: Thursday, July 20, 2006 12:04 AM
To: address@hidden
Cc: address@hidden; address@hidden
Subject: Re: TTF font doesn't load in FT.


> I encountered one TTF font that fails to load using FreeType (the font 
> is attached).  The font was embedded in a PDF document and it renders 
> fine in Acrobat.  The problem is that the embedded font says that 
> there are 12 tables, but there are only 8 (most likely an 
> omission/by-product of font subsetting).  By tweaking check_table_dir 
> in ttload.c, I managed to load the font (but I thought FT should be 
> able to go around this types of errors as well).

Basically, I agree.  It would be possible to rewrite `check_table_dir'
and `tt_face_load_font_dir' so that it ignores table directory entries with
invalid offsets instead.  Ideally, there should be support for
FT_VALIDATE_xxx settings so that strict behaviour can be enforced.

Can you provide a patch?


    Werner






reply via email to

[Prev in Thread] Current Thread [Next in Thread]