Page 1 of 1

MTG.Design Vector-Based Rendering Engine

PostPosted: 24 Feb 2022, 06:53
by proud
MTG.Design Vector-Based Rendering Engine

Hi everyone!

A brief bit of history.

I started MTG.Design back in 2014. (“ancestral” is my other handle.) I was looking for a 300 dpi source, and was happy to see ahkren had been working on HQ Cardgen, and had everything I needed. (I owe you a debt of gratitude! I would love to send you something — get in touch with me.) But within a year or two, ahkren became busy, and HQ Cardgen no longer had a maintainer. I was a de facto steward, but wasn’t familiar with the rendering portion, as I had developed my own text renderer.

Fast forward a few more years. Other options have become available, but I tired of pushing pixels and fussing over destructive and tedious image editing. I ended up deciding a fully vector-drawn approach (with exception to background textures) was going to be the very best option. When I didn’t find the right artist to take this on, I self-taught myself SVG, acquainted myself with Affinity Designer and Inkscape, and here we are today.

The next-gen MTG.Design renderer.

Attached are some samples.

https://github.com/MTG-Design/resources

Resources are split into individual components, the recipes how how to build the cards, and the PHP and LaTeX rendering files. Components include items such as accents, backgrounds, boxes, borders, and shadows. Recipes indicate which components to use, what effects to apply, and where to place them on a card. Rendering files composite the graphics with LaTeX text.

Currently, the components and recipes are included.

Some rendering support has been enabled, but it is unfinished.

Requirements

  • PHP 8.1 or newer
  • XeLaTeX, with several packages installed
  • Inkscape, in order to save SVGs to a differnet format (like PNG or PDF)
How to use

build.php builds the .ini recipe files into SVG or PNG images. (To export to PNG, inkscape is recommended for proper SVG export. (Not all graphics applications fully implement the SVG 1.1 specification.)

When cards are built, they will save to /cards by default.

render.php renders the text using XeLaTeX. You must install it on your system if you want to render text on cards.

Code: Select all
usage: render.php <format> <path>

Formats:
  -l   LackeyBot JSON format
  -m   MTGJSON JSON format
  -n   Start rendering at card number
  -s   Scryfall JSON format
When cards are rendered, they will save to /output by default.

(Fonts are not in this repository; it is up to the user to source their font files. I’ll add support for substitute fonts.)

The following LaTeX packages are required:

Code: Select all
  textpos
  calc
  xcolor
  fontspec
  lmodern
  hyphenat
  enumitem
  graphicx
  setspace
/frames includes the .ini recipes for how to draw the card, and where. /typesetting includes the text .ini recipes for how to set the type, and where to place it.

You can add new types of cards by creating a new recipe file. (Guidance and help on how to write recipe files will be added in the future.)

Contribute

MTG.Design is being actively worked on, with frames being uploaded only when they are considered ready. If you have components or recipes to add, please file a pull request and they will be reviewed.

You can donate to MTG.Design using Patreon.

About

MTG.Design was created using the MIT license by ancestral of Spellshapers, LLC.

Images in /background, /title, /typeline and /stamp may contain trademarks and be copyright of Wizards of the Coast, LLC, a subsidiary of Hasbro, Inc.

MTG.Design is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC.

Re: MTG.Design Vector-Based Rendering Engine

PostPosted: 03 Jul 2022, 01:33
by Huggybaby
How did I miss this post?

Thanks proud!