Using Fonts with Universal Printers and SAS/GRAPH Devices

Rendering Fonts

In SAS 9.3, TrueType and Type1 fonts are rendered by using the FreeType library or by exercising the font-rendering capabilities of the host.
Note: Universal Printing and SAS/GRAPH do not support double-byte Type1 fonts.
Output methods that use the FreeType library are preferred because they can render fonts in all of the operating environments that SAS supports. The following Universal Printers and SAS/GRAPH devices are recommended because they use the FreeType library.(footnote1) to render fonts.
Devices That Use the FreeType Library to Render Fonts
Output Method
Device
SAS/GRAPH devices
UGIF, UPCL5, UPCL5C, UPCL5E, UPDF, UPNG, UPNGT, UPSL, UPSLC, UEMF
GIF, GIFANIM, GIF733, HTML, WEBFRAME
TIFFB, TIFFP, TIFFG3, TIFFB300, TIFFP300
SASBMP
JPEG
PCL5, PCL5C, PCL5E
PDF, PDFC, PDFA
PNG, PNGT, PNG300
PSL, PSCOLOR, PSLEPSF, PSLEPSFC
SVG, SVGT, SVGVIEW, and SVGZ1
SASEMF, SASWMF2
SASPRTC, SASPRTG, SASPRTM printer interface devices
ODS printing and Universal Printing
EMF universal printer2
GIF
PCL5, PCL5C, PCL5E
PDF, PDFA
PNG, PNGT, PNG300
PostScript
SVG, SVGT, SVGZ, SVGView, and SVGnotip
SVGANIM
ODS RTF
PNG, UEMF, SASEMF 1
ODS HTML
PNG, PNGT, PNG300, GIF, JPEG, SASBMP, SVG, SVGT 1
1If the NOFONTRENDERING option is set, SVG uses the FreeType library only for measuring the text. The font rendering is done by the browser using system installed fonts.
2These devices use the FreeType library only for measuring text. The final font rendering is done by an application such as Microsoft Word, which displays the output using system installed fonts.
Font embedding allows the fonts used in the creation of output to travel with that output, ensuring that it is displayed or printed exactly as you intended. For more information about the FONTEMBEDDING system option see FONTEMBEDDING System Option in SAS System Options: Reference.
Note: Not all browsers support font embedding.
The following table lists the devices and output methods that use host font-rendering only.
Devices That Use Host Font-Rendering Only
Output Method
Device
SAS/GRAPH devices
ACTIVEX, ACTXIMG, JAVA, JAVAIMG
Note: These are client devices.
BMP, BMP20
DIB
EMF, WMF
ZGIF, ZGIF733, ZGIFANIM, ZHTML, ZWEBFRAM, ZJPEG, ZPNG, ZSASBMP
ZTIFFB, ZTIFFBII, ZTIFFBMM, ZTIFFG3, ZTIFFG4, ZTIFFP
Devices That Use FreeType Font-Rendering or Host Font-Rendering
Output Method
Device
SAS/GRAPH devices
GIF160, GIF260
Note: GIF160 and GIF260 use host font-rendering by default.
Note: Text is rendered at very small sizes.
GIF, GIFANIM, GIF733, HTML, WEBFRAME
Note: These devices use FreeType font-rendering by default.
TIFFB, TIFFP, TIFFG3, TIFFBII, TIFFBMM, TIFFB300, TIFFP300
Note: These devices use FreeType font-rendering by default.
JPEG
Note: The JPEG device uses FreeType font-rendering by default.
Note: You can set OPTIONS FONTRENDERING= FREETYPE_POINTS | HOST_PIXELS to change the rendering method for devices that support both FreeType library and host rendering.
UNIX Specifics: With devices that use host rendering in a UNIX operating environment, the TrueType fonts must be installed in the X server that is being used. This is usually specified by the DISPLAY environment variable. For more information, see the Configuration Guide for SAS 9.3 Foundation for UNIX Environments.

ODS Styles and TrueType Fonts

By default, many SAS/GRAPH device drivers and all Universal Printers generate output by using ODS styles, and these ODS styles use TrueType fonts. If no style is specified, the default style is used. If you want the appearance of graphs to be compatible with graphs that were generated prior to SAS 9.2, set the GSTYLE system option to specify NOGSTYLE. For information about the GSTYLE System Option, see GSTYLE System Option in SAS System Options: Reference.

Portability of TrueType Fonts

TrueType fonts are portable across operating environments and are always available in Microsoft Windows environments. A few TrueType fonts are included with some versions of UNIX X Windows.

International Character Support

