Tools for building PDF & PNG files suitable for printing on card stock, or sending to a printer of game cards.
Starting with John Scott’s MS Word documents as inspiration, these cards have been reedited, reformatted, and reimagined.
Many of the cards have acting tips for bringing the madness to life at the table as well as in the game.
Thanks to the artists whose work made this project possible:
If you are happy to simply download my original release of the cards without updates or changes of your own, see the original blog post.
Otherwise, keep reading to build a copy yourself.
To build a PDF of the cards requires xsltproc from libxstl2, Apache FOP 2.x, and ImageMagick
PNG files are built from the PDF, and also require Ghostscript.
My own PDFs use the Cochin typeface.
I strongly recommend installation via Homebrew.
brew install fop imagemagick
brew install ghostscript
or combined into a
single command: brew install fop imagemagick ghostscript
If you wish to use the Cochin typeface you can extract the TTF
files out of the TTC file in /Library/Fonts/Cochin.ttc
. This
Gist works for fontforge installed
via Homebrew if you change the shebang to use python2.7
instead of python3
.
yum install -y epel-release
.yum install -y make libxslt ImageMagick fop
brew install -y ghostscript
RHEL / CentOS Note: At the time of this writing EPEL installs fop-1.1 and will likely do so for the lifetime of RHEL7. I do not believe I’m using any XSL:FO not supported by 1.1, but it has been a long time since I used 1.1, and I am not explicitly testing on 1.1.
apt-get install -y fop imagemagick xsltproc
install -y ghostscript
No idea, sorry. FOP is Java-based, so you should be able to download and run it once you have Java installed. I know ImageMagick has Windows support, and I believe libxslt2 & ghostscript have provisions for installing on Windows, though they may or may not require Cygwin.
If someone with a Windows box gets it working, I’d love a docs PR.
Provided xsltproc & fop are in your PATH, you should be able to run make
and
it will produce a PDF named cards.pdf
:
% make
xsltproc -o cards.fo cards-fo.xsl cards.xml
fop -c fonts/userconfig.xml cards.fo cards.pdf
2018-05-08 07:37:23.963 java[87241:14203638] ApplePersistence=NO
May 08, 2018 7:37:31 AM org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #1.
May 08, 2018 7:37:31 AM org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #2.
[ … ]
May 08, 2018 7:37:34 AM org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #53.
May 08, 2018 7:37:34 AM org.apache.fop.events.LoggingEventListener processEvent
INFO: Rendered page #54.
If you do not have the Cochin TTF files in the fonts
directory matching the
names in the fonts/userconfig.xml
file, fop will error out with a Java
FileNotFoundErrors for these files:
[…]
May 08, 2018 7:42:21 AM org.apache.fop.fonts.LazyFont load
SEVERE: Failed to read font metrics file null
java.io.FileNotFoundException: /Users/erik/work/madness_cards/fonts/Cochin.ttf (No such file or directory)
[…]
In this case you have a few options:
userconfig.xml
file to match. You may have to edit the cards to allow the
text on them to fit, since the letter-spacing will have changed.-c $<
so that the configuration file is
not used. (Not Recommended. The cards will look terrible.)I used poker playing cards as the template for these cards. The company I used to print mine specified their cards as 63×88mm, with ⅛" buffer lost to cutting, and another ⅛" “for safety.”
I’m very happy with my cards (I chose the 330gsm stock), and would definitely recommend them. If you are using another printer, make sure you check their sizing, and adjust accordingly. The cards should render correctly at new sizes, but you should spot check each card to ensure everything lines up and the text all fits before sending them to the printer.
By default, PNGs will be created at 1200 dpi, allowing Ghostscript to use 512MB as it builds them. To use these defaults run:
make png
That will create all of the cards (that do not have the enabled="false"
attribute set) in the cards directory: cards/card-01.png
through
cards/card-54.png
.
To change the defaults:
make PNG_DPI=300 GS_MEMORY=1073741824 png
Unless you merely want to tweak the wording of an existing card, I recommend
creating new cards for all your changes. If you are limited in the number of
cards you can print, you can add an enabled="false"
attribute to the cards you
want to leave out. (I have already done this on two cards in the deck, to make
room for two new ones.)
Each card is defined by a <card>
entry in cards.xml
. I happen to think the
DTD is pretty straightforward, but there are some points it’s probably worth
documenting by example:
<card duration="Short|Long|Indefinite">
<title shrink="optional attribute: if present, shrinks the text size to try to fit it on one line. Use sparingly.">
The Title Goes Here and Is Shown At the Top of the Card (The Stylesheet Does
Not Gracefully Handle Titles That Wrap, So Keep It Short!)
</title>
<description>
<line>
Descriptions can either contain their text directly, in which case it is
all run together in a single block.
</line>
<line>
Or they can contain <line>s, which separate text into lines.
</line>
<line>Also: <em> and <strong< work as you might expect.</line>
</description>
<acting tight="optional attribute: if present, the spacing is reduced up to try to help it fit when space is tight">
This portion of the card is optional. If present, it appears below the
description, in the paper section, in italics, with a pair of Sock and
Buskin Masks to denote acting tips. This section can also include
<line>s. <strong> also works as expected, but <em>
romanizes and bolds the text.
</acting>
</card>
New card contributions are certainly welcome. Fixes for typos, grammatical errors, or clumsy wording are also welcome.
I’ve also debated adding a subtle texture to the flat black backgrounds of the cards, as well as changing up the backgrounds of the title bars & duration tabs.
If you’re looking to tackle on any of these, let’s discuss it!
Artwork copyrights all held with their respective artist, except where otherwise noted. All other code is distributed under the Affero General Public License v3.0, and is freely distributable under that license.