Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!decwrl!adobe!orthlieb From: orthlieb@adobe.COM (Carl Orthlieb) Newsgroups: comp.lang.postscript Subject: Re: Thin line woes Message-ID: <5657@adobe.UUCP> Date: 16 Aug 90 18:59:11 GMT References: <10244@pt.cs.cmu.edu> <15253@imagen.UUCP> Reply-To: orthlieb@adobe.UUCP (Carl Orthlieb) Organization: Adobe Systems Incorporated, Mountain View Lines: 31 In article <15253@imagen.UUCP> isaak@imagen.UUCP (Mark Isaak) writes: >The simplest solution otherwise is to specify "0 setlinewidth", which >will give a nice-looking one-pixel-wide line at all angles. For slightly >wider diagonals, some combination of endpoint rounding and/or width >correction may be desirable. > >in article <10244@pt.cs.cmu.edu>, tgl@zog.cs.cmu.edu (Tom Lane) says: >> 2. In the book "Real World PostScript" (Roth, ed.), Michael Fryd >> recommends rounding endpoint coordinates to nearest-integer-plus-0.25 >> in device space, whereas the green book just shows rounding to nearest >> integer. Which of these is better, and why? > >For horizontal and vertical lines, it shouldn't matter in theory, although >adding +0.25 might avoid some obscure round-off errors in practice (That >last part is just a guess). I'm not sure how the difference would affect >diagonal lines. The "Real World PostScript" book is correct. If straight rounding is performed, lines will be biased to be an even number of pixels wide. If rounding + 0.5 is performed, lines will be biased towards an odd number of pixels. Rounding + 0.25 ensures an even (no pun intended) distribution of even and odd pixel line weights. 0 setlinewidth is discouraged because it is device dependent, lines will be different point sizes on printers with different resolutions. To obtain a one-pixel wide line on a 300 dpi device, use the round + 0.25 method and specify 0.12 setlinewidth. This will give you wider diagonals and maintain a 1 pixel width on horizontal and vertical lines. Carl 8-)