From ca12e20a7a9dd67893094a55a39d45f661a4c585 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 9 Jul 2021 20:45:38 +0200 Subject: [PATCH] Fix topmargin, increased default margins --- lib/config.py | 8 ++++---- output2img.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/config.py b/lib/config.py index 3761976..e27e5b7 100644 --- a/lib/config.py +++ b/lib/config.py @@ -39,16 +39,16 @@ def initConfig(): 'exporttoraw': 0 } config['output'] = {'metafontfamily': 'fonts/CourierPrime-Regular.ttf', - 'metaFontWeight': 16, + 'metaFontWeight': 32, 'lyricfontfamily': 'fonts/CourierPrime-Regular.ttf', 'tablaturefontfamliy': 'fonts/CourierPrime-Bold.ttf', 'imageppi': 144, 'backgroundColour': '255,255,255', 'fontColour': '0,0,0', 'metadataColour': '128,128,128', - 'topMargin': 10, - 'leftMargin': 25, - 'rightMargin': 25 + 'topMargin': 50, + 'leftMargin': 50, + 'rightMargin': 50 } # (if CMD arguments: load CMD arguments to override specific settings) with open('config.ini', 'w') as configfile: diff --git a/output2img.py b/output2img.py index 390ed92..ff77fbd 100644 --- a/output2img.py +++ b/output2img.py @@ -52,10 +52,10 @@ def outputToImage(folderLocation, songObj): metadataTextWidth, metadataTextHeight = songObj.fontMetadata.getsize(line) draw.text((songObj.leftMargin,currentHeight), line, fill=songObj.metadataColour, font=songObj.fontMetadata) currentHeight += metadataTextHeight - # Margin between metadata and the first section - currentHeight += songObj.topMargin # Draw all pages for page in songObj.pages: + # Margin between metadata and the first section / section and top of page + currentHeight += songObj.topMargin for section in page.sections: # Reset section specific variables lineIterator = 0