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

Home » Public Forums » archive » Angstrom symbol
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Angstrom symbol [message #1305] Wed, 15 September 1993 02:59 Go to next message
egami is currently offline  egami
Messages: 1
Registered: September 1993
Junior Member
I'm wondering if there's a way to print out an angstrom symbol in a
title of a plot with PostScript font. I know this is possible with
X-window fonts, because the symbol is encoded with an octal number,
which can be found by using "xfd". However, this symbol is not
explicitly encoded in PostScript, so I don't know how to access it
even though my printer has the font.

Currently, I'm using the following sequence of positioning commands
to construct the symbol with PostScript font:

"!SA!R !A!9\260!N"

However, this still looks awkward.

Is there a way to print out this symbol directly in PostScript?
Someone might have asked this question already, but I couldn't
find any answer in the FAQ. I would appreciate any suggestions.
Thanks in advance.


Eiichi Egami
Institute for Astronomy
University of Hawaii
Re: Angstrom symbol [message #1485 is a reply to message #1305] Wed, 22 September 1993 21:19 Go to previous messageGo to next message
claflin is currently offline  claflin
Messages: 1
Registered: September 1993
Junior Member
In article <JACOBSEN.93Sep16195850@xray1.physics.sunysb.edu>, jacobsen@xray1.physics.sunysb.edu (Chris Jacobsen) writes:
> There's a way to do it. Look in the release notes on your
> computer. If you're on Unix, I think you can do
> cd /usr/local/lib/idl/lib/doc
> grep ngstrom *
> or something like that. Sorry I can't get it at it at the moment...
> --
> *******************
> Chris Jacobsen, Department of Physics, SUNY at Stony Brook
> Phone (516) 632-8093, FAX -8101 Bitnet: cjacobsen@sbccmail
> jacobsen@xray1.physics.sunysb.edu ALL-IN_ONE: CJACOBSEN
> *******************

As I recall, the original question was, "How do I get an Angstrom symbol in
PostScript output." Version 3.1 of IDL incorporated Adobe ISO-LATIN 1 font
encoding. With that Version or later one can use

SET_PLOT,'PS'
DEVICE,/HELVETICA,/ISOLATIN1

and insert the Angstrom symbol in character strings with STRING(197B) .

Reference: IDL News, Spring, 1993.

Scott Claflin
LMSC
Re: Angstrom symbol [message #1493 is a reply to message #1305] Thu, 16 September 1993 16:58 Go to previous messageGo to next message
jacobsen is currently offline  jacobsen
Messages: 28
Registered: July 1992
Junior Member
There's a way to do it. Look in the release notes on your
computer. If you're on Unix, I think you can do
cd /usr/local/lib/idl/lib/doc
grep ngstrom *
or something like that. Sorry I can't get it at it at the moment...
--
*******************
Chris Jacobsen, Department of Physics, SUNY at Stony Brook
Phone (516) 632-8093, FAX -8101 Bitnet: cjacobsen@sbccmail
jacobsen@xray1.physics.sunysb.edu ALL-IN_ONE: CJACOBSEN
*******************
Re: Angstrom symbol [message #4369 is a reply to message #1305] Thu, 25 May 1995 00:00 Go to previous message
Eric Deutsch is currently offline  Eric Deutsch
Messages: 11
Registered: May 1995
Junior Member
abraham@ast.cam.ac.uk (Roberto Abraham) wrote:
> Hi, I'm a new user of IDL so apologies if this is a FAQ (although I
> did do a quick check of the FAQ List so hopefully it isn't!). Can somebody
> tell me how to make IDL print out an Angstrom symbol? It seems to be
> part of the default font table if one knows how to use the ISO
> encoding to specify the character, which unfortunately I don't and can't
> figure out from the documentation.

If you are interested in generating PostScript plots using the printer's
hardware font and hardware Angstrom symbol, my solution to this problem
can be found at

http://www.astro.washington.edu/deutsch/local_IDL.html


If you can't access this site, here's one of the program examples that
is there. The program shows a little bit how to deal with the difference
between vector fonts and printer hardware fonts. Hope this helps...

Eric


; This MAIN_PROGRAM is a demo of how to make publication quality output in
; IDL using Postscript fonts. The program can also be run on X displays
; with the Hershey Triplex font, but special characters will not come out
; looking the same (the price you pay for better quality printed output.)
; See also charsets.pro which prints out the characters sets to the printer.
; Send comments or changes to: deutsch@astro.washington.edu (Eric Deutsch)
;
; You can run this program with something like:
; IDL> setps,/landscape ; direct output to landscape Postscript
; IDL> .run psspecxmpl.pro ; run this program to generate spectrum
; IDL> psclose,auto='sol' ; send output to printer queue sol

wl=indgen(2000)*4+1000 ; generate wavelength array
spec=sin(wl/1850.)*3+4+randomu(seed,2000) ; generate a noisy sine wave

if (!d.name eq 'PS') then begin ; If Postscript output mode
!p.font=0 ; select hardware fonts
device,/helv,/isolatin1 ; Helvetica ISOLatin fontset
ang=string(197B) ; Angstrom sym char string
thk=4 ; thick borders are nice
endif else begin ; If screen or other output mode
!p.font=-1 ; select Hershey fonts
xyouts,0,0,/norm,'!17' ; Set to Triplex Roman font
ang='!3'+string(197b)+'!X' ; only Simplex Angstrom
thk=1 ; use regular thickness
endelse

; Now create the plot. Note that !U is for superscript (Up) and !N is
; for Normal letter sizes.

plot,wl,spec,yr=[0,10],xstyle=1, $
xtitle='Wavelength ('+ang+')', $
ytitle='Flux (10!U-13!N erg cm!U-2!N s!U-1!N '+ang+'!U-1!N)', $
title='Artificial Spectrum', $
xcharsize=1.5, ycharsize=1.5, xthick=thk, ythick=thk

; print a legend-style string with some fancy characters. !9 switches to
; the Postscript Symbol font. !X switches back to the initial font.
; string(nnnB) is a way to generate a string containing a character of
; ASCII value nnn (You NEED the 'B').

xyouts,2000,9,/data,'H!9b!X: !9s '+string(179B)+'!X 4.23'+string(215B)+ $
'10!U-13!N '+string(177B)+' 0.54',charsize=2

; also here's a fancy example of printing world coordinates. !S is save
; a position and !R is to restore to that position.

degsym='!9'+string(176B)+'!X'
minsym='!9'+string(162B)+'!X'
secsym='!S.!R!9'+string(178B)+'!X'

xyouts,2000,8.2,/data,charsize=2,'!9a!X(1950)=15!Uh!N37!Um!N 23!S.!R!Us!N31'+$
' !9d!X(1950)=+56'+degsym+'34'+minsym+'15'+secsym+'2'

end

--
Eric Deutsch
Re: Angstrom symbol [message #4373 is a reply to message #1305] Thu, 25 May 1995 00:00 Go to previous message
soc is currently offline  soc
Messages: 12
Registered: October 1994
Junior Member
Roberto Abraham (abraham@ast.cam.ac.uk) wrote:
: Hi, I'm a new user of IDL so apologies if this is a FAQ (although I
: did do a quick check of the FAQ List so hopefully it isn't!). Can somebody
: tell me how to make IDL print out an Angstrom symbol? It seems to be
: part of the default font table if one knows how to use the ISO
: encoding to specify the character, which unfortunately I don't and can't
: figure out from the documentation.

This probably isnt the easiest way to do it, but I find it useful:
you can use string(194b) - I set it up in my idlstartup as
angst=string(194b). Works on UNIX and VAX Alpha.

Rob O'Connell
Re: Angstrom symbol [message #4384 is a reply to message #1305] Wed, 24 May 1995 00:00 Go to previous message
nicholas is currently offline  nicholas
Messages: 22
Registered: January 1994
Junior Member
I use two different methods:

ang = string(197b)

or

ang = '!6!sA!r!u!9 %!6!n'

The !6 is just my favorite font, !S saves the position, A is the "A"
in angstrom, !r returns to saved position, !u is superscript, !9
changes to math font, ' %' is a space and the degree symbol, !6 back to
my font, !n is normal size. It is a hack but it works.....

-Andy



----------------------------------
Andrew Nicholas
CPI onsite at Naval Research Lab
Code : 7640
(202) 767-9452 voice
(202) 404-8090 fax
nicholas@uap.nrl.navy.mil
-----------------------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: The Key To Organizing Your Health Records
Next Topic: keyword_set bug or feature

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

Current Time: Wed Oct 08 16:01:27 PDT 2025

Total time taken to generate the page: 0.01347 seconds