DrawShield From the Command Line

From DrawShield Documentation
Revision as of 18:57, 22 October 2023 by Karlw (talk | contribs) (Created page with "= Locally Installed DrawShield = It is possible to run DrawShield by installing it on your system and invoking it from the command line. == Pre-requisites == You will need PHP8.1 or above (8.2 may generate deprecation warnings). You will need PHP extensions for libxml and possibly some others, you should get warning messages about what is needed. The basic program will produce SVG files. For conversion to other formats I suggest installing ImageMagick and using its '...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Locally Installed DrawShield

It is possible to run DrawShield by installing it on your system and invoking it from the command line.

Pre-requisites

You will need PHP8.1 or above (8.2 may generate deprecation warnings). You will need PHP extensions for libxml and possibly some others, you should get warning messages about what is needed.

The basic program will produce SVG files. For conversion to other formats I suggest installing ImageMagick and using its 'convert' program.

DrawShield from the command line

Basic Use

At it simplest, running DrawShield from the command line will just concatenate all of the arguments into a single string, separated by spaces and this will be treated as the blazon. A file named shield.png will be created which will be 500 pixels wide, using the DrawShield colour scheme, the heater shield shape and the shiny effect.

The program should be run from the top level directory containing the drawshield code. An example command line would be:

php drawshield.php azure a bend or

Advanced use

Debugging

If there are no arguments at all the program will instead look for a file in the same folder named ‘debug.inc’. If this exists it will be “included” and hence should consist of PHP code. Most usefully this code should set the various values of the $options array, for example:

$options[“blazon”] = ”azure a bend or“;

You can also set other options as required. This is the suggested method for using a PHP debugger.