mirror of
https://github.com/lalbornoz/roar.git
synced 2024-12-22 20:36:37 +00:00
libgui/GuiCanvasWxBackend.py: only import WinDLL from ctypes if platform.system() == "Windows" (via blowfish.)
This commit is contained in:
parent
d545a7447e
commit
8fabe15792
@ -9,7 +9,6 @@ try:
|
|||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print("Failed to import GuiCanvasWxBackendFast: {}".format(e)); haveGuiCanvasWxBackendFast = False;
|
print("Failed to import GuiCanvasWxBackendFast: {}".format(e)); haveGuiCanvasWxBackendFast = False;
|
||||||
|
|
||||||
from ctypes import WinDLL
|
|
||||||
from GuiCanvasColours import Colours
|
from GuiCanvasColours import Colours
|
||||||
import math, os, platform, Rtl, wx
|
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._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
|
self.canvasBitmap, self.cellSize, self.fontName, self.fontPathName, self.fontSize = None, None, fontName, fontPathName, fontSize
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
|
from ctypes import WinDLL
|
||||||
WinDLL("gdi32.dll").AddFontResourceW(self.fontPathName.encode("utf16"))
|
WinDLL("gdi32.dll").AddFontResourceW(self.fontPathName.encode("utf16"))
|
||||||
self._initBrushesAndPens(); self.resize(canvasSize);
|
self._initBrushesAndPens(); self.resize(canvasSize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user