Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can i use CID fonts in GhostScript?

74 views
Skip to first unread message

kevin

unread,
Apr 22, 2008, 11:10:25 PM4/22/08
to
I'm using Ghostscript to print a pdf file containing CID fonts,but it
gives some err message as follows:
-----------------------------------------------------------------------------------------------------
**** Warning: Fonts with Subtype = /TrueType should be embedded.
But TimesNewRoman is not embedded.
Substituting font Times-Roman for TimesNewRoman.
Loading NimbusRomNo9L-Regu font from C:\Program Files\gs\fonts/
n021003l.pfb... 2
320872 950801 1653608 364502 3 done.
Substituting CID font resource/Adobe-GB1 for /SimSun.
Error: /undefinedresource in --findresource--
Operand stack:
--dict:8/8(L)-- C2_0 1 --dict:5/5(L)-- --dict:5/5(L)--
SimSun --d
ict:10/12(ro)(G)-- --nostringval-- --dict:6/6(L)-- --dict:
6/6(L)-- Adobe
-GB1 CIDFont Adobe-GB1
Execution stack:
......
......
Current allocation mode is local
Last OS error: No such file or directory
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1


I know the problem is that gs can't find some resource. But this PDF
file can be opened by Adobe Acrobat Reader, and in Acrobat Reader's
installation directory there is indeed a sub directory named
"Resource", which contains the CIDFont,Cmap directorys used by Acrobat
Reader. So my question is, how can i tell GhostScript to make use of
Acrobat Reader's resource to process such pdf files containing CID
fonts?

Great Thanks!!!!!!

Kevin

darren

unread,
Jun 12, 2008, 1:20:41 AM6/12/08
to
I am having the same problem with ghostscript not being able to cope
with a PDF that has a Chinese font in it.

The PDF is here : http://epublications.bond.edu.au/theses/tan/
Direct link : http://epublications.bond.edu.au/context/theses/article/1008/index/0/type/native/viewcontent

It gives up on page 24. when it fails to Substitute CID font resource/
Adobe-GB1 for /SimSun

Page 24
Loading TimesNewRomanPSMT font from C:\Windows/fonts/times.ttf...
4729544 206589
5 21660704 20278044 3 done.
Substituting font Times-Roman for TimesNewRomanPSMT.
Loading TimesNewRomanPS-ItalicMT font from C:\Windows/fonts/
timesi.ttf... 4729544 2066750 22455244 21068027 3 done.
Substituting font Times-Italic for TimesNewRomanPS-ItalicMT.


Substituting CID font resource/Adobe-GB1 for /SimSun.

Error: /undefinedresource in findresource
Operand stack:
--nostringval-- --dict:9/18(L)-- C2_0 1 --dict:5/5(L)-- --
dict:5/5(L)-- SimSun --dict:11/12(ro)(G)-- --nostringval-- --
dict:7/7(L)-- --dict:7/7(L)-- Adobe-GB1 CIDFont Adobe-GB1
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-- 25 1
449 --nostringval-- %for_pos_int_continue --nostringval-- --
nostringval
-- --nostringval-- --nostringval-- %array_continue --
nostringval-- false 1 %stopped_push --nostringval--
%loop_continue --nostringval-- --
nostringval-- --nostringval-- --nostringval-- --nostringval--
--nostring
val-- %array_continue --nostringval-- --nostringval-- --
nostringval--
--nostringval-- --nostringval-- %loop_continue --nostringval--
1856 13
9 %oparray_pop findresource %errorexec_pop --
nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1161/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)--
--dict:75
/200(L)-- --dict:108/127(ro)(G)-- --dict:275/300(ro)(G)-- --dict:
23/25(L)-
- --dict:4/6(L)-- --dict:26/40(L)-- --dict:20/26(ro)(G)--


Current allocation mode is local
Last OS error: No such file or directory

GPL Ghostscript 8.62: Unrecoverable error, exit code 1
Press any key to continue . . .

Did you ever get an answer, or find a work-around ?

Message has been deleted

darren

unread,
Jun 12, 2008, 3:05:41 AM6/12/08
to
Solved it - answered my own question - had been bugging me.

Downloaded the MS Japanese Office pack
http://www.microsoft.com/downloads/details.aspx?FamilyID=24a66277-cd9f-4332-a6f1-52b85a6470bd&DisplayLang=en

The Chinese fonts were already installed (simsun.ttc)

read the manual ; http://ghostscript.com/doc/current/Use.htm#CIDFonts

then added these 2 lines to C:\Program Files\gs\gs8.62\lib\cidfmap

%Substituting CID font resource /Adobe-GB1 for /SimSun.
/SimSun << /FileType /TrueType /Path (C:/WINDOWS/fonts/simsun.ttc) /
SubfontID 0 /CSI [(GB1) 2] >> ;
%
%Substituting CID font resource /Adobe-Japan1 for /MS-PGothic.
/MS-PGothic << /FileType /TrueType /Path (C:/WINDOWS/fonts/
msgothic.ttc) /SubfontID 0 /CSI [(Japan1) 2] >> ;

so now I have a *super* PDF unlocker than can unlock PDFs with Chinese
and Japanese fonts as well. :-)

BTW, the .msi installer bundled "PDF unlocker" utility is nothing more
than an older version of gs with this .cmd
http://www.google.com.au/search?q=pdf+unlocker&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a

I just installed the current version of gs and copied the .cmd over to
C:\Program Files\gs\gs8.62\bin

8.62-unlockpdf.cmd
-------------------
@echo off
echo This may take a minute, please wait.
echo.
set ttt=%1
set tt=%ttt:~0,-5%
gswin32c -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sFONTPATH=
%windir%/fonts;xfonts;. -sPDFPassword= -dPDFSETTINGS=/prepress -
dPassThroughJPEGImages=true -sOutputFile=%tt%_noPW.pdf" %1

pause
echo pause added so you can see any error messages...

------------------------

0 new messages