bugThe FreeType Project - Bugs: bug #25010, TrueType font containing empty...

 
 

bug #25010: TrueType font containing empty 'glyf' table is incorrectly rejected by FT

Submitted by:  John Tytgat <joty>
Submitted on:  Thu 04 Dec 2008 03:51:39 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.8

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 09 Dec 2008 06:53:25 AM UTC, comment #3:

I was confused. You are right: Such a font can be considered as
containing spaces only, with varying widths.

A new fix is now in the CVS; please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 08 Dec 2008 08:58:47 AM UTC, comment #2:

This seems like a dangerous way to fix it. This way you'll create a valid font that does not have a .notdef glyph at index 0.

This is a valid font that actually defines glyphs as having an empty outline. so i see no reason to return FT_Err_Invalid_Glyph_Index. A font like this will most likely only occur embedded in documents like pdf, but if anyone renders such a document I believe they would expect freetype to parse the font this way.

bram tassyns <bramt>
Fri 05 Dec 2008 06:43:52 PM UTC, comment #1:

> Attached a subsetted TrueType font Univers-Extend which was found in a PDF file. This font has been subsetted so significantly that it does not contain any glyph definitions at all but there is still a 'glyf' table present with length 0.


Hmm. What is such a font good for? Or is it a bug in the PDF
creation engine which should not add such an `empty' font at all?

> It is a bit unclear what precisely the "compatibility with Windows" means (see comment line in the diff of the change made)


Windows indeed ignores SFNT tables with size zero, AFAIK.

> but a reasonable fix to accept this TrueType font is probably to ignore the 0 length check for 'glyf' tables as this means that all glyphs in this font (including the .notdef one) are of length 0, i.e. no outlines.


I've implemented it in a different way. FT_Load_Glyph will always return `FT_Err_Invalid_Glyph_Index' for fonts which neither have outlines nor bitmaps. Please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 04 Dec 2008 03:51:39 PM UTC, original submission:

Attached a subsetted TrueType font Univers-Extend which was found in a PDF file. This font has been subsetted so significantly that it does not contain any glyph definitions at all but there is still a 'glyf' table present with length 0.

This font is incorrectly rejected by FT (cvs trunk).

The reason is that in tt_face_lookup_table() all 0 length tables are considered as not-present since revision 1.79 of freetype2/src/sfnt/ttload.c, see http://cvs.savannah.gnu.org/viewvc/freetype/freetype2/src/sfnt/ttload.c?r1=1.78&r2=1.79. This change made that such a subsetted font is rejected by FreeType as invalid as there is no bitmap data either.

It is a bit unclear what precisely the "compatibility with Windows" means (see comment line in the diff of the change made) but a reasonable fix to accept this TrueType font is probably to ignore the 0 length check for 'glyf' tables as this means that all glyphs in this font (including the .notdef one) are of length 0, i.e. no outlines.

John Tytgat <joty>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16982:  universextend-subset.ttf added by joty (7KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bramt (Posted a comment)
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by joty (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 05 Dec 2008 06:43:52 PM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.8
    Thu 04 Dec 2008 03:51:39 PM UTCjotyAttached File-=>Added universextend-subset.ttf, #16982

    Back to the top


    Powered by Savane 3.1-cleanup1