Panda3d does not want me to load my font (that's in the same directory)... "OSError: Could not load font file: SatellaRegular.ttf"


For the past few day, i have been developing a multiplayer shooter. Obviously, it needs some kind of gui. I wanted various fonts and font styles to be used so i tried to load a font and show some text with it.

However, it threw the following error at me:

OSError: Could not load font file: SatellaRegular.ttf

After a couple hours of scowering the internet i found absolutely nothing, so i decided to post here.

Below is a minimum reproducible example, and the font in question (though i dont think it will be of much help
The two files are in the same directory.
Minimum reproducible example:

from direct.showbase.ShowBase import ShowBase

from direct.gui.DirectGui import *
from direct.gui.OnscreenText import OnscreenText

class MyApp(ShowBase):
    def __init__(self):
        fontloader = loader.loadFont('SatellaRegular.ttf')
app = MyApp()

And finally the font(if you need it):
*the website just opens a file dialog and downloads there

Hi, welcome to the community!

Could you share which version of Panda3D you are using, which operating system, and how you installed it?

Panda version: 1.10.7
Python version: 3.8.2
Operating system: Microsoft Windows [Version 10.0.19041.685]
Installed using pip

My panda3d installations appears to be normal and executes other code perfectly well

fontloader = loader.loadFont('SatellaRegular.ttf')

Name in code SatellaRegular.ttf and name file SatellaRegular-ZVVaz.ttf

do you think there is a difference?

I changed the name and booted without errors.

1 Like

Still same problem, i believe that it is a problem with my installation
Here’s the full error log:

Traceback (most recent call last):
File “C:\Users\lazar\Desktop\”, line 58, in
app = MyApp()
File “C:\Users\lazar\Desktop\”, line 20, in init
fontloader = loader.loadFont(‘SatellaRegular-ZVVaz.ttf’)
File “C:\Users\lazar\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\”, line 638, in loadFont
raise IOError(message)
OSError: Could not load font file: SatellaRegular-ZVVaz.ttf

And the file is located in C:\Users\lazar\Desktop\, I presume?

Are there any other error messages?

Is there a particular reason why you’re using the 32-bit version of Python and Panda3D instead of the 64-bit version?

Are you new to Windows? No spaces, no hyphens in the path. no, no. :stuck_out_tongue:

1- Yes, it is in fact located there

2- No, this is the only error message

3- I dont remember specifically, but it had something to do with library support, and im too scared to change it now

One last thing to try before I see if I can manage to install a 32-bit build of Python somewhere and see if I can replicate it. Try loading it via the full path, like so:


I really do recommend using a 64-bit build. We only have the 32-bit build available for extremely old computers, and since there are so few people using it, there may be bugs that could go unnoticed.

Oh God


And change the name for the file.



SatellaRegular - ZVVaz.ttf

In the hyphen

Wait a minute, this shouldn’t be a problem, are you by any chance using some IDE?

Thank you very much! I took the time to switch to 64 bit and now it works!

On another hand, i feel really bad for people with 32-bit x86 emulators

All right, it may be a bug in how we created the 32-bit build of Panda. I’ll look into it. Thanks for bringing it to light!

My previous installation was janky so take it with a gran of salt :sweat_smile:

For the record, I’m not having any issues loading the font in an installation of 32-bit Python 3.9.1 with Panda3D 1.10.7 installed via pip.

Interesting. Maybe its something else? I dont know

If you want it to work, just do the following:

from panda3d.core import Filename
fontpath = Filename.fromOsSpecific("path/to/font.ttf")
font = loader.loadFont(fontpath)