• Print  |
  • Feedback  |

Knowledge Base


TS-652

Using the SYSPRINTFONT Option with the Universal Printer in Version 8.2

In Release 8.2 of the SAS system and above, the SYSPRINTFONT option can be used to set the default font for a specific printer or printers for the duration of the current SAS session. This option temporarily overrides the default font for the designated printer(s).

This option has been available in previous releases of the SAS system for Windows to specify the system font to use with the system printers. Beginning with Release 8.2, the option can set the default font for the Universal Printers. Universal Printing is the default printing method for Release 8.2 of the SAS system on all operating systems except Windows systems. The Universal printers and their available fonts are listed in the SAS registry. The SYSPRINTFONT option temporarily overrides the printer's default font; it does not change the value of the default font key in the registry.

If Universal Printing is enabled on Windows systems at invocation by including the
"-uprint -uprintmenuswitch" parameters, the SYSPRINTFONT option will apply to the Universal Printers. Otherwise, using the SYSPRINTFONT option on Windows systems will apply to the system printers as before.

The SYSPRINTFONT option can be specified in a configuration file, at SAS invocation, or on the OPTIONS statement. The syntax required for the SYSPRINTFONT option can vary by the location where it is specified as well as by the operating system. This document discusses the basic syntax as well as the system-specific variations.


General syntax

The basic syntax for SYSPRINTFONT is:
SYSPRINTFONT="facename" <weight> <style> <pointsize> <'character-set'>
<NAMED "printer-name" | DEFAULT | ALL>

The facename (ie, the font name) is required and must be the first attribute specified whenever SYSPRINTFONT is used.

Description of attributes

Attributes specified between the < and > brackets are optional, but they should be specified in order if used. If you do not specify an attribute, the values are taken from SAS registry for each Universal printer. For system printers, the default settings from the system are used.

Each attribute is defined as follows.

  • weight The weight of the font. Typical settings include NORMAL, MEDIUM, BOLD, DEMI, THIN, EXTRA BOLD.
  • style The style of the font. Settings include REGULAR, ITALIC, and OBLIQUE.
  • point size The text height in points (pt). This number must be an integer. Settings such as 8, 10, and 12 are typical.
  • character set The encoding for the output. Typical values include Western and French. The necessary settings vary by region and the encoding method needed by the receiving device or application. If the character set name contains spaces then the name must be enclosed in quotes. For example, "Central European".
Use one of the following attributes to specify which printer(s) should use this font.
  • NAMED "printername" Set as the default font for the printer indicated by printername. The printername must exactly match the name given in the Print Setup dialog or in the SAS registry, otherwise the font will not be applied. The NAMED keyword is optional.
  • DEFAULT Set as the default font for the current default printer.
  • ALL Set as the default font for all printers in the SAS registry that can use this font.

If none of these three parameters is specified, the font will be applied only to the default printer.

Listing the attributes for a particular font or printer

To use SYSPRINTFONT, the correct spelling for the font name and any attributes you want to use for that particular font are needed. You can view the available fonts and their attributes through several different methods.

  • In an interactive (-dms) SAS session, choose "File"®"Print Setup" from the menu and click the "Fonts" button. On some systems, you may have to highlight the printer name before you can select "Properties" and then the "Fonts" button. The font listed in the Font dialog box is the current default font; attributes for the selected font are listed here as well.
  • You can check the SAS registry for the names and attributes of fonts that can be used with the Universal Printers. In an interactive SAS session, choose "Solutions"®"Accessories"®"Registry Editor" from the menu. Fonts are listed under the following key:

    [CORE\PRINTING\PRINTERS\ Printername \Printer Setup\Fonts]

    The current default font for a given printer and its attributes are listed under the [Default Settings] key for that printer.
  • You can list the registry key values in a non-interactive session by submitting the following statements:

    proc registry list
     startat="KEY ";
    run;


    The KEY should be the location in the registry you want to list. The value is not case sensitive but it must use backslashes \ to indicate branches in the registry. The destination branch must not end with a backslash. For example, the following code will list all the fonts available to the generic Color Postscript printer:

    proc registry list
     startat=
    "HKEY_USER_ROOT\Core\Printing\Printers\Color Postscript\Printer Setup\Fonts";
    run;


    The output will be sent to the Log file.

OPTIONS statement syntax

It is recommended that the SYSPRINTFONT option be assigned with the OPTIONS statement. The general syntax is:
OPTIONS SYSPRINTFONT=('facename' <attributes> );

General guidelines for specifying SYSPRINTFONT attributes

  • The facename should always be the first value specified.
  • The facename must be enclosed in quotes if it contains spaces. Either single or double quotes can be used.
  • Either single or double-quotes can be used around the character set.
  • Either single or double-quotes can be used around the printername.
  • The NAMED keyword is not required; you can simply specify the quoted printer name alone.

System specific requirements

There are some host-specific exceptions to the general guidelines.

  • PC/Windows
    Attributes are not required, but if used they MUST be specified in the correct order. See the General syntax for the correct order to use. If Universal Printing has been enabled using the -UPRINT -UPRINTMENUSWITCH invocation options, the printernames to use are those listed in the SAS Registry. If Universal Printing has not been enabled, use the printer names listed on the desktop.


Invocation and configuration file syntax

If you choose to specify the SYSPRINTFONT in a configuration file or at SAS invocation be aware of the following conditions.

General guidelines for specifying SYSPRINTFONT attributes

  • All the attributes must be specified each time SYSPRINTFONT is used.
  • Attributes must be specified in the correct order. See the General syntax for the correct order to use.

System specific requirements

The syntax required when specifying the SYSPRINTFONT option at invocation time or in a configuration file varies by operating system.

  • MVS O('SYSPRINTFONT=("facename" <attributes>)')

    Double quotes must be used around the facename, printer name and character set name, if specified.

  • CMS SYSPRINTFONT ("facename" <attributes> )

    Double quotes must be used around the facename, printer name and character set name, if specified.

  • PC/Windows

    -SYSPRINTFONT ('facename' <attributes>)

    Single or double quotes may be used around the facename, printername and character set name, if specified.


  • UNIX

    -SYSPRINTFONT "'facename' <attributes> "

    Single or double quotes may be used around the facename, printername and character set name, if specified.. However, it is recommended to use single quotes around the facename and attributes and double-quotes around the entire option.

  • VMS

    /SYSPRINTFONT=("facename" <attributes> )

    Double quotes must be used for the facename, printername and character set name, if specified.



Troubleshooting

If you are running SAS interactively, you can test to see if the font has been applied by choosing File-Print Preview from the SAS Log, Output, or Editor window.

If you receive an error when assigning the SYSPRINTFONT option, or if the font is ignored, first check to see what value SAS stored for the option by submitting the following code:

proc options option=sysprintfont;
run;

The output will be sent to the Log. Then try the following suggestions to correct the problem.

  • Make sure the font is listed in the SAS registry or Print Setup window for the printer you have designated.
  • Check the spelling of the font name. Names are not case sensitive, but they must be spelled exactly as listed in the SAS registry or Print Setup window.
  • Check the spelling of the attribute and its value. Values are not case sensitive, but they must be spelled exactly as listed in the SAS registry or Print Setup window.
  • Make sure the attributes are in the correct order. See the General syntax for the correct order to use.
  • Use the SYSPRINTFONT option on a separate OPTIONS statement.
  • If you have only specified certain attributes, try specifying all the attributes, in order. See the General syntax for the correct order to use.
  • Try enclosing the entire option in quotes or parenthesis according to the guidelines given above.