if (args.size() % 2 == 1 || args.contains("--help") || args.contains("-h")) {
usage();
return;
}
PApplet processing = new PApplet();
processing.init();
processing.start();
try {
WordCram wordCram = new WordCram(processing)
.fromTextString(PApplet.loadStrings(System.in))
.withColorer(Colorers.twoHuesRandomSats(processing))
.withAngler(Anglers.mostlyHoriz())
.withWordPadding(4)
.withPlacer(Placers.centerClump());
ImageConfiguration imageConfig = parseArgs(args, wordCram);
PGraphics image = processing.createGraphics(imageConfig.width, imageConfig.height, JAVA2D);
try {
wordCram.withCustomCanvas(image);
image.beginDraw();
wordCram.drawAll();
image.endDraw();
image.save(imageConfig.fileName);
} finally {
image.dispose();
}
processing.stop();
System.exit(0);
} catch (Throwable t) {
System.err.println(t.getMessage());
System.exit(1);