projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remaining bits
[naja.git]
/
naja
/
widgets
/
text.py
diff --git
a/naja/widgets/text.py
b/naja/widgets/text.py
index 39178ed8777ee3e500276b95c975993721e681e2..12df393f1ff855c8a83aa8cd520c181f5ed19984 100644
(file)
--- a/
naja/widgets/text.py
+++ b/
naja/widgets/text.py
@@
-1,3
+1,5
@@
+import pygame
+
from naja.constants import FONT, FONT_SIZE
from naja.widgets.base import Widget
from naja.resources import resources
from naja.constants import FONT, FONT_SIZE
from naja.widgets.base import Widget
from naja.resources import resources
@@
-10,12
+12,15
@@
class TextWidget(Widget):
self.text = text
self.fontname = fontname or FONT
self.text = text
self.fontname = fontname or FONT
- self.fontsize =
fontsize or FONT_SIZE
+ self.fontsize =
(fontsize or FONT_SIZE) / 2
self.colour = colour or (0, 0, 0)
def prepare(self):
self.font = resources.get_font(self.fontname, self.fontsize)
self.colour = colour or (0, 0, 0)
def prepare(self):
self.font = resources.get_font(self.fontname, self.fontsize)
- self.surface = self.font.render(self.text, True, self.colour)
+ text = self.font.render(self.text, True, self.colour)
+ text_rect = text.get_rect()
+ self.surface = pygame.transform.scale(text, (text_rect.width * 2,
+ text_rect.height * 2))
self.size = self.surface.get_rect().size
def draw(self, surface):
self.size = self.surface.get_rect().size
def draw(self, surface):