# HG changeset patch # User Stefano Rivera # Date 1329063862 -7200 # Node ID b27b5c6c54e8622b1f714efd9ca3eb53204ac597 # Parent fe7023750b20076365eb1373306015462f3f6645 Use constants for font location diff -r fe7023750b20 -r b27b5c6c54e8 pyntnclick/constants.py --- a/pyntnclick/constants.py Sun Feb 12 18:00:18 2012 +0200 +++ b/pyntnclick/constants.py Sun Feb 12 18:24:22 2012 +0200 @@ -26,6 +26,8 @@ debug = _get_debug() font = 'Vera.ttf' + bold_font = 'VeraBd.ttf' + mono_font = 'Monospace.ttf' font_size = 16 text_color = 'black' label_padding = 10 diff -r fe7023750b20 -r b27b5c6c54e8 pyntnclick/gamescreen.py --- a/pyntnclick/gamescreen.py Sun Feb 12 18:00:18 2012 +0200 +++ b/pyntnclick/gamescreen.py Sun Feb 12 18:24:22 2012 +0200 @@ -257,8 +257,8 @@ self.left = self.rect.left self.menu_button = self.add_tool( - 0, TextButton, gd, "Menu", fontname="VeraBd.ttf", color="red", - padding=2, border=0) + 0, TextButton, gd, "Menu", fontname=gd.constants.bold_font, + color="red", padding=2, border=0) self.menu_button.add_callback(MOUSEBUTTONDOWN, self.menu_callback) hand_image = gd.resource.get_image('items', 'hand.png') diff -r fe7023750b20 -r b27b5c6c54e8 pyntnclick/tools/rect_drawer.py --- a/pyntnclick/tools/rect_drawer.py Sun Feb 12 18:00:18 2012 +0200 +++ b/pyntnclick/tools/rect_drawer.py Sun Feb 12 18:24:22 2012 +0200 @@ -85,7 +85,7 @@ self.current_image = None self.place_image_menu = None self.close_button = LabelWidget(pygame.Rect((0, 0), (200, 100)), - gd, 'Close', fontname='Vera.ttf', fontsize=20) + gd, 'Close', fontname=constants.bold_font, fontsize=20) self.close_button.fg_color = (0, 0, 0) self.close_button.bg_color = (0, 0, 0) self.draw_rects = True @@ -528,7 +528,7 @@ def __init__(self, rect, gd, app_image): self.app_image = app_image super(ModeLabel, self).__init__(rect, - gd, 'Mode : ', fontname='VeraBd.ttf', + gd, 'Mode : ', fontname=constants.bold_font, fontsize=15, color=pygame.color.Color(128, 0, 255)) def draw_all(self, surface): @@ -540,7 +540,7 @@ rect = pygame.rect.Rect(0, 0, constants.menu_width, constants.menu_button_height) rect.move_ip(805, ypos) - button = TextButton(rect, gd, text, fontname='Vera.ttf', fontsize=12, + button = TextButton(rect, gd, text, fontname=constants.font, fontsize=12, color=pygame.color.Color(255, 255, 0), border=1, padding=3) button.add_callback('clicked', action) return button