Re: Fix for Bug 686961 - Can't open a PDF file in GS 8_10 (but it works in GS 8_00).

"Igor V. Melichev" <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
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.

----- Original Message ----- 
From: "Jeong Kim" <[email protected]>
To: "'Igor V. Melichev'" <[email protected]>; "'gs-code-review'"
<[email protected]>
Sent: Wednesday, August 27, 2003 4:44 AM
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).


> Igor,
>
> It seems that no glyph name is used when name is not
> available in 'post'.
>
> New Log:
> When Glyph names data is not available for a TrueType Format 2.0 font,
> rangecheck error occured. It was due to the termination condition
> check code in the bottom of the data retrieving loop. The check code
> was moved to the top of the loop and now when the data is not available
> the code does not enter to the loop. Bug#686961.
>
> Jeong
>
> > -----Original Message-----
> > From: Igor V. Melichev [mailto:[email protected]]
> > Sent: Tuesday, August 26, 2003 4:36 PM
> > 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,
> >
> > IMO the log message is still unclear.
> > It should explain what glyph name is used for a glyph when a
> > name is not available in 'post'.
> >
> > Igor.
> >
> >
> > ----- Original Message ----- 
> > From: "Jeong Kim" <[email protected]>
> > To: "'Igor V. Melichev'" <[email protected]>;
> > "'gs-code-review'" <[email protected]>
> > Sent: Tuesday, August 26, 2003 5:45 AM
> > 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).
> >
> >
> > > Igor and Reviewers,
> > >
> > > I modified the log message as follows,
> > >
> > > Log:
> > > When Glyph names data is not available for a TrueType
> > Format 2.0 font,
> > > rangecheck error occured. It was due to the termination condition
> > > check code in the bottom of the data retrieving loop. The
> > check code
> > > was moved to the top of the loop and now fixed. Bug#686961.
> > >
> > > Jeong
> > >
> > > > -----Original Message-----
> > > > From: [email protected]
> > > > [mailto:[email protected]] On Behalf
> > Of Igor V.
> > > > Melichev
> > > > Sent: Tuesday, August 26, 2003 3:28 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).
> > > >
> > > >
> > > > Fine with me, except the log message should better
> > explain the new
> > > > behavior. The words "Now fixed" may have too many interpretations.
> > > >
> > > > Igor.
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Jeong Kim" <[email protected]>
> > > > To: "'gs-code-review'" <[email protected]>
> > > > Sent: Sunday, August 24, 2003 4:15 AM
> > > > Subject: [gs-code-review] Fix for Bug 686961 - Can't open a
> > > > PDF file in GS 8_10 (but it works in GS 8_00).
> > > >
> > > >
> > > > > Reviewers,
> > > > >
> > > > > When an MS TrueType Format 2.0 font does not have Glyph names
> > > > > data, the rangecheck error occurs.
> > > > >
> > > > > Following code segment (line 461-467 in gs_ttf.ps) is
> > for building
> > > > > Glyph
> > > > >
> > > > > names array for MS TrueType Format 2.0,
> > > > >
> > > > >       [ numglyphs 1 sub {
> > > > > postglyphs postpos get <-----
> > > > >         postglyphs postpos 1 add 2 index getinterval cvn exch
> > > > > postpos add 1 add /postpos exch def postpos postglyphs
> > length ge {
> > > > > exit } if
> > > > >       } repeat
> > > > >       ] /postnames exch def
> > > > >
> > > > > /postpos is the pointer value for the position where Glyph
> > > > names data
> > > > > starts. When Glyph names data is not included in a
> > font, /postpos
> > > > > value is equal to the length of the whole 'post' table data
> > > > > (/postglyphs) and 'get'
> > > > > operator in the second line of the code segment above makes
> > > > > invalid access to the data.
> > > > >
> > > > > To avoid this situation mentioned, I moved the termination
> > > > condition
> > > > > checking code in the last of the loop to the first.
> > > > >
> > > > >       [ numglyphs 1 sub {
> > > > > postpos postglyphs length ge { exit } if <----- 
> > postglyphs postpos
> > > > > get
> > > > >         postglyphs postpos 1 add 2 index getinterval cvn exch
> > > > > postpos add 1 add /postpos exch def
> > > > >       } repeat
> > > > >       ] /postnames exch def
> > > > >
> > > > > Now the condition checking code makes the process exit the
> > > > loop when
> > > > > Glyph names data is not available and no error occurs.
> > > > >
> > > > > Jeong
> > > > >
> > > > > Log:
> > > > > When Glyph names data is not available for a TrueType
> > > > Format 2.0 font,
> > > > > rangecheck error occured. Now fixed. Bug#686961.
> > > > >
> > > > > _______________________________________________
> > > > > gs-code-review mailing list [email protected]
> > > > > http://www.ghostscript.com/mailman/listinfo/gs-code-review
> > > > >
> > > >
> > > > _______________________________________________
> > > > gs-code-review mailing list
> > > > [email protected]
> > > > http://www.ghostscript.com/mailman/listinfo/gs-code-review
> > > >
> > >
> > > _______________________________________________
> > > gs-code-review mailing list
> > > [email protected]
> > > http://www.ghostscript.com/mailman/listinfo/gs-code-review
> > >
> >
> >
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.