comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Xwindow, TVimage and PostScript fonts
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Xwindow, TVimage and PostScript fonts [message #16765] Thu, 19 August 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Roy E. Hansen (roy.hansen@triad.no) writes:

> I know this post should be sent directly to David Fanning
> but he answers all the questions on this newsgroup anyhow :-)

I really need to get a life. :-(

I'm making a vow to post only once a week, and
then only if someone really riles me up about color. :-)

Before I go....

> I have been playing around with David Fanning's example programs to
> see if I can snatch a few ideas for my next project. BTW, Xwindow is a
> fantastic program.
>
> One thing that I need is a plot of an image with axis and a colorbar that
> easily can be printed to high quality PostScript.
> Easy, I thougth. Use xwindow, tvimage and colorbar as in the following
> example:
>
> ;------------- Start hurrah.pro -------------------
>
> PRO hurrah, image, Xxx=xxx, Yyy=yyy
>
> erase
> pos = [0.05, 0.1, 0.8, 0.9]
> tvimage, image, position=pos
> !p.position = pos
> plot, xxx, yyy, /xsty, /ysty, /nodata, /noerase
>
> colorbar, position=[0.85, 0.1, 0.95, 0.9], /VERT, /RIGHT
>
> END ;------------ hurrah.pro ----------------------
>
>
> image = hanning(64) # hanning(64)
> xwindow, 'hurrah', image*200, Xxx=[0,1], Yyy=[0,1], /Out
>
> END ;-------------- main.pro ----------------------
>
> This works except one detail:
> How do I get readable fonts (i.e. PostScript and NOT Hershey fonts) on the PS output?

Well, before I answer this question for you, let me
point out that your ERASE command is already going to
hurt you in PostScript output, since that will force
the output onto the *next* page. You will get a blank
page every time you get output. Think of the trees!

So, I would fix both of these problems by writing
your HURRAH program like this:

PRO hurrah, image, Xxx=xxx, Yyy=yyy

IF !D.Name EQ 'PS' OR !D.Name EQ 'PRINTER' THEN BEGIN
font = 0 ; or 1 if you want True-Type fonts
ENDIF ELSE BEGIN
erase
font = -1
ENDELSE
pos = [0.05, 0.1, 0.8, 0.9]
tvimage, image, position=pos
!p.position = pos
plot, xxx, yyy, /xsty, /ysty, /nodata, /noerase, FONT=font

colorbar, position=[0.85, 0.1, 0.95, 0.9], /VERT, /RIGHT, FONT=font

END ;------------ hurrah.pro ----------------------

By the way, I just a moment ago got an e-mail from David Ritscher
(david.ritscher@bigfoot.com) who has sent me a new XWINDOW program
that has implemented a multiple-command-line functionality with
my LinkedList object. I haven't even had a chance to look at it
yet, but we may make it available for people to fool around with.
I've been working on a similar capability (also using that
incredibly useful LINKEDLIST object) in my little free time.

So, if you liked XWINDOW, just hang on a bit. Something better
may be just around the corner. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Previous Topic: IDL 5.2.1L for Red Hat Linux 6.0
Next Topic: Displaying 24-bit Images on PCs

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 16:07:13 PDT 2025

Total time taken to generate the page: 1.04119 seconds