Bug 689893

Summary: Regression: CID font emulation is broken.
Product: Ghostscript Reporter: leonardo <leonardo>
Component: PS InterpreterAssignee: leonardo <leonardo>
Status: NOTIFIED FIXED    
Severity: blocker    
Priority: P1    
Version: master   
Hardware: PC   
OS: Windows NT   
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 688058, 689304    
Attachments: patch.txt
Leo's patch in the standard diff format.
cidfmap

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]
batang.ttc.zip

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]
patch.txt

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 :
http://ghostscript.com/pipermail/gs-cvs/2008-July/008460.html
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

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

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

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.