If the font was not loaded successfully, LoadFont() returns nonzero instead of zero.
Code: Select all
If OpenWindow(0, 0, 0, 270, 160, "Loading font...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
r = LoadFont(1, "", 24)
Debug r
r = LoadFont(#PB_Any, "", 24)
Debug r
r = LoadFont(1, "anything", 24)
Debug r
r = LoadFont(#PB_Any, "anything", 24)
Debug r
r = LoadFont(1, "Arial", 24)
Debug r
r = LoadFont(#PB_Any, "Arial", 24)
Debug r
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
PureBasic 5.51 (Linux - x64)