Bug 690446 - Arial-BoldMT Error: /undefined in findresource
Summary: Arial-BoldMT Error: /undefined in findresource
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.64
Hardware: PC Windows XP
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-23 07:53 UTC by serge gubenko
Modified: 2012-07-17 04:54 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
file which had an error (10.31 KB, application/pdf)
2009-04-23 07:54 UTC, serge gubenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description serge gubenko 2009-04-23 07:53:23 UTC
This issue seem to be related to bug#689956 and bug#689623. I was trying to 
view the document using the 

gswin32c -dSAFAER -dBATCH test_16.pdf

command (test file is attached). The output log was:

GPL Ghostscript 8.64 (2009-02-03)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Can't find CID font "Arial-BoldMT".
Substituting CID font /Adobe-Identity for /Arial-BoldMT, see doc/Use.htm#CIDFont
Substitution.
The substitute CID font "Adobe-Identity" is not provided either. Will exit with
error.
Error: /undefined in findresource
Operand stack:
   --nostringval--   --dict:6/15(L)--   F1   8   --dict:6/6(L)--   --dict:6/6(L)
--   Arial-BoldMT   --dict:11/12(ro)(G)--   --nostringval--   CIDFontObject   --
dict:8/8(L)--   --dict:8/8(L)--   Adobe-Identity
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1862   1   3   %oparray_pop   1861   1   3   %oparray_
pop   1845   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1
1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--
  --nostringval--   --nostringval--   %array_continue   --nostringval--   false
  1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   --nos
tringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval
--   %array_continue   --nostringval--   --nostringval--   --nostringval--   --n
ostringval--   --nostringval--   %loop_continue
Dictionary stack:
   --dict:1150/1684(ro)(G)--   --dict:1/20(G)--   --dict:74/200(L)--   --dict:74
/200(L)--   --dict:106/127(ro)(G)--   --dict:280/300(ro)(G)--   --dict:22/25(L)-
-   --dict:4/6(L)--   --dict:21/40(L)--   --dict:1/1(ro)(G)--   --dict:8/8(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 8.64: Unrecoverable error, exit code 1

First I tried to edit the cidfmap file adding following lines there:
/Arial-BoldMT  			<< /FileType /TrueType /Path 
(C:/WINDOWS/Fonts/ARIALBD.TTF)  /SubfontID 0  /CSI [(Unicode) 0] >> ;
/Arial-ItalicMT			<< /FileType /TrueType /Path 
(C:/WINDOWS/Fonts/ARIALI.TTF)  /SubfontID 0  /CSI [(Unicode) 0] >> ;
/ArialMT  				<< /FileType /TrueType /Path 
(C:/WINDOWS/Fonts/arial.ttf)  /SubfontID 0  /CSI [(Unicode) 0] >> ;
/TimesNewRomanPSMT  	<< /FileType /TrueType /Path 
(C:/WINDOWS/Fonts/timesi.ttf)  /SubfontID 0  /CSI [(Unicode) 0] >> ;

This will allow the document to be rendered correctly but symbols were not 
readable, I tried to play with encoding setting but no luck, same unreadable 
symbols displayed.

Then I to defined a small dictionary:

/tempfontsdict 1 dict def tempfontsdict 
begin 
 /Arial-BoldMT       (C:/WINDOWS/Fonts/ARIALBD.TTF)  def
 /Arial-ItalicMT     (C:/WINDOWS/Fonts/ARIALI.TTF)  def 
 /ArialMT            (C:/WINDOWS/Fonts/arial.ttf)  def 
 /TimesNewRomanPSMT  (C:/WINDOWS/Fonts/timesi.ttf)  def 
End

And changed the pdf_font.ps:

       dup /FontFile knownoget not {
		  dup /FontFile2 knownoget not {
			dup /FontFile3 knownoget not {
				%//null			  		
	    
	+			dup /FontName get 
	+			/tempFontName exch def
	+			tempfontsdict tempFontName known {
	+				dup /FontName get (Custom font change:) 
print == 
	+				tempfontsdict tempFontName get
	+				/tempFontFile exch def			
	 
	+				dup /FontFile3 << /F tempFontFile >> 
put     				 
	+				dup /FontFile3 get
	+			} {
	+				//null
	+			} ifelse				
            } if
          } if
        } if

This solved the problem but doesn’t look like a good solution for the issue.
Comment 1 serge gubenko 2009-04-23 07:54:04 UTC
Created attachment 4971 [details]
file which had an error
Comment 2 Alex Cherepanov 2012-07-17 04:54:18 UTC
The file no longer fails with PS errors.
New procedure of defining CIDFont substitution is described in
doc/Use.htm#CIDFontSubstitution