%! /me (aliascid.ps by Taiji Yamada and gs-cjk project) def % % Usage: % % $ gs [-q] -dNODISPLAY [-dBATCH] [-dECHOONLY] [-dUNINSTALL] \ % [-sOUTPUTDIR=[dir|-|=]] \ % -dPSNAME='{/cidfontname /orig_cidfontname}' |\ % -dPSNAME='{/cidfontname /orig_cidfontname /Bold}' |\ % -dPSNAME='{/cidfontname /orig_cidfontname .03}' |\ % -dPSNAME='{/cidfontname /orig_cidfontname /Italic}' |\ % -dPSNAME='{/cidfontname /orig_cidfontname {1,0,.3,1,0,0}}' |\ % -dPSNAME='{/cidfontname /orig_cidfontname /BoldItalic}' |\ % -dPSNAME='{/cidfontname /orig_cidfontname .03 {1,0,.3,1,0,0}}' |\ % -dPSNAME='{/cidfontname (filename.ttf)}' |\ % -dPSNAME='{/cidfontname (filename.ttc) 2}' |\ % -dPSNAME='{/cidfontname (filename.ttf) /Adobe-Japan2}' |\ % -dPSNAME='{/cidfontname (filename.ttc) 2 /Adobe-CNS1-Big5}' |\ % [-soutputdir=[dir|-|=]] \ % [-sRO=Adobe-CNS1|Adobe-GB1|Adobe-Japan1|Adobe-Japan2|Adobe-Korea1|\ % Adobe-Identity] \ % [-dCOMPOSE [-sDELIMITER=--] [-sDOTDELIMITER=.]] \ % aliascid.ps % % $ gs [-q] -dNODISPLAY [-dBATCH] [-dECHOONLY] [-dUNINSTALL] \ % [-soutputdir=[dir|-|=]] \ % -sFNNAME=cidfontname |\ % [-sRO=Adobe-CNS1|Adobe-GB1|Adobe-Japan1|Adobe-Japan2|Adobe-Korea1|\ % Adobe-Identity] \ % [-sDELIMITER=--] [-sDOTDELIMITER=.] \ % aliascid.ps % /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 /FNNAME null unknowndef % cidfontname will be composed with CMaps /RO (Adobe-Identity) unknowndef % Registry and Ordering used at COMPOSE mode /COMPOSE false unknowndef % Font/CIDFontName--CMapName creation mode /DELIMITER (-) unknowndef % CIDFontNameDELIMITERCMapName as FontName /DOTDELIMITER (.) unknowndef % CIDFontNameDOTDELIMITERCMapName as FontName % at Roman|Katakana|Hiragana|Hankaku|WP-Symbol CMaps for OCF compatibility /OUTPUTDIR () unknowndef % for CIDFont, default current directory /PSNAME null unknowndef % name and cidfontname|truetype font filename /MAKEBOLD null def % /MAKEBOLD .03 def /MAKEFONT null def % /MAKEFONT [1 0 .3 1 0 0] def /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 /concatanytostringprocs << /dicttype { exch (<< ) concat2strings exch { 1 dict begin /value exch def concatanytostring value concatanytostring end } forall (>> ) concat2strings } bind /arraytype { dup xcheck { exch ({ ) concat2strings exch { concatanytostring } forall (} ) concat2strings } { exch ([ ) concat2strings exch { concatanytostring } forall (] ) concat2strings } ifelse } bind /stringtype { exch (\() concat2strings exch { dup isprint { 1 string dup 0 4 -1 roll put concat2strings } { exch (\\) concat2strings exch 8 3 string cvrs dup length 3 exch sub { (0) exch concat2strings } repeat concat2strings } ifelse } forall (\) ) concat2strings } bind /operatortype { 64 string cvs cvn concat2strings } bind /nametype { dup xcheck { dup length string cvs [ 3 1 roll ( ) ] concats } { dup length string cvs (/) exch [ 4 1 roll ( ) ] concats } ifelse } bind /realtype { 16 string cvs [ 3 1 roll ( ) ] concats } bind /integertype { 16 string cvs [ 3 1 roll ( ) ] concats } bind /booleantype { 16 string cvs [ 3 1 roll ( ) ] concats } bind /nulltype { pop (null ) concat2strings } bind >> def /concatanytostring { % str any concatanytostring string dup type concatanytostringprocs exch 2 copy known { get exec } { pop pop pop null concatanytostring } ifelse } bind def /cutoutstring { % string i len cutoutstring string 2 index 0 3 index getinterval 3 1 roll add % string pre i+len 2 index length 1 index sub % string pre i+len L-i-len 4 -1 roll 3 1 roll getinterval concat2strings % pre post concat2strings } bind def /insertstring { % str i substr insertstring string [ 3 index 3 index 5 index length 5 index sub getinterval 5 -2 roll 0 exch getinterval 4 -1 roll 3 -1 roll ] concats } bind def /replacestrings { % string [[src1 dst1] ...] replacestrings string 0 { % string [[]..] i 1 2 index { dup 0 get exch 1 get % string [[]..] i d src dst % string [[]..] i d src dst i+sl<=L 3 index 2 index length add 6 index length le { % string [[]..] i d src dst substr=src 5 index 4 index 3 index length getinterval 2 index eq { % string [[]..] i d src dst pre+post % string [[]..] i d src dst pre+dst+post 5 index 4 index 3 index length cutoutstring 4 index 2 index insertstring % pre+dst+post [[]..] i d src dst % pre+dst+post [[]..] i dl-1+d src dst 7 -1 roll pop 6 1 roll dup length 1 sub 4 -1 roll add 3 1 roll pop pop exit } if } if pop pop } forall % string [[]..] i d add dup 3 index length ge { exit } if } loop pop pop % string } bind def % string str tailmatch pre true % string str tailmatch string false /tailmatch { 1 index length 1 index length 2 copy sub % S str L l L-l dup 0 gt { 4 index 1 index 3 index getinterval 4 index eq dup 6 1 roll { % S boolean str L l L-l % pre boolean str L l L-l 5 index 0 2 index getinterval 7 -1 roll pop 6 1 roll } if } { false 5 1 roll } ifelse 4 { pop } repeat } bind def /putmorekey { % dict key value putmorekey - 2 index 2 index known { 2 index 2 index get dup null eq { pop 1 array } { dup length 1 add array dup 0 4 -1 roll putinterval } ifelse dup dup length 1 sub 4 -1 roll put put } { [ exch ] put } ifelse } bind def /putmoreknownkey { % dict key value putmoreknownkey - 2 index 2 index known { 2 index 2 index get dup null eq { pop 1 array } { dup length 1 add array dup 0 4 -1 roll putinterval } ifelse dup dup length 1 sub 4 -1 roll put put } { pop pop pop } 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 % it is dict to store RO and CMap names as a key and an array of strings % already-stored CMap names are for efficiency /ROCMapNames << % gs-cjk supported (all at gs-cjk-M2-R3 or later) /Adobe-CNS1 [ (Adobe-CNS1-0) (Adobe-CNS1-1) (Adobe-CNS1-2) (Adobe-CNS1-3) (Adobe-CNS1-4) (B5-H) (B5-V) (B5pc-H) (B5pc-V) (CNS-EUC-H) (CNS-EUC-V) (CNS1-H) (CNS1-V) (CNS2-H) (CNS2-V) (ETHK-B5-H) (ETHK-B5-V) (ETen-B5-H) (ETen-B5-V) (ETenms-B5-H) (ETenms-B5-V) (HKdla-B5-H) (HKdla-B5-V) (HKdlb-B5-H) (HKdlb-B5-V) (HKgccs-B5-H) (HKgccs-B5-V) (HKm314-B5-H) (HKm314-B5-V) (HKm471-B5-H) (HKm471-B5-V) (HKscs-B5-H) (HKscs-B5-V) (UniCNS-UCS2-H) (UniCNS-UCS2-V) (UniCNS-UTF16-H) (UniCNS-UTF16-V) (UniCNS-UTF32-H) (UniCNS-UTF32-V) (UniCNS-UTF8-H) (UniCNS-UTF8-V) ] /Adobe-GB1 [ (Adobe-GB1-0) (Adobe-GB1-1) (Adobe-GB1-2) (Adobe-GB1-3) (Adobe-GB1-4) (GB-EUC-H) (GB-EUC-V) (GB-H) (GB-RKSJ-H) (GB-V) (GBK-EUC-H) (GBK-EUC-V) (GBK2K-H) (GBK2K-V) (GBKp-EUC-H) (GBKp-EUC-V) (GBT-EUC-H) (GBT-EUC-V) (GBT-H) (GBT-RKSJ-H) (GBT-V) (GBTpc-EUC-H) (GBTpc-EUC-V) (GBpc-EUC-H) (GBpc-EUC-V) (UniGB-UCS2-H) (UniGB-UCS2-V) (UniGB-UTF8-H) (UniGB-UTF8-V) ] /Adobe-Japan1 [ (78-EUC-H) (78-EUC-V) (78-H) (78-RKSJ-H) (78-RKSJ-V) (78-V) (78ms-RKSJ-H) (78ms-RKSJ-V) (83pv-RKSJ-H) (90ms-RKSJ-H) (90ms-RKSJ-V) (90msp-RKSJ-H) (90msp-RKSJ-V) (90pv-RKSJ-H) (90pv-RKSJ-V) (Add-H) (Add-RKSJ-H) (Add-RKSJ-V) (Add-V) (Adobe-Japan1-0) (Adobe-Japan1-1) (Adobe-Japan1-2) (Adobe-Japan1-3) (Adobe-Japan1-4) (EUC-H) (EUC-V) (Ext-H) (Ext-RKSJ-H) (Ext-RKSJ-V) (Ext-V) (H) (Hankaku) (Hiragana) (Katakana) (NWP-H) (NWP-V) (RKSJ-H) (RKSJ-V) (Roman) (UniJIS-UCS2-H) (UniJIS-UCS2-HW-H) (UniJIS-UCS2-HW-V) (UniJIS-UCS2-V) (UniJIS-UTF8-H) (UniJIS-UTF8-V) (UniJISPro-UCS2-HW-V) (UniJISPro-UCS2-V) (UniJISPro-UTF8-V) (V) (WP-Symbol) ] /Adobe-Japan2 [ (Adobe-Japan2-0) (Hojo-EUC-H) (Hojo-EUC-V) (Hojo-H) (Hojo-RKSJ-H) (Hojo-V) (UniHojo-UCS2-H) (UniHojo-UCS2-V) (UniHojo-UTF8-H) (UniHojo-UTF8-V) ] /Adobe-Korea1 [ (Adobe-Korea1-0) (Adobe-Korea1-1) (Adobe-Korea1-2) (KSC-EUC-H) (KSC-EUC-V) (KSC-H) (KSC-Johab-H) (KSC-Johab-V) (KSC-RKSJ-H) (KSC-V) (KSCms-UHC-H) (KSCms-UHC-HW-H) (KSCms-UHC-HW-V) (KSCms-UHC-V) (KSCpc-EUC-H) (KSCpc-EUC-V) (UniKS-UCS2-H) (UniKS-UCS2-V) (UniKS-UTF8-H) (UniKS-UTF8-V) ] /Adobe-Identity [ (Identity-H) (Identity-V) ] % gs-cjk unsupported /Adobe-CNS2 [ (CNS01-RKSJ-H) (CNS02-RKSJ-H) (CNS03-RKSJ-H) (CNS04-RKSJ-H) (CNS05-RKSJ-H) (CNS06-RKSJ-H) (CNS07-RKSJ-H) (CNS15-RKSJ-H) ] /Adobe-HongKong1 [ (HK-RKSJ-H) ] /Adobe-Korea2 [ (KSC2-RKSJ-H) ] /Adobe-Vietnam1 [ (TCVN-RKSJ-H) ] >> def % it is for efficiency /ROKnownCMap? { % CMapName ROKnownCMap? boolean false ROCMapNames { % CMapName boolean dict {} forall exch pop { % CMapName boolean array {} forall 2 index eq or dup { exit } if % CMapName boolean||value=CMapName } forall dup { exit } if % CMapName boolean } forall exch pop } bind def % it is to avoid gs hangs up /FromCIDCMap? { % CMapName FromCIDCMap? boolean [ % ToUnicode CMap (-UCS2) (-UCS2C) % ToCode CMap (-B5pc) (-ETen-B5) (-GBK-EUC) (-GBpc-EUC) (-90ms-RKSJ) (-90pv-RKSJ) (-KSCms-UHC) (-KSCpc-EUC) % FromCID CMap to compose multiple fonts (-H-CID) (-H-Host) (-H-Mac) (-PS-H) (-PS-V) ] false exch { % CMapName boolean [] {} forall 2 index exch tailmatch exch pop or % CMapName boolean bool or dup { exit } if } forall exch pop } bind def /entryROCMapNames { % - entryROCMapNames - (*) { % CMapName {} - dup ROKnownCMap? not { dup FromCIDCMap? not { dup /CMap findresource /CIDSystemInfo get dup /Registry get exch /Ordering get % CMapName R O [ 3 1 roll (-) exch ] concats cvn % CMapName /R-O exch ROCMapNames 3 1 roll dup length string copy % dict /R-O CMapName %putmorekey putmoreknownkey } { pop } ifelse } { pop } ifelse } 1024 string /CMap resourceforall } bind def entryROCMapNames % for future CMap added by Adobe /DotDelimiterCMap? { % CMapName DotDelimiterCMap? boolean [ (Roman) (Katakana) (Hiragana) (Hankaku) (WP-Symbol) ] false exch { % CMapName boolean [] {} forall 2 index eq or dup { exit } if % CMapName boolean||value==CMapName } forall exch pop } bind def % % Font output procedures with DSC and so on % % fontname cidfontname cmapname *echocidcmapfont boolean /*echocidcmapfont { 3 dict begin [ /cmapname /cidfontname /fontname ] { exch dup type /stringtype ne { dup length string cvs } if def } forall %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (\ %!PS-Adobe-3.0 Resource-Font %%Creator: @Creator@ %%DocumentNeededResources: @CMapName@ (CMap) %%IncludeResource: @CMapName@ (CMap) %%BeginResource: Font (@FontName@) (@FontName@) (@CMapName@) /CMap findresource [(@CIDFontName@) /CIDFont findresource] composefont pop %%EndResource %%EOF ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [ [ (@FontName@) fontname ] [ (@CIDFontName@) cidfontname ] [ (@CMapName@) cmapname ] [ (@Creator@) me ] ] replacestrings *echo true end } bind def % % CIDFont output procedures with DSC and so on % % string|name cidfontproc *echocidprocfont boolean /*echocidprocfont { 2 dict begin /cidfontproc () 3 -1 roll { concatanytostring } forall ( ) tailmatch pop (\n) concat2strings def /cidfontname exch dup type /stringtype ne { dup length string cvs } if def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (\ %!PS-Adobe-3.0 Resource-CIDFont %%Creator: @Creator@ %%BeginResource: CIDFont (@CIDFontName@) (@CIDFontName@) @CIDFontProc@@MakeBoldProc@@MakeFontProc@/CIDFont defineresource pop %%EndResource %%EOF ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [ [ (@CIDFontName@) cidfontname ] [ (@CIDFontProc@) cidfontproc ] [ (@MakeBoldProc@) MAKEBOLD null ne { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (\ 16 dict begin /basecidfont exch def /basefont-H /.basefont-H /Identity-H [ basecidfont ] composefont def /basefont-V /.basefont-V /Identity-V [ basecidfont ] composefont def /CIDFontName dup basecidfont exch get def /CIDFontType 1 def /CIDSystemInfo dup basecidfont exch get def /FontInfo dup basecidfont exch get def /FontMatrix matrix def /FontBBox [ basecidfont /FontBBox get cvx exec 4 2 roll basecidfont /FontMatrix get transform 4 2 roll basecidfont /FontMatrix get transform ] def /cid 2 string def /BuildGlyph { gsave exch begin dup 256 idiv cid exch 0 exch put 256 mod cid exch 1 exch put rootfont /WMode known { rootfont /WMode get 1 eq } { false } ifelse { basefont-V } { basefont-H } ifelse setfont @MakeBoldLineWidth@ setlinewidth 1 setlinejoin newpath 0 0 moveto cid false charpath stroke 0 0 moveto cid show currentpoint setcharwidth end grestore } bind def currentdict end ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [ [ (@MakeBoldLineWidth@) () MAKEBOLD concatanytostring ( ) tailmatch pop ] ] replacestrings } { () } ifelse ] [ (@MakeFontProc@) MAKEFONT null ne { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (\ dup length dict begin { 1 index /FontMatrix eq { @MakeFontMatrix@ matrix concatmatrix def } { def } ifelse } forall currentdict end ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [ [ (@MakeFontMatrix@) () MAKEFONT concatanytostring ( ) tailmatch pop ] ] replacestrings } { () } ifelse ] [ (@Creator@) me ] ] replacestrings *echo true end } bind def % % CIDFont and CMap composefont definition ------------------------ % /*outputcidfontcmaps { % CIDFontName RO *outputcidfontcmaps - % CIDFontName RO ROCMapNames exch get { % CIDFontName CMapName CIDFontName CMapName '--' 2 copy dup DotDelimiterCMap? not { DELIMITER } { DOTDELIMITER } ifelse % CIDFontName CMapName CIDFontName--CMapName exch [ 4 1 roll ] concats dup *outputpath UNINSTALL not { *open % CIDFontName CIDFontName--CMapName CIDFontName CMapName 2 index 3 -1 roll % CIDFontName boolean *echocidcmapfont *close not { *deletefile } if } { pop pop pop *deletefile } ifelse } forall pop } bind def [ //FNNAME null ne { //FNNAME } if %/MSung-Light %/MSung-Medium %/MHei-Medium %/MKai-Medium %{ /MSung-Light /Adobe-CNS1 } %{ /MSung-Medium /Adobe-CNS1 } %{ /MHei-Medium /Adobe-CNS1 } %{ /MKai-Medium /Adobe-CNS1 } %/STSong-Light %/STFangsong-Light %/STHeiti-Regular %/STKaiti-Regular %{ /STSong-Light /Adobe-GB1 } %{ /STFangsong-Light /Adobe-GB1 } %{ /STHeiti-Regular /Adobe-GB1 } %{ /STKaiti-Regular /Adobe-GB1 } ] { dup type /arraytype eq 1 index xcheck and { exec } { RO } ifelse *outputcidfontcmaps } forall % % CIDFont rename definition ---------------------------------------- % [ //PSNAME null ne { //PSNAME } if %{ /MKai-Medium /ZenKai-Medim } %{ (MSung-Medium) /ShanHeiSun-Light } %{ /STSong-Light /BousungEG-Light-GB } %{ /STKaiti-Regular /GBZenKai-Medium } %{ /ZenKai-Medium (/usr/local/share/fonts/truetype/arphic/bkai00mp.ttf) } %{ (ShanHeiSun-Light) (/usr/local/share/fonts/truetype/arphic/bsmi00lp.ttf) } %{ / (/usr/local/share/fonts/truetype/arphic/gbsn00lp.ttf) } %{ () (/usr/local/share/fonts/truetype/arphic/gkai00mp.ttf) } %{ /MS-Mincho (\\WINDOWS\\Fonts\\msmincho.ttc) 1 } %{ /MS-Mincho-Bold /MS-Mincho .03 } %{ /MS-Mincho-BoldItalic /MS-Mincho .03 {1 0 .3 1 0 0} } %{ /MS-Mincho-Italic /MS-Mincho {1 0 .3 1 0 0} } %{ /MS-Gothic-Bold /MS-Gothic /Bold } %{ /MS-Gothic-BoldItalic /MS-Gothic /BoldItalic } %{ /MS-Gothic-Italic /MS-Gothic /Italic } %{ /MS-Mincho-Bold } % gsnd -dBATCH -dUNINSTALL %{ /MS-Mincho-BoldItalic } % gsnd -dBATCH -dUNINSTALL %{ /MS-Mincho-Italic } % gsnd -dBATCH -dUNINSTALL %{ /MS-Gothic-Bold } % gsnd -dBATCH -dUNINSTALL %{ /MS-Gothic-BoldItalic } % gsnd -dBATCH -dUNINSTALL %{ /MS-Gothic-Italic } % gsnd -dBATCH -dUNINSTALL ] { dup length 1 gt { dup 1 get type /nametype eq { [ 1 index 1 get /CIDFont /findresource cvx ] } { [ 1 index 1 3 index length 1 sub getinterval cvx exec /.openttcidfont cvx ] } ifelse } { [] } ifelse cvx exch % CIDFontProc { ... } /MAKEBOLD null def /MAKEFONT null def 2 1 2 index length 1 sub { 1 index exch get dup type /realtype eq { /MAKEBOLD 1 index def } { dup type /arraytype eq { /MAKEFONT 1 index cvlit def } { dup type /nametype eq { << /Bold { /MAKEBOLD .03 def } /BoldItalic { /MAKEBOLD .03 def /MAKEFONT [1 0 .3 1 0 0] def } /Italic { /MAKEFONT [1 0 .3 1 0 0] def } >> { exch 2 index eq { exec exit } { pop } ifelse } forall } if } ifelse } ifelse pop } for 0 get % CIDFontProc CIDFontName dup null eq 1 index / eq or 1 index () eq or { pop dup exec /CIDFontName get dup type /stringtype ne { dup length string cvs } if safestring BATCH not { (CIDFontName: ) *oecho dup *oechostring (? ) *oecho *oflush *enterstring } if } { dup type /stringtype ne { dup length string cvs } if } ifelse dup 3 -1 roll % CIDFontName CIDFontName CIDFontProc UNINSTALL not { dup length 0 gt { 1 index *OUTPUTPATH *open *echocidprocfont *close not { *DELETEFILE } if } { pop pop } ifelse } { 1 index *OUTPUTPATH pop pop pop *DELETEFILE } ifelse % CIDFontName COMPOSE { RO *outputcidfontcmaps } { pop } ifelse } forall