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 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659
|
<HTML>
<HEAD>
<!-- Created with AOLpress/2.0 -->
<!-- AP: Created on: 18-Jan-2002 -->
<!-- AP: Last modified: 11-Sep-2009 -->
<TITLE>Writing scripts to change fonts in FontForge</TITLE>
<LINK REL="icon" href="fftype16.png">
<LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css">
</HEAD>
<BODY>
<DIV id="in">
<H1 ALIGN=Center>
Writing scripts to change fonts in FontForge
</H1>
<P>
FontForge includes two interpreters so you can write scripts to modify fonts.
One of these interpreters is <A HREF="python.html">python</A>, one is a legacy
language I came up with. FontForge may be configured with either or both
of these. If configured with both then fontforge will make a guess at which
to use based on the script file's extension ("py" means use the python
interpreter, "ff" or "pe" means use the old interpreter)
<UL>
<LI>
<A HREF="#Starting">Invoking a
script</A><A HREF="scripting-tutorial.html"></A>
<LI>
<A HREF="python.html">Python scripting</A>
<LI>
<A HREF="scripting-tutorial.html">Native Scripting tutorial</A>
<LI>
<A HREF="#Language">Native Scripting language</A>
<UL>
<LI>
<A HREF="#variables">Built in variables</A>
<LI>
<A HREF="#procedures">Built in procedures</A>
<LI>
<A HREF="#Example">Examples</A>
</UL>
<LI>
<A HREF="scripting.html#Execute">The Execute Script dialog</A>
<LI>
<A HREF="#menu">The Scripts menu</A>
</UL>
<H2>
<A NAME="Starting">Invoking scripts</A>
</H2>
<P>
If you start fontforge with a script on the command line it will not put
up any windows and it will exit when the script is done. The script can be
in a file, or just a string presented as an argument. You may need to specify
which interpreter to use with the -lang argument.
<BLOCKQUOTE>
<PRE>$ fontforge -script scriptfile.pe {arguments}
$ fontforge -c "script-string" {arguments}
$ fontforge -lang={ff|py} -c "script-string"
</PRE>
</BLOCKQUOTE>
<P>
FontForge can also be used as an interpreter to which the shell will
automatically pass scripts. If you a mark your script files as executable<BR>
<CODE> $ chmod +x scriptfile.pe</CODE><BR>
and begin each one with the line<BR>
<CODE> #!/usr/local/bin/fontforge</CODE><BR>
(or wherever fontforge happens to reside on your system) then you can invoke
the script just by typing<BR>
<CODE> $ scriptfile.pe {fontnames}</CODE>
<P>
If you wish FontForge to read a script from stdin then you can use "-" as
a "filename" for stdin. (If you build FontForge without X11 then fontforge
will attempt to read a script file from <CODE>stdin</CODE> if none is given
on the command line.)
<P>
You can also start a script from within FontForge with
<CODE>File->Execute Script</CODE>, and you can use the Preference Dlg
to define a set of frequently used scripts which can be invoked directly
by menu.
<P>
The scripting language provides access to much of the functionality found
in the font view's menus. It does not currently (and probably never will)
provide access to everything. (If you find a lack let me know, I may put
it in for you). It does not provide commands for building up a glyph out
of splines, instead it allows you to do high level modifications to glyphs.
<P>
If you set the environment variable <CODE>FONTFORGE_VERBOSE</CODE> (it doesn't
need a value, just needs to be set) then FontForge will print scripts to
stdout as it executes them.
<P>
You may set the environment variable <CODE>FONTFORGE_LANGUAGE</CODE> to either
"py" (for python) or "ff" or "pe" (for native scripting) as another way to
determne what interpreter to use.
<H2>
<A HREF="python.html">Python scripting</A>
</H2>
<P>
<A HREF="python.html">Is described elsewhere.</A>
<H2>
Scripting <A NAME="Language">Language</A>
</H2>
<P>
The syntax is rather like a mixture of C and shell commands. Every file
corresponds to a procedure. As in a shell script arguments passed to the
file are identified as $1, $2, ... $n. $0 is the file name itself. $argc
gives the number of arguments. $argv[<expr>] provides array access
to the arguments.
<P>
Terms can be
<UL>
<LI>
A variable name (like "$1" or "i" or "@fontvar" or "_global")<BR>
The scope of the variable depends on the initial character of its name.
<UL>
<LI>
A '$' signifies that it is a built-in variable. The user cannot create any
new variables beginning with '$'. Some, but not all, of these may be assigned
to.
<LI>
A '_' signifies that the variable is global, it is always available. You
can use these to store context across different script files (or to access
data within nested script files).
<LI>
A '@' signifies that the variable is associated with the font. Any two scripts
looking at the same font will have access to the same variables.
<LI>
A variable which begins with a letter is a local variable. It is only meaningful
within the current script file. Nested script files may have different variables
with the same names.
</UL>
<LI>
an integer expressed in decimal, hex or octal
<LI>
a unicode code point (which has a prefix of "0u" or "0U" and is followed
by a string of hex digits. This is only used by the select command.
<LI>
a real number (in "C" locale format -- "." as the decimal point character)
<LI>
A string which may be enclosed in either double or single quotes. String
tokens are limited to 256 bytes. "\n" can be used to represent a newline
character. (If you need longer strings use the concatenation operator).
<LI>
a procedure to call or file to invoke.
<LI>
an expression within parentheses
<LI>
a series of expressions (separated by commas) within brackets, as <CODE>[1,
2, 3, 5, 8]</CODE>, used to create an array.
</UL>
<P>
There are three different comments supported:
<UL>
<LI>
Starting with a "#" character and proceeding to end of line
<LI>
Starting with "//" and proceeding to end of line
<LI>
Starting with "/*" and proceeding to "*/"
</UL>
<P>
<A NAME="Expressions">Expressions</A> are similar to those in C, a few operators
have been omitted, a few added from shell scripts. Operator precedence has
been simplified slightly. So operators (and their precedences) are:
<UL>
<LI>
unary operators (+, -, !, ~, ++ (prefix and postfix), --(prefix and postfix),
() (procedure call), [] (array index), :h, :t, :r, :e<BR>
Most of these are as expected in C, the last four are borrowed from shell
scripts and are applied to strings
<UL>
<LI>
:h gives the head (directory) of a pathspec
<LI>
:t gives the tail (filename) of a pathspec
<LI>
:r gives the pathspec without the extension (if any)
<LI>
:e gives the extension
</UL>
<LI>
*, /, % (binary multiplicative operators)
<LI>
+, - (binary arithmetic operators)<BR>
If the first operand of + is a string then + will be treated as concatenation
rather than addition. If the second operand is a number it will be converted
to a string (decimal representation) and then concatenated. If the first
operand of + is an array then + will do array concatenation -- if the second
argment is also an array the two will be concatenated ([1,2] + [3,4] yields
[1,2,3,4], while [1,2] + 3 yields [1,2,3]). Otherwise these are the normal
arithmetric operations.
<LI>
==, !=, >, <, >=, <= (comparison operators, may be applied to
either two integers or two strings)
<LI>
&&, & (logical and, bitwise and. (logical and will do short circuit
evaluation))
<LI>
||, |, ^ (logical or, bitwise or, bitwise exclusive or (logical or will do
short circuit evaluation))
<LI>
=, +=, -=, *=, /=, %= (assignment operators as in C. The += will act as
concatenation if the first operand is a string.)
</UL>
<P>
Note there is no comma operator, and no "?:" operator. The precedence of
"and" and "or" has been simplified, as has that of the assignment operators.
<P>
Procedure calls may be applied either to a name token, or to a string. If
the name or string is recognized as one of FontForge's internal procedures
it will be executed, otherwise it will be assumed to be a filename containing
another fontforge script file, this file will be invoked (since filenames
can contain characters not legal in name tokens it is important to allow
general strings to specify filenames). If the procedure name does not contain
a directory then it is assumed to be in the same directory as the current
script file. As a convenience, it is not necessary to include the
script's extension if it is either ".ff" or ".pe". At most 25 arguments can be
passed to a procedure.
<P>
Arrays are passed by reference, strings and integers are passed by value.
<P>
Variables may be created by assigning a value to them (only with the "="),
so:<BR>
<CODE> i=3</CODE><BR>
could be used to define "i" as a variable. Variables are limited in scope
to the current file, they will not be inherited by called procedures.
<P>
A statement may be
<UL>
<LI>
an expression
<LI>
<CODE>if ( expression )<BR>
statements<BR>
{elseif ( expression )<BR>
statements}<BR>
[else<BR>
statements]<BR>
endif</CODE>
<LI>
<CODE>while ( expression )<BR>
statements<BR>
endloop</CODE>
<LI>
<CODE>foreach<BR>
statements<BR>
endloop</CODE>
<LI>
<CODE>break</CODE>
<LI>
<CODE>return [ expression ]</CODE>
<LI>
<CODE>shift</CODE>
</UL>
<P>
As with C, non-zero expressions are defined to be true.<BR>
A return statement may be followed by a return value (the expression) or
a procedure may return nothing (void).<BR>
The shift statement is stolen from shell scripts and shifts all arguments
down by one. (argument 0, the name of the script file, remains unchanged.<BR>
The foreach statement requires that there be a current font. It executes
the statements once for each glyph in the selection. Within the statements
only one glyph at a time will be selected. After execution the selection
will be restored to what it was initially. (Caveat: Don't reencode the font
within a foreach statement).<BR>
Statements are terminated either by a new line (you can break up long lines
with backslash newline) or a semicolon.
<P>
Trivial example:
<BLOCKQUOTE>
<PRE>i=0; #semicolon is not needed here, but it's ok
while ( i<3 )
if ( i==1 /* pointless comment */ )
Print( "Got to one" ) // Another comment
endif
++i
endloop
</PRE>
</BLOCKQUOTE>
<P>
FontForge maintains the concept of a "current font"-- almost all commands
refer only to the current font (and require that there be a font). If you
start a script with File->Execute Script, the font you were editing will
be current, otherwise there will be no initial current font. The Open(),
New() and Close() commands all change the current font. FontForge also maintains
a list of all fonts that are currently open. This list is in no particular
order. The list starts with $firstfont.
<P>
Similarly when working with cid keyed fonts, FontForge works in the "current
sub font", and most commands refer to this font. The CIDChangeSubFont() command
can alter that.
<P>
All builtin <A NAME="variables">variables</A> begin with "$", you may not
create any variables that start with "$" yourself (though you may assign
to (some) already existing ones)
<UL>
<LI>
<CODE>$0 </CODE>the current script filename
<LI>
<CODE>$1 </CODE>the first argument to the script file
<LI>
<CODE>$2 </CODE>the second argument to the script file
<LI>
...
<LI>
<CODE>$argc</CODE> the number of arguments passed to the script file (this
will always be at least 1 as $0 is always present)
<LI>
<CODE>$argv </CODE>allows you to access the array of all the arguments
<LI>
<CODE>$curfont </CODE>the name of the filename in which the current font
resides
<LI>
<CODE>$firstfont </CODE>the name of the filename of the font which is first
on the font list (Can be used by Open()), if there are no fonts loaded this
returns an empty string. This can be used to determine if any font at all
is loaded into fontforge.
<LI>
<CODE>$nextfont </CODE>the name of the filename of the font which follows
the current font on the list (or the empty string if the current font is
the last one on the list)
<LI>
<CODE>$fontchanged</CODE> returns 1 if the current font has changed, 0 if
it has not changed since it was read in (or saved).
<LI>
<CODE>$fontname</CODE> the name contained in the postscript FontName field
<LI>
<CODE>$familyname </CODE>the name contained in the postscript FamilyName
field
<LI>
<CODE>$fullname </CODE>the name contained in the postscript FullName field
<LI>
<CODE>$fondname </CODE>if set this name indicates what FOND the current font
should be put in under Generate Mac Family.
<LI>
<CODE>$weight </CODE>the name contained in the postscript Weight field
<LI>
<CODE>$copyright </CODE>the name contained in the postscript Notice field
<LI>
<CODE>$filename </CODE>the name of the file containing the font.
<LI>
<CODE>$fontversion</CODE> the string containing the font's version
<LI>
<CODE>$iscid </CODE>1 if the current font is a cid keyed font, 0 if not
<LI>
<CODE>$cidfontname </CODE>returns the fontname of the top-level cid-keyed
font (or the empty string if there is none)<BR>
Can be used to detect if this is a cid keyed font.
<LI>
<CODE>$cidfamilyname, $cidfullname, $cidweight, $cidcopyright </CODE>similar
to above
<LI>
<CODE>$mmcount </CODE>returns 0 for non multiple master fonts, returns the
number of instances in a multiple master font.
<LI>
<CODE>$italicangle </CODE>the value of the postscript italic angle field
<LI>
<CODE>$loadState</CODE> a bitmask of non-fatal errors encountered when loading
the font.
<LI>
<CODE>$privateState </CODE>a bitmask of some errors in the PostScript Private
dictionary (see the <A HREF="python.html#Font_privateState">python entry</A>
for more info).
<LI>
<CODE>$curcid </CODE>returns the fontname of the current font
<LI>
<CODE>$firstcid </CODE>returns the fontname of the first font within this
cid font
<LI>
<CODE>$nextcid </CODE>returns the fontname of the next font within this cid
font (or the empty string if the current sub-font is the last)
<LI>
<CODE>$macstyle </CODE>returns the value of the macstyle field (a set of
bits indicating whether the font is bold, italic, condensed, etc.)
<LI>
<CODE>$bitmaps </CODE>returns an array containing all bitmap pixelsizes generated
for this font. (If the font database contains greymaps then they will be
indicated in the array as
<CODE>(<BitmapDepth><<16)|<PixelSize></CODE>)
<LI>
<CODE>$order </CODE>returns an integer containing either 2 (for truetype
fonts) or 3 (for postscript fonts). This indicates whether the font uses
quadratic or cubic splines.
<LI>
<CODE>$em</CODE> returns the number of em-units used by the font.
<LI>
<CODE>$ascent </CODE>returns the ascent of the font
<LI>
<CODE>$descent </CODE>returns the descent of the font.
<LI>
<CODE>$selection</CODE> returns an array containing one entry for each glyph
in the current font indicating whether that glyph is selected or not
(0=>not, 1=>selected)
<LI>
<CODE>$panose</CODE> returns an array containing the 10 panose values for
the font.
<LI>
<CODE>$trace</CODE> if this is set to one then FontForge will trace each
procedure call.
<LI>
<CODE>$version</CODE> returns a string containing the current version of
fontforge. This should look something like "20050817".
<LI>
<CODE>$haspython</CODE> returns 1 if python scripting is available, 0 if
it is not.
<LI>
<CODE>$</CODE><<A NAME="Preference">Preference</A> Item> (for example
<CODE>$AutoHint</CODE>) allows you to examine the value of that preference
item (to set it use
<CODE><A HREF="scripting-alpha.html#SetPref">SetPref</A></CODE>)
</UL>
<P>
The following example will perform an action on all loaded fonts:
<BLOCKQUOTE>
<PRE>file = $firstfont
while ( file != "" )
Open(file)
/* Do Stuff */
file = $nextfont
endloop
</PRE>
</BLOCKQUOTE>
<P>
The built in <A NAME="procedures">procedures</A> are very similar to the
menu items with the same names. Often the description here is sketchy, look
at the menu item for more information.
<UL>
<LI>
<A HREF="scripting-alpha.html">Built-in procedures in alphabetic order</A>
<LI>
<A HREF="#no-font">Built-in procedures that do not require a font</A>
<LI>
<A HREF="#file-menu">File menu</A>
<LI>
<A HREF="#files">File manipulation</A>
<LI>
<A HREF="#edit-menu">Edit menu</A>
<LI>
<A HREF="#select-menu">Select menu</A>
<LI>
<A HREF="#element-menu">Element menu</A>
<LI>
<A HREF="#font-info">Font information</A>
<LI>
<A HREF="#glyph-info">Glyph information</A>
<LI>
<A HREF="#ATT">Advanced Typography</A>
<LI>
<A HREF="#encoding-menu">Encoding menu</A>
<LI>
<A HREF="#hint-menu">Hint menu</A>
<LI>
<A HREF="#metrics-menu">Metrics menu</A>
<LI>
<A HREF="#MM">Multiple master</A>
<LI>
<A HREF="#CID">CID keyed fonts</A>
<LI>
<A HREF="#user">User interaction</A>
<LI>
<A HREF="#prefs">Preferences</A>
<LI>
<A HREF="#math">Math</A>
<LI>
<A HREF="#unicode">Unicode</A>
<LI>
<A HREF="#strings">String manipulation</A>
<LI>
<A HREF="#Character">Character manipulation</A>
<LI>
<A HREF="#arrays">Arrays</A>
<LI>
<A HREF="#misc">Miscellaneous</A>
<LI>
<A HREF="#Deprecated">Deprecated</A> Names
</UL>
<H3 ALIGN=Center>
Built-in procedures in <A NAME="alpha">alphabetic</A> order
</H3>
<P ALIGN=Center>
- <A HREF="scripting-alpha.html#A">A</A> -
<A HREF="scripting-alpha.html#B">B</A> -
<A HREF="scripting-alpha.html#C">C</A> -
<A HREF="scripting-alpha.html#D">D</A> -
<A HREF="scripting-alpha.html#E">E</A> -
<A HREF="scripting-alpha.html#F">F</A> -
<A HREF="scripting-alpha.html#G">G</A> -
<A HREF="scripting-alpha.html#H">H</A> - <A HREF="scripting-alpha.html#I">I
</A>- <A HREF="scripting-alpha.html#J">J </A>-
<A HREF="scripting-alpha.html#K">K</A> -
<A HREF="scripting-alpha.html#L">L</A> -
<A HREF="scripting-alpha.html#M">M</A> -
<A HREF="scripting-alpha.html#N">N</A> -
<A HREF="scripting-alpha.html#O">O</A> -
<A HREF="scripting-alpha.html#P">P</A> -
<A HREF="scripting-alpha.html#Q">Q</A> -
<A HREF="scripting-alpha.html#R">R</A> -
<A HREF="scripting-alpha.html#S">S</A> - <A HREF="scripting-alpha.html#T">T
</A>- <A HREF="scripting-alpha.html#U">U </A>-
<A HREF="scripting-alpha.html#V">V </A>-
<A HREF="scripting-alpha.html#W">W</A> - <A HREF="scripting-alpha.html#X">X
</A>- <A HREF="scripting-alpha.html#Y">Y</A> -
<A HREF="scripting-alpha.html#Z">Z </A>-
<H3 ALIGN=Center>
Built-in procedures that do not require a <A NAME="no-font">loaded font</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#Array">Array(size)</A>
<LI>
<A HREF="scripting-alpha.html#AskUser">AskUser(question[,default-answer])</A>
<LI>
<A HREF="scripting-alpha.html#ATan2">ATan2(val1,val2)</A>
<LI>
<A HREF="scripting-alpha.html#Ceil">Ceil(real)</A>
<LI>
<A HREF="scripting-alpha.html#Chr">Chr(int)</A>
<LI>
<A HREF="scripting-alpha.html#Cos">Cos(val)</A>
<LI>
<A HREF="scripting-alpha.html#Floor">Floor(real)</A>
<LI>
<A HREF="scripting-alpha.html#Error">Error(str)</A>
<LI>
<A HREF="scripting-alpha.html#Exp">Exp(val)</A>
<LI>
<A HREF="scripting-alpha.html#DefaultOtherSubrs">DefaultOtherSubrs()</A>
<LI>
<A HREF="scripting-alpha.html#FileAccess">FileAccess(filename[,prot])</A>
<LI>
<A HREF="scripting-alpha.html#FontsInFile">FontsInFile(filename)</A>
<LI>
<A HREF="scripting-alpha.html#GetEnv">GetEnv(str)</A>
<LI>
<A HREF="scripting-alpha.html#GetPref">GetPref(str)</A>
<LI>
<A HREF="scripting-alpha.html#Int">Int(real)</A>
<LI>
<A HREF="scripting-alpha.html#IsAlNum">IsAlNum(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsAlpha">IsAlpha(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsDigit">IsDigit(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsFinite">IsFinite(real)</A>
<LI>
<A HREF="scripting-alpha.html#IsFraction">IsFraction(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsHexDigit">IsHexDigit(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsLigature">IsLigature(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsLower">IsLower(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsNan">IsNan(real)</A>
<LI>
<A HREF="scripting-alpha.html#IsOtherFraction">IsOtherFraction(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsSpace">IsSpace(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsUpper">IsUpper(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsVulgarFraction">IsVulgarFraction(val)</A>
<LI>
<A HREF="scripting-alpha.html#LoadEncodingFile">LoadEncodingFile(filename,[encname])</A>
<LI>
<A HREF="scripting-alpha.html#LoadNamelist">LoadNamelist(filename)</A>
<LI>
<A HREF="scripting-alpha.html#LoadNamelistDir">LoadNamelistDir([directory-name])</A>
<LI>
<A HREF="scripting-alpha.html#LoadPlugin">LoadPlugin(filename)</A>
<LI>
<A HREF="scripting-alpha.html#LoadPluginDir">LoadPluginDir([directory-name])</A>
<LI>
<A HREF="scripting-alpha.html#LoadPrefs">LoadPrefs()</A>
<LI>
<A HREF="scripting-alpha.html#LoadStringFromFile">LoadStringFromFile("filename")</A>
<LI>
<A HREF="scripting-alpha.html#Log">Log(val)</A>
<LI>
<A HREF="scripting-alpha.html#NameFromUnicode">NameFromUnicode(uni[,namelist])</A>
<LI>
<A HREF="scripting-alpha.html#New">New()</A>
<LI>
<A HREF="scripting-alpha.html#Open">Open(filename[,flags])</A>
<LI>
<A HREF="scripting-alpha.html#Ord">Ord(string[,pos])</A>
<LI>
<A HREF="scripting-alpha.html#PostNotice">PostNotice(str)</A>
<LI>
<A HREF="scripting-alpha.html#Pow">Pow(val1,val2)</A>
<LI>
<A HREF="scripting-alpha.html#PreloadCidmap">PreloadCidmap(filename,registry,ordering,supplement)</A>
<LI>
<A HREF="scripting-alpha.html#Print">Print(arg1,arg2,arg3,...)</A>
<LI>
<A HREF="scripting-alpha.html#Rand">Rand()</A>
<LI>
<A HREF="scripting-alpha.html#ReadOtherSubrsFile">ReadOtherSubrsFile(filename)</A>
<LI>
<A HREF="scripting-alpha.html#Real">Real(int)</A>
<LI>
<A HREF="scripting-alpha.html#Round">Round(real)</A>
<LI>
<A HREF="scripting-alpha.html#SavePrefs">SavePrefs()</A>
<LI>
<A HREF="scripting-alpha.html#SetPref">SetPref(str,val[,val2])</A>
<LI>
<A HREF="scripting-alpha.html#SizeOf">SizeOf(arr)</A>
<LI>
<A HREF="scripting-alpha.html#Sin">Sin(val)</A>
<LI>
<A HREF="scripting-alpha.html#Sqrt">Sqrt(val)</A>
<LI>
<A HREF="scripting-alpha.html#Strcasestr">Strcasestr(haystack,needle)</A>
<LI>
<A HREF="scripting-alpha.html#Strcasecmp">Strcasecmp(str1,str2)</A>
<LI>
<A HREF="scripting-alpha.html#Strftime">Strftime(format[,isgmt[,locale]])</A>
<LI>
<A HREF="scripting-alpha.html#StrJoin">StrJoin(array,delimiter)</A>
<LI>
<A HREF="scripting-alpha.html#Strlen">Strlen(str)</A>
<LI>
<A HREF="scripting-alpha.html#Strrstr">Strrstr(haystack,needle)</A>
<LI>
<A HREF="scripting-alpha.html#Strskipint">Strskipint(str[,base])</A>
<LI>
<A HREF="scripting-alpha.html#StrSplit">StrSplit(str,delimiter[,max-count])</A>
<LI>
<A HREF="scripting-alpha.html#Strstr">Strstr(haystack,needle)</A>
<LI>
<A HREF="scripting-alpha.html#Strsub">Strsub(str,start[,end])</A>
<LI>
<A HREF="scripting-alpha.html#Strtod">Strtod(str)</A>
<LI>
<A HREF="scripting-alpha.html#Strtol">Strtol(str[,base])</A>
<LI>
<A HREF="scripting-alpha.html#Tan">Tan(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToLower">ToLower(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToMirror">ToMirror(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToString">ToString(arg)</A>
<LI>
<A HREF="scripting-alpha.html#ToUpper">ToUpper(val)</A>
<LI>
<A HREF="scripting-alpha.html#TypeOf">TypeOf(any)</A>
<LI>
<A HREF="scripting-alpha.html#UCodePoint">UCodePoint(int)</A>
<LI>
<A HREF="scripting-alpha.html#UnicodeFromName">UnicodeFromName(name)</A>
<LI>
<A HREF="scripting-alpha.html#Ucs4">Ucs4(str)</A>
<LI>
<A HREF="scripting-alpha.html#Utf8">Utf8(int)</A>
<LI>
<A HREF="scripting-alpha.html#WriteStringToFile">WriteStringToFile("string","Filename"[,append])</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="file-menu">File Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#Close">Close()</A>
<LI>
<A HREF="scripting-alpha.html#ControlAfmLigatureOutput"><STRIKE>ControlAfmLigatureOutput(script,lang,ligature-tag-list)</STRIKE></A>
<LI>
<A HREF="scripting-alpha.html#Export">Export(format[,bitmap-size])</A>
<LI>
<A HREF="scripting-alpha.html#FontsInFile">FontsInFile(filename)</A>
<LI>
<A HREF="scripting-alpha.html#Generate">Generate(filename[,bitmaptype[,fmflags[,res[,mult-sfd-file[,namelist-name]]]]])</A>
<LI>
<A HREF="scripting-alpha.html#GenerateFamily">GenerateFamily(filename,bitmaptype,fmflags,array-of-font-filenames)</A>
<LI>
<A HREF="scripting-alpha.html#Import">Import(filename[,toback[,flags]])</A>
<LI>
<A HREF="scripting-alpha.html#MergeKern">MergeKern(filename)</A> deprecated
<LI>
<A HREF="scripting-alpha.html#MergeFeature">MergeFeature(filename)</A>
<LI>
<A HREF="scripting-alpha.html#New">New()</A>
<LI>
<A HREF="scripting-alpha.html#Open">Open(filename[,flags])</A>
<LI>
<A HREF="scripting-alpha.html#PrintFont">PrintFont(type[,pointsize[,sample-text/filename[,output-file]]])</A>
<LI>
<A HREF="scripting-alpha.html#PrintSetup">PrintSetup(type,[printer[,width,height]])</A>
<LI>
<A HREF="scripting-alpha.html#Quit">Quit(status)</A>
<LI>
<A HREF="scripting-alpha.html#Revert">Revert()</A>
<LI>
<A HREF="scripting-alpha.html#RevertToBackup">RevertToBackup()</A>
<LI>
<A HREF="scripting-alpha.html#Save">Save([filename])</A>
</UL>
<H3 ALIGN=Center>
<A NAME="files">File Manipulation</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#FileAccess">FileAccess(filename[,prot])</A>
<LI>
<A HREF="scripting-alpha.html#FontImage">FontImage(filename,array[,width[,height]])</A>
<LI>
<A HREF="scripting-alpha.html#LoadStringFromFile">LoadStringFromFile("filename")</A>
<LI>
<A HREF="scripting-alpha.html#WriteStringToFile">WriteStringToFile("string","Filename"[,append])</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="edit-menu">Edit Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#Clear">Clear</A>
<LI>
<A HREF="scripting-alpha.html#ClearBackground">ClearBackground</A>
<LI>
<A HREF="scripting-alpha.html#Copy">Copy</A>
<LI>
<A HREF="scripting-alpha.html#CopyAnchors">CopyAnchors</A>
<LI>
<A HREF="scripting-alpha.html#CopyFgToBg">CopyFgToBg</A>
<LI>
<A HREF="scripting-alpha.html#CopyGlyphFeatures"><STRIKE>CopyGlyphFeatures(arg,...)</STRIKE></A>
<LI>
<A HREF="scripting-alpha.html#CopyLBearing">CopyLBearing</A>
<LI>
<A HREF="scripting-alpha.html#CopyRBearing">CopyRBearing</A>
<LI>
<A HREF="scripting-alpha.html#CopyReference">CopyReference</A>
<LI>
<A HREF="scripting-alpha.html#CopyUnlinked">CopyUnlinked</A>
<LI>
<A HREF="scripting-alpha.html#CopyVWidth">CopyVWidth</A>
<LI>
<A HREF="scripting-alpha.html#CopyWidth">CopyWidth</A>
<LI>
<A HREF="scripting-alpha.html#Cut">Cut</A>
<LI>
<A HREF="scripting-alpha.html#Join">Join([fudge])</A>
<LI>
<A HREF="scripting-alpha.html#Paste">Paste</A>
<LI>
<A HREF="scripting-alpha.html#Paste">PasteInto</A>
<LI>
<A HREF="scripting-alpha.html#PasteWithOffset">PasteWithOffset(xoff,yoff)</A>
<LI>
<A HREF="scripting-alpha.html#ReplaceWithReference">ReplaceWithReference([fudge])</A>
<LI>
<A HREF="scripting-alpha.html#SameGlyphAs">SameGlyphAs</A>
<LI>
<A HREF="scripting-alpha.html#UnlinkReference">UnlinkReference</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="select-menu">Select Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#Select">Select(arg1, arg2, ...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectAll">SelectAll</A>
<LI>
<A HREF="scripting-alpha.html#SelectAllInstancesOf">SelectAllInstancesOf</A>(name1[,...])
<LI>
<A HREF="scripting-alpha.html#SelectBitmap">SelectBitmap(size)</A>
<LI>
<A HREF="scripting-alpha.html#SelectByATT"><STRIKE>SelectByATT(type,tags,contents,search-type)</STRIKE></A>
<LI>
<A HREF="scripting-alpha.html#SelectByPosSub">SelectByPosSub(lookup-subtable-name,search_type)</A>
<LI>
<A HREF="scripting-alpha.html#SelectChanged">SelectChanged([merge])</A>
<LI>
<A HREF="scripting-alpha.html#SelectFewer">SelectFewer(arg1, arg2, ...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectFewerSingletons">SelectFewerSingletons(arg1,
...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectGlyphsBoth">SelectGlyphsBoth()</A>
<LI>
<A HREF="scripting-alpha.html#SelectGlyphsReferences">SelectGlyphsReferences()</A>
<LI>
<A HREF="scripting-alpha.html#SelectGlyphsSplines">SelectGlyphsSplines()</A>
<LI>
<A HREF="scripting-alpha.html#SelectHintingNeeded">SelectHintingNeeded([merge])</A>
<LI>
<A HREF="scripting-alpha.html#SelectIf">SelectIf(arg1,arg2, ...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectInvert">SelectInvert()</A>
<LI>
<A HREF="scripting-alpha.html#SelectMore">SelectMore(arg1, arg2, ...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectMoreIf">SelectMoreIf(arg1, arg2, ...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectMoreSingletons">SelectMoreSingletons(arg1,
...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectMoreSingletonsIf">SelectMoreSingletonsIf(arg1,
...)</A>
<LI>
<A HREF="scripting-alpha.html#SelectNone">SelectNone()</A>
<LI>
<A HREF="scripting-alpha.html#SelectSingletons">SelectSingletons(arg1, ...)
</A>
<LI>
<A HREF="scripting-alpha.html#SelectSingletonsIf">SelectSingletonsIf(arg1,
...) </A>
<LI>
<A HREF="scripting-alpha.html#SelectWorthOutputting">SelectWorthOutputting()</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="element-menu">Element Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#AddAccent">AddAccent(accent[,pos])</A>
<LI>
<A HREF="scripting-alpha.html#AddExtrema">AddExtrema([all])</A>
<LI>
<A HREF="scripting-alpha.html#ApplySubstitution">ApplySubstitution(script,lang,tag)</A>
<LI>
<A HREF="scripting-alpha.html#AutoTrace">AutoTrace()</A>
<LI>
<A HREF="scripting-alpha.html#BitmapsAvail">BitmapsAvail(sizes[,rasterized])</A>
<LI>
<A HREF="scripting-alpha.html#BitmapsRegen">BitmapsRegen(sizes)</A>
<LI>
<A HREF="scripting-alpha.html#BuildAccented">BuildAccented()</A>
<LI>
<A HREF="scripting-alpha.html#BuildComposite">BuildComposite()</A>
<LI>
<A HREF="scripting-alpha.html#BuildDuplicate">BuildDuplicate()</A>
<LI>
<A HREF="scripting-alpha.html#CanonicalContours">CanonicalContours</A>()
<LI>
<A HREF="scripting-alpha.html#CanonicalStart">CanonicalStart</A>()
<LI>
<A HREF="scripting-alpha.html#ChangeWeight">ChangeWeight</A>(em-units)
<LI>
<A HREF="scripting-alpha.html#CompareFonts">CompareFonts(other-font-filename,output-filename,flags)</A>
<LI>
<A HREF="scripting-alpha.html#CompareGlyphs">CompareGlyphs([pt_err[,spline_err[,pixel_off_frac[,bb_err[,compare_hints[,report_diffs_as_errors]]]]]])</A>
<LI>
<A HREF="scripting-alpha.html#CorrectDirection">CorrectDirection([unlinkrefs])</A>
<LI>
<A HREF="scripting-alpha.html#DefaultRoundToGrid">DefaultRoundToGrid()</A>
<LI>
<A HREF="scripting-alpha.html#DefaultUseMyMetrics">DefaultUseMyMetrics()</A>
<LI>
<A HREF="scripting-alpha.html#ExpandStroke">ExpandStroke(width)</A>
<LI>
<A HREF="scripting-alpha.html#FindIntersections">FindIntersections()</A>
<LI>
<A HREF="scripting-alpha.html#HFlip">HFlip([about-x])</A>
<LI>
<A HREF="scripting-alpha.html#Inline">Inline(width,gap)</A>
<LI>
<A HREF="scripting-alpha.html#InterpolateFonts">InterpolateFonts(percentage,other-font-name[,flags])</A>
<LI>
<A HREF="scripting-alpha.html#Italic">Italic([angle[,[xscale[,flags[,serif[,bearings[,stems[,counters[,lcstems[,lccounters]]]]]]]]]])</A>
<LI>
<A HREF="scripting-alpha.html#MergeFonts">MergeFonts(other-font-name[,flags])</A>
<LI>
<A HREF="scripting-alpha.html#Move">Move(delta-x,delta-y)</A>
<LI>
<A HREF="scripting-alpha.html#MoveReference">MoveReference(delta-x,delta-y,[refname/ref-unicode]+)</A>
<LI>
<A HREF="scripting-alpha.html#NearlyHvCps">NearlyHvCps([error[,err-denom]])</A>
<LI>
<A HREF="scripting-alpha.html#NearlyHvLines">NearlyHvLines([error[,err-denom]])</A>
<LI>
<A HREF="scripting-alpha.html#NearlyLines">NearlyLines(error)</A>
<LI>
<A HREF="scripting-alpha.html#NonLinearTransform">NonLinearTransform(x-expression,y-expression)</A>
<LI>
<A HREF="scripting-alpha.html#Outline">Outline(width)</A>
<LI>
<A HREF="scripting-alpha.html#OverlapIntersect">OverlapIntersect()</A>
<LI>
<A HREF="scripting-alpha.html#PositionReference">PositionReference(x,y,[refname/ref-unicode]+)</A>
<LI>
<A HREF="scripting-alpha.html#RemoveOverlap">RemoveOverlap()</A>
<LI>
<A HREF="scripting-alpha.html#Rotate">Rotate(angle[,ox,oy])</A>
<LI>
<A HREF="scripting-alpha.html#RoundToCluster">RoundToCluster([within[,max]])</A>
<LI>
<A HREF="scripting-alpha.html#RoundToInt">RoundToInt([factor])</A>
<LI>
<A HREF="scripting-alpha.html#Scale">Scale(factor[,yfactor][,ox,oy])</A>
<LI>
<A HREF="scripting-alpha.html#ScaleToEm">ScaleToEm(em-size)</A>
<LI>
<A HREF="scripting-alpha.html#Shadow">Shadow(angle,outline-width,shadow-width)</A>
<LI>
<A HREF="scripting-alpha.html#Simplify">Simplify()</A>
<LI>
<A HREF="scripting-alpha.html#Skew">Skew(angle[,ox,oy])</A>
<LI>
<A HREF="scripting-alpha.html#SmallCaps">SmallCaps([v-scale[,h-scale[,stemw-scale[,stemh-scale]]]])</A>
<LI>
<A HREF="scripting-alpha.html#Transform">Transform(t1,t2,t3,t4,t5,t6)</A>
<LI>
<A HREF="scripting-alpha.html#VFlip">VFlip([about-y])</A>
<LI>
<A HREF="scripting-alpha.html#Wireframe">Wireframe(angle,outline-width,shadow-width)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="font-info">Font Info</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#AddSizeFeature">AddSizeFeature(default-size[,range-bottom,range-top,style-id,array-of-lang-names])</A>
<LI>
<A HREF="scripting-alpha.html#ChangePrivateEntry">ChangePrivateEntry(key,val)</A>
<LI>
<A HREF="scripting-alpha.html#ClearPrivateEntry">ClearPrivateEntry(key)</A>
<LI>
<A HREF="scripting-alpha.html#GetFontBoundingBox">GetFontBoundingBox()</A>
<LI>
<A HREF="scripting-alpha.html#GetMaxpValue">GetMaxpValue(field-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetOS2Value">GetOS2Value(field-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetPrivateEntry">GetPrivateEntry(key)</A>
<LI>
<A HREF="scripting-alpha.html#GetTeXParam">GetTeXParam(index)</A>
<LI>
<A HREF="scripting-alpha.html#GetTTFName">GetTTFName(lang,nameid)</A>
<LI>
<A HREF="scripting-alpha.html#HasPrivateEntry">HasPrivateEntry(key)</A>
<LI>
<A HREF="scripting-alpha.html#ScaleToEm">ScaleToEm(em-size)</A>
<LI>
<A HREF="scripting-alpha.html#SetFondName">SetFondName(fondname)</A>
<LI>
<A HREF="scripting-alpha.html#SetFontHasVerticalMetrics">SetFontHasVerticalMetrics(flag)</A>
<LI>
<A HREF="scripting-alpha.html#SetFontNames">SetFontNames(fontname[,family[,fullname[,weight[,copyright-notice[,fontversion]]]]])</A>
<LI>
<A HREF="scripting-alpha.html#SetFontOrder">SetFontOrder(order)</A>
<LI>
<A HREF="scripting-alpha.html#SetGasp">SetGasp([ppem,flag[,ppem2,flag[,...]]])</A>
<LI>
<A HREF="scripting-alpha.html#SetItalicAngle">SetItalicAngle(angle[,denom])</A>
<LI>
<A HREF="scripting-alpha.html#SetMacStyle">SetMacStyle(val)</A>
<LI>
<A HREF="scripting-alpha.html#SetMaxpValue">SetMaxpValue(field-name,value)</A>
<LI>
<A HREF="scripting-alpha.html#SetOS2Value">SetOS2Value(field-name,field-value)</A>
<LI>
<A HREF="scripting-alpha.html#SetPanose">SetPanose(array)
SetPanose(index,value)</A>
<LI>
<A HREF="scripting-alpha.html#SetTeXParams">SetTeXParams(type,design-size,slant,space,stretch,shrink,xheight,quad,extraspace[...])</A>
<LI>
<A HREF="scripting-alpha.html#SetTTFName">SetTTFName(lang,nameid,utf8-string)</A>
<LI>
<A HREF="scripting-alpha.html#SetUniqueID">SetUniqueID(value)</A>
<LI>
Some items (such as the font name) may be retrieved via built-in variables.
</UL>
<H3 ALIGN=Center>
<A NAME="glyph-info">Glyph Info</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#DrawsSomething">DrawsSomething([arg])</A>
<LI>
<A HREF="scripting-alpha.html#GetPosSub">GetPosSub(lookup-subtable-name)</A>
<LI>
<A HREF="scripting-alpha.html#GlyphInfo">GlyphInfo(str)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphColor">SetGlyphColor(color)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphComment">SetGlyphComment(comment)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphChanged">SetGlyphChanged(flag)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphClass">SetGlyphClass(class-name)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphName">SetGlyphName(name[,set-from-name-flag])</A>
<LI>
<A HREF="scripting-alpha.html#SetUnicodeValue">SetUnicodeValue(uni[,set-from-value-flag])</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphTeX">SetGlyphTeX(height,depth[,subpos,suppos])</A>
<LI>
<A HREF="scripting-alpha.html#WorthOutputting">WorthOutputting([arg])</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that handle <A NAME="ATT">Advanced Typography</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#AddAnchorClass">AddAnchorClass(name,type,script-lang,tag,flags,merge-with)</A>
<LI>
<A HREF="scripting-alpha.html#AddAnchorPoint">AddAnchorPoint(name,type,x,y[,lig-index])</A>
<LI>
<A HREF="scripting-alpha.html#AddLookup">AddLookup(new-lookup-name,type,flags,feature-script-lang-array[,after-lookup-name)</A>
<LI>
<A HREF="scripting-alpha.html#AddLookupSubtable">AddLookupSubtable(lookup-name,new-subtable-name[,after-subtable-name])</A>
<LI>
<A HREF="scripting-alpha.html#AddPosSub">AddPosSub(subtable-name,variant(s))<BR>
AddPosSub(subtable-name,dx,dy,dadv_x,dadv_y)<BR>
AddPosSub(subtable-name,other-glyph-name,dx1,dy1,dadv_x1,dadv_y1,dx2,dy2,dadv_x2,dadv_y2)</A>
<LI>
<A HREF="scripting-alpha.html#AddSizeFeature">AddSizeFeature(default-size[,range-bottom,range-top,style-id,array-of-lang-names])</A>
<LI>
<A HREF="scripting-alpha.html#AddATT"><STRIKE>AddATT(type,script-lang,tag,flags,variant)</STRIKE></A>
<LI>
<A HREF="scripting-alpha.html#ApplySubstitution">ApplySubstitution(script,lang,tag)</A>
<LI>
<A HREF="scripting-alpha.html#CheckForAnchorClass">CheckForAnchorClass(name)</A>
<LI>
<A HREF="scripting-alpha.html#DefaultATT"><STRIKE>DefaultATT(tag)</STRIKE></A>
<LI>
<A HREF="scripting-alpha.html#GetAnchorPoints">GetAnchorPoints</A>
<LI>
<A HREF="scripting-alpha.html#GetLookupInfo">GetLookupInfo(lookup-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetLookups">GetLookups(table-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetLookupSubtable">GetLookupSubtables(lookup-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetLookupOfSubtable">GetLookupOfSubtable(subtable-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetPosSub">GetPosSub(lookup-subtable-name)</A>
<LI>
<A HREF="scripting-alpha.html#GetSubtableOfAnchor">GetSubtableOfAnchor(anchor-class-name)</A>
<LI>
<A HREF="scripting-alpha.html#GenerateFeatureFile">GenerateFeatureFile(filename[,lookup-name])</A>
<LI>
<A HREF="scripting-alpha.html#HasPreservedTable">HasPreservedTable(tag)</A>
<LI>
<A HREF="scripting-alpha.html#LoadTableFromFile">LoadTableFromFile(tag,filename)</A>
<LI>
<A HREF="scripting-alpha.html#LookupStoreLigatureInAfm">LookupStoreLigatureInAfm(lookup-name,store-it)</A>
<LI>
<A HREF="scripting-alpha.html#LookupSetFeatureList">LookupSetFeatureList(lookup-name,feature-script-lang-array)</A>
<LI>
<A HREF="scripting-alpha.html#MergeLookups">MergeLookups(lookup-name1,lookup-name2)</A>
<LI>
<A HREF="scripting-alpha.html#MergeLookupSubtables">MergeLookupSubtables(subtable-name1,subtable-name2)</A>
<LI>
<A HREF="scripting-alpha.html#RemoveATT"><STRIKE>RemoveATT(type,script-lang,tag)</STRIKE></A>
<LI>
<A HREF="scripting-alpha.html#RemoveAnchorClass">RemoveAnchorClass(name)</A>
<LI>
<A HREF="scripting-alpha.html#RemoveLookup">RemoveLookup(lookup-name)</A>
<LI>
<A HREF="scripting-alpha.html#RemoveLookupSubtable">RemoveLookupSubtable(subtable-name)</A>
<LI>
<A HREF="scripting-alpha.html#RemovePosSub">RemovePosSub(subtable-name)</A>
<LI>
<A HREF="scripting-alpha.html#RemovePreservedTable">RemovePreservedTable(tag)</A>
<LI>
<A HREF="scripting-alpha.html#SaveTableToFile">SaveTableToFile(tag,filename)</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="encoding-menu">Encoding Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#CharCnt">CharCnt()</A>
<LI>
<A HREF="scripting-alpha.html#DetachGlyphs">DetachGlyphs</A>
<LI>
<A HREF="scripting-alpha.html#DetachAndRemoveGlyphs">DetachAndRemoveGlyphs</A>
<LI>
<A HREF="scripting-alpha.html#LoadEncodingFile">LoadEncodingFile(filename,[encname])</A>
<LI>
<A HREF="scripting-alpha.html#MultipleEncodingsToReferences">MultipleEncodingsToReferences()</A>
<LI>
<A HREF="scripting-alpha.html#Reencode">Reencode(encoding-name[,force])</A>
<LI>
<A HREF="scripting-alpha.html#RemoveDetachedGlyphs">RemoveDetachedGlyphs</A>()
<LI>
<A HREF="scripting-alpha.html#RenameGlyphs">RenameGlyphs(namelist-name)</A>
<LI>
<A HREF="scripting-alpha.html#SameGlyphAs">SameGlyphAs</A>
<LI>
<A HREF="scripting-alpha.html#SetCharCnt">SetCharCnt(cnt)</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="hint-menu">Hint Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#AddDHint">AddDHint(x1,y1,x2,y2,unit.x,unit.y)</A>
<LI>
<A HREF="scripting-alpha.html#AddHHint">AddHHint(start,width)</A>
<LI>
<A HREF="scripting-alpha.html#AddInstrs">AddInstrs(thingamy,replace,instrs)</A>
<LI>
<A HREF="scripting-alpha.html#AddVHint">AddVHint(start,width)</A>
<LI>
<A HREF="scripting-alpha.html#AutoCounter">AutoCounter()</A>
<LI>
<A HREF="scripting-alpha.html#AutoHint">AutoHint()</A>
<LI>
<A HREF="scripting-alpha.html#AutoInstr">AutoInstr()</A>
<LI>
<A HREF="scripting-alpha.html#ChangePrivateEntry">ChangePrivateEntry(key,val)</A>
<LI>
<A HREF="scripting-alpha.html#ClearGlyphCounterMasks">ClearGlyphCounterMasks()</A>
<LI>
<A HREF="scripting-alpha.html#ClearHints">ClearHints()</A>
<LI>
<A HREF="scripting-alpha.html#ClearInstrs">ClearInstrs()</A>
<LI>
<A HREF="scripting-alpha.html#ClearPrivateEntry">ClearPrivateEntry(key)</A>
<LI>
<A HREF="scripting-alpha.html#ClearTable">ClearTable(tag)</A>
<LI>
<A HREF="scripting-alpha.html#DontAutoHint">DontAutoHint()</A>
<LI>
<A HREF="scripting-alpha.html#FindOrAddCvtIndex">FindOrAddCvtIndex(value[,sign-matters])</A>
<LI>
<A HREF="scripting-alpha.html#GetCvtAt">GetCvtAt(index)</A>
<LI>
<A HREF="scripting-alpha.html#GetPrivateEntry">GetPrivateEntry(key)</A>
<LI>
<A HREF="scripting-alpha.html#HasPrivateEntry">HasPrivateEntry(key)</A>
<LI>
<A HREF="scripting-alpha.html#ReplaceGlyphCounterMasks">ReplaceGlyphCounterMasks(array)</A>
<LI>
<A HREF="scripting-alpha.html#ReplaceCvtAt">ReplaceCvtAt(index,value)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphCounterMask">SetGlyphCounterMask(cg,hint-index,hint-index,...)</A>
<LI>
<A HREF="scripting-alpha.html#SubstitutionPoints">SubstitutionPoints()</A>
</UL>
<H3 ALIGN=Center>
Built-in procedures that act like the <A NAME="metrics-menu">Metrics Menu</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#AutoKern">AutoKern(spacing,threshold,subtable-name[,kernfile])</A>
<LI>
<A HREF="scripting-alpha.html#AutoWidth">AutoWidth(spacing)</A>
<LI>
<A HREF="scripting-alpha.html#CenterInWidth">CenterInWidth()</A>
<LI>
<A HREF="scripting-alpha.html#SetKern">SetKern(ch2,offset[,lookup-subtable])</A>
<LI>
<A HREF="scripting-alpha.html#RemoveAllKerns">RemoveAllKerns()</A>
<LI>
<A HREF="scripting-alpha.html#RemoveAllVKerns">RemoveAllVKerns()</A>
<LI>
<A HREF="scripting-alpha.html#SetLBearing">SetLBearing(lbearing[,relative])</A>
<LI>
<A HREF="scripting-alpha.html#SetRBearing">SetRBearing(rbearing[,relative])</A>
<LI>
<A HREF="scripting-alpha.html#SetVKern">SetVKern(ch2,offset[,lookup-subtable])</A>
<LI>
<A HREF="scripting-alpha.html#SetVWidth">SetVWidth(vertical-width[,relative])</A>
<LI>
<A HREF="scripting-alpha.html#SetWidth">SetWidth(width[,relative])</A>
<LI>
<A HREF="scripting-alpha.html#VKernFromHKern">VKernFromHKern()</A>
</UL>
<H3 ALIGN=Center>
<A NAME="MM">Multiple master routines</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#MMAxisBounds">MMAxisBounds(axis)</A>
<LI>
<A HREF="scripting-alpha.html#MMAxisNames">MMAxisNames()</A>
<LI>
<A HREF="scripting-alpha.html#MMBlendToNewFont">MMBlendToNewFont(weights)</A>
<LI>
<A HREF="scripting-alpha.html#MMChangeInstance">MMChangeInstance(instance)</A>
<LI>
<A HREF="scripting-alpha.html#MMChangeWeight">MMChangeWeight(weights)</A>
<LI>
<A HREF="scripting-alpha.html#MMInstanceNames">MMInstanceNames()</A>
<LI>
<A HREF="scripting-alpha.html#MMWeightedName">MMWeightedName()</A>
</UL>
<H3 ALIGN=Center>
<A NAME="CID">CID routines</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#CIDChangeSubFont">CIDChangeSubFont(new-sub-font-name)</A>
<LI>
<A HREF="scripting-alpha.html#CIDFlatten">CIDFlatten()</A>
<LI>
<A HREF="scripting-alpha.html#CIDFlattenByCMap">CIDFlattenByCMap(cmap-filename)</A>
<LI>
<A HREF="scripting-alpha.html#CIDSetFontNames">CIDSetFontNames(fontname[,family[,fullname[,weight[,copyright-notice]]]])</A>
<LI>
<A HREF="scripting-alpha.html#ConvertToCID">ConvertToCID(registry, ordering,
supplement)</A>
<LI>
<A HREF="scripting-alpha.html#ConvertByCMap">ConvertByCMap(cmapfilename)</A>
<LI>
<A HREF="scripting-alpha.html#PreloadCidmap">PreloadCidmap(filename,registry,ordering,supplement)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="user">User Interaction</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#AskUser">AskUser(question[,default-answer])</A>
<LI>
<A HREF="scripting-alpha.html#Error">Error(str)</A>
<LI>
<A HREF="scripting-alpha.html#PostNotice">PostNotice(str)</A>
<LI>
<A HREF="scripting-alpha.html#Print">Print(arg1,arg2,arg3,...)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="prefs">Preferences</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#DefaultOtherSubrs">DefaultOtherSubrs()</A>
<LI>
<A HREF="scripting-alpha.html#GetPref">GetPref(str)</A>
<LI>
<A HREF="scripting-alpha.html#LoadEncodingFile">LoadEncodingFile(filename,[encname])</A>
<LI>
<A HREF="scripting-alpha.html#LoadNamelist">LoadNamelist(filename)</A>
<LI>
<A HREF="scripting-alpha.html#LoadNamelistDir">LoadNamelistDir([directory-name])</A>
<LI>
<A HREF="scripting-alpha.html#LoadPlugin">LoadPlugin(filename)</A>
<LI>
<A HREF="scripting-alpha.html#LoadPluginDir">LoadPluginDir([directory-name])</A>
<LI>
<A HREF="scripting-alpha.html#LoadPrefs">LoadPrefs()</A>
<LI>
<A HREF="scripting-alpha.html#ReadOtherSubrsFile">ReadOtherSubrsFile(filename)</A>
<LI>
<A HREF="scripting-alpha.html#SavePrefs">SavePrefs()</A>
<LI>
<A HREF="scripting-alpha.html#SetPref">SetPref(str,val[,val2])</A>
<LI>
It it also possible to get the value of a preference item by preceding its
name with a dollar sign.
</UL>
<H3 ALIGN=Center>
<A NAME="math">Math</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#ATan2">ATan2(val1,val2)</A>
<LI>
<A HREF="scripting-alpha.html#Ceil">Ceil(real)</A>
<LI>
<A HREF="scripting-alpha.html#Chr">Chr(int)</A>
<LI>
<A HREF="scripting-alpha.html#Cos">Cos(val)</A>
<LI>
<A HREF="scripting-alpha.html#Exp">Exp(val)</A>
<LI>
<A HREF="scripting-alpha.html#Floor">Floor(real)</A>
<LI>
<A HREF="scripting-alpha.html#Int">Int(real)</A>
<LI>
<A HREF="scripting-alpha.html#IsFinite">IsFinite(real)</A>
<LI>
<A HREF="scripting-alpha.html#IsNan">IsNan(real)</A>
<LI>
<A HREF="scripting-alpha.html#Log">Log(val)</A>
<LI>
<A HREF="scripting-alpha.html#Ord">Ord(string[,pos])</A>
<LI>
<A HREF="scripting-alpha.html#Pow">Pow(val1,val2)</A>
<LI>
<A HREF="scripting-alpha.html#Rand">Rand()</A>
<LI>
<A HREF="scripting-alpha.html#Real">Real(int)</A>
<LI>
<A HREF="scripting-alpha.html#Round">Round(real)</A>
<LI>
<A HREF="scripting-alpha.html#Sin">Sin(val)</A>
<LI>
<A HREF="scripting-alpha.html#Sqrt">Sqrt(val)</A>
<LI>
<A HREF="scripting-alpha.html#Strskipint">Strskipint(str[,base])</A>
<LI>
<A HREF="scripting-alpha.html#Strtod">Strtod(str)</A>
<LI>
<A HREF="scripting-alpha.html#Strtol">Strtol(str[,base])</A>
<LI>
<A HREF="scripting-alpha.html#Tan">Tan(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToString">ToString(arg)</A>
<LI>
<A HREF="scripting-alpha.html#UCodePoint">UCodePoint(int)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="unicode">Unicode</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#NameFromUnicode">NameFromUnicode(uni[,namelist])</A>
<LI>
<A HREF="scripting-alpha.html#UCodePoint">UCodePoint(int)</A>
<LI>
<A HREF="scripting-alpha.html#UnicodeFromName">UnicodeFromName(name)</A>
<LI>
<A HREF="scripting-alpha.html#Ucs4">Ucs4(str)</A>
<LI>
<A HREF="scripting-alpha.html#Utf8">Utf8(int)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="strings">String manipulation</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#Chr">Chr(int)</A>
<LI>
<A HREF="scripting-alpha.html#GetEnv">GetEnv(str)</A>
<LI>
<A HREF="scripting-alpha.html#NameFromUnicode">NameFromUnicode(uni[,namelist])</A>
<LI>
<A HREF="scripting-alpha.html#Ord">Ord(string[,pos])</A>
<LI>
<A HREF="scripting-alpha.html#Strcasecmp">Strcasecmp(str1,str2)</A>
<LI>
<A HREF="scripting-alpha.html#Strcasestr">Strcasestr(haystack,needle)</A>
<LI>
<A HREF="scripting-alpha.html#Strftime">Strftime(format[,isgmt[,locale]])</A>
<LI>
<A HREF="scripting-alpha.html#StrJoin">StrJoin(array,delimiter)</A>
<LI>
<A HREF="scripting-alpha.html#Strlen">Strlen(str)</A>
<LI>
<A HREF="scripting-alpha.html#Strrstr">Strrstr(haystack,needle)</A>
<LI>
<A HREF="scripting-alpha.html#Strskipint">Strskipint(str[,base])</A>
<LI>
<A HREF="scripting-alpha.html#StrSplit">StrSplit(str,delimiter[,max-count])</A>
<LI>
<A HREF="scripting-alpha.html#Strstr">Strstr(haystack,needle)</A>
<LI>
<A HREF="scripting-alpha.html#Strsub">Strsub(str,start[,end])</A>
<LI>
<A HREF="scripting-alpha.html#Strtod">Strtod(str)</A>
<LI>
<A HREF="scripting-alpha.html#Strtol">Strtol(str[,base])</A>
<LI>
<A HREF="scripting-alpha.html#ToString">ToString(arg)</A>
<LI>
<A HREF="scripting-alpha.html#UnicodeFromName">UnicodeFromName(name)</A>
<LI>
<A HREF="scripting-alpha.html#Ucs4">Ucs4(str)</A>
<LI>
<A HREF="scripting-alpha.html#Utf8">Utf8(int)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="Character">Character Manipulation</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#IsAlNum">IsAlNum(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsAlpha">IsAlpha(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsDigit">IsDigit(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsFraction">IsFraction(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsHexDigit">IsHexDigit(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsLower">IsLower(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsLigature">IsLigature(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsOtherFraction">IsOtherFraction(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsSpace">IsSpace(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsUpper">IsUpper(val)</A>
<LI>
<A HREF="scripting-alpha.html#IsVulgarFraction">IsVulgarFraction(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToLower">ToLower(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToMirror">ToMirror(val)</A>
<LI>
<A HREF="scripting-alpha.html#ToUpper">ToUpper(val)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="arrays">Arrays</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#Array">Array(size)</A>
<LI>
<A HREF="scripting-alpha.html#SizeOf">SizeOf(arr)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="misc">Miscellaneous</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#InFont">InFont(arg)</A>
<LI>
<A HREF="scripting-alpha.html#TypeOf">TypeOf(any)</A>
</UL>
<H3 ALIGN=Center>
<A NAME="Deprecated">Deprecated Names</A>
</H3>
<UL>
<LI>
<A HREF="scripting-alpha.html#ClearGlyphCounterMasks">ClearCharCounterMasks()</A>
<LI>
<A HREF="scripting-alpha.html#GlyphInfo">CharInfo(str)</A>
<LI>
<A HREF="scripting-alpha.html#ReplaceGlyphCounterMasks">ReplaceCharCounterMasks(array)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphColor">SetCharColor(color)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphComment">SetCharComment(comment)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphCounterMask">SetCharCounterMask(cg,hint-index,hint-index,...)</A>
<LI>
<A HREF="scripting-alpha.html#SetGlyphName">SetCharName(name[,set-from-name-flag])</A>
</UL>
<P>
<HR>
<H2>
<A NAME="Example">Example</A>s
</H2>
<UL>
<LI>
<A HREF="https://github.com/fontforge/fontforge/tree/master/test">FontForge's
testsuite in the test subdirectory</A> (such as it is)
<LI>
<A HREF="scripts/">Directory of donated scripts</A>
<LI>
Scripts used in other projects
<UL>
<LI>
<A HREF="http://sourceforge.net/projects/x-symbol/">x-symbol</A>
</UL>
<LI>
<A HREF="scripting-tutorial.html">the scripting tutorial</A>
</UL>
<H3>
Example 1:
</H3>
<BLOCKQUOTE>
<PRE>#Set the color of all selected glyphs to be yellow
#designed to be run within an interactive fontforge session.
foreach
SetCharColor(0xffff00)
endloop
</PRE>
</BLOCKQUOTE>
<H3>
Example 2:
</H3>
<BLOCKQUOTE>
<PRE>#!/usr/local/bin/fontforge
#This is the sfddiff script which compares two fonts
if ( Strtol($version) < 20060330 )
Error( "Please upgrade to a more recent version of fontforge" )
endif
flags=0x789
outfile=""
while ( $argc > 1 && Strsub($1,0,1)=="-" )
temp = $1
if ( Strsub(temp,1,2)=='-' )
temp = Strsub(temp,1)
endif
if ( temp=="-ignorehints" )
flags = flags & ~0x8
elseif ( temp=="-ignorenames" )
flags = flags & ~0x100
elseif ( temp=="-ignoregpos" )
flags = flags & ~0x200
elseif ( temp=="-ignoregsub" )
flags = flags & ~0x400
elseif ( temp=="-ignorebitmaps" )
flags = flags & ~0x80
elseif ( temp=="-exact" )
flags = flags | 0x2
elseif ( temp=="-warn" )
flags = flags | 0x44
elseif ( temp=="-merge" )
flags = flags | 0x1800
shift
outfile = $1
elseif ( temp=="-help" )
Print( "sfddiff: [--version] [--help] [--usage] [--ignorehints] [--ignorenames] [--ignoregpos] [--ignoregsup] [--ignorebitmaps] [--warn] [--exact] fontfile1 fontfile2" )
Print( " Compares two fontfiles" )
Print( " --ignorehints: Do not compare postscript hints or truetype instructions" )
Print( " --ignorenames: Do not compare font names" )
Print( " --ignoregpos: Do not compare kerning, etc." )
Print( " --ignoregsub: Do not compare ligatures, etc." )
Print( " --ignorebitmaps: Do not compare bitmap strikes" )
Print( " --exact: Normally sfddiff will match contours which are not exact" )
Print( " but where the differences are slight (so you could compare" )
Print( " truetype and postscript and get reasonable answers). Also" )
Print( " normally sfddiff will unlink references before it compares" )
Print( " (so you can compare a postscript font (with no references)" )
Print( " to the original source (which does have references)). Setting")
Print( " this flag means glyphs must match exactly.")
Print( " --warn: Provides a warning when an exact match is not found" )
Print( " --merge outfile: Put any outline differences in the backgrounds of" )
Print( " appropriate glyphs" )
return(0)
elseif ( temp=="-version" )
Print( "Version 1.0" )
return(0)
else
break
endif
shift
endloop
if ( $argc!=3 || $1=="--usage" || $1=="-usage" )
Print( "sfddiff: [--version] [--help] [--usage] [--ignorehints] [--ignorenames] [--ignoregpos] [--ignoregsup] [--ignorebitmaps] [--warn] [--exact] [--merge outfile] fontfile1 fontfile2" )
return(0)
endif
Open($2)
Open($1)
CompareFonts($2,"-",flags)
if ( outfile!="" )
Save(outfile)
endif
</PRE>
</BLOCKQUOTE>
<H3>
Example 3:
</H3>
<BLOCKQUOTE>
<PRE>#!/usr/local/bin/fontforge
#Take a Latin font and apply some simple transformations to it
#prior to adding cyrillic letters.
#can be run in a non-interactive fontforge session.
Open($1);
Reencode("KOI8-R");
Select(0xa0,0xff);
//Copy those things which look just like latin
BuildComposit();
BuildAccented();
//Handle Ya which looks like a backwards "R"
Select("R");
Copy();
Select("afii10049");
Paste();
HFlip();
CorrectDirection();
Copy();
Select(0u044f);
Paste();
CopyFgToBg();
Clear();
//Gamma looks like an upside-down L
Select("L");
Copy();
Select(0u0413);
Paste();
VFlip();
CorrectDirection();
Copy();
Select(0u0433);
Paste();
CopyFgToBg();
Clear();
//Prepare for editing small caps K, etc.
Select("K");
Copy();
Select(0u043a);
Paste();
CopyFgToBg();
Clear();
Select("H");
Copy();
Select(0u043d);
Paste();
CopyFgToBg();
Clear();
Select("T");
Copy();
Select(0u0442);
Paste();
CopyFgToBg();
Clear();
Select("B");
Copy();
Select(0u0432);
Paste();
CopyFgToBg();
Clear();
Select("M");
Copy();
Select(0u043C);
Paste();
CopyFgToBg();
Clear();
Save($1:r+"-koi8-r.sfd");
Quit(0);
</PRE>
</BLOCKQUOTE>
<H2>
The <A NAME="Execute">Execute</A> Script dialog
</H2>
<P>
This dialog allows you to type a script directly in to FontForge and then
run it. Of course the most common case is that you'll have a script file
somewhere that you want to execute, so there's a button [Call] down at the
bottom of the dlg. Pressing [Call] will bring up a file picker dlg looking
for files with the extension *.pe (you can change that by typing a wildcard
sequence and pressing the [Filter] button). After you have selected your
script the appropriate text to text to invoke it will be placed in the text
area.
<P>
The current font of the script will be set to whatever font you invoked it
from (in python this is <CODE>fontforge.activeFontInUI()</CODE>).
<P>
Note that if you try to print from a script the output will go to stdout.
If you have invoked fontforge from a window manager's menu stdout will often
be bound to /dev/null and not useful. Try starting fontforge from the command
line instead.
<H2>
The Scripts <A NAME="menu">Menu</A>
</H2>
<P>
You can use the preference dialog to create a list of frequently used scripts.
Invoke <A HREF="prefs.html#scripts">File->Preferences</A> and select the
Scripts tag. In this dialog are ten possible entries, each one should have
a name (to be displayed in the menu) and an associated script file to be
run.
<P>
After you have set up your preferences you can invoke scripts from the font
view, either directly from the menu (File->Scripts-><your name>)
or by a hot key. The first script you added will be invoked by Cnt-Alt-1,
then second by Cnt-Alt-2, and the tenth by Cnt-Alt-0.
<P>
The current font of the script will be set to whatever font you invoked it
from.
<P>
<P ALIGN=Center>
-- <A HREF="HotKeys.html">Prev</A> -- <A HREF="overview.html">TOC</A> --
<A HREF="PfaEdit-TeX.html">Next</A> --
</DIV>
</BODY></HTML>
|