Custom fonts not loading, editing .json during runtime fixed it #680
Unanswered
Julian-Roach
asked this question in
Q&A
Replies: 1 comment
-
Actually, the .json file wasn't the one that provided the information at all. I hard coded it with the Immediate suggestion: perhaps return "True" if there's any path error and "False" if loading the font goes smoothly? This way it's wayy easier to analyze path issues by calling print(a) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is this the appropriate place to post this? Anyway,
I've spent an amount of time trying to figure out why my font placed in the parallel folder Fonts/fontname.ttf wouldn't load, even though pygame recognized it and my .json file with
seemed to be perfectly written. Altering the .json during runtime, which forces a refresh, suddenly applied my font on the screen, implying the manager hadn't loaded it initially. Hence I played around and found that calling
right before my main loop also made the manager recognize the appropriate font.
To be fair, I haven't been using pygame_gui for long, but I couldn't find enough help in the documentation either, so I wish there had been a more direct explanation on how loading from files works around here.
Either I have overlooked something, or it could also be a linux-specific issue, as I'm on manjaro linux (though using a virtual environment)
Beta Was this translation helpful? Give feedback.
All reactions