Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some unicode symbols not supported.
#1
Code: (Select All)
Option _Explicit

Screen _NewImage(800, 600, 32)

Dim fh As Long: fh = _LoadFont("cyberbit.ttf", 21)
If fh <= 0 Then
    Print "Failed to load font file!"
    End
End If

_Font fh

Restore text_data
Dim myString As String: myString = LoadUData$

_UPrintString (_Width \ 2 - _UPrintWidth(myString, 8, fh) \ 2, _Height \ 2 - _UFontHeight \ 2), myString, _Width, 8

End

text_data:
Data 6F
Data E2,96,95,E2,96,94,E2,96,94,E2,96,94,E2,96,94,E2,96,94,E2,96,94,E2,96,94,E2,96,94,E2,96,94,E2,96,94
Data E2,96,81 'Lower one eighth block won't display.
Data E2,96,8F 'Left one eighth block won't display.
Data E2,89,A1

Function LoadUData$
    Dim As _Unsigned Long i, s
    Dim d As String
    Dim buffer As String

    Read d
    s = Val("&h" + d)
    s = 42
    buffer = Space$(s)

    For i = 1 To s
        Read d
        Asc(buffer, i) = Val("&h" + d)
    Next

    LoadUData = buffer
End Function

What's funny is this routine will print that hamburger menu symbol I wasn't able to display to a screen a couple of years ago, but it misses on two of the outer one eighth blocks. When a symbol fails to display correctly, we get a hollow rectangle symbol in the display.

So is this a QB64 glitch?

Pete
Reply


Messages In This Thread
Some unicode symbols not supported. - by Pete - 03-09-2024, 02:52 AM
RE: Some unicode symbols not supported. - by Pete - 03-09-2024, 05:46 PM



Users browsing this thread: 1 Guest(s)