Bug 689893 - Regression: CID font emulation is broken.
Summary: Regression: CID font emulation is broken.
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: master
Hardware: PC Windows NT
: P1 blocker
Assignee: leonardo
Depends on:
Blocks: 688058 689304
  Show dependency treegraph
Reported: 2008-06-12 04:29 UTC by leonardo
Modified: 2011-06-01 14:40 UTC (History)
0 users

See Also:
Word Size: ---

patch.txt (10.62 KB, patch)
2008-07-26 09:53 UTC, leonardo
Details | Diff
Leo's patch in the standard diff format. (9.05 KB, patch)
2008-07-26 11:52 UTC, Alex Cherepanov
Details | Diff
cidfmap (1.45 KB, text/plain)
2008-09-25 21:34 UTC, leonardo

Note You need to log in before you can comment on or make changes to this bug.
Description leonardo 2008-06-12 04:29:29 UTC
Revision 8795 can't laod TT as a CID font.
Test file t.ps :

/Ryumin-Light /CIDFont findresource 10 saclefont setfont
100 100 moveto
1001 glyphshow

The file lib/cidfmap :

/Ryumin-Light << /FileType /TrueType /Path (F:/AFPL/MLC2/PROB0003-
688058/batang.ttc) /SubfontID 0 /CSI [(Japan1) 1] >> ;

The file batang.ttc is from Windows/Fonts of Vista 64, rather I think the 
Windows version isn't relevant.

Command line :

..\..\gs-hd\bin\gswin32c.exe -IF:\AFPL\gs-hd\lib;f:\afpl\fonts -r72 -dBATCH -
d/DEBUG -dEPSFitPage t.ps

Fails with /invalidfont in --.buildcidfont--

Revision 8198 dowesn't fail in same environment.

Please check recent changes to TT font loader.
Comment 1 leonardo 2008-06-12 04:32:26 UTC
Upgrading the priority for regression bug, and because another P2 bug depends 
on this one.
Comment 2 Alex Cherepanov 2008-06-13 14:24:38 UTC
Yes, this is a regression but it was introduced a while ago:
r8228 | mpsuzuki | 2007-09-05 03:54:54 -0400 (Wed, 05 Sep 2007) | 35 lines
Fix (TT fonts) : Suppress loading trailing data after chosen cmap subtable.

This result was obtained using a different font. Please attach your
font to the bug report.
Comment 3 leonardo 2008-06-15 11:54:54 UTC
Created attachment 4117 [details]

Attaching the font packed with WinZIP.
Comment 4 leonardo 2008-07-26 08:38:00 UTC
Setting P1 blocker because it is similar to 689976. I'm working on both.
Comment 5 leonardo 2008-07-26 09:53:53 UTC
Created attachment 4240 [details]

A suggested patch to HEAD is being tested. Sorry it is generated with fc.exe
because Cygwin doesn't work on Vista 64.
Comment 6 Alex Cherepanov 2008-07-26 11:52:52 UTC
Created attachment 4241 [details]
Leo's patch in the standard diff format.
Comment 7 Alex Cherepanov 2008-07-26 20:33:08 UTC
I agree with the proposed changes, confirm that the patch works, and
see no regressions in local testing.
Comment 8 leonardo 2008-07-27 02:42:21 UTC
Patch to HEAD :
Comment 9 leonardo 2008-09-25 21:33:53 UTC
I reopen this bug because we still fail loading OTFs from Vista. The test case 
is attachment 3073 [details] from the bug 689304 and a cidfmap file which I'll attach.
Comment 10 leonardo 2008-09-25 21:34:44 UTC
Created attachment 4427 [details]

cidfmap to reproduce the problem.
Comment 11 leonardo 2008-09-25 21:39:07 UTC
Created attachment 4428 [details]

The font from Vista.
Comment 12 leonardo 2008-09-25 21:42:14 UTC
Created attachment 4429 [details]

The 2nd font.
Comment 13 leonardo 2008-10-07 06:35:47 UTC
I missed to reopen it on 2008-09-25, so doing now.
Comment 14 leonardo 2008-10-07 06:36:31 UTC
Assigning to myself for a faster resolution because Alex is busy.
Comment 15 leonardo 2008-10-07 07:17:36 UTC
Oops, that OTF font doesn't include TT data. It includes a CFF instead. So 
it's a different bug. I opened a new bug 690110 for that case. Restoring 
the "resolved fixed" state for this bug.