LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 27 Aug 2007 12:01:53 -0400
Reply-To:     John Birken <zbq5@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         John Birken <zbq5@CDC.GOV>
Subject:      Re: Embedding font and margins

Dave:

Thanks very much for your comprehensive answer. The OPTION additions were accepted by the program. However the print set up and page set up settings still rule the roost.

When people use the program with larger set fonts ... 8pt the some long 18 column tables get cut off.

Further suggestions on how to embed the desired font

TIA, John, jbirken@cdc.gov

--On 8/24/2007 2:43 PM -0400 John Birken wrote:

> Is there a way to embed into a program the output font size (only 1 > size > used) margins and to use landscape? I want the program to have *Margins: > Left = .25", Right = .25", Top = 1.5", Bottom = 1.5 Font: SAS MON > BOLD 6 Pt. LANDSCAPE

Yes. You use the SAS options ORIENTATION, SYSPRINTFONT, TOPMARGIN, LEFTMARGIN, RIGHTMARGIN, and BOTTOMMARGIN. (There's also (no)DUPLEX if you want it.

In OPTIONS statement syntax it would look like:

options sysPrintFont=('Courier New' 8) topMargin=.5in bottomMargin=.5in leftMargin=.5in rightMargin=.5in orientation=landscape noDuplex ;

And in config file syntax it would look like:

/* Set printer font and margins */ -sysPrintFont ('Courier New' 8) -topMargin .5in -bottomMargin .5in -leftMargin .5in -rightMargin .5in

/* default printing to landscape */ -orientation landscape

/* default printing to one-sided */ -noDuplex

What you probably want to do to get the right string for SYSPRINTFONT is to go to File... Print Setup..., use the Font... button to select your font, close the font selection dialog, click OK on the print setup dialog, and then do a PROC OPTIONS and check the value of SYSPRINTFONT to make sure you have the exact wording/spacing correct.

Note that when you change any of these options (except DUPLEX), the values of PAGESIZE (PS) and LINESIZE (LS) will be computed based on the margins, font, and orientation that are currently in effect. So when you use these, never set PS or LS directly.

A note for application developers: each of these options (except DUPLEX) causes LINESIZE and PAGESIZE to be recomputed on the fly when they are used, regardless of whether the value of the option has been changed. That means they're time consuming--in my environment, roughly a quarter-second per option.

If you're writing code that the user will be waiting for--e.g. code that re- sets these options between tasks in an interactive application--you probably want to to check the value (in SCL, with OPTGETC()) before you set it (in SCL, with OPTSETC()). So for example:

if upcase(optGetC('sysPrintFont')) ne '("COURIER NEW" 8)' then rc=optSetC('sysPrintFont', quote('Courier New') || ' 8');

if upcase(optGetC('orientation')) ne 'LANDSCAPE' then rc=optSetC('orientation', 'Landscape') ;

if upcase(optGetC('topMargin')) ne '.5IN' then rc=optSetC('topMargin', '.5in');

if upcase(optGetC('bottomMargin')) ne '.5IN' then rc=optSetC('bottomMargin', '.5in');

if upcase(optGetC('leftMargin')) ne '.5IN' then rc=optSetC('leftMargin', '.5in');

if upcase(optGetC('rightMargin')) ne '.5IN' then rc=optSetC('rightMargin', '.5in');

At a quarter-second each, this prevents a 1.5 second delay when the options do not need to be set.

Dave Scocca


Back to: Top of message | Previous page | Main SAS-L page