TrueType fonts support a wide range of international characters. For more information about SAS code that uses TrueType fonts, see Examples of Specifying Fonts and Printing International Characters.

TrueType Fonts Supplied by SAS

When you install SAS, a number of TrueType fonts are available based on choices that were made during the installation. TrueType fonts that are supplied by SAS can be categorized into four groups: Windows Gylph List (WGL) Pan-European character set fonts that are compatible with Microsoft; graphic symbol; multilingual; and monolingual Asian. These fonts are about the same shape and size as the Microsoft fonts and can be substituted for the Microsoft fonts without changing formatting or paging. The following table shows the SAS font and the compatible Microsoft font.
Windows Gylph List (WGL) Pan-European Character Set Fonts That Are Compatible with Microsoft
Font Name
Font Description
Compatibility with Microsoft Font
Albany AMT
sans-serif
Arial
Thorndale AMT
serif
Times New Roman
Cumberland AMT
serif fixed1
Courier New
1Fixed refers to uniform spacing.
Graphic Symbol TrueType Fonts
Font Name
Font Description
Compatibility with Microsoft Font
Compatibility with Adobe Type1 Font
Symbol MT
192 symbols
Symbol
Symbol
Monotype Sorts1
205 Wingding characters
Not applicable1
Not applicable1
Arial Symbol
42 symbols2
Not applicable
Not applicable
Arial Symbol Bold
42 symbols2
Not applicable
Not applicable
Arial Symbol Bold Italic
42 symbols2
Not applicable
Not applicable
Arial Symbol Italic
42 symbols2
Not applicable
Not applicable
Times New Roman Symbol
42 symbols2
Not applicable
Not applicable
Times New Roman Symbol Bold
42 symbols2
Not applicable
Not applicable
Times New Roman Symbol Bold Italic
42 symbols2
Not applicable
Not applicable
Times New Roman Symbol Italic
42 symbols2
Not applicable
Not applicable
1SAS Monotype Sorts is an ornamental font consisting of shapes, symbols, and decorative glyphs that have no one-to-one mapping to Microsoft TrueType or Adobe Type1 fonts. However, the SAS Monotype Sorts font closely resembles Microsoft "Wingdings" TrueType and Adobe "ITC Zapf Dingbats" Type1 fonts.
2These fonts have special glyphs for the Latin characters 0, <. =, C, D, L, M, N, P, R, S, U, V ,W, X, Z, and a–z. All other characters are undefined and might be rendered as a rectangle. For example, in the HTML destination, the rectangle is replaced with the matching Latin1 character when it is displayed in Internet Explorer.
Multilingual TrueType Fonts
Language Supported
Font Name
Font Description
Japanese
Monotype Sans WT 1
sans-serif
Thorndale Duospace WT J1
serif
Korean
Monotype Sans WT K1
sans-serif
Thorndale Duospace WT K1
serif
Simplified Chinese
Monotype Sans WT SC1
sans-serif
Thorndale Duospace WT SC1
serif
Traditional Chinese
Monotype Sans WT TC1
sans-serif
Thorndale Duospace WT TC1
serif
1Both Thorndale Duospace WT and Monotype Sans WT support HKSCS (Hong Kong Supplement Character Set) and substantially support the GB18030 standard.
Monolingual Asian TrueType Fonts
Language Supported
Font Name
Character Set
Japanese
MS Gothic, MS UI Gothic, MS PGothic
Shift JIS
MS Mincho, MS PMincho
Shift JIS
Korean
Gulim, GulimChe, Dotum, DotumChe
KSC5601
Batang, BatangChe, Gungsuh, GungsuhChe
KSC5601
Simplified Chinese
Sim Hei
GB2312
SimSun, NSimSun
GB2312
Traditional Chinese1
HeiT
Big5
MingLiU, MingLiU_HKSCS, PMingLiU
Big5
1HeiT, MingLiU, MingLiU_HKSCS, and PMingLiu support HKSCS2004 (Hong Kong Supplemental Character Set) characters.
The fonts that are supplied by SAS and the fonts that are already installed on Windows are automatically registered in the SAS registry when you install SAS. Fonts already installed on UNIX and z/OS must be registered manually in the SAS registry after you install SAS. To register other TrueType Fonts, see Registering Fonts.

Registering Fonts

Fonts Supported by SAS

