Greek Symbols in Plot Annotations [message #69302] |
Sun, 10 January 2010 07:51 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I had occasion this week to want to use the Greek symbol
mu in a plot annotation. And since I am all about device-
independent programs, I wanted to write my code in such
a way that the mu showed up on my display *and* in my
PostScript file. This turned out to be surprisingly
difficult to do and took a whole lot more time to
figure out than I expected it to. (The Coyote web
page was hopeless. Who runs things over there!?)
I think most of the difficulty comes because the
information you need seems to be scattered throughout
the IDL on-line help and is not particularly easy
to find without some specialized knowledge of IDL
fonts. Plus, this version of the on-line help (the
12th in the last four years?) is missing those
helpful tabs that used to keep me organized.
Anyway, once I pulled all the information I needed
to write a device-independent program together, the
code was ugly as sin and offended my delicate
sensibilities. You can see what I mean in this
article:
http://www.dfanning.com/ps_tips/greeksym.html
To solve this problem, I wrote a small program that
can return all 24 of the letters in the Greek alphabet
in lowercase or uppercase versions, and in a device-
independent way. The program assumes you use
Hershey fonts (FONT=-1) on your display, and either
hardware fonts (FONT=0) or True-Type fonts (FONT=1)
when you are writing a PostScript file. It also
assumes you have turned ISOLATIN1 encoding on for
the PostScript device. All of these conditions
are met for me just by using the PS_START/PS_END
routines from the Coyote Library, so I don't even
think about it.
You can find the Greek program here:
http://www.dfanning.com/programs/greek.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|