Bug 690611 - TrueType fonts with malformed name tables aren't handled properly
Summary: TrueType fonts with malformed name tables aren't handled properly
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Text (show other bugs)
Version: master
Hardware: Macintosh MacOS X
: P4 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 14:23 UTC by Marcos H. Woehrmann
Modified: 2011-09-18 21:46 UTC (History)
0 users

See Also:
Customer: 0
Word Size: ---


Attachments
patch (500 bytes, patch)
2009-07-08 22:33 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2009-07-08 14:23:03 UTC
I haven't had time to test this, but the customer reports:

I've run into a number of TrueType fonts that have slightly malformed 'name'
tables (as is typical for Microsoft file formats, the TT format is unclear
in a lot of areas about what is actually required) that Ghostscript doesn't
handle properly.  Specifically, these fonts have a 'name' table with
platform ID 0 strings that are all empty, but with correct strings for other
platform IDs.  Because of this, Ghostscript uses an empty string for the
font name when loading these fonts, which is wrong: I think Ghostscript
should clearly look for a non-empty string.

I think the right place to fix this is in the findname procedure in
Resource/Init/gs_ttf.ps, since findname is used for locating the font name
by both .findttfontname and .ttkeys.  If I weren't running around getting
ready to leave town for a month on Sunday, I'd send a fix, but I just don't
have time right now, so please pass this along to the appropriate engineer.
I've attached an example font with this problem.
Comment 1 Marcos H. Woehrmann 2009-07-08 14:24:12 UTC
Created attachment 5197 [details]
NOVEE___.TTF
Comment 2 Alex Cherepanov 2009-07-08 22:33:23 UTC
Created attachment 5198 [details]
patch

Don't take empty string for an answer when searching 'name' table in TrueType
font because some MS fonts have empty strings for platform IDs MS doesn't
use.
Comment 3 Alex Cherepanov 2009-07-09 06:11:03 UTC
The patch is committed as a rev. 9853.
Regression testing shows no differences.
Comment 4 Marcos H. Woehrmann 2011-09-18 21:46:50 UTC
Changing customer bugs that have been resolved more than a year ago to closed.