Previous Page | Next Page

Printing with SAS

Using TrueType Fonts with Universal Printers and SAS/GRAPH Devices in SAS 9.2


Rendering TrueType Fonts

In SAS 9.2, TrueType fonts are rendered using the FreeType library or by exercising the font-rendering capabilities of the host.

Rendering TrueType fonts with the FreeType library is the preferred method because fonts can be rendered for output in all of the operating environments that SAS supports. All Universal Printers and many SAS/GRAPH devices use the FreeType library to render TrueType fonts.

The following SAS output methods and devices use the FreeType library:

The following SAS/GRAPH devices use host font rendering only:

The following SAS/GRAPH devices also use host font rendering:

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.  [cautionend]

Note:   With devices that use host rendering in a UNIX operating environment, the TrueType fonts must be installed for the display in order for the fonts to work. For more information, see the Configuration Guide for SAS 9.2 Foundation for UNIX Environments.  [cautionend]


ODS Styles and TrueType Fonts

By default, many SAS/GRAPH device drivers and all Universal Printers will generate output by using ODS styles, and these ODS styles use TrueType fonts. If no style is specified, the default style is the style for the listing output unless the ODS LISTING destination is closed. If you want the appearance of graphs to be compatible with graphs that were generated before SAS 9.2, you can set the GSTYLE system option to NOGSTYLE.


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 That Are Supplied by SAS

When you install SAS, in addition to SAS Monospace and SAS Monospace Bold, 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, as shown in the following tables.

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
1 Fixed 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 Sorts 205 Wingding characters Wingdings ITC Zapf Dingbats
Arial Symbol 42 symbols1 Not applicable Not applicable
Arial Symbol Bold 42 symbols1 Not applicable Not applicable
Arial Symbol Bold Italic 42 symbols1 Not applicable Not applicable
Arial Symbol Italic 42 symbols1 Not applicable Not applicable
Times New Roman Symbol 42 symbols1 Not applicable Not applicable
Times New Roman Symbol Bold 42 symbols1 Not applicable Not applicable
Times New Roman Symbol Bold Italic 42 symbols1 Not applicable Not applicable
Times New Roman Symbol Italic 42 symbols1 Not applicable Not applicable
1 These 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, with ODS destinations such as HTML, the rectangle is replaced with the matching Latin1 character when it is displayed in Internet Explorer.

Multlingual TrueType Fonts
Language Supported Font Name Font Description
Japanese Monotype Sans WT J1 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
1 Both Thorndale Duospace WT and Monostype 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 SimSun, NSimSun GB2312

Sim Hei GB2312
Traditional Chinese1 HeiT Big5

MingLiU, MingLiU_HKSCS, PMingLiU Big5
1 HeiT, MingLiU, MingLiU_HKSCS, and PMingLiU support the HKSCS2004 (Hong Kong Supplemental Character Set) characters.

The fonts that are supplied by SAS and any currently installed system fonts 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. To register other TrueType Fonts, see Other TrueType Fonts.


Other TrueType Fonts


Registering the TrueType Fonts with the SAS Registry

To use TrueType 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 the FONTREG procedure in the 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.  [cautionend]


Registering TrueType Fonts for Microsoft Windows or UNIX

Submit the following SAS program. The FONTPATH statement specifies the directory that contains the TrueType fonts and pathname is the directory path of the TrueType fonts.

proc fontreg;
   fontpath 'pathname';
run;

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.  [cautionend]


Registering TrueType Fonts for z/OS

Use the FONTFILE statement instead of the FONTPATH statement to specify the fixed block sequential file that contains a TrueType font.

proc fontreg;
    fontfile 'filename';
run;

Note:   When you add TrueType fonts to a z/OS system, the TrueType font file must be allocated as a sequential data set with a fixed block record format and a record length of 1.  [cautionend]


Locating the TrueType Font Files

After you update the SAS Registry, you can use the SAS Registry Editor to view a list of any registered fonts by typing REGEDIT on the SAS command line or by submitting a REGISTRY procedure statement that specifies the location of the files.

proc registry list startat='core\printing\freetype\fonts';
run;

When SAS is invoked, the FONTSLOC= system option points to the location of the fonts that are supplied by SAS. Use the following OPTIONS procedure statement to display the location of the SAS fonts.

proc options option=fontsloc;
run;


Using the TrueType Fonts


Specifying the TrueType Fonts with the Print Dialog Box

After you have updated the SAS Registry, the TrueType fonts are available for use within SAS. To access the TrueType fonts interactively when Universal Printing is enabled, follow these steps:

  1. Select File [arrow] Print

  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 a three-character tag enclosed in angle brackets. For example, the TrueType font Albany AMT will be listed as <ttf> Albany AMT. The <ttf> tag 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 reside in the printer's memory. 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 again to create your output.


Specifying TrueType Fonts with SAS Program Statements

To choose a printer that supports TrueType fonts when you're using SAS in a batch or line-mode environment, submit the following OPTIONS statement.

options printerpath=printername;

printername can be a printer name such as PDF, PNG, SVG, PCL5, PCL5e, or GIF.

Then, submit your program code with the font that you want to use. 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";

When you use the SAS/GRAPH graphics device drivers SASPRTC, SASPRTG, and SASPRTM, you can specify attributes, such as style or weight, 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.  [cautionend]


Specifying a Font with the SYSPRINTFONT Option

The SYSPRINTFONT= system option sets the default font that you want to use for printing to 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 the SAS Language Reference: Dictionary.


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.

goptions reset=all device=sasprtc;
title1 color=black f="Albany AMT/Italic/Bold" "Sample Title in Bold Italic Albany AMT";
options printerpath=pdf;
proc gplot data=sashelp.class;
   plot height*weight;
run;
quit;

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) 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);
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 prints ten Unicode characters.

filename new 'titles.png';
options printerpath=(png new);
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);
filename out 'utf8.gif';

ods printer style=utf8_style;
   proc print;
   run;
ods printer close;

Output of International Characters

[Output of International Characters]

Previous Page | Next Page | Top of Page