1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
<?xml version="1.0"?>
<!DOCTYPE Document SYSTEM "Document.dtd">
<Document>
<Title>Basic SVG Examples</Title>
<Description>
Shows some of the basic svg elements when placed in FO.
</Description>
<Chapter>
<Title>Examples</Title>
<Section>
<Title>Introduction</Title>
<Body>
<p>
These examples show the areas of SVG currently implemented.
</p>
<p>
This is provided so that others can see how to write the svg elements
and the result to expect.
</p>
</Body>
</Section>
<Section>
<Title>Graphic Elements</Title>
<SubSection>
<Title>SVG Examples</Title>
<ExternalDiagram file="ex-diagrams.xml">examples</ExternalDiagram>
<Body>
<p>
The SVG xml data is capable of any type of drawing,
from simple lines and shapes to complex shading, colouring
and transformations.
</p>
<p>
Currently only a small set of the possibilities are implemented.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Basic Shapes</Title>
<Body>
<p>
Lines can be draw, they map directly to PDF data.
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-lines</ExternalDiagram>
The example above shows some lines.
</p>
<p>
The rectangle is a simple shape, which maps directly
to PDF data.
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-rect</ExternalDiagram>
The example above is a simple rectangle, circle and ellipse.
</p>
<p>
The circle and ellipse are drawn by creating four curves
that make up the shape.
</p>
<p>
All shapes can have style applied to them. Style can also
be inherited from a surrounding <svg:g> element.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Curves and Paths</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-paths</ExternalDiagram>
Paths have no effect by themselves unless there
is some style applied. The default styling is set
by the svg area.
</p>
<p>
There are many possible parts to a path. There are simple
moveto, lineto and closepath commands. There are also
a number of curve commands that create Bezier curves etc.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Poly Elements</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-poly</ExternalDiagram>
Polylines and Polygons are multi-point lines
made up of straight lines. A polygon has a close path
at the end. <b>Note</b> how the numbers in the points
property can be over a number of lines to make it
easier to read.
</p>
<p>
The only difference between the polyline and the polygon
is that a polygon has a close path at the end.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Styling</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-style</ExternalDiagram>
Most elements can have style. The style information
is a list of properties separated by a ';'. The
property name and value are separated by a ':'.
Notice how the style of the sub-element overrides that
of all the ones in the heirarchy, the element also inherits
all the other style data.
</p>
</Body>
</SubSection>
<SubSection>
<Title>G Element</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-g</ExternalDiagram>
The G element can contain any other graphic
element, including other G elements. The purpose
of this is to enable style and transform to apply
to a group of graphic elements. The elements have no
other relationship except they are drawn together.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Transform</Title>
<Body>
<p>
The transform of an element can do all the usual
mathematical transforms. These can be represented by
a matrix for use in the pdf. The options include
translate, scale, rotate, shear etc.
</p>
<p>
The transform of an element is accumulative from
its ancestors. That is, if a transform is applied to
a <svg:g> element then any graphic element also
has that transform applied to it. If the child
element has a transform then its transform is also
applied after the transform of the parent.
</p>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-transform</ExternalDiagram>
</p>
</Body>
</SubSection>
<SubSection>
<Title>Text Elements</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-text</ExternalDiagram>
Text can be placed in any position and with style.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Clipping, Masking</Title>
<Body>
<p>
Not yet implemented.
The SVG area is clipped to start with.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Text Paths</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-textpath</ExternalDiagram>
The above example shows the <svg:use> and textPath
elements in action.
</p>
</Body>
</SubSection>
<SubSection>
<Title>Images</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-image</ExternalDiagram>
The above example shows the <svg:image> with position
and sizing elements in action.
</p>
</Body>
</SubSection>
<SubSection>
<Title>SVG Element</Title>
<Body>
<p>
<ExternalDiagram file="ex-diagrams.xml" showcode="true">ex-misc</ExternalDiagram>
Doing some silly stuff with svg elements.
</p>
</Body>
</SubSection>
</Section>
</Chapter>
</Document>
|