blob: 31248fccfa578deaaee5c61dfcd4ebe4ab51084c [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001Summary of MVG Primitives and Syntax
2====================================
3
4MVG ignores all white-space between commands. This allows
5multiple MVG commands per line. It is common convention to
6terminate each MVG command with a new line to make MVG easier
7to edit and read. This syntax description uses indentation in
8MVG sequences to aid with understanding. Indentation is
9supported but is not required.
10
11Metafile wrapper syntax (to support stand-alone MVG files)
12----------------------------------------------------------
13
14 push graphic-context
15 viewbox 0 0 width height
16 [ any other MVG commands ]
17 pop graphic-context
18
19
20Pattern syntax (saving and restoring context)
21---------------------------------------------
22
23 push pattern id x,y width,height
24 push graphic-context
25 [ drawing commands ]
26 pop graphic-context
27 pop pattern
28
29an example is (%s is a identifier string)
30
31 push defs
32 push pattern %s 10,10 20,20
33 push graphic-context
34 fill red
35 rectangle 5,5 15,15
36 pop graphic-context
37 push graphic-context
38 fill green
39 rectangle 10,10 20,20
40 pop graphic-context
41 pop pattern
42 pop defs
43
44For image tiling use
45
46 push pattern id x,y width,height
47 image Copy ...
48 pop pattern
49
50Note you can use the pattern for either the fill or stroke like
51
52 stroke url(#%s)
53
54 or
55
56 fill url(#%s)
57
58Clip-path syntax
59----------------
60
61 The clip path defines a clipping area, where only the contained
62 area will be drawn upon. Areas outside of the clipping area are
63 masked.
64
65 push defs
66 push clip-path %s
67 push graphic-context
68 rectangle 10,10 20,20
69 pop graphic-context
70 pop clip-path
71 pop defs
72 clip-path url(#%s)
73
74Individual Drawing Primitives
75=============================
76
77affine sx,rx,ry,sy,tx,ty
78arc x0,y0 x1,y1 a0,a1
79bezier x0,y0 ... xn,yn
80circle originX,originY perimX,perimY
81clip-path url(#%s) (%s is the name of the clip path)
82clip-rule (evenodd|nonzero)
83clip-units (userSpace|userSpaceOnUse|objectBoundingBox)
84color x,y (point|replace|floodfill|filltoborder|reset)
85decorate (none|underline|overline|line-through)
86ellipse centerX,centerY radiusX,radiusY arcStart,arcEnd
87fill colorspec
88fill-opacity opacity[%]
89fill-rule (evenodd|nonzero)
90font fontname
91font-family familyname (e.g. "helvetica")
92font-size pointsize
93font-stretch (all|normal|ultra-condensed|extra-condensed|condensed|
94 semi-condensed|semi-expanded|expanded|extra-expanded|
95 ultra-expanded)
96font-style (all|normal|italic|oblique)
97font-weight (all|normal|bold|100|200|300|400|500|600|700|800|900)
98gradient-units (userSpace|userSpaceOnUse|objectBoundingBox)
99gravity (NorthWest|North|NorthEast|West|Center|East|SouthWest|
100 South|SouthEast)
101image (Add|Atop|Bumpmap|Clear|CopyBlue|CopyGreen|CopyOpacity|CopyRed|
102 Copy|Difference|In|Minus|Multiply|Out|Over|Plus|Subtract|Xor)
103 dest_x,dest_y dest_width,dest_height 'filename'
104line startX,startY endX,endY
105matte x,y (point|replace|floodfill|filltoborder|reset)
106offset ???
107opacity value[%]
108path 'SVG-compatible path arguments'
109point x,y
110polygon x1,y1, x2,y2, x3,y3, ..., xN,yN
111polyline x1,y1, x2,y2, x3,y3, ..., xN,yN
112pop clip-path
113pop defs
114pop gradient
115pop graphic-context
116pop pattern
117push clip-path %s (%s is the name of the clip path)
118push defs
119push gradient id linear x1,y1 x2,y2
120push gradient id radial cx,cy fx,fy r
121push graphic-context
122push pattern id x,y width,height
123rectangle upperLeftX,upperLeftY lowerRightX,lowerRightY
124rotate angle
125roundrectangle upperLeftX,upperLeftY lowerRightX,lowerRightY cornerWidth,cornerHeight
126scale x,y
127skewX angle
128skewY angle
129stop-color colorspec offset
130stroke colorspec
131stroke-antialias truth-value (0 or 1)
132stroke-dasharray (none|comma-delimited-numeric-list)
133stroke-dashoffset dashoffset
134stroke-linecap (butt|round|square)
135stroke-linejoin (butt|miter|round|square)
136stroke-miterlimit limit
137stroke-opacity opacity[%]
138stroke-width linewidth
139text x,y "some text"
140text-antialias (0|1)
141text-undercolor colorspec
142translate x,y
143viewbox x1 y1 x1 y2 (e.g. "viewbox 0 0 640 480")
144