Figure 15.28 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 website at
http://www.unicode.org/charts.
proc template;
define style utf8_style / store = SASUSER.TEMPLAT;
parent = styles.printer;
style fonts /
'docFont' = ("Arial Unicode MS", 12pt)
'headingFont' = ("Arial Unicode MS", 10pt, bold)
'headingEmphasisFont' = ("Arial Unicode MS", 10pt, bold italic)
'TitleFont' = ("Arial Unicode MS", 12pt, italic bold)
'TitleFont2' = ("Arial Unicode MS", 11pt, italic bold)
'FixedFont' = ("Times New Roman Uni", 11pt)
'BatchFixedFont' = ("Times New Roman Uni", 6pt)
'FixedHeadingFont' = ("Times New Roman Uni", 9pt, bold)
'FixedStrongFont' = ("Times New Roman Uni", 9pt, bold)
'FixedEmphasisFont' = ("Times New Roman Uni", 9pt, italic)
'EmphasisFont' = ("Arial Unicode MS", 10pt, italic)
'StrongFont' = ("Arial Unicode MS", 10pt, bold);
end;
run;
298 Chapter 15 Printing with SAS
%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;
Note: If you get an “unable to write to template store” error when running this code,
place the following before the proc step:
PROC TEMPLATE step:
ODS PATH work.templat(update) sasuser.templat(read)
sashelp.tmplmst(read);
This statement causes the templates to be written to the WORK library where the
server has Read and Write access.
Using Fonts with Universal Printers and SAS/GRAPH Devices 299
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.98.250