This worked in 8.60: 1) place WadaGo-Bold in Resource/CIDFont 2) Single line cidfmap is: /Adobe-Japan1 /WadaGo-Bold ; 3) run the test file: gswin32c 070201.pdf This is an URGENT issue and may be related to bug 689956. MANY customers rely on this feature to perform substitution for Asian Fonts.
Created attachment 4231 [details] 070201.pdf
BTW, the error message with rev 8850 is: Substituting CID font resource/Adobe-Japan1 for /éléréoû╛Æ⌐. Error: /undefinedresource in findresource Operand stack: --nostringval-- --dict:5/14(L)-- F0 10.1719 --dict:6/6(L)-- --dict:6/6(L)-- éléréoû╛Æ⌐ --dict:10/12(ro)(G)-- --nostringval-- CIDFontObject --dict:8/8(L)-- --dict:8/8(L)-- Adobe-Japan1 CIDFont true Adobe-Japan1 Adobe-Japan1 WadaGo-Bold
Bumping priority since this is an important feature for many customers
Note that this is broken in the 8.62 release and works in 8.61 as well as 8.60
It seems unlikely this is the same issue as bug 689956; that issue didn't appear until after 8.62. I'm searching know for the revision applicable to this bug.
I'm not able to get this file to work with any version of Ghostscript. All produce the same error as in Comment #2: Substituting CID font resource/Adobe-Japan1 for /?l?r?o????. Error: /undefinedresource in findresource I think this bug might be related to bug 688770
Okay, now I'm totally confused. If I place the font I'm using as a substitute for Adobe-Japan1 in a directory called CIDFont gshead (r8853), gs8.62, and every other version I tried, work: marcos@macbookpro:[93]% ~/artifex/ghostscript/head/gs/bin/gs -sDEVICE=tiff24nc -o test.tif ./070201.pdf GPL Ghostscript SVN PRE-RELEASE 8.63 (2008-03-01) Copyright (C) 2008 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 Substituting CID font resource/Adobe-Japan1 for /?l?r?o????. Error: /undefinedresource in findresource Operand stack: --nostringval-- --dict:5/14(L)-- F0 10.1719 --dict:6/6(L)-- --dict:6/6(L)-- ?l?r?o???? -- dict:10/12(ro)(G)-- --nostringval-- CIDFontObject --dict:8/8(L)-- --dict:8/8(L)-- Adobe- Japan1 CIDFont true Adobe-Japan1 Adobe-Japan1 WadaGo-Bold Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push - -nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1905 1 3 %oparray_pop 1904 1 3 %oparray_pop 1888 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-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- -- nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval-- 1856 14 9 %oparray_pop findresource %errorexec_pop --nostringval-- --nostringval-- --nostringval-- - -nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1147/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- -- dict:106/127(ro)(G)-- --dict:274/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- -- dict:25/40(L)-- --dict:20/26(ro)(G)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript SVN PRE-RELEASE 8.63: Unrecoverable error, exit code 1 marcos@macbookpro:[94]% mkdir CIDFont marcos@macbookpro:[95]% mv WadaGo-Bold CIDFont/. marcos@macbookpro:[96]% ~/artifex/ghostscript/head/gs/bin/gs -sDEVICE=tiff24nc -o test.tif ./070201.pdf GPL Ghostscript SVN PRE-RELEASE 8.63 (2008-03-01) Copyright (C) 2008 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 Substituting CID font resource/Adobe-Japan1 for /?l?r?o????. Can't find (or can't open) font file %rom%Resource/Font/TimesNewRomanPSMT. Can't find (or can't open) font file TimesNewRomanPSMT. Can't find (or can't open) font file %rom%Resource/Font/TimesNewRomanPSMT. Can't find (or can't open) font file TimesNewRomanPSMT. Querying operating system for font files... Didn't find this font on the system! Substituting font Times-Roman for TimesNewRomanPSMT. Can't find (or can't open) font file n021003l.pfb. Loading NimbusRomNo9L-Regu font from %rom%Resource/Font/NimbusRomNo9L-Regu... 2770916 1157919 11570316 10133630 3 done. Substituting CID font resource/Adobe-Japan1 for /?l?r?o????. Can't find (or can't open) font file %rom%Resource/Font/TimesNewRomanPS-BoldMT. Can't find (or can't open) font file TimesNewRomanPS-BoldMT. Can't find (or can't open) font file %rom%Resource/Font/TimesNewRomanPS-BoldMT. Can't find (or can't open) font file TimesNewRomanPS-BoldMT. Didn't find this font on the system! Substituting font Times-Bold for TimesNewRomanPS-BoldMT. Can't find (or can't open) font file n021004l.pfb. Loading NimbusRomNo9L-Medi font from %rom%Resource/Font/NimbusRomNo9L-Medi... 2770916 1184848 11650700 10189122 3 done. marcos@macbookpro:[97]% more cidfmap %! % $Id: cidfmap 6300 2005-12-28 19:56:24Z giles $ % This is a sample map file for CIDFont category. % % The map is a set of records, which must use one of the two formats : % % 1. A substutution of a CIF font with another CID font : % % /substituted /original ; % % Where 'substituted' is a name being used in a document, % 'original' is a name of an available resource. % % 2. A substutution of a CIF font with a True Type font : % % /substituted << /FileType /TrueType /Path (path) /SunfontID 1 /CSI [(ordering) supplement] >> ; % % Where 'substituted' is a name being used in a document, % 'path' is a path to a True Type font file, % 'ordering' is a value of Ordering required for CIDSystemInfo dictionary, % 'supplement' is a value of Supplement required for CIDSystemInfo dictionary. % % Examples : % % /ShinGo-Bold /HeiseiKakuGo-W5 ; % /Ryumin-Medium << /FileType /TrueType /Path (H:/AuxFiles/Fonts/BATANG.TTC) /SubfontID 3 /CSI [(Japan1) 2] >> ; % %/ShinGo-Bold /Adobe-Japan1 ; /Adobe-Japan1 /WadaGo-Bold ; marcos@macbookpro:[98]%
I think I understand the problem. When COMPILE_INITS=1 (as it is by default on linux, and is on my development version on Windows), the default GenericResourceDir is %rom%Resource/ If I use -sGenericResourceDir=./Resource/ prior to the input file, then this works. If the WadaGo-Bold is in the Resource/CIDFont when I build, I get a different error message: Substituting CID font resource/Adobe-Japan1 for /éléréoû╛Æ⌐. Error: /invalidfileaccess in findresource Operand stack: --nostringval-- --dict:5/14(L)-- F0 10.1719 --dict:6/6(L)-- --dict:6/6(L)-- éléréoû╛Æ⌐ --dict:10/12(ro)(G)-- --nostringval-- CIDFontObject --dict:8/8(L)-- --dict:8/8(L)-- Adobe-Japan1 CIDFont true Adobe-Japan1 Adobe-Japan1 WadaGo-Bold --nostringval-- 8082 2914020 DataSource --nostringval-- true I'm not running -dSAFER so I don't know what the /invalidfileaccess is coming from.
Created attachment 4235 [details] experimental patch - doesn't work
Created attachment 4236 [details] foo.ps -- test program First, %rom% file system didn't provide working file_open_stream() function. The experimental patch attempts to resolve this problem. Still, interaction between the reusable stream and %rom% files is not correct. The program attached clearly shows this. So this bug is about reusable streams and %rom% files rather than resource machinery.
Fix direct access to a subfile in the %rom% file system by reusable stream. 1. Open the source file of the reusable stream as a general stream, rather than an os-based file stream. 2. Take into account file_offset member when accessing the stream. The following patch has been committed as a rev. 8878. http://ghostscript.com/pipermail/gs-cvs/2008-July/008457.html Regression testing shows no differences.