Bug 687724 - /invalidfont error
Summary: /invalidfont error
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Windows 2000
: P2 normal
Assignee: Igor Melichev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-04 09:37 UTC by Edward
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
PDF file (1.67 MB, application/pdf)
2004-10-04 09:38 UTC, Edward
Details
tttrace.txt (23.80 KB, text/plain)
2004-10-05 05:23 UTC, Igor Melichev
Details
patch2.txt (6.10 KB, patch)
2004-10-06 03:46 UTC, Igor Melichev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edward 2004-10-04 09:37:12 UTC
When trying to convert the attached PDF file into PDF, tiff or any other format 
with the latest GS head i get an /invalidfont error. It works fine however with 
GS 7.03.
Comment 1 Edward 2004-10-04 09:38:29 UTC
Created attachment 938 [details]
PDF file
Comment 2 Alex Cherepanov 2004-10-04 15:30:44 UTC
I confirm that this bug is present in the
current CVS version and can be reproduced as:
  gswin32c foo.pdf
Comment 3 Igor Melichev 2004-10-05 05:13:59 UTC
When instantiating a face, TT interpreter fails with TT_Err_ENDF_In_Exec_Stream 
in Ins_END called indirectly from TT_Set_Instance_CharSizes. Either the font 
has an invalid TT instructions, or it has a mangled TT table pointers, or we 
wrongly extract it from the document. 7.03 ignores TT instructions.
Comment 4 Igor Melichev 2004-10-05 05:17:27 UTC
The event explaineg in Comment #3 happens with the first execution of ashow, 
and the first call to TT_Set_Instance_CharSizes, when RunIns calls 
Instruct_Dispatch[CUR.opcode].p at 499th time. Set a breakpoint at ttinterp.c 
ln 5180 with skipping 498 times.
Comment 5 Igor Melichev 2004-10-05 05:23:18 UTC
Created attachment 944 [details]
tttrace.txt

Attaching the TT interpreter trace obtained with -ZY. Don't like the unknown
instruction INS_$91 near its end.
Comment 6 Igor Melichev 2004-10-05 05:49:47 UTC
Running GS-FAPI.FreeType2 (with the patch to zfapi.c committed few minutes 
ago), the document renders with no problem. So we can trace how FreeType2 
instantiates that face.
Comment 7 Igor Melichev 2004-10-05 11:30:53 UTC
Interpretation succeeded with copying Ins_UNKNOWN from FreeType2.
Comment 8 Igor Melichev 2004-10-05 11:37:08 UTC
Created attachment 945 [details]
patch.txt

A suggested patch. Need to resolve a possible licensing problem before
publicising it.
Comment 9 Igor Melichev 2004-10-05 12:36:06 UTC
The patch passed the regression test, but Ralph says that we didn't license 
FreeType2. So put this on hold until the license is obtained.
Comment 10 Igor Melichev 2004-10-06 03:46:58 UTC
Created attachment 947 [details]
patch2.txt

Well, the specs is in the public domain, and I don't like the code from
FreeType2. So I implemented it differently.