⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ps2ai.ps

📁 GhostScript的源代码
💻 PS
📖 第 1 页 / 共 2 页
字号:
            dup rhtpar eq { (\\\)) jp }{ %ifelse
                dup bckslsh eq { (\\\\) jp }{ %ifelse
                    hstr exch 0 exch put hstr jp
                } ifelse
            } ifelse
        } ifelse
   } forall (\)) jp flush
} bind def
% AI 3 text format pieces
jtxt3 {
/j3txt { j3ftxt {(0 Ts 100 Tz 0 Tt 0 TA 0 0 5 TC 100 100 200 TW 0 0 0 Ti\n) jp
                (0 Ta 0 Tq 0 0 TI 0 Tc 0 Tw\n) jp} if } def
/show {oldgsave  (0 To\n) jp 
  currentpoint 2 copy /jy exch def /jx exch def translate 
  curftmatrix /jitm exch def
  0 1 5 {jitm exch get jpnum} for ( 0 Tp\n) jp (TP\n) jp
  (0 Tr\n) jp (\/_) jp curftname  curftsize jpnum ( Tf\n) jp
  (0) jp j_ax  curftsize div 100 mul jpnum ( 100 TC\n) jp %  percent(?)
  dup curpt moveto mark exch handft ( Tx\n) jp (TO\n) jp /j3ftxt false def
  cleartomark currentpoint oldgrestore moveto
} def  
/ashow {exch pop exch /j_ax exch def show /j_ax {0} def } def
} 
 {
/show {oldgsave (u\n) jp currentpoint 2 copy /jy exch def /jx exch def translate
  (\/) jp curftname jstr cvs jp
  curftsize dup jpnum  jpnum ( 0 0 z\n) jp
  curftmatrix jpmat ( e\n) jp
  dup curpt moveto mark exch handft ( t T U\n) jp
  cleartomark currentpoint oldgrestore moveto} def
/ashow {oldgsave (u\n) jp currentpoint translate (\/) jp curftname jstr cvs jp
  curftsize dup jpnum jpnum  exch kscl mul jpnum ( 0 z\n) jp
  curftmatrix jpmat ( e\n) jp dup curpt moveto mark exch handft
  ( t T U\n) jp cleartomark currentpoint oldgrestore moveto} def
} ifelse
/widthshow { show pop pop pop} def
/awidthshow {ashow pop pop pop} def
/kshow {show pop} def
%/show {true charpath fill} bind def   % get outline of charactor
joutln {/show { true charpath currentpoint 
     /jy exch def /jx exch def fill jx jy moveto} bind def} if
%/show {oldshow} def    % do nothing different
%
%               Color Operators
%
/oldsetcmykcolor [/setcmykcolor load] cbdef
/setcmykcolor {oldsetcmykcolor 
currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( k\n) jp
currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
 } def
/oldsetgray [/setgray load] cbdef
/setgray {0 0 0 4 -1 roll 1 exch sub setcmykcolor} def
/oldsethsbcolor [/sethsbcolor load] cbdef
/sethsbcolor {oldsethsbcolor currentcmykcolor setcmykcolor} def
/oldsetrgbcolor [/setrgbcolor load] cbdef
/setrgbcolor {oldsetrgbcolor currentrgbcolor /bval xdef /gval xdef /rval xdef
 /rawC 1 rval sub def /rawM 1 gval sub def /rawY 1 bval sub def
 rawC rawM ge { rawY rawM ge { /blk rawM def} if } if
 rawC rawY ge { rawM rawY ge { /blk rawY def} if } if
 rawY rawC ge { rawM rawC ge { /blk rawC def} if } if
 rawY rawC eq { rawM rawC eq { /blk rawC def} if } if
 /cyan  rawC blk sub  def
 /mag  rawM blk sub  def
 /yel  rawY blk sub  def
 /blk blk def
 cyan mag yel blk setcmykcolor } def
%
%                State Operators
%
/oldsetlinewidth [/setlinewidth load] cbdef
/setlinewidth {kscl abs mul jltz  oldsetlinewidth
 currentlinewidth jpnum ( w\n) jp } def
/oldsetlinecap [/setlinecap load] cbdef
/setlinecap {dup oldsetlinecap jpnum ( J\n) jp} def
/oldsetlinejoin [/setlinejoin load] cbdef
/setlinejoin {dup oldsetlinejoin jpnum ( j\n) jp} def
/oldsetmiterlimit [/setmiterlimit load] cbdef
/setmiterlimit {dup oldsetmiterlimit jpnum ( M\n) jp}def
/oldsetdash [/setdash load] cbdef
/setdash {exch [ exch {kscl abs mul} forall ] exch kscl abs mul oldsetdash
  currentdash exch jpmat jpnum ( d\n) jp } def
