06-28-2024, 02:05 PM
(This post was last modified: 06-28-2024, 02:06 PM by Kernelpanic.)
Quote:One thing to remember, any call to _FONT will reset your print cursor location, as different fonts are going to be different heights and such.I understand that, what I don't understand is why the font doesn't change. No matter what I try, it doesn't work.
If you call _FONT, the next PRINT statement is always going to be at the top left of the screen, just as if you'd called CLS.
Either it doesn't work or I don't understand how it works.
Errors at 16 and 25 -- _FreeFont f/myFont
Code: (Select All)
Option _Explicit
Dim As String rootpath, fontfile, fontfile2, style, style2
Dim As Long f, f2, myfont
rootpath = Environ$("SYSTEMROOT") 'normally "C:\WINDOWS"
fontfile = rootpath + "\Fonts\cour.ttf" 'TTF file in Windows
style = "monospace" 'font style is not case sensitive
f = _LoadFont(fontfile, 30, style)
_Font f
Print "Hello!"
_FreeFont f
'fontfile2 = "C:\WINDOWS\Fonts\courbd.ttf"
'style2 = "Bold,Monospace"
fontfile2 = "C:\Windows\Fonts\Dauphinn.ttf"
style2 = "Bold"
myfont = _LoadFont("C:\Windows\Fonts\Dauphinn.ttf", 25, "")
_Font myfont
'f2 = _LoadFont(fontfile2, 30, style2)
'_Font f2
Locate 3, 5
Print "Hello!"
_Font 16
_FreeFont myfont 'f2
End