FONTREG Procedure

Concepts: FONTREG Procedure

Supported Font Types and Font Naming Conventions

When a font is added to the SAS registry, the font name is prefixed with a three-character tag, enclosed in angle brackets (< >). This prefix indicates the font type. For example, if you add the TrueType font Arial to the SAS registry, then the name in the registry is <ttf> Arial. This naming convention enables you to add and distinguish between fonts that have the same name but are of different types. When you specify a font in a SAS program (for example, in the TEMPLATE procedure or in the STYLE= option in the REPORT procedure), use the tag to distinguish between fonts that have the same name:
proc report data=grocery nowd
            style(header)=[font_face='<ttf> Palatino Linotype'];
run;
If you do not include a tag in your font specification, SAS searches the registry for fonts with that name. If more than one font with that name is found, SAS uses the font that has the highest rank in the following table.
Supported Font Types
Rank
Type
Tag
File extension(s)
1
TrueType
<ttf>
.ttf
2
Type1
<at1>
.pfa
.pfb
Note: OpenType font is an extension of TrueType font and is supported by SAS.
Note: SAS does not support any type of nonscalable fonts that require FreeType font-rendering. Even if they are recognized as valid fonts, they will not be added to the SAS registry.
Note: PDF and PostScript do not support double-byte Type1 fonts.
Font files that are not produced by major vendors can be unreliable, and in some cases SAS might not be able to use them.
The following SAS output methods and device drivers can use FreeType font-rendering:
  • SAS/GRAPH GIF, GIF733, GIFANIM
  • SAS/GRAPH JPEG
  • SAS/GRAPH PCL
  • SAS/GRAPH PNG
  • SAS/GRAPH SASEMF
  • SAS/GRAPH SASWMF
  • SAS/GRAPH TIFFP, TIFFB
  • Universal EMF
  • Universal PNG
  • Universal Printing GIF
  • Universal Printing PCL
  • Universal Printing PDF
  • Universal PS
  • Universal SVG

Registering Fonts with PROC FONTREG

PROC FONTREG is used to register fonts in the SAS Registry. For example, if you have a Type1 or OpenType font in your Windows font directory, you can register the font, as well as all of the other font files in that Window’s font directory, by submitting the following code:
proc fontreg mode=add;
fontpath '!SYSTEMROOT\fonts';
run;

Removing Fonts from the SAS Registry

You can remove a font from the SAS registry in the following ways:
  • by using the SAS Registry Editor
  • by using PROC REGISTRY
  • by using the REMOVE statement in PROC FONTREG
To remove a font by using the SAS Registry Editor, select Solutionsthen selectAccessoriesthen selectRegistry Editor. Alternatively, you can enter regedit in the command window or Command ===> prompt.
SAS Registry Editor
SAS Registry Editor
In the left pane of the Registry Editor window, navigate to the [CORE\PRINTING\FREETYPE\FONTS] key. Select the font that you want to delete, and use one of these methods to delete it:
  • Right-click the font name and select Delete from the menu.
  • Select the Delete button Delete button .
  • Select Editthen selectDeletethen selectKey.
To delete a font by using PROC REGISTRY, submit a program similar to the following example. This example removes the <ttf> Arial font.
/* Write the key name for the font to an external file */
proc registry export='external-filename'
              startat='core\printing\freetype\fonts\<ttf> Arial';
run;

/* Remove the "<ttf> Arial" font from the SAS registry */
proc registry
uninstall='external-filename' fullstatus;
run;
To delete a font by using the REMOVE statement in PROC FONTREG, see REMOVE Statement.
For more information about PROC REGISTRY, see REGISTRY Procedure.

Font Aliases and Locales

The FONTFILE, FONTPATH, and TRUETYPE statements support aliases and locales. If the font that is being processed contains a localized name in the same locale as the current SAS session, then an alias of that localized name will be added to the SAS registry to reference the font family.