aboutsummaryrefslogtreecommitdiff
path: root/helpers/key.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-20 23:38:10 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-20 23:38:10 +0200
commit956ce6fd3e47b2536f57f3359ebff26850f30aea (patch)
treef1dbabd3d625bbbc638d7ac5e9a77b4061bff9b8 /helpers/key.py
parent9de92b6dd2bd906f6a64fce7c90a6aff0dbb27a2 (diff)
downloadMusicSampler-956ce6fd3e47b2536f57f3359ebff26850f30aea.tar.gz
MusicSampler-956ce6fd3e47b2536f57f3359ebff26850f30aea.tar.zst
MusicSampler-956ce6fd3e47b2536f57f3359ebff26850f30aea.zip
Cleanup fonts
Diffstat (limited to 'helpers/key.py')
-rw-r--r--helpers/key.py15
1 files changed, 4 insertions, 11 deletions
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 @@
1from .rounded_rect import * 1from .rounded_rect import *
2from .action import * 2from .action import *
3from .font import font
3import time 4import time
4import sys 5import sys
5import pygame 6import pygame
@@ -19,7 +20,6 @@ class Key:
19 default_inner_color = (255, 255, 255) 20 default_inner_color = (255, 255, 255)
20 mapped_inner_color = ( 0, 255, 0) 21 mapped_inner_color = ( 0, 255, 0)
21 mapped_unready_inner_color = ( 0, 255, 0, 100) 22 mapped_unready_inner_color = ( 0, 255, 0, 100)
22 #mapped_unready_inner_color = (255, 165, 0)
23 23
24 def __init__(self, mapping, draw_lock, key_name, key_sym, top, left, width = 48, height = 48, disabled = False): 24 def __init__(self, mapping, draw_lock, key_name, key_sym, top, left, width = 48, height = 48, disabled = False):
25 self.draw_lock = draw_lock 25 self.draw_lock = draw_lock
@@ -89,12 +89,8 @@ class Key:
89 89
90 self.surface = self.square(all_actions_ready).surface() 90 self.surface = self.square(all_actions_ready).surface()
91 91
92 if getattr(sys, 'frozen', False): 92 police = font(14)
93 police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14) 93 text_police = font(10)
94 text_police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 10)
95 else:
96 police = pygame.font.Font("Ubuntu-Regular.ttf", 14)
97 text_police = pygame.font.Font("Ubuntu-Regular.ttf", 10)
98 94
99 police.set_bold(True) 95 police.set_bold(True)
100 text = police.render(self.key_sym, True, (0,0,0)) 96 text = police.render(self.key_sym, True, (0,0,0))
@@ -151,10 +147,7 @@ class Key:
151 self.draw_lock.acquire() 147 self.draw_lock.acquire()
152 surface = pygame.Surface((690, 250)).convert() 148 surface = pygame.Surface((690, 250)).convert()
153 surface.fill((250, 250, 250)) 149 surface.fill((250, 250, 250))
154 if getattr(sys, 'frozen', False): 150 police = font(14)
155 police = pygame.font.Font(sys._MEIPASS + "/Ubuntu-Regular.ttf", 14)
156 else:
157 police = pygame.font.Font("Ubuntu-Regular.ttf", 14)
158 151
159 offset = 0 152 offset = 0
160 police.set_bold(True) 153 police.set_bold(True)