From ea9e25dd5b2c045d2d5f61baf4c2a594ea3e69cf Mon Sep 17 00:00:00 2001 From: Wendel Voigt Date: Fri, 23 Oct 2015 14:42:46 -0500 Subject: [PATCH] Fix for Issue #20 - Unsleeved horizontal A4 sheets overlap with expansion name Fixed two things: 1. font.face.descent was a negative number. To get the full font height, the absolute value of it needed to be added. 2. Was printing the footer to the middle of the space left between the bottom of the cards and the margin. For small spaces this gives up 1/2 the room. So instead, printing the footer at the very bottom of the margin. --- dominion_tabs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dominion_tabs.py b/dominion_tabs.py index 8b3ebd3..f0a7edd 100755 --- a/dominion_tabs.py +++ b/dominion_tabs.py @@ -709,7 +709,7 @@ class DominionTabs: minFontsize = 6 fontname = 'MinionPro-Regular' font = pdfmetrics.getFont(fontname) - fontHeightRelative = (font.face.ascent + font.face.descent) / 1000 + fontHeightRelative = (font.face.ascent + abs(font.face.descent) ) / 1000.0 canFit = False @@ -744,8 +744,10 @@ class DominionTabs: if setTitle not in sets: sets.append(setTitle) + # Centered on page xPos = layout['width'] / 2 - yPos = layout['minMarginHeight'] + availableMargin / 2 + # Place at the very edge of the margin + yPos = layout['minMarginHeight'] if layout['rotation']: self.canvas.rotate(layout['rotation'])