In addition to the TrueType fonts that come installed with SAS, SAS supports PostScript Type1 fonts. The following table shows the font prefix and file extension for TrueType and Type1 fonts:
Supported Font Types for SAS 9.3
Type
Tag
File Extension
TrueType
<ttf>
.ttf
Type1
<at1>
.pfb 1
1Data from a .pfm file is used to generate output using the SAS/GRAPH SASEMF and SASWMF devices on Windows. On UNIX and z/OS, data from a .pfm file is used to generate output using the WMF device and the EMF universal printer. This file is not required to register Type1 fonts using PROC FONTREG. If you do not register a .pfm file, you might not have the desired results.

Registering Fonts with the SAS Registry

To use TrueType or Type1 fonts that are not registered when SAS is installed, use the FONTREG procedure to register these fonts in the SAS registry. For more information, see FONTREG Procedure in Base SAS Procedures Guide.
Note: The fonts that are supplied by SAS and the fonts that are installed by Microsoft are automatically registered in the SAS registry when you install SAS. Fonts that are installed after you install SAS must be registered manually in the SAS registry.

Registering Fonts for UNIX, Windows, or the z/OS HFS File System

Submit the following SAS program. The FONTPATH statement specifies the directory that contains the fonts and pathname is the directory path of the fonts.
proc fontreg;
   fontpath 'pathname';
run;
For more information about adding fonts to the SAS Registry, see FONTREG Procedure in Base SAS Procedures Guide.
Note: In Microsoft Windows environments, TrueType fonts are usually located in either the C:\WINNT\Fonts or C:\Windows\Fonts directory. For all other operating environments, contact your system administrator for the location of the TrueType font files.
For more information, see FONTREG Procedure in Base SAS Procedures Guide.

Registering Fonts for z/OS

On z/OS systems that do not use the HFS file system, you can use the FONTFILE statement instead of the FONTPATH statement to specify the fixed block sequential file that contains a font. Because the default value of MODE= option is ALL, the PROC statement below adds new fonts that do not already exist in the SAS registry and replaces fonts that already exist in the SAS registry.
proc fontreg;
    fontfile 'filename';
run;
z/OS Specifics: When you add fonts to a z/OS system, the font file must be allocated as a sequential data set with a fixed block record format and a record length of 1.
For more information, see FONTREG Procedure in Base SAS Procedures Guide.

Listing the Registered Fonts for a Device

You can use the QDEVICE procedure to view the list of fonts that have been registered in the SAS registry, including fonts that you registered with the FONTREG procedure. You can submit the following program to view fonts for a device or universal printer.
/* Macro FONTLIST - Report fonts supported by a device */

%macro fontlist(type, name);
proc qdevice report=font out=fonts;
   &type &name;
   var font ftype fstyle fweight;
run;

data; 
   set fonts;
   drop ftype;
   length type $16;
   if ftype = "System"
     then do;
	    if substr(font,2,3) = "ttf" then type = "TrueType";
	      else if substr(font,2,3) = "at1" then type = "Adobe Type1";
	      else if substr(font,2,3) = "cff" then type = "Adobe CFF/Type2";
	      else if substr(font,2,3) = "pfr" then type = "Bitstream PFR";
	      else type = "System";
	    if type ^= "System" then font = substr(font,7,length(font)-6);
	      else if substr(font,1,1) = "@" then font = substr(font, 2,length(font)-1);
       end;
       else type = "Printer Resident";
run;

proc sort;
   by font;
run;

title "Fonts Supported by the %upcase(&name) &type";

proc print label;
   label fstyle="Style" fweight="Weigth" font="Font" type="Type";
run;

%mend fontlist;

%fontlist(printer, pdf)
%fontlist(device, pdf)
%fontlist(device, win)
%fontlist(printer, png)
%fontlist(device, pcl5c)
Here is the output for the first 20 fonts in the output data set::
Fonts for the PDF Printer
Fonts for the PDF Printer
For more information, see QDEVICE Procedure in Base SAS Procedures Guide.

Using Fonts

Specifying Fonts with the Print Dialog Box

After you update the SAS Registry, the newly registered fonts are available for use within SAS. To access the fonts interactively when Universal Printing is enabled, follow these steps:
  1. Select Filethen selectPrint.
  2. Select an appropriate printer, such as PDF or PCL5.
  3. Click the Properties button.
  4. Click the Font tab.
    This window contains drop-down boxes for Font, Style, Weight, Size (in points), and Character Set.
  5. Click the arrow on the right side of the Font box and scroll through the list of available fonts.
    TrueType fonts are indicated by the letters ttf enclosed in angle brackets (< >), and Type1 fonts are indicated by the letters at1 enclosed in angle brackets (< >). For example, the TrueType font Albany AMT is listed as <ttf> Albany AMT and the Type1 Font Times is listed as <at1> Times. The three-character tag enclosed in angle brackets makes the distinction between the different types of fonts with the same name, such as <ttf> Symbol and a Symbol font that resides on a physical printer. Fonts that do not have a <ttf> tag or an <at1> tag reside in the printer's memory. To ensure that you are using SAS fonts when you specify a font that has different types, such as the Symbol font, use only the font syntax with the angled brackets. For example, <ttf> Symbol.
    If you designate PDF as the printer, the font is in the Adobe Reader rather than on a physical printer.
  6. Select the font that you want to use.
  7. Click OK to return to the Print dialog box.
  8. Click OK to create your output.

