summaryrefslogtreecommitdiff
path: root/gs/lib/pdf_font.ps
diff options
context:
space:
mode:
authorDan Coby <dan.coby@artifex.com>2005-06-28 06:19:27 +0000
committerDan Coby <dan.coby@artifex.com>2005-06-28 06:19:27 +0000
commit74a5f124a76ac1c307d5748a40aa0cc61dab5f17 (patch)
tree96650017fbd516f4e1b84e96d6e288c3adb043c7 /gs/lib/pdf_font.ps
parentc3b5eceb4b38a9b7b28e92d98d694d6167eaf2a1 (diff)
downloadghostpdl-74a5f124a76ac1c307d5748a40aa0cc61dab5f17.tar.gz
Fix for 687989 PDF to any format raises /invalidfont in /R21. The test
file was created by an imposition program. DETAILS: The given file (the one with the four pages imposed together) has: 1. A Page dict with form Xobjects and the /R21 font is not in the Resources/Font dict. 2. The Pg3 form XObject has the /R21 font in the Resources/Font dict. 3. /R19 is a Type3 font. There is not a Resources entry in the dict. This font uses both the /R13 ExtGState and the /R21 font. To find the /R13 and the /R21 resources, Ghostscript is first looking in the /R19 font. Since it is not present (no Resources in /R19), Ghostscript then searches the Page dict. Once again the resources are not found and then the InvalidFont error is generated. (Ghostcript is silent about the missing ExtGState /R13.) From page 391 of the PDF REference, version 1.6 on the entries in the dict for a Type3 font: "Resources dictionary (Optional but strongly recommended; PDF 1.2) A list of the named resources, such as fonts and images, required by the glyph descriptions in this font (see Section 3.7.2, "Resource Dictionaries"). If any glyph descriptions refer to named resources but this dictionary is absent, the names are looked up in the resource dictionary of the page on which the font is used. (See implementation note 64 in Appendix H.)" This implies that Ghostscript is following the correct path for finding the resources /R13 and /R21. (However one can make a case for a 'liberal' interpretation of the spec. that implies that the form XObject resources should also be checked.) This fix checks the current resources when the Resources dictionary is not present in a type 3 font. I do not know why Acrobat 6.0 Pro does not find /R13 but does find /R21. If Acrobat is not checking the Resources for the Pg3 form XObject then it should find neither. If it is checking Pg3 Resources then both should be found. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@5983 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/lib/pdf_font.ps')
-rw-r--r--gs/lib/pdf_font.ps16
1 files changed, 15 insertions, 1 deletions
diff --git a/gs/lib/pdf_font.ps b/gs/lib/pdf_font.ps
index ee6ac4cf6..d9d5894ef 100644
--- a/gs/lib/pdf_font.ps
+++ b/gs/lib/pdf_font.ps
@@ -700,7 +700,21 @@ readonly def
/buildType3 { % <Type3-font-resource> buildType3 <font>
8 dict begin
/FontType 3 def
- /Resources 1 index /Resources knownoget { oforce } { 0 dict } ifelse def
+ % If the font does not contain a Resources entry, then we use
+ % the resources from our current context. Page 391 of the PDF
+ % 1.6 spec says that the Resources dict is optional and if not
+ % present then we should use the Resources for the page.
+ % However we have a test file (687989) which uses a Type3 font
+ % inside a form XObject and the desired Resources are in the
+ % XObject dict and not in the Page dict. So we are going to
+ % the parent object to find resources instead of only going to
+ % the page dict when a font does not specify its required
+ % resources.
+ /Resources 1 index /Resources knownoget {
+ oforce
+ } {
+ LocalResources
+ } ifelse def
/FontBBox 1 index /FontBBox get cvx def
/FontMatrix 1 index /FontMatrix oget def
/CharProcs 1 index /CharProcs oget def