' Draw custom font sample ' ' Usage : test_fbfont.exe INPUT_FONT.bmp ' by mieki256 ' License : CC0 / Public Domain ' Last updated: <2024/02/12 21:04:50 +0900> Const SCRW = 512 Const SCRH = 288 Dim As Integer sdepth = 32 If Command(1) = "" Then Print "Usage : " & Command(0) & " INPUT_FONT.bmp" : end End If ScreenRes SCRW, SCRH, sdepth Dim As String infilename = Command(1) Dim As Integer f Dim As Long w, h ' open bitmap file f = FreeFile() Open infilename For Binary Access Read As #f If Err > 0 Then Print "Error: Can not open file" : End ' get bitmap width and height Get #f, 19, w ' get width Get #f, , h ' get height Close #f Dim As Any Ptr img = ImageCreate(w, h) bload infilename, img Color RGB(255, 255, 255), RGB(0, 0, 0) cls h = 34 Draw String (0, h * 0), "Hello World !", , img Draw String (0, h * 1), infilename, , img Draw String (0, h * 2), "0123456789", , img Draw String (0, h * 3), "@ABCDEFGHIJKLMNO", , img Draw String (0, h * 4), "PQRSTUVWXYZ[\]^_", , img Draw String (0, h * 5), "`abcdefghijklmno", , img Draw String (0, h * 6), "pqrstuvwxyz{|}~ ", , img sleep ImageDestroy img