Previous Page | Next Page

The GFONT Procedure

PROC GFONT Statement


The PROC GFONT statement can either create SAS/GRAPH fonts or display existing SAS/GRAPH fonts. The GFONT procedure names the font to be created or displayed. If the GFONT procedure creates a font, then an input data set name is required. You can modify the design and appearance of the fonts that you create or display, and specify a destination catalog for graphics output.

Syntax

PROC GFONT NAME=SAS/GRAPH font| device resident font | system font
mode
<display-option(s)>
<creation-option(s)>;

For more detail on using the GFONT syntax, see Displaying Fonts: Required Arguments and Options and Creating Fonts: Required Arguments and Options.

Displaying Fonts: Required Arguments and Options



Required Arguments for Displaying Fonts

NAME=SAS/GRAPH font| device-resident font| system font

specifies of theSAS/GRAPH font to be displayed. Name can be any of the following values:

  • the name of a SAS/GRAPH font stored in the SASHELP.FONTS catalog, and fonts created by the user and stored in a GFONTn catalog. These fonts can be used only by SAS/GRAPH procedures or other procedures that generate SAS/GRAPH output files.

  • the name of a system font that can be used by any SAS procedure and by other software, such as Microsoft Word. SAS/GRAPH installs and registers a set of TrueType fonts, and it is recommended that you use these fonts whenever possible.

  • the name of a device-resident font that is burned into the chips in a device's hardware. These fonts are specific to the device being used and are not portable between devices. Some device resident fonts such as Helvetica can also be present as system fonts.

Alias: N=
Note: The device-resident font name must be enclosed in quotes.
NOBUILD

specifies that the GFONT procedure is to display an existing font. The NOBUILD argument tells the GFONT procedure that no font is being created and not to look for an input data set.

Alias: NB
Featured in: Displaying Fonts with Character Codes.
.

Options for Displaying Fonts

Options that can be used for either font display or font creation are described here and in Options for Creating Fonts.

Options to display a font can be used when you create a font if you also display it (that is, you do not use the NODISPLAY option in the PROC GFONT statement). However, none of the display options affect the design and appearance of the stored font except the NOKEYMAP, SHOWROMAN, and ROMHEX options.

When the syntax of an option includes units, specify one of these:

CELLS

character cells

CM

centimeters

IN

inches

PCT

percentage of the graphics output area

PT

points

If you omit units, a unit specification is searched for in the following order:

  1. the value of GUNIT= in a GOPTIONS statement

  2. the default unit, CELLS

CTEXT=text-color

specifies a color for the body of the characters. If you do not use the CTEXT= option, a color specification is searched for in the following order:

  1. the CTEXT= option in the procedure statement

  2. the CTEXT= option in a GOPTIONS statement

  3. the color specified in the ODS style

  4. the first color in the color list

Alias: CT=
Featured in: Creating Figures for a Symbol Font.
Note: The CTEXT= value is not stored as part of the font.
GOUT=<libref.>output-catalog

specifies the SAS catalog in which to save the graphics output generated by the display of the font. You can use the GREPLAY procedure to view the output that is stored in the catalog.

If you omit the libref, SAS/GRAPH looks for the catalog in the temporary WORK library, and creates the catalog if it does not exist.

See also: Specifying the Catalog Name and Entry Name for Your GRSEGs
HEIGHT=character-height<units>

specifies the height of the font characters in number of units, n. Height is measured from the minimum font measurement to the capline.

Alias: H=
Default: 2
Featured in: Displaying Fonts with Character Codes.
NOKEYMAP

specifies that the current key map is ignored when displaying the font and its character codes or hexadecimal values. If you do not use the NOKEYMAP option when you display a font, the current key map remains in effect. If any characters in the font are not available through the current key map, they are not displayed and a warning is issued in the SAS log. This happens when not all characters in the font are mapped into the current key map.

Displaying a font using the NOKEYMAP option enables you to see all of the characters in the font, including those that are not mapped into your current key map.

Note: Only the characters that are mapped into your current key map are available.
NOROMAN

