What fonts can be used with pygame.font.SysFont()?

Viewed 1067

So far I've found that Calibri, Courier, and Times New Roman can be used with pygame.font.SysFont(). It takes the name of a font as a string as an argument. Would it be possible to put any font name, as long as its a string, as the font argument? Or is there a select number of fonts you can use?

1 Answers

Any font in the list returned from pygame.font.get_fonts() can be used. This is a list of all the system fonts (ones built into the running system). If you have your own .ttf file you want to use, you can instead use pygame.font.Font. The advantage of that is you know the font you want is available (since you are bundling it with your game). With system fonts, you don't necessarily know what fonts will be available on the user's system.

Related