True-Type Font Confusion [message #84479] |
Fri, 24 May 2013 07:42 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I've spent a couple of confusing hours this morning trying to understand
true-type font handling in IDL on Windows computers for an article I'd
like to write. I don't have time to write the article now, but I thought
I would jot a few observations down in case I ever get back to it.
The name of the font in the Windows/Fonts directory is NOT the name of
the font you want to use when you are selecting the true-type font for
use in IDL. To get the font name you want to use, get a list of the font
names from the Device command:
IDL> Device, Get_FontName=names, Set_Font='*'
The font you want to use must be a true-type font. It cannot be an
OpenType font, even though OpenType font names will appear in the names
you just downloaded! To find out if this is a true-type font, you can
right click on a font in the Windows/Fonts folder and use the Properties
button to check its name. You want fonts that have a *.ttf extension.
You cannot use fonts that have an *.otf extension.
If you right click on a font family, rather than a single font, you will
not find the Properties button. You will have to open these fonts in the
Windows Font Viewer and look for the name at the top of the (many!)
windows that open.
If you get the name right, and you have a true-type font, then there is
no need to modify the ttfont.map file in the IDL resources/font/tt
directory. You can use the true-type font directly by just making it the
default true-type font. For example:
cgSet_TTFont, 'Vladimir Script'
Sadly, if you purchase a font from somewhere, that font is almost always
an OpenType font. True-Type fonts are pretty old technology. As far as I
can determine, OpenType fonts are not supported in IDL. (Does anyone
know if this is true or not?)
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.")
|
|
|