From 8fabe15792aef54a0029c3eb45911762184e7f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 27 Mar 2020 18:13:26 +0100 Subject: [PATCH] libgui/GuiCanvasWxBackend.py: only import WinDLL from ctypes if platform.system() == "Windows" (via blowfish.) --- libgui/GuiCanvasWxBackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgui/GuiCanvasWxBackend.py b/libgui/GuiCanvasWxBackend.py index 31b5eda..d1ec5b6 100644 --- a/libgui/GuiCanvasWxBackend.py +++ b/libgui/GuiCanvasWxBackend.py @@ -9,7 +9,6 @@ try: except ImportError as e: print("Failed to import GuiCanvasWxBackendFast: {}".format(e)); haveGuiCanvasWxBackendFast = False; -from ctypes import WinDLL from GuiCanvasColours import Colours import math, os, platform, Rtl, wx @@ -244,6 +243,7 @@ class GuiCanvasWxBackend(): self._brushes, self._font, self._lastBrush, self._lastPen, self._pens = None, None, None, None, None self.canvasBitmap, self.cellSize, self.fontName, self.fontPathName, self.fontSize = None, None, fontName, fontPathName, fontSize if platform.system() == "Windows": + from ctypes import WinDLL WinDLL("gdi32.dll").AddFontResourceW(self.fontPathName.encode("utf16")) self._initBrushesAndPens(); self.resize(canvasSize);