UPDATE: I just tried the programs below with the cyberbit.ttf font file that came with QB64 and everything works. Now the question is why does it not work for any other FONT that came with Linux or imported from Windows?
For those who do not have it, I have also attached the veranda.ttf file to this post.
I've been working on a game, and in v1.4 the FONTS worked great. Now with the new v1.5, they no longer work.
I've created a program from several past posts as well as included a snippet from what I used that worked previously.
Below is the code I am having issues with, but first let me give you some information on what I am getting and my OS environment.
I have been using Linux for more than 10 years, and am a UNIX Mainframe expert, working with it for more than 35 years. I also use macOS, but I have yet to try this on this OS. My Linux is Linux Mint Ubuntu 20.1 with the Cinnamon desktop. I've been using Linux Mint Ubuntu for the past 3 years.
In my testing, I have used the Linux FONTS to install them in usr/share/fonts, as well as placing the fonts into the same directory as my executable, and in every case, the program is unable to load the fonts.
I've tested more than 24 different fonts besides Veranda. All the files exist and have an installed status, yet QB64 cannot load them.
I am not sure whether this is a Linux problem, so anyone who uses other OS's I would like to hear your perspective on this.
Also, if this is a problem running QB64 on Linux, then this maybe a bug in QB64 v1.5.
I would be able to spend the time to do this, but I am currently working with an astrophysics grad student in helping him analyze data from NASA and ESA satellites using both PYTHON and QB64, and while I would love to have FONTS working, I can for this project get by without it (FONTS work fine in PYTHON, so I can use that if I need to show bold, or other font attributes).
Any help or suggestions is greatly appreciated. I've gone as far as I can in QB64 without scouring QB64 source code for the problem.
Below are the code snippet and a program I put together from prior posts on this issue, along with the results I am getting.
First, this snippet is from a program I wrote that allows a user to input values to the Drake Equation. It is the same snippet that I used in many other programs I wrote in v1.4 and worked:
'--------------------------------
'*** Initialize SCREEN
'SCREEN 12
'*** Setup Font Type and Size
fontpath$ = "veranda.ttf"
'_FONT font&
This program is a combo from several other posts in BUGS from people (SMcNeill is one of them) that was solved back in 2017.
'MultipleFontLoad
'SCREEN 0 may use only one FONT. When changed, changes full screen
'Otherwise graphic modes preserve the screen contents when change font
'_LOADFONT needs the use of style$ variable instead of constant
CONST MINSIZE
= 8, MAXSIZE
= 100 f$ = "veranda.ttf"
style$ = "MONOSPACE"
PRINT:
PRINT "LOADING MIN/MAX: "; f$;
" style: "; style$
FOR i
= MINSIZE
TO MAXSIZE
PRINT "Font sizes:"; MINSIZE;
"-"; MAXSIZE;
INPUT ". Select size"; fontsize%
PRINT "Fail"; i; hFont&
(i
)
FOR i
= MINSIZE
TO MAXSIZE
When I run the program that tests various uses of FONTS I get the following output:
0 : -1
1 : -1
2 : -1
3 : -1
4 : -1
5 : -1
6 : -1
7 : -1
8 : -1
9 : -1
10 : -1
LOADING MIN/MAX: veranda.ttf style: MONOSPACE
8 Fail 8 -1
After this, I get a box that says: Unhandled Error #258, Line 45 (in main module) Invalid handle, Continue?
After this, the program loops when I hit Yes until I click on No.
Thanks for taking the time to look into this.