Bug 690007

Summary: pdfwrite generates wrong glyph positions
Product: Ghostscript Reporter: leonardo <leonardo>
Component: PDF WriterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED WONTFIX    
Severity: normal CC: chris.liddell, christinedelight.top85, htl10
Priority: P3    
Version: master   
Hardware: PC   
OS: Windows NT   
Customer: Word Size: ---

Description leonardo 2008-08-10 11:38:23 UTC
I run test case of the bug 688058 with this cidfmap :

% /Ryumin-Light /WadaGo-Bold ;
/Ryumin-Light << /FileType /TrueType /Path (F:/AFPL/MLC2/PROB0003-
688058/batang.ttc) /SubfontID 0 /CSI [(Japan1) 1] >> ;

and it generates PDF with wrong glyph positions. When I uncomment the 
1st line and comment the 2nd (thyus using a real CID font), the positions are 
wrong also. Command line :

..\..\gs-hd\bin\gswin32c.exe  -IF:/AFPL/gs-hd/lib;f:\afpl\fonts -dPDFA -
sDSCEncoding=PDFDocEncoding -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -
sOutputFile=cur.pdf params.ps vert.gs8.51.ps

batang.ttc is taken from \Windows\Fonts of Windows Vista. It is attached to 
Bug 689893. WadaGo-Bold is a free Wadalab font.
Comment 1 leonardo 2008-08-10 11:42:13 UTC
s/thyus/thus
Comment 2 leonardo 2008-08-10 11:48:03 UTC
Note the patch 4267 attached to the bug to be applied before working on this 
bug, rather the problem persists without it. At this moment the patch is not 
committed due to gs/src reorganization.
Comment 3 Ken Sharp 2010-08-12 08:09:58 UTC
The test file vert.gs8.51.ps is not attached to this bug report and I can't find it anywhere. There is no attachment to clarify what is meant by 'wrong glyph positions'.

I've tried the font batang.ttc and it looks OK to me. Closing the bug due to lack of information to reproduce the problem.
Comment 4 Hin-Tak Leung 2010-08-12 14:41:18 UTC
(In reply to comment #3)
> The test file vert.gs8.51.ps is not attached to this bug report and I can't
> find it anywhere. There is no attachment to clarify what is meant by 'wrong
> glyph positions'.
> 
> I've tried the font batang.ttc and it looks OK to me. Closing the bug due to
> lack of information to reproduce the problem.


The file vert.gs8.51.ps is apparently part of
http://bugs.ghostscript.com/attachment.cgi?id=1353
which was in
http://bugs.ghostscript.com/show_bug.cgi?id=688058

reopen bug for you to check, but feel free to close if it still proves uninformative.
Comment 5 Ken Sharp 2013-12-02 02:04:17 UTC
As far as I can tell the problem here is that we are substituting a vertical font with a horizontal one, so its hardly surprising that the glyphs are vertically misplaced.

Unfortunately I don;t have a suitable vertical font to use as a substitute, but I believe that if such a font was used, the problem would not occur. In addition, the pdfwrite output is, as far as I can tell, the same as the rendered output, which is essentially whet we're aiming for with pdfwrite.
Comment 6 Hin-Tak Leung 2013-12-02 07:45:08 UTC
Two of the recent (a year old?) bugs I filed is about wrong rotated quote marks in vertical writing. There is a suitable font in there (the IPA ones).

Also, another poster to one of those reports posted a patch for freetype to use the special sfnt v* tables for truetype fonts in vertical layouts.
Comment 7 Ken Sharp 2013-12-02 09:01:14 UTC
(In reply to comment #6)
> Two of the recent (a year old?) bugs I filed is about wrong rotated quote
> marks in vertical writing. There is a suitable font in there (the IPA ones).

Hmm, I'll see if I can find one.

I've gone through all the bug reports in Bugzilla which you have raised against Ghostscript (open or closed) which results in 107 reports. Of those only one seems to deal with rotated punctuation and there is no font attached, just a PDF file with a non-embedded CID font.

Obviously I could have missed it, but I think my point at the end of this post says it all really.


> Also, another poster to one of those reports posted a patch for freetype to
> use the special sfnt v* tables for truetype fonts in vertical layouts.

Well that would require FreeType to be modified, we prefer to ship a standard one. If you can get the patch into FreeType then maybe we can use the additional metrics, but I cannot promise anything. 

Note that the file doesn't use composefont or anything, it just uses a *font* called Ryumin-Light-V which isn't a standard CMap name either, so the only way this is going to work, as far as I can tell, is if you create a substitute font, using a vertical layout font or CIDFont, and map it to Ryumin-Light-V.

I'm not inclined to keep this bug alive, as *none* of the information required to investigate it is attached to the bug report. Sifting through old closed bug reports to find bits from here and bits from there to try and assemble a coherent report is too challenging.

If there is a genuine problem I'd rather see a new bug report for it.
Comment 8 Chris Liddell (chrisl) 2013-12-02 09:16:18 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Two of the recent (a year old?) bugs I filed is about wrong rotated quote
> > marks in vertical writing. There is a suitable font in there (the IPA ones).
> 
> Hmm, I'll see if I can find one.


IIRC, I closed them because a) not embedding CIDFonts is really, *really* stupid if you expect the document to display correctly, and b) I don't think we should go down the road of shipping a CID font substitute for every CJK (and other!) ordering that we might encounter.