Re: Text Formatting with TexToIDL [message #47568] |
Wed, 15 February 2006 21:27 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Craig Markwardt writes:
> But here's an interesting tidbit. The PS and TrueType symbol fonts
> are close enough that one can switch to Postscript mode and get the
> desired effect:
>
> set_plot, 'ps'
> str = textoidl(' \lambda_{1} (nm)', font=0)
> set_plot, 'x'
> text = obj_new('idlgrtext', str, ENABLE_FORMATTING=1)
> xobjview, text
>
> Major-kludge, but it suggests that a modification to textoidl() would
> be fairly straightforward.
I've suggested to the person who passed this information along
to me that he get in touch with Matt Craig and offer to help
fix this up, but so far stone silence on the other end. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Text Formatting with TexToIDL [message #47569 is a reply to message #47568] |
Wed, 15 February 2006 15:29  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Craig Markwardt <craigmnet@REMOVEcow.physics.wisc.edu> writes:
> David, the problem is that the font sets and character encodings for
> the TrueType and PostScript fonts are totally different than the
> direct graphics Hershey fonts. textoidl() only knows about the
> Hershey fonts. Somebody would have to re-write a part of textoidl()
> to handle the new encodings.
But here's an interesting tidbit. The PS and TrueType symbol fonts
are close enough that one can switch to Postscript mode and get the
desired effect:
set_plot, 'ps'
str = textoidl(' \lambda_{1} (nm)', font=0)
set_plot, 'x'
text = obj_new('idlgrtext', str, ENABLE_FORMATTING=1)
xobjview, text
Major-kludge, but it suggests that a modification to textoidl() would
be fairly straightforward.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Text Formatting with TexToIDL [message #47570 is a reply to message #47569] |
Wed, 15 February 2006 15:21  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
David Fanning <davidf@dfanning.com> writes:
> Folks,
>
> Here is a straightforward string using TexToIDL:
>
> IDL> xyouts, 0.5, 0.5, charsize=2.5, align=0.5, /normal, $
> textoidl(' \lambda_{1} (nm)')
> IDL> Print, textoidl(' \lambda_{1} (nm)')
> !7k!X!D1!N (nm)
>
> Just what I want. But...I want it in object graphics:
>
> IDL> string = textoidl(' \lambda_{1} (nm)')
> IDL> text = obj_new('idlgrtext', string, ENABLE_FORMATTING=1)
> IDL> xobjview, text
>
> NOT what I want. :-(
>
> What good is it to enable formatting if I'm going to get something
> completely different!?
David, the problem is that the font sets and character encodings for
the TrueType and PostScript fonts are totally different than the
direct graphics Hershey fonts. textoidl() only knows about the
Hershey fonts. Somebody would have to re-write a part of textoidl()
to handle the new encodings.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: Text Formatting with TexToIDL [message #47575 is a reply to message #47570] |
Wed, 15 February 2006 14:29  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> Folks,
>
> Here is a straightforward string using TexToIDL:
>
> IDL> xyouts, 0.5, 0.5, charsize=2.5, align=0.5, /normal, $
> textoidl(' \lambda_{1} (nm)')
> IDL> Print, textoidl(' \lambda_{1} (nm)')
> !7k!X!D1!N (nm)
>
> Just what I want. But...I want it in object graphics:
>
> IDL> string = textoidl(' \lambda_{1} (nm)')
> IDL> text = obj_new('idlgrtext', string, ENABLE_FORMATTING=1)
> IDL> xobjview, text
>
> NOT what I want. :-(
>
> What good is it to enable formatting if I'm going to get something
> completely different!?
>
> Any ideas?
This works:
IDL> s2='!Ml!X!D1!N (nm)'
IDL> text = obj_new('idlgrtext', s2, ENABLE_FORMATTING=1)
IDL> xobjview, text
I have similar problems with PS output in DG (i.e the difference between on screen chars
and PS output when !p.font=1) but it happens rarely enough that I've never bothered to
figure it out for good.
paulv
p.s. To have the character "k" correspond to lambda in the IDL font list/whatever makes no
sense (to me at least).
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
|
|
|