The only bad thing I can say about it is that it simply doesn't work :(
f = pygame.font.Font(None, 12)
f.size = 12
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'pygame.font.Font' object attribute 'size' is read-only
And that is not just because Font already has a method named .size()
f.pointsize = 12
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'pygame.font.Font' object has no attribute 'pointsize'
I'm guessing that since pygame.font.Font is impelmented in C, it doesn't
allow new members to be added as it would if it was implemented in
python (Correct me if I am wrong)
---
James Paige
On Tue, Jan 13, 2009 at 01:54:30AM +0200, Thiago Chaves wrote:
You can also just violate the object by giving it an extra attribute:
f = pygame.font.Font(filename, size)
f.new_attribute = size