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

Home » Public Forums » archive » Sun Symbol in Postscript
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
Sun Symbol in Postscript [message #8675] Wed, 09 April 1997 00:00 Go to next message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
Does anyone know how to draw the Sun symbol (a circle with a centered
dot) with a postscript font? This symbol is available under font 9 in
the vector fonts, i.e. sunsymbol = !9n. But I haven't been able to
find it in a postscript font, or to create it with the positioning
commands. (I can't get the dot perfectly centered in the circle.)

Thanks,


Wayne Landsman landsman@mpb.gsfc.nasa.gov
Re: Sun Symbol in Postscript [message #8743 is a reply to message #8675] Fri, 11 April 1997 00:00 Go to previous messageGo to next message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
Wayne Landsman wrote:
>
> Does anyone know how to draw the Sun symbol (a circle with a centered
> dot) with a postscript font? This symbol is available under font 9 in
> the vector fonts, i.e. sunsymbol = !9n. But I haven't been able to
> find it in a postscript font, or to create it with the positioning
> commands.

I have finally found positioning commands that give a reasonable (but
not perfect) representation of the Sun symbol, as in the following
function:

***
function sunsymbol

; Returns the Sun symbol (circle with a dot in the middle)
; as a postscript character string. This is available as a vector
font as
; the string '!9n' but it is not in the standard postscript set. Note
that
; this routine already includes subscript output positioning commands.
; EXAMPLE:
; To make the X-axis of a plot read M/M_Sun
; IDL> plot,indgen(10),xtit = 'M / M' + sunsymbol()


if (!P.FONT EQ -1) or (!D.NAME NE 'PS') then return,'!D!9n!N!X' else
begin

;Want to use /AVANTGARDE,/BOOK which is the default font 17, but to make
sure
;that ISOLATIN encoding is turned off, we'll define our own font.

device,/AVANTGARDE,/BOOK,ISOLATIN=0,FONT_INDEX = 20

return, '!20!S!DO!R!I ' + string(183b) + '!X!N'
endelse
end
***

Jack Saba pointed to me that Sun symbol is the command /odot in TeX, and
so that it
might be possible to use the OUTPUT keyword in DEVICE to output the same
string used
by TeX (after the TeX file is converted to postscript). But I think
that there is no
easy way to tell IDL to use a postscript font other than the "standard
35" available
fonts. Or is there???

--Wayne Landsman
landsman@mpb.gsfc.nasa.gov
Re: Sun Symbol [message #41367 is a reply to message #8675] Tue, 26 October 2004 07:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Joel Vernet writes:

> This is just a shame that there is no option for a 'user font' with True
> Type that would be accessible with !20 like (it should do) in
> postscript. That forces me to replace the default Courier font by the
> Marvosym one to later be able to access it easily.

Just to expand a bit on what Joel means here. In PostScript
you can, in theory, add another PostScript font that you
can access by means of a !Number syntax. For example,
if I had a PostScript font named "Fanning", I could
go into the PostScript device and set it up so that !4
gave me the Fanning font:

Device, Set_Font='fanning', Font_Index=4
Plot, data, Title='This is normal and !4this is fanning!X'

Thus, I could mix font types in a single string, an
essential feature when you are writing papers for
journal publication. (All those pesky Greek symbols,
for example.)

Alas, the FONT_INDEX keyword does not apply to True-Type
fonts. So, the only way to add a True-Type font to IDL
that we have found, is to fake IDL out and substitute
one of our font files for one of theirs in their fonts/tt
directory. Actually, by modifying the ttfont.map file.

It is an ugly solution, to be sure, but we do get
a *great* looking sun symbol (and moon symbols, etc.). :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41368 is a reply to message #8675] Tue, 26 October 2004 07:25 Go to previous message
Joel Vernet is currently offline  Joel Vernet
Messages: 1
Registered: October 2004
Junior Member
Hi,

I found a way to get the sun symbol using the Marvosym True Type font.

1) Install the Marvosym font. You can get the zip file at:
http://www.marvosym.de/marvosym.e.html
Unzip the file an copy the marvosym.ttf file in your IDL TT font
resource directory: $IDL_DIR/resource/fonts/tt

2) Next you have to edit the TT font table named ttfont.map that you
find in the same directory. I decided to replace the Courier font (later
accessible via !11) by the marvosym font:
"Courier" marvosym.ttf 0.675014 1.0

* DON'T FORGET TO MAKE A BACKUP COPY OF YOUR ttfont.map FILE to be able
to go back to IDL default settings if you need to *

On my Linux machine I did not have write access to the idl directory.
So, I made a full copy of it in my home directory and changed the
IDL_DIR environment variable to point to my copy of it.

3) Restart IDL. You can have a look at the Marvosym font with the command:

IDL> showfont,'Courier','Marvosym',/TT

The sun symbol is string(192b) in this font. You can use it in a plot
title like this:


IDL> plot, findgen(100), xtitle='Mass
[M!i!11'+string(192b)+'!X!n]',chars=2, font=1

This is device independent. Works exactly the same in PS, WIN and X.

The nice thing about the marvosym fon is that it has a few other
astronomical symbols.

This is just a shame that there is no option for a 'user font' with True
Type that would be accessible with !20 like (it should do) in
postscript. That forces me to replace the default Courier font by the
Marvosym one to later be able to access it easily.

Joel
Re: Sun Symbol [message #41373 is a reply to message #8675] Mon, 25 October 2004 22:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> The best solution would be for RSI to collect a useful math and
> other symbols Truetype font to match their vector font, and distribute it
> with IDL. All of those symbols are freely available, so I think it's just
> a matter of them doing so.

There are days when I think their policy is to
rely on their community to do this kind of work
for them. Do you know how many times in the past
month I have mentioned the Astro Library, MPFIT,
and IDLWAVE! And the question that is inevitably
asked me when I point these resources out is,
"Why isn't this stuff distributed with IDL?"

Good question.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41376 is a reply to message #8675] Mon, 25 October 2004 15:15 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 25 Oct 2004 15:07:04 -0600, David Fanning wrote:

> Wayne Landsman writes:
>
>> P.S. My solution to the Sun symbol postscript font problem has been to
>> use the kluge in sunsymbol.pro which displays the inner dot slightly
>> offcenter. If you print it small enough, no-one will notice...
>
> Yeah, I think the same thing applies to graphics in general.
> But that's, uh, only usually done if we have less than 50%
> confidence in the results. :-)
>
> Cheers,
>
> David
>
> P.S. Thanks everyone. I've finally concluded there is
> no PostScript solution on the horizon, and it is LATE
> here. Going to bed...

The best solution would be for RSI to collect a useful math and
other symbols Truetype font to match their vector font, and distribute it
with IDL. All of those symbols are freely available, so I think it's just
a matter of them doing so.

JD
Re: Sun Symbol [message #41381 is a reply to message #8675] Mon, 25 October 2004 14:07 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wayne Landsman writes:

> P.S. My solution to the Sun symbol postscript font problem has been to
> use the kluge in sunsymbol.pro which displays the inner dot slightly
> offcenter. If you print it small enough, no-one will notice...

Yeah, I think the same thing applies to graphics in general.
But that's, uh, only usually done if we have less than 50%
confidence in the results. :-)

Cheers,

David

P.S. Thanks everyone. I've finally concluded there is
no PostScript solution on the horizon, and it is LATE
here. Going to bed...

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41382 is a reply to message #8675] Mon, 25 October 2004 13:31 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
> Postscript output (with default vector fonts) and Postscript output (with
> Postscript fonts) are two different things.

Besides explaining why Craig was able to get a Sun symbol in postscript
output from textoidl (i.e. he wasn't using Postscript fonts, !p.font=0)
this may also explain David's difficulty switching fonts to incorporate
a unicode glyph with truetype fonts:

********
>All ideas welcome. I don't even think my font_index
>code is switching to wingdings, because if I print
>text I get helvetica looking character, not wingdings.

According to the documentation, the FONT_INDEX keyword to DEVICE only
works with the POSTSCRIPT device. Perhaps this means that it can only
be used with POSTSCRIPT fonts - and not with truetype fonts? At
least I haven't be able to successfully use FONT_INDEX to switch any
truetype or vector fonts.

If this is true, then probably DEVICE needs to give a warning if the
user tries to set both /TT_FONT and FONT_INDEX.

--Wayne

P.S. My solution to the Sun symbol postscript font problem has been to
use the kluge in sunsymbol.pro which displays the inner dot slightly
offcenter. If you print it small enough, no-one will notice...
Re: Sun Symbol [message #41383 is a reply to message #8675] Mon, 25 October 2004 12:50 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Paul Van Delst writes:
>> I resorted to using !DSolar!N long ago since I could never get the Sun Symbol to work
>> right across different IDL installations and platforms.
>
> Yeah, not exactly what I hoped to hear, however. :-(

Fret not. I only tried to get the solar symbol for about 30 minutes after which I thought
I'd better get back to regular work. I don't work with astronomers so it wasn't a very big
deal for me, but I hear their lot can be quite picky about this stuff, though..... :o)

paulv
Re: Sun Symbol [message #41384 is a reply to message #8675] Mon, 25 October 2004 12:46 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Marshall Perrin wrote:
> David Fanning <david@dfanning.com> wrote:
>
>> And here is what I get, both on my display and in
>> my PostScript file.
>>
>> http://www.dfanning.com/misc/mdot.jpg
>>
>> What do you make of that!? I think that is what
>> all of us here are seeing. I did this on a Windows
>> machine. I'll have to wait for tomorrow to try it
>> on a Linux machine.
>
>
> Not that this is a surprise, but the output on both Mac OS and Solaris
> looks identical to that.

And my example on a linux box (RH WSE 3.0) looked like that also.

paulv
Re: Sun Symbol [message #41385 is a reply to message #8675] Mon, 25 October 2004 12:29 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Craig Markwardt <craigmnet@REMOVEcow.physics.wisc.edu> writes:
>> Craig, care to share your magical version that *does* work?
>
> Heh, this is embarassing, but I am using version 1.4, dated 1996 !!!

Wierd, the plot gets thicker. I must have made my own version of
textoidl some time ago.

In textable.pro, I added one symbol to the last table, after \circ:

...
[ '\circ', "%" , string(byte(176)) ],$
[ '\odot', 'n' , 'O' ]$

and that did the trick. I should have sent something to Matthew Craig.

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Sun Symbol [message #41386 is a reply to message #8675] Mon, 25 October 2004 12:30 Go to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
David Fanning <david@dfanning.com> wrote:
> And here is what I get, both on my display and in
> my PostScript file.
>
> http://www.dfanning.com/misc/mdot.jpg
>
> What do you make of that!? I think that is what
> all of us here are seeing. I did this on a Windows
> machine. I'll have to wait for tomorrow to try it
> on a Linux machine.

Not that this is a surprise, but the output on both Mac OS and Solaris
looks identical to that.

- Marshall
Re: Sun Symbol [message #41387 is a reply to message #8675] Mon, 25 October 2004 11:52 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 25 Oct 2004 12:22:26 -0600, David Fanning wrote:

> Craig writes:
>
>>> Are you using some froofy truetype fonts?
>
> You can't believe what people will try when their fingers
> are in knots and they are totally frustrated with Emacs. :-(

The best thing you can do for you emacs feng shui is to swap the caps lock
and control characters, and never look back.

I can get a sun symbol like:

xyouts,.5,.5,'!9!Z(6E)!X',/NORMAL,CHARSIZE=5

But only with vector Hershey fonts (with FONT=1, it's a lowercase nu).

JD
Re: Sun Symbol [message #41388 is a reply to message #8675] Mon, 25 October 2004 11:55 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Marshall Perrin writes:

> Try your plot again with !9n!X after setting !p.font=-1, 0, or 1 and
> you'll see the difference.

Believe me, I've tried it every which way. But Craig
must have a different version of something than we
do here. :-(

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41389 is a reply to message #8675] Mon, 25 October 2004 11:54 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul Van Delst writes:

> Huh. This is what I get:
>
> IDL> print, textoidl('M_\odot')
> M!D\!Nodot
>
> Same whether !p.font = -1 or 1. If it's 0, then I get
>
> IDL> !p.font=0
> IDL> print, textoidl('M_\odot')
> Warning: No translation for device: X
> M_\odot
>
> Doesn't matter if it's onscreen or to PS output either.
>
>
> IDL> doclibrary, 'textoidl'
>
> gives me:
>
> MODIFICATION HISTORY:
> $Id: textoidl.pro,v 1.7 2004/06/15 17:25:54 mcraig Exp $
> $Log: textoidl.pro,v $
> Revision 1.7 2004/06/15 17:25:54 mcraig
> Fixed bug in regular expression, changed array notation to square brackets
>
> and
>
> RELEASE:
> $Name: Rel_2_1_2 $
>
> Do you have a later (or earlier) release?

Alright, gentlemen, this is a conundrum. Here is what I have:

; MODIFICATION HISTORY:
; $Id: textoidl.pro,v 1.7 2004/06/15 17:25:54 mcraig Exp $
; $Log: textoidl.pro,v $
; Revision 1.7 2004/06/15 17:25:54 mcraig
;
; RELEASE:
; $Name: Rel_2_1_2 $

Here is what I did. Enter a fresh IDL session. Type
this command:

IDL> plot, findgen(100), xtitle=textoidl('M_\odot')

And here is what I get, both on my display and in
my PostScript file.

http://www.dfanning.com/misc/mdot.jpg

What do you make of that!? I think that is what
all of us here are seeing. I did this on a Windows
machine. I'll have to wait for tomorrow to try it
on a Linux machine.

> I resorted to using !DSolar!N long ago since I could never get the Sun Symbol to work
> right across different IDL installations and platforms.

Yeah, not exactly what I hoped to hear, however. :-(

Cheers,

David


--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41390 is a reply to message #8675] Mon, 25 October 2004 11:50 Go to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
Ben Panter <me@privacy.net> wrote:
> David Fanning wrote:
>
>> Maybe I have my fonts totally screwed up now, but
>> when I look at the PostScript output with Ghostview,
>> it looks less like a circle with a dot, and more like
>> someone hit you in the arm as you were starting to write
>> your name. :-(
>
> Hmmm. I've always had problems getting the windows gv thing to give me
> nice looking output, but it usually comes out ok on the page when you
> print it. If you zoom in does it still look naff? Failing that, have you
> tried using the linux gv on the output? I think that has antianilasing
> stuff switched on by default.

Postscript output (with default vector fonts) and Postscript output (with
Postscript fonts) are two different things. This is something I've only
recently learned myself - you control which font family is currently in
use with !p.font. The Postscript fonts are far higher quality than the
vector fonts, so I've started switching over to use them myself (See, David,
at least some astronomers *are* trying to keep up with this modern newfangled
stuff! :-) However, in some cases the symbols available in vector fonts don't
match those available in Postscript fonts, the sun symbol being one such case.

Try your plot again with !9n!X after setting !p.font=-1, 0, or 1 and
you'll see the difference.

- Marshall
Re: Sun Symbol [message #41391 is a reply to message #8675] Mon, 25 October 2004 11:36 Go to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
Paul Van Delst <paul.vandelst@noaa.gov> wrote:
> Huh. This is what I get:
>
> IDL> print, textoidl('M_\odot')
> M!D\!Nodot
>
...
> RELEASE:
> $Name: Rel_2_1_2 $

I get the same result as you. According to Matt Craig's web page, 2.1.2 is
the latest version, released this past June.

Craig, care to share your magical version that *does* work?

- Marshall
Re: Sun Symbol [message #41392 is a reply to message #8675] Mon, 25 October 2004 11:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig writes:

>> Are you using some froofy truetype fonts?

You can't believe what people will try when their fingers
are in knots and they are totally frustrated with Emacs. :-(

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41393 is a reply to message #8675] Mon, 25 October 2004 11:18 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> David, if I do the following
>
> plot, findgen(100), xtitle=textoidl('M_\odot')
>
> it looks fine on both the X console and in postscript output. I am
> using default everything, no strange fonts.
>
> Are you using some froofy truetype fonts?

No, I'm mostly listening, rather than testing. :-)
Let me go check this out. I think I have the
latest version of textoidl, but maybe the 10
people who told me they tried it and it doesn't
work don't. :-)

Mostly, if it's not at least 20 years old, we don't
want any of it in astronomy. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41394 is a reply to message #8675] Mon, 25 October 2004 11:02 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Craig Markwardt wrote:
> David Fanning <david@dfanning.com> writes:
>
>>> M_\odot - not sure if this works with textoidl though
>>
>> No, it doesn't. One of our problems. :-(
>
>
> Huh???
>
> David, if I do the following
>
> plot, findgen(100), xtitle=textoidl('M_\odot')
>
> it looks fine on both the X console and in postscript output. I am
> using default everything, no strange fonts.
>
> Are you using some froofy truetype fonts?

Huh. This is what I get:

IDL> print, textoidl('M_\odot')
M!D\!Nodot

Same whether !p.font = -1 or 1. If it's 0, then I get

IDL> !p.font=0
IDL> print, textoidl('M_\odot')
Warning: No translation for device: X
M_\odot

Doesn't matter if it's onscreen or to PS output either.


IDL> doclibrary, 'textoidl'

gives me:

MODIFICATION HISTORY:
$Id: textoidl.pro,v 1.7 2004/06/15 17:25:54 mcraig Exp $
$Log: textoidl.pro,v $
Revision 1.7 2004/06/15 17:25:54 mcraig
Fixed bug in regular expression, changed array notation to square brackets

and

RELEASE:
$Name: Rel_2_1_2 $

Do you have a later (or earlier) release?

I resorted to using !DSolar!N long ago since I could never get the Sun Symbol to work
right across different IDL installations and platforms.

paulv
Re: Sun Symbol [message #41396 is a reply to message #8675] Mon, 25 October 2004 10:36 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
David Fanning <david@dfanning.com> writes:
>
>> M_\odot - not sure if this works with textoidl though
>
> No, it doesn't. One of our problems. :-(

Huh???

David, if I do the following

plot, findgen(100), xtitle=textoidl('M_\odot')

it looks fine on both the X console and in postscript output. I am
using default everything, no strange fonts.

Are you using some froofy truetype fonts?
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Sun Symbol [message #41399 is a reply to message #8675] Mon, 25 October 2004 09:21 Go to previous message
Ben Panter is currently offline  Ben Panter
Messages: 102
Registered: July 2003
Senior Member
David Fanning wrote:

> Maybe I have my fonts totally screwed up now, but
> when I look at the PostScript output with Ghostview,
> it looks less like a circle with a dot, and more like
> someone hit you in the arm as you were starting to write
> your name. :-(

Hmmm. I've always had problems getting the windows gv thing to give me
nice looking output, but it usually comes out ok on the page when you
print it. If you zoom in does it still look naff? Failing that, have you
tried using the linux gv on the output? I think that has antianilasing
stuff switched on by default.

> Looks OK in vector fonts, and this is what sunsymbol.pro
> from the Astro library does too.

Ah. I think I probably always use vector fonts then. Another thing to
unlearn...

Ben

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ben Panter, Edinburgh, UK
email is false. Use my name (no spaces) at bigfoot which is a com.
Re: Sun Symbol [message #41400 is a reply to message #8675] Mon, 25 October 2004 09:12 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ben Panter writes:

> I always use M!l!9n!x!n which seems to work pretty well [in postscript
> output of course... and onscreen it looks ok to me with simplex fonts]

Maybe I have my fonts totally screwed up now, but
when I look at the PostScript output with Ghostview,
it looks less like a circle with a dot, and more like
someone hit you in the arm as you were starting to write
your name. :-(

Looks OK in vector fonts, and this is what sunsymbol.pro
from the Astro library does too.

> M_\odot - not sure if this works with textoidl though

No, it doesn't. One of our problems. :-(

Let me ask another question. Has anyone got PostScript
to accept a unicode glyph, such as !Z(164)? I have ISOLATIN1
turned on. I am trying to switch to a Wingding true-type font
that has this symbol. The Unicode on the Wingding character map
is 0xA4, which I read as 164. Is this correct? Here is the code
I'm tying to use. I get this message when I use it:

% PLOT: Invalid graphtext command: ...!Z('00a4'xL)!X

Same thing happens when I try !Z(164).

Code:

Set_Plot, 'PS'
device, _Extra=psconfig(/nogui)
device, filename='sunsymbol.ps', /isolatin1
device, set_font='wingdings', /tt_font, font_index = 8
device, set_font='helvetica', /tt_font
Plot, findgen(11), xTitle="This is Sun Symbol M!8!Z(00a4'xL)!X", $
Title='This is the x title', YTitle='This is the Y title', font=0
Device, /Close

All ideas welcome. I don't even think my font_index
code is switching to wingdings, because if I print
text I get helvetica looking character, not wingdings.

I'm confused...

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Re: Sun Symbol [message #41401 is a reply to message #8675] Mon, 25 October 2004 09:09 Go to previous message
marcuirl is currently offline  marcuirl
Messages: 14
Registered: December 2003
Junior Member
David Fanning <david@dfanning.com> writes:

> I'm asked about every 10 minutes around here how to
> get a good looking sun symbol on IDL plots. A sun
> symbol is a circle with a dot in the center of it.
> Usually you subscript a capital M with it, and it
> represents the mass of the sun, a standard astronomical
> unit.
>
> I've read the back issues of the IDL newsgroup (which are
> bound in leather on my shelves), and I've seen Wayne Landsman's
> sunsymbol.pro in the Astro Library (how in the world
> does anyone do any astronomy without Wayne's Library!?),
> but I thought I would ask if there is any news I may
> have overlooked.
>
> Or, how is the world does LaTeX do it? They seem
> to get it right, but we can't seem to work it out as
> nicely.

On the side of IDL I can't help much on this but for LaTeX that would
be with the \astrosun obviously (-;

n.b. you need \usepackage{wasysym} in the preamble

The link below directs to a 2.3Mb PDF file in CTAN (Tex repository)
for all the symbols you could ever think or dream of using!

http://tinyurl.com/5583t

HTH

marcu
--
Unless otherwise noted, the statements herein reflect my
personal opinions and not those of any organisation with
which I may be affiliated.
Re: Sun Symbol [message #41402 is a reply to message #8675] Mon, 25 October 2004 08:51 Go to previous message
Ben Panter is currently offline  Ben Panter
Messages: 102
Registered: July 2003
Senior Member
David Fanning writes:

> I'm asked about every 10 minutes around here how to
> get a good looking sun symbol on IDL plots. A sun
> symbol is a circle with a dot in the center of it.
> Usually you subscript a capital M with it, and it
> represents the mass of the sun, a standard astronomical
> unit.

I always use M!l!9n!x!n which seems to work pretty well [in postscript
output of course... and onscreen it looks ok to me with simplex fonts]

I find that http://astron.berkeley.edu/~sdawson/idlfonts.html is a
really useful source for looking up what's what with these sort of things.

> Or, how is the world does LaTeX do it? They seem
> to get it right, but we can't seem to work it out as
> nicely.

M_\odot - not sure if this works with textoidl though

Ben


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ben Panter, Garching, Germany
email via www.benpanter.co.uk
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Installing PostScript Fonts in IDL
Next Topic: 2D scatter-density plotting

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

Current Time: Wed Oct 08 09:18:50 PDT 2025

Total time taken to generate the page: 0.00686 seconds