diff --git a/example_config.json b/example_config.json index 4b11bd3..46a3e21 100644 --- a/example_config.json +++ b/example_config.json @@ -41,6 +41,10 @@ "message_text_color": "#2e3440", "btn_bg_color": "#d8dee9", "btn_hover_color": "#eceff4", - "btn_text_color": "#2e3440" + "btn_text_color": "#2e3440", + "btn_font_face": "Sans", + "btn_font_size": "20", + "message_font_face": "Sans", + "message_font_size": "40" } } diff --git a/menu.py b/menu.py index 4e853aa..4277150 100644 --- a/menu.py +++ b/menu.py @@ -45,7 +45,7 @@ class Button: self.text = text self.theme = theme self.cbk = cbk - self.font = pygame.freetype.SysFont(name="Sans", size=20) + self.font = pygame.freetype.SysFont(name=theme["btn_font_face"], size=int(theme["btn_font_size"])) text_rect = self.font.get_rect(self.text) self.text_pos = pygame.Rect((self.position.left + (self.position.width - text_rect.width)/2), (self.position.top + (self.position.height - text_rect.height)/2), @@ -104,7 +104,7 @@ class Button: class MessageBoard(IBoard): def __init__(self, screen_rect: pygame.Rect, text: str, theme: Dict): self.text = text - self.font = pygame.freetype.SysFont(name="Sans", size=30) + self.font = pygame.freetype.SysFont(name=theme["message_font_face"], size=int(theme["message_font_size"])) text_rect = self.font.get_rect(self.text) self.text_pos = pygame.Rect((screen_rect.left + (screen_rect.width - text_rect.width)/2), (screen_rect.top + (screen_rect.height - text_rect.height)/2),