FOCUS AREAS

Return to Universal Printing

Base SAS

Creating Alias Font Names for SAS Universal Printers

When SAS templates or ODS style definitions contain hard-coded font names, national character support may be limited to Latin-1 characters sets covering only the languages of the Americas and western Europe. Editing each utility or template outside these geographies is labor-intensive and, fortunately, unnecessary.

In SAS 9 and later, if you need national characters in templates or ODS style definitions that are not provided in the default fonts, you can alias the font names instead of editing each template or style definition. The examples are programming statements you submit to SAS to alias the default fonts to other fonts containing the national characters you need.

The following are examples of alias font names.

"Courier"="<ttf> Courier New"
"sans-serif"="<ttf> Arial Unicode MS"

The font "<ttf> Courier New" can be used by just specifying "Courier". All references to a sans-serif font in the ODS style definitions will use "<ttf> Arial Unicode MS".

In countries covered by the Latin-1 character set, most PCs will have a number of TrueType fonts available for you to use. Server PCs may have only a few font names with typefaces similar to Arial, Courier, Times Roman, Symbol and/or Wingdings.

After locating the TrueType fonts you wish to use, create alias font names in the SAS Registry with the following steps:

  1. Make the fonts available to SAS by registering them with PROC FONTREG.
  2. Export these newly registered fonts in your SASUSER directory to a file.
  3. Import this file to your SASHELP directory.
  4. Select a printer and create a list of relevant font and alias names.
  5. Import the list of font and alias names to update the printer.


Examples

Example 1

The SAS programming statements below register the TrueType fonts in your Windows font directory with the SAS Registry, create a file, arialpdf.sasxreg, and then update the SAS Registry with the information contained in arialpdf.sasxreg.

The file arialpdf.sasxreg creates the font family "Arial" and the font alias "sans-serif" to reference the TrueType font, Arial Unicode MS. It also changes the default font for the PDF printer to Arial Unicode MS. You could also create this file with a text editor and import it with the PROC REGISTRY statement.

This job assumes that whoever runs it has administrator rights to the SASHELP directory.

proc fontreg; fontpath "%sysget(systemroot)\Fonts"; run;

data _null_;
file "c:arialpdf.sasxreg";
input line $80.;
put line;
lines;
[CORE\PRINTING\PDF\FONT FAMILIES]
"Arial"="<ttf> Arial Unicode MS"
[CORE\PRINTING\ALIAS\FONTS\PDF]
"san-serif"="<ttf> Arial Unicode MS"
[CORE\PRINTING\PRINTERS\PDF\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PRINTERS\PDF\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Arial Unicode MS"
run;

proc registry import="c:arialpdf.sasxreg"; run;

Example 2

The SAS program below updates the PDF printer and its fonts. This job assumes that whoever runs it has administrator rights to the SASHELP directory.
/* Register all fonts in your system's fonts directory with SAS */
proc fontreg;
   fontpath "%sysget(systemroot)\Fonts";
run;

 /* Export all fonts currently registered in your SASUSER directory to a file, fonts.sasxreg */
proc registry export="C:fonts.sasxreg" startat="core\printing\freetype\fonts"; run;

 /* Import fonts.sasxreg to your sashelp */
proc registry import="C:fonts.sasxreg" usesashelp;
run;

 /* Create aliases for PDF font families in the file ttfpdf.sasxreg */
data _null_;
 file "C:ttfpdf.sasxreg";
 input line $80.;
 put line;
 lines;
[CORE\PRINTING\PDF\FONT FAMILIES]
"AvantGardeGothic"="<ttf> MS Gothic"
"Bookman"="<ttf> Times New Roman"
"Chancery"="<ttf> Times New Roman"
"Courier"="<ttf> Courier New"
"Dingbats"="<ttf> Wingdings"
"Helvetica"="<ttf> Arial"
"NewCenturySchoolbook"="<ttf> Times New Roman"
"Palatino"="<ttf> Palatino Linotype"
"Symbol"="<ttf> Symbol"
"Times"="<ttf> Times New Roman"
[CORE\PRINTING\ALIAS\FONTS\PDF]
"Century Schoolbook"="<ttf> Century Schoolbook"
"NewCenturySchlbk"="<ttf> Times New Roman"
"Times New Roman"="<ttf> Times New Roman"
"ZapfChancery"="<ttf> Times New Roman"
"ZapfDingbats"="<ttf> Wingdings"
"ITC Bookman"="<ttf> Times New Roman"
"Courier"="<ttf> Coutier New"
"SAS Monospace"="<ttf> Courier"
"Palatino"="<ttf> Palatino Linotype"
"Times"="<ttf> Times New Roman"
"monospace"="<ttf> Courier New"
"san-serif"="<ttf> Arial"
"serif"="<ttf> Times New Roman"
[CORE\PRINTING\PRINTERS\PDF\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PRINTERS\PDF\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.3 (Partial Font Embedding)\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.3 (Full Font Embedding)\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.3 (Full Font Embedding)\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.3\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.3\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.2 (Partial Font Embedding)\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.2 (Partial Font Embedding)\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.2 (Full Font Embedding)\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.2 (Full Font Embedding)\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.2\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.2\ADVANCED]
"FONT FAMILIES"=LINK:"\\CORE\\PRINTING\\PDF\\FONT FAMILIES"
[CORE\PRINTING\PROTOTYPES\PDF Version 1.3 (Partial Font Embedding)\DEFAULT SETTINGS]
"Font Typeface"="<ttf> Courier New"
run;

 /* Import the PDF font family aliases into the SAS Registry */
proc registry import="C:ttfpdf.sasxreg" usesashelp;
run;

Recommended Reading

See also the following information: