Specifying Fonts in SASGRAPH Programs


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 the 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.

With SAS/GRAPH you can select existing hardware or software fonts or create your own font. Hardware fonts are fonts that exist on hardcopy output devices (such as printers or plotters ) or on a computer. PC TrueType and UNIX system fonts are examples of hardware fonts that exist on computers. Software fonts are the fonts delivered with SAS. The software fonts are the entries in the SASHELP.FONTS catalogue . If you do not make a font assignment, in most cases the SAS/GRAPH software uses the default hardware font for your device.

Note: Java and ActiveX devices do not support software fonts.

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

    • a software font that is either

      • a catalog entry that is supplied by SAS Institute (for example, CENTB), or that is user -generated (for example, MYFONT generated by the GFONT procedure)

      • a system font that is available in your operating environment.

    • Note: Font names greater than eight characters in length must be enclosed in quotation marks.

      To see a list of available software fonts, issue the FONTLIST command from the SAS command line. See Base SAS Software Help for more information on the FONTLIST command. The resulting window enables you to copy a font name into the copy buffer so that you can paste the name into your SAS program. The window s Family box lists the software fonts that are supplied by SAS Institute. Choose the System button to see a list of the system fonts that are available in your operating environment. Choose the Help button for help on using the window. See Font Lists on page 82 for more information on the valid font names for Institute-supplied software fonts.

    • a hardware font that is either in the form of

      • HW xxxnnn

      • hardware-font-name .

    • See Specifying Alternative Hardware Fonts on page 80 for details.

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.

Default Fonts

When a font is needed, theSAS/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, the SAS/GRAPH software uses one of the following:

  • for TITLE1 statements, the default font is SWISS.

  • for all other text, the default font is NONE. The NONE font specifies the default hardware font for the output device.

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:

  • FONT=NONE or FONT=HW xxxnnn or no font is specified, and one of the following conditions or sets of conditions is also met:

    • GOPTIONS NOCHARACTERS is specified.

    • The device driver does not support hardware text.

    • You request a hardware font for a different device.

    • You specify an angle or rotation for the characters that the device does not support.

    • The device does not have scalable hardware characters (that is, hardware characters can be generated only in the proportions specified with the font), and one of the following conditions is also met:

      • The values of the HPOS= and VPOS= graphics options do not match the values displayed in the LCOLS or PCOLS field or the LROWS or PROWS field in the Detail window of the device entry.

      • The HSIZE= or VSIZE= graphics option is set to values that are not the default.

      • You replay a graph in a template that is not the same size as the full size of the graphics output area, or you use a device driver other than the one you used to create the graph.

      • The target device and the display device have different values for the HPOS= and VPOS= graphics options.

      • You use any height specification, including the HEIGHT=, HTEXT=, HTITLE=, and HBY= graphics options, that is not equal to 1.

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 on page 351 for more information on the SIMFONT= option.

Font Locations

SAS/GRAPH software fonts are stored in catalogs. The SAS/GRAPH software 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, theSAS/GRAPH software performs a sequential search of these catalogs when locating the font that you have specified.

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

  1. If a SAS data library with the libref GFONT0 exists, then the 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, then the 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 the SAS/GRAPH software fails to find the specified font in any FONTS catalog in the libraries GFONT0 to GFONT9, or if it finds a GFONT n 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 Chapter 32, The GFONT Procedure, on page 939 for additional information on specifying the libref GFONT0.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net