2009/11/13

PostScript Line-Drawing Details, setdash, aload, astore, roll

10.2-LineDrawingDetails.ps

% --- variables ------------------------
/width 500 def
/height 700 def
/ypos 700 def
/font-size 15 def
/dec-point 15 def
/Times-Roman findfont font-size scalefont setfont

% --- procedures -----------------------
/prt-n {
    (   ) cvs show
} def

/borders {
    -2.5 0 moveto
    0 height rlineto
    width 0 moveto
    0 height rlineto
    stroke
} def

/newline {
    /ypos ypos dec-point sub def
} def

/doLine {
    0 ypos moveto
    width 0 rlineto
    stroke
    5 ypos 2 add moveto
    ypos prt-n
    newline
} def

/dot {
    setdash doLine
} def

% --- main -----------------------------
50 50 translate
15 setlinewidth
borders

.5 setlinewidth
[] 0 dot
/dotary [0 1 2 3 4 5] def
height dec-point idiv {
    /dotary dotary aload pop 6 1 roll 6 array astore def
    [4 4] dotary 0 get dot
} repeat

showpage

 

 

PostScript(R) Language Tutorial and Cookbook (APL)

PostScript(R) Language Tutorial and Cookbook (APL)

posted with amazlet at 09.10.07

Adobe Systems Inc.
Addison-Wesley Professional
売り上げランキング: 235737

おすすめ度の平均: 5.0

5 まず最初に読むべき入門書
5 効率の良いPostScript書くなら…

Amazon.co.jp で詳細を見る

0 件のコメント:

コメントを投稿