Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!psuvax1!psuvm!cxt105 From: CXT105@PSUVM.BITNET (Christopher Tate) Newsgroups: comp.sys.mac.programmer Subject: Re: Thin lines on Laser Message-ID: <89284.171455CXT105@PSUVM.BITNET> Date: 11 Oct 89 21:14:55 GMT References: <847@chyde.uwasa.fi> Organization: Penn State University Lines: 59 Ok, I know of two different ways to do this, each with its own strengths: 1) You can manually set the reduce/enlarge field in the Style record to be something like 25% (the minimum), then pretend that the page is four time larger than it really is. When the print driver scales the page based on this info, it actually reduces EVERYTHING, including the pen dimensions. This is the easy way to do it, but your users may set the reduce/enlarge back up to 100% and throw you off, depending on how you do it. Also, the user no longer gets any control over how big they want their document to print. (NOTE: this is the way that the program "Diatom" produces fine-line laser output.) 2) You can use direct PostScript commands to draw the image, using the BeginPostScript and TextIsPostScript PicComments. Any following text sent through DrawText will be treated as literal PS code, and the printer will attempt to draw it. So, you can use a command like ".02 setlinewidth" to specify a 2/100 of a point pen size, then draw the image using "lineto" commands, etc. The biggest problem with this method is that drawing images that are more complex that simple line figures is nearly impossible using only direct PostScript. Also, you have to figure out a way to construct the command strings for DrawString. The main advantage is that you get precise control over the output resolution. I have a program that draws figures using "0 setlinewidth", which gives device-minimum lines. If your figures are simple enough that you can figure out the PS drawing commands for them directly, and use those to construct the image, then you may want to consider using this method. If your images use Mac- type figures, such as patterned fills, etc., then you probably want to stick to the first method I described. The reason that changing the pen size using PenSize doesn't work the way you want it to is that a) it accepts only integer values, and b) the default coordinate system for the LaserWriter uses 1-point (1/72 inch) units. In my program (mentioned above), the coarseness of resolution imposed by this pen size caused visible streaking, due to round-off error in the integer math I was doing (I used integers for speed). I fixed this by saying ".25 .25 scale" to reduce the user coordinate system by 4 times, then drawing everything 4 times larger. This gave much better addressible resolution (over 280 dpi), and still let me use integers for coordinate specification. Once again, this method only works if you are using direct PostScript for your drawing. I haven't tinkered much with a hybrid of direct PostScript and printer driver interpretation of regular Mac QuickDraw commands; there may be a way to set up the pen size and coordinate system to give you the resolution you want, then drop out of direct PS mode to draw your image using QuickDraw. Has anyone else out there worked anything out along these lines? That's about all I know about this stuff. If you like, I can send you some Turbo Pascal source for method 2), but some things would have to be changed, most notably all the times I concatenated strings. I haven't used LSP enough to know how to do that.... ------- Christopher Tate | Vengeance (noun): | Eye for eye, tooth for tooth; Bitnet: cxt105@psuvm | a fair, satisfying, and rapid Uucp: ...!psuvax1!psuvm.bitnet!cxt105 | way to a sightless, toothless Internet: cxt105@psuvm.psu.edu | world.