Function Reference

GUISetFont

Sets the default font for a GUI window.

GUISetFont (size [, weight [, attribute [, fontname [, winhandle]]]] )

 

Parameters

size Fontsize (default is 9).
weight [optional] Font weight (default 400 = normal).
attribute [optional] To define italic:2 underlined:4 strike:8 char format (add together the values of all the styles required, 2+4 = italic and underlined).
fontname [optional] Font to use. (OS default GUI font is used if the font is "" or is not found).
winhandle [optional] Windows handle as returned by GUICreate (default is the previously used window).

 

Return Value

Success: Returns 1.
Failure: Returns 0.

 

Remarks

See the Appendix for a complete list of fonts and the operating systems under which they are supported.

Size can be with decimal as 8.5.

 

Related

GUICtrlSetFont

 

Example


#include <GUIConstants.au3>

GUICreate ("My GUI default font")  ; will create a dialog box that when displayed is centered

$font="Comic Sans MS"
GUISetFont (9, 400, 4, $font)   ; will display underlined characters
GUICtrlCreateLabel ("underlined label",10,20)

GUISetFont (9, 400, 2, $font)   ; will display underlined characters
GUICtrlCreateLabel ("italic label", 10,40)

GUISetFont (9, 400, 8, $font)   ; will display underlined characters
GUICtrlCreateLabel ("strike label",10,60)

GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend