MiRCARTCanvasImportStore.py:importTextFile(): open() w/ encoding="utf-8-sig" due to potentially present BOM.

MiRCARTToPngFile.py:export(): disable PIL font anti-aliasing.
This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-08-18 13:02:33 +02:00
parent b4e2286ecc
commit ecaaf75b6b
2 changed files with 2 additions and 1 deletions

View File

@ -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()

View File

@ -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]