Git Product home page Git Product logo

dominiontabs's Introduction

Dominion Divider Generation

Tests

Introduction

This is a script and library to generate card dividers for storing cards for the game Dominion. If you are just looking go generate some dominion dividers, there is no need to install this script as I host a live version of this generator code. However, if you want to use arguments that I don't expose on that page, or change the code, or contribute to the project the full generation code (not the web interface or the fonts) is included here, and contributions are more than welcome.

Again, to generate tabs go to the Online Generator.

Installation

If you do need to install the package locally (the script provides a lot more options than the web-based generator), a simple pip install domdiv should suffice, providing a command by the name of dominion_dividers. However, see the note under Prerequisites->Fonts below as the default install will fall back on a font that doesn't match the cards (though most people don't notice). Run dominion_dividers <outfile> to get a pdf of all dividers with the default options, or run dominion_dividers --help to see the (extensive) list of options.

Documentation

The script has an extensive set of options that are relatively well documented via dominion_dividers --help. Some are hard to describe unless you see output samples, so we recommend running the script with various options to see which configuration you like. The help output is replicated here for reference.

Translations

When changing any of the card database files you should run the language update tool via doit update_languages. This produces the package version of the card db from the card db source. This will also be run automatically and checked into git when you push to github. You should make sure that the resulting changes to the package are what you intend by generating dividers in the relevant languages.

If you would like to help with translations to new (or updating existing) languages, please see instructions here.

Fonts

There are a number of fonts used in Dominion and many of them we cannot distribute with the package. We use fallbacks to commonly distributed fonts that work fine if you don't care the match the game exactly. If you do want to match, the script prints the preferred fonts if it uses fallbacks. Some come with programs like Adobe Reader and you can grab them from there.

Sadly, many of these fonts use features 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 'tools/convert_font.ff' is a script for fontforge to do the conversion, on Mac OS X with fontforge installed through macports or homebrew you can just run commands like ./tools/convert_font.ff MinionPro-Regular.otf.

To supply fonts locally, put them in a directory and supply the relative path to it to the script via the --font-dir option. Alternatively you can copy the converted .ttf files to the fonts directory in the domdiv package/directory, then perform the package install below.

Using as a library

The library will be installed as domdiv with the main entry point being domdiv.main.generate(options). It takes a Namespace of options as generated by python's argparser module. You can either use domdiv.main.parse_opts(cmdline_args) to get such an object by passing in a list of command line options (like sys.argv), or directly create an appropriate object by assigning the correct values to its attributes, starting from an empty class or an actual argparse Namespace object.

Developing

Install requirements via pip install -r requirements.txt. Then, run pre-commit install. You can use python setup.py develop to install the dominion_dividers script so that it calls your checked out code, enabling you to run edited code without having to perform an install every time.

Feel free to comment on boardgamegeek at https://boardgamegeek.com/thread/926575/web-page-generate-tabbed-dividers or file issues on github (https://github.com/sumpfork/dominiontabs/issues).

Tests can be run (and their dependencies installed) via python setup.py test, which will also happen if/when you push a branch or make a PR.

Image Sources

There is a separate repo for the image sources. While these are optional, they can be useful reference and/or used for creating new or recreating old tab banners, icons, etc. Many of these were originally scans of the physical game. Some of them have a lot of layers and are approaching 1GB in size, so they are hosted via Git LFS. As the Github version of that incurs a higher monthly cost, I instead host them on a private LFS server. If you would like the images or would like to contribute images let me know and I can make you an account on said server, or you I can copy them for you for easier access.

dominiontabs's People

Contributors

sumpfork avatar pmolodo avatar wvoigt avatar nickv2002 avatar pjmikkol avatar mr-ice avatar md5i avatar robertre avatar bszonye avatar splatteredbits avatar github-actions[bot] avatar piroxxi avatar rmammouth avatar gwen1230 avatar aarongilly avatar xedorian avatar mrgrain avatar openam avatar rystan avatar jdgordon avatar dennislaumen avatar inigogutierrez avatar tcnuk avatar robertre2 avatar nstraz avatar msykora avatar idlaviv avatar despian avatar wdoekes avatar 0-wiz-0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.