Specifying Fonts with SAS Program Statements

You can specify a font in the TITLE statement. For example, if you want to use the TrueType font Albany AMT on a TITLE statement, include the following line of code in your SAS program.
Title1 f="Albany AMT"  "Text in Albany AMT";
You can also specify attributes such as style or weight in the TITLE statement by using the forward slash (/) as a delimiter.
Title1 f="Albany AMT/Italic/Bold" "Text in Bold Italic Albany AMT";
For ODS templates, the attributes are specified after the text size parameter. See Specifying a Font with PROC PRINT and a User-Defined ODS Template for a complete example.
Note: You should use the <ttf> tag only when it is necessary (for example, to distinguish between a TrueType font and another type of font with the same name).

Specifying a Font with the SYSPRINTFONT Option

The SYSPRINTFONT= system option sets the default font that you want to use for printing from windows such as the Program Editor, the Log, and Output windows. For example, you could use the SYSPRINTFONT= system option to print your output in the Albany AMT font by submitting the following OPTIONS statement.
options sysprintfont=("Albany AMT");
You can also use the SYSPRINTFONT= system option to specify the weight and size of a font. For example, the following code specifies an Arial font that uses bold face, is italicized, and has a size of 14 points.
options sysprintfont=("Arial" bold italic 14);
You can override the default font by explicit font specifications or ODS styles.
For more information, see the SYSPRINTFONT= System Option in SAS System Options: Reference.

Examples of Specifying Fonts and Printing International Characters

Specifying a Font with SAS/GRAPH

The following example creates an output file, sasprt.pdf, with a title in the Albany AMT font that uses bold face and is italicized.
options printerpath=pdf device=sasprtc;
ods printer;
title1 color=black f="Albany AMT/Italic/Bold" "Sample Title in Bold Italic Albany AMT";
proc gplot data=sashelp.class;
plot height*weight;
run;
quit;
ods printer close;
Note: The DEVICE= option defaults to either SASPRTM, SASPRTG, or SASPRTC, depending on the type of printer. If PRINTERPATH=PCL5, which is a monochrome printer, ODS PRINTER defaults to SASPRTM.
GPLOT Output
GPLOT Output

Specifying a Font with PROC PRINT

The following example produces an output file ,print1.pdf, with the titles in the Albany AMT, Thorndale AMT, and Cumberland AMT fonts.
filename new 'print1.pdf';
options printerpath=(PDF new) device=sasprtc obs=5;
ods printer;
proc print data=sashelp.class;
   title1 f='Albany AMT' h=2 'TrueType Albany AMT';
   title2 f='Thorndale AMT' h=3 'Thorndale AMT';
   title3 f='Cumberland AMT' 'Cumberland AMT ';
run;
ods printer close;
PDF Output Using PROC PRINT
PDF Output Using PROC PRINT

Specifying a Font with PROC PRINT and a User-Defined ODS Template

The following example creates a template of font styles and then produces a PDF file.
filename out 'print2.pdf';

options printerpath=(pdf out) device=sasprtc;
proc template;
   define style New_style / store = SASUSER.TEMPLAT;
   parent = styles.printer;
   replace fonts /
    'docFont'             = ("Thorndale Duospace WT J", 12pt)
    'headingFont'         = ("Albany AMT", 10pt, bold)
    'headingEmphasisFont' = ("Albany AMT", 10pt, bold italic)
    'TitleFont'           = ("Albany AMT", 12pt, italic bold) 
    'TitleFont2'          = ("Albany AMT", 11pt, italic bold)
    'FixedFont'           = ("Cumberland AMT", 11pt)
    'BatchFixedFont'      = ("Cumberland AMT", 6pt)
    'FixedHeadingFont'    = ("Cumberland AMT", 9pt, bold)
    'FixedStrongFont'     = ("Cumberland AMT", 9pt, bold)
    'FixedEmphasisFont'   = ("Cumberland AMT", 9pt, italic)
    'EmphasisFont'        = ("Albany AMT", 10pt, italic)
    'StrongFont'          = ("Albany AMT", 10pt, bold);
