From e6e1f1524b0fb8fb79f898ff863ae742cd0a3246 Mon Sep 17 00:00:00 2001 From: "Yi Yang @ Anteros" Date: Mon, 30 Dec 2024 04:15:53 +0800 Subject: [PATCH] (agrf) Move fonts to subdirectory --- agrf/pkg/font_test.py | 2 +- .../resources/{ => fonts}/AntaeusConsoleNumbers.otf | Bin agrf/sprites/__init__.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename agrf/resources/{ => fonts}/AntaeusConsoleNumbers.otf (100%) diff --git a/agrf/pkg/font_test.py b/agrf/pkg/font_test.py index 2b5d8ed4..7b90cde8 100644 --- a/agrf/pkg/font_test.py +++ b/agrf/pkg/font_test.py @@ -2,4 +2,4 @@ def test_font(): - assert load_font("resources/AntaeusConsoleNumbers.otf", 12) is not None + assert load_font("resources/fonts/AntaeusConsoleNumbers.otf", 12) is not None diff --git a/agrf/resources/AntaeusConsoleNumbers.otf b/agrf/resources/fonts/AntaeusConsoleNumbers.otf similarity index 100% rename from agrf/resources/AntaeusConsoleNumbers.otf rename to agrf/resources/fonts/AntaeusConsoleNumbers.otf diff --git a/agrf/sprites/__init__.py b/agrf/sprites/__init__.py index 1deb4bca..b292dbc0 100644 --- a/agrf/sprites/__init__.py +++ b/agrf/sprites/__init__.py @@ -25,7 +25,7 @@ def get_data_layers(self, context): alpha = Image.fromarray(alpha) draw = ImageDraw.Draw(img) drawa = ImageDraw.Draw(alpha) - font = load_font("resources/AntaeusConsoleNumbers.otf", w // 4) + font = load_font("resources/fonts/AntaeusConsoleNumbers.otf", w // 4) message = str(self.number) _, _, _w, _h = draw.textbbox((0, 0), message, font=font) draw.text(((w - _w) // 2, w // 4), message, "blue", font=font)