Dot miscentered in \sun symbol of cgsymbol? [message #89803] |
Thu, 04 December 2014 04:03  |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
When I use the \sun symbol in cgplot titles with output to a pdf file, it comes out with the dot not centered in the ring. Is there something I can do about that? I usually use it as a subscript but just the symbol by itself also has this problem.
Here is an example:
IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
This is my output:
http://www.isf.astro.su.se/~mats/test.pdf
Is there something I can do about that? I currently don't set the ps_font to anything, would this maybe work better with a font other than the default?
/Mats
|
|
|
Re: Dot miscentered in \sun symbol of cgsymbol? [message #89804 is a reply to message #89803] |
Thu, 04 December 2014 05:02   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mats Löfdahl writes:
>
> When I use the \sun symbol in cgplot titles with output to a pdf file, it comes out with the dot not centered in the ring. Is there something I can do about that? I usually use it as a subscript but just the symbol by itself also has this problem.
>
> Here is an example:
>
> IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
>
> This is my output:
>
> http://www.isf.astro.su.se/~mats/test.pdf
>
> Is there something I can do about that? I currently don't set the ps_font to anything, would this maybe work better with a font other than the default?
Try this:
IDL> cgset_ttfont, 'dejavusans'
IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Dot miscentered in \sun symbol of cgsymbol? [message #89806 is a reply to message #89804] |
Thu, 04 December 2014 05:53   |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den torsdagen den 4:e december 2014 kl. 14:02:08 UTC+1 skrev David Fanning:
> Mats Löfdahl writes:
>
>>
>> When I use the \sun symbol in cgplot titles with output to a pdf file, it comes out with the dot not centered in the ring. Is there something I can do about that? I usually use it as a subscript but just the symbol by itself also has this problem.
>>
>> Here is an example:
>>
>> IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
>>
>> This is my output:
>>
>> http://www.isf.astro.su.se/~mats/test.pdf
>>
>> Is there something I can do about that? I currently don't set the ps_font to anything, would this maybe work better with a font other than the default?
>
> Try this:
>
> IDL> cgset_ttfont, 'dejavusans'
> IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
Thanks Dave.
That made the sun symbol look right, but now it doesn't respond to subscripting:
IDL> cgset_ttfont, 'dejavusans'
IDL> cgplot, [0, 1], [0, 1], xtitle = 'R$\sub$$\sun$', output = 'test.pdf'
The new version of test.pdf is now at the same url as before: http://www.isf.astro.su.se/~mats/test.pdf
/Mats
|
|
|
Re: Dot miscentered in \sun symbol of cgsymbol? [message #89807 is a reply to message #89806] |
Thu, 04 December 2014 05:59   |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
On Thursday, December 4, 2014 2:54:00 PM UTC+1, Mats Löfdahl wrote:
> Den torsdagen den 4:e december 2014 kl. 14:02:08 UTC+1 skrev David Fanning:
>> Mats Löfdahl writes:
>>
>>>
>>> When I use the \sun symbol in cgplot titles with output to a pdf file, it comes out with the dot not centered in the ring. Is there something I can do about that? I usually use it as a subscript but just the symbol by itself also has this problem.
>>>
>>> Here is an example:
>>>
>>> IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
>>>
>>> This is my output:
>>>
>>> http://www.isf.astro.su.se/~mats/test.pdf
>>>
>>> Is there something I can do about that? I currently don't set the ps_font to anything, would this maybe work better with a font other than the default?
>>
>> Try this:
>>
>> IDL> cgset_ttfont, 'dejavusans'
>> IDL> cgplot, [0, 1], [0, 1], xtitle = '$\sun$', output = 'test.pdf'
>
> Thanks Dave.
>
> That made the sun symbol look right, but now it doesn't respond to subscripting:
>
> IDL> cgset_ttfont, 'dejavusans'
> IDL> cgplot, [0, 1], [0, 1], xtitle = 'R$\sub$$\sun$', output = 'test.pdf'
>
> The new version of test.pdf is now at the same url as before: http://www.isf.astro.su.se/~mats/test.pdf
>
> /Mats
plot(/TEST,xtitle = 'R$_{\Sun}$')
|
|
|
|
Re: Dot miscentered in \sun symbol of cgsymbol? [message #89811 is a reply to message #89806] |
Thu, 04 December 2014 06:41   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mats Löfdahl writes:
> That made the sun symbol look right, but now it doesn't respond to subscripting:
>
> IDL> cgset_ttfont, 'dejavusans'
> IDL> cgplot, [0, 1], [0, 1], xtitle = 'R$\sub$$\sun$', output = 'test.pdf'
>
> The new version of test.pdf is now at the same url as before: http://www.isf.astro.su.se/~mats/test.pdf
This needs to be explained better in the documentation, but construct
your string like this:
cgset_ttfont, 'dejavusans'
cgplot, [0, 1], [0, 1], xtitle = 'R$\sub\\sun$', output = 'test.pdf'
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Dot miscentered in \sun symbol of cgsymbol? [message #89813 is a reply to message #89811] |
Thu, 04 December 2014 07:00   |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den torsdagen den 4:e december 2014 kl. 15:41:21 UTC+1 skrev David Fanning:
>
> This needs to be explained better in the documentation, but construct
> your string like this:
>
> cgset_ttfont, 'dejavusans'
> cgplot, [0, 1], [0, 1], xtitle = 'R$\sub\\sun$', output = 'test.pdf'
Yes, beautiful! Thanks a lot.
/Mats
|
|
|
Re: Dot miscentered in \sun symbol of cgsymbol? [message #89822 is a reply to message #89811] |
Fri, 05 December 2014 05:46  |
JDS
Messages: 94 Registered: March 2009
|
Member |
|
|
On Thursday, December 4, 2014 3:41:21 PM UTC+1, David Fanning wrote:
> Mats Löfdahl writes:
>
>> That made the sun symbol look right, but now it doesn't respond to subscripting:
>>
>> IDL> cgset_ttfont, 'dejavusans'
>> IDL> cgplot, [0, 1], [0, 1], xtitle = 'R$\sub$$\sun$', output = 'test.pdf'
>>
>> The new version of test.pdf is now at the same url as before: http://www.isf.astro.su.se/~mats/test.pdf
>
> This needs to be explained better in the documentation, but construct
> your string like this:
>
> cgset_ttfont, 'dejavusans'
> cgplot, [0, 1], [0, 1], xtitle = 'R$\sub\\sun$', output = 'test.pdf'
>
Wow! This fixes an issue that has persisted 20 years in direct graphics. For those of us still stuck on then even more ancient PODG (plain-ole-direct-graphics), you can invoke the DejaVuSans font using the formatting code !10. E.g.:
xyouts,.5,.5,/normal,'M!D!10!Z(2299)!X!N',CHARSIZE=2,FONT=1
I see now that sunsymbol.pro has updated, using the more astronomically correct symbol at !Z(2609). Either works (pick your favorite).
|
|
|