Menu

[r760]: / trunk / documentation / lispbuilder-sdl-ttf.html  Maximize  Restore  History

Download this file

1301 lines (951 with data), 55.1 kB

   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
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<title>LISPBUILDER-SDL-TTF - </title>
<style type="text/css">
body {
margin: 10px 20px 20px 220px;
padding: 0px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: small;
text-align: justify;
max-width: 50em;
background-color: white;
}
a, a:visited {
text-decoration: none;
color: maroon;
}
/* index */
div.index {
position: fixed;
top: 0px;
left: 0px;
width: 180px;
height: 100%;
margin: 0px;
padding: 5px;
font-size: 12px;
background-color: #DCDCDC;
border-right: thin black solid;
}
div.index ol {
color: navy;
margin: 0px;
padding-left: 0px;
}
div.index ol li {
list-style: none;
}
div.index ol li:before {
display: marker;
content: counter(heading1) ". ";
counter-increment: heading1;
}
div.index ol ol {
padding-left: 10px;
font-size: 10px;
list-style: none;
counter-reset: heading2;
}
div.index ol ol li:before {
display: marker;
content: counter(heading1)"." counter(heading2)" ";
counter-increment: heading2;
}
/* heading styles */
body > h1 {
margin-top: 0px;
}
h1 {
margin-top: 40px;
margin-bottom: 0px;
color: #4682B4;
}
h1:before {
display: marker;
content: counter(chapter) ". ";
counter-increment: chapter;
counter-reset: section1;
}
h1 + p {
margin-top: 5px;
}
h2 {
margin-top: 20px;
color: #000000;
margin-bottom: 0px;
}
h2:before {
display: marker;
content: counter(chapter) "." counter(section1) " ";
counter-increment: section1;
}
h2 + p {
margin-top: 0px;
}
h3 {
margin-top: 20px;
color: #000000;
margin-bottom: 0px;
}
h3:before {
display: marker;
content: counter(chapter) "." counter(section1) "." counter(section2) " ";
counter-increment: section2;
}
h3 + p {
margin-top: 0px;
}
h4 {
margin-top: 20px;
color: #000000;
margin-bottom: 0px;
}
h4:before {
display: marker;
content: counter(chapter) "." counter(section1) "." counter(section2) "." counter(section3) " ";
counter-increment: section3;
}
h4 + p {
margin-top: 0px;
}
/* generated content for images and tables */
img:after {
content: "[" counter(image) "] " attr(title);
counter-increment: image;
display: block;
font-size: 10px;
font-weight: bold;
margin-top: 5px;
margin-bottom: 20px;
color: black;
}
table:after {
content: "Table " counter(table) ": " attr(summary);
counter-increment: table;
display: table-caption;
caption-side: bottom;
font-size: 10px;
font-weight: bold;
margin-top: 5px;
margin-bottom: 20px;
white-space: nowrap;
color: black;
}
/* code for examples, code and pathnames*/
div.example table {
color: black;
}
div.example, div.code, div.path, div.sequence {
margin: 10px 0px;
border: 1px black solid;
padding: 10px;
background-color: #F4F4F4;
counter-reset: image;
color: maroon;
}
div.example:before {
content: "Example " counter(example);
counter-increment: example;
display: block;
}
div.example + p {
margin-bottom: 0px;
}
div.code:before {
content: "Code";
}
div.path:before {
content: "Path";
}
div.sequence:before {
content: "Sequence";
}
p.reference:before {
display: marker;
content: "[" counter(reference) "]";
counter-increment: reference;
font-weight: bold;
margin-right: 5px;
}
div.code:before, div.example:before, div.path:before, div.sequence:before {
font-weight: bold;
font-size: 15px;
margin-bottom: 20px;
color: black;
}
pre {
color: Green;
margin: 0px;
padding: 0px;
}
/* equation counter */
e:after {
content: "[" counter(equation) "]";
counter-increment: equation;
display: block;
float: right;
margin-right: 10px;
}
/* to prevent the CC image from being numbered */
img[alt="Creative Commons License"] {
display: inline;
}
img[alt="Creative Commons License"]:after {
display: none;
}
div#cc {
background-color: #DCDCDC;
border: thin black solid;
padding: 10px;
font-size: 10px;
}
/* Table Design */
/* http://www.duoh.com/csstutorials/csstables/ */
#mytable {
width: 700px;
padding: 0;
margin: 0;
}
caption {
padding: 0 0 5px 0;
width: 700px;
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
text-align: right;
}
th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: uppercase;
text-align: left;
padding: 6px 6px 6px 12px;
background: #CAE8EA url(images/bg_header.jpg) no-repeat;
}
th.nobg {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
td {
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
background: #fff;
padding: 6px 6px 6px 12px;
color: #4f6b72;
}
td.alt {
background: #F5FAFA;
color: #797268;
}
th.spec {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #fff url(images/bullet1.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th.specalt {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #f5fafa url(images/bullet2.gif) no-repeat;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #797268;
}
</style>
</head>
<!--
(CC) 2003 Luke Crook. Some Rights Reserved.
http://creativecommons.org/licenses/by/1.0
This page is licensed under a Creative Commons License.
Maintained by the Common Lisp Application Builder project at www.lispbuilder.org
The entire styleguide was copied wholesale from http://www.markschenk.com/cssexp/publication/article.xml
(CC) 2003 Mark Schenk. Some Rights Reserved.
http://creativecommons.org/licenses/by/1.0
This page is licensed under a Creative Commons License.
-->
<BODY BGCOLOR=#FFFFFF >
<h1><a name="top" class=none> LISPBUILDER-SDL-TTF - </a></h1>
<blockquote>
<br>&nbsp;</br><h2><a name=abstract class=abstract>Abstract</a></h2>
<p>
LISPBUILDER-SDL-TTF provides a Lisp wrapper for the
<a href="http://www.libsdl.org/projects/SDL_ttf/">SDL_TTF</a> library,
and provides support for loading and rendering True-Type fonts in an
SDL application. The SDL_TTF wrapper is in itself a wrapper around the
FreeType 1.2 library, available at: <a href="http://www.freetype.org/">Freetype Homepage</a>.
LISPBUILDER-SDL-TTF has a dependency on the LISPBUILDER-SDL package.
LISPBUILDER-SDL-TTF is distributed under the
<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
</p>
<p>
<font color=red>Current Version:</font> The current version of LISPBUILDER-SDL-TTF is version <a href="#download">0.2</a>.
</p>
<!-- <p> -->
<!-- <font color=red>Download shortcut:</font> <a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip</a>. -->
<!-- </p> -->
</blockquote>
<br>&nbsp;</br><h2><a class=none name="packageover">Package Overview</a></h2>
<p>The TrueType library is automatically initialized and uninitialized by the LISPBUILDER-SDL package.
The functions INIT-TTF and QUIT-TTF are added to the lists SDL:*EXTERNAL-INIT-ON-STARTUP* and
SDL:*EXTERNAL-QUIT-ON-EXIT*. LISPBUILDER-SDL iterates over these lists in calls to SDL:INIT-SDL, SDL:QUIT-SDL
and SDL:WITH-INIT in order to initialize or uninitialize any external libraries such as LISPBUILDER-SDL-TTF.</p>
<p>To open a TrueType font use INITIALISE-FONT or the macro WITH-OPEN-FONT. LISPBUILDER-SDL-TTF allows more than
one FONT to be used simultaneously within a single SDL application.
</p>
<p>
LISPBUILDER-SDL-TTF has the concept of a *DEFAULT-FONT*. A FONT may be bound to *DEFAULT-FONT* by using
INITIALISE-DEFAULT-FONT, WITH-OPEN-FONT, or WITH-DEFAULT-FONT.
All functions that take a &KEYword or &OPTIONAL FONT argument accept *DEFAULT-FONT* unless a FONT is specified.
This makes calling functions a bit easier as the :FONT parameter need not be explicitely passed. For example:
(GET-FONT-SIZE "TEXT" :SIZE :W), compared to
(GET-FONT-SIZE "TEXT" :SIZE :W :FONT ANY-FONT)
</p>
<p>
Functions and symbols exported from the LISPBUILDER-SDL-TTF package are
accessible from the <code>LISPBUILDER-SDL-TTF:</code> prefix or the
shorter form <code>SDL-TTF:</code> nickname.
</p>
<br>&nbsp;</br><h2><a class=none name="examplesimple">Simple Example</a></h2>
<div class="example">
<p>
This example was created with the following code:
</p>
<p>
<img src="ttf-hello-world.png" width="200" height="167" title="TTF Hello World!" alt="TTF Hello World!"/>
</p>
<pre>
(sdl:with-init ()
(sdl:window 320 240)
(sdl-ttf:initialise-default-font)
(sdl-ttf:draw-string-solid-* "Hello TTF World!" 25 50
:color (sdl:color :r 255 :g 0 :b 255))
(sdl:with-events ()
(:quit-event () t)
(:video-expose-event () (sdl:update-display))))
</pre>
</div>
<div class="index">
<ol>
<li><a href="#top">LISPBUILDER-SDL-TTF</a></li>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#packageover">Package Overview</a></li>
<li><a href="#examplesimple">Simple Example</a></li>
<li><a href="#compatibility">Compatibility</a></li>
<li><a href="#download">Download</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#build">Build Instructions</a></li>
<ol>
<li><a href="#buildwindows">Windows Instructions</a></li>
<li><a href="#buildlinux">Linux Instructions</a></li>
</ol>
<li><a href="#usage">Usage</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#dependency">Dependencies</a></li>
<li><a href="#license">License</a></li>
<li><a href="#dictionar">LISPBUILDER-SDL-TTF dictionary</a></li>
<ol>
<li><a href="#dictionary">INDEX</a></li>
</ol>
<li><a href="#ack">Acknowledgements</a></li>
</ol>
</div>
<br>&nbsp;</br><h2><a class=none name="dictionary">The LISPBUILDER-SDL-TTF dictionary Index</h2>
<ol>
<li><a href="#*default-font*"><code>*default-font*</code></a>
<li><a href="#*default-font-path*"><code>*default-font-path*</code></a>
<li><a href="#close-font"><code>close-font</code></a>
<li><a href="#draw-font"><code>draw-font</code></a>
<li><a href="#draw-font"><code>draw-font</code></a>
<li><a href="#draw-font-at"><code>draw-font-at</code></a>
<li><a href="#draw-font-at-*"><code>draw-font-at-*</code></a>
<li><a href="#draw-string-blended"><code>draw-string-blended</code></a>
<li><a href="#draw-string-blended-*"><code>draw-string-blended-*</code></a>
<li><a href="#draw-string-shaded"><code>draw-string-shaded</code></a>
<li><a href="#draw-string-shaded-*"><code>draw-string-shaded-*</code></a>
<li><a href="#draw-string-solid"><code>draw-string-solid</code></a>
<li><a href="#draw-string-solid-*"><code>draw-string-solid-*</code></a>
<li><a href="#font"><code>font</code></a>
<li><a href="#free-font"><code>free-font</code></a>
<li><a href="#get-font-ascent"><code>get-font-ascent</code></a>
<li><a href="#get-font-descent"><code>get-font-descent</code></a>
<li><a href="#get-font-face-family-name"><code>get-font-face-family-name</code></a>
<li><a href="#get-font-face-style-name"><code>get-font-face-style-name</code></a>
<li><a href="#get-font-faces"><code>get-font-faces</code></a>
<li><a href="#get-font-height"><code>get-font-height</code></a>
<li><a href="#get-font-line-skip"><code>get-font-line-skip</code></a>
<li><a href="#get-font-size"><code>get-font-size</code></a>
<li><a href="#get-font-style"><code>get-font-style</code></a>
<li><a href="#get-glyph-metric"><code>get-glyph-metric</code></a>
<li><a href="#init-ttf"><code>init-ttf</code></a>
<li><a href="#initialise-default-font"><code>initialise-default-font</code></a>
<li><a href="#initialise-font"><code>initialise-font</code></a>
<li><a href="#is-font-face-fixed-width"><code>is-font-face-fixed-width</code></a>
<li><a href="#is-init"><code>is-init</code></a>
<li><a href="#new-font"><code>new-font</code></a>
<li><a href="#open-font"><code>open-font</code></a>
<li><a href="#quit-ttf"><code>quit-ttf</code></a>
<li><a href="#render-string-blended"><code>render-string-blended</code></a>
<li><a href="#render-string-shaded"><code>render-string-shaded</code></a>
<li><a href="#render-string-solid"><code>render-string-solid</code></a>
<li><a href="#set-font-style"><code>set-font-style</code></a>
<li><a href="#with-default-font"><code>with-default-font</code></a>
<li><a href="#with-open-font"><code>with-open-font</code></a>
</li>
</ol>
<br>&nbsp;</br><h2><a class=none name="compatibility">Compatibility</h2>
<p>
The following table describes the status of the Lisp implementations that have been tested with
LISPBUILDER-SDL-TTF:
</p>
<table id="mytable" cellspacing="0" summary="Compatibility">
<tr>
<th><b>Lisp Implementation</b></th>
<th colspan="3"><b>LISPBUILDER-SDL-TTF Status</b></th>
<th><b>Comments</b></th>
</tr>
<tr>
<th colspan="1"></th>
<th><b>Win32</b></th>
<th><b>Linux</b></th>
<th><b>MacOS</b></th>
<th></th>
</tr>
<tr>
<th class="spec" scope="row">
<a href="http://clisp.cons.org/">CLISP v2.38</a>
</th>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#ff6060">No</td>
<td></td>
</tr>
<tr>
<th class="specalt" scope="row">
<a href="http://www.lispworks.com/">Lispworks v4.4.6 Personal</a>
</th>
<td class="alt" bgcolor="#60c060">Working</td>
<td class="alt" bgcolor="#60c060">Working</td>
<td class="alt" bgcolor="#ff6060">No</td>
<td></td>
</tr>
<tr>
<th class="spec" scope="row">
<a href="http://www.franz.com/">Allegro Express 8.0</a>
</th>
<td bgcolor="#ff6060">Unknown</td>
<td bgcolor="#ff6060">Unknown</td>
<td bgcolor="#ff6060">No</td>
<td></td>
</tr>
<tr>
<th class="specalt" scope="row">
<a href="http://openmcl.clozure.com/">OpenMCL</a>
</th>
<td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
<td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
<td class="alt" bgcolor="#ff6060">Unknown</td>
<td></td>
</tr>
<tr>
<th class="spec" scope="row">
<a href="http://www.sbcl.org/">SBCL</a>
</th>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#60c060">Working</td>
<td bgcolor="#ff6060">No</td>
<td></td>
</tr>
</table>
<br>&nbsp;</br><h2><a class=none name="download">Download</a></h2>
<ul>
<li><font color=red>Development:</font> Available via anonymous SVN at:
<pre>
svn co https://lispbuilder.svn.sourceforge.net/svnroot/lispbuilder lispbuilder
</pre>
</li>
<li>
<font color=red>Stable:</font> The latest stable versions are available from the
<a href="http://sourceforge.net/project/showfiles.php?group_id=159740">LISPBUILDER-SDL repository on SourceForge.</a>
</li>
<li>
<font color=red>The Edi Weitz 'Starter Pack' Version:</font> The stable version of Lispbuilder,
suitable for the installation of installation LISPBUILDER-SDL-TTF using the Lisp Starter Pack from Edi Weitz is can be downloaded from
<a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip</a>.
</li>
</ul>
<br>&nbsp;</br><h2><a class=none name="installation">Installation</a></h2>
<p>See <a href="http://lispbuilder.sourceforge.net/index.html#installation">the LISPBUILDER documentation</a>
for installation instructions.
</p>
<br>&nbsp;</br><h2><a class=none name="build">Build Instructions</a></h2>
<p>LISPBUILDER-SDL-TTF requires that a glue library <code>lispbuilder-sdl-ttf-glue</code> is also installed
in the library search path. <code>lispbuilder-sdl-ttf-glue</code> wraps the native font rendering functions
provided by <code>SDL_TTF</code> as these functions require that a <code>SDL_Color</code> struct is passed
by value. However CFFI only supports passing structs by reference.
</p>
<br>&nbsp;</br><h3><a class=none name="buildwindows">Windows Build Instructions</a></h2>
<p><code>lispbuilder-sdl-ttf-glue</code> is installed as part of the <code>LISPBUILDER-SDL-TTF-BINARIES</code>
package into the directory <code>LISPBUILDER-SDL-TTF/BIN</code>.
</p>
<p>To rebuild the glue library:
<ol>
<li>A working installation of <a href="http://www.mingw.org/">MingW</a> is required.</i>
<li>Make sure that the path to the include files for SDL and SDL_TTF are specified
correctly in <code>LISPBUILDER-SDL-TTF/Makefile.mingw</code>. Modify the existing line
<code>SDL_TTF_CFLAGS=$(CFLAGS) -ISDL-1.2.11/include -ISDL_ttf-2.0.8</code>.</li>
<li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make</code>
to create the glue library.</li>
<li>If the build is successful, the <code>lispbuilder-sdl-ttf-glue</code> library will be found in the
<code>LISPBUILDER-SDL-TTF/BUILD/</code> directory.</li>
<li>Copy or move this file <code>LISPBUILDER-SDL-TTF/BUILD/lispbuilder-sdl-ttf-glue.dll</code> to the
<code>BIN</code> directory <code>LISPBUILDER-SDL-TTF/BIN/lispbuilder-sdl-ttf-glue.dll</code></li>
</ol>
</p>
<br>&nbsp;</br><h3><a class=none name="buildlinux">Linux Build Instructions</a></h2>
<p>To rebuild the glue library:
<ol>
<li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make</code>
to create the glue library.</li>
<li>If the build is successful, the <code>lispbuilder-sdl-ttf-glue</code> library will be found in the
<code>LISPBUILDER-SDL-TTF/BUILD/</code> directory.</li>
<li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make install_ttf</code>
to install the <code>lispbuilder-sdl-ttf-glue</code> library.</li>
</ol>
</p>
<br>&nbsp;</br><h2><a class=none name="usage">Using LISPBUILDER-SDL-TTF</a></h2>
<p>See <a href="http://lispbuilder.sourceforge.net/index.html#usage">the LISPBUILDER documentation</a>
for Usage instructions.
</p>
<br>&nbsp;</br><h2><a class=none name="examples">Running Examples in LISPBUILDER-SDL-TTF-EXAMPLES</a></h2>
<p>The following examples are contained in the package LISPBUILDER-SDL-TTF-EXAMPLES:
</p>
<ul>
<li>(SDL-TTF-EXAMPLES:FONT-EXAMPLE)</li>
</ul>
<p>Enter the following at the REPL to load the examples in the
LISPBUILDER-SDL-TTF-EXAMPLES package:</p>
<pre>
(asdf:operate 'asdf:load-op :lispbuilder-sdl-TTF-examples)
</pre>
<br>&nbsp;</br><h2><a class=none name="dependency">Dependencies</a></h2>
<p>LISPBUILDER-SDL-TTF has a dependency on LISPBUILDER-SDL.</p>
<br>&nbsp;</br><h2><a class=none name="license">License</a></h2>
<p>
LISPBUILDER-SDL-TTF is distributed under the
<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
</p>
<br>&nbsp;</br><h2><a class=none name="dictionar">The LISPBUILDER-SDL-TTF dictionary</a></h2>
<!-- Entry for *DEFAULT-FONT* -->
<p><br>[Special variable]<br><a class=none name='*default-font*'><b>*default-font*</b></a>
<blockquote><br>
<p>When a <code>LISPBUILDER-SDL-TTF</code> function or macro has an <code>OPTIONAL</code> or <code>KEY</code>word argument <code>FONT</code>, the default action is to bind to <code>*DEFAULT-FONT*</code>. <code>*DEFAULT-FONT*</code> is set to <code>NIL</code> initially. A font must be initialized by calling <a href="#with-open-font">WITH-OPEN-FONT</a>, <a href="#initialise-font">INITIALISE-FONT</a>, or <a href="#initialise-default-font">INITIALISE-DEFAULT-FONT</a>. These will bind <code>*DEFAULT-FONT*</code> to a Truetype font <code>FONT</code>. </p>
</blockquote>
<!-- End of entry for *DEFAULT-FONT* -->
<!-- Entry for *DEFAULT-FONT-PATH* -->
<p><br>[Special variable]<br><a class=none name='*default-font-path*'><b>*default-font-path*</b></a>
<blockquote><br>
<p>The path to the default Truetype font, <code>&amp;quot;Bitstream Vera&amp;quot;</code></p>
</blockquote>
<!-- End of entry for *DEFAULT-FONT-PATH* -->
<!-- Entry for CLOSE-FONT -->
<p><br>[Function]<br><a class=none name='close-font'><b>close-font</b> <i><tt>&amp;key</tt> font *default-font*</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Closes the font <code>FONT</code> when the <code>SDL_TTF</code> font library is intitialized. NOTE: <code>CLOSE-FONT</code> does not uninitialise the font library, and does not bind <code>*DEFAULT-FONT*</code> to <code>NIL</code>. Returns <code>T</code> if successful, or <code>NIL</code> if the font cannot be closed or the <code>SDL_TTF</code> font library is not initialized. </p>
</blockquote>
<!-- End of entry for CLOSE-FONT -->
<!-- Entry for DRAW-FONT -->
<p><br>[Generic function]<br><a class=none name='draw-font'><b>draw-font</b> <i><tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Blit the cached SURFACE in FONT to the destination surface SURFACE. The cached surface is created during a previous call to any of the DRAW-STRING* functions. Uses POSITION in the cached SURFACE to render to the X/Y coordinates on the destination SURFACE. </p><p>This function can speed up blitting when the text remains unchanged between screen updates. </p>
</blockquote>
<!-- End of entry for DRAW-FONT -->
<!-- Entry for DRAW-FONT -->
<p><br>[Function]<br><a class=none name='draw-font'><b>draw-font</b> <i><tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
</blockquote>
<!-- End of entry for DRAW-FONT -->
<!-- Entry for DRAW-FONT-AT -->
<p><br>[Generic function]<br><a class=none name='draw-font-at'><b>draw-font-at</b> <i>position <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>See DRAW-FONT. POINT is used to position the cached SURFACE, where POINT is of type SDL:POINT. </p>
</blockquote>
<!-- End of entry for DRAW-FONT-AT -->
<!-- Entry for DRAW-FONT-AT -->
<p><br>[Method]<br><a class=none><b>draw-font-at</b> <i>position <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
</blockquote>
<!-- End of entry for DRAW-FONT-AT -->
<!-- Entry for DRAW-FONT-AT-* -->
<p><br>[Generic function]<br><a class=none name='draw-font-at-*'><b>draw-font-at-*</b> <i>x y <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>See DRAW-FONT. X and Y are used to position the cached SURFACE, where X and Y are INTEGERS. </p>
</blockquote>
<!-- End of entry for DRAW-FONT-AT-* -->
<!-- Entry for DRAW-FONT-AT-* -->
<p><br>[Method]<br><a class=none><b>draw-font-at-*</b> <i>x y <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
</blockquote>
<!-- End of entry for DRAW-FONT-AT-* -->
<!-- Entry for DRAW-STRING-BLENDED -->
<p><br>[Function]<br><a class=none name='draw-string-blended'><b>draw-string-blended</b> <i>text position <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>See <a href="#draw-string-blended-*">DRAW-STRING-BLENDED-*</a>. </p><ul><li><code>POSITION</code> is the <code>X</code> and <code>Y</code> coordinates to render <code>TEXT</code>, of type <code>SDL:POINT</code>. </li>
</ul>
</blockquote>
<!-- End of entry for DRAW-STRING-BLENDED -->
<!-- Entry for DRAW-STRING-BLENDED-* -->
<p><br>[Function]<br><a class=none name='draw-string-blended-*'><b>draw-string-blended-*</b> <i>text x y <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Draw text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> onto surface <code>SURFACE</code>, using the Blended mode. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>X</code> and <code>Y</code> are the x and y coordinates of the <code>TEXT</code>, as <code>INTEGER</code>s. </li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
<li><code>SURFACE</code> is the target surface, of type <code>SDL:SDL-SURFACE</code>. </li>
<li><code>COLOR</code> is the color used to render <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
</ul><h5>Return </h5>
<ul><li>Returns the font <code>FONT</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-SOLID-* &amp;quot;Hello World!&amp;quot; 0 0 :FONT *DEFAULT-FONT* :SURFACE A-SURFACE :COLOR A-COLOR)
</code></pre>
</blockquote>
<!-- End of entry for DRAW-STRING-BLENDED-* -->
<!-- Entry for DRAW-STRING-SHADED -->
<p><br>[Function]<br><a class=none name='draw-string-shaded'><b>draw-string-shaded</b> <i>text position fg-color bg-color <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>See <a href="#draw-string-shaded-*">DRAW-STRING-SHADED-*</a></p><h5>Parmeters </h5>
<ul><li><code>POSITION</code> is the <code>X</code> and <code>Y</code> coordinates to render <code>TEXT</code>, of type <code>SDL:POINT</code>. </li>
</ul>
</blockquote>
<!-- End of entry for DRAW-STRING-SHADED -->
<!-- Entry for DRAW-STRING-SHADED-* -->
<p><br>[Function]<br><a class=none name='draw-string-shaded-*'><b>draw-string-shaded-*</b> <i>text x y fg-color bg-color <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Draw text <code>TEXT</code> using font <code>FONT</code> with foreground color <code>FG-COLOR</code> and background color <code>BG-COLOR</code> onto surface <code>SURFACE</code>, using the Shaded mode. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>X</code> and <code>Y</code> are the x and y coordinates of the <code>TEXT</code>, as <code>INTEGER</code>s. </li>
<li><code>FG-COLOR</code> is the foreground color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>BG-COLOR</code> is the background color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
<li><code>SURFACE</code> is the target surface, of type <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the font <code>FONT</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-SHADED-* &amp;quot;Hello World!&amp;quot; 0 0 fg-col bg-col :FONT *DEFAULT-FONT* :SURFACE A-SURFACE)
</code></pre>
</blockquote>
<!-- End of entry for DRAW-STRING-SHADED-* -->
<!-- Entry for DRAW-STRING-SOLID -->
<p><br>[Function]<br><a class=none name='draw-string-solid'><b>draw-string-solid</b> <i>text position <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>See <a href="#draw-string-solid-*">DRAW-STRING-SOLID-*</a>. </p><h5>Parmeters </h5>
<ul><li><code>POSITION</code> is the <code>X</code> and <code>Y</code> coordinates to render <code>TEXT</code>, of type <code>SDL:POINT</code>. </li>
</ul>
</blockquote>
<!-- End of entry for DRAW-STRING-SOLID -->
<!-- Entry for DRAW-STRING-SOLID-* -->
<p><br>[Function]<br><a class=none name='draw-string-solid-*'><b>draw-string-solid-*</b> <i>text x y <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Draw text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> onto surface <code>SURFACE</code>, using the Solid mode. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>X</code> and <code>Y</code> are the x and y coordinates of the <code>TEXT</code>, as <code>INTEGER</code>s. </li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
<li><code>SURFACE</code> is the target surface, of type <code>SDL:SDL-SURFACE</code>. </li>
<li><code>COLOR</code> is the color used to render <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
</ul><h5>Return </h5>
<ul><li>Returns the font <code>FONT</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-SOLID-* &amp;quot;Hello World!&amp;quot; 0 0 :FONT *DEFAULT-FONT* :SURFACE A-SURFACE :COLOR A-COLOR)
</code></pre>
</blockquote>
<!-- End of entry for DRAW-STRING-SOLID-* -->
<!-- Entry for FONT -->
<p><br>[Standard class]<br><a class=none name='font'><b>font</b></a>
<blockquote><br>
<p>A <code>FONT</code> object is wrapper around a foreign <code>TTF_Font</code> object. </p><p>The <code>FONT</code> object maintains the most recent surface <code>SDL:SURFACE</code> created by a call to any of the <code>RENDER-STRING*</code> functions. Use <a href="#draw-font">DRAW-FONT</a>, <a href="#draw-font-at">DRAW-FONT-AT</a> or <a href="#draw-font-at-*">DRAW-FONT-AT-*</a> to draw the cached surface. </p><p>Prior to the first call to a <code>RENDER-STRING*</code> function, the cached surface is <code>NIL</code>. </p>
</blockquote>
<!-- End of entry for FONT -->
<!-- Entry for FREE-FONT -->
<p><br>[Generic function]<br><a class=none name='free-font'><b>free-font</b> <i>font</i> =&gt; <i>result</i></a>
<blockquote><br>
</blockquote>
<!-- End of entry for FREE-FONT -->
<!-- Entry for FREE-FONT -->
<p><br>[Method]<br><a class=none><b>free-font</b> <i>(font font)</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Free the resources used by the font <code>FONT</code>. Free&#039;s any cached surface. Closes the <code>TTF_Font</code> object only when the <code>FONT</code> was created within the current <a href="#init-ttf">INIT-TTF</a>/<a href="#quit-ttf">QUIT-TTF</a> sequence. In other words, when <code>(EQ (GENERATION FONT) *GENERATION)</code>. Otherwise it is assumed that the <code>TTF_Font</code> was closed in a previous call to <code>QUIT-TTF</code>. </p>
</blockquote>
<!-- End of entry for FREE-FONT -->
<!-- Entry for GET-FONT-ASCENT -->
<p><br>[Function]<br><a class=none name='get-font-ascent'><b>get-font-ascent</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the maximum pixel ascent of all glyphs of font <code>FONT</code>. This can also be interpreted as the distance from the top of the font to the baseline. It could be used when drawing an individual glyph relative to a top point, by combining it with the glyph&#039;s maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the ascent of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-ASCENT -->
<!-- Entry for GET-FONT-DESCENT -->
<p><br>[Function]<br><a class=none name='get-font-descent'><b>get-font-descent</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the maximum pixel descent of all glyphs of font <code>FONT</code>. This can also be interpreted as the distance from the baseline to the bottom of the font. It could be used when drawing an individual glyph relative to a bottom point, by combining it with the glyph’s maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the descent of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-DESCENT -->
<!-- Entry for GET-FONT-FACE-FAMILY-NAME -->
<p><br>[Function]<br><a class=none name='get-font-face-family-name'><b>get-font-face-family-name</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the current font face family name of font <code>FONT</code> or <code>NIL</code> if the information is unavailable. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the name of the <code>FONT</code> face family name as a <code>STRING</code>, or <code>NIL</code> if unavailable. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-FACE-FAMILY-NAME -->
<!-- Entry for GET-FONT-FACE-STYLE-NAME -->
<p><br>[Function]<br><a class=none name='get-font-face-style-name'><b>get-font-face-style-name</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the current font face style name of font <code>FONT</code>, or <code>NIL</code> if the information is unavailable. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the name of the <code>FONT</code> face style as a <code>STRING</code>, or <code>NIL</code> if unavailable. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-FACE-STYLE-NAME -->
<!-- Entry for GET-FONT-FACES -->
<p><br>[Function]<br><a class=none name='get-font-faces'><b>get-font-faces</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the number of faces &#039;sub-fonts&#039; available in the font <code>FONT</code>. This is a count of the number of specific fonts (based on size and style and other typographical features perhaps) contained in the font itself. It seems to be a useless fact to know, since it can’t be applied in any other <code>SDL_TTF</code> functions. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the number of faces in the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-FACES -->
<!-- Entry for GET-FONT-HEIGHT -->
<p><br>[Function]<br><a class=none name='get-font-height'><b>get-font-height</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the maximum pixel height of all glyphs of font <code>FONT</code>. Use this height for rendering text as close together vertically as possible, though adding at least one pixel height to it will space it so they can&#039;t touch. Remember that <code>SDL_TTF</code> doesn&#039;t handle multiline printing so you are responsible for line spacing, see <a href="#get-font-line-skip">GET-FONT-LINE-SKIP</a> as well. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Retuns the height of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-HEIGHT -->
<!-- Entry for GET-FONT-LINE-SKIP -->
<p><br>[Function]<br><a class=none name='get-font-line-skip'><b>get-font-line-skip</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the recommended pixel height of a rendered line of text of the font <code>FONT</code>. This is usually larger than the <a href="#get-font-height">GET-FONT-HEIGHT</a> of the font. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the pixel height of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-LINE-SKIP -->
<!-- Entry for GET-FONT-SIZE -->
<p><br>[Function]<br><a class=none name='get-font-size'><b>get-font-size</b> <i>text <tt>&amp;key</tt> size font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Calculates and returns the resulting <code>SIZE</code> of the <code>SDL:SURFACE</code> that is required to render the text <code>TEXT</code>, or <code>NIL</code> on error. No actual rendering is performed, however correct kerning is calculated for the actual width. The height returned is the same as returned using <a href="#get-font-height">GET-FONT-HEIGHT</a>. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the string to size, of type <code>STRING</code>. </li>
<li><code>SIZE</code> must be one of; <code>:W</code> for the text width or <code>:H</code> for the text height. </li>
<li><code>FONT</code> is the font used to calculate the size of the <code>TEXT</code>. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Return </h5>
<ul><li>Returns the width or height of the specified <code>SDL:SURFACE</code>, or <code>NIL</code> upon error. </li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-SIZE -->
<!-- Entry for GET-FONT-STYLE -->
<p><br>[Function]<br><a class=none name='get-font-style'><b>get-font-style</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the rendering style of the font <code>FONT</code>. If no style is set then <code>:STYLE-NORMAL</code> is returned, or <code>NIL</code> upon error. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binfs to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Return </h5>
<ul><li>Retuns the font style as one or more of: <code>:STYLE-NORMAL</code>, <code>:STYLE-BOLD</code>, <code>:STYLE-ITALIC</code>, <code>:STYLE-UNDERLINE</code></li>
</ul>
</blockquote>
<!-- End of entry for GET-FONT-STYLE -->
<!-- Entry for GET-GLYPH-METRIC -->
<p><br>[Function]<br><a class=none name='get-glyph-metric'><b>get-glyph-metric</b> <i>ch <tt>&amp;key</tt> metric font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns the glyph metrics <code>METRIC</code> for the character <code>CH</code>, or <code>NIL</code> upon error. </p><h5>Parameters </h5>
<ul><li><code>CH</code> is a UNICODE chararacter specified as an <code>INTEGER</code>. </li>
<li><code>FONT</code> is a <code>FONT</code> object from which to retrieve the glyph metrics of the character <code>CH</code>. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
<li><code>METRIC</code> is a <code>KEY</code>word argument and may be one of; <code>:MINX</code>, for the minimum <code>X</code> offset. <code>:MAXX</code>, for the maximum <code>X</code> offset. <code>:MINY</code>, for the minimum <code>Y</code> offset. <code>:MAXY</code>, for the maximum <code>Y</code> offset. <code>:ADVANCE</code>, for the advance offset. </li>
</ul><h5>Return </h5>
<ul><li>Returns the glyph metric as an <code>INTEGER</code>. </li>
</ul><h5>Example </h5>
<pre><code>(GET-GLYPH-METRIC UNICODE-CHAR :METRIC :MINX :FONT *DEFAULT-FONT*)
</code></pre>
</blockquote>
<!-- End of entry for GET-GLYPH-METRIC -->
<!-- Entry for INIT-TTF -->
<p><br>[Function]<br><a class=none name='init-ttf'><b>init-ttf</b> <i></i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Initializes the <code>SDL_TTF</code> font library if uninitialized. Returns <code>T</code> if the library was uninitialized and is successfully initialized, or else returns <code>NIL</code> if uninitialized. </p>
</blockquote>
<!-- End of entry for INIT-TTF -->
<!-- Entry for INITIALISE-DEFAULT-FONT -->
<p><br>[Function]<br><a class=none name='initialise-default-font'><b>initialise-default-font</b> <i><tt>&amp;optional</tt> free filename size</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates a new <code>FONT</code> object that is loaded from the file at location <code>FILENAME</code>, and binds this to the symbol <code>*DEFAULT-FONT*</code>. Although several truetype fonts may used within a single SDL application, only a single <code>FONT</code> may be bound to the symbol <code>*DEFAULT-FONT*</code> at any one time. Generates an <code>ERROR</code> if <code>FREE</code> is <code>NIL</code> and <code>*DEFAULT-FONT*</code> is already bound to a <code>FONT</code> when <code>INITIALISE-DEFAULT-FONT</code> is called. </p><h5>Parameters </h5>
<ul><li><code>FREE</code> when set to <code>T</code> will automatically free any font that is already bound to <code>*DEFAULT-FONT*</code>. </li>
<li><code>FILENAME</code> is the optional file name of the font, as a STRING. Default value is <code>Vera.ttf</code>. </li>
<li><code>SIZE</code> is the <code>INTEGER</code> point size of the new <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns a new <code>FONT</code>, or <code>NIL</code> if unsuccessful. </li>
</ul>
</blockquote>
<!-- End of entry for INITIALISE-DEFAULT-FONT -->
<!-- Entry for INITIALISE-FONT -->
<p><br>[Function]<br><a class=none name='initialise-font'><b>initialise-font</b> <i>filename size</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates a new <code>FONT</code> object of size <code>SIZE</code> loaded from the file at location <code>FILENAME</code>. Automatically initialises the <code>SDL_TTF</code> truetype font library if the library is uninitialised when <code>FONT</code> is loaded. </p><h5>Parameters </h5>
<ul><li><code>FILENAME</code> is the file name of the <code>FONT</code>, of type <code>STRING</code>. </li>
<li><code>SIZE</code> is the <code>INTEGER</code> point size of the new <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns a new <code>FONT</code>, or <code>NIL</code> if unsuccessful. </li>
</ul>
</blockquote>
<!-- End of entry for INITIALISE-FONT -->
<!-- Entry for IS-FONT-FACE-FIXED-WIDTH -->
<p><br>[Function]<br><a class=none name='is-font-face-fixed-width'><b>is-font-face-fixed-width</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Returns <code>T</code> if the font face is of a fixed width, or <code>NIL</code> otherwise. Fixed width fonts are monospace, meaning every character that exists in the font is the same width. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Retuns <code>T</code> if <code>FONT</code> is of fixed width, and <code>NIL</code> otherwise. </li>
</ul>
</blockquote>
<!-- End of entry for IS-FONT-FACE-FIXED-WIDTH -->
<!-- Entry for IS-INIT -->
<p><br>[Function]<br><a class=none name='is-init'><b>is-init</b> <i></i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Queries the initialization status of the <code>SDL_TTF</code> truetype library. Returns <code>T</code> if this library is already initialized and <code>NIL</code> if uninitialized. </p>
</blockquote>
<!-- End of entry for IS-INIT -->
<!-- Entry for NEW-FONT -->
<p><br>[Function]<br><a class=none name='new-font'><b>new-font</b> <i>fp</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates and returns a new <code>FONT</code> object when <code>FP</code> is a pointer to a foreign <code>TTF_Font</code> object. Returns <code>NIL</code> otherwise. </p>
</blockquote>
<!-- End of entry for NEW-FONT -->
<!-- Entry for OPEN-FONT -->
<p><br>[Function]<br><a class=none name='open-font'><b>open-font</b> <i>filename size</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Creates a new <code>FONT</code> from the file loaded at the location specified by <code>FILENAME</code>. NOTE: Does not bind the new <code>FONT</code> to <code>*DEFAULT-FONT*</code>. Does not attempt to initialize the <code>SDL_TTF</code> truetype library if the library is uninitialised. </p><h5>Parameters </h5>
<ul><li><code>FILENAME</code> is the name of the truetype font to be loaded, of type <code>STRING</code></li>
<li><code>SIZE</code> is the size of the <code>FONT</code>, as an <code>INTEGER</code>. </li>
</ul><h5>Returns </h5>
<ul><li>Returns new <code>FONT</code> object if successful, returns <code>NIL</code> if unsuccessful. </li>
</ul>
</blockquote>
<!-- End of entry for OPEN-FONT -->
<!-- Entry for QUIT-TTF -->
<p><br>[Function]<br><a class=none name='quit-ttf'><b>quit-ttf</b> <i></i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Uninitializes the <code>SDL_TTF</code> font library if already initialized. Increments the <code>*generation*</code> count. Returns <code>NIL</code>. </p>
</blockquote>
<!-- End of entry for QUIT-TTF -->
<!-- Entry for RENDER-STRING-BLENDED -->
<p><br>[Function]<br><a class=none name='render-string-blended'><b>render-string-blended</b> <i>text <tt>&amp;key</tt> font color free cache</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Render text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> into a new <code>SURFACE</code>, using the Blended mode. Unless <code>:FREE T</code>, the caller is responsible for freeing the new <code>SURFACE</code>. Use <code>:CACHE T</code> to cache the newly created surface in the <code>FONT</code> object. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
<li><code>COLOR</code> is the color used to render the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FREE</code> when <code>T</code> will free the existing cached <code>SURFACE</code> in <code>FONT</code>. </li>
<li><code>CACHE</code> when <code>T</code> will cache the newly created <code>SURFACE</code> in <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the new surface <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-BLENDED &amp;quot;Hello World!&amp;quot; :FONT *DEFAULT-FONT* :COLOR A-COLOR)
</code></pre>
</blockquote>
<!-- End of entry for RENDER-STRING-BLENDED -->
<!-- Entry for RENDER-STRING-SHADED -->
<p><br>[Function]<br><a class=none name='render-string-shaded'><b>render-string-shaded</b> <i>text fg-color bg-color <tt>&amp;key</tt> font free cache</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Render text <code>TEXT</code> using font <code>FONT</code> with foreground and background colors <code>FG-COLOR</code> and <code>BG-COLOR</code> into a new <code>SURFACE</code>, using the Solid mode. Unless <code>:FREE T</code>, the caller is responsible for freeing the new <code>SURFACE</code>. Use <code>:CACHE T</code> to cache the newly created surface in the <code>FONT</code> object. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>FG-COLOR</code> is the foreground color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>BG-COLOR</code> is the background color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to *<code>DEFAULT-FONT*</code> by default. </li>
<li><code>FREE</code> when <code>T</code> will free the existing cached <code>SURFACE</code> in <code>FONT</code>. </li>
<li><code>CACHE</code> when <code>T</code> will cache the newly created <code>SURFACE</code> in <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the new surface <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Example </h5>
<p>(DRAW-STRING-SHADED &quot;Hello World!&quot; fg-col bg-col :FONT <EM>DEFAULT-FONT</EM> :COLOR A-COLOR) </p>
</blockquote>
<!-- End of entry for RENDER-STRING-SHADED -->
<!-- Entry for RENDER-STRING-SOLID -->
<p><br>[Function]<br><a class=none name='render-string-solid'><b>render-string-solid</b> <i>text <tt>&amp;key</tt> font color free cache</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Render text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> into a new <code>SURFACE</code>, using the Solid mode. Unless <code>:FREE T</code>, the caller is responsible for freeing the new <code>SURFACE</code>. Use <code>:CACHE T</code> to cache the newly created surface in the <code>FONT</code> object. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
<li><code>COLOR</code> is the color used to render the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FREE</code> when <code>T</code> will free the existing cached <code>SURFACE</code> in <code>FONT</code>. </li>
<li><code>CACHE</code> when <code>T</code> will cache the newly created <code>SURFACE</code> in <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the new surface <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Example </h5>
<pre><code> (DRAW-STRING-SOLID &amp;quot;Hello World!&amp;quot; :FONT *DEFAULT-FONT* :COLOR A-COLOR)
</code></pre>
</blockquote>
<!-- End of entry for RENDER-STRING-SOLID -->
<!-- Entry for SET-FONT-STYLE -->
<p><br>[Function]<br><a class=none name='set-font-style'><b>set-font-style</b> <i>style <tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Sets the rendering style <code>STYLE</code> of font <code>FONT</code>. This will flush the internal cache of previously rendered glyphs, even if there is no change in style, so it may be best to check the current style using <a href="#get-font-style">GET-FONT-STYLE</a> first. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. </li>
<li><code>STYLE</code> is a list of one or more: <code>:STYLE-NORMAL</code>, <code>:STYLE-BOLD</code>, <code>:STYLE-ITALIC</code>, <code>:STYLE-UNDERLINE</code>. NOTE: Combining <code>:STYLE-UNDERLINE</code> with anything can cause a segfault, other combinations may also do this. </li>
</ul>
</blockquote>
<!-- End of entry for SET-FONT-STYLE -->
<!-- Entry for WITH-DEFAULT-FONT -->
<p><br>[Macro]<br><a class=none name='with-default-font'><b>with-default-font</b> <i>(font) declaration* statement*</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>Binds <code>FONT</code> to <code>*DEFAULT-FONT*</code> within the scope of <code>WITH-DEFAULT-FONT</code>. </p>
</blockquote>
<!-- End of entry for WITH-DEFAULT-FONT -->
<!-- Entry for WITH-OPEN-FONT -->
<p><br>[Macro]<br><a class=none name='with-open-font'><b>with-open-font</b> <i>(font-name size) declaration* statement*</i> =&gt; <i>result</i></a>
<blockquote><br>
<p>This is a convenience macro that will first attempt to initialize the truetype font library and if successful, will then open the font in the file <code>FONT-NAME</code> prior to evaluating the forms in <code>BODY</code>. Will exit if the library cannot be initialized or the <code>FONT</code> cannot be opened. Closes <code>FONT</code> after the forms in <code>BODY</code> have evaluated. </p><p>Binds <code>FONT</code> to a shadowed instance of <code>*DEFAULT-FONT*</code> valid within the scope of <code>WITH-OPEN-FONT</code>. <code>WITH-OPEN-FONT</code> calls may be nested. </p><h5>Parameters </h5>
<ul><li><code>FONT-NAME</code> is the file name of the truetype font to be opened, of type <code>STRING</code>. </li>
<li><code>SIZE</code> is the <code>INTEGER</code> point size of the font. </li>
</ul>
</blockquote>
<!-- End of entry for WITH-OPEN-FONT -->
<br>&nbsp;<br><h3><a class=none name="ack">Acknowledgements</a></h3>
<ul>
<li>
Documentation prepared using:
</li>
<ul>
<li>
Edi Weitz's
<a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>.
</li>
<li>
Gary King's
<a href="http://common-lisp.net/project/cl-markdown/">CL-MARKDOWN</a>.
</li>
</ul>
</ul>
<p>
<a href="index.html">BACK</a>
</p>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.