Hi,
I am trying produce a figure using Graphic Template Language (GLT), however no matter what I try the fonts are not changing.
This is the PROC TEMPLATE code:
proc template;
define statgraph series;
begingraph / designwidth=800px designheight=500px border=false;
layout datalattice rowvar=severity / headerborder=false
columnaxisopts=(label="Visit" labelattrs=(family="courier new" weight=bold)
tickvalueattrs=(family="courier new"))
rowdatarange=union
rowaxisopts=(label="Mean" labelattrs=(family="courier new" weight=bold)
tickvalueattrs=(family="courier new"));
** Plot;
layout prototype / cycleattrs=true;
seriesplot x=xvar y=mean / name="mean" group=treatment;
endlayout;
** Legend;
sidebar / align=bottom;
discretelegend "mean" / border=false valueattrs=(family="courier new" weight=bold);
endsidebar;
endlayout;
endgraph;
end;
run;
I am setting the font for all components to Courier New yet once it runs and I open the output all components are using the Arial font. Any help? Sorry I cannot upload the actual output, but the log is also clean.
This is the code used to output the file:
ods _all_ close;
ods rtf file = "C:/Myfile.rtf" style=custom_style;
ods graphics on / imagefmt = png;
proc sgrender
data = mydataset
template = series;
by myvariable;
run;
ods rtf close;
ods listing;
You did not provide any data so I can't test this.
I would suggest that you test the case of your font that matches the name that appears installed on your system, likely "Courier New" instead of "courier new".
I'm hoping you found a solution because I am having the same issue, but with Proc Template. Font Styles are set to courier new but graph text shows up as something resembling Arial.
proc template;
define style sty1 / store=metadata.sty1;
parent=styles.rtf;
replace fonts/
'TitleFont2' = ("Courier New, Courier",8pt)
'TitleFont' = ("Courier New, Courier",8pt)
'StrongFont' = ("Courier New, Courier",8pt)
'EmphasisFont' = ("Courier New, Courier",8pt)
'FixedEmphasisFont' = ("Courier New, Courier",8pt)
'FixedStrongFont' = ("Courier New, Courier",8pt)
'FixedHeadingFont' = ("Courier New, Courier",8pt)
'BatchFixedFont' = ("Courier New, Courier",8pt)
'HeadingEmphasisFont' = ("Courier New, Courier",8pt)
'HeadingFont' = ("Courier New, Courier",8pt)
'FixedFont' = ("Courier New, Courier",8pt)
'docFont' = ("Courier New, Courier",8pt)
;
style graphfonts from graphfonts /
'GraphDataFont' = ("Courier New, Courier",8pt)
'GraphUnicodeFont' = ("Courier New, Courier",8pt)
'GraphValueFont' = ("Courier New, Courier",8pt)
'GraphLabel2Font' = ("Courier New, Courier",8pt)
'GraphLabelFont' = ("Courier New, Courier",8pt)
'GraphFootnoteFont' = ("Courier New, Courier",8pt)
'GraphTitleFont' = ("Courier New, Courier",8pt)
'GraphTitle1Font' = ("Courier New, Courier",8pt)
'GraphAnnoFont' = ("Courier New, Courier",8pt)
;
end;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.