File: CastleFonts.TCastleFont.html

package info (click to toggle)
castle-game-engine 5.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 185,428 kB
  • sloc: pascal: 260,781; cpp: 1,363; objc: 713; makefile: 537; xml: 496; sh: 480; php: 4
file content (592 lines) | stat: -rw-r--r-- 42,409 bytes parent folder | download
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Castle Game Engine: CastleFonts: Class TCastleFont</title>
<meta name="generator" content="PasDoc 0.13.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<table class="container"><tr><td class="navigation">
<h2>Castle Game Engine</h2><p><a href="introduction.html" class="navigation">Introduction</a></p><p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
<a name="TCastleFont"></a><h1 class="cio">Class TCastleFont</h1>
<table class="sections wide_list">
<tr>
<td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td>Fields</td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
<a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
<p class="unitlink">
<a  href="CastleFonts.html">CastleFonts</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TCastleFont = class abstract(TObject)</code></p>
<h2 class="description">Description</h2>
<p>
Abstract class for 2D font.</p>
<a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TObject</li>
<li class="thisitem">TCastleFont</li></ul><h2 class="overview">Overview</h2>
<a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <b><a  href="CastleFonts.TCastleFont.html#Create">Create</a></b>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>destructor <b><a  href="CastleFonts.TCastleFont.html#Destroy">Destroy</a></b>; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PrintAndMove">PrintAndMove</a></b>(const s: string); deprecated;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#Print">Print</a></b>(const X, Y: Integer; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string); overload; virtual; abstract;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#Print">Print</a></b>(const Pos: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string); overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#Print">Print</a></b>(const X, Y: Integer; const S: string); overload; deprecated;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#Print">Print</a></b>(const s: string); overload; deprecated;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PrintRect">PrintRect</a></b>(const Rect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const HorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a>; const VerticalAlignment: <a  href="CastleRectangles.html#TVerticalPosition">TVerticalPosition</a>);</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PrintRectMultiline">PrintRectMultiline</a></b>(const Rect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const HorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a>; const VerticalAlignment: <a  href="CastleRectangles.html#TVerticalPosition">TVerticalPosition</a>; const Tags: boolean; const LineSpacing: Integer; const TextHorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#GLContextOpen">GLContextOpen</a></b>; virtual;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#GLContextClose">GLContextClose</a></b>; virtual;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#TextWidth">TextWidth</a></b>(const S: string): Integer; virtual; abstract;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#TextHeight">TextHeight</a></b>(const S: string): Integer; virtual; abstract;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#TextHeightBase">TextHeightBase</a></b>(const S: string): Integer; virtual; abstract;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#TextMove">TextMove</a></b>(const S: string): <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>; virtual; abstract;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#TextSize">TextSize</a></b>(const S: string): <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#RowHeight">RowHeight</a></b>: Integer;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#RowHeightBase">RowHeightBase</a></b>: Integer;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#Descend">Descend</a></b>: Integer;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#BreakLines">BreakLines</a></b>(const unbroken: string; broken: TStrings; MaxLineWidth: integer); overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#BreakLines">BreakLines</a></b>(unbroken, broken: TStrings; MaxLineWidth: integer); overload;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#BreakLines">BreakLines</a></b>(broken: TStrings; MaxLineWidth: Integer; FirstToBreak: integer); overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#MaxTextWidth">MaxTextWidth</a></b>(SList: TStrings; const Tags: boolean = false): Integer;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a></b>(const X0, Y0: Integer; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const Strs: TStrings; const Tags: boolean; const LineSpacing: Integer; const TextHorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a>); overload;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a></b>(const Strs: TStrings; const Tags: boolean; const LineSpacing: Integer; const X0: Integer = 0; const Y0: Integer = 0); overload; deprecated;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a></b>(const Strs: array of string; const Tags: boolean; const LineSpacing: Integer; const X0: Integer = 0; const Y0: Integer = 0); overload; deprecated;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#PrintBrokenString">PrintBrokenString</a></b>(const Rect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const LineSpacing: Integer; const AlignHorizontal: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a>; const AlignVertical: <a  href="CastleRectangles.html#TVerticalPosition">TVerticalPosition</a>): Integer;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#PrintBrokenString">PrintBrokenString</a></b>(X0, Y0: Integer; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const MaxLineWidth: Integer; const PositionsFirst: boolean; const LineSpacing: Integer): Integer;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <b><a  href="CastleFonts.TCastleFont.html#PrintBrokenString">PrintBrokenString</a></b>(const S: string; const MaxLineWidth, X0, Y0: Integer; const PositionsFirst: boolean; const LineSpacing: Integer): Integer; deprecated;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PushProperties">PushProperties</a></b>;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <b><a  href="CastleFonts.TCastleFont.html#PopProperties">PopProperties</a></b>;</code></td>
</tr>
</table>
<a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleFonts.TCastleFont.html#Scale">Scale</a></b>: Single read FScale write SetScale;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleFonts.TCastleFont.html#Size">Size</a></b>: Single read GetSize write SetSize;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleFonts.TCastleFont.html#Outline">Outline</a></b>: Cardinal read FOutline write FOutline;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <b><a  href="CastleFonts.TCastleFont.html#OutlineColor">OutlineColor</a></b>: <a  href="CastleColors.html#TCastleColor">TCastleColor</a> read FOutlineColor write FOutlineColor;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Create"></a><code>constructor <b>Create</b>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Destroy"></a><code>destructor <b>Destroy</b>; override;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintAndMove"></a><code>procedure <b>PrintAndMove</b>(const s: string); deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p><p>
Draw text at the current <a class="normal" href="CastleGLUtils.html#WindowPos">WindowPos</a>, and move the <a class="normal" href="CastleGLUtils.html#WindowPos">WindowPos</a> at the end. This way you can immediately call another <code>PrintAndMove</code> again, to add something at the end.

