| SAS/GRAPH Fonts |
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
.
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.
specifies bold text.
specifies italic text.
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. ![[cautionend]](../../../../common/61925/HTML/default/images/cautend.gif)
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. ![[cautionend]](../../../../common/61925/HTML/default/images/cautend.gif)
| Specifying International Characters (Unicode Encoding) |
You can use the /unicode modifier with a hexadecimal code to print Unicode characters. This modifier can be used only with fonts that support Unicode encoding. Most of the TrueType fonts listed in TrueType Fonts Supplied by SAS support Unicode encoding.
For example, font="Arial/unicode" "20ac"x 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.
The table of Unicode character names and the associated codes 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.
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, to produce the character ζ, 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.)
You display characters with hexadecimal values the same way that 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 any character in any font is dependent on the key map that is currently
being used. Contact Technical Support if you need assistance with creating
or modifying key maps. ![[cautionend]](../../../../common/61925/HTML/default/images/cautend.gif)
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 the characters available in 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.
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. ![[cautionend]](../../../../common/61925/HTML/default/images/cautend.gif)
SAS Program For Displaying Hexadecimal Codes For Special Characters goptions reset=all; /***************************************************/ /* Generate the hex 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 hex */ /* values and the corresponding font characters */ /* underneath the hex 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 */ /* hex value. For example, a circle with the number*/ /* one inside is the hex value AC in the Monotype */ /* Sorts system font. To use this symbol, specify: */ /* font="Monotype Sorts" "AC"x; */ /****************************************************/ proc ganno anno=anno; run; quit;
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. ![[cautionend]](../../../../common/61925/HTML/default/images/cautend.gif)
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.