_LOADFONT example omission
#1
Information 
From this page:

https://qb64phoenix.com/qb64wiki/index.php/LOADFONT

The second example has "_FONT" statement missing. If the font doesn't exist, largely due to mistyping (which was driving me crazy just now trying to load "cyberbit.ttf" in current directory), then the example as it's presented right now isn't going to do anything about it.

The code example should read like the following:
Code: (Select All)
i& = _NEWIMAGE(800, 600, 32)
SCREEN i&
COLOR &HC0FFFF00, &H200000FF
f& =_LOADFONT("C:\Windows\Fonts\times.ttf", 25)  'normal style
_FONT f&
PRINT "Hello!"

TIP: If you have Wine in your Linux installation and have run "winetricks corefonts", or any other way to populate the "Windows/Fonts" directory, then this statement could be used to load Times New Roman:
Code: (Select All)
f& = _LOADFONT("/home/user/.wine/drive_c/windows/Fonts/times.ttf", 25) 'normal style

(replace "user" without double-quotation marks with the name of the user that is linked with the password for your regular account.)
Reply
#2
(04-24-2023, 02:46 PM)mnrvovrfc Wrote: From this page:

https://qb64phoenix.com/qb64wiki/index.php/LOADFONT

The second example has "_FONT" statement missing. If the font doesn't exist, largely due to mistyping (which was driving me crazy just now trying to load "cyberbit.ttf" in current directory), then the example as it's presented right now isn't going to do anything about it.

Page updated, thanks for reporting.
Reply




Users browsing this thread: 2 Guest(s)