WINFONT Mnemonic - Set Default Window And Control Font
Syntax
'WINFONT'(id,font{,size{,style{,charset}}})
Description
The 'WINFONT' mnemonic sets the default font for a window and its contained controls. All new controls and text drawn into a window are set to the default font. The only difference between 'FONT' and 'WINFONT' is that the size and style parameters are optional and omitting the charset parameter retains the current character set instead of changing to a default character set.
Parameter |
Description |
id |
Window ID. |
font |
Font family. |
size |
Font size in points. |
style |
Font style (see the table below). |
charset |
Character set. |
If values for the size, style, and charset parameters are not provided, Visual PRO/5 retrieves those values from the current font active in the window, instead of the default values.
Values for the style Parameter
The following identifies the values specified in the style parameter. The values are additive. For example, a value of 17 sets the text to be bold and underlined.
Style |
Decimal Value |
Normal |
0 |
Bold |
1 |
Italic |
2 |
Underline |
16 |
Strikeout |
512 |
Values for the charset Parameter
The following identifies the values specified in the charset parameter:
Character Set |
Decimal Value |
ANSI |
0 |
DEFAULT |
1 |
SYMBOL |
2 |
SHIFTJIS |
3 |
HANGEUL |
4 |
GB2312 |
5 |
CHINESEBIG5 |
6 |
OEM |
7 |
JOHAB |
8 |
HEBREW |
9 |
ARABIC |
10 |
GREEK |
11 |
TURKISH |
12 |
THAI |
13 |
EASTEUROPE |
14 |
RUSSIAN |
15 |
BALTIC |
16 |
MAC |
17 |
ANSI is the default Windows character set for the United States. DEFAULT specifies the default country setting; SYMBOL specifies fonts such as Wingdings; and OEM specifies the default DOS character set and can result in either stroke font selection or raster font selection. The other sets specify particular country or region sets. A given character set can only be used if matching fonts are also installed.
Windows may not support all characters in a given character set. Therefore, the 'WINFONT' mnemonic may not be able to use all character sets, especially when using WIN32s.
Example
The following example opens the SYSGUI device and uses the FIN function to obtain an available context. It then uses the 'CONTEXT' mnemonic to set the context and create a window in that context using the 'WINDOW' mnemonic. In addition, the 'WINFONT' mnemonic sets the default font for the window to Arial, 10 point, bold, ANSI character set.
begin let sysgui=unt
open (sysgui)"x0"
let fintmpl$=tmpl(sysgui,ind=0)
dim findata$:fintmpl$
let findata$=fin(sysgui,ind=0)
print findata.available_context
let this_context=findata.available_context
print (sysgui)'context'(this_context)
print (sysgui)'window'(10,10,500,300,"input dialog",$0002$,$$)
print (sysgui)'winfont'(this_context,"arial",10,1,0)