Add horizontal/vertical gap option

Horizontal and vertical gap between dividers support - doesn’t properly
work with crop marks yet.
This commit is contained in:
Sumpfork 2016-03-16 15:05:43 -07:00
parent 0977c3e7d4
commit fdc2055999
2 changed files with 9 additions and 5 deletions

View File

@ -17,7 +17,7 @@ I believe I cannot distribute one font (Minion Pro) dominion\_tabs uses as they
Sadly, these fonts use features of the otf format that are not support by the reportlab package. Thus, they need to first be converted to ttf (TrueType) format. I used the open source package fontforge to do the conversion. Included as 'convert.ff' is a script for fontforge to do the conversion, on Mac OS X with fontforge installed through macports you can just run './convert.ff MinionPro-Regular.otf' and './convert.ff MinionPro-Bold.otf'. With other fontforge installations, you'll need to change the first line of convert.ff to point to your fontforge executable. I have not done this step under Windows - I imagine it may be possible with a cygwin install of fontforge or some such method.
## Install/Running
Once the prerequisites exist, just run 'python dominiontabs.py <outfile>' to produce a pdf file of dominion tabs. You can use a '-h' flag to see various options, such as changing to vertical tabs.
Once the prerequisites exist, just run 'python dominion_dividers.py <outfile>' to produce a pdf file of dominion tabs. You can use a '-h' flag to see various options, such as changing to vertical tabs.
Feel free to comment on boardgamegeek at <http://boardgamegeek.com/filepage/59848/horizontal-double-sided-dominion-tabs-for-all-expa> or file issues on github (<https://github.com/sumpfork/dominiontabs/issues>).

View File

@ -124,6 +124,10 @@ def parse_opts(argstring):
help="use text/letters to represent a card's set instead of the set icon")
parser.add_option("--no-page-footer", action="store_true", dest="no_page_footer",
help="don't print the set name at the bottom of the page.")
parser.add_option("--horizontal_gap", type=float, default=0.,
help="horizontal gap between dividers in centimeters")
parser.add_option("--vertical_gap", type=float, default=0.,
help="vertical gap between dividers in centimeters")
options, args = parser.parse_args(argstring)
if not options.cost:
@ -361,8 +365,8 @@ def calculate_layout(options):
else:
labelWidth = options.tabwidth * cm
labelHeight = .9 * cm
horizontalBorderSpace = 0 * cm
verticalBorderSpace = 0 * cm
horizontalBorderSpace = options.horizontal_gap * cm
verticalBorderSpace = options.vertical_gap * cm
dividerHeight = dividerBaseHeight + labelHeight
@ -405,10 +409,10 @@ def calculate_layout(options):
# dynamically max margins
add_opt(options, 'horizontalMargin',
(options.paperwidth -
options.numDividersHorizontal * options.dividerWidthReserved) / 2)
options.numDividersHorizontal * options.dividerWidthReserved + horizontalBorderSpace) / 2)
add_opt(options, 'verticalMargin',
(options.paperheight -
options.numDividersVertical * options.dividerHeightReserved) / 2)
options.numDividersVertical * options.dividerHeightReserved + verticalBorderSpace) / 2)
else:
add_opt(options, 'horizontalMargin', minmarginwidth)
add_opt(options, 'verticalMargin', minmarginheight)