| **Navigation:**  [[introduction.htm|Language Reference]] > 9 -  Window and Report Attributes > Window and Report Attributes >====== FONT (set default font) ====== | [[flat set flat buttons .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[format set list or combo layout .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **FONT(**[//typeface//] [,//size//] [,//color//] [,//style//] [,//charset //]**)** {{blk2blue.jpg|blk2blue.jpg}} | **FONT** | Specifies the default display font for the TOOLBAR . | | //typeface// | A string constant containing the name of the font (PROP:FontName, equivalent to {PROP:Font,1}). If omitted, the system font is used. | | //size// | An integer constant containing the size (in points) of the font (PROP:FontSize, equivalent to {PROP:Font,2}). If omitted, the system default font size is used. | | //color// | A LONG integer constant containing the red, green, and blue values for the color of the font in the low-order three bytes, or an EQUATE for a standard Windows color value (PROP:FontColor, equivalent to {PROP:Font,3}). If omitted, black is used. | | //style// | An integer constant or constant expression or EQUATE specifying the strike weight and style of the font (PROP:FontStyle, equivalent to {PROP:Font,4}). If omitted, the weight is GDI default. | | //charset// | An integer constant or constant expression or EQUATE specifying the character set for the specified FONT (PROP:FontCharSet) or (PROP:Font,5). This provides support for international character sets. If omitted, the default charater set for the FONT is used. | The **FONT** attribute (PROP:FONT) specifies the default display font for controls. When the property assignment's //target// is the SYSTEM built-in variable, PROP:FONT sets the font for the MESSAGE procedure. The //typeface// parameter may name any font registered in the Windows system. For a report, the printer driver must support the specified //typeface// (this includes the TrueType fonts for most printers). The EQUATES.CLW file contains EQUATE values for standard //style// values. A //style// in the range zero (0) to one thousand (1000) specifies the strike weight of the font. You may add to that values that indicate italic, underline, or strikeout text. The following EQUATES are in [[commonly used equates.htm#fontequates|EQUATES.CLW]]: | FONT:thin | EQUATE (100) | | FONT:regular | EQUATE (400) | | FONT:bold | EQUATE (700) | | FONT:italic | EQUATE (01000H) | | FONT:underline | EQUATE (02000H) | | FONT:strikeout | EQUATE (04000H) | The //charset// parameter may name any //character set// registered in the Windows system. For a report, the printer driver must support the specified //character set. //The [[commonly used equates.htm#charsetequates|EQUATES.CLW]] file contains EQUATE values for standard //character set// values. The SYSTEM Property, can be used to set the Character Set propertiy at the system level (i.e., SYSTEM{PROP:CharSet} = CHARSET:GREEK). | CHARSET:ANSI | EQUATE(0) | | CHARSET:DEFAULT | EQUATE(1) | | CHARSET:SYMBOL | EQUATE(2) | | CHARSET:MAC | EQUATE(77) | | CHARSET:SHIFTJIS | EQUATE(128) | | CHARSET:HANGEUL | EQUATE(129) | | CHARSET:JOHAB | EQUATE(130) | | CHARSET:GB2312 | EQUATE(134) | | CHARSET:CHINESEBIG5 | EQUATE(136) | | CHARSET:GREEK | EQUATE(161) | | CHARSET:TURKISH | EQUATE(162) | | CHARSET:HEBREW | EQUATE(177) | | CHARSET:ARABIC | EQUATE(178) | | CHARSET:BALTIC | EQUATE(186) | | CHARSET:CYRILLIC | EQUATE(204) | | CHARSET:THAI | EQUATE(222) | | CHARSET:EASTEUROPE | EQUATE(238) | | CHARSET:OEM | EQUATE(255) | **Window Usage** {{black.jpg|black.jpg}} The FONT attribute on a WINDOW or APPLICATION structure specifies the default display font for all controls in the WINDOW or APPLICATION that do not have a FONT attribute. This is also the default font for newly created controls on the window, and is the font used by the SHOW and TYPE statements when writing to the window. The FONT attribute on a TOOLBAR structure specifies the default display font for all controls in the TOOLBAR that do not have a FONT attribute. Setting any of the runtime properties (PROP://property//) of the FONT attribute for the WINDOW, APPLICATION, or TOOLBAR does not affect the existing controls already displayed. Controls CREATEd after the property has been reset are affected, however. The FONT attribute on a control declaration overrides any FONT specified on the WINDOW, APPLICATION, or TOOLBAR. **Report Usage** {{black.jpg|black.jpg}} The FONT attribute on a REPORT structure specifies the default print font for all controls in the REPORT. This font is used when the control does not have its own FONT attribute and the print structure contianing the control also has no FONT attribute. The FONT attribute on FORM, DETAIL, HEADER, and FOOTER structures specifies the default print font for all controls in the structures that do not have a FONT attribute. The FONT attribute on a control declaration overrides any FONT specified on the REPORT or print structure. **Example:** **LRFont WINDOW('LR FontExample'),AT(,,289,192),|** ** ****FONT****('Arial',12,COLOR:Maroon,FONT:bold+FONT:italic,CHARSET:ANSI),GRAY** **        !14 point Arial typeface, Red, normal:** **        LIST,AT(120,0,20,20),USE(?L7),FROM(Que1),FONT('Arial',14,0FFh)** **        !14 point Arial typeface, Black, Bold:** **        LIST,AT(120,120,20,20),USE(?C7),FROM(Que2),FONT('Arial',14,0,700)** **        !14 point Arial typeface, Black, Bold Italic** **        LIST,AT(120,240,20,20),USE(?C7),FROM(Que2),FONT('Arial',14,0,700+01000h)** **       END** **CustRpt REPORT,AT(1000,1000,6500,9000),THOUS, |** **         ****FONT****('Arial',12,,FONT:Bold+FONT:Italic)** **        !report declarations** **        END  ** **!A Window using 14 point Times New Roman, Bold and Italic** **Win WINDOW,****FONT****('Times New Roman',14,00H,FONT:italic+FONT:bold)** **     STRING('This is Times 14 pt Bold Italic'),AT(42,14),USE(?String1)** **    END** ** CODE** ** OPEN(Win)** ** Win{PROP:FontSize} = 20           !Set default font size for CREATEd controls** ** CREATE(100,CREATE:string)         !Create a control** ** 100{PROP:Text} = 'This is 20 point'** ** SETPOSITION(100,82,24)** ** UNHIDE(100)** ** ACCEPT** ** END** **See Also:** [[setfont specify font .htm|SETFONT]] [[getfont get font information .htm|GETFONT]] [[fontdialog return chosen font .htm|FONTDIALOG]] [[fontdialoga return chosen font and character set .htm|FONTDIALOGA]] [[color set color .htm|COLOR]] [[create return new control created .htm|CREATE]] [[font support quick summary.htm|Font Support Quick Summary]]