From 368df55a72088abb67cb6628b2fac6b1c855c350 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sun, 9 Nov 2025 15:40:40 -0500 Subject: [PATCH] [#1805] Fix Prototyping for Font Theme --- theme.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/theme.py b/theme.py index 99ccb158..20ffe51f 100644 --- a/theme.py +++ b/theme.py @@ -35,11 +35,13 @@ if sys.platform == 'win32': from ctypes.wintypes import DWORD, LPCVOID, LPCWSTR import win32gui AddFontResourceEx = ctypes.windll.gdi32.AddFontResourceExW - AddFontResourceEx.restypes = [LPCWSTR, DWORD, LPCVOID] # type: ignore + AddFontResourceEx.argtypes = [LPCWSTR, DWORD, LPCVOID] + AddFontResourceEx.restype = ctypes.c_int FR_PRIVATE = 0x10 FR_NOT_ENUM = 0x20 - font_path = config.respath_path / 'EUROCAPS.TTF' - AddFontResourceEx(str(font_path), FR_PRIVATE, 0) + font_path = str(config.respath_path / 'EUROCAPS.TTF') + if not AddFontResourceEx(font_path, FR_PRIVATE, None): + raise RuntimeError(f"Failed to load font {font_path}") elif sys.platform == 'linux': # pyright: reportUnboundVariable=false