Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Freefont error
#5
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.

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.
I understand that, what I don't understand is why the font doesn't change. No matter what I try, it doesn't work.
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

[Image: Dauphin1.jpg]

[Image: Dauphin2.jpg]
Reply


Messages In This Thread
Freefont error - by Kernelpanic - 06-27-2024, 07:57 PM
RE: Freefont error - by DSMan195276 - 06-27-2024, 08:02 PM
RE: Freefont error - by Kernelpanic - 06-27-2024, 08:27 PM
RE: Freefont error - by SMcNeill - 06-27-2024, 08:52 PM
RE: Freefont error - by Kernelpanic - 06-28-2024, 02:05 PM
RE: Freefont error - by SMcNeill - 06-28-2024, 02:55 PM
RE: Freefont error - by Pete - 06-28-2024, 04:11 PM
RE: Freefont error - by Kernelpanic - 06-28-2024, 07:31 PM
RE: Freefont error - by Pete - 06-28-2024, 10:03 PM
RE: Freefont error - by bplus - 06-28-2024, 10:38 PM
RE: Freefont error - by Pete - 06-29-2024, 03:26 AM



Users browsing this thread: 3 Guest(s)