Fix topmargin, increased default margins

This commit is contained in:
Marco van Dijk 2021-07-09 20:45:38 +02:00
parent 8d03f6d665
commit ca12e20a7a
2 changed files with 6 additions and 6 deletions

View File

@ -39,16 +39,16 @@ def initConfig():
'exporttoraw': 0 'exporttoraw': 0
} }
config['output'] = {'metafontfamily': 'fonts/CourierPrime-Regular.ttf', config['output'] = {'metafontfamily': 'fonts/CourierPrime-Regular.ttf',
'metaFontWeight': 16, 'metaFontWeight': 32,
'lyricfontfamily': 'fonts/CourierPrime-Regular.ttf', 'lyricfontfamily': 'fonts/CourierPrime-Regular.ttf',
'tablaturefontfamliy': 'fonts/CourierPrime-Bold.ttf', 'tablaturefontfamliy': 'fonts/CourierPrime-Bold.ttf',
'imageppi': 144, 'imageppi': 144,
'backgroundColour': '255,255,255', 'backgroundColour': '255,255,255',
'fontColour': '0,0,0', 'fontColour': '0,0,0',
'metadataColour': '128,128,128', 'metadataColour': '128,128,128',
'topMargin': 10, 'topMargin': 50,
'leftMargin': 25, 'leftMargin': 50,
'rightMargin': 25 'rightMargin': 50
} }
# (if CMD arguments: load CMD arguments to override specific settings) # (if CMD arguments: load CMD arguments to override specific settings)
with open('config.ini', 'w') as configfile: with open('config.ini', 'w') as configfile:

View File

@ -52,10 +52,10 @@ def outputToImage(folderLocation, songObj):
metadataTextWidth, metadataTextHeight = songObj.fontMetadata.getsize(line) metadataTextWidth, metadataTextHeight = songObj.fontMetadata.getsize(line)
draw.text((songObj.leftMargin,currentHeight), line, fill=songObj.metadataColour, font=songObj.fontMetadata) draw.text((songObj.leftMargin,currentHeight), line, fill=songObj.metadataColour, font=songObj.fontMetadata)
currentHeight += metadataTextHeight currentHeight += metadataTextHeight
# Margin between metadata and the first section
currentHeight += songObj.topMargin
# Draw all pages # Draw all pages
for page in songObj.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: for section in page.sections:
# Reset section specific variables # Reset section specific variables
lineIterator = 0 lineIterator = 0