Got a weird error on Win7, while trying to import font to my game via this class:
class StartText(GameText):
def Create(self, text, xpos, ypos, active):
font = sf.Font()
font.LoadFromFile('Arial.ttf')
self.active = active
if self.active == False:
self.text = sf.String(text, font, Size = 10)
else:
self.text = sf.String(text, font, Size = 12)
self.text.Italic
self.text.SetColor(sf.Color(0, 0, 0))
self.text.SetPosition(xpos, ypos)
On suggestion from IRC I simplified it to this in a separate file:
from PySFML import sf
font = sf.Font()
print 1
font.LoadFromFile(" Arial.ttf ")
print 2
This prints 1 and then crashes without an error, python just stops working. In both cases Arial.ttf is in the same folder as the script and is correctly capitalized. Anyone else experienced this or knows how to fix it? ^^