Description
The FONT message sets the font that is used for printing the main body of text. This is the font that is used by the ADDTABLE, TABLE, TEXT, TEXTBOX, TEXTCOL, and TEXTXY messages. To set the font for the header and footer use the FONTHEADFOOT message. Call the FONT message multiple times to change the font during a printing session. The TEXTRTF message describes how to change the font in the middle of a line. The default font is 12 point Courier New.
Parameters
The first parameter is used to set the font information. The Font Name specifies the name of the font, "Times New Roman", for example. The Point Size is used to set the size of the text font. The Justification is used to set the font justification. The code that is used to specify left justification is "L", right justification is "R", and center justification is "C." The FontBold is used to make the font normal or bold. The Italics and Underline flags are used to set these font properties. The ForeColor parameter sets the color of the font. The TextAngle parameter specifies the angle, in tenths of degrees, between the base line of a character and the horizontal. The TextAlign parameter deterimes if the text is aligned at the top, bottom, or baseline of the font.
The second parameter for the FONT message is the Spacing parameter. The Interline Spacing is used to set the percentage between printed lines. To print double spacing, set the Interline Spacing to 200. To print single spacing, set the Interline Spacing to 100. To print the text lines closer together set the Interline Spacing less than 100.
Parameter | Description of Fields | Comments | Default |
---|---|---|---|
Parm1 - FontInfo | <1> Font Name | "Font String" | Courier New |
<2> Point Size | 4-128 | 10 | |
<3> Justification | "L", "R", or "C" | "L" | |
<4> FontBold | 0=Normal 1=Bold | 0 | |
<5> Italics | 0/1 | 0 | |
<6> Underline | 0/1 | 0 | |
<7> Strikethrough | 0/1 -- NOT USED | 0 | |
<8> ForeColor | COLORREF | 0 - black | |
<9> TextAngle | In tenth of degrees | 0 | |
<10> TextAlign | 0=Top 1=Bottom 2=Baseline | 0 | |
Parm2 - Spacing | <1> Interline Spacing | Percentage of line spacing | 100 |
See also
FONTHEADFOOT, TABLE, TEXT, TEXTXY, TEXTCOL
Example
/* The following example shows how to use the FONT message to change the font to Bold, 14 point, Times New Roman. */ declare function Set_Printer stat = Set_Printer("INIT") ;* Start printing font = "Times New Roman,14,L,1" ;* 14 point, Left just, Bold convert "," to @fm in font ;* Use @fm delimiters stat = Set_Printer("FONT", font) ;* Set font stat = Set_Printer("TEXT", "Test 1 2 3") ;* Print text with new font stat = Set_Printer("TERM") ;* End printing