Using Hardware Fonts


There are four ways to use hardware fonts with SAS/GRAPH output:

  • By using the CHARTYPE= graphics options in a GOPTIONS statement to assign the number of a font listed in the Chartype window of your device entry as the default hardware font. See Using a GOPTIONS Statement to Change the Default Hardware Font on page 79 for details.

  • By using the GDEVICE procedure to specify the number of the font you want to use as the default hardware font. See Using the GDEVICE Procedure to Change the Default Hardware Font on page 79 for details.

  • By specifying the full font name as it appears on the Chartype window of the device driver entry. See Specifying the Full Font Name on page 80 for details.

  • By explicitly specifying a hardware font name of the type HW xxxnnn . See Specifying Alternative Hardware Fonts on page 80 for details.

There are several advantages to using hardware fonts instead of software fonts. Hardware fonts often are produced faster than software fonts and produce smaller output files. Also, some devices, such as laser printers with resident hardware fonts, may produce better quality output with hardware fonts than with software fonts.

Default Hardware Fonts

SAS/GRAPH software uses a device s default hardware font to draw characters when both of the following conditions are true:

  • No font specification is made in the SAS/GRAPH program, or FONT=NONE is specified.

  • The hardware font can be used. See Default Fonts on page 77 for details on when hardware fonts cannot be used.

Every available hardware font for a particular device has a number associated with it. This number and the corresponding font name are listed in the Chartype window of the device entry for your device. The default hardware font is the font whose number is entered in the Chartype field in the Parameters window of the device entry. When FONT=NONE or no font is specified, SAS/GRAPH software uses the font assigned to this field.

If your device has more than one hardware font, there are two ways you can assign a different default hardware font:

  • By specifying the font with the CHARTYPE= option in a GOPTIONS statement. See Using a GOPTIONS Statement to Change the Default Hardware Font on page 79

  • By using the GDEVICE procedure to modify the value of the Chartype field in the Parameters window of your device entry. See Using the GDEVICE Procedure to Change the Default Hardware Font on page 79 for more details.

If your device has only one hardware font (this is often the case), the Chartype field has a value of 0.

Using a GOPTIONS Statement to Change the Default Hardware Font

To assign the default hardware font for your current SAS session, use the CHARTYPE= option in a GOPTIONS statement. Assign it the actual number of the hardware font as listed in the Chartype field in the Chartype window of the device entry for your device.

Using the CHARTYPE= option only changes the default font for the duration of your SAS session; using the CHARTYPE= option does not change the value of the field in the device entry. (See CHARTYPE on page 269 for a complete description of the CHARTYPE= option.)

When you specify a hardware font by using the graphics option CHARTYPE= n and the font specification NONE, the size of the character cells is determined by the current values for the HPOS= and VPOS= options. This means that the font is drawn using the current cell size. As a result, the aspect ratio of the displayed font may be different and the height of the characters, if displayed in cells, may be affected.

CAUTION:

  • Specifying a nonscalable hardware font with the CHARTYPE= option may cause the SIMULATE font to be used.

In addition, if the font selected with CHARTYPE= is not scalable and if the values of HPOS= and VPOS= do not match the values of the Rows and Cols fields in the Chartype window, then the SIMULATE font is substituted.

Using the GDEVICE Procedure to Change the Default Hardware Font

To change the default hardware font with the GDEVICE procedure, change the Chartype field in the Parameters window for the device:

  1. Invoke the GDEVICE procedure and select the entry for your device.

  2. Go to the Chartype window and review the available fonts.

  3. Note the number of the font that you want to use as the default font and go to the Parameters window.

  4. Enter the number of the font in the Chartype field.

  5. Close the window and exit the procedure.

Note: If you change the number in the Chartype field in the Parameters window of the device entry, the change is permanent and remains in effect from one SAS session to another until you change the entry again.

(See Chapter 31, The GDEVICE Procedure, on page 915 for information on viewing device entries and changing device parameters.)

Specifying the Full Font Name

You can specify the full font name in any SAS statement where a font specification is valid (such as for the FTEXT= font graphics option or the FONT= font specification on a TITLE statement). For the value font, specify the full font name exactly as it appears in the Chartype window of the device driver entry. For example, to specify the Times-Roman font on a TITLE statement when you use the PS300 device driver, specify:

 title font=Times-Roman Testing the Times-Roman font; 

The SAS System allows up to 255 characters for the font name. The font name may contain spaces. If the font name is longer than 40 characters, PROC GDEVICE in fullscreen mode only displays the first 37 characters, followed by an ellipsis (...). To see the complete font name when the name is longer than 40 characters, use PROC GDEVICE with the NOFS (no fullscreen) option as follows :

 proc gdevice c=sashelp.devices nofs;     list  driver-name  ;  run;  quit; 

When a font is quoted, the SAS System will first look at the Chartype window of the device driver entry to see if it is a valid hardware font. If the font is not found in the Chartype window, the SAS System will then check to see if the quoted font is a valid SAS/GRAPH software font. If the font is not recognized as either a valid hardware font or a valid SAS/GRAPH software font, the SIMPLEX font will be used.

Specifying Alternative Hardware Fonts

An alternative hardware font can be specified in any SAS statement where a font specification is valid. You can use more than one hardware font in a single graph (or even in a single statement), as long as all of the fonts that you specify exist on your device. If you specify a hardware font, make sure that the font is available on the device and that there is a corresponding Chartype value for the font. If you request a hardware font that does not have a Chartype defined, SAS/GRAPH software substitutes the SIMULATE font.

These are the three ways to specify alternative hardware fonts:

  • In the font specification, explicitly assign a hardware font using the following form:

    • HW xxxnnn

      HW

      identifies the font as a hardware font. The font name must begin with the characters HW.

      xxx

      are the last two or three characters of the module name in the Module field in the Detail window of your device entry. If the module name has eight characters (SASGDPSL, for example), use the last three characters (PSL). If the module name has only seven characters (SASGDVT, for example), use the last two characters (VT).

      nnn

      is the Chartype number of the hardware font that you want to use as listed in the Chartype window in the device entry. This value should be a three-digit decimal number, with leading zeros if necessary.

  • In the font specification, explicitly assign a hardware font using the following form:

    • hardware-font-name

      • identifies the name of the hardware font that is listed in the Chartype window of the device entry. Hardware-font-name must be enclosed in quotation marks and the maximum length is 256 characters. The specified font name will be converted internally to the HW xxxnnn name. Note that in Annotate, the specified font name must be enclosed in both double quotes and single quotes (see Chapter 25, Annotate Dictionary, on page 613 for details).

  • Assign one of the fonts listed in the Chartype window of your device entry as the default hardware font with the CHARTYPE= graphics option. You can also change the default hardware font by modifying the value of the Chartype field in the Parameters window of your device entry. Then you can use FONT=NONE in your SAS/GRAPH procedure or statement to specify the new default hardware font.

When you specify FONT=HW xxxnnn or hardware-font-name , the size of the character cells is determined by the values in the Rows and Cols fields in the Chartype window of the device entry, and the values of the HPOS= and VPOS= options are ignored for the font. Consequently, the font retains its original proportions . In addition, with this method the font catalog is checked for proportional spacing information. This information is used by the software to determine how much space to reserve for proportional text. See Chapter 8, Graphics Options and Device Parameters Dictionary, on page 261 for additional information.




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