/oldsetflat [/setflat load] cbdef
/setflat {dup oldsetflat jpnum ( i\n) jp } def
%
%                More State Operators
%
/kscl { % use just the x scale factor
 oldgsave
 matrix currentmatrix /jctm exch def
 jctm 4 0 put jctm 5 0 put jctm setmatrix
 1 0 moveto currentpoint transform
 dup mul exch dup mul add sqrt 10000 mul round 10000 div
 oldgrestore
} def
/currentstate {currentcmykcolor setcmykcolor
 currentflat jpnum ( i) jp currentlinecap jpnum ( J) jp
 currentlinejoin jpnum ( j) jp currentlinewidth jpnum ( w) jp
 currentmiterlimit jpnum ( M ) jp currentdash exch jpmat jpnum ( d\n) jp 
} def
/jdifG {
 currentcmykcolor /jok xdef /joy xdef /jom xdef /joc xdef
 currentflat /jof xdef currentlinecap /jolc xdef currentlinejoin /jolj xdef
 currentlinewidth /jolw xdef currentmiterlimit /joml xdef
 currentdash /jood xdef /joad xdef
 oldgrestore
 currentcmykcolor /jnk xdef /jny xdef /jnm xdef /jnc xdef
 currentflat /jnf xdef currentlinecap /jnlc xdef currentlinejoin /jnlj xdef
 currentlinewidth /jnlw xdef currentmiterlimit /jnml xdef
 currentdash /jnod xdef /jnad xdef
 % compare old gstate to new gstate
 joc jnc ne jom jnm ne joy jny ne jok jnk ne
 jof jnf ne jolc jnlc ne jolj jnlj ne jolw jnlw ne joml jnml ne 
 false joad {true exit} forall {pop pop true}{false} ifelse
 false jnad {true exit} forall {pop pop true}{false} ifelse ne
 jood jnod ne 10 {or} repeat {currentstate} if
} def
/oldgsave [/gsave load] cbdef
/gsave {oldgsave /gcnt gcnt 1 add def } def % clarry gcnt false put} def
%  (%%Note:gsave ) jp gcnt jpnum (\n) jp} def
/oldgrestore [/grestore load] cbdef
/grestore {dpth {newpath} if clarry gcnt get {(Q\n) jp clarry gcnt false put} if 
 jdifG /gcnt gcnt 1 sub def } def
% oldgrestore currentstate } def
% (%%Note:grestore ) jp gcnt 1 add jpnum (\n) jp} def
/oldrestore [/restore load] cbdef
% a kludgy way of saving the clipping path status information
/restore {clarry aload pop 11 -1 roll oldrestore clarry astore pop} def
/showpage {  0 1 9 {clarry exch get {(Q\n) jp} if } for
 (%%Note: If Error, make sure there are matched pairs of 'q's and 'Q's\n) jp
 (%%Note: in the file. Add 'Q's before '%%Trailer' until equal\n) jp
 (%%Trailer\n) jp
 jtxt3 {(Adobe_IllustratorA_AI3 /terminate get exec\n) jp
        (Adobe_typography_AI3 /terminate get exec\n) jp
        (Adobe_customcolor /terminate get exec\n) jp
        (Adobe_cshow /terminate get exec\n) jp
        (Adobe_cmykcolor /terminate get exec\n) jp
        (Adobe_packedarray /terminate get exec\n) jp
}{
        (Adobe_Illustrator881 /terminate get exec\n) jp
        (Adobe_customcolor /terminate get exec\n) jp
        (Adobe_cshow /terminate get exec\n) jp
        (Adobe_cmykcolor /terminate get exec\n) jp
        (Adobe_packedarray /terminate get exec\n) jp 
       } ifelse
( showpage\n%EOF\n%%EndDocument\n) jp
 jout {joutput closefile} if jMacGS not {quit} if /j3ftxt true def } def 
