RE: Fix for Bug 686961 - Can't open a PDF file in GS 8_10 (but it works in GS 8_00).
"Jeong Kim" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <000a01c36ece$6e1eb390$020ba8c0@daedun> |
Igor,
I changed the pathch and log message as your advice.
Jeong
Log:
When Glyph names data is not available for a TrueType Format 2.0 font,
rangecheck error occured. It was due to an attempt to get the data even
when
it is not available. Now when no name data is available, /postnames is
defined
as an empty array and the glyph won't get a name attached. Fixes
Bug#686961.
Index: lib/gs_ttf.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/gs_ttf.ps,v
retrieving revision 1.32
diff -r1.32 gs_ttf.ps
461a462,464
> postpos postglyphs length ge { exit } if
> % No name available, /postnames will be defined as an empty
> % array and the glyph won't get a name attached.
465d467
< postpos postglyphs length ge { exit } if
> -----Original Message-----
> From: Igor V. Melichev [mailto:[email protected]]
> Sent: Thursday, August 28, 2003 12:35 AM
> To: Jeong Kim; 'gs-code-review'
> Subject: Re: [gs-code-review] Fix for Bug 686961 - Can't open
> a PDF file in GS 8_10 (but it works in GS 8_00).
>
>
> Jeong,
>
> Please add comment to code near 'exit' :
>
> % No name available, the glyph won't get a name attached.
>
> (I guess I understand this correctly. Change the comment
> appropriately if I don't). Also I'd like a sentence like this
> to be added to the log message.
>
> In general, I'm unclear what happens in there.
> In PS Type 42 fonts require glyph names.
> So if a name is not attached, the glyph isn't accessible.
>
> In PDF the situation is different. A TT font don't require
> glyph names, because glyphs may be accessed by glyph indices.
> This happens if there is no Encoding specified in the PDF
> font dictionary. But if an Encoding presents, glyph names are
> still required.
>
> Since we emulate PDF interpreter with PS interpreter, glyph
> names are necessary for PS interpreter to emulate a TT font
> embedded in PDF even when the latter has no Encoding. In this
> case glyph names may be chosen arbitrary.
>
> With CID fonts glyph names are not used.
>
> I'm not sure that you understand all consequences of your
> patch. Please check for sure. I would appreciate if you
> explain the whole behavior of the new code in the log message
> or in additional comments.
>
> Igor.
>