Chapter Contents

Previous

Next
SAS/GRAPH Software: Reference

Specifying Fonts in SAS/GRAPH Programs

When you select a type style for text or plot symbols, you use statement options to assign the font. You can assign fonts for any amount of text from a single character in a title to all the text in your output. When SAS/GRAPH software encounters an explicit font specification in a SAS statement, it uses the font that you specify rather than a font that is specified in a GOPTIONS statement or the device's hardware font.

If you do not make a font assignment, in most cases SAS/GRAPH software uses the default hardware font for your device.


Font Specifications

A font specification is an argument that takes a font name as its value. Font specifications typically take the following form:

FONT=font
F=font
where font is a valid SAS name. The specified font can be

For example, the following statement specifies the Century Bold font in a title:

title font=centb 'This is a Title';

However, there are other arguments that also take font as a value. For example, the FTEXT= option in the following GOPTIONS statement specifies the Century Bold font for all text that does not have a more explicit font specification:

goptions ftext=centb;

Note:   In this chapter, the argument FONT= is used to represent any argument that takes font as its value.  [cautionend]


Default Fonts

When a font is needed, SAS/GRAPH software looks first for a font specification in the statement or procedure that produces the output, and then it looks in the GOPTIONS statement. If no font specification is found, SAS/GRAPH software uses one of the following:

In some cases, the device's hardware font cannot be used and the SIMULATE font is used instead. The SIMULATE font is a software font that simulates the device's hardware characters by allowing the same amount of space for the text that the hardware characters use. The SIMULATE font is used whenever the default hardware font is unavailable, including the following situations:

You should never delete the SIMULATE font from the fonts catalog.

Note:   You can change the font that is used as the SIMULATE font with the SIMFONT= graphics option. If you use the SIMFONT= option, it is better to specify a uniform font. Do not specify a hardware font as a substitute for SIMULATE. See SIMFONT for more information on the SIMFONT= option.  [cautionend]


Font Locations

SAS/GRAPH software fonts are stored in catalogs. SAS/GRAPH looks only into catalogs with certain librefs and names to find fonts. By default, SAS/GRAPH searches for the font in the catalog SASHELP.FONTS, which contains Institute-supplied fonts, key maps, and device maps.

If you want to specify fonts that you have created locally, submit a LIBNAME statement that associates the libref GFONT0 with the location of your font catalog. If you have specified more than one libref in the sequence GFONT0 through GFONT9, SAS/GRAPH software performs a sequential search of these catalogs when locating the font that you have specified.

When you specify a font name, SAS/GRAPH software searches for the font in the following order:

  1. If a SAS data library with the libref GFONT0 exists, then SAS/GRAPH software looks there for a catalog named FONTS. If GFONT0.FONTS exists, it is checked for the specified font. If the font is not there, SAS/GRAPH software looks next for a library with the libref GFONT1 and for a catalog named FONTS in that library. The search is repeated for the sequence of librefs through GFONT9.

  2. If SAS/GRAPH software fails to find the specified font in any FONTS catalog in the libraries GFONT0 to GFONT9, or if it finds a GFONTn libref without a FONTS catalog, or if it encounters an undefined libref in that sequence before locating the specified font, then it searches for the font in SASHELP.FONTS. (SASHELP is one of the standard librefs defined automatically whenever you start your SAS session; you do not need to issue a LIBNAME statement to define it.)

  3. If the specified font is not found in SASHELP.FONTS, then a warning is issued and the SIMPLEX font is used. The SIMPLEX font is the default software font and should never be deleted from the fonts catalog.

See The GFONT Procedure for additional information on specifying the libref GFONT0.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.