BookmarkSubscribeRSS Feed
craig159753
Quartz | Level 8

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;

 

 

3 REPLIES 3
ballardw
Super User

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".

craig159753
Quartz | Level 8
Sadly I cannot provide the data (which I know is not helpful). However I can describe it.

X axis represents some visits.
Y axis represents the mean result.
Group is a categorical variable.
Column variable (for the grouped outputs) is another categorical variable.
Page variable can be any further categorical variable.

Page, Column, Group, Y, X
A, FIRST, DRUG A, 11, VISIT 1
A, FIRST, DRUG B, 14, VISIT 2
A, LAST, DRUG A,13, VISIT 1
A, LAST, DRUG B, 12, VISIT 2

The casing on a windows machine is not usually an issue. I have already produce some odd rtf tables using courier new without an issue. It seems only the figures are not playing ball.
bwhiz44
Calcite | Level 5

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;

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 838 views
  • 0 likes
  • 3 in conversation