Summary: | (PDF interpreter) : CID Font in PDF | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Igor Melichev <igor.melichev> |
Component: | PDF Interpreter | Assignee: | Masaki Ushizaka <masaki.ushizaka> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | news |
Priority: | P2 | ||
Version: | 0.00 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Customer: | Word Size: | --- | |
Bug Depends on: | |||
Bug Blocks: | 690834 | ||
Attachments: |
testCIDfonts.pdf
t7.pdf b687832_b1.patch |
Description
Igor Melichev
2004-12-06 06:20:24 UTC
Created attachment 1076 [details]
testCIDfonts.pdf
Attaching the sample file. It is created by InDesign. I confirm a problem with
GS PDF interpreter : the font size in rendering is incorrect.
Oops, I was not enough correct. Actually the font size is good, but with GS the character spacing is 2 times smaller than expected. *** Bug 687815 has been marked as a duplicate of this bug. *** The subfont of the CIDFontType0 has an unusial FontMatrix [0.488280982 0 0 0.488280982 0 0]. Likely it is not accounted when accounting the CDevProc output. Patch to HEAD : http://ghostscript.com/pipermail/gs-cvs/2005-January/005143.html Patch to GS_8_1X : http://ghostscript.com/pipermail/gs-cvs/2005-January/005144.html Bug 690834 going to revert rev. 5613 which was a fix for this bug. I am going to reopen and assign myself. Created attachment 5736 [details] t7.pdf A simplified test file. Two strings are drawn as following: 71 0 0 71 344.22311 304.12367 Tm [<0021>-54<0022>-54<0018>-54<001D>-54<0016>]TJ 71 0 0 71 344.22311 204.12367 Tm <002100220018001D0016> Tj Simple 'Tj' drawing already has a problem. I suspect CIDFont's 'W' values are interpreted in glyph space, not in 1000th of text space. I confirmed this is caused by rev. 2685 code, which interprets widths in W/W2 in glyph space units. Need to change it to 1000th of text space. Created attachment 5859 [details] b687832_b1.patch A patch to calculate W/W2 values in 1000th of text space. I have chosen a way that minimize differences. I have a plan to review all composite functions in ghostscript in near future, I will probably need to revisit this code again that time. Localcluster test reported differences in following files. I haven't reviewed them in detail yet, but I believe those are caused by floating point calculation errors and have only a dot differences. Metrics values are now always go through FontMatrix, so there may be a little more errors than without this patch. tests_private/comparefiles/Bug687832.pdf tests_private/comparefiles/Bug689753.pdf tests_private/comparefiles/Bug690113.pdf tests_private/comparefiles/Bug690372.pdf tests_private/comparefiles/CIDembedded.pdf tests_private/comparefiles/HeiseiMinStd.pdf tests_private/comparefiles/KozukaB-ILEmbed.pdf tests_private/comparefiles/Openhuis_pdf_zw.pdf tests_private/comparefiles/RodinCIDEmbed.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX0325.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX1101.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX1803.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX2049.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX5233.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX6508.pdf tests_private/pdf/PDFIA1.7_SUBSET/IA3Z0222.pdf tests_private/pdf/PDFIA1.7_SUBSET/IA3Z1869.pdf tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf tests_private/pdf/PDFIA1.7_SUBSET/IA3Z4373.pdf Interesting. So the metrics (W, W2, DW, DW2) are in glyph space, which depends on the FontMatrix, not in text space ? And our existing CDevProc assumes that the FontMatrix is always 1000x1000 ? Looks good to me, though I haven't checked the specific files you mention either. Need an opinion from Alex as well. I forgot to mention that the patch in comment #9 (b687832_b1.patch) need to be used together with a patch (b690834_p3.patch) in bug #690834. I have checked all 82 pages produced by files in comment #9, and confirmed differences are all one dot width. Looks good to me Masaki, you should probably commit both patches and close the bugs as fixed. I'd like an opinion from Alex Cherepanov as well, since the PDF interpreter is his ownership. The patch b687832_b1.patch is committed in rev. 10603. Closing. r10603 was incomplete. Please use r10722 (PostScript code fix) and r10973 (Makefile change) together. |