Skip to content
Karl Wilcox edited this page Apr 25, 2020 · 5 revisions

Welcome to DrawShield!

Welcome to DrawShield and the world of Heraldry. The purpose of this Wiki is to contain longer form explanations of the code that makes up DrawShield and some of the ideas behind it.

Before looking in detail at DrawShield it helps to have at lease a little understanding of Blazonry, the language of Heraldry.

There are lots of books on heraldry, both in print and on-line, or if you are just interested in learning the blazonry language that is implemented by DrawShield then there is a (currently incomplete) tutorial here.

Operation Overview

The main phases of operation are as follows:

  • Setting global options (in version.inc) and argument processing (in drawshield.php)

  • Lexical analysis - breaking the input into tokens (parser/tokeniser.inc)

  • Parsing - recognising the blazon and putting into an XML parse tree (parser/*)

  • Analysis() - applying specialist knowledge to modify the parse tree (analyser/)

  • Rendering - creating the SVG image from the parse tree (svg/*)

  • Converting (optional) - reformat the SVG as jpg or png (drawshield.php)