turns off the automatic display of character codes that are created when you use the SHOWROMAN option during font creation.

Alias: NR
NOROMHEX

turns off the automatic display of hexadecimal values for single-byte characters that are created when you use the ROMHEX option during font creation.

Alias: NOHEX
REFCOL=reference-line-color

specifies a color for reference lines. If you do not use the REFCOL= option, a color specification is searched for in the following order:

  1. the CTEXT= option in a GOPTIONS statement

  2. the color specified in the ODS style

  3. the first color in the color list

REFLINES

draws reference lines around each displayed character. Vertical reference lines show the width of the character. Horizontal reference lines show the font maximum and the font minimum, as well as the baseline and the capline.

See: Font Terminology and Characteristics.
ROMCOL=code-color

specifies the color of the character codes or hexadecimal values that are displayed with the SHOWROMAN and ROMHEX options. If you do not use the ROMCOL= option, a color specification is searched for in the following order:

  1. the color specified by the CTEXT= option in a GOPTIONS statement

  2. the color specified in the current style or, if the NOGSTYLE option is specified, then the default color is black for the Java and Activex devices and the first color in the color list for all the other devices

Alias: RC=
Featured in: Displaying Fonts with Character Codes.
Note: The ROMCOL= value is not stored as part of the font.
ROMFONT=font

specifies the font for character codes and hexadecimal values that are displayed by the SHOWROMAN and ROMHEX options. If you do not use the ROMFONT= option, a font specification is searched for in the following order:

  1. the value of the ODS STYLE variable

  2. the FTEXT= option in a GOPTIONS statement

  3. SAS-supplied fonts

  4. the device-resident font

Alias: RF=
Featured in: Displaying Fonts with Character Codes.
ROMHEX

displays hexadecimal values below the font characters. If you use both the ROMHEX and SHOWROMAN options, both the character codes and the hexadecimal values are displayed. You can also use the ROMHEX option when you create a font.

Alias: HEX
See also: the ROMHEX option.
ROMHT=height<units>

specifies the height of the character codes and the hexadecimal values that are displayed with the SHOWROMAN and ROMHEX options in number of units, n. If you do not use the ROMHT= option, a height specification is searched for in the following order:

  1. the HEIGHT specified in the ODS STYLE

  2. the HTEXT= option in a GOPTIONS statement

Alias: RH=
Default: 1
Featured in: Displaying Fonts with Character Codes.
SHOWALL

displays the font with a space for every possible character position whether a font character exists for that position. The characters that are displayed are those available under your current key map, unless you use the NOKEYMAP option. The SHOWALL option usually is used in conjunction with the ROMHEX option, to display all possible hexadecimal values. If, under your current key map, a font character is available for a position, it displays above the hexadecimal value. If no character is available for a position, the space above the hexadecimal value is blank. You can use the SHOWALL option to show where undefined character positions fall in the font.

SHOWROMAN

displays character codes below the font characters even if they are not displayed automatically with the font. If you use both the SHOWROMAN option, and the ROMHEX option, both the character codes, and the hexadecimal values are displayed. You can also use the SHOWROMAN option when you create a font.

Alias: SR
Featured in: Displaying Fonts with Character Codes.

Details

proc gfont name=weather nobuild romfont=albany;
run;


Creating Fonts: Required Arguments and Options



Required Arguments for Creating Fonts

NAME=font-name

assigns a name to the font that you create. Font name is the name of a catalog entry, and must be a valid SAS name of no more than eight characters. You cannot specify NONE, or the name of a SAS/GRAPH font that is shipped with SAS/GRAPH software.

Alias: N=
Featured in: Creating Figures for a Symbol Font.
DATA=font-data-set

specifies the SAS data set that the GFONT procedure uses to build the font. The data set must be sorted by the variables CHAR and SEGMENT.

Default: The GFONT procedure uses the most recently created data set.
See also: SAS Data Sets.
Featured in: Creating Figures for a Symbol Font.

When you create a font, define the libref GFONT0. See Storing User-Created Fonts: GFONT0 Libref.

