The amazing Toon-o-Matic, take 2


Yes, this is the home page of that astounding drawing software, the amazing Toon-o-matic. Largely vaporware, the Toon-o-Matic takes a description of a cartoon, style information, character descriptions and plans, chops, dices, puts it all into the microwave for five minutes (stirring occasionally) and then -- draws a cartoon.

This is the second run from whole cloth. This is the Toon-o-Matic Take 2, and the cartoon series it produces shall heretofore be known as Toonbots 2.0. The old Toon-o-Matic is here. Development on that ran from October 21, 2000 until April 28, 2001, at which point development stalled due to, well, a lot of things, ranging from my son's illness to my business's failure to my country's insanity. Toonbots staggered along until July of 2005, with a sort of fractal hiatus pattern, but essentially it was going nowhere, and that was largely because my beloved baroque script was already completely unmanageable and thus less fun to work with. Impossible, really, in the time I had at my disposal.

I'm not sure why I've suddenly got the urge to revisit the Toon-o-Matic, but it appears that the Muse is back. I ain't complainin'.

With Take 2, as with the original effort, my objective is not to produce quality software. Instead, my objective is to take as little time from my family as possible and still support a little technical self-development and creative self-expression, in the form of both weird-ass software and weird-ass cartoon humor. To reduce the overall complexity, however, it appears that it will be necessary to produce at least a minimal level of software quality. So even though quality is not my objective, it appears that it is once again raising its ugly head no matter what my opinion may be.

Roughly, the timeline of development of the Toon-o-matic has been:
October 21, 2000Panel layout
October 28, 2000Caption layout
up to Nov 10 or soVarious panel and caption features
November 12, 2000Rudimentary character sizing and placement
December 2000A first stab at variant structures for characters
January 1, 2001The first drawing commands, definition of named points for reference, etc.
April 2001Conversion of the original much more baroque program into a single script which outputs SVG code for ImageMagick to convert all in one fell swoop. You don't want to know how it used to be.
April 28, 2001Rework of text handling to use XML font summaries generated by my new tool ttfx. Captions again!
 
October, 2006Take 2: total rewrite from scratch.

The new structure is a different beast. Each comic will be built using a Makefile, and the tools it uses in its self-construction will be diverse and as small and understandable as possible. This should allow me to express some cartoons as templates to be randomized, to include cartoons in other cartoons, and to generalize the very concept of what a cartoon really is. There's a lot of ground I'd like to cover, but the steps to get there have to be baby steps.

At any rate, the top-level script in play here is "toono2.pl". All this does is to read the original cartoon definition file (by default in cartoon.xml) and set up the build directory, including writing the Makefile and initial setup files. It then invokes make to perform the actual build. The tools used by the build process reside in the Toon-o-Matic home directory, and there will probably also be a module of some description.

Reverse compatibility is not an issue. All previous scripts will probably break. I don't care; I made some weird decisions during that coding which, in retrospect, I didn't much care for. Now I will make other, but at least different, mistakes. And hopefully the new start will result in some fresh insights (that's the way everything else works.)

Whereas the original Toon-o-Matic ran as a single monolithic script, Take 2 will run in itty-bitty pieces. Our original setup is the first step; it takes the original XML cartoon specification and sets up a build directory for the cartoon, then runs "make" in that directory. Simple as pie. The actual work is then done using separate small tools which will be defined in later steps. Let's first document that setup, then we'll go from there.
 
use Workflow::wftk::XML;

$toon = $ARGV[0];
print "$toon\n";

die;
And then we get down and do our stuff. The panel module does panel positioning, and the layout module does the rest of the cartoon (character placement, drawing, etc.) Hmm. A third module I will call the drawing module; that takes the decorated cartoon XML and writes an SVG script for ImageMagick to work from.
 
See The panel module
See The layout module
See Drawing (by writing SVG)

This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2001-2006, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. This presentation prepared using LPML. Try literate programming. You'll like it.