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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<!--meta http-equiv="Content-Script-Type" content="text/javascript"-->
<TITLE>SVG Examples: Circuit_macros Version XXX</TITLE>
<style type="text/css">
.svg{display:none}
*>.svg{display:inline}
</style>
<link rel="shortcut icon" href="../Circuit_macros.ico" type="image/x-icon" />
</HEAD>
<BODY>
<H2>SVG Circuit_macros examples, Version XXX</H2>
<hr>
<p>
These diagrams are in .svg format.
<A HREF="examples.pdf">Pdf</A>
and
<A HREF="examples.html">png</A>
versions are also available.
The PDF equivalent can be found in examples.pdf of the distribution.
</p>
<p>
Click on the link to view the source of each diagram.
</p>
<hr>
define(`cfig',`
<p>
<!--[if lte IE 8]><embed src="$1.svg" sinclude($1.siz)><![endif]-->
<!--[if gte IE 9]>
<object dx="4" data="$1.svg" sinclude($1.siz) type="image/svg+xml" class="img">
</object> <![endif]-->
<!--[if !IE]><!-->
<object data="$1.svg" sinclude($1.siz) type="image/svg+xml" class="img">
</object> <!--<![endif]-->
<br>
<a href="$1.txt" TYPE="text/plain" TARGET="_blank" alt="$1">$1.m4</a>
</p>
<hr>')
define(`m4tt',`<g style="font-family:monospace">')
<!--
<embed pluginspage="http://www.adobe.com/svg/viewer/install/" />
-->
<p>
These diagrams have been adapted from the Circuit_macros examples in
order to test the <em>experimental</em> svg output of dpic.
Generating the line art is relatively straightforward, but
the labeling is not created by a text processor and therefore must be
more basic. Some of these diagrams might benefit from a little more
tweaking of fonts and labels.
</p>
<p>
These examples conform to the latest dpic, which has changed the
treatment of text sizing. That is, "Text" ht y sets the true height
of SVG text to y rather than the nominal height as previously.
</p>
<p>
There are a number of other issues:
<ul>
<li> Embedding .svg files in html documents with the <embed> or
<object> tag seems to be a perennial issue.
<li> This file has been tested mainly by using Firefox.
Chrome also seems to work well with two issues detected to date:
a difference handling color fills and text links in svg.
<li> The Adobe reader apparently requires a line of the form
<br> <embed src="figure.svg" width="x" height="y" type="image/svg+xml"
/>
This means that the html file has to contain dimension
information for each figure, whereas Firefox can
determine the figure size
from the <svg ... object. Currently, dpic includes a comment line
giving reasonable dimensions in pixels but this has to be insterted into
the <embed or <object line. A makefile does it easily but
otherwise this could be tedious.
<li> The default font face is not specified in all of these diagrams but is
inherited from the enclosing document, so the appearance of labels can
differ depend on the browser. Some of these diagrams set the font at
the beginning of the diagram source.
<li> The <svg tag may require modification
from the default used for this test. Dpic might be modified to
allow the generation of custom headers but that has not yet been done.
<li> Diagrams such as these contain text labels
that have to be treated differently from the LaTeX-compatible versions.
Apparently there is no direct way to know the bounding box of arbitrary svg
text.
<!-- text, as discussed
<a href="http://www.aditus.nu/jpgraph/jpg_svg.php" TARGET="_blank">here,</a>
for example. -->
Consequently, text placement is approximate and may require
manual adjustment.
Rather than patch the original source files for svg production, edited copies
have been used. The configuration file svg.m4 read by m4
prior to libcct.m4 contains the following macros defined for svg.
Others should be defined to exercise some of the media capabilties of svg.
They are subject to change:
<ul>
<li>
m4tt`'svg_font(</g>font-face,height,textoffset,dpic commands`'m4tt)</g>:
Change font face, size, and dpic textoffset parameter.
If arg4 is blank, the font is changed and
requires m4tt`'command "</g>"</g> to cancel the font change.
Examples: <br>
m4tt`'svg_font(Times)</g><br>
m4tt`'svg_font(Times,11bp__,1bp__,"text" at A)</g><br>
m4tt`'svg_font(font-family="Times")</g><br>
m4tt`'svg_font(font-family="Times" font-style="italic")</g><br>
m4tt`'svg_font(style="font-family:Times; font-style:italic")</g>
<li>m4tt svg_tspan(</g>text attributes, text`'m4tt)</g>;
e.g. m4tt`'svg_tspan(font-style="italic" font-size="75%",XYZ)</g>
<li>m4tt svg_it(</g>text`'m4tt)</g>: for italics
<li>m4tt svg_tt(</g>text`'m4tt)</g>: for monospace (courier)
<li>m4tt svg_norm(</g>text`'m4tt)</g>: for normal text
<li>m4tt svg_bf(</g>text`'m4tt)</g>: for bold face
<li>m4tt svg_small(</g>text, percent`'m4tt)</g>:
to set a smaller text size, default 66
<li>m4tt svg_fsize(</g>text, percent`'m4tt)</g>:
for setting larger or smaller text size, default 100
<li>m4tt svg_sub(</g>text, size percent, y displ, x displ`'m4tt)</g>:
subscript
<li>m4tt svg_sup(</g>text, size percent, y displ, x displ`'m4tt)</g>:
superscript
<li>m4tt svg_symbol(</g>text`'m4tt)</g>: allow quoted pound sign in text,
e.g., m4tt`'svg_symbol(10&`#'176;)</g> produces 10°
<li>m4tt svgLink(</g>URL, drawing object, m4tt[B])</g>:
link to external file using
<a xlink:href=...>...</a> (default is
m4tt`'target="_blank"</g> unless
arg 3 = B)
<li>m4tt svgLinkString</g> as above but for strings attached to objects
<li> Greek and other symbols:
<table cellpadding="0" cellspacing="0" width="100%" >
<tr>
<td width="7%"> m4tt svg_alpha</g>
<td align="left"> changecom(,)&`#'945;changecom(`#')
<td width="7%"> m4tt svg_beta</g>
<td align="left"> changecom(,)&`#'946;changecom(`#')
<td width="7%"> m4tt svg_chi</g>
<td align="left"> changecom(,)&`#'967;changecom(`#')
<td width="7%"> m4tt svg_comma</g>
<td align="left"> changecom(,)&`#'44;changecom(`#')
<td width="7%"> m4tt svg_Delta</g>
<td align="left"> changecom(,)&`#'916;changecom(`#')
<td width="7%"> m4tt svg_delta</g>
<td align="left"> changecom(,)&`#'948;changecom(`#')
<td width="7%"> m4tt svg_epsilon</g>
<td align="left"> changecom(,)&`#'949;changecom(`#')
<td width="7%"> m4tt svg_eta</g>
<td align="left"> changecom(,)&`#'951;changecom(`#')
<tr>
<td width="7%"> m4tt svg_Gamma</g>
<td align="left"> changecom(,)&`#'915;changecom(`#')
<td width="7%"> m4tt svg_gamma</g>
<td align="left"> changecom(,)&`#'947;changecom(`#')
<td width="7%"> m4tt svg_iota</g>
<td align="left"> changecom(,)&`#'953;changecom(`#')
<td width="7%"> m4tt svg_kappa</g>
<td align="left"> changecom(,)&`#'954;changecom(`#')
<td width="7%"> m4tt svg_Lambda</g>
<td align="left"> changecom(,)&`#'923;changecom(`#')
<td width="7%"> m4tt svg_lambda</g>
<td align="left"> changecom(,)&`#'955;changecom(`#')
<td width="7%"> m4tt svg_micro</g>
<td align="left"> changecom(,)&`#'956;changecom(`#')
<td width="7%"> m4tt svg_mu</g>
<td align="left"> changecom(,)&`#'956;changecom(`#')
<tr>
<td width="7%"> m4tt svg_nu</g>
<td align="left"> changecom(,)&`#'957;changecom(`#')
<td width="7%"> m4tt svg_ohm</g>
<td align="left"> changecom(,)&`#'937;changecom(`#')
<td width="7%"> m4tt svg_Omega</g>
<td align="left"> changecom(,)&`#'937;changecom(`#')
<td width="7%"> m4tt svg_omega</g>
<td align="left"> changecom(,)&`#'969;changecom(`#')
<td width="7%"> m4tt svg_Phi</g>
<td align="left"> changecom(,)&`#'934;changecom(`#')
<td width="7%"> m4tt svg_phi</g>
<td align="left"> changecom(,)&`#'966;changecom(`#')
<td width="7%"> m4tt svg_Pi</g>
<td align="left"> changecom(,)&`#'928;changecom(`#')
<td width="7%"> m4tt svg_pi</g>
<td align="left"> changecom(,)&`#'960;changecom(`#')
<tr>
<td width="7%"> m4tt svg_Psi</g>
<td align="left"> changecom(,)&`#'936;changecom(`#')
<td width="7%"> m4tt svg_psi</g>
<td align="left"> changecom(,)&`#'968;changecom(`#')
<td width="7%"> m4tt svg_rho</g>
<td align="left"> changecom(,)&`#'961;changecom(`#')
<td width="7%"> m4tt svg_Sigma</g>
<td align="left"> changecom(,)&`#'931;changecom(`#')
<td width="7%"> m4tt svg_sigma</g>
<td align="left"> changecom(,)&`#'963;changecom(`#')
<td width="7%"> m4tt svg_tau</g>
<td align="left"> changecom(,)&`#'964;changecom(`#')
<td width="7%"> m4tt svg_Theta</g>
<td align="left"> changecom(,)&`#'920;changecom(`#')
<td width="7%"> m4tt svg_theta</g>
<td align="left"> changecom(,)&`#'952;changecom(`#')
<tr>
<td width="7%"> m4tt svg_upsilon</g>
<td align="left"> changecom(,)&`#'965;changecom(`#')
<td width="7%"> m4tt svg_Xi</g>
<td align="left"> changecom(,)&`#'926;changecom(`#')
<td width="7%"> m4tt svg_xi</g>
<td align="left"> changecom(,)&`#'958;changecom(`#')
<td width="7%"> m4tt svg_zeta</g>
<td align="left"> changecom(,)&`#'950;changecom(`#')
<td width="7%"> m4tt svg_lt</g>
<td align="left"> changecom(,)&`#'60;changecom(`#')
<td width="7%"> m4tt svg_gt</g>
<td align="left"> changecom(,)&`#'62;changecom(`#')
<td width="7%"> m4tt svg_leq</g>
<td align="left"> changecom(,)&`#'8804;changecom(`#')
<td width="7%"> m4tt svg_geq</g>
<td align="left"> changecom(,)&`#'8805;changecom(`#')
<tr>
<td width="7%"> m4tt svg_prime</g>
<td align="left"> changecom(,)&`#'8242;changecom(`#')
<td width="7%"> m4tt svg_ensp</g>
<td align="left"> |changecom(,)&`#'8194;changecom(`#')|
<td width="7%"> m4tt svg_emsp</g>
<td align="left"> |changecom(,)&`#'8195;changecom(`#')|
<td width="7%"> m4tt svg_thinsp</g>
<td align="left"> |changecom(,)&`#'8201;changecom(`#')|
<td width="7%"> m4tt svg_backsl</g>
<td align="left"> changecom(,)&`#'92;changecom(`#')
</table>
</ul>
<li> Inkscape: It may be efficient to define elements by macro and to
place them using a WYSIWYG graphics editor. A draft page intended
for Inkscape is included. A reasonable variety of elements is defined
but many more could be added and they should be customized for
particular applications.
<li> Link experiments: Click on the resistor or source of quickSVG
to go to external
files in new windows. Click on "n-port" in NportSVG to replace the diagram
and then "back" to return.
<li> Some of the assumptions used to create this draft may be naive. Comments
are welcome.
</ul>
<hr>
cfig(quickSVG)
cfig(CctTableSVG)
cfig(DiodesSVG)
cfig(EmarrowsSVG)
cfig(SourcesSVG)
cfig(VariableSVG)
cfig(AmpTableSVG)
cfig(FusesSVG)
cfig(SwitchesSVG)
cfig(GroundsSVG)
cfig(AntennasSVG)
cfig(AudioSVG)
cfig(OpampSVG)
cfig(XformSVG)
cfig(NPDTSVG)
cfig(ContactSVG)
cfig(ContactsSVG)
cfig(relaycoilSVG)
cfig(RelaySVG)
cfig(JackSVG)
cfig(ConnSVG)
cfig(PconnSVG)
cfig(HeadersSVG)
cfig(fetSVG)
cfig(ujtSVG)
cfig(thyristorSVG)
cfig(BipSVG)
cfig(TgateSVG)
cfig(NportSVG)
cfig(NLGSVG)
cfig(WindingsSVG)
cfig(ex01.m4)
cfig(TimerSVG)
cfig(OptoisoSVG)
cfig(MixerSVG)
cfig(PushPullSVG)
cfig(QuantumSVG)
cfig(SQUIDSVG)
cfig(SixpoleSVG)
cfig(ex18SVG)
cfig(MCSVG)
cfig(ex10SVG)
cfig(ThreeSVG)
cfig(ex17SVG)
cfig(ex02SVG)
cfig(ex12SVG)
cfig(pwrsupplySVG)
cfig(TTLnandSVG)
cfig(I2LSVG)
cfig(SchottkySVG)
cfig(ex11SVG)
cfig(ex04SVG)
cfig(CsourceSVG)
cfig(DriveSVG)
cfig(ex16SVG)
cfig(ex03SVG)
cfig(MotorControlSVG)
cfig(RectifiersSVG)
cfig(HeathkitSVG)
cfig(lcctSVG)
cfig(TubediagsSVG)
cfig(sfgSVG)
cfig(LogicSVG)
cfig(ex08SVG)
cfig(DecoderSVG)
cfig(ex21SVG)
cfig(MultiplexerSVG)
cfig(DemultiplexerSVG)
cfig(ShiftRSVG)
cfig(AdderSVG)
cfig(CanLogicSVG)
cfig(AlogixSVG)
cfig(ABlogixSVG)
cfig(XORSVG)
cfig(ex00SVG)
cfig(controlSVG)
cfig(GrayCodeSVG)
cfig(CrossbarSVG)
cfig(ByteSVG)
cfig(RotboxSVG)
cfig(ex06SVG)
cfig(ex09SVG)
cfig(ex05SVG)
cfig(LoglogSVG)
cfig(randomSVG)
cfig(expSVG)
cfig(graysurfSVG)
cfig(shapesSVG)
cfig(AntiqueClockSVG)
cfig(cscSVG)
cfig(roseSVG)
cfig(diamondSVG)
cfig(wormSVG)
cfig(ButtonsSVG)
cfig(DiniSVG)
cfig(SierpinskiSVG)
cfig(recycleSVG)
cfig(ex15SVG)
cfig(CountingSVG)
cfig(CrowSVG)
cfig(FlowSVG)
cfig(BtreeSVG)
cfig(TtreeSVG)
cfig(InclepsSVG)
cfig(FontsSVG)
</BODY>
</HTML>
|