Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Having a Heck of a Time...
#1
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

Reply
#2
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".
Reply
#3
(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

Reply
#4
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.
Reply
#5
I downloaded https://www.dafont.com/picturama-founder.font and placed the folder into the QB64pe folder
the following works in Zorin x64 with the latest QB64pe
Code: (Select All)

i& = _NewImage(800, 600, 32)
Screen i&
Color &HC0FFFF00, &H200000FF
f& = _LoadFont("picturama_founder/PicturamaAlternate_PERSONAL_USE_ONLY.otf", 25) 'normal style
_Font f&
Print "Hello!"
Reply
#6
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.
Reply
#7
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

Reply




Users browsing this thread: 1 Guest(s)