2009/11/17

PostScript Expanded and constant width lines, matrix

Program02-ExpandedAndConstantWidthLines.ps

% Expanded and constant width lines
% BlueBook P.136 - 137

% --- procedures -----------------------
/pow {
    /n 1.75 def
    2 {
        n mul
        exch
    } repeat
} def

/inch {
    72 mul
} def

/centersquare {
    .5 .5 pow moveto
    -.5 .5 pow lineto
    -.5 -.5 pow lineto
    .5 -.5 pow lineto
    closepath
} def

/tran {
    /proc exch def
    /proc load
    gsave
    proc
    grestore
} def

% --- main -----------------------------
{
    2.5 inch 6 inch translate
    1 16 div setlinewidth
    1 1 5 {
        {
            pop .5 mul inch dup scale
            centersquare
            stroke
        } tran
    } for
} tran

{
    6 inch 6 inch translate
    1 setlinewidth
    /cmtx matrix currentmatrix def
    1 1 5 {
        {
            pop .5 mul inch dup scale
            centersquare
            cmtx setmatrix
            stroke
        } tran
    } for
} tran

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 件のコメント:

コメントを投稿