(AGK version: 108.13)
Submitted: 2013-06-23 06:07:12
//NOTE: For this example to work you will need to copy 'custom.png' and 'custom subimages.txt'
//to the media folder at the location where you are running this example.
//Both files can be found in [our AGK Install Directory]/Projects/Basic/Examples/Text/CustomText/media/

Setvirtualresolution(640,480)
ResetTimer()

//Check for required custom font files in media folder
fileok=GetFileExists("custom.png")
fileok=fileok+GetFileExists("custom subimages.txt")
If fileok<>2
    Repeat
        Print ("Both 'custom.png' and 'custom subimages.txt'")
        Print ("need to be in your media folder")
        Sync()
    Until Timer()>5
EndIF

If fileok=2
    //Get Custom Font
    fontimage = LoadImage ("custom.png")

    CreateText(1,"Default Font")
    SetTextSize(1,25)
    SetTextPosition(1,10,50)

    CreateText(2,"Custom Font")
    SetTextSize(2,25)
    SetTextPosition(2,10,100)

    SetTextFontImage(2,fontimage)

    Sync()

    Repeat
    Until Timer()>15
EndIf
End
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.