| anstrom [message #16430] |
Tue, 27 July 1999 00:00 |
Sang-Heon Shim
Messages: 11 Registered: October 1998
|
Junior Member |
|
|
Simple question.
How can I put angstrom character (�) in the postscript file using true
type font?
Thanks.
--
----------------------------------
Sang-Heon Dan Shim
Department of Geosciences
Princeton University
Princeton, NJ 08544-1003
office:(609)258-3261
fax:(609)258-1274
home:(609)258-8977
http://www.princeton.edu/~sangshim
sangshim@princeton.edu
----------------------------------
|
|
|
|
| Re: anstrom [message #16523 is a reply to message #16430] |
Tue, 27 July 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Sang-Heon Shim (sangshim@princeton.edu) writes:
> Thanks for the answer. For vector font, your idea works fine. However,
> if I try to use true type font, it doesn't.
>
> IDL>xyouts, 0,0, string(197B), font=0 ; <- to get true type font
> It gives wired character. Thanks.
You also have to set the ISOLATIN1 keyword. This works in both
vector and true-type fonts:
thisDevice = !D.Name
set_plot, 'PS'
DEVICE, FILE='w.ps', SET_FONT='Helvetica', /TT_FONT, /isolatin1
plot, [0], /nodata, xrange = [-50,50], yrange = [-50,50]
xyouts, 0,0, 'This is some nice test ' + string(197B), Font=0
device, /close
set_plot, thisDevice
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
|
|
|
|
| Re: anstrom [message #16526 is a reply to message #16430] |
Tue, 27 July 1999 00:00  |
Sang-Heon Shim
Messages: 11 Registered: October 1998
|
Junior Member |
|
|
Thanks for the answer. For vector font, your idea works fine. However,
if I try to use true type font, it doesn't.
IDL>xyouts, 0,0, string(197B), font=0 ; <- to get true type font
It gives wired character. Thanks.
Dan
Jeff Kolthammer wrote:
>
> Sang-Heon Shim wrote:
>
>> Simple question.
>> How can I put angstrom character (�) in the postscript file using true
>> type font?
>> Thanks.
>>
>
> Conveniently, the angstrom character is in the ASCII character set. You can
> generate the character with the "string" function and a byte argument:
>
> IDL> print, STRING(197B)
>
> You could use XYOUTS or something similar when writing to your postscript device;
> the TrueType font, size, et cetera can be controlled using keywords to DEVICE.
>
> For example, the following code draws some axes and drops a large TrueType
> angstrom character in the middle.
>
> IDL> set_plot, 'PS'
> IDL> DEVICE, FILE='w.ps', SET_FONT='Times', /TT_FONT
> IDL> plot, [0], /nodata, xrange = [-50,50], yrange = [-50,50]
> IDL> xyouts, 0,0, string(197B)
> IDL> device, /close
> IDL> set_plot, 'X'
>
> Hope this helps,
>
> Jeff
>
> --------------------------
> Jeff Kolthammer
>
> Nuclear Medicine Division
> Picker International
> Email: jeffk@nm.picker.com
--
----------------------------------
Sang-Heon Dan Shim
Department of Geosciences
Princeton University
Princeton, NJ 08544-1003
office:(609)258-3261
fax:(609)258-1274
home:(609)258-8977
http://www.princeton.edu/~sangshim
sangshim@princeton.edu
----------------------------------
|
|
|
|
| Re: anstrom [message #16527 is a reply to message #16430] |
Tue, 27 July 1999 00:00  |
Jeff Kolthammer
Messages: 2 Registered: July 1999
|
Junior Member |
|
|
Sang-Heon Shim wrote:
> Simple question.
> How can I put angstrom character (�) in the postscript file using true
> type font?
> Thanks.
>
Conveniently, the angstrom character is in the ASCII character set. You can
generate the character with the "string" function and a byte argument:
IDL> print, STRING(197B)
You could use XYOUTS or something similar when writing to your postscript device;
the TrueType font, size, et cetera can be controlled using keywords to DEVICE.
For example, the following code draws some axes and drops a large TrueType
angstrom character in the middle.
IDL> set_plot, 'PS'
IDL> DEVICE, FILE='w.ps', SET_FONT='Times', /TT_FONT
IDL> plot, [0], /nodata, xrange = [-50,50], yrange = [-50,50]
IDL> xyouts, 0,0, string(197B)
IDL> device, /close
IDL> set_plot, 'X'
Hope this helps,
Jeff
--------------------------
Jeff Kolthammer
Nuclear Medicine Division
Picker International
Email: jeffk@nm.picker.com
|
|
|
|