From 956ce6fd3e47b2536f57f3359ebff26850f30aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 20 Jun 2016 23:38:10 +0200 Subject: Cleanup fonts --- helpers/key.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'helpers/key.py') diff --git a/helpers/key.py b/helpers/key.py index 57fdef1..e643dc2 100644 --- a/helpers/key.py +++ b/helpers/key.py @@ -1,5 +1,6 @@ from .rounded_rect import * from .action import * +from .font import font import time import sys import pygame @@ -19,7 +20,6 @@ class Key: default_inner_color = (255, 255, 255) mapped_inner_color = ( 0, 255, 0) mapped_unready_inner_color = ( 0, 255, 0, 100) - #mapped_unready_inner_color = (255, 165, 0) def __init__(self, mapping, draw_lock, key_name, key_sym, top, left, width = 48, height = 48, disabled = False): self.draw_lock = draw_lock @@ -89,12 +89,8 @@ class Key: self.surface = self.square(all_actions_ready).surface() - if getattr(sys, 'frozen', False): - police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14) - text_police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 10) - else: - police = pygame.font.Font("Ubuntu-Regular.ttf", 14) - text_police = pygame.font.Font("Ubuntu-Regular.ttf", 10) + police = font(14) + text_police = font(10) police.set_bold(True) text = police.render(self.key_sym, True, (0,0,0)) @@ -151,10 +147,7 @@ class Key: self.draw_lock.acquire() surface = pygame.Surface((690, 250)).convert() surface.fill((250, 250, 250)) - if getattr(sys, 'frozen', False): - police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14) - else: - police = pygame.font.Font("Ubuntu-Regular.ttf", 14) + police = font(14) offset = 0 police.set_bold(True) -- cgit v1.2.3