%! /me (ttcf2cid.ps by suzuki toshiya, Masatake YAMATO and gs-cjk project) def % % Usage: % % $ gs [-q] -dNODISPLAY [-dBATCH] [-dECHOONLY] [-dUNINSTALL] \ % [-soutputdir=[dir|-|=]] \ % -sttfont=filename.ttf |\ % -dttname='{/fontname (filename.ttf)}' |\ % -spsfont=fontname \ % [-sOUTPUTDIR=[dir|-|=]] \ % -sTTFONT=filename.ttc |\ % -dTTFONT='{(filename.ttf) /Adobe-GB1-Unicode}' |\ % -dTTFONT='{(filename.ttc) 2 /Adobe-CNS1}' |\ % -dTTNAME='{/cidfontname (filename.ttf) /Adobe-Korea1}' |\ % -dTTNAME='{/cidfontname (filename.ttc) 2 /Adobe-Japan1}' |\ % -sPSFONT=cidfontname \ % [-dRAWMODE] ttcf2cid.ps % % References: % % [1] Adobe Systems Incorporated, ``PostScript Language Reference, % third edition,'' pp. 321-390, Feb 1999. % [2] Adobe Systems Incorporated, ``The Type 42 Font Format % Specification, Technical Note #5012,'' Jul 1998. % [3] Adobe Systems Incorporated, ``Adobe CMap and CIDFont Files % Specification, Technical Note #5014,'' Oct 1996. % [4] Adobe Systems Incorporated, ``The Compact Font Format % Specification, Technical Note #5176,'' Mar 2000. % [5] Adobe Systems Incorporated, ``Adobe Type1 Font Format,'' % Feb 1993. % /unknowndef { exch dup where { pop pop pop } { exch def } ifelse } bind def /QUIET false unknowndef % echo outputpath at no QUIET mode /BATCH false unknowndef % reenter FontName|CIDFontName at no BATCH mode /ECHOONLY false unknowndef % confirm FontName|CIDFontName only /UNINSTALL false unknowndef % delete fonts|cidfonts, UNINSTALL mode /outputdir () unknowndef % for Font, default current directory /ttfont null unknowndef % truetype font filename /ttname null unknowndef % name and truetype font filename /psfont null unknowndef % visible-to-gs fontname /OUTPUTDIR () unknowndef % for CIDFont, default current directory /TTFONT null unknowndef % CJK truetype font filename /TTNAME null unknowndef % name and CJK truetype font filename /PSFONT null unknowndef % visible-to-gs CID-keyed fontname /RAWMODE false unknowndef % uses RD procedure in Font|CIDFont file /isprint { % integer isprint boolean false [ (\t) (\n) (\r) ] { % d bool chr 0 get 2 index eq { pop true exit } if % d bool chr=int {pop true} if } forall dup not { 1 index 16#20 ge 2 index 16#7F lt and or } if exch pop } bind def /areprint { % string areprint boolean false exch { isprint { true or } { false and exit } ifelse } forall } bind def /concat2strings { % str1 str2 concat2strings str 2 { dup type /stringtype ne { dup length string cvs } if exch } repeat exch dup length 3 2 roll dup length 2 index add string 0 5 1 roll 2 { dup 4 2 roll putinterval } repeat } bind def /concats { % [str ...] concats string () exch dup length 1 sub -1 0 { 1 index exch get 3 -1 roll concat2strings exch } for pop } bind def % convert to filesystem-safe string /safestring { % string safestring string [ 0 255 ] 0 2 index { % string array 0 string {} forall false 3 index { % string array 0 c boolean array {} forall 2 index eq or % string array 0 c (boolean x=c or)boolean } forall exch pop not { 1 add } if } forall % string array n string 0 4 -1 roll { % array buffer 0 string {} forall 3 copy put % array buffer 0 c (buffer 0 c put) false 4 index { % array buffer 0 c boolean array {} forall 2 index eq or % array buffer 0 c (boolean x=c or)boolean } forall exch pop not { 1 add } if 1 index length 1 index eq { exit } if } forall % array buffer i 3 -1 roll pop pop % buffer (i array pop pop) } bind def /xtypes << /numbertype { type dup /integertype eq exch /realtype eq or } bind /proctype { dup type /arraytype eq exch xcheck and } bind /binstringtype { dup type /stringtype eq { dup length 256 gt { % for such string as /FontInfo/Notice areprint not } { pop false } ifelse } { pop false } ifelse } bind /arrayofnamestype { dup type /arraytype eq 1 index xcheck not and { true exch { type /nametype eq and { true } { false exit } ifelse } forall } { pop false } ifelse } bind /arrayofstringstype { dup type /arraytype eq 1 index xcheck not and { true exch { type dup /stringtype eq exch /nulltype eq or and { true } { false exit } ifelse } forall } { pop false } ifelse } bind >> def /xtype { % any xtype name null exch xtypes { % null any xtypes {} forall 2 index exch exec { 3 -1 roll pop exch exit } { pop } ifelse } forall exch % any null|name dup null eq { pop type } { exch pop } ifelse } bind def % any name|array of names xtypematch name true % any name|array of names xtypematch false /xtypematch { dup type /arraytype ne { dup 3 -1 roll xtype eq { true } { pop false } ifelse } { null 3 1 roll { % null any array {} forall 1 index exch xtypematch { % null any (any name xtypematch)name true|false 3 1 roll exch pop exit % name any } if % null any } forall pop dup null ne { true } { pop false } ifelse } ifelse } bind def % used at interactive mode, without -dBATCH /*enterstring { % defaultstring *enterstring userspecifiedstring (%stdin) (r) file 128 string readline { dup length 0 eq { pop } { exch pop } ifelse } { pop } ifelse } bind def % output file, default /*echofp (%stdout) (w) file def % error output /*eechofp (%stderr) (w) file def % other output /*oechofp (%stdout) (w) file def /*open { % filepath|(%stdout) *open - (w) file /*echofp exch def } bind def /*close { % - *close - *echofp (%stdout) (w) file ne { *echofp closefile } if } bind def % - *eflush - /*eflush { *eechofp flushfile } bind def % - *oflush - /*oflush { *oechofp flushfile } bind def /*outputfile null def /*outputpath { % filename *outputpath fullpath|(%stdout) /*outputfile null def outputdir (=) eq { /outputdir pssystemparams /FontResourceDir get def } if outputdir (-) ne { outputdir (*) ne { % for debug only on UNIX outputdir () ne { [ outputdir pssystemparams /GenericResourcePathSep get 4 -1 roll ] concats } if dup /*outputfile exch def UNINSTALL QUIET or not { (+) *oecho *outputfile *oecho (\n) *oecho *oflush } if } { pop (/dev/null) } ifelse } { pop (%stdout) } ifelse } bind def /*deletefile { % - *deletefile - *outputfile null ne { *outputfile status { 4 { pop } repeat QUIET not { (-) *oecho *outputfile *oecho (\n) *oecho *oflush } if *outputfile deletefile } if } if } bind def /*OUTPUTFILE null def /*OUTPUTPATH { % filename *OUTPUTPATH fullpath|(%stdout) /*OUTPUTFILE null def OUTPUTDIR (=) eq { /OUTPUTDIR [ pssystemparams /GenericResourceDir get pssystemparams /GenericResourcePathSep get (CIDFont) ] concats def } if OUTPUTDIR (-) ne { OUTPUTDIR (*) ne { % for debug only on UNIX OUTPUTDIR () ne { [ OUTPUTDIR pssystemparams /GenericResourcePathSep get 4 -1 roll ] concats } if dup /*OUTPUTFILE exch def UNINSTALL QUIET or not { (+) *oecho *OUTPUTFILE *oecho (\n) *oecho *oflush } if } { pop (/dev/null) } ifelse } { pop (%stdout) } ifelse } bind def /*DELETEFILE { % - *DELETEFILE - *OUTPUTFILE null ne { *OUTPUTFILE status { 4 { pop } repeat QUIET not { (-) *oecho *OUTPUTFILE *oecho (\n) *oecho *oflush } if *OUTPUTFILE deletefile } if } if } bind def % file string|name *fecho - /*fecho { dup type /stringtype ne { dup length string cvs } if writestring } bind def % string|name *echo - /*echo { *echofp exch *fecho } bind def % string|name *eecho - /*eecho { *eechofp exch *fecho } bind def % string|name *oecho - /*oecho { *oechofp exch *fecho } bind def % file string|name *fechooct - /*fechooct { dup type /stringtype ne { dup length string cvs } if 3 string exch { % file ooo str 2 index (\\) *fecho 8 2 index cvrs % file ooo 8 ooo cvrs dup length 3 exch sub % file ooo 'ooo' 3-len { 2 index (0) *fecho } repeat 2 index exch *fecho % file ooo } forall pop pop } bind def % file string|name *fechostring - /*fechostring { dup type /stringtype ne { dup length string cvs } if 1 index (\() *fecho dup length 1 sub 0 1 3 -1 roll { 1 index exch 1 getinterval % file str (str i 1 getinterval)s false [ (\\) (\() (\)) ] { % file str s false 2 index eq or % file str s (false (S s eq)boolean or)boolean } forall { % file str s boolean 2 index (\\) *fecho 2 index exch *fecho } { dup areprint { 2 index exch *fecho } { 2 index exch *fechooct } ifelse } ifelse } for pop (\) ) *fecho } bind def % string|name *echostring - /*echostring { *echofp exch *fechostring } bind def % string|name *oechostring - /*oechostring { *oechofp exch *fechostring } bind def % string|name *eechostring - /*eechostring { *eechofp exch *fechostring } bind def % file string *fechohex - /*fechohex { writehexstring } bind def /*fechohexstring { % file string *fechohexstring - 1 index (<) *fecho dup length 32 lt { 1 index exch *fechohex } { 1 index (\n) *fecho dup length 1 sub 0 32 3 -1 roll { % str 32 0 l-1 {} for % str (str i (i+32 l min)i+n-i i n getinterval)substr dup 32 add 2 index length 2 copy gt { exch } if pop 1 index sub 2 index 3 1 roll getinterval 2 index exch *fechohex 1 index (\n) *fecho } for pop } ifelse (> ) *fecho } bind def /*fechorawstring { % file string *fechorawstring - dup length 2 index exch *fechoobj 1 index (RD ) *fecho 1 index exch *fecho (\n) *fecho } bind def /*fechobinstring { % file string|name *fechobinstring - RAWMODE not { *fechohexstring } { *fechorawstring } ifelse } bind def /*level 0 def /*fechoprocs << /dicttype { *fp 1 index length *fechoobj dup wcheck { *fp (dict begin\n) *fecho { exch *fp exch *fechoobj *fp exch *fechoobj *fp (def\n) *fecho } forall *fp (currentdict end ) *fecho } { *fp (dict begin\n) *fecho { exch *fp exch *fechoobj *fp exch *fechoobj *fp (def\n) *fecho } forall *fp (currentdict end readonly ) *fecho } ifelse } bind /arraytype { *fp ([ ) *fecho { *fp exch *fechoobj } forall *fp (] ) *fecho } bind /arrayofnamestype { *fp ([ ) *fecho dup length 1 sub 0 1 3 -1 roll { dup 8 mod 0 eq { *fp (\n) *fecho } if 1 index exch get *fp exch *fechoobj } for pop *fp (] ) *fecho } bind /arrayofstringstype { *fp ([ ) *fecho { *fp exch dup type /stringtype eq { *fechobinstring } { *fechoobj } ifelse } forall *fp (] ) *fecho } bind /proctype { *fp ({ ) *fecho { *fp exch *fechoobj } forall *fp (}\n) *fecho } bind /stringtype { *fp exch *fechostring } bind /binstringtype { *fp exch *fechobinstring } bind /operatortype { 64 string cvs cvn cvx *fp exch *fechoobj } bind %/packedarraytype { pop *fp null *fechoobj } bind % ! %/marktype { pop *fp null *fechoobj } bind % ! %/savetype { pop *fp null *fechoobj } bind % ! %/filetype { pop *fp null *fechoobj } bind % ! %/fonttype { pop *fp null *fechoobj } bind % ! /nametype { *level 2 mul { *fp ( ) *fecho } repeat dup xcheck not { *fp (/) *fecho } if dup length string cvs *fp exch *fecho *fp ( ) *fecho } bind /numbertype { 16 string cvs *fp exch *fecho *fp ( ) *fecho } bind /integertype { 16 string cvs *fp exch *fecho *fp ( ) *fecho } bind /booleantype { 16 string cvs *fp exch *fecho *fp ( ) *fecho } bind /nulltype { pop *fp (null ) *fecho } bind >> def /*fechoobj { % file obj *fechoobj - 1 dict begin /*fp 3 -1 roll def dup xtype *fechoprocs exch 2 copy known { get exec } { pop pop pop *fp null *fechoobj } ifelse end } bind def % obj *echoobj - /*echoobj { *echofp exch *fechoobj } bind def % obj *oechoobj - /*oechoobj { *oechofp exch *fechoobj } bind def % obj *eechoobj - /*eechoobj { *eechofp exch *fechoobj } bind def % mark /key1 value1 /key2 value2 ... keyarray % mark /key1 value1 /key2 value2 ... /keys [ /key1 /key2 ... ] /keyarray { counttomark 2 idiv array % mark ... a dup length 1 sub -1 0 { % mark ... a size-1 -1 0 {} for dup 2 index length exch sub 1 sub 2 mul 3 add index % mark ... a i key(2*(size-i-1)+3 index) 2 index 3 1 roll put % mark ... a (a i key(2*i+3 index) put) } for /keys exch } bind def /beginformat { << } bind def /endformat { keyarray >> dup 3 1 roll def } bind def /inheritformat { load dup /keys get { 2 copy get 3 -1 roll } forall pop } bind def % % Font spec. % /FontInfoFormat beginformat % key type req. nestformat /FamilyName [ /stringtype false null ] /FullName [ /stringtype false null ] /Notice [ /stringtype false null ] /Weight [ /stringtype false null ] /version [ /stringtype false null ] /ItalicAngle [ /numbertype false null ] /isFixedPitch [ /boolean false null ] /UnderlinePosition [ /numbertype false null ] /UnderlineThickness [ /numbertype false null ] endformat pop /FontFormat beginformat % key type req. nestformat /FontType [ /integertype true null ] /FontMatrix [ /arraytype true null ] /FontName [ /stringtype false null ] /FontInfo [ /dicttype false /FontInfoFormat ] /LanguageLevel [ /integertype false null ] /WMode [ /integertype false null ] endformat pop /FontType!0Format beginformat /FontFormat inheritformat % key type req. nestformat /Encoding [ /arrayofnamestype true null ] /FontBBox [ /arraytype true null ] /UniqueID [ /integertype false null ] /XUID [ /arraytype false null ] endformat pop % Type42 Font /FontType42Format beginformat /FontType!0Format inheritformat % key type req. nestformat /PaintType [ /integertype true null ] /StrokeWidth [ /numbertype false null ] /Metrics [ /dicttype false null ] /Metrics2 [ /dicttype false null ] /CDevProc [ /proctype false null ] /CharStrings [ /dicttype true null ] /sfnts [ /arrayofstringstype true null ] /CIDMap [ [ /arrayofstringstype /binstringtype /integertype /dicttype ] true null ] /GDBytes [ /integertype false null ] % ! /GlyphDirectory [ [ /arrayofstringstype /dicttype ] false null ] /MetricCount [ /integertype false null ] endformat pop % Type2 Font /FontType2Format beginformat /FontType!0Format inheritformat % key type req. nestformat /PaintType [ /integertype true null ] /StrokeWidth [ /numbertype false null ] /CharStrings [ /dicttype true null ] endformat pop % % CIDFont spec. % /CIDSystemInfoFormat beginformat % key type req. nestformat /Registry [ /stringtype true null ] /Ordering [ /stringtype true null ] /Supplement [ /integertype true null ] endformat pop /CIDFontFormat beginformat % key type req. nestformat /CIDFontType [ /integertype true null ] /CIDFontName [ /stringtype true null ] % ! /CIDSystemInfo [ /dicttype true /CIDSystemInfoFormat ] % %/Encoding [ /arrayofnamestype true null ] /FontBBox [ /arraytype true null ] /FontType [ /integertype true null ] /FontMatrix [ /arraytype true null ] /FontName [ /stringtype false null ] % /FontInfo [ /dicttype false /FontInfoFormat ] %/LanguageLevel [ /integertype false null ] /WMode [ /integertype false null ] /UIDBase [ /integertype false null ] /UniqueID [ /integertype false null ] /XUID [ /arraytype false null ] endformat pop % CIDFontType2 - Type11: Type42-like CIDFont /CIDFontType2Format beginformat /CIDFontFormat inheritformat % key type req. nestformat /CIDCount [ /integertype true null ] /GDBytes [ /integertype true null ] % ! /CIDMap [ [ /arrayofstringstype /binstringtype /integertype /dicttype ] true null ] /sfnts [ /arrayofstringstype true null ] /Encoding [ /arrayofnamestype true null ] /CharStrings [ /dicttype true null ] /PaintType [ /integertype false null ] /StrokeWidth [ /numbertype false null ] /Metrics [ /dicttype false null ] /Metrics2 [ /dicttype false null ] /CDevProc [ /proctype false null ] /GlyphDirectory [ [ /arrayofstringstype /dicttype ] false null ] /MetricCount [ /integertype false null ] endformat pop % CIDFontType0 - Type9: Type1-like CIDFont /CIDFontType0Format beginformat /CIDFontFormat inheritformat % key type req. nestformat /CDevproc [ /proctype false null ] /CIDCount [ /integertype true null ] /CIDFontVersion [ /integertype false null ] /CIDFontRevision [ /integertype false null ] /CIDMapOffset [ /integertype true null ] /FDArray [ /arraytype true null ] /FDBytes [ /integertype false null ] /GDBytes [ /integertype true null ] endformat pop /*echodictformat { % dict fmt *echodictformat - load dup /keys get 3 -1 roll % fmt keys dict dup length *level 0 eq RAWMODE and { 3 add } if *echoobj (dict begin\n) *echo RAWMODE *level 0 eq and { (/RD { string currentfile exch readstring pop } executeonly def\n) *echo (/ND { noaccess def } executeonly def\n) *echo (/NP { noaccess put } executeonly def\n) *echo } if 1 index { % fmt keys dict [] {} forall 1 index exch 2 copy known { % fmt keys dict dict key boolean 4 index 1 index get 2 get dup null eq { % fmt keys dict dict key fmt fmt=null pop % fmt keys dict dict key dup *echoobj get *echoobj (def\n) *echo } { 2 index 2 index get type /dicttype ne { % fmt keys dict dict key fmt type!=/dicttype pop % fmt keys dict dict key dup *echoobj get *echoobj (def\n) *echo } { 3 1 roll dup *echoobj get exch % fmt keys dict nfmt (dict key get)ndict /*level *level 1 add def *echodictformat /*level *level 1 sub def (def\n) *echo } ifelse } ifelse } { pop pop } ifelse } forall % fmt keys dict exch pop { % fmt dict {} forall 2 index 2 index known not { % fmt key value (fmt key known not)!boolean dup type /fonttype ne 1 index type /filetype ne and { exch *echoobj *echoobj (def\n) *echo } { pop pop } ifelse } { pop pop } ifelse } forall (currentdict end ) *echo pop } bind def % % FontType-depend output procedures with DSC, ProcSet and so on % % string|name type42fontdict fontformat *echottfont boolean /*echottfont { (%!PS-TrueTypeFont-65536-65536-1\n) *echo (%%Creator: ) *echo me *echo (\n) *echo 2 index *echoobj (\n) *echo *echodictformat (\ndefinefont pop\n) *echo (%%EOF\n) *echo pop true } bind def % string|name type2fontdict fontformat *echoresfont boolean /*echoresfont { (%!PS-Adobe-3.0 Resource-Font\n) *echo (%%BeginResource: Font ) *echo 2 index *echo (\n) *echo (%%Title: \() *echo 2 index *echo (\)\n) *echo (%%Creator: ) *echo me *echo (\n) *echo 2 index *echoobj (\n) *echo *echodictformat (\n/Font defineresource pop\n) *echo (%%EndResource\n) *echo (%%EOF\n) *echo pop true } bind def % string|name type2cidfontdict fontformat *echottcidfont boolean /*echottcidfont { (%!PS-Adobe-3.0 Resource-CIDFont\n) *echo (%%DocumentNeedResources: procset CIDInit\n) *echo (%%IncludeResource: procset CIDInit\n) *echo (%%BeginResource: CIDFont ) *echo 2 index *echo (\n) *echo (%%Title: \() *echo 2 index *echo ( ) *echo 1 index /CIDSystemInfo get dup /Registry get *echo ( ) *echo dup /Ordering get *echo ( ) *echo /Supplement get 16 string cvs *echo (\)\n) *echo (%%Creator: ) *echo me *echo (\n) *echo (/CIDInit /ProcSet findresource begin\n) *echo 2 index *echoobj (\n) *echo *echodictformat (\n/CIDFont defineresource pop\n) *echo (end\n) *echo (%%EndResource\n) *echo (%%EOF\n) *echo pop true } bind def % string|name type0cidfontdict fontformat *echocidfont boolean /*echocidfont { *echottcidfont } bind def /*echofonttypes << % 0 { /FontFormat *echoresfont } % ! 2 { /FontType2Format *echoresfont } % ! 42 { /FontType42Format *echottfont } 9 { /CIDFontType0Format *echocidfont } % ! % 10 { /CIDFontFormat *echocidfont } % ! 11 { /CIDFontType2Format *echottcidfont } >> def /*echofont { % string|name fontdict *echofont - dup /FontType get *echofonttypes exch 2 copy known { get exec } { % string|name fontdict *echofonttypes FontType exch pop (Error: Unsupported FontType ) *eecho *eechoobj pop (for ) *eecho *eechostring (\n) *eecho *eflush false } ifelse } bind def % .openttfont % .openttfont /.openttfont { dup type /integertype eq not { (r) file } { exch (r) file exch } ifelse .loadttfont } bind def % % FontType42 generation ------------------------------------------------ % [ //ttfont null ne { //ttfont } if %(/usr/local/share/fonts/truetype/solaris8/arial__h.ttf) %(/usr/local/share/fonts/truetype/solaris8/arialb_h.ttf) %(/usr/local/share/fonts/truetype/solaris8/arialbih.ttf) %(/usr/local/share/fonts/truetype/solaris8/ariali_h.ttf) %{ (/usr/local/share/fonts/truetype/solaris8/ArialBold.ttf) } %{ (/usr/local/share/fonts/truetype/solaris8/ArialBoldItalic.ttf) } %{ (/usr/local/share/fonts/truetype/solaris8/ArialItalic.ttf) } %{ (/usr/local/share/fonts/truetype/solaris8/ArialRegular.ttf) } ] { dup type /arraytype eq 1 index xcheck and { exec } if .openttfont dup /FontName get dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (FontName: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring BATCH not { (FontName: ) *oecho dup *oechostring (? ) *oecho *oflush *enterstring } if dup *outputpath UNINSTALL not { *open exch *echofont *close not { *deletefile } if } { pop pop pop *deletefile } ifelse } ifelse } forall % % FontType42 rename generation ---------------------------------------- % [ //ttname null ne { //ttname } if %{ null (/usr/local/share/fonts/truetype/solaris8/TimesBold.ttf) } %{ / (/usr/local/share/fonts/truetype/solaris8/TimesBoldItalic.ttf)} %{ () (/usr/local/share/fonts/truetype/solaris8/TimesItalic.ttf) } %{ <> (/usr/local/share/fonts/truetype/solaris8/TimesRegular.ttf) } ] { exec .openttfont exch dup null eq 1 index / eq or 1 index () eq or { pop dup /FontName get dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (FontName: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring BATCH not { (FontName: ) *oecho dup *oechostring (? ) *oecho *oflush *enterstring } if dup *outputpath UNINSTALL not { *open exch *echofont *close not { *deletefile } if } { pop pop pop *deletefile } ifelse } ifelse } { dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (FontName: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring dup *outputpath UNINSTALL not { *open exch *echofont *close not { *deletefile } if } { pop pop pop *deletefile } ifelse } ifelse } ifelse } forall % % font resource generation ---------------------------------------- % [ //psfont null ne { //psfont } if %/CourierNewHebrew %/CourierNewHebrew-Bold %/CourierNewHebrew-BoldItalic %/CourierNewHebrew-Italic %/TimesNewRomanHebrew %/TimesNewRomanHebrew-Bold %/TimesNewRomanHebrew-BoldItalic %/TimesNewRomanHebrew-Italic ] { dup findfont exch dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict rename exch pop (Font name: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring dup *outputpath UNINSTALL not { *open exch *echofont *close not { *deletefile } if } { pop pop pop *deletefile } ifelse } ifelse } forall % % CIDFontType2 generation ---------------------------------------- % [ //TTFONT null ne { //TTFONT } if %{ (/usr/local/share/fonts/truetype/solaris8/msgbl.ttf) /Adobe-GB1 } %(/usr/local/share/fonts/truetype/solaris8/mkgbm.ttf) ] { dup type /arraytype eq 1 index xcheck and { exec } if .openttcidfont dup /CIDFontName get dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (CIDFontName: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring BATCH not { (CIDFontName: ) *oecho dup *oechostring (? ) *oecho *oflush *enterstring } if dup *OUTPUTPATH UNINSTALL not { *open exch *echofont *close not { *DELETEFILE } if } { pop pop pop *DELETEFILE } ifelse } ifelse } forall % % CIDFontType2 rename generation -------------------------------- % [ //TTNAME null ne { //TTNAME } if %{ /hei (/usr/local/share/fonts/truetype/solaris8/hei.ttf) /Adobe-CNS1 } %{ /kai (/usr/local/share/fonts/truetype/solaris8/kai.ttf) /Adobe-CNS1 } %{ /ming (/usr/local/share/fonts/truetype/solaris8/ming.ttf) /Adobe-CNS1 } %{ null (/usr/local/share/fonts/truetype/arphic/bkai00mp.ttf) } %{ / (/usr/local/share/fonts/truetype/arphic/bsmi00lp.ttf) } %{ () (/usr/local/share/fonts/truetype/arphic/gbsn00lp.ttf) } %{ <> (/usr/local/share/fonts/truetype/arphic/gkai00mp.ttf) } ] { exec .openttcidfont exch dup null eq 1 index / eq or 1 index () eq or { pop dup /CIDFontName get dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (CIDFontName: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring BATCH not { (CIDFontName: ) *oecho dup *oechostring (? ) *oecho *oflush *enterstring } if dup *OUTPUTPATH UNINSTALL not { *open exch *echofont *close not { *DELETEFILE } if } { pop pop pop *DELETEFILE } ifelse } ifelse } { dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (CIDFontName: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring dup *OUTPUTPATH UNINSTALL not { *open exch *echofont *close not { *DELETEFILE } if } { pop pop pop *DELETEFILE } ifelse } ifelse } ifelse } forall % % CIDFont resource generation ---------------------------------------- % [ //PSFONT null ne { //PSFONT } if %(Baekmuk-Batang) %/Baekmuk-Gulim %/Baekmuk-Headline ] { dup /CIDFont findresource exch dup type /nametype eq { dup length string cvs } if ECHOONLY { % fontdict fontname exch pop (CIDFont name: ) *oecho *oechostring (\n) *oecho *oflush } { % fontdict fontname safestring dup *OUTPUTPATH UNINSTALL not { *open exch *echofont *close not { *DELETEFILE } if } { pop pop pop *DELETEFILE } ifelse } ifelse } forall