mirror of
https://github.com/stronk-dev/Guitar-Sheet-Parser.git
synced 2025-07-05 08:25:09 +02:00
Added a right-margin propert
Overflow-X check function now takes left and right margin into account
This commit is contained in:
parent
0767b7c2eb
commit
5325906c22
@ -42,7 +42,8 @@ def initConfig():
|
||||
'fontColour': '0,0,0',
|
||||
'metadataColour': '128,128,128',
|
||||
'topMargin': 10,
|
||||
'leftMargin': 25
|
||||
'leftMargin': 25,
|
||||
'rightMargin': 25
|
||||
}
|
||||
# (if CMD arguments: load CMD arguments to override specific settings)
|
||||
with open('config.ini', 'w') as configfile:
|
||||
|
@ -199,6 +199,7 @@ class Song:
|
||||
self.imageWidth = int(configObj['imageWidth'])
|
||||
self.imageHeight = int(configObj['imageHeight'])
|
||||
self.leftMargin = int(configObj['leftMargin'])
|
||||
self.rightMargin = int(configObj['rightMargin'])
|
||||
self.fontMetadata = ImageFont.truetype(configObj['metafontfamily'], int(configObj['metaFontWeight']))
|
||||
self.fontSize = int(configObj['songFontWeight'])
|
||||
self.fontLyrics = ImageFont.truetype(configObj['lyricfontfamily'], self.fontSize)
|
||||
@ -258,7 +259,7 @@ class Song:
|
||||
"""
|
||||
def checkOverflowX(self):
|
||||
for section in self.sections:
|
||||
if section.expectedWidth > self.imageWidth:
|
||||
if section.expectedWidth > self.imageWidth - self.leftMargin - self.rightMargin:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user