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

Home » Public Forums » archive » Re: IDL Fonts
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
Re: IDL Fonts [message #50999] Wed, 01 November 2006 18:36 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jared Espley writes:

> I was left with strings that looked this:
> '!7d!17B!D!M!!!M!!!N/!7d!17B!D!9x!17!N' but hey life's not perfect.

You are thinking of this in the wrong way. Think
of it as "job security" and it makes a lot more
sense to you. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL Fonts [message #51000 is a reply to message #50999] Wed, 01 November 2006 18:27 Go to previous messageGo to next message
Jared Espley is currently offline  Jared Espley
Messages: 17
Registered: February 2006
Junior Member
David Fanning wrote:
> Symbols in Postscript usually require UNICODE characters.
> Here is an article that explains the situation in a lot
> more detail:
>
> http://www.dfanning.com/graphics_tips/lesign.html

Thanks for the quick and helpful response, David. Everything you said
seemed to be spot on except for some quibbles I have with your tutorial
you link above. I found that I could not get the specific unicode
characters I wanted using the !z trick for any of the truetype fonts I
had on my Windows XP system. Specifically, I was trying to get the
perpendicular symbol (unicode 22A5) to show up -- instead I just got a
square. I could get less-than-equal as per your example. Thus, I
think that the fonts may not have been fully unicode compliant so the
fault doesn't really lie with your tutorial.

Thus, I found myself back to using the vector fonts in the end. At
least they look better in .ps than they do on the screen. Furthermore,
I found that if I used triplex roman (!17) instead of single roman (!3)
things looked much better -- in fact, very professional looking. I was
left with strings that looked this:
'!7d!17B!D!M!!!M!!!N/!7d!17B!D!9x!17!N' but hey life's not perfect. In
end, after all my wailing and gnashing of teeth, I was able to make a
nice "publication" quality figure with vectors fonts as .ps output.

In any case, thanks again for your help and all you do for the IDL
community.

Jared
Re: IDL Fonts [message #51002 is a reply to message #51000] Wed, 01 November 2006 12:29 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jared Espley writes:

> I have a few questions that I haven't been able to answer with some
> digging around on the web and in the IDL help files so maybe someone
> can help. The background on my question is that I'm trying to produce
> a "publication" quality plot using IDL and I intend to either make a
> .tif from a screen capture using tvread.pro
> (http://www.dfanning.com/programs/pswindow.pro) or a color .eps using
> postscript output. I'm using IDL 6.2 on Windows XP.
>
> 1. Has anyone been able to get True Type fonts (i.e. !p.font=1) to look
> ok on the screen?

No. This is an item with a long history, but I think I can
say with some assurance that direct graphics fonts will NEVER
look good on the screen. To make them look good requires bitmaps,
apparently, and IDL direct graphics does not have the machinery
to manipulate bitmaps quickly. OpenGL *does* have the machinery,
which is why screen fonts can (and do) look good in object
graphics programs.

> 2. Has anyone been able to get device fonts (i..e !p.font=0) to work
> correctly with vertical axis labels on the screen?

No, screen fonts do not rotate on your display. They rotate
in PostScript, but only in the XY plane, not in 3D.

> 3. Assuming I could get the fonts to work correctly, how do I get
> special symbols? For example, using vector fonts, I would type,
> "title='!4d!B'" to get little delta B -- how can I do this with the
> other font styles?

Symbols in Postscript usually require UNICODE characters.
Here is an article that explains the situation in a lot
more detail:

http://www.dfanning.com/graphics_tips/lesign.html

> 4. How come when I make sure that my plot size is the same on both the
> output window on my monitor and in the postscript output (by using
> David Fanning's pswindow.pro
> http://www.dfanning.com/programs/pswindow.pro) then I still have to
> adjust the positions of my plots, colorbars, etc. to make both outputs
> look the same?

Humm. Not sure about this. Probably because your
programs are written incorrectly. I've never found
this to be a problem. Are you trying to position things
in Device coordinates? That would wreak havoc.

> 5. It appears that the color output of the .eps file I make has very
> discrete color levels (about 10 or so) compared to the fairly smooth
> continuum I see when I output to a window on the screen. Is this a
> fundamental limit of postscript or am I doing something wrong?

This is something you are doing wrong. Probably you set the COLOR=1
keyword, but forgot the BITS_PER_PIXEL=8 keyword for the DEVICE
command.

Since you are already using PSWINDOW and other programs, why
not just use PSCONFIG to get your PostScript page set up.
Then most of these problems will be avoided.

keywords = PSCONFIG(_Extra=PSWINDOW(), Cancel=cancelled)
IF ~cancelled THEN BEGIN
thisDevice = !D.Name
Set_Plot, 'PS'
Device, _Extra=keywords
YourPlotHere
Device, /Close
Set_Plot, thisDevice
ENDIF


Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL Fonts [message #51003 is a reply to message #51002] Wed, 01 November 2006 12:24 Go to previous messageGo to next message
Jared Espley is currently offline  Jared Espley
Messages: 17
Registered: February 2006
Junior Member
> 3. Assuming I could get the fonts to work correctly, how do I get
> special symbols? For example, using vector fonts, I would type,
> "title='!4d!B'" to get little delta B -- how can I do this with the
> other font styles?

First I made a typo here -- it should say: title='!4d!3B'

Answering my own question:
For Truetype, there are 4 fonts instead of the 20 vector ones. The
commands are the same but one has to look up the exact truetype font
being used since the numbers don't necessarily correspond between
truetype and vector.

For device fonts, the IDL manual states:
"Embedded formatting commands prefaced by the exclamation mark have no
special significance for hardware-generated characters unless the
ability is provided by the particular device in use. The IDL PostScript
device driver accepts many of the standard embedded formatting
commands, and is described here. If you wish to use hardware fonts with
IDL Direct Graphics devices other than the PostScript device [like
'win'], consult the description of the device in IDL Direct Graphics
Devices before trying to use these commands with hardware characters."
Since the entry on 'win' is sparse to say the least, I think we're on
our own.
Re: IDL Fonts [message #51086 is a reply to message #51000] Thu, 02 November 2006 07:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jared Espley writes:

>> Symbols in Postscript usually require UNICODE characters.
>> Here is an article that explains the situation in a lot
>> more detail:
>>
>> http://www.dfanning.com/graphics_tips/lesign.html
>
> Thanks for the quick and helpful response, David. Everything you said
> seemed to be spot on except for some quibbles I have with your tutorial
> you link above. I found that I could not get the specific unicode
> characters I wanted using the !z trick for any of the truetype fonts I
> had on my Windows XP system. Specifically, I was trying to get the
> perpendicular symbol (unicode 22A5) to show up -- instead I just got a
> square.

Well, I am using the same Windows XP and IDL 6.2 system you
are, and I find that unicode 22A5 is for a box! The perpendicular
line is listed as unicode 007C. This code worked for me.

device, set_font='Times New Roman', /tt_font
thisDevice = !D.Name
set_plot, 'ps'
device, xsize=5, ysize=1, /inches, filename='test.ps', /isolatin1
xyouts, 0.5, 0.5, /normal, charsize=2, align=0.5, $
'Straight bar (!Z(007C)) sign.'
device, /close
set_plot, thisDevice

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Naming batch files and main-level programs
Next Topic: Re: printing hexadecimal

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

Current Time: Thu Oct 09 06:56:46 PDT 2025

Total time taken to generate the page: 1.43885 seconds