10-04-2024, 10:54 AM
The easiest solution is using _UPRINTSTRING
Code: (Select All)
SCREEN _NEWIMAGE(640, 320, 32)
f& = _LOADFONT("arial.ttf", 20)
IF f& > 0 THEN _FONT f&
'a single char is easy with Utf-16 or Utf-32,
'if you know the exact unicode codepoint
_UPRINTSTRING (10, 10), MKI$(1046), , 16 'use MKI$() for Utf-16 encoding
_UPRINTSTRING (10, 30), MKL$(1046), , 32 'use MKL$() for Utf-32 encoding
'if you otherwise have a Utf-8 multibyte sequence,
'then you can assemble it
_UPRINTSTRING (10, 50), CHR$(208) + CHR$(150), , 8 'use CHR$() for multibyte Utf-8 encoding
'to write complete text, just concatenate the values
_UPRINTSTRING (10, 80), MKI$(1046) + MKI$(1046), , 16 'use MKI$() for Utf-16 encoding
_UPRINTSTRING (10, 100), MKL$(1046) + MKL$(1046), , 32 'use MKL$() for Utf-32 encoding
_UPRINTSTRING (10, 120), CHR$(208) + CHR$(150) + CHR$(208) + CHR$(150), , 8 'use CHR$() for multibyte Utf-8 encoding
_UPRINTSTRING (10, 160), "press any key...": SLEEP 'or write ASCII as is with _UPRINTSTRING
_FONT 16
SCREEN 0
SYSTEM
GuiTools, Blankers & other Projects:
https://qb64phoenix.com/forum/forumdisplay.php?fid=32
Libraries & useful Functions:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23
https://qb64phoenix.com/forum/forumdisplay.php?fid=32
Libraries & useful Functions:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23