Note:   If a user-created SAS/GRAPH font has the same name as a font supplied by SAS, and if the libref GFONT0 has been defined, then the user-created SAS/GRAPH font is used, because GFONT0 is first in the search order.  [cautionend]


Options for Creating Fonts

Options that can be used for either font display or font creation are described here, and in Options for Displaying Fonts.

Options to display a font can be used when you create a font if you also display it (that is, you do not use the NODISPLAY option in the PROC GFONT statement). However, none of the display options affect the design and appearance of the stored font except the NOKEYMAP, SHOWROMAN, and ROMHEX options.

When the syntax of an option includes units, specify a unit using one of the following measures:

CELLS

character cells

CM

centimeters

IN

inches

PCT

percentage of the graphics output area

PT

points

If you omit units, a unit specification is searched for in the following order:

  1. the value of GUNIT= in a GOPTIONS statement

  2. the value of units in the ODS STYLE

  3. the default unit; CELLS

BASELINE=y

specifies the vertical coordinate in the font data set that is the baseline of the characters. The baseline is the line upon which the letters rest. If you do not use the BASELINE= option, the GFONT procedure uses the lowest vertical coordinate of the first character in the font data set.

B=
CAPLINE=y

specifies the vertical coordinate in the font data set that is the capline of the characters. The capline is the highest point of normal that case the capline, and the font maximum are the same. See Font Characteristics Terminology for an illustration of capline, and font maximum.

If you use the CAPLINE= option, when the height of a character is calculated, any part of the character that is above the capline is ignored in the calculation.

You can use this option to prevent an accented capital like A from being shortened to accommodate the accent. If you do not use the CAPLINE= option, the capline and the font maximum are the same. The A is shortened to make room for the accent below the capline. However, if the CAPLINE= option is used, the top of the letter A is at the capline, and the accent is drawn above the capline, and below the font maximum.

Alias: C=
CHARSPACETYPE=DATA | FIXED | NONE | UNIFORM

specifies the type of intercharacter spacing. The following are valid values:

DATA

specifies that the first observation for each character sets the width of that character. When CHARSPACETYPE=DATA, the PTYPE variable is required, and the observation that specifies the width of the character must have a PTYPE value of W. See The Font Data Set for details on the PTYPE variable.

Intercharacter spacing is included in the character's width. If the first observation for the letter A specifies a character width of 10 units, and the A occupies 8 units, the remaining 2 units serve as intercharacter spacing.

Note:   The character can extend beyond the width that you specified in the first observation if desired.  [cautionend]

FIXED

adds a fixed amount of space between characters based on the font size. The width of the individual character is determined by the data that generates the character.

NONE

specifies that no space is added between characters. The width of the individual character is determined by the data that generates the character. This type of spacing is useful for script fonts in which the characters should appear connected.

UNIFORM

specifies that the amount of space that is used for each character is uniform, not proportional. Each character occupies the same amount of space. In uniform spacing the letters m and i occupy the same amount of space, in proportional spacing m occupies more space than i. In uniform spacing, the character is always centered in the space, and a fixed space is added between characters.

When UNIFORM is specified, the amount of space that is used for each character is one of the following:

Alias: CSP=
Default: CHARSPACETYPE=FIXED
Note: Specifying CHARSPACETYPE=UNIFORM is the same as using the UNIFORM option.
CODELEN=1 | 2

specifies the length in bytes of the CHAR variable. To specify double-byte character sets for languages such as Chinese, Japanese, or Korean, use CODELEN=2.

FILLED

specifies that the characters in a polygon font are filled.

Alias: F
Default: 1
Featured in: Creating Figures for a Symbol Font.
Restriction: If you specify a double-byte character set, the KERNDATA= option and SPACEDATA= option are ignored.
KERNDATA=kern-data-set

specifies the data set that contains kerning information. When the KERNDATA= option is used during font creation, the data that is contained in the kern data set is applied and stored with the font.

Alias: KERN=
See also: The Kern Data Set
Restriction: If you specify kerning for a double-byte character set that is created by using the option CODELEN=2, then the KERNDATA= option is ignored.
MWIDTH=character-width

