png: character size adjustment

This commit is contained in:
Gordon Shumway 2019-05-14 02:29:27 -04:00 committed by GitHub
parent 909b6b8440
commit 640c564c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -172,6 +172,7 @@ class ASCII(callbacks.Plugin):
maxWidth, height = max(lineLens), len(lineLens)
font = ImageFont.truetype(defaultFont, size)
fontX, fontY = font.getsize(' ')
fontX -= 1
fontY += 3
imageX, imageY = maxWidth * fontX, height * fontY
image = Image.new('RGB', (imageX, imageY), self.rgbColors[defaultBg])