dxLoadFont%(filename$,height,bold,italic,underline)

Parameters

fontname$ - name of font to be loaded, e.g. "arial"
height - height of font in points (default is 12)
bold - True to load bold version of font, False not to (default is False)
italic - True to load italic version of font, False not to (default is False)
underlined - True to load underlined version of font, False not to (default is False)

Description

Loads a font and returns a font handle.

You can then use the font handle with commands such as dxSetFont and dxFreeFont.

Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.

Example

; dxLoadFont/dxSetFont/dxFreeFont Example
; ---------------------------------

; Enable Graphics mode
Graphics 800,600

; Set global on font variables
Global fntArial,fntArialB,fntArialI,fntArialU

; Load fonts to a file handle variables
fntArial=dxLoadFont("Arial",24)
fntArialB=dxLoadFont("Arial",18,True)
fntArialI=dxLoadFont("Arial",32,False,True)
fntArialU=dxLoadFont("Arial",14,False,False,True)

; Set the font and dxPrint dxText
dxSetFont fntArial
dxText 400,0,"This is just plain Arial 24 point",True

dxSetFont fntArialB
dxText 400,30,"This is bold Arial 18 point",True

dxSetFont fntArialI
dxText 400,60,"This is italic Arial 32 point",True

dxSetFont fntArialU
dxText 400,90,"This is underlined Arial 14 point",True

; Standard 'wait for ESC' from user
While Not dxKeyHit(1)
Wend

; Clear all the fonts from memory!
dxFreeFont fntArial
dxFreeFont fntArialB
dxFreeFont fntArialI
dxFreeFont fntArialU

Index