'Why do I sometimes get 'pygame.error: Couldn't find glyph' when I use ptext.draw()?

Every now and then when I run my pygame window it gives me an error: pygame.error: Couldn't find glyph and points me to the line where I used the ptext.draw() function (from the ptext module that I got from https://github.com/cosmologicon/pygame-text) This error doesn't happen all the time, but only when I give it a lot of text to process (more than approx. 40 characters). The weird thing is that when I run it again after it got an error, it works and doesn't give the error with the same text. Does anyone know what's causing this random error and how to stop it? This is the code where I use this function:

ptext.draw(text=quote, width=800, topleft=(315, 680), align="left", surf=screen,
 fontname="assets/Aller_Rg.ttf", fontsize=30, color="black", ocolor="white", owidth=1)

ptext.draw(text=speaker, width=800, topleft=(315, 670), align="left", surf=screen,
 fontname="assets/Aller_Rg.ttf", fontsize=40, color=speakerColor, ocolor="black", owidth=1)

ptext.draw(text=f"\"{quote}\"", width=800, topleft=(315, 730), align="left", surf=screen,
 fontname="assets/Aller_Rg.ttf", fontsize=30, color=speakerColor, ocolor="black", owidth=1)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source