comparison src/parpg/font.py @ 182:59c9ce2b8351

PARPG now works with, and needs Fife 0.3.3.
author KarstenBock@gmx.net
date Tue, 11 Oct 2011 14:47:37 +0200
parents d60f1dab8469
children
comparison
equal deleted inserted replaced
181:54c4277ed905 182:59c9ce2b8351
1 import os 1 import os
2 2
3 from fife.extensions import pychan
3 from fife.extensions.pychan.fonts import Font 4 from fife.extensions.pychan.fonts import Font
4 from fife.extensions.pychan.internal import get_manager 5
5 6
6 class PARPGFont(Font): 7 class PARPGFont(Font):
7 """ Font class for PARPG 8 """ Font class for PARPG
8 This class behaves identical to PyChan's Font class except in 9 This class behaves identical to PyChan's Font class except in
9 initialization. Ratherthan take a name and a get object, this class 10 initialization. Ratherthan take a name and a get object, this class
33 34
34 if self.typename == 'truetype': 35 if self.typename == 'truetype':
35 self.size = fontdef['size'] 36 self.size = fontdef['size']
36 self.antialias = fontdef['antialias'] 37 self.antialias = fontdef['antialias']
37 self.color = fontdef.get('color', [255, 255, 255]) 38 self.color = fontdef.get('color', [255, 255, 255])
38 manager = get_manager().hook.engine.getGuiManager() 39 manager = pychan.manager.hook.guimanager
39 self.font = manager.createFont(self.source, self.size, '') 40 self.font = manager.createFont(self.source, self.size, '')
40 41
41 if not self.font: 42 if not self.font:
42 raise InitializationError('Could not load font ' 43 raise InitializationError('Could not load font '
43 '{0}'.format(self.name)) 44 '{0}'.format(self.name))