|  | HTML |  |

|  | Splash! |  |

|  | PostScript |  |

| Template Toolkit Examples: PostScript Library: Various useful marks |

|  | index |  |

|  | marks |  |

# Various useful marks

These elements define a range of procedures for generating various marks.

Source #1:

    [% PROCESS ps/mm %]

    20 mm 20 mm whatever

PostScript Output #1:

    /mm {
        72 mul 25.4 div
    } bind def
    20 mm 20 mm whatever

Source #2:

    [%  PROCESS ps/mm;
        PROCESS ps/ring;
    %]

    20 mm 20 mm ring

PostScript Output #2:

    /mm {
        72 mul 25.4 div
    } bind def
    /ring {
        newpath
        2 mm 0 360 arc
        stroke
    } def
    20 mm 20 mm ring

Source #3:

    [% # ps/ring loads ps/mm if necessary
       PROCESS ps/ring
    %]

    20 mm 20 mm ring

PostScript Output #3:

    /mm {
        72 mul 25.4 div
    } bind def
    /ring {
        newpath
        2 mm 0 360 arc
        stroke
    } def
    20 mm 20 mm ring

Source #4:

    [% PROCESS ps/ring radius='10 mm' %]

    20 mm 20 mm ring

PostScript Output #4:

    /mm {
        72 mul 25.4 div
    } bind def
    /ring {
        newpath
        2 mm 0 360 arc
        stroke
    } def
    20 mm 20 mm ring

Source #5:

    [% PROCESS ps/cross %]

    20 mm 20 mm cross

PostScript Output #5:

    /mm {
        72 mul 25.4 div
    } bind def
    /cross {
        newpath
        moveto
       -5 mm 0 rmoveto
        5 mm 0 rlineto
        5 mm 0 rlineto
       -5 mm -5 mm rmoveto
        0 5 mm rlineto
        0 5 mm rlineto
        stroke
    } def
    20 mm 20 mm cross

Source #6:

    [%  PROCESS ps/mm;
        PROCESS ps/cross radius='10 mm'
    -%]

    20 mm 20 mm cross

PostScript Output #6:

    /mm {
        72 mul 25.4 div
    } bind def
    /cross {
        newpath
        moveto
       -5 mm 0 rmoveto
        5 mm 0 rlineto
        5 mm 0 rlineto
       -5 mm -5 mm rmoveto
        0 5 mm rlineto
        0 5 mm rlineto
        stroke
    } def
    20 mm 20 mm cross

Source #7:

    [%  # ps/cross loads ps/mm anyway
        PROCESS ps/cross radius='10 mm'
    -%]

    20 mm 20 mm cross

PostScript Output #7:

    /mm {
        72 mul 25.4 div
    } bind def
    /cross {
        newpath
        moveto
       -5 mm 0 rmoveto
        5 mm 0 rlineto
        5 mm 0 rlineto
       -5 mm -5 mm rmoveto
        0 5 mm rlineto
        0 5 mm rlineto
        stroke
    } def
    20 mm 20 mm cross

Source #8:

    [% INCLUDE ps/cross;
       INCLUDE ps/ring;
    %]

    20 mm 20 mm cross
    20 mm 20 mm ring

PostScript Output #8:

    /mm {
        72 mul 25.4 div
    } bind def
    /cross {
        newpath
        moveto
       -5 mm 0 rmoveto
        5 mm 0 rlineto
        5 mm 0 rlineto
       -5 mm -5 mm rmoveto
        0 5 mm rlineto
        0 5 mm rlineto
        stroke
    } def
    /ring {
        newpath
        2 mm 0 360 arc
        stroke
    } def
    20 mm 20 mm cross
    20 mm 20 mm ring

Source #9:

    [% PROCESS ps/crosshair %]

    20 mm 20 mm crosshair

PostScript Output #9:

    /mm {
        72 mul 25.4 div
    } bind def
    /ring {
        newpath
        2 mm 0 360 arc
        stroke
    } def
    /cross {
        newpath
        moveto
       -5 mm 0 rmoveto
        5 mm 0 rlineto
        5 mm 0 rlineto
       -5 mm -5 mm rmoveto
        0 5 mm rlineto
        0 5 mm rlineto
        stroke
    } def
    /crosshair {
        /y exch def
        /x exch def
        x y ring
        x y cross
    } def
    20 mm 20 mm crosshair

Source #10:

    [% PROCESS ps/cross radius='20 mm';
       PROCESS ps/ring  radius='10 mm';
       PROCESS ps/crosshair;
    -%]

    20 mm 20 mm crosshair

PostScript Output #10:

    /mm {
        72 mul 25.4 div
    } bind def
    /cross {
        newpath
        moveto
       -5 mm 0 rmoveto
        5 mm 0 rlineto
        5 mm 0 rlineto
       -5 mm -5 mm rmoveto
        0 5 mm rlineto
        0 5 mm rlineto
        stroke
    } def
    /ring {
        newpath
        2 mm 0 360 arc
        stroke
    } def
    /crosshair {
        /y exch def
        /x exch def
        x y ring
        x y cross
    } def
    20 mm 20 mm crosshair