end;
run;

ods printer style=New_style;
proc print data=sashelp.class;
  title1  'Proc Print';
  title2  'Templated ODS output';
run; 
ods printer close;
PDF Output Using PROC PRINT and a User-Defined ODS Template
PDF Output Using PROC PRINT and a User-Defined ODS Template

Printing International Characters

Example 1
The following example produces an output file, titles.png. It is printed ten Unicode characters.
filename new 'titles.png';
options printerpath=(png new)device=sasprtc;
ods printer;

proc gslide;
   title1 "Printing Unicode code points";
   title2 "double exclamation mark" f="Monotype Sans WT SC/Unicode" h=2 '203C'x;
   title3 "French Franc symbol " f="Monotype Sans WT SC/Unicode" h=3 '20A3'x;
   title4 "Lira symbol " f="Monotype Sans WT SC/Unicode" h=3 '20A4'x;
   title4 "Rupee symbol " f="Monotype Sans WT SC/Unicode" h=3 '20A8'x;
   title5 "Euro symbol " f="Monotype Sans WT SC/Unicode" h=3 '20Ac'x;
   title6 "Fraction, one third " f="Monotype Sans WT SC/Unicode" h=3 '2153'x;
   title7 "Fraction, one fifth " f="Monotype Sans WT SC/Unicode" h=3 '2155'x;
   title8 "Fraction one eighth " f="Monotype Sans WT SC/Unicode" h=3 '215B'x;
   title9 "Black Florette " f="Monotype Sans WT SC/Unicode" h=3 '273F'x;
   title10 "Black Star " f="Monotype Sans WT SC/Unicode" h=3 '2605'x;
run;
quit;
ods printer close;
Output of Ten Unicode Characters
Output of Ten Unicode Characters
Example 2
The following example produces an output file, utf8.gif. It must be run with a UTF-8 server and requires a TrueType font that contains the characters that are used. The table of character names and the associated codes can be found on the Unicode Web site at http://www.unicode.org/charts.
proc template;
   define style utf8_style / store = SASUSER.TEMPLAT;
   parent = styles.printer;
   replace fonts /
    'docFont'             = ("Monotype Sans WT J", 12pt)
    'headingFont'         = ("Monotype Sans WT J", 10pt, bold)
    'headingEmphasisFont' = ("Monotype Sans WT J", 10pt, bold italic)
    'TitleFont'           = ("Monotype Sans WT J", 12pt, italic bold)
    'TitleFont2'          = ("Monotype Sans WT J", 11pt, italic bold)
    'FixedFont'           = ("Thorndale Duospace WT J", 11pt)
    'BatchFixedFont'      = ("Thorndale Duospace WT J", 6pt)
    'FixedHeadingFont'    = ("Thorndale Duospace WT J", 9pt, bold)
    'FixedStrongFont'     = ("Thorndale Duospace WT J", 9pt, bold)
    'FixedEmphasisFont'   = ("Thorndale Duospace WT J", 9pt, italic)
    'EmphasisFont'        = ("Monotype Sans WT J", 10pt, italic)
    'StrongFont'          = ("Monotype Sans WT J", 10pt, bold);
end;
run%macro utf8chr(ucs2);
 kcvt(&ucs2, 'ucs2b', 'utf8');
%mend utf8chr;
%macro namechar(name, char);
 name="&name"; code=upcase("&char"); char=%utf8chr("&char"x); output;
%mend namechar;

data uft8char;
length name $40;
%namechar(Registered Sign, 00AE);
%namechar(Cent Sign, 00A2);
%namechar(Pound Sign, 00A3);
%namechar(Currency Sign, 00A4);
%namechar(Yen Sign, 00A5);
%namechar(Rupee Sign, 20A8);
%namechar(Euro Sign, 20Ac);
%namechar(Dong Sign, 20Ab);
%namechar(Euro-currency Sign, 20A0);
%namechar(Colon Sign, 20A1);
%namechar(Cruzeiro Sign, 20A2);
%namechar(French Franc Sign, 20A3);
%namechar(Lira Sign, 20A4);
run;

options printerpath=(gif out) device=sasprtc;
filename out 'utf8.gif';

ods printer style=utf8_style;
proc print;
run;
ods printer close;
Output of International Characters
Output of International Characters
FOOTNOTE 1:The FreeType library is used to perform two distinct operations in SAS: measuring the text and rendering the font. Depending on the output devices specified, the FreeType library can perform one or both of these operations. to render fonts.[return]