• Print  |
  • Feedback  |

FOCUS AREAS

Return to SAS 9

Base SAS

New Fonts for SAS 9.2

This is just a simple demo that shows the new SAS 9.2 fonts (Thorndale AMT, Albany AMT, and Cumberland AMT) side-by-side with their Microsoft equivalents (Times New Roman, Arial, and Courier New). It also shows the characters in the a-g range of the Symbol MT and Monotype Sorts fonts. These two fonts correspond to the Microsoft Symbol font and Wingdings, respectively.

You can access these fonts in any SAS product that uses TrueType fonts. The fonts are available to Enterprise Guide customers, for instance. What's significant about the new fonts is that SAS distributes them. And they include a Unicode font, which is very helpful for customers who don't use latin1.

Note: you need to have the fonts installed on your machine for this to work. In addition, SAS needs to know about the fonts installed in your winnt directory. You might need to run the FONTREG procedures at the beginning to get SAS to load the fonts.

  /* Tell SAS about the fonts (as needed) */
  /*
  proc fontreg mode=all;
     fontpath 'c:\winnt\fonts';
  run;
  */

  /* Create data set with new font names */
  data fonts;
  input @1 newfont $14. @16 oldfont $16.;
  datalines;
  Albany AMT     Arial
  Thorndale AMT  Times New Roman
  Cumberland AMT Courier New
  ;

  /* Create a table template that will use the data point as the font family */
  proc template;
     define table fonts;
     define column oldfont;
        header = 'Old Font';
        style={fontfamily=expression('oldfont')};
     end;
     define column newfont;
        header = 'New Font';
        style={fontfamily=expression('newfont')};
     end;
     end;
  run;

  /* Create data set for symbol and wingding fonts */
  data symbols;
  input @1 name $15. @17 data $13.;
  datalines;
  Symbol MT       a b c d e f g
  Monotype Sorts  a b c d e f g
  ;

  /* Create table to demonstrate symbol fonts */
  proc template;
     define table symbols;
     define column name;
        header = 'Font Name';
     end;
     define column data;
        header = 'Sample Data';
        style={fontfamily=expression('name')};
     end;
     end;
  run;

  /* Make a style with big fonts to show off */
  proc template;
     define style styles.bigdefault; parent=styles.default;
        class body / fontsize=20pt;
        class data / fontsize=20pt;
        class header / fontsize=24pt;
     end;
     define style styles.bigprinter; parent=styles.printer;
        class body / fontsize=20pt;
        class data / fontsize=20pt;
        class header / fontsize=24pt;
     end;
  run;

  /* Generate the tables */
  ods html file="fonts.html" style=styles.bigdefault;
  ods pdf file="fonts.pdf" style=styles.bigprinter;

  data _null_;
     set fonts;
  file print ods=(template='fonts');
     put _ods_;
  run;

  data _null_;
     set symbols;
  file print ods=(template='symbols');
     put _ods_;
  run;

  ods pdf close;
  ods html close;