Specifying a Font

Specifying the FONT= Option

To specify a font in your SAS program, include a font name, enclosed in quotes, anywhere fonts are supported. For example, you can specify Thorndale AMT as the font for legend labels as follows:
legend label=(font="Thorndale AMT"  "Generation Source");
You can change between fonts, specify font modifiers such as /bold, and specify special characters. Font names are not case-sensitive. For example, the following FOOTNOTE statement prints E = m c squared .
footnote font="Thorndale AMT/bold" "E=mc" font="Albany AMT" "b2"x;

Specifying Font Modifiers (/bold, /italic, and /unicode)

To add a modifier such as bold or italic to a font, follow the font name with /modifier. For example:
axis1 value=(font="Cumberland AMT/bold/italic" );
SAS/GRAPH recognizes three font modifiers.
/bold or /bo
specifies bold text.
/italic or /it
specifies italic text.
/unicode or /unic
specifies special characters using Unicode code points. See Specifying International Characters (Unicode Encoding) for more information.
Note: The /unicode modifier is not supported by the Java or ActiveX devices.
Note: With the ACTIVEX and ACTXIMG devices, you can specify only one modifier at a time. Specifying font modifiers is not supported by the JAVA or JAVAIMG devices.
Note: You cannot specify font modifiers if you specify the font using a registry subkey.

Using a Registry Subkey

You can specify a font by specifying a registry subkey such as <MTsans-serif> or <MTmonospace> instead of specifying a font name. For example:
title font="<MTsans-serif>" "My Title";
The font specified by the <MTsans-serif> registry subkey will be used for the title.
The SAS registry is localized. If you specify a font using a registry subkey, the actual font that is used will be the localized value specified in your registry.

Specifying International Characters (Unicode Encoding)

You can use the /unicode modifier with a hexadecimal code to print any character in a font that supports Unicode encoding. Most of the TrueType fonts listed in TrueType Fonts Supplied by SAS support Unicode encoding.
For example, the following statement uses the /unicode modifier and a hexadecimal code (see Specifying Special Characters Using Character and Hexadecimal Codes) to display the symbol for the Euro sign.
title "Euro Symbol" font="Albany AMT/unicode" "20ac"x;
Unicode Character Code Charts can be found on the Unicode Web site at http://www.unicode.org/charts. See also Printing International Characters in SAS Language Reference: Concepts.
The Java and ActiveX devices do not support the /unicode modifier.

Specifying Special Characters Using Character and Hexadecimal Codes

Some fonts contain characters that are not mapped to the keyboard and cannot be typed directly into a text string. To display these special characters, substitute a character code or a hexadecimal value in the text string. Hexadecimal values are recommended over character codes.
Note: You can also display special characters using unicode code points. Unicode code points are specified with the /unicode font modifier followed by a hexadecimal value. See Specifying International Characters (Unicode Encoding) for more information.
Character codes include the letters, numbers, punctuation marks, and symbols that are commonly found on a keyboard. They are usually associated with symbols or national alphabets. These codes enable you to display the character by specifying the font and using the keyboard character in the text string. For example, on Windows operating environments, to produce the character ζ, you can specify the Symbol MT font and the character code z in the text string.
title font="Symbol MT" "z";
Hexadecimal values are any two-digit hexadecimal numbers enclosed in quotation marks, followed by the letter x. For example, “3D”x. (In double-byte character sets, the hexadecimal values contain four digits (for example, “4E60”x). Unicode characters also contain four digits.)
You display characters with hexadecimal values the same way you display them with character codes. You specify the font that contains the special character and place the hexadecimal value in the text string. For example, this TITLE statement uses hexadecimal A9 to produce © in the Albany AMT font.
title font="Albany AMT" "a9"x;
Note: The character code or hexadecimal value associated with characters in a font might be dependent on the key map that is currently being used. Keymaps are not used if the /unicode modifier is specified, a symbol font is specified, or NOKEYMAP is specified in the font header. Contact Technical Support if you need assistance with creating or modifying key maps.
To determine the hexadecimal codes that you need to specify for a specific character, you can use the program shown in SAS Program for Displaying Hexadecimal Codes for Special Characters. This program displays 224 characters of a font together with the hexadecimal codes for each character. As shown here, it displays the characters in the Symbol font. You can change the font displayed by this program to any font available on your system. Also, some fonts have many more characters than those displayed by the program below.
Note: Some fonts, such as Albany AMT, display variations due to the national characters for that locale. Symbol fonts, such as Monotype Sorts, are not affected by your locale encoding. For double-byte encodings, the second half of the table might be blank or show small rectangles.
SAS Program for Displaying Hexadecimal Codes for Special Characters
goptions reset=all;
                
/***************************************************/
/* Generate the hexadecimal values.  The A values  */
/* do not include 0 and 1 because these values are */
/* reserved for commands in most hardware fonts.   */
/***************************************************/

data one;
   do a="2","3","4","5","6","7","8","9","a","b","c","d","e","f";
     do b="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f";
        char=input(a||b,$hex3.);
        output;         
        end;
     end;
run;

/***************************************************/
/* Create annotation data set to show the          */
/* hexadecimal values and the corresponding font   */
/* characters underneath the hexadecimal value.    */
/***************************************************/

data anno;
   length text $2. style $ 25.;
   retain xsys  "3"   ysys  "3" 
          tempy 95    x     0 
          size  1.5   count 0 
          y     0     position "6";
   set one;
   count = count + 1;
   x = x + 4;

   y     = tempy;
   text  = compress(a||b);
   style = "Albany AMT/bold";
   output;

   y        = tempy - 3;
   function = "label";

   /* Modify this statement to use the */
   /* font that you want to display.   */
   style    = "Monotype Sorts";  
   text     = char;
   output;

   if int(count/16) = (count/16)
      then do;
            x = 0;
                tempy = tempy - 6;
        end;
 run;

/****************************************************/ 
/* Create the table.  The symbol is shown below its */ 
/* hexadecimal value.  For example, a circle with   */ 
/* the number one inside is the hexadecimal value   */
/* AC in the Monotype Sorts system font. To use     */ 
/* this symbol, specify:                            */
/* font="Monotype Sorts" "AC"x;                     */ 
/****************************************************/

proc ganno anno=anno;
run;
quit;
Symbol MT Font and Monotype Sorts Font show the output of the program above for the TrueType fonts Symbol MT and Monotype Sorts.
Symbol MT Font
Symbol MT Font
Monotype Sorts Font
Monotype Sorts Font