0

I want to use a font that I found on the internet in my game, but whenever I try and implement it, I get the error: FileNotFoundError: [Errno 2] No such file or directory: 'PixelFont.ttf'

My current code is: pygame.font.Font("PixelFont.ttf", 40)

Thank you for any help!

  • 1
    Use an absolut path and read [pygame.image.load('sprite/test_bg.jpg'): pygame.error: Couldn't open sprite/test_bg.jpg](https://stackoverflow.com/questions/58177145/pygame-image-loadsprite-test-bg-jpg-pygame-error-couldnt-open-sprite-test) – Rabbid76 Jan 10 '21 at 20:19
  • Try to put the full file extension in. Example: "C://Users//yourName//Downloads//PixelFont.ttf" – User 12692182 Jan 10 '21 at 20:20

0 Answers0