QuadDraw revisited - drawing program work in progress
#13
Aha! Revised Text Sub kicks butt with clean graphics fonts at a range of sizes!

Code: (Select All)
Sub Text (x, y, textHeight, K As _Unsigned Long, txt$)
    Static beenHere, fontHandle&(6 To 64)
    If beenHere = 0 Then
        For i = 6 To 64
            'fontHandle&(i) = _LoadFont("arial.ttf", i )
            fontHandle&(i) = _LoadFont("ARLRDBD.ttf", i)
        Next
        beenHere = -1
    End If
    th = textHeight - 4 ' <<< this is needed to fix Dav's menu
    _Font fontHandle&(th)
    Dim As _Unsigned Long fg, bg
    fg = _DefaultColor
    bg = _BackgroundColor
    Color K, _RGB32(0, 0, 0, 0)
    _PrintString (x, y), txt$
    Color fg, bg
End Sub


You will have to adjust the sizes and x, y 's for better fitting screening of data but this sub is fast enough to update with each drawing loop! You will also have to include font(s) files for non Windows users.

    Clean and fast!
b = b + ...
Reply


Messages In This Thread
RE: QuadDraw revisited - drawing program work in progress - by bplus - 05-31-2022, 08:46 PM



Users browsing this thread: 6 Guest(s)