Fonts in IDL Direct vs. Object Graphics

The majority of this section deals with IDL Direct Graphics. However, the Hershey vector and TrueType font systems described here are also available in the IDL Object Graphics system as described in Annotating an Object Display (Object Programming).

IDL Direct Graphics

When generating characters for Direct Graphics plots, IDL uses the font system specified by setting the !P.FONT system variable to one of the following values:

-1    

Use Hershey vector-drawn fonts—the default

0

Use device fonts (fonts supplied by the graphics device)

1

Use TrueType fonts

The IDL system variable !P.FONT setting can be overridden for a single IDL Direct Graphics routine (AXIS, CONTOUR, PLOT, SHADE_SURF, SURFACE, or XYOUTS) by setting the FONT keyword equal to -1, 0, or 1.

Once a font system has been selected, an individual font can be chosen either via a formatting command embedded in a text string as described in Embedded Formatting Commands, or by setting the value of the SET_FONT keyword to the DEVICE routine (see SET_FONT). Also see Using TrueType Fonts and Using Device Fonts for additional examples of using SET_FONT.

IDL Object Graphics

IDL Object Graphics can use the Hershey vector and TrueType font systems. Like Direct Graphics, embedded formatting commands can change the characteristics or position of text within a text string as described in Embedded Formatting Commands. TrueType fonts you add to your IDL installation as described in About TrueType Fonts will be available to the Object Graphics system. Device fonts (including PostScript fonts) are unavailable in Object Graphics. See Annotating an Object Display (Object Programming) for information on using creating and using IDLgrText and IDLgrFont objects.