Bug 688536 - /invalidfont in --show-- when trying to convert the PDF file
Summary: /invalidfont in --show-- when trying to convert the PDF file
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: PC Windows XP
: P4 normal
Assignee: leonardo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-03 09:57 UTC by Edward
Modified: 2008-12-19 08:31 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
PDF file (zipped with winzip) (1.73 MB, application/octet-stream)
2006-02-03 09:58 UTC, Edward
Details
patch (1016 bytes, patch)
2006-02-04 22:07 UTC, Alex Cherepanov
Details | Diff
improved path (1.40 KB, patch)
2006-02-07 17:52 UTC, Alex Cherepanov
Details | Diff
cur.pdf (190.74 KB, application/pdf)
2006-02-09 08:33 UTC, leonardo
Details
hdr.pdf (190.74 KB, application/pdf)
2006-02-09 08:34 UTC, leonardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edward 2006-02-03 09:57:26 UTC
When trying to convert the attached PDF file to PDF with GS Head i get the 
following error /invalidfont in --show--.
Comment 1 Edward 2006-02-03 09:58:58 UTC
Created attachment 1990 [details]
PDF file (zipped with winzip)
Comment 2 Alex Cherepanov 2006-02-04 22:07:51 UTC
Created attachment 1995 [details]
patch

Upgrade ttf_OS_2_t structure to support v.2 (96-byte) OS/2 table.

Out test suite has no files with 96-byte tables. So the patch should not
be detectable by our regression testing.
Comment 3 leonardo 2006-02-05 06:52:38 UTC
1. The patch adds a confusable code.
Please rewrite like this :

+    stream_write(s, &os2, offset_of(ttf_OS_2_t, os2.sxHeight[0]));
+    put_pad(s, offset_of(ttf_OS_2_t, os2.sxHeight[0]));

2. Please add a comment why the new fields are not written.

Comment 4 Alex Cherepanov 2006-02-07 17:52:19 UTC
Created attachment 2012 [details]
improved  path

Improved path that uses offset_of macro and adds a comment.
Comment 5 Alex Cherepanov 2006-02-08 22:59:55 UTC
Proposed log message:

Upgrade ttf_OS_2_t structure to support v.2 (96-byte) OS/2 table.

DETAILS:
We don't use the new fields in the 96-byte structure and continue to
create 86-byre structures. The extra space is used as a buffer when
we copy the structure intact.

DIFFERENCES:
None

Out test suite has no files with 96-byte tables. So the patch is not
exercised by the regression test.

Comment 6 leonardo 2006-02-09 01:48:56 UTC
Alex, please commit Comment #4,5.
Comment 7 Alex Cherepanov 2006-02-09 05:18:00 UTC
The patch is committed to the trunk, rev. 6574.
Comment 8 leonardo 2006-02-09 08:31:16 UTC
The patch caused a regression and has been unwinded with
http://ghostscript.com/pipermail/gs-cvs/2006-February/006338.html
Comment 9 leonardo 2006-02-09 08:33:15 UTC
Created attachment 2018 [details]
cur.pdf

One file generated with 6574
Comment 10 leonardo 2006-02-09 08:34:57 UTC
Created attachment 2019 [details]
hdr.pdf

Another file generated with 6574 with different home directory paths.
OS/2 table got another length, didn't analyze why.
Comment 11 leonardo 2006-02-09 08:36:09 UTC
cur.pdf, hdr.pdf are generated from 01_001.pdf with -dLastPage=1.
Comment 12 leonardo 2006-05-03 09:32:51 UTC
Marking this bug as a dup of 688678, becase both have same reason. Also 
changing the assignment because there was no activity for a long time.
Comment 13 leonardo 2006-07-17 12:13:24 UTC
Patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2006-July/006677.html