How does one change the font family and size in output, particularly in ODS destinations like PDF.
Creating a new style definition using the TEMPLATE procedure with inheritance would seem to be appropriate, but even when I use the STYLE= option in the ODS PDF statement, it did not seem to help.
proc template ;
define style
styles.fda
;
parent = styles.pearl ;
class fonts
/ "TitleFont" = ( Arial , 10pt )
"TitleFont2" = ( Arial , 10pt )
"StrongFont" = ( Arial , 10pt , bold )
"EmphasisFont" = ( Arial , 9pt , italic )
"FixedEmphasisFont" = ( Courier , 9pt )
"FixedStrongFont" = ( Courier , 9pt , bold )
"FixedHeadingFont" = ( Courier , 9pt , bold )
"BatchFixedFont" = ( Courier , 9pt )
"FixedFont" = ( Courier , 9pt )
"headingEmphasisFont" = ( Arial , 9pt , bold italic )
"headingFont" = ( Arial , 9pt , bold )
"docFont" = ( Arial , 9pt )
;
style data from data
/ font = fonts( "docFont" )
;
end ;
run ;
I was able to change the individual attributes for the various location in the PRINT procedure. What can one do if one wants to direct the output of a procedure like GLM or MIXED to PDF, but have the font be a certain family and size. Currently, it appears to be Albany.
Thank you,
Kevin
Hi:
REPLACE was deprecated in 9.2 and it was my understanding that if you use REPLACE now, in 9.2, 9.3 or 9.4 that it will behave the same way as STYLE or CLASS statements in PROC TEMPLATE. However, I was always advised to use the "official" name of the Arial font, which in PDF-land is "Arial Unicode MS" and also advised to always use the "official" name of the Courier font, which is "Courier New". As you can see from the screen shot below (I did change the original template so the changes were obvious), when I use those font names, the correct fonts are embedded and appear to be used.
To make specific changes to PROC PRINT data cells or header cells or areas like the summary line, the OBSHEADER and the OBS numbers, you need to use STYLE(area)= overrides in the PROC PRINT syntax, as shown in the second example.
cynthia
Hi:
REPLACE was deprecated in 9.2 and it was my understanding that if you use REPLACE now, in 9.2, 9.3 or 9.4 that it will behave the same way as STYLE or CLASS statements in PROC TEMPLATE. However, I was always advised to use the "official" name of the Arial font, which in PDF-land is "Arial Unicode MS" and also advised to always use the "official" name of the Courier font, which is "Courier New". As you can see from the screen shot below (I did change the original template so the changes were obvious), when I use those font names, the correct fonts are embedded and appear to be used.
To make specific changes to PROC PRINT data cells or header cells or areas like the summary line, the OBSHEADER and the OBS numbers, you need to use STYLE(area)= overrides in the PROC PRINT syntax, as shown in the second example.
cynthia
Thanks to both Cynthia and Reeza for offering solutions.
Pearl inherits from Printer, which appears to go to "base" elements. In Printer, ContentTitle specifies font = fonts('TitleFont') and in Pearl Data specifies font = fonts('DocFont'). In the case of the latter, I do not have to repeat the CLASS (or STYLE) statement in my custom template, but only need to change the font family and size in Font.
Cynthia included SystemTitle, but my experimentation suggested previously that it was already covered by TitleFont. I would imagine that each location is covered by reference or inheritance, but I would still be interested in a listing of each for each style template/procedure.
I appreciate the advice and corrections.
Thank you,
Kevin
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.