From e86a9c604878d80a2c4d24647ab015957c291f11 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:18:44 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20Config=20Window:=20Setting=20box,=20?= =?UTF-8?q?Font=20Family.=20=E3=82=A2=E3=83=AB=E3=83=95=E3=82=A1=E3=83=99?= =?UTF-8?q?=E3=83=83=E3=83=88=E9=A0=86=E3=81=ABsort=E3=81=97=E3=80=81@(?= =?UTF-8?q?=E7=B8=A6=E6=9B=B8=E3=81=8D)=E3=81=AE=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E6=8E=92=E9=99=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/view.py b/view.py index 36c5cdc0..860aa633 100644 --- a/view.py +++ b/view.py @@ -135,7 +135,7 @@ class View(): VAR_LABEL_FONT_FAMILY=StringVar(value="Font Family"), VAR_DESC_FONT_FAMILY=StringVar(value="(Default: Yu Gothic UI)"), - LIST_FONT_FAMILY=list(tk_font.families()), + LIST_FONT_FAMILY=self.getAvailableFonts(), CALLBACK_SET_FONT_FAMILY=None, VAR_FONT_FAMILY=StringVar(value=config.FONT_FAMILY), @@ -400,6 +400,13 @@ class View(): # self._insertSampleConversationToTextbox() + @staticmethod + def getAvailableFonts(): + available_fonts = list(tk_font.families()) + available_fonts.sort() + filtered_available_fonts = list(filter(lambda x: x.startswith("@") is False, available_fonts)) + return filtered_available_fonts + @staticmethod def openWebPage(url:str): webbrowser.open_new_tab(url)