Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<style type="text/css">
2
		<!--
3
		A:link        {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
4
		A:visited     {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
5
		A:hover       {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: underline; color: #FF0000}
6
		th            {font-family: helvetica, arial; color : blue; font-size:85%; background : lightgrey; border-right:black solid 1pt; border-bottom:black solid 1pt;}
7
		//-->
8
		</style><hr><a name="_C_TEXT"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>Text</b></div>
9
<i>(Defined in: jpgraph.php : 2778)</i><table border=1><tr><td>&nbsp;<a href="Text.html" style="font-family:arial;font-weight:bold;color:darkblue;">Text</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="Text.html#_TEXT_ALIGN">Align()</a>&nbsp;<br>
10
&nbsp;<a href="Text.html#_TEXT_CENTER">Center()</a>&nbsp;<br>
11
&nbsp;<a href="Text.html#_TEXT_GETFONTHEIGHT">GetFontHeight()</a>&nbsp;<br>
12
&nbsp;<a href="Text.html#_TEXT_GETTEXTHEIGHT">GetTextHeight()</a>&nbsp;<br>
13
&nbsp;<a href="Text.html#_TEXT_GETWIDTH">GetWidth()</a>&nbsp;<br>
14
&nbsp;<a href="Text.html#_TEXT_HIDE">Hide()</a>&nbsp;<br>
15
&nbsp;<a href="Text.html#_TEXT_PARAGRAPHALIGN">ParagraphAlign()</a>&nbsp;<br>
16
&nbsp;<a href="Text.html#_TEXT_POS">Pos()</a>&nbsp;<br>
17
&nbsp;<a href="Text.html#_TEXT_SET">Set()</a>&nbsp;<br>
18
&nbsp;<a href="Text.html#_TEXT_SETALIGN">SetAlign()</a>&nbsp;<br>
19
&nbsp;<a href="Text.html#_TEXT_SETANGLE">SetAngle()</a>&nbsp;<br>
20
&nbsp;<a href="Text.html#_TEXT_SETBOX">SetBox()</a>&nbsp;<br>
21
&nbsp;<a href="Text.html#_TEXT_SETCOLOR">SetColor()</a>&nbsp;<br>
22
&nbsp;<a href="Text.html#_TEXT_SETCSIMTARGET">SetCSIMTarget()</a>&nbsp;<br>
23
&nbsp;<a href="Text.html#_TEXT_SETFONT">SetFont()</a>&nbsp;<br>
24
&nbsp;<a href="Text.html#_TEXT_SETMARGIN">SetMargin()</a>&nbsp;<br>
25
&nbsp;<a href="Text.html#_TEXT_SETORIENTATION">SetOrientation()</a>&nbsp;<br>
26
&nbsp;<a href="Text.html#_TEXT_SETPARAGRAPHALIGN">SetParagraphAlign()</a>&nbsp;<br>
27
&nbsp;<a href="Text.html#_TEXT_SETPOS">SetPos()</a>&nbsp;<br>
28
&nbsp;<a href="Text.html#_TEXT_SETSCALEPOS">SetScalePos()</a>&nbsp;<br>
29
&nbsp;<a href="Text.html#_TEXT_SETSHADOW">SetShadow()</a>&nbsp;<br>
30
&nbsp;<a href="Text.html#_TEXT_SETWORDWRAP">SetWordWrap()</a>&nbsp;<br>
31
&nbsp;<a href="Text.html#_TEXT_SHOW">Show()</a>&nbsp;<br>
32
&nbsp;<a href="Text.html#_TEXT_TEXT">Text()</a>&nbsp;<br>
33
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>All text that is to be draw onto any graph is handled by this class. You create each text you want printed as an instance of this class.
34
 
35
It is possible to adjust both font, color, alignment and paragraph alignment.
36
 
37
If the text contains multiple lines (separated by "\n") the paragraph alignment determines how each line is formatted (i.e. left,center or right)
38
 <p> &nbsp;
39
<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
40
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_ALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
41
function&nbsp;Align($aHAlign,$aVAlign,$aParagraphAlign)</font>
42
</b></div></a></span>
43
 
44
<span style='font-family:arial;font-size:90%;'><i>Specify alignment for the text in relation to the x,y position for text</i></span><p>
45
 
46
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
47
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
48
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
49
$aHAlign</font>
50
 
51
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Horizontal alignment</td></tr>
52
 
53
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
54
$aVAlign</font>
55
 
56
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
57
"top"</font>
58
</td><td>Vertical alignment</td></tr>
59
 
60
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
61
$aParagraphAlign</font>
62
 
63
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
64
""</font>
65
</td><td>Paragraph alignment</td></tr>
66
</table>
67
 
68
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>This determines how the text's x,y position is to be interpretated.
69
 
70
Valid horizontal alignments are
71
<ul>
72
<li> 'left'
73
<li> 'center'
74
<li> 'right'
75
</ul>
76
 
77
Valid vertical position are
78
<ul>
79
<li> 'top'
80
<li> 'middle' or 'center'
81
<li> 'bottom'
82
</ul>
83
 
84
Valid paragraph alignment
85
<ul>
86
<li> 'left'
87
<li> 'center'
88
<li> 'right'
89
</ul>
90
&nbsp;<br>
91
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_PARAGRAPHALIGN">Text::ParagraphAlign</a>
92
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
93
$text&nbsp;=&nbsp;new&nbsp;Text();
<br /></font>
94
</span><br>
95
<p>
96
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_CENTER"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
97
function&nbsp;Center($aLeft,$aRight,$aYAbsPos)</font>
98
</b></div></a></span>
99
100
 
101
102
 
103
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
104
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
105
$aLeft</font>
106
107
 
108
109
 
110
$aRight</font>
111
112
 
113
114
 
115
$aYAbsPos</font>
116
117
 
118
false</font>
119
</td><td>The common Y-coodinate</td></tr>
120
</table>
121
122
 
123
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_POS">Text::Pos</a>
124
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
125
$txt-&gt;Center(50,150,75);</font>
126
</span><br>
127
<p>
128
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_GETFONTHEIGHT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
129
function&nbsp;GetFontHeight(&amp;$aImg)</font>
130
</b></div></a></span>
131
132
 
133
134
 
135
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
136
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
137
&amp;$aImg</font>
138
139
 
140
</table>
141
142
 
143
144
 
145
&nbsp;<br>
146
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_GETTEXTHEIGHT">Text::GetTextHeight</a> and <a href="Text.html#_TEXT_GETWIDTH">Text::GetWidth</a>
147
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
148
$height&nbsp;=&nbsp;$txt-&gt;GetFontHeight($graph-&gt;img)</font>
149
</span><br>
150
<p>
151
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_GETTEXTHEIGHT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
152
function&nbsp;GetTextHeight(&amp;$aImg)</font>
153
</b></div></a></span>
154
155
 
156
157
 
158
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
159
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
160
&amp;$aImg</font>
161
162
 
163
</table>
164
165
 
166
167
 
168
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_GETFONTHEIGHT">Text::GetFontHeight</a> and <a href="Text.html#_TEXT_GETWIDTH">Text::GetWidth</a>
169
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
170
$height&nbsp;=&nbsp;$txt-&gt;GetTextHeight($graph-&gt;img);
<br /></font>
171
</span><br>
172
<p>
173
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_GETWIDTH"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
174
function&nbsp;GetWidth(&amp;$aImg)</font>
175
</b></div></a></span>
176
177
<span style='font-family:arial;font-size:90%;'><i>Get total width of text</i></span><p>
178
 
179
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
180
 
181
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
182
&amp;$aImg</font>
183
184
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>No description available</td></tr>
185
 
186
187
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Get total width of text&nbsp;<br>
188
 
189
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
190
$width&nbsp;=&nbsp;$txt-&gt;GetWidth($graph-&gt;img);
<br /></font>
191
</span><br>
192
<p>
193
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_HIDE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
194
function&nbsp;Hide($aHide)</font>
195
</b></div></a></span>
196
197
<span style='font-family:arial;font-size:90%;'><i>Hide the text</i></span><p>
198
199
 
200
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
201
 
202
$aHide</font>
203
204
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
205
true</font>
206
 
207
</table>
208
209
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>The opposite of Show()&nbsp;<br>
210
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_SHOW">Text::Show</a>
211
 
212
$txt-&gt;Hide();</font>
213
</span><br>
214
<p>
215
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_PARAGRAPHALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
216
function&nbsp;ParagraphAlign($aAlign)</font>
217
</b></div></a></span>
218
219
<span style='font-family:arial;font-size:90%;'><i>Specifies the alignment for a multi line text</i></span><p>
220
221
 
222
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
223
 
224
$aAlign</font>
225
226
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Alignment for a multiline text</td></tr>
227
</table>
228
 
229
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the paragraph alignment for a multi line text. Each text line is separated by a "\n" character.
230
231
 
232
<ul>
233
 
234
<li> 'center'
235
<li> 'right'
236
</ul>&nbsp;<br>
237
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_ALIGN">Text::Align</a>
238
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
239
$txt-&gt;Set("The&nbsp;first&nbsp;line\nSec&nbsp;line\nThird&nbsp;line");
<br />$txt-&gt;ParagraphAlign('center');
<br />
<br />//&nbsp;Will&nbsp;give&nbsp;the&nbsp;result:
<br />//
<br />//&nbsp;&nbsp;The&nbsp;first&nbsp;line
<br />//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sec&nbsp;line
<br />//&nbsp;&nbsp;&nbsp;&nbsp;Third&nbsp;line
<br /></font>
240
</span><br>
241
<p>
242
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_POS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
243
function&nbsp;Pos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign)</font>
244
</b></div></a></span>
245
246
<span style='font-family:arial;font-size:90%;'><i>Specify the position and alignment for the text object</i></span><p>
247
248
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
249
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
250
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
251
$aXAbsPos</font>
252
253
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
254
0</font>
255
</td><td>X-position absolute position</td></tr>
256
 
257
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
258
 
259
260
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
261
0</font>
262
</td><td>Y-position absolute position</td></tr>
263
 
264
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
265
$aHAlign</font>
266
267
 
268
"left"</font>
269
</td><td>Horizontal alignment</td></tr>
270
 
271
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
272
$aVAlign</font>
273
274
 
275
"top"</font>
276
</td><td>Vertical alignment</td></tr>
277
 
278
279
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set the position text to be displayed. As a convinience the horizontal alignment may also be set in this call.
280
281
 
282
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_ALIGN">Text::Align</a>, <a href="Text.html#_TEXT_SET">Text::Set</a> and <a href="Text.html#_TEXT_PARAGRAPHALIGN">Text::ParagraphAlign</a>
283
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
284
 
285
</span><br>
286
<p>
287
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SET"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
288
function&nbsp;Set($aTxt)</font>
289
 
290
291
 
292
293
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
294
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
295
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
296
$aTxt</font>
297
298
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Text string</td></tr>
299
</table>
300
301
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set text to be displayed&nbsp;<br>
302
 
303
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
304
 
305
</span><br>
306
<p>
307
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
308
function&nbsp;SetAlign($aHAlign,$aVAlign,$aParagraphAlign)</font>
309
 
310
311
<span style='font-family:arial;font-size:90%;'><i>Alias for Align()</i></span><p>
312
 
313
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
314
 
315
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
316
$aHAlign</font>
317
318
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Horizontal anchor point</td></tr>
319
320
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
321
$aVAlign</font>
322
 
323
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
324
 
325
</td><td>Vertical anchor point</td></tr>
326
327
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
328
$aParagraphAlign</font>
329
 
330
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
331
 
332
</td><td>Paragraph alignment</td></tr>
333
</table>
334
 
335
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>See Align&nbsp;<br>
336
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_ALIGN">Text::Align</a><p>
337
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
338
 
339
</b></div></a></span>
340
341
 
342
343
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
344
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
345
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
346
 
347
348
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Angle in degrees</td></tr>
349
</table>
350
351
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify Orientation of text. If TTF fonts are used then the orientation can be a arbitrary angle. If the builtin fonts are used then only horizontal and vertical position can be used, i.e 0 or 90 degrees,&nbsp;<br>
352
 
353
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
354
 
355
</span><br>
356
<p>
357
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETBOX"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
358
function&nbsp;SetBox($aFrameColor,$aBorderColor,$aShadowColor,$aCornerRadius,$aShadowWidth)</font>
359
 
360
361
<span style='font-family:arial;font-size:90%;'><i>Set parameters for poossible frame around text</i></span><p>
362
 
363
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
364
 
365
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
366
$aFrameColor</font>
367
368
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
369
array(255,255,255)</font>
370
</td><td>Color for text background</td></tr>
371
372
 
373
$aBorderColor</font>
374
 
375
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
376
array(0,0,0)</font>
377
</td><td>Color for border around text</td></tr>
378
379
 
380
$aShadowColor</font>
381
382
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
383
 
384
</td><td>Color for shadow</td></tr>
385
386
 
387
$aCornerRadius</font>
388
389
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
390
 
391
</td><td>Corner radius for rectangle</td></tr>
392
393
 
394
$aShadowWidth</font>
395
396
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
397
 
398
</td><td>Drop shadow width</td></tr>
399
</table>
400
 
401
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify parameters for background color, border and possible text drop shadow.
402
<br>
403
If no shadow color is specified then no shadow will appear.
404
 
405
To use the old style of stright corners specify a corner radius of 0.
406
407
 
408
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_SETSHADOW">Text::SetShadow</a>
409
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
410
$txt&nbsp;=&nbsp;new&nbsp;Text("Note:&nbsp;Simple&nbsp;textnote.\nWIth&nbsp;two&nbsp;lines");
<br />$txt-&gt;SetFont(FF_FONT1,FS_BOLD);
<br />$txt-&gt;Pos(0.5,0.97,'center','bottom');
<br />$txt-&gt;SetBox('yellow','black');
<br />$graph-&gt;AddText($txt);
<br />
<br /></font>
411
</span><br>
412
 
413
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETCOLOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
414
function&nbsp;SetColor($aColor)</font>
415
</b></div></a></span>
416
417
<span style='font-family:arial;font-size:90%;'><i>Set text color</i></span><p>
418
 
419
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
420
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
421
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
422
$aColor</font>
423
424
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color</td></tr>
425
</table>
426
427
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify color for text&nbsp;<br>
428
429
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
430
$txt-&gt;SetColor('darkblue');</font>
431
</span><br>
432
<p>
433
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETCSIMTARGET"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
434
 
435
</b></div></a></span>
436
 
437
<span style='font-family:arial;font-size:90%;'><i>Specify CSIM Target for text</i></span><p>
438
439
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
440
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
441
 
442
$aTarget</font>
443
444
 
445
446
 
447
$aAlt</font>
448
449
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
450
null</font>
451
</td><td>Alt-tag text</td></tr>
452
</table>
453
454
 
455
456
 
457
$graph-&gt;title-&gt;SetCSIMTarget('mainpage.html','Go&nbsp;to&nbsp;main&nbsp;page');
<br /></font>
458
</span><br>
459
<p>
460
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETFONT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
461
 
462
</b></div></a></span>
463
 
464
<span style='font-family:arial;font-size:90%;'><i>Specify font</i></span><p>
465
466
 
467
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
468
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
469
$aFamily</font>
470
471
 
472
473
 
474
$aStyle</font>
475
476
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
477
FS_NORMAL</font>
478
</td><td>Font style</td></tr>
479
480
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
481
$aSize</font>
482
 
483
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
484
 
485
</td><td>Font size</td></tr>
486
</table>
487
488
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify font family, size and style. Two major types of font families can be used, builtin bitmnapped fonts or TTF fonts. The builtin fonts have a fixed size which can't be altered.
489
 
490
Valid styles are
491
 
492
<li> FS_NORMAL
493
<li> FS_BOLD
494
 
495
<li> FS_BOLDITALIC
496
</ul>
497
498
 
499
<ul>
500
<li> FF_FONT0, Internal font 1 (small font)
501
 
502
<li> FF_FONT2, Internal font 3, (large size)
503
</ul>
504
505
Note: FF_FONT0 only suppor font style FS_NORMAL
506
 
507
The available TTF are by default
508
 
509
<li> FF_ARIAL
510
<li> FF_TIMES, (Times Roman)
511
<li> FF_COURIER, (Courier new)
512
<li> FF_VERDANA, (Verdana)
513
<li> FF_BOOK, (Bookman)
514
<li> FF_HANDWRT, (Handwriting)
515
<li> FF_COMIC, (Sans Comic)
516
 
517
&nbsp;<br>
518
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Image.html#_IMAGE_STROKETEXT">Image::StrokeText</a>
519
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
520
$txt-&gt;SetFont(FF_ARIAL,&nbsp;FS_BOLD,&nbsp;14);</font>
521
</span><br>
522
<p>
523
 
524
function&nbsp;SetMargin($aMarg)</font>
525
 
526
527
<span style='font-family:arial;font-size:90%;'><i>Set the contect sensiive margin</i></span><p>
528
529
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
530
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
531
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
532
$aMarg</font>
533
534
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Margin in pixels</td></tr>
535
</table>
536
537
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a context sensitive margin for the text. Depending on in which context the text is used the margin will be interpretated accordingly.&nbsp;<br>
538
539
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
540
//&nbsp;Start&nbsp;further&nbsp;away&nbsp;from&nbsp;the&nbsp;top&nbsp;of&nbsp;graph
<br />$graph-&gt;title-&gt;SetMargin(15);</font>
541
</span><br>
542
<p>
543
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETORIENTATION"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
544
function&nbsp;SetOrientation($aDirection)</font>
545
 
546
547
 
548
549
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
550
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
551
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
552
 
553
554
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
555
 
556
</td><td>Orientation of text in degrees</td></tr>
557
 
558
559
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Deprecated. Use SetAngle() instead.
560
Specify Orientation of text. If TTF fonts are used then the orientation can be a arbitrary angle. If the builtin fonts are used then only horizontal and vertical position can be used, i.e 0 or 90 degrees,&nbsp;<br>
561
562
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
563
$txt-&gt;SetOrientation(90);&nbsp;//&nbsp;Vertical&nbsp;text</font>
564
</span><br>
565
<p>
566
 
567
function&nbsp;SetParagraphAlign($aAlign)</font>
568
 
569
570
<span style='font-family:arial;font-size:90%;'><i>Specifies the alignment for a multi line text</i></span><p>
571
572
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
573
 
574
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
575
$aAlign</font>
576
577
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Horizontal alignment</td></tr>
578
 
579
580
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Determines how a multi-line text paragraph will be formatted. Each line in the paragraph will be treated individually. Allowed values are
581
 
582
<li> "center"
583
<li> "left"
584
<li> "right"
585
</ol>
586
587
Note: Paragraph alignment is only applicable to horizontal text, i.e. angle = 0 . For paragraphs at an angle the alignbment will always be "left".
588
&nbsp;<br>
589
 
590
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
591
 
592
</span><br>
593
<p>
594
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETPOS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
595
function&nbsp;SetPos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign)</font>
596
 
597
598
<span style='font-family:arial;font-size:90%;'><i>Alias for Pos()</i></span><p>
599
 
600
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
601
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
602
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
603
$aXAbsPos</font>
604
605
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
606
 
607
</td><td>X position</td></tr>
608
609
 
610
$aYAbsPos</font>
611
612
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
613
0</font>
614
</td><td>Y position</td></tr>
615
616
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
617
$aHAlign</font>
618
619
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
620
"left"</font>
621
 
622
623
 
624
$aVAlign</font>
625
626
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
627
"top"</font>
628
 
629
</table>
630
631
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Alias for Pos()&nbsp;<br>
632
 
633
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
634
$txt-&gt;Pos(100,150,'center');</font>
635
 
636
<p>
637
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETSCALEPOS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
638
function&nbsp;SetScalePos($aX,$aY)</font>
639
 
640
641
<span style='font-family:arial;font-size:90%;'><i>Specify the position of the text using the plot scale positions</i></span><p>
642
 
643
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
644
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
645
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
646
 
647
648
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X-position</td></tr>
649
 
650
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
651
$aY</font>
652
653
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Y-position</td></tr>
654
 
655
656
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the position of the text using the plot scale positions. The Y position is taken to be the Y axis. It is not possible to use Y2 scale to specify the position.&nbsp;<br>
657
658
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
659
$txt&nbsp;=&nbsp;new&nbsp;Text();
<br />$txt-&gt;SetScalePos(27.3,&nbsp;278.9);</font>
660
</span><br>
661
<p>
662
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETSHADOW"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
663
function&nbsp;SetShadow($aShadowColor,$aShadowWidth)</font>
664
 
665
666
 
667
668
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
669
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
670
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
671
 
672
673
 
674
'darkgray'</font>
675
</td><td>Shadow color</td></tr>
676
 
677
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
678
$aShadowWidth</font>
679
 
680
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
681
 
682
</td><td>Shadow width (in pixels)</td></tr>
683
</table>
684
685
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>If the text has been boxed (by  call to SetBox()) then you can easily add a drop shadow by just calling this method.
686
<p>
687
Note: You can also specify the shadow directly in the SetBox() call. This method was added to make Text more like other graph objects which have a SetShadow() method.&nbsp;<br>
688
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_SETBOX">Text::SetBox</a>
689
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
690
 
691
</span><br>
692
 
693
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SETWORDWRAP"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
694
function&nbsp;SetWordWrap($aCol)</font>
695
</b></div></a></span>
696
697
 
698
699
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
700
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
701
 
702
$aCol</font>
703
704
 
705
</table>
706
707
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a maximum line length. This method will insert suitable line breaks to ensure thateach line never exeeds the specified number of characters. The method will not break words.&nbsp;<br>
708
709
 
710
$txt&nbsp;=&nbsp;new&nbsp;Text('A&nbsp;suitable&nbsp;long&nbsp;text&nbsp;which&nbsp;will&nbsp;be&nbsp;broken');
<br />$txt-&gt;SetWordWrap(15);</font>
711
</span><br>
712
<p>
713
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_SHOW"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
714
function&nbsp;Show($aShow)</font>
715
</b></div></a></span>
716
717
<span style='font-family:arial;font-size:90%;'><i>Show or hide the text string</i></span><p>
718
719
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
720
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
721
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
722
$aShow</font>
723
724
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
725
true</font>
726
</td><td>True=Display text</td></tr>
727
 
728
729
 
730
&nbsp;<br>
731
732
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
733
$txt-&gt;Show();
<br /></font>
734
 
735
<p>
736
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TEXT_TEXT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
737
 
738
</b></div></a></span>
739
 
740
<span style='font-family:arial;font-size:90%;'><i>Constructor. Create new text at absolute pixel coordinates</i></span><p>
741
742
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
743
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
744
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
745
$aTxt</font>
746
747
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
748
 
749
</td><td>Text string</td></tr>
750
 
751
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
752
$aXAbsPos</font>
753
754
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
755
 
756
</td><td>X-coordinate</td></tr>
757
758
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
759
$aYAbsPos</font>
760
 
761
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
762
0</font>
763
 
764
</table>
765
766
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Create a new object to repesent a text string that is to be displayed on the graph.
767
768
If the position is not specified when the object is created it can later be specified with a call to the Pos() method.
769
770
The default alignment is to interpret the x,y coordinate as being the lower left corner of the bounding box for the text string.
771
772
 
773
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Text.html#_TEXT_POS">Text::Pos</a>, <a href="Text.html#_TEXT_SET">Text::Set</a>, <a href="Text.html#_TEXT_PARAGRAPHALIGN">Text::ParagraphAlign</a> and <a href="Text.html#_TEXT_SHOW">Text::Show</a>
774
 
775
//&nbsp;Possible&nbsp;creations&nbsp;of&nbsp;text&nbsp;objects
<br />
<br />//&nbsp;Case&nbsp;1.&nbsp;Text&nbsp;and&nbsp;position&nbsp;is&nbsp;specified&nbsp;later
<br />$txt&nbsp;=&nbsp;new&nbsp;Text();
<br />
<br />//&nbsp;Case&nbsp;2.&nbsp;Position&nbsp;is&nbsp;specified&nbsp;later
<br />$txt&nbsp;=&nbsp;new&nbsp;Text('Hello&nbsp;world');
<br />
<br />//&nbsp;Case&nbsp;3.&nbsp;Full&nbsp;specification
<br />$txt&nbsp;=&nbsp;new&nbsp;Text('Hello&nbsp;world',100,150);
<br />
<br />//&nbsp;A&nbsp;more&nbsp;real&nbsp;life&nbsp;example
<br />$txt&nbsp;=&nbsp;new&nbsp;Text("Note:&nbsp;Simple&nbsp;textnote.\nWIth&nbsp;two&nbsp;lines");
<br />$txt-&gt;SetFont(FF_FONT1,FS_BOLD);
<br />$txt-&gt;Pos(0.5,0.97,'center','bottom');
<br />$txt-&gt;SetBox('yellow','black');
<br />$graph-&gt;AddText($txt);
<br />
<br />
<br />
<br /></font>
776
</span><br>
777
<p> <hr> <p>