Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Helge Blischke Newsgroups: comp.lang.postscript Subject: Re: How can I stretch a Postscript image, vertically only?? Followup-To: comp.lang.postscript Date: Tue, 10 Jan 2012 12:50:38 +0100 Lines: 69 Message-ID: <9n2n0jF1f1U1@mid.individual.net> References: <621c6264-3d28-42d0-81b6-65d0f4eb934e@m11g2000yqe.googlegroups.com> <9n0vt8Fpp4U1@mid.individual.net> <5f5084db-e002-401d-8a8d-072e0592db75@q17g2000yqh.googlegroups.com> <1f50f327-f97f-496f-971b-c1d2996b41e1@r5g2000yqc.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: individual.net n8vwW+alB7jMj+EZiUOOmQW2XOrY2mRn2P4DAAOeyYHUDq22bc Cancel-Lock: sha1:E8Rc+H745QaCYjB/CCJKgNfG2SU= User-Agent: KNode/0.99.01 Xref: x330-a1.tempe.blueboxinc.net comp.lang.postscript:561 luser- -droog wrote: > On Jan 9, 3:27 pm, luser- -droog wrote: >> On Jan 9, 2:44 pm, Ramon F Herrera wrote: >> >> >> >> > On Jan 9, 2:10 pm, Helge Blischke wrote: >> >> > > Ramon F Herrera wrote: >> >> > > > See my thread "Need minimum/tutorial Postscript code". >> >> > > > In essence, I need to multiply the vertical dimensions by a factor >> > > > of 3. >> >> > > > TIA, >> >> > > > -Ramon >> >> > > What about >> > > >> > > 1 3 scale >> > > >> > > ? >> > > >> > > Helge >> >> > Thanks Helge! >> >> > I tried it, but it doesn't work. It scales the traces, making the >> > horizontal lines thicker: >> >> That's not fatal! You just need to *un*scale before you `stroke`. >> >> matrix currentmatrix  % get a copy of the 'current' matrix >> 1 3 scale >> %create path (moveto's and lineto's) >> setmatrix  % reinstall the saved matrix >> stroke  % draw the lines with the "normal" pen-shape. >> >> In a pinch, you can use >> matrix defaultmatrix setmatrix >> to reset the pen-shape. But this is a bad habit; it destroys >> modularity; and it's illegal in EPS. Because you can't *embed* >> the program fragment anymore. "illegal" is a hard statement. The core of the restrictions the PLRM states on EPS files is that an EPS must not generate any unwanted side effects that may have influence of the environment that includes the EPS. But if you use e.g. setmatrix as shown above it is perfectly legal. > > This is an aspect of postscript that took me a looooong time even > to notice. For line-drawing, postscript uses the Current > Transformation > Matrix /twice/! It transforms user coordinates through the CTM and > stores the current path in device-space points (so currentpoint > uses itransform to present the point in the current user-space). > > Then, when you stroke, it uses the CTM a second time to define the > shape of the virtual pen (brush) that performs the drawing. > > A nifty special effect is to use some crazy /skewed/ pen to draw > an otherwise static picture. It can "liven things up". > > % construct path (moveto's and lineto's) > [ 1 .5 5 30 0 0 ] setmatrix stroke