Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!warwick!nott-cs!swx From: swx@cs.nott.ac.uk (Stephen Woolston) Newsgroups: comp.lang.postscript Subject: Re: 0 0 moveto (+) show: how to center the (+)? Message-ID: <1991Jun3.084911.20213@cs.nott.ac.uk> Date: 3 Jun 91 08:49:11 GMT References: <9106020627.AA01346@einstein.physics.buffalo.edu> Organization: Nottingham University Lines: 23 In article <9106020627.AA01346@einstein.physics.buffalo.edu> xiaofei@EINSTEIN.PHYSICS.BUFFALO.EDU (X. F. Wang) writes: >I need something > >x y moveto >( symbol ) show > >in drawing agraph. The probem is the symbol is not centered at >currentpoint [The lower left corner is at currentpoint]. How do I >symbol centered at currentpoint ? Haven't tried it, but off the top of my head ... x y moveto (symbol) dup % stack[ (symbol) (symbol) ] stringwidth % stack[ (symbol) xwid ywid ] 2 div neg % stack[ (symbol) xwid -ywid/2 ] exch % stack[ (symbol) -ywid/2 xwid ] 2 div neg % stack[ (symbol) -ywid/2 -xwid/2 ] exch % stack[ (symbol) -xwid/2 -ywid/2 ] rmoveto show % stack[ ] You might like to define {dup ... show} as a procedure.