[gs-code-review] Fix for Photo caption rendered diagonally: SF bug #616692
Ray Johnston
ray at artifex.com
Wed Oct 2 11:18:23 PDT 2002
Reviewers,
This file has an invalid Type 3 font embedded.
The PDF specification states that the wy parameter to the d1 operator
must be 0. This Type 3 font has CharProcs that have a value of 100
for wy as well as wx. The PDF creator (Acrobat Distiller 4.05 for
Windows) probably was confused by an original font that was vertical
writing mode -- just a guess since we don't have to original
PostScript file that was distilled.
It seems that Acrobat Reader ignores the wy parameter and just uses
a value of 0. A patch to do this is quite simple:
--- lib/pdf_font.ps 19 Sep 2002 18:10:00 -0000 1.45
+++ lib/pdf_font.ps 2 Oct 2002 17:58:08 -0000
@@ -1188,6 +1188,10 @@
.adjustcharwidth setcharwidth
} bdef
/d1 {
+ 4 index 0 ne {
+ % invalid wy parameter for d1 in Type3 font (must be 0)
+ 5 -1 roll pop 0 5 1 roll % set it to 0
+ } if
6 -2 roll .adjustcharwidth 6 2 roll setcachedevice
} bdef
/Tf {
We could get more aggressive with the patch and spit out an error
message using pdfformaterror, but that would also need some kind
of flag to prevent gobs of warnings (the 'd1' is executed for each
character displayed). In this case, I opted for silent operation.
Proposed log message:
Fix: Ignore non-zero wy values to the d1 CharProcs operator in
Type3 fonts. This is what Adobe Acrobat Readers do, and apparently
Adobe Distiller will write fonts with non-zero wy values even
though the spec says "wy must be zero". Fixes SourceForge bug
#616692 for Artifex customer #561.
-------------------------------------------------------------------
Regards,
Ray
___________________________________________________________________
More information about the gs-code-review
mailing list