🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3247

printing thin lines on 300dpi printer

#3247
From: J. Daniel Smith
Date: Mon, 01 Oct 1990 22:21
72 lines
2664 bytes
I'm trying to print 1 pixel wide lines on a 300dpi PS printer.
Following the techniques on page 62-63 of _Real World PostScript_, 
I have the code shown below.

The problem is that the top line of the box is thicker than the other
sides.  I tried printing this file on two different Apple PS printers,
and the result was the same on both of them.  I also tried different
values for "setlinewidth" (0.24, 0.12 and 0.003).  And I tried putting
the SnapToPixel before the "rmoveto".  None of this worked!  There
must be a way to do this properly (i.e. *not* doing everything in
1/300 inch units).

Thanks for any and all help.
   Dan

P.S. Internet mail isn't working properly right now; use either
"uunet!sharkey!applga!dsmith" or "smithda@buster.cps.msu.edu" or just
post a followup article.
=========================================================================
J. Daniel Smith                     Internet: dsmith@applga.aa.cad.slb.com
Schlumberger CAD/CAM                  BITNET: smithdan@msuegr
Ann Arbor, Michigan                   Usenet: uunet!sharkey!applga!dsmith
                                       SINet: AAACA1::SMITH

The two most common things in the universe are hydrogen and stupidity,
but not necessarily in that order. 
=========================================================================
---------
%!PS-Adobe-2.0
%%EndComments

/bdf {bind def} bind def
/inch {72 mul} bdf

%
% Logo sizes
/boxy {.25 inch} bdf      % box start this far up from division name
/boxlength {7.5 inch} bdf % length of entire logo box
/logoheight {.1875 inch} bdf

/SnapToPixel   % snap X,Y coord to device pixels
  { transform
    round .25 add
    exch
    round .25 add
    exch
    itransform
  } bdf

/drawboxes
 {gsave
  .12 setlinewidth % 1/600 inch hairlines 
  newpath				% long, narrow box
    0 boxy SnapToPixel moveto
    boxlength 0 rlineto
    0 logoheight rlineto
    boxlength neg 0 rlineto
  closepath
  stroke

  grestore
  } bdf
%%EndProlog

%%BeginSetup
0.5 inch 1 inch SnapToPixel translate  % 0.5 inch margins
%%EndSetup

drawboxes

showpage
%%Trailer
Technical Details
Message-ID: <1990Oct1.222116.14508@applga.aa.cad.slb.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!ucsd!pacbell.com!pacbell!indetech!sharkey!applga!dsmith

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!ucsd!pacbell.com!pacbell!indetech!sharkey!applga!dsmith
From: dsmith@applga.aa.cad.slb.com (J. Daniel Smith)
Newsgroups: comp.lang.postscript
Subject: printing thin lines on 300dpi printer
Keywords: thin lines
Message-ID: <1990Oct1.222116.14508@applga.aa.cad.slb.com>
Date: 1 Oct 90 22:21:16 GMT
Sender: dsmith@applga.aa.cad.slb.com (J. Daniel Smith)
Reply-To: smithda@buster.cps.msu.edu
Organization: Schlumberger CAD/CAM ; Ann Arbor, MI
Lines: 72