<p>It is not adviced to use it, as using the global <a class="normal" href="CastleGLUtils.html#WindowPos">WindowPos</a> leads sooner or later to messy in code, that has to deal with global state. If you need to know how to move after printing text, use <a class="normal" href="CastleFonts.TCastleFont.html#TextMove">TextMove</a>.

<p>May require 1 free slot on the attributes stack. May only be called when current matrix is modelview. Doesn't modify any OpenGL state or matrix, except it moves raster position.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Print"></a><code>procedure <b>Print</b>(const X, Y: Integer; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string); overload; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
Draw text at the given position with given color. If the last Color component is not 1, the text is rendered with blending.

<p>Overloaded version without X, Y uses <a class="normal" href="CastleGLUtils.html#WindowPos">WindowPos</a> (but doesn't modify it, in contrast to <a class="normal" href="CastleFonts.TCastleFont.html#PrintAndMove">PrintAndMove</a>). Overloaded version without Color uses <a class="normal" href="CastleGLUtils.html#CurrentColor">CurrentColor</a>, last color set by <a class="normal" href="CastleGLUtils.html#glColorv">glColorv</a>. It is not adviced to use overloaded versions without X, Y or Color &mdash; using global state leads to messy code. You should upgrade your code to use the version that gets X,Y,Color explicitly.

<p>May require 1 free slot on the attributes stack. May only be called when current matrix is modelview. Doesn't modify any OpenGL state or matrix, except it moves raster position.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Print"></a><code>procedure <b>Print</b>(const Pos: <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string); overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Print"></a><code>procedure <b>Print</b>(const X, Y: Integer; const S: string); overload; deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Print"></a><code>procedure <b>Print</b>(const s: string); overload; deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintRect"></a><code>procedure <b>PrintRect</b>(const Rect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const HorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a>; const VerticalAlignment: <a  href="CastleRectangles.html#TVerticalPosition">TVerticalPosition</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Print text, aligning within given rectangle.

<p>Hint: Use <a class="normal" href="CastleRectangles.TRectangle.html#Grow">TRectangle.Grow</a>(-10) or similar to align within a rectangle with padding.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintRectMultiline"></a><code>procedure <b>PrintRectMultiline</b>(const Rect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const HorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a>; const VerticalAlignment: <a  href="CastleRectangles.html#TVerticalPosition">TVerticalPosition</a>; const Tags: boolean; const LineSpacing: Integer; const TextHorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Print text, aligning within given rectangle. Newlines within the text will be automatically honored, the text will be rendered as multiple lines. See <a class="normal" href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a> for description of parameters Tags, LineSpacing, TextHorizontalAlignment.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GLContextOpen"></a><code>procedure <b>GLContextOpen</b>; virtual;</code></td>
</tr>
<tr><td colspan="2">
<p>
The font may require some OpenGL resources for drawing. You can explicitly create them using <code>GLContextOpen</code> (although it is never needed) and explicitly destroy them (although it is needed only in some situations).

<p>You can explicitly create resources using <code>GLContextOpen</code>. It's always optional to call <code>GLContextOpen</code>, resources will be automatically created anyway in the nearest <a class="normal" href="CastleFonts.TCastleFont.html#Print">Print</a> call. Note that only the PrintXxx methods require an OpenGL context, the rest of the methods (like measuring the text sizes) may be used at any time, even before initializing the OpenGL context.

<p>You can also explicitly release the OpenGL resources using <a class="normal" href="CastleFonts.TCastleFont.html#GLContextClose">GLContextClose</a>. This is required if you want to keep the <a class="normal" href="CastleFonts.TCastleFont.html">TCastleFont</a> instance existing even after OpenGL context is closed. It is automatically done at destruction, so you do not have to worry about it if you want to destroy <a class="normal" href="CastleFonts.TCastleFont.html">TCastleFont</a> instance before closing OpenGL context. Calling <a class="normal" href="CastleFonts.TCastleFont.html#GLContextClose">GLContextClose</a> is also automatically taken care of if you use this font as <a class="normal" href="CastleControls.html#UIFont">CastleControls.UIFont</a>, <a class="normal" href="CastleControls.html#UIFontSmall">CastleControls.UIFontSmall</a> or <a class="normal" href="CastleControls.TUIControlFont.html#CustomFont">TUIControlFont.CustomFont</a> or <a class="normal" href="CastleControls.TCastleTheme.html#MessageFont">TCastleTheme.MessageFont</a>.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="GLContextClose"></a><code>procedure <b>GLContextClose</b>; virtual;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TextWidth"></a><code>function <b>TextWidth</b>(const S: string): Integer; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TextHeight"></a><code>function <b>TextHeight</b>(const S: string): Integer; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TextHeightBase"></a><code>function <b>TextHeightBase</b>(const S: string): Integer; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
<p>
The height (above the baseline) of the text. This doesn't take into account height of the text below the baseline (for example letter &quot;y&quot; has the tail below the baseline in most fonts).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TextMove"></a><code>function <b>TextMove</b>(const S: string): <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>; virtual; abstract;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="TextSize"></a><code>function <b>TextSize</b>(const S: string): <a  href="CastleVectors.html#TVector2Integer">TVector2Integer</a>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RowHeight"></a><code>function <b>RowHeight</b>: Integer;</code></td>
</tr>
<tr><td colspan="2">
<p>
Height of a row of text in this font. This may be calculated as simply <code><a class="normal" href="CastleFonts.TCastleFont.html#TextHeight">TextHeight</a>('Wy')</code> for most normal fonts.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="RowHeightBase"></a><code>function <b>RowHeightBase</b>: Integer;</code></td>
</tr>
<tr><td colspan="2">
<p>
Height (above the baseline) of a row of text in this font. Similar to <a class="normal" href="CastleFonts.TCastleFont.html#TextHeightBase">TextHeightBase</a> and <a class="normal" href="CastleFonts.TCastleFont.html#TextHeight">TextHeight</a>, note that <code>RowHeightBase</code> is generally smaller than <a class="normal" href="CastleFonts.TCastleFont.html#RowHeight">RowHeight</a>, because <code>RowHeightBase</code> doesn't care how low the letter may go below the baseline.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Descend"></a><code>function <b>Descend</b>: Integer;</code></td>
</tr>
<tr><td colspan="2">
<p>
How low the text may go below the baseline.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BreakLines"></a><code>procedure <b>BreakLines</b>(const unbroken: string; broken: TStrings; MaxLineWidth: integer); overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Break lines (possibly break one long string into more strings) to fit the text with given MaxLineWidth.

<p>This takes into account current font information (works also for non-monospace fonts, of course), and converts your Unbroken text into Broken text, such that <a class="normal" href="CastleFonts.TCastleFont.html#TextWidth">TextWidth</a> of the longest Broken line fits within MaxLineWidth.

<p>Tries to break on <a class="normal" href="CastleColors.html#White">white</a> characters. If not possible (there's a long stream of non-<a class="normal" href="CastleColors.html#White">white</a> characters that really has to be broken), it will break in the middle of normal (non-<a class="normal" href="CastleColors.html#White">white</a>) characters. The only situation when we have to fail, and the resulting Broken text is wider than required MaxLineWidth, is when <i>a single character in your font</i> is wider than MaxLineWidth. In such case, there's really no solution, and we'll just let such character stay.

<p>If you use the overloaded version where Unbroken is just a string, then note that already existing newlines (<a class="normal" href="CastleUtils.html#NL">NL</a>) inside Unbroken will be correctly preserved.

<p>If you use the overloaded version with separate Unbroken and Broken parameters, then the previous Broken contents are not modified. We only append to Broken new strings, coming from Unbroken text. The overloaded version that takes only Broken parameter (no Unbroken parameter) simply modifies it's Broken parameter (from the line FirstToBreak).

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BreakLines"></a><code>procedure <b>BreakLines</b>(unbroken, broken: TStrings; MaxLineWidth: integer); overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="BreakLines"></a><code>procedure <b>BreakLines</b>(broken: TStrings; MaxLineWidth: Integer; FirstToBreak: integer); overload;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="MaxTextWidth"></a><code>function <b>MaxTextWidth</b>(SList: TStrings; const Tags: boolean = false): Integer;</code></td>
</tr>
<tr><td colspan="2">
<p>
Largest width of the line of text in given list.

<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>Tags</dt>
<dd>Indicates that strings inside SList use HTML-like tags, the same as interpreted by <a class="normal" href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a>. If your SList uses these tags (for example, you plan to call later <a class="normal" href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a> with the same SList and Tags = <code>True</code>) then make sure you pass Tags = <code>True</code> to this method. Otherwise, <code>MaxTextWidth</code> will treat tags text (like <code>&lt;font ...&gt;</code>) like a normal text, usually making the width incorrectly large.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintStrings"></a><code>procedure <b>PrintStrings</b>(const X0, Y0: Integer; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const Strs: TStrings; const Tags: boolean; const LineSpacing: Integer; const TextHorizontalAlignment: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a> = <a  href="CastleUIControls.html#hpLeft">hpLeft</a>); overload;</code></td>
</tr>
<tr><td colspan="2">
<p>
Print all strings from the list.

<p>

<p>

<p>

<p>

<p>

<p></p>
<h6 class="description_section">Parameters</h6>
<dl class="parameters">
<dt>X0</dt>
<dd>The X position of the whole text block. It's exact interpretation depends on TextHorizontalAlignment value.</dd>
<dt>Y0</dt>
<dd>The bottom position of the whole text block. That is, this is the bottom position of the last string.</dd>
<dt>LineSpacing</dt>
<dd>Extra space between lines. Distance between each line is determined by <a class="normal" href="CastleFonts.TCastleFont.html#RowHeight">RowHeight</a> + LineSpacing pixels.

<p>Note that LineSpacing can be &lt; 0 (as well as &gt; 0), this may be sometimes useful if you really want to squeeze more text into the available space. Still, make sure that (<a class="normal" href="CastleFonts.TCastleFont.html#RowHeight">RowHeight</a> + LineSpacing) is &gt; 0.</dd>
<dt>Tags</dt>
<dd>Enable some HTML-like tags to mark font changes inside the text. For now, these can only be used to surround whole lines (so you have to place opening tag at the beginnig of line, and closing tag at the end of line). For now, the only tag handled is <code>&lt;font color=&quot;#rrggbb&quot;&gt;</code> that changes line color to specified RGB. Also, we handle <code>&lt;font color=&quot;#rrggbbaa&quot;&gt;</code> where the last component is alpha (opacity), and when it's &lt; 1 then we render using blending. Close with <code>&lt;/font&gt;</code>.

<p>This functionality may be enhanced in the future (feature requests and patches welcome). Don't expect full HTML implementation inside, but some small set of useful tags may be doable and comfortable to use. Not necessarily replicating some (old version of) HTML standard.</dd>
<dt>Color</dt>
<dd>The color of the text. Alpha value of the color is honored, value &lt; 1 renders partially-transparent text.

<p>Overloaded and deprecated versions without explicit Color parameter use <a class="normal" href="CastleGLUtils.html#CurrentColor">CurrentColor</a>.</dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintStrings"></a><code>procedure <b>PrintStrings</b>(const Strs: TStrings; const Tags: boolean; const LineSpacing: Integer; const X0: Integer = 0; const Y0: Integer = 0); overload; deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintStrings"></a><code>procedure <b>PrintStrings</b>(const Strs: array of string; const Tags: boolean; const LineSpacing: Integer; const X0: Integer = 0; const Y0: Integer = 0); overload; deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintBrokenString"></a><code>function <b>PrintBrokenString</b>(const Rect: <a  href="CastleRectangles.TRectangle.html">TRectangle</a>; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const LineSpacing: Integer; const AlignHorizontal: <a  href="CastleRectangles.html#THorizontalPosition">THorizontalPosition</a>; const AlignVertical: <a  href="CastleRectangles.html#TVerticalPosition">TVerticalPosition</a>): Integer;</code></td>
</tr>
<tr><td colspan="2">
<p>
Print the string, broken such that it fits within MaxLineWidth. The string is broken into many lines using <a class="normal" href="CastleFonts.TCastleFont.html#BreakLines">BreakLines</a>, so the original newlines insides are correctly used, and the length of lines fits inside MaxLineWidth.

<p>The strings are printed on the screen, just like by <a class="normal" href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a> (with Tags = always false for now, since our string breaking cannot omit tags). If PositionsFirst then the X0, Y0 determine the position of the first (top) line, otherwise they determine the position of the last (bottom) line.

<p>LineSpacing has the same meaning as for <a class="normal" href="CastleFonts.TCastleFont.html#PrintStrings">PrintStrings</a>: it adds an additional space between lines (if positive) or forces the lines to be more tightly squeezed (if negative). Always make sure that (<a class="normal" href="CastleFonts.TCastleFont.html#RowHeight">RowHeight</a> + LineSpacing) &gt; 0.

<p>Returns the number of lines printed, that is the number of lines after breaking the text into lines. This may be useful e.g. to calculate the height of the printed text.

<p>May require 1 free slot on the attributes stack. May only be called when current matrix is modelview. Doesn't modify any OpenGL state or matrix.

<p>Overloaded and deprecated version without explicit Color parameter uses <a class="normal" href="CastleGLUtils.html#CurrentColor">CurrentColor</a>.

<p>Overloaded version that takes rectangle as a parameter can align the resulting string box within the rectangle.

<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintBrokenString"></a><code>function <b>PrintBrokenString</b>(X0, Y0: Integer; const Color: <a  href="CastleColors.html#TCastleColor">TCastleColor</a>; const S: string; const MaxLineWidth: Integer; const PositionsFirst: boolean; const LineSpacing: Integer): Integer;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PrintBrokenString"></a><code>function <b>PrintBrokenString</b>(const S: string; const MaxLineWidth, X0, Y0: Integer; const PositionsFirst: boolean; const LineSpacing: Integer): Integer; deprecated;</code></td>
</tr>
<tr><td colspan="2">
<p class="hint_directive">Warning: this symbol is deprecated.</p>&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PushProperties"></a><code>procedure <b>PushProperties</b>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Save draw properties to a stack. Saves: <a class="normal" href="CastleFonts.TCastleFont.html#Scale">Scale</a> (synchronized with <a class="normal" href="CastleFonts.TCastleFont.html#Size">Size</a>), <a class="normal" href="CastleFonts.TCastleFont.html#Outline">Outline</a>, <a class="normal" href="CastleFonts.TCastleFont.html#OutlineColor">OutlineColor</a>.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="PopProperties"></a><code>procedure <b>PopProperties</b>;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Scale"></a><code>property <b>Scale</b>: Single read FScale write SetScale;</code></td>
</tr>
<tr><td colspan="2">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Size"></a><code>property <b>Size</b>: Single read GetSize write SetSize;</code></td>
</tr>
<tr><td colspan="2">
<p>
Adjust font size by scaling. Underneath, it scales the font using <a class="normal" href="CastleFonts.TCastleFont.html#Scale">Scale</a> property, to adjust it to requested size.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="Outline"></a><code>property <b>Outline</b>: Cardinal read FOutline write FOutline;</code></td>
</tr>
<tr><td colspan="2">
<p>
<code>Outline</code> size around the normal text. Note that the current implementation is very simple, it will only look sensible for small <code>outline</code> values (like 1 or 2).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a  href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><a name="OutlineColor"></a><code>property <b>OutlineColor</b>: <a  href="CastleColors.html#TCastleColor">TCastleColor</a> read FOutlineColor write FOutlineColor;</code></td>
</tr>
<tr><td colspan="2">
<p>
<a class="normal" href="CastleFonts.TCastleFont.html#Outline">Outline</a> color, used only if <a class="normal" href="CastleFonts.TCastleFont.html#Outline">Outline</a> &lt;&gt; 0. Default is <a class="normal" href="CastleColors.html#Black">black</a>.</p>
</td></tr>
</table>
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://michalis.ii.uni.wroc.pl/piwik-castle-engine/";
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "1"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Piwik Code -->

<noscript>
<!-- Piwik Image Tracker -->
<img src="http://michalis.ii.uni.wroc.pl/piwik-castle-engine/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->
</noscript>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2015-06-15 04:43:09</em>
</span>
</td></tr></table></body></html>