From 7910d58dab72c013dbdf4f060d7e4680bce44a67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 26 Jun 2016 10:18:43 +0200 Subject: [PATCH] Fix font sizes --- musicsampler.kv | 67 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/musicsampler.kv b/musicsampler.kv index 3bf344e..137b7bd 100644 --- a/musicsampler.kv +++ b/musicsampler.kv @@ -113,6 +113,7 @@ size: self.parent.play_list_width, self.parent.play_list_height : + min_height: min(action_list_mock_symbola.height, action_list_mock_ubuntu_regular.height, action_list_mock_ubuntu_bold.height) size_hint: None, None canvas: Color: @@ -120,6 +121,36 @@ Rectangle: pos: 0, 0 size: self.width, self.height + # FIXME: déplacer ça dans Screen? + Label: + id: action_list_mock_symbola + font_name: h.path() + "fonts/Symbola.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Label: + id: action_list_mock_ubuntu_regular + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Label: + id: action_list_mock_ubuntu_bold + font_name: h.path() + "fonts/Ubuntu-B.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + + Label: id: action_list_title font_name: h.path() + "fonts/Ubuntu-B.ttf" @@ -135,7 +166,7 @@ id: action_list_icons font_name: h.path() + "fonts/Symbola.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - line_height: 1.2 # FIXME: Donner la bonne taille de label + line_height: self.parent.min_height / max(action_list_mock_symbola.height,1) color: 0, 0, 0, 1 text: "\n".join(map(lambda x: x[0], self.parent.action_list)) text_size: None, self.parent.height @@ -147,6 +178,7 @@ id: action_list_names font_name: h.path() + "fonts/Ubuntu-Regular.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + line_height: self.parent.min_height / max(action_list_mock_ubuntu_regular.height,1) color: 0, 0, 0, 1 text: "\n".join(map(lambda x: x[1], self.parent.action_list)) text_size: None, self.parent.height @@ -157,6 +189,7 @@ size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size : + min_height: min(playlist_mock_symbola.height, playlist_mock_ubuntu_regular.height, playlist_mock_ubuntu_bold.height) size_hint: None, None canvas: Color: @@ -164,11 +197,40 @@ Rectangle: pos: 0, 0 size: self.width, self.height + Label: + id: playlist_mock_symbola + font_name: h.path() + "fonts/Symbola.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Label: + id: playlist_mock_ubuntu_regular + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Label: + id: playlist_mock_ubuntu_bold + font_name: h.path() + "fonts/Ubuntu-B.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + + Label: id: playlist_icons font_name: h.path() + "fonts/Symbola.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - line_height: 1.2 # FIXME: Donner la bonne taille de label + line_height: self.parent.min_height / max(playlist_mock_symbola.height,1) color: 0, 0, 0, 1 text: "\n".join(map(lambda x: x[0], self.parent.playlist)) text_size: None, self.parent.height @@ -179,6 +241,7 @@ Label: id: playlist_names font_name: h.path() + "fonts/Ubuntu-Regular.ttf" # FIXME: Mettre en gras quand c'est en cours + line_height: self.parent.min_height / max(playlist_mock_ubuntu_regular.height,1) font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) color: 0, 0, 0, 1 text: "\n".join(map(lambda x: x[1], self.parent.playlist)) -- 2.41.0