From bfe11abc5ffad21f01fc22bde9d036497ddd0c2f Mon Sep 17 00:00:00 2001 From: Gordon Shumway <39967334+oddluck@users.noreply.github.com> Date: Wed, 26 Jun 2019 01:57:51 -0400 Subject: [PATCH] change font for png command --- ASCII/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ASCII/plugin.py b/ASCII/plugin.py index f8078c3..08fc3b7 100644 --- a/ASCII/plugin.py +++ b/ASCII/plugin.py @@ -365,7 +365,7 @@ class ASCII(callbacks.Plugin): text = text.replace('\t', ' ') self.strip_colors_regex = re.compile('(\x03([0-9]{1,2})(,[0-9]{1,2})?)|[\x0f\x02\x1f\x03\x16]').sub path = os.path.dirname(os.path.abspath(__file__)) - defaultFont = "{0}/DejaVuSansMono.ttf".format(path) + defaultFont = "{0}/hack.ttf".format(path) def strip_colors(string): return self.strip_colors_regex('', string) _colorRegex = re.compile('(([0-9]{1,2})(,([0-9]{1,2}))?)') @@ -373,9 +373,9 @@ class ASCII(callbacks.Plugin): lineLens = [len(line) for line in strip_colors(text).splitlines()] maxWidth, height = max(lineLens), len(lineLens) font = ImageFont.truetype(defaultFont, size) - fontX, fontY = font.getsize(' ') + fontX, fontY = font.getsize('█') fontX -= 1 - fontY += 3 + fontY -= 1 imageX, imageY = maxWidth * fontX, height * fontY image = Image.new('RGB', (imageX, imageY), self.rgbColors[defaultBg]) draw = ImageDraw.Draw(image)