Summary: | Issue with pswrite device: Thai characters with accent are not printed at the correct place | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Subrahmanyan K.H. <subrahmanyan-h.kalathur> |
Component: | PS Writer | Assignee: | Ken Sharp <ken.sharp> |
Status: | NOTIFIED INVALID | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | master | ||
Hardware: | All | ||
OS: | AIX | ||
Customer: | 130 | Word Size: | --- |
Attachments: |
thai_input.ps
thai_output_ps.ps thai_output_pdf.pdf screen_shot.jpg gs870_output.ps Test of accent glyphs in Distiller Result of accent test Original speciment file modified to use the Acrobat font name Distiller otuptu using modified input file Test file to draw all glyphs (0x00 -> 0xffff) from the spciment font PDF fiel produced by Adobe Acrobat from the glyph test program |
Description
Subrahmanyan K.H.
2009-11-24 20:43:29 UTC
Created attachment 5711 [details]
thai_input.ps
Input Postscript document.
Created attachment 5712 [details]
thai_output_ps.ps
pswrite output from GS, where the issue can be seen.
Created attachment 5713 [details]
thai_output_pdf.pdf
PDF output file, where all the characters are correct.
Created attachment 5714 [details]
screen_shot.jpg
Screen shot showing both correct and wrong output.
Few wrong characters are marked.
We need the font but global search on Artifex servers so far was unsuccessful. The font can be attached to the bug report and marked "private" to restrict the access to the font to Artifex employees and contractors. Bug 690118 may be related to this bug report. We have an Andale font in /home/support/688799/amwt_f1_v4.05.ttf but it may be unrelated to this problem. Created attachment 5715 [details]
amwt_f1.ttf
font used in the test file.
This is used with CID reference.
This is the reference used in the cidfmap file
/AndaleMonoWT << /FileType /TrueType /Path
(/hp/om/lib/FONTS/Unicode/amwt_f1.ttf) /SubfontID 0 /CSI [(Identity) 1] >> ;
Looks like there are business issues to be resolved before this problem can be given customer level priority. Please contact Miles Jones. Created attachment 5722 [details]
gs870_output.ps
With GS8.70 PS output, the output is even worse, the thai characters are not
coming properly at all.
The pswrite device is obsolete and won't be maintained. We suggest switching to to the ps2write device. Re-opening this. I am able to see the incorrect output on any device, such as the 'display' device. It still shows up with HEAD (r11600) Sorry, Ken. (In reply to comment #10) > Re-opening this. I am able to see the incorrect output on any device, such > as the 'display' device. It still shows up with HEAD (r11600) > > Sorry, Ken. If it's wrong on any device, then its not a pswrite/ps2write/pdfwrite problem, so its a font problem and should probably belong to Chris ;-) I will look tomorrow. wrt Comment #7 are the business issues now resolved ? I believe so, but if anyone knows differently, now's the time to say. (In reply to comment #11) > (In reply to comment #10) > > Re-opening this. I am able to see the incorrect output on any device, such > > as the 'display' device. It still shows up with HEAD (r11600) > > > > Sorry, Ken. > > If it's wrong on any device, then its not a pswrite/ps2write/pdfwrite problem, > so its a font problem and should probably belong to Chris ;-) I will look > tomorrow. The first thing that's wrong is using 'Identity' in the cidfmap file, it should be 'Unicode'. Without that the CID decoding won't work properly, which is almost certainly why comment #7 says the output is even worse with 8.70. The output for me after that change matches the 'wrong' output in the customer screenshot. However, I am unable to see how the 'correct' PDF was obtained, Acrobat won't use the TrueType font as a replacement for the CIDFont, and Ghostscript's pdfwrite device unsurprisingly produces the same output as the rendering devices. At the moment I can't say that this is a GS problem as opposed to a font problem, I would need to see the font supplied being used in some way that proves it does work. 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 Distiller. Created attachment 6743 [details]
Test of accent glyphs in Distiller
PostScript file using Acrobat encodings and font name to demonstrate the positioning of the accent glyphs
Created attachment 6744 [details]
Result of accent test
Output from Adobe Acrobat Distiller using the AndaleMonoWTG font and the PostScript test file intended to display the accent glyph positioing
Created attachment 6745 [details]
Original speciment file modified to use the Acrobat font name
Original specimen file, modified to use the font name AndaleMonoWTG instead of AndaleMonoWT so that it can be used with the supplied font and tested using Acrobat Distiller
Created attachment 6746 [details]
Distiller otuptu using modified input file
Output from Adobe Acrobat Distiller of the original specimen file modified to use the font name expected by Adobe Acrobat (AndaleMonoWTG)
Created attachment 6747 [details]
Test file to draw all glyphs (0x00 -> 0xffff) from the spciment font
A PostScript file which draws all the glyphs (range 0x00 to 0xffff) from the font AndaleMonoWTG, 256 glyphs per page, 256 pages.
Created attachment 6748 [details]
PDF fiel produced by Adobe Acrobat from the glyph test program
Output from Adobe Acrobat of the glyph test program
|