Re: Vertical text alignment in postscript [message #54852 is a reply to message #54846] |
Tue, 17 July 2007 08:21  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
I'm not sure what you were expecting this program to produce. For me,
it produces the words "Testing 123" with two horizontal lines. There
is some vertical space between the top of the "T" and the top line,
but this is expected for the Helvetica font.
Alignment of text on plots was just discussed in the past few days in
this newsgroup. Maybe the tips presented there could help you.
Good luck,
Craig
Andy Heaps <a.j.heaps@reading.ac.uk> writes:
> I'm trying to align text vertically in postscript but have some extra
> space
> above where the text finishes.Using !D.Y_CH_SIZE/2.0 as the mid-point
> means that the text is now not vertically aligned.
>
> Has anyone an explanation/solution for this problem?
> Attached is a small program to show the problem.
>
> Many thanks
> Andy
>
>
> PRO ll
>
> SET_PLOT, 'ps'
> DEVICE, FILE='ll.ps', XSIZE=8.27, YSIZE=11.69, $
> XOFFSET=0.5, YOFFSET=0.5, /INCHES, /COLOR
> !P.COLOR=1
> !P.FONT=0
> !P.POSITION=[0.1,0.3,0.9,0.6]
> r = [255,0]
> g = [255,0]
> b = [255,0]
> TVLCT,r,g,b
>
> mysize=6.0 ;Size of our text
> ypix=!D.Y_CH_SIZE*mysize ;Height of text in pixels
> xstart=1000 ;X start of plotting
> xfinish=20000 ;X finish of plotting
> ystart=5000 ;Y start of plotting
>
> XYOUTS, xstart, ystart, CHARSIZE=mysize, 'Testing 123', /DEVICE
> PLOTS, [xstart, xfinish], [ystart, ystart], /DEVICE ;Bottom of text
> PLOTS, [xstart, xfinish], [ystart+ypix, ystart+ypix], /DEVICE ;Top of text
>
> DEVICE, /CLOSE
>
> END
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|