specifies the width of a character in a uniform font, where character-width is the number of font units. The MWIDTH= option is valid when you specify uniform spacing by using the UNIFORM option or when you specify CHARSPACETYPE=UNIFORM. If you omit the MWIDTH= option, the default is the width of the widest character in the font (usually the letter m).

The MWIDTH= option is typically used to tighten the spacing between characters. To do this, specify a smaller value for character-width. Using the MWIDTH= Option to Modify Spacing shows the effect of decreasing the space that is allowed for uniformly spaced characters.

Using the MWIDTH= Option to Modify Spacing

[Using the MWIDTH= Option to Modify Spacing]

See also: the CHARSPACETYPE= option and the UNIFORM option
NODISPLAY

specifies that the GFONT procedure is not to display the font that it is creating.

Alias: ND
NOKEYMAP

specifies that the current key map is ignored when you create and then use the font that is created. The character codes you enter are not mapped in any way before being displayed. As a result, the created font is never affected by any setting of the KEYMAP= graphics option.

CAUTION:
Fonts created with the NOKEYMAP option are never affected by any setting of the KEYMAP= graphics option.   [cautionend]

By default, the NOKEYMAP option is not used; in that case, when you build a font, the current key map is applied to the values in the CHAR variable.

However, your current key map might not be symmetrical; two or more input character codes might be mapped to the same output character. For example, if A is mapped to B, then both A and B map to B, but nothing maps to A. In this case, more than one code in your input data set can map to the same character in the resulting font. For example, if A and B are values of CHAR, both map to B. If this happens, a message that indicates the problem characters is displayed in the SAS log. To solve this problem, do one of the following tasks:

  • change the character code of one of the characters

  • eliminate one of the characters

  • use the NOKEYMAP option

The NOKEYMAP option works correctly only if the end user's host or controller encoding is the same as the encoding used to create the input data set.

See also: the NOKEYMAP= option for Displaying Fonts.
RESOL=1...4

controls the resolution of the fonts by specifying the number of bytes (1 through 4) for storing coordinates in the font. The GFONT procedure provides three resolution levels (RESOL=3 produces the same resolution level as RESOL=4). By default, RESOL=1.

The higher the number, the closer together the points that define the character can be spaced. A high value specifies a denser set of points for each character so that the characters approximate smooth curved lines at very large sizes. RESOL=2 works well for most applications; RESOL=3 or 4 might be too dense to be practical.

The table below shows the resolution number and the maximum number of distinct points that can be defined horizontally or vertically.

Resolution Number of Distinct Points
2 32,766
3 2,147,483,646
4 2,147,483,646

Alias: R=
Featured in: Creating Figures for a Symbol Font.
ROMHEX

specifies that hexadecimal values display automatically below the font characters when the GFONT procedure displays the font. If you use the ROMHEX option for a font that you create, you can later use the NOROMHEX option to suppress display of the hexadecimal values.

Alias: HEX
See also: the SHOWROMAN option, the ROMHEX option for Displaying Fonts, and the NOROMHEX option.
SHOWROMAN

specifies that character codes display automatically below the font characters when the GFONT procedure displays the font. If you use the SHOWROMAN option for a font you create, you can later use the NOROMAN option to suppress display of the character codes.

Alias: SR
See also: the ROMHEX option, the SHOWROMAN option for Displaying Fonts, and the NOROMAN option.
SPACEDATA=space-data-set

specifies the SAS data set that contains font spacing information. When you use the SPACEDATA= option during font creation, the data contained in the space data set is applied to the font and stored with it.

Alias: SPACE=
See also: The Space Data Set.
Restriction: If you specify the SPACEDATA= option for a double-byte character set that is created by using the option CODELEN=2, then the SPACEDATA= option is ignored.
UNIFORM

specifies that characters are spaced uniformly rather than proportionately. Using the UNIFORM option is the same as specifying CHARSPACETYPE=UNIFORM.

Alias: U
See also: the CHARSPACETYPE= option and the MWIDTH= option.

Previous Page | Next Page | Top of Page