From a002cb96bb88928c8efb746c69fdb9422aabe2d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 18 Aug 2019 13:02:33 +0200 Subject: [PATCH] MiRCARTCanvasImportStore.py:importTextFile(): open() w/ encoding="utf-8-sig" due to potentially present BOM. MiRCARTToPngFile.py:export(): disable PIL font anti-aliasing. --- MiRCART-python/MiRCARTCanvasImportStore.py | 2 +- MiRCART-python/MiRCARTToPngFile.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MiRCART-python/MiRCARTCanvasImportStore.py b/MiRCART-python/MiRCARTCanvasImportStore.py index 6b55b48..275a9ac 100644 --- a/MiRCART-python/MiRCARTCanvasImportStore.py +++ b/MiRCART-python/MiRCARTCanvasImportStore.py @@ -53,7 +53,7 @@ class MiRCARTCanvasImportStore(): # }}} # {{{ importTextFile(self, pathName): XXX def importTextFile(self, pathName): - self.inFile = open(pathName, "r", encoding="utf-8") + self.inFile = open(pathName, "r", encoding="utf-8-sig") self.inSize = self.outMap = None; inCurColourSpec = ""; inCurRow = -1; inLine = self.inFile.readline() diff --git a/MiRCART-python/MiRCARTToPngFile.py b/MiRCART-python/MiRCARTToPngFile.py index 45bee4e..e1f03b8 100755 --- a/MiRCART-python/MiRCARTToPngFile.py +++ b/MiRCART-python/MiRCARTToPngFile.py @@ -68,6 +68,7 @@ class MiRCARTToPngFile: outCurPos = [0, 0] outImg = Image.new("RGBA", outSize, (*self._ColourMapNormal[1], 255)) outImgDraw = ImageDraw.Draw(outImg) + outImgDraw.fontmode = "1" for inCurRow in range(len(self.inCanvasMap)): for inCurCol in range(len(self.inCanvasMap[inCurRow])): inCurCell = self.inCanvasMap[inCurRow][inCurCol]