Summary of MVG Primitives and Syntax
====================================

MVG ignores all white-space between commands. This allows
multiple MVG commands per line. It is common convention to
terminate each MVG command with a new line to make MVG easier
to edit and read. This syntax description uses indentation in
MVG sequences to aid with understanding. Indentation is
supported but is not required.

Metafile wrapper syntax (to support stand-alone MVG files)
----------------------------------------------------------

  push graphic-context
   viewbox 0 0 width height
    [ any other MVG commands ]
  pop graphic-context


Pattern syntax (saving and restoring context)
---------------------------------------------

  push pattern id x,y width,height
   push graphic-context
    [ drawing commands ]
   pop graphic-context
  pop pattern

an example is (%s is a identifier string)

  push defs
   push pattern %s 10,10 20,20
    push graphic-context
     fill red
     rectangle 5,5 15,15
    pop graphic-context
    push graphic-context
     fill green
     rectangle 10,10 20,20
    pop graphic-context
   pop pattern
  pop defs

For image tiling use

  push pattern id x,y width,height
   image Copy ...
  pop pattern

Note you can use the pattern for either the fill or stroke like

  stroke url(#%s)

    or

  fill url(#%s)

Clip-path syntax
----------------

 The clip path defines a clipping area, where only the contained
 area will be drawn upon.  Areas outside of the clipping area are
 masked.

  push defs
   push clip-path %s
    push graphic-context
     rectangle 10,10 20,20
    pop graphic-context
   pop clip-path
  pop defs
  clip-path url(#%s)

use syntax
----------

The "use" command (based on SVG's "use")implements a macro capability,
in which the referenced object and its contents are deep-cloned into
the generated tree.

 use url

Using 'image' primitive with inlined image
------------------------------------------

The 'filename' argument of the 'image' primitive may be a
base64-encoded version of the encoded image prefixed with a MIME-type
declaration similar to the following:

  image Copy 0,0 1024,106.09 'data:image/x-dib;base64,
  KAAAANACAAAuAAAAAQAYAAAAAAAghAEAjQEAAI0BAAAAAAAAAAAAAGOb9FaP5k6L3FGQ3Fea42ap
  ...
  hy9cii9ciixaiCpYhiVYhSZZhiRbiCdeiyVciSRbiCZbiChdii1gjSxfjCpaiCZWhA=='

Individual Drawing Primitives
=============================

affine sx,rx,ry,sy,tx,ty
arc x0,y0 x1,y1 a0,a1
bezier x0,y0  ...  xn,yn
circle originX,originY perimX,perimY
class %s (class is a string value)
clip-path url(#%s)  (%s is the name of the clip path)
clip-rule (evenodd|nonzero)
clip-units (userSpace|userSpaceOnUse|objectBoundingBox)
color x,y (point|replace|floodfill|filltoborder|reset)
decorate (none|underline|overline|line-through)
ellipse centerX,centerY radiusX,radiusY arcStart,arcEnd
encoding %s (%s is document encoding string)
fill colorspec
fill-opacity opacity[%]
fill-rule (evenodd|nonzero)
font (fontname|none)
font-family familyname (e.g. "helvetica")
font-size pointsize
font-stretch (all|normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded)
font-style (all|normal|italic|oblique)
font-weight (all|normal|bold|100|200|300|400|500|600|700|800|900)
gradient-units (userSpace|userSpaceOnUse|objectBoundingBox)
gravity (Forget|NorthWest|North|NorthEast|West|Center|East|SouthWest|
         South|SouthEast|Static)
image (Add|Atop|Bumpmap|Clear|CopyBlue|CopyGreen|CopyOpacity|CopyRed|
       Copy|Difference|In|Minus|Multiply|Out|Over|Plus|Subtract|Xor|[many more])
       dest_x,dest_y dest_width,dest_height 'filename'
line startX,startY endX,endY
matte x,y (point|replace|floodfill|filltoborder|reset)
mask %s (%s is a mask value)
offset %g (%g is an offset value)
opacity value[%]
path 'SVG-compatible path arguments'
point x,y
polygon x1,y1, x2,y2, x3,y3, ..., xN,yN
polyline x1,y1, x2,y2, x3,y3, ..., xN,yN
pop clip-path
pop defs
pop gradient
pop graphic-context
pop id
pop mask
pop pattern
push clip-path %s  (%s is the name of the clip path)
push defs
push gradient id linear x1,y1 x2,y2
push gradient id radial cx,cy fx,fy r
push graphic-context
push id %s (%s is the id string)
push mask %s (%s is the mask id)
push pattern id x,y width,height
rectangle upperLeftX,upperLeftY lowerRightX,lowerRightY
rotate angle
roundrectangle upperLeftX,upperLeftY lowerRightX,lowerRightY cornerWidth,cornerHeight
scale x,y
skewX angle
skewY angle
stop-color colorspec offset
stroke colorspec
stroke-antialias truth-value (0 or 1)
stroke-dasharray (none|comma-delimited-numeric-list)
stroke-dashoffset dashoffset
stroke-linecap (butt|round|square)
stroke-linejoin (bevel|miter|round)
stroke-miterlimit limit
stroke-opacity opacity[%]
stroke-width linewidth
svg-compliant 1
textc %s (%s is some text)
textdx %g (%s is an 'em' or 'ex' float value)
textdx %s (%s is a text value)
textdy %g (%s is an 'em' or 'ex' float value)
textdy %s (%s is a text value)
textr %g (%g is rotation angle)
textx X
texty Y
text x,y "some text"
text-align %s (%s is text align argument)
text-anchor (start|middle|end)
text-antialias (0|1)
text-undercolor colorspec
translate x,y
viewbox x1 y1 x2 y2 (e.g. "viewbox 0 0 640 480")