%
%                Error handling
%
errordict begin
% Attempt to handle the error caused by bitmap fonts (TeX,Windows.ps,etc)
% this is a big-time kludge
jbiterr {
 /undefined {pop pop (Times-Roman)} def
 /typecheck {pop pop} def
} if
jerr {
 /handleerror {
  (%%Note: ps2ai error, aborting rest of conversion\n) jp showpage
 } def
} if
end
%
%                Mac LW 8 improvements
%
/jmacimp { % stroked line instead of thin filled boxes
 /@a {  3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
      3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll exch sub exch lineto
      abs setlinewidth  stroke pop pop} def
 /@b { 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
      pop
      3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch lineto
      abs setlinewidth  stroke} def
 /endp {showpage pm restore} def % because the restore stops clean up
} def
%
%                Handle (some) PS Level 2
%
/rectstroke { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  closepath stroke} def
/rectfill { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  fill } def
/rectclip { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  closepath clip newpath jMacfix {jmacimp} if } def
%
% Add a header prolog to the output file so it is still view/print-able
%
(%!PS-Adobe-2.0 EPSF-1.2\n%%BoundingBox: 0 0 612 792\n) jp
(%%Title: Adobe Illustator 3 Editable Document\n) jp
(%%Creator: ps2ai.ps vers.) jp vers jpnum ( \(C\) 1993-94 Jason Olszewski\n) jp
(%%TemplateBox: 0 0 612 792\n) jp
jtxt3 {(%%AI3_Margin:0 0 0 0\n) jp } if
(%%EndComments\n) jp
(%%BeginProlog\n) jp
(/m {moveto} def /l {lineto} def /c {curveto} def\n) jp
(/S {stroke} def /F {fill} def\n) jp
(/s {closepath S} def /f {closepath F} def\n) jp
(/q {gsave} def /Q {grestore} def /W {clip} def /k {setcmykcolor} def\n) jp
(/i {setflat} def /J {setlinecap} def /j {setlinejoin} def\n) jp
(/w {setlinewidth} def /M {setmiterlimit} def /d {setdash} def\n) jp
(/u {gsave} def /U {grestore} def /K {k} def\n) jp
(/N {newpath} def /n {closepath N} def\n) jp
(/g {setgray} def /G {g} def\n) jp
(/x {pop pop k} def /X {x} def\n) jp
(/H {} def /h {H closepath} def /D {pop} def\n) jp
(/*u { /N {/spth 0 def}def /S{/spth 1 def}def /F {/spth 2 def} def} def\n) jp
(/*U { spth 0 eq {newpath} if spth 1 eq {stroke} if spth 2 eq {fill} if\n) jp
(     /N {newpath} def /S {stroke} def /F {fill} def  } def\n) jp
%(\n) jp
jtxt3 {
 (/TC {pop pop pop} def /Tr {pop} def\n) jp
 (/To {pop gsave} def /TO {grestore} def\n) jp
 (/Tp {pop matrix astore concat} def  /TP {0 0 moveto} def\n) jp
 (/a_str 40 string def /cnt 0 def /h_str (X) def /undsc (_) 0 get def\n) jp
 (/fntfix {a_str cvs dup length 1 sub /f_str exch string def\n) jp
 (  {dup undsc eq {pop}{f_str cnt 3 -1 roll put /cnt cnt 1 add def\n) jp
 (  } ifelse } forall flush /cnt 0 def f_str cvn } bind def\n) jp

 (/Tf {exch fntfix findfont exch scalefont setfont} def /Tx {show} def\n) jp
}{
 (/z {pop pop pop exch findfont exch scalefont setfont} def\n) jp
 (/e {concat 0 0 m} def /t {show} def /T {} def\n) jp
} ifelse
(\n) jp
jtxt3 {
 (userdict /Adobe_packedarray 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_cmykcolor 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_cshow 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_customcolor 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_typography_AI3 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_IllustratorA_AI3 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
}{
 (userdict /Adobe_packedarray 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_cmykcolor 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_cshow 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_customcolor 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
 (userdict /Adobe_Illustrator881 2 dict dup begin put\n) jp
 (/initialize {} def /terminate {} def\n) jp
} ifelse
(%%EndProlog\n) jp
(%%BeginSetup\n) jp
jtxt3 {
 (Adobe_packedarray /initialize get exec\n) jp
 (Adobe_cmykcolor /initialize get exec\n) jp
 (Adobe_cshow /initialize get exec\n) jp
 (Adobe_customcolor /initialize get exec\n) jp
 (Adobe_typography_AI3 /initialize get exec\n) jp
 (Adobe_IllustratorA_AI3 /initialize get exec\n) jp
}{
 (Adobe_packedarray /initialize get exec\n) jp
 (Adobe_cmykcolor /initialize get exec\n) jp
 (Adobe_cshow /initialize get exec\n) jp
 (Adobe_customcolor /initialize get exec\n) jp
 (Adobe_Illustrator881 /initialize get exec\n) jp
} ifelse
(%%EndSetup\n) jp
0 0 0 1 oldsetcmykcolor
currentstate
jout {(%%Note: Load Postscript file to be converted now\n) print} if

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -