[gs-bugs] [Bug 690960] Issue with pswrite device: Thai characters with accent are not printed at the correct place

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Wed Sep 22 12:47:29 UTC 2010


Ken Sharp <ken.sharp at artifex.com> changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #13 from Ken Sharp <ken.sharp at artifex.com> 2010-09-22 12:47:24 UTC ---
I do not see any evidence of a bug in Ghostscript here. The Thai glyph accents
are shown as glyphs in their own right, the accented glyphs are not composite
glyphs, nor are they unique glyphs.

In essence they follow this pattern:

Draw a glyph

Store the current point
Draw an accent glyph
Restore the saved current point
Draw the base glyph

Draw a glyph

And so on. This works if the accented glyphs are drawn above the baseline, but
to the right of the origin, and have a positive horizontal advance.

The accent glyphs in the supplied font are drawn above the baseline, and with a
positive horizontal advance, but are drawn to the left of the origin. These
glyphs are mean to be used to draw accented glyphs by following this sequence:

Draw a glyph

Draw a base glyph
Draw an accent glyph

Draw a glyph

Because the accents are drawn to the left of the origin they effectively are
drawn over the *preceding* glyph, and the horizontal advance moves the current
point to the correct position for the next glyph.

We have not been supplied with the PDF file which shows how the output should
look (just a screenshot of it), nor instructions on how to produce this file
ourselves from the supplied font and test file, so its impossible to say if the
same PostScript file and font was used to construct that PDF file. However....

With some effort I have been able to make Acrobat Distiller use the supplied
font. The font is not in fact called AndaleMonoWT, it is called AndaleMonoWTG
(possibly this suggests that it is not the required font).

If I install the font so that Acrobat Distiller can use it, and then run the
supplied thai_input.ps test file, it of course fails, because the font has the
wrong name. Altering all occurrences of the font name in thai_input.ps so that
the name is correct, and running the file does produce valid output, however
the glyphs displayed are not Thai glyphs (I'm not certain what they are).

So obviously the font encoding in Distiller is different to that present in the
PostScript file.

So I abandoned the supplied test file and wrote a PostScript program to render
every glyph from 0x0000 to 0xffff. On page 11 of the resulting file can be
found the Thai glyphs and they show quite clearly (rows 6 and 7) that the
accent glyphs are positioned to the left of the origin.

By using the encoding now available to me I was able to reproduce the first
couple of glyphs and the first accent using Acrobat Distiller. This again shows
quite clearly that the accent is positioned over the preceding glyph.

So, as far as I can tell Ghostscript is working perfectly correctly. I do not
believe it is possible to use the supplied font and PostScript file to produce
the output which is indicated as the desirable result. I don't know how the PDF
file which is apparently showing the correct result was obtained, but I don't
see how it could have been created using the supplied font and test file, nor
do I think it could have been created using Adobe Acrobat from those sources.

I will attach here the PostScript program which draws the glyphs (glyph
test.ps), the PDF file produced by running that through Adobe Acrobat
Distiller, a test program using the Acrobat font encodings (Acrobat accent
test.ps) and the resutl of running that through Acrobat Distiller (Acrobat
accent test.pdf) and finally the modified that-input.ps which uses the correct
font name for Acrobat and the result of running this file through Acrobat

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list