groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Printing everything on 1 page


From: Paul J. Lucas
Subject: Re: [Groff] Printing everything on 1 page
Date: Sat, 12 Jan 2002 01:44:16 -0800 (PST)

On Sat, 12 Jan 2002 address@hidden wrote:

> In that case I would suspect that the EPS file does some things
> which have an adverse effect on the surrounding PS code.

        I hand-wrote the PostScript myself.  I've done this before and
        it's always worked.  There isn't anything strange about it (I
        don't think).

> Thereafter, I think some of us would want to look at the EPS
> file, in the context of the document where you embed it.

        I've appended the file since it's not that big.

        - Paul

%!PS-Adobe-1.0
%%Title: interval_logo.eps
%%Creator: Paul J. Lucas
%%BoundingBox: 0 0 96 72
%%EndComments

%
%       Name:   cvrgbf
%       For:    converting 3 RGB values from 0-255 to 0-1 (floating point)
%       Stack:  r g b => r g b
%
/cvrgbf {
        3 { 255 div 3 1 roll } repeat
} bind def

%
%       Name:   rect
%       For:    drawing rectangles (whose origin is at the lower-left)
%
%       Stack:  width height => ---
%       Example:
%               130 200 moveto 72 36 rect stroke
%
/rect {
        dup                             % w h h
        0 exch rlineto                  % line to nw corner
        exch 0 rlineto                  % line to ne corner
        0 exch neg rlineto              % line to se corner
        closepath                       % back to sw corner
} bind def

%
%       Name:   rrect
%       For:    drawing rounded-corner rectangles
%       Stack:  width height radius => ---
%       Example:
%               130 200 moveto 72 36 0.2 rrect stroke
%
/rrect {
        dup 0 exch                      % w h r 0 r
        rmoveto currentpoint            % w h r x0 y0
        3 index 3 index sub             % w h r x0 y0 (h-r)
        add                             % w h r x1 y1
        1 index                         % w h r x1 y1 x1
        5 index 4 index sub             % w h r x1 y1 x1 (w-r)
        add                             % w h r x1 y1 x2
        1 index 4 index                 % w h r x1 y1 x2 y2 r
        arct                            % w h r
        currentpoint                    % w h r x0 y0
        4 index 3 index sub             % w h r x0 y0 (w-r)
        3 -1 roll                       % w h r y0 (w-r) x0
        add exch                        % w h r x1 y1
        1 index                         % w h r x1 y1 x2
        4 index 4 index sub             % w h r x1 y1 x2 (h-r)
        2 index                         % w h r x1 y1 x2 (h-r) y1
        exch sub                        % w h r x1 y1 x2 y2
        4 index                         % w h r x1 y1 x2 y2 r
        arct                            % w h r
        currentpoint                    % w h r x0 y0
        3 index 3 index sub             % w h r x0 y0 (h-r)
        sub                             % w h r x1 y1
        1 index                         % w h r x1 y1 x1
        5 index 4 index sub             % w h r x1 y1 x1 (w-r)
        sub                             % w h r x1 y1 x2
        1 index 4 index                 % w h r x1 y1 x2 y2 r
        arct                            % w h r
        currentpoint                    % w h r x0 y0
        5 -2 roll pop                   % r x0 y0 w
        3 index sub                     % r x0 y0 (w-r)
        3 -1 roll                       % r y0 (w-r) x0
        exch sub exch                   % r x1 y1
        1 index 1 index 4 index         % r x1 y1 x2 y1 r
        add                             % r x1 y1 x2 y2
        5 -1 roll                       % x1 y1 x2 y2 r
        arct
        closepath
} bind def
%%EndProlog

%%BeginSetup
/color_left     [   3 122 153 cvrgbf ] def
/color_right    [  89  89  89 cvrgbf ] def
/color_middle   [ 171 204  84 cvrgbf ] def
/logo_height    72 def
/logo_width     logo_height 1.18544 mul def
/outer_radius   10.00 def
/inner_radius    4.30 def
/outer_inset    10.80 def
/inner_inset    15.84 def
/vert_line_pct  0.690 def
4.3 setlinewidth
%%EndSetup

%Pages: 1 1

% left half
newpath
0 0 moveto
logo_width logo_height outer_radius rrect
color_left aload pop setrgbcolor fill

gsave
        % Make clipping path the area of the right half so the fill below will
        % only fill the right half.
        newpath
        logo_width vert_line_pct mul 0 moveto
        0 logo_height rlineto
        logo_width 1 vert_line_pct sub mul 0 rlineto
        0 logo_height neg rlineto
        closepath clip

        % right half
        newpath
        0 0 moveto
        logo_width logo_height outer_radius rrect
        color_right aload pop setrgbcolor fill
grestore

% vertical white line
newpath
logo_width vert_line_pct mul 0 moveto
0 logo_height rlineto
1 setgray stroke

% middle white
newpath
outer_inset outer_inset moveto
logo_width outer_inset 2 mul sub logo_height outer_inset 2 mul sub
        inner_radius rrect
1 setgray fill

% middle green
newpath
inner_inset inner_inset moveto
logo_width inner_inset 2 mul sub logo_height inner_inset 2 mul sub rect
color_middle aload pop setrgbcolor fill

showpage
%%Trailer
%%EOF


reply via email to

[Prev in Thread] Current Thread [Next in Thread]