Main Menu

KB#00062-How to determine the CPI and POINT size of the SYSPRINTer's font

Title:

How to determine the CPI and POINT size of the SYSPRINTer's font

Description:

To determine what the CPI and POINT Size of the current FONT, you can do the following: 

f_1$=fin(chan,ind=1) 

cpi=f_1.xppi/f_1.char_width 
points=72.2*f_1.char_height/f_1.yppi) 

This can then be plugged into a 'font' mnemonic as: 

print (chan)'font'(f_1.font$,cpi,points) 

This example starts with a FONT=,ROWS=,COLS= on the OPEN mode. Assume that in a report you need to print a large piece of text to emphasize something, but then you want to go back to the original size text. 

0010 LET CHAN=UNT 
0020 OPEN (CHAN,MODE="FONT=Courier,ROWS=66,COLS=80")"LP" 
0030 DIM F_1$:TMPL(CHAN,IND=1); LET F_1$=FIN(CHAN,IND=1) 
0040 LET CPI=F_1.XPPI/F_1.CHAR_WIDTH 
0050 LET POINTS=72.2*F_1.CHAR_HEIGHT/F_1.YPPI 
0060 PRINT (CHAN)"All kinds of neat data" 
0070 PRINT (CHAN)'FONT'("Letter Gothic",5,20),"This should be large" 
0080 PRINT (CHAN)'FONT'(F_1.FONT$,CPI,POINTS),"Back to regular size and font." 
0090 PRINT (CHAN)'FF',; CLOSE (CHAN) 



Last Modified: 12/18/1997 Product: Visual PRO/5 Operating System: Windows

BASIS structures five components of their technology into the BBx Generations.

View BASIS LinkedIN Profile Visit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel