| Re: writing to 2 "windows" in idl? [message #5644 is a reply to message #5633] |
Thu, 18 January 1996 00:00  |
Eric Deutsch
Messages: 11 Registered: May 1995
|
Junior Member |
|
|
Cathy Smith wrote:
>
> Hi- I'd like to write out character strings to a gif imagee and determine
> their lengths (in pixels). I can do this using xyouts and this works for
> most of what I want to do. However, now I would like to find the length
> of a character string BEFORE I write it out. I tried writing out
> in the same color as my image to get the returned length and then writing
> it out again in the color I want. This works except that I cover up some
> lines on my original plot that I don't want covered. Is there a way to
> write to a "fake" device instead?
yes, there is a "Z-buffer" device which is a virtual device that lets you do these
sorts of things, but...
> The relevant parts of my code are:
>
> tvlct,/GET,r,g,b
> window, colors=223,xsize=n1,ysize=n2
> etc......
>
> device,font='-adobe-helvetica-bold-r-normal--10-100-75-75-p- 60-iso8859-1'
you are using an X hardware font here, and it is very unfortunate (but not
surprising, I guess) that you cannot use X hardware fonts when using the Z
device... As far as I know, the best you can do is use the Hershey fonts
(or a bitmapped font solution). Anyone know otherwise??
> xyouts, x+4, y, string, /device,width=namew ,charsize=1.2,color=44
> mmwidth=namew*n1
> xyouts, x-mmwidth-4, y, string, /device, width=namew ,charsize=1.2,color=222
However, if I understand your coding here, it looks to me like you're trying to
right-justify some text. IDL provides a nice facility for this with the xyouts
,ALIGN=1 keyword; and you can use ,ALIGN=0.5 to center text about the specified
X,Y coordinates.
Hope this helps..
Eric
--
------------------------------------------------------------ ----------------
Eric Deutsch email: deutsch@astro.washington.edu
Department of Astronomy Voice: (206) 616-2788
University of Washington FAX: (206) 685-0403
Box 351580 WWW: http://www.astro.washington.edu/deutsch
Seattle, WA 98195-1580 Physics/Astronomy Bldg., Room B356F
|
|
|
|