# coyote: CGSET_TTFONT

- coyote/Utilities
- [Source code]

Description

      The purpose of this procedure is to allow the user to set the True-Type font in use
      both at the IDL command line and in a PostScript file. Normally, True-Type fonts are
      set with the Device command and the Set_Font and TT_Font keywords. However, if such a
      command is issued at the IDL command line, it has no effect in the PostScript device.
      The cgSet_TTFont command will set the True-Type font for both devices, thereby keeping
      them in sync with each other so that the expected output can be created both on the display
      and in a PostScript file.
      Using this procedure also has an effect on Coyote Graphics routines by setting both the
      PS_TT_FONT and PS_FONT keywords to cgWindow_SetDefs. This ensures that any Coyote Graphics
      routine that creates a PostScript file will use the requested font upon producing PostScript
      output. Revert to the default Helvetica font by either using the font name "Helvetica",
      or by simply calling the function without a font name parameter. If the ADDCMD keyword is
      used, the font change will apply ONLY to the current cgWindow (i.e., the PS_TT_FONT and PS_FONT
      keywords will be set for just the current cgWindow).

Categories

      Utility

Params

      font_name: in, optional, type=string, default="Helvetica"
           The name of a true-type font to use in producing graphical output.

Keywords

      addcmd: in, optional, type=boolean, default=0
           Set this keyword to apply this True-Type font ONLY to the current cgWindow via
           the PS_TT_FONT and PS_FONT keywords of cgControl. An error will occur if there
           is no current cgWindow in existance.

Examples

      Here is how to use this program to use the Times True-Type font::
          cgSet_TTFont, 'Times'
          cgPlot, cgDemoData(1), Title='This is Times Text', Output='cgplot.png'
      or::
          cgSet_TTFont, 'Times'
          cgPS_Open, 'cgplot.ps', Font=1
          cgPlot, cgDemoData(1), Title='This is Times Text'
          cgPS_Close, /PNG
      or, to set the font ONLY for the current cgWindow::
          cgPlot, cgDemoData(1), Title='This is Times Text', /Window
          cgSet_TTFont, 'Times', /AddCmd

Author

      FANNING SOFTWARE CONSULTING::
         David W. Fanning
         1645 Sheely Drive
         Fort Collins, CO 80526 USA
         Phone: 970-221-0438
         E-mail: david@idlcoyote.com
         Coyote's Guide to IDL Programming: http://www.idlcoyote.com

History

      Change History::
         Written, 21 May 2013 by David W. Fanning.

Copyright

      Copyright (c) 2013, Fanning Software Consulting, Inc.