Attribute/Parameter System

Attributes or global parameters are accessible by all rules. Even if an attribute only used by one rule, all instances receive the same value; they can also be thought of as flags. An attribute consists of three items:

  1. type – a string which cay be either can be “number, “bool” or of type option. The first are self-explanatory, in case it is an option the syntax is:
    "option" ':' <option_1> { ',' <option_i> }
  2. value – a double precision number which can store a value of any other type. In integer is obtained by casting, boolean is obtained by comparison to zero, and in case of an option the count of the selected option is stored. Initially a default value is stored.
  3. percent flag – if true, the value is relative to some other measure – as if percent.

An example clipping mode parameter, which determines whether an inserted shape is clipped to iregion or not, or discarded (if touches), is:
{ "option:ignore,clip,discard", 0, false }
Whereas path width parameter is:
{ "double", 10, true }