SAS Institute. The Power to Know

SAS/GRAPH(R) 9.2 Reference

Previous Page | Next Page

SAS/GRAPH Fonts

Methods For Overriding Default Fonts

In general, there are four ways to override the default fonts. The method you choose depends on how extensively you want to change fonts.

  • You can create a new style by copying and modifying an existing style and changing the font settings. Your new style can be used for all your ODS output at your site to ensure a consistent appearance. If you always want all of your output to have a specific appearance, then modifying the styles is probably the best alternative. See Modifying The Fonts Used By a Style.

  • You can specify fonts on the GOPTIONS statement, which affects all output in the current SAS session. Using the FTEXT= graphics option is usually the best solution if you are dealing with any of the following situations.

    • You want to change the fonts only for the current SAS session.

    • You want to change the fonts only for a specific application.

    • You do not need for all of your output to use the same style.

    See Using GOPTIONS To Change Fonts.
  • You can specify fonts on the AXIS, LEGEND, or SYMBOL statements. Fonts specified with these statements affect the output of any procedure that references those statements. See Using SAS/GRAPH Global Statement Options To Modify Fonts.

  • Many procedures support font options on that enable you to change the fonts for certain graph elements. For example, with the GCHART procedure, you can specify the FONT= suboption on the PLABEL= option to control the font for the pie slice labels. With the GKPI procedure, you can use the BFONT= option to specify the font for boundary labels. Changes specified using procedure options affect the output of the current invocation of the procedure only.

    For information on the font options that are available for a specific procedure, see the documentation for the procedure.


Modifying The Fonts Used By a Style

There are three ways to modify the fonts used by a style. Which method you choose depends on how extensively you want to change a font.

  • You can modify the style element that controls a specific graph element such as graph titles or contour line labels.

  • You can modify the abstract font specifications in the GraphFonts class. These font specifications can be referenced in multiple places in a style and affect several graph elements.

  • You can modify the font settings in the SAS registry that the styles use to determine the default fonts. Changes to the SAS registry affect the fonts used by all styles that reference the SAS registry entry.

Modifying fonts by modifying the styles might be the best alternative if you need to create a style for all of your company's output. If you only want to change fonts for a few applications, then using GOPTIONS is a better alternative.

For a complete description of modifying the fonts that are used by the styles, see Modifying Graph Fonts Or Colors Specified By Styles.


Using GOPTIONS To Change Fonts

The GOPTIONS statement has several options that can be used to specify fonts for your graphs.

  • FBY= sets the BY line font in your graphs.

  • FTEXT= sets the font for all the text in your graphs.

  • FTITLE= sets the font for the first title in your graphs.

For example, to specify Cumberland AMT for all of the text in your graphs, specify

goptions ftext="Cumberland AMT";

Settings specified on the GOPTIONS statement remain in effect until you change them, until you specify reset=all , or until you close the SAS session.

If you want most or all of the text in your output to use a single font, specifying this font with the FTEXT= graphics option is frequently the best alternative. Specifying the FTEXT= option on the GOPTIONS statement instead of adding font specifications to several procedure action statements in addition to other global statements makes your code easier to maintain.

Note:   The FBY= option is not supported by the Java or ActiveX devices. For specific information on the GOPTIONS statement, see GOPTIONS Statement. Information for specific graphics options is in Graphics Options and Device Parameters Dictionary.  [cautionend]

Note:   When you are sending SAS/GRAPH output to the HTML or RTF destinations (MARKUP destinations), titles and footnotes can be rendered as part of your graph image or as part of the HTML or RTF files. Where your titles and footnotes are rendered determines the default fonts that are used for them. See Controlling Titles and Footnotes with Java and ActiveX Devices in HTML Output for information on the GTITLE and GFOOTNOTE destination options and the ODS USEGOPT statement.  [cautionend]


Using SAS/GRAPH Global Statement Options To Modify Fonts

Font options on SAS/GRAPH AXIS, LEGEND, and SYMBOL global statements enable you to specify fonts for the following:

  • axis labels, reference line labels, and tick mark values

  • legend labels and legend value descriptions

  • contour line labels and plot point labels

For example, the following statement could be used to label contour lines:
symbol value="Deep" font="CUMBERLAND AMT/bold/italic";

See Labeling Contour Lines, Modifying the Horizontal Axis, Modifying the Legend for an example that uses SYMBOL statements to label contour lines.

As with the options specified on the GOPTIONS statement, options specified with these global statements remain in effect until you change them or until you start a new SAS session.

For specific information on each of the global statements, see SAS/GRAPH Statements.


Precedence of Font Specifications

When SAS/GRAPH is trying to determine the font to use for a specific graph element, it uses the first font that it finds from the following list.

  1. Fonts specified on procedure action statement options such as the PLABEL= option on the PIE statement in the GCHART procedure.

  2. Fonts specified on the AXIS, LEGEND, or SYMBOL statements.

  3. Fonts specified with the GOPTIONS global statement.

  4. Fonts specified by the current style (if GSTYLE is in effect) or the font specified by the MTsans-serif entry in the SAS registry (if the NOGSTYLE system option is in effect).

Previous Page | Next Page | Top of Page