BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sm4
Quartz | Level 8 sm4
Quartz | Level 8

I've been able to use Base SAS to produce a perfect ODS RTF file for my needs. Now I want to do the same thing in batch mode in Unix. Everything works fine except font - in Base SAS, I had been using proc template to set font to Georgia globally:

 

ods path(prepend) work.templat(update); *Added this in Unix batch mode code because of a separate issue;

proc template;
	define style styles.hello;
		class usertext / 
			font_size = 11pt
			font_face = Georgia;

		class body /
			topmargin = 1.0in
			leftmargin = 0.75in
			rightmargin = 0.75in;
	end;
run;


When I try this in batch mode, I get this nice log note right after that step: NOTE: STYLE 'Styles.hello' has been saved to: WORK.TEMPLAT

But at the very end of my log, after all of my ods rtf text= statements and my ods rtf close statement, I get multiple of these warnings:

WARNING: Font specification "Georgia" failed. Using default font family instead.

 

Margins and font_size are all fine in the output, it's just the font that did not work. I've tried changing the font through inline formatting for individual text= statements too, but it didn't work (though font_weight and foreground color worked that way). Thus my guess is that the proc template syntax is fine, but the font isn't registered or something like that. 

 

Any ideas on how to solve this? I've googled it pretty thoroughly and haven't found anything. I need to use Georgia because it's an official organization font.

Thanks!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
You might try the FreeType fonts that are included with SAS starting in 9.2: Albany AMT, Cumberland AMT and Thorndale AMT. Albany is similar to Arial; Cumberland to Courier; and Thorndale to Times.

Otherwise, you have to install the fonts on your system and then register them with SAS using FONTREG.

cynthia

View solution in original post

4 REPLIES 4
Reeza
Super User

You need to install the font into your system, which I don't think is a SAS specific issue. 

Or maybe it's not in your library of SAS fonts, but for some reason I think it uses the system fonts. 

sm4
Quartz | Level 8 sm4
Quartz | Level 8
Thanks for your response!

I figured it was something like that.
So, specifically, I need to install the font in my Unix system? If you have a good link for that I would really appreciate it! I’ve googled a bunch and it’s not too clear (or I’m not knowledgeable).

Thanks again!
Cynthia_sas
SAS Super FREQ
You might try the FreeType fonts that are included with SAS starting in 9.2: Albany AMT, Cumberland AMT and Thorndale AMT. Albany is similar to Arial; Cumberland to Courier; and Thorndale to Times.

Otherwise, you have to install the fonts on your system and then register them with SAS using FONTREG.

cynthia
sm4
Quartz | Level 8 sm4
Quartz | Level 8

Thanks for your response! It worked!

For others:
After some digging, I established that Georgia is in fact installed on my Unix system and located its path. I then added to the top of my code a proc fontreg mode=add with fontpath directing to that directory. I got a really encouraging message:

SUMMARY:
Files processed: 82
Unusable files: 3
Files identified as fonts: 79
Fonts that were processed: 79
Fonts replaced in the SAS registry: 0
Fonts added to the SAS registry: 0
Fonts that could not be used: 79
Font Families removed from SAS registry: 0

It did not give me the previous error relating to Georgia failing, instead it gave this: 
"ERROR:  An exception has been encountered.

Please contact technical support and provide them with the following traceback
information:

The SAS task name is [SQL (2) ]
Segmentation Violation"
Underneath was a bunch of lines referencing the SAS 9.4 folder in the Unix system.

I was about to post this new problem when I tried running the same code again - and the second time got no error message and the output is in Georgia! Let's hope it continues to do this on a monthly basis or I'll have to come back here lol.

Thanks to both of you for the extremely relevant help!!!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1400 views
  • 0 likes
  • 3 in conversation