Posts: 734
Threads: 30
Joined: Apr 2022
Reputation:
43
I feel as though it is probably something I'm doing wrong but I am having so much trouble trying to load a font in Linux QB64pe. I don't know what I am doing wrong. I will provide an absolute path to a TTF file and the font handle is always invalid. Even when using InFormPE, it is unable to load any fonts besides 8 or 16 (the built-in VGA fonts). Is there some mystical-magical thing I need to do in Linux to work around this or are custom fonts not available in Linux? I am very confused and would appreciate any help.
Tread on those who tread on you
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
I've never had any issues with fonts on Linux. Try copying one into the QB64 folder and see if you can find it without a path.
And, since there's no code provided, if you're in a SCREEN 0 environment, be certain to declare the style as "monospace".
Posts: 734
Threads: 30
Joined: Apr 2022
Reputation:
43
(10-05-2023, 01:51 PM)SMcNeill Wrote: I've never had any issues with fonts on Linux. Try copying one into the QB64 folder and see if you can find it without a path.
And, since there's no code provided, if you're in a SCREEN 0 environment, be certain to declare the style as "monospace".
I've tried doing monospace as well as trying to use one that is in the same folder. Always invalid handles.
Tread on those who tread on you
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
Which version of Linux? I'll pop a copy into a VM (or boot via USB) and give it a test run and see if I can reproduce the issue.
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
Make sure the spelling of the paths and the font name are exact. Linux is a case-sensitive operating system.
The paths will be different eg. on Debian that they will be on eg. Slackware. The starting path is usually `/usr/share/fonts` and then there might be a "TTF" or "OTF" directory, or the fonts might be classified by "family", which is roughly the font name such as "Liberation". You should not be interested in any other folder. There is one full of ancient fonts to be used by terminals, especially the startup "tty" ones, and other X-dot-org stuff.
You could put fonts under `/home/(user)/.local/share/fonts`. ("(user)" is your handle used to log into the desktop.) You will have to create that directory because a Linux installer will not do it for you. It's not recommended to use any other "local" path such as that for GIMP.
Make sure you're calling `_LOADFONT()` after the `SCREEN` is set. Once this drove me nuts, but with `_RGB()` because the latter kept returning values from zero to 15 instead of the long-integer mumbo-jumbo.
Posts: 734
Threads: 30
Joined: Apr 2022
Reputation:
43
10-05-2023, 09:35 PM
(This post was last modified: 10-05-2023, 09:38 PM by SpriggsySpriggs.)
Sorry, everyone. I hadn't made a screen. mnrvovrfc and Jack were right. I am so used to making console apps I don't even think about making screens hardly. Even so, InFormPE wouldn't pull in any fonts in the designer. I wonder if that's normal.
Tread on those who tread on you