Article View: comp.lang.postscript
Article #886Snap to Pixel Question
From: jwhiting
Date: Thu, 17 Aug 1989 11:03
Date: Thu, 17 Aug 1989 11:03
42 lines
1687 bytes
1687 bytes
%% the following PostScript code has me baffled
%%
%% inch procedure
/in {72 mul } def
%%
%% procedure for line w/o snap procedure
%%
/NoSnap { 0 .125 in rlineto .045 in -.125 in rmoveto } bind def
%%
%% snap to pixel procedure from p148 Green Book
%%
/snap { transform round exch round exch itransform } bind def
%%
%% procedure for line w/Green Book snap procedure
%%
/WithSnap { 0 .125 in snap rlineto .045 in -.125 in snap rmoveto } bind def
%%
%% Aldus Prep snap trick
/Snap2
{
transform 2 div round 2 mul exch 2 div round 2 mul exch itransform
} bind def
%%
%% procedure for line w/Aldus Prep snap
%%
/WithAldusSnap { 0 .125 in Snap2 rlineto .045 in -.125 in Snap2 rmoveto } bind
def
%%
200 200 moveto 35 { NoSnap } repeat
200 250 moveto 35 { WithSnap } repeat
200 300 moveto 35 { WithAldusSnap } repeat
.02 in setlinewidth stroke showpagesnap procedure?
%% this is no better: { transform .25 sub round .25 add round exch
%% .25 sub round .25 add round exchange itransform } bind def
%% the Aldus Prep snap trick gives a wiggle to the lines
%% what am I doing wrong? I just want the lines & spaces to be even.
%% thanks jwhiting
%% [DE3MIR]jwhiting via DASnet
%% UUCP: uunet!pyramid!cdp!jwhiting
%% Bitnet: cdp!jwhiting%labrea@stanford
%% Internet: cdp!jwhiting!@arisia.xerox.com
Technical Details
Message-ID:
<134400007@cdp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!agate!shelby!labrea!cdp!jwhitingShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!agate!shelby!labrea!cdp!jwhiting From: jwhiting@cdp.UUCP Newsgroups: comp.lang.postscript Subject: Snap to Pixel Question Message-ID: <134400007@cdp> Date: 17 Aug 89 11:03:27 GMT Lines: 42 Nf-ID: #N:cdp:134400007:000:1300 Nf-From: cdp.UUCP!jwhiting Aug 16 10:20:00 1989