/usr/share/doc/xgridfit/html/moves.html is in xgridfit-doc 2.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Xgridfit</title>
<link rel="stylesheet" href="oeg.css" media="screen" type="text/css" />
<link rel="stylesheet" href="parchment.css" media="screen"
type="text/css" title="parchment" />
<link rel="alternate stylesheet" href="legible.css" media="screen"
type="text/css" title="legible" />
<style type="text/css" media="print"> @import "oeg.print.css"; </style>
<meta name="AUTHOR" content="Peter S. Baker" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div id="jumplist">
<a href="http://sourceforge.net"><img src="" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a>
<a href="http://xgridfit.sourceforge.net/">Home Page</a>
<a href="http://sourceforge.net/projects/xgridfit">Project Page</a>
<a href="http://sourceforge.net/project/showfiles.php?group_id=159705">Download</a>
<a href="http://xgridfit.cvs.sourceforge.net/xgridfit/xgridfit/">CVS repository</a>
<hr/>
<a href="#move"><move></a>
<a href="#diagonal-stem"><diagonal-stem></a>
<a href="#interpolate"><interpolate></a>
<a href="#interpolate-untouched-points"><interpolate-untouched-points></a>
<a href="#untouch"><untouch></a>
<a href="#align"><align></a>
<a href="#align-midway"><align-midway></a>
<a href="#shift"><shift></a>
<a href="#shift-absolute"><shift-absolute></a>
<a href="#move-point-to-intersection"><move-point-to-intersection></a>
<a href="#set-coordinate"><set-coordinate></a>
<a href="#flip-on"><flip-off></a>
<a href="#flip-on"><flip-on></a>
<a href="#toggle-points"><toggle-points></a>
<a href="#mirp"><mirp></a>
<a href="#mdrp"><mdrp></a>
<a href="#miap"><miap></a>
<a href="#mdap"><mdap></a>
</div>
<div id="content">
<h1>Instructions that Move Points</h1>
<p>
The most important Xgridfit instruction is <move>. This
may move a point to an absolute position on the raster grid, to
the nearest gridline (or rounded position), or to a position
relative to another point. <move> does the work of the
TrueType MIRP, MDRP, MSIRP, MIAP, MDAP and SCFS
instructions. (Xgridfit provides equivalents of most of these
primitive instructions, but their use is not recommended except
in special circumstances.)
</p>
<p>
Other commonly used instructions are <shift>,
<align> and <interpolate>. These are generally
subordinate to <move>: that is, after <move> has
moved a point, these instructions are used to shift other
points along with it (<shift>), align other points with
it (<align>), or reposition some points so that they are
properly located between it and another moved point
(<interpolate>). Another instruction, <delta>,
which moves a point an absolute distance at a specific size, is
discussed in <a href="deltas.html">its own section</a>.
</p>
<p>
Some of the following instructions should be avoided in favor
of higher level instructions but are here in case they're
needed, or in case the programmer wants to produce more
efficient code. Such instructions have cryptic names (e.g.
<mirp>) that echo the mnemonics for TrueType
instructions. Those that are suitable for frequent use have
clearer, fuller names (e.g. <shift>).
</p>
<h3 id="move"><move></h3>
<p>
Moves a point and, optionally, aligns other points with it or
moves other points in relation to it.
</p>
<p>
The only required item is a point to move. Xgridfit moves this
point differently depending on the presence or absence of a
reference point (explicit or, in the case of a <move>
nested within a <move>, implicit) and the "distance" or
"pixel-distance" attribute:
</p>
<dl>
<dt>no reference point or distance attribute</dt>
<dd>
The point is moved to a position on the grid determined by
the current position of the point and the round state: for
example, if the round state is "to-grid," the point is moved
to the nearest grid line. If rounding is off, the point is
not moved, but "touched" as if it had been moved. In this
example, the point "bottom" is moved to the nearest position
halfway between two grid lines:
<pre>
<move round="to-half-grid">
<point num="bottom"/>
</move>
</pre>
</dd>
<dt>reference point but no distance attribute</dt>
<dd>
The point is moved so that its original distance from the
reference point is maintained. The distance is rounded in
accordance with the current round state. Here the original
distance between "bottom" and "top" is rounded (presumably
"to-grid"), and "top" is moved until it is that distance from
"bottom":
<pre>
<move>
<reference>
<point num="bottom"/>
</reference>
<point num="top"/>
</move>
</pre>
</dd>
<dt>reference point and distance attribute</dt>
<dd>
"Distance" is a value from a <control-value> element;
the point is positioned this distance from the reference
point. The distance is rounded in accordance with the current
round state. Here the <control-value> "lc-height" is
rounded and "top" is moved until it is that distance from
"bottom":
<pre>
<move distance="lc-height">
<reference>
<point num="bottom"/>
</reference>
<point num="top"/>
</move>
</pre>
</dd>
<dt>distance attribute but no reference point</dt>
<dd>
"Distance" is a value from a <control-value>
element; the point is positioned this distance from the grid
origin. The distance is rounded in accordance with the
current round state. Here the <control-value>
"lc-height" is rounded and "top" is moved until it is that
distance from the grid origin. If the freedom and projection
vectors are set to the <tt>y</tt> axis, the distance is
measured from the baseline:
<pre>
<move distance="lc-height">
<point num="top"/>
</move>
</pre>
</dd>
<dt>reference point and pixel-distance attribute</dt>
<dd>
"Pixel-distance" is a distance in pixels (e.g. "2p" or "2.0"
or "round(control-value(lc-height) * 0.8)"). The point is
positioned this distance from the reference point:
<pre>
<move pixel-distance="2p">
<reference>
<point num="left"/>
</reference>
<point num="right"/>
</move>
</pre>
</dd>
<dt>pixel-distance attribute but no reference point</dt>
<dd>
The point is positioned the specified distance from the grid
origin:
<pre>
<move pixel-distance="2p">
<point num="right"/>
</move>
</pre>
</dd>
</dl>
<p>
A top-level <move>--one that is not a child of another
<move> element--always leaves the RP0 reference pointer
set to the point just moved. When another <move> follows,
with a reference point that matches the point just moved,
Xgridfit optimizes the output, "chaining" the instructions
generated by <move>. Here is a series of chained
<move> elements:
</p>
<pre>
<move distance="std-stem-left-side" min-distance="no">
<reference>
<point num="left-sidebearing"/>
</reference>
<point num="stem-left"/>
</move>
<move distance="lc-vert-stem">
<reference>
<point num="stem-left"/>
</reference>
<point num="stem-right-a"/>
</move>
<move min-distance="no">
<reference>
<point num="stem-right-a"/>
</reference>
<point num="stem-right-b"/>
</move>
</pre>
<p>
A number of subordinate moves may be packaged inside a
<move> element. This is done by including
<interpolate>, <align>, <shift>,
<delta> and other <move> instructions after the
<point> element. The parent <move> element supplies
the reference point or points for those child elements that
take reference points (<delta> does not); in such child
elements the <reference> element should be omitted, the
reference point(s) being implicit. Here are further notes on
the behavior of nested elements:
</p>
<ul>
<li>
The points and ranges in an <align> element are aligned
with the point moved by the <move> instruction.
</li>
<li>
You may include <interpolate> instructions if the
<move> instruction contains either an explicit or an
implicit reference point. The points and ranges in the
<interpolate> instructions are interpolated between the
reference point and the moved point.
</li>
<li>
The points, ranges and contours in a <shift> element
are shifted relative to the point moved by the <move>
instruction.
</li>
<li>
The point in a <move> element is moved relative to the
point moved by the parent <move> instruction. Unlike a
top-level <move>, a nested <move> does not leave
RP0 set to its <point>; rather, RP0 always continues to
point to the <point> in the parent <move>.
</li>
<li>
You may include <delta> elements both before and after
nested <align>, <interpolate>, <shift> and
<move> elements. Deltas positioned before those
elements are executed immediately after the <point>
belonging to the parent <move> is moved, but before
other nested elements are executed. Normally these deltas are
used to make fine adjustments to the position of the point
just moved; if you omit the <point> element in a
<delta-set> here, the <point> belonging to the
parent <move> is assumed. The <delta> elements
that come after other nested elements are executed after all
those elements have been executed: use these to make fine
adjustments in the positions of the points moved by those
other instructions.
</li>
</ul>
<p>
You should use this nesting or packaging feature to build
programming structures around the visible structures of the
glyph. The payoffs for doing so are more compact and legible
program code and more compact and efficient output. As an
example, here are the horizontal instructions for a letter
<b>n</b>:
</p>
<pre>
<move distance="fhijklmnt-left-side">
<reference>
<point num="left-sidebearing"/>
</reference>
<point num="left-left"/>
<move distance="top-serif-x-width">
<point num="top-serif-end"/>
</move>
<move distance="lc-serif-width">
<point num="left-serif-left-end"/>
</move>
<move distance="lc-vert-stroke">
<point num="left-right-a"/>
<align>
<point num="left-right-b"/>
</align>
<move distance="lc-serif-width">
<point num="left-serif-right-end"/>
</move>
</move>
</move>
<move distance="hnu-width">
<reference>
<point num="left-left"/>
</reference>
<point num="right-right"/>
<delta>
<delta-set size="4" distance="-8"/>
</delta>
<move distance="lc-serif-width">
<point num="right-serif-right-end"/>
</move>
<move distance="lc-vert-stroke">
<point num="right-left"/>
<move distance="lc-serif-width">
<point num="right-serif-left-end"/>
</move>
</move>
</move>
</pre>
<p>
The first <move> block relates to the left "leg" of the
<b>n</b>. First the point <tt>left-left</tt> is positioned
relative to the <tt>left-sidebearing</tt> point; then the
points that define the left ends of the serifs are positioned
relative to <tt>left-left</tt>. Then <tt>left-right-a</tt> is
positioned relative to <tt>left-left</tt>,
<tt>left-right-b</tt> is aligned with <tt>left-right-a</tt>,
and the right end of the left serif is positioned relative to
<tt>left-right-a</tt>. The second <move> block works in a
similar way, each element nested inside a <move> taking
that element's <point> as a reference point. Note that
the <delta> in this element moves the point
<tt>right-right</tt>.
</p>
<img src="n-hroz.png" alt="instructions for the letter n"/>
<p>
The figure above illustrates this code graphically, the
thick lines showing the relationship among the reference points
and moved points of the top-level <move> elements, and
the thin lines showing the subordinate moves.
</p>
<p>
Remember that <move> elements are not "chained" inside
other <move> elements as top-level <move> elements
are. Rather, after a nested <move> RP0 always points to
the <point> moved by the parent <move>. One might
say that chaining inside the <move> is vertical, from
parent to child, while otherwise is it horizontal, from sibling
to sibling.
</p>
<p>
Elements nested inside a <move> must come in the
following order:
</p>
<ul>
<li><delta></li>
<li><align>,
<interpolate>,
<shift> (in any order),</li>
<li><move></li>
<li><delta></li>
</ul>
<p>
You may include more than one of each of these nested
elements. Note that the order of <align>,
<interpolate> and <shift> is not significant:
Xgridfit sets the order in which these elements are
executed. Normally this should not be a problem, as it would be
very odd if the content of these elements were to overlap.
</p>
<p>
The <compile-if> element is not permitted in a
<move>, but nested elements may be compiled conditionally
with the <tt>compile-if</tt> attribute. For example, one set of
deltas can be compiled if a font is bold and another if it is
not bold (a "bold" constant, either true (1) or false (0) being
defined in the top level of your program):
</p>
<pre>
<move>
<point num="p"/>
<delta compile-if="bold"/>
<delta-set size="5" distance="2"/>
</delta>
<delta compile-if="not(bold)"/>
<delta-set size="3" distance="-1"/>
</delta>
</delta>
˙ </pre>
<p>
Bypassing the Control Value Table by using the pixel-distance
attribute is usually unnecessary. Yet this attribute may
occasionally be useful. For example, here is a function that
guarantees at least one pixel of space between a character and
the diacritic above it:
</p>
<pre>
<function id="ensure-diacritic-gap">
<param name="char-top"/>
<param name="diacritic-bottom"/>
<param name="diacritic-contour"/>
<variable id="d"/>
<with-vectors axis="y">
<measure-distance result-to="d">
<point num="char-top"/>
<point num="diacritic-bottom"/>
</measure-distance>
<if test="d &lt; 1p">
<move pixel-distance="1p" round="no">
<reference>
<point num="char-top">
</reference>
<point num="diacritic-bottom"/>
<shift>
<contour num="diacritic-contour"/>
</shift>
</move>
</if>
</with-vectors>
</function>
</pre>
<h4>Attributes</h4>
<dl>
<dt>distance</dt>
<dd>
A value from a <control-value> element. If
a <tt>distance</tt> is specified, the target point is positioned
that distance either from the reference point or from the grid
origin. If a <tt>distance</tt> is not specified, the distance from
the original outline is used. In either case,
the <tt>distance</tt> is measured along the projection
vector.
</dd>
<dt>pixel-distance</dt>
<dd>
A distance in pixels. If a <tt>pixel-distance</tt> is specified,
the target point is positioned that distance either from the
reference point or from the grid origin. The <tt>distance</tt> and
<tt>pixel-distance</tt> attributes are not compatible.
If a <tt>distance</tt> attribute is present, the
<tt>pixel-distance</tt> attribute is not consulted.
</dd>
<dt>round</dt>
<dd>
Whether and how to round the <tt>distance</tt> or
<tt>pixel-distance</tt>. The default value is <tt>yes</tt>, which
means to round it according to the current setting (to the grid,
if you haven't changed it). If you specify
<tt>no</tt>, no rounding will be done. To use one of the standard
round states, use <tt>to-grid, to-half-grid, to-double-grid,
down-to-grid</tt> or <tt>up-to-grid</tt>. To use a custom round
state, use its name. Finally, any
number (constant, variable) is passed to SROUND for the TrueType
engine to interpret. Setting the round state with this attribute
has no effect except in this instruction: the round state returns
to its former value after the instruction is executed. If several
<move> instructions use the same round state, it is more
efficient to enclose them in a <with-round-state> element
than to include a <tt>round</tt> attribute with each one. That is
also true if the <tt>round</tt> value is to be <tt>no</tt>: in
that case use <tt><with-round-state round="no"></tt> and
omit the <tt>round</tt> attribute for the <move>
instructions.
</dd>
<dt>cut-in</dt>
<dd>
Whether to use the Control Value cut-in; or a cut-in value to
use. Legal values are <tt>yes</tt>, <tt>no</tt> or any number; the
default value is <tt>yes</tt>. If the value of this attribute
is <tt>no</tt>, the value of the <tt>round</tt> attribute must
also be <tt>no</tt>. (This is a peculiarity of the TrueType
instruction set and has nothing to do with Xgridfit.) This
attribute has an effect only when the <tt>distance</tt> attribute
is present.
</dd>
<dt>min-distance</dt>
<dd>
Whether to maintain a minimum distance between the reference point
and the target point; or the minimum distance to use: legal values
are <tt>yes</tt> (the default), <tt>no</tt>, or any number. This
attribute has an effect only when there is a reference point.
</dd>
<dt>color</dt>
<dd>
Distance type: <tt>black</tt>, <tt>white</tt> or
<tt>gray</tt> (the default). This applies only when there is a
reference point.
</dd>
<dt>compile-if</dt>
<dd>
The <move> instruction and all its contents are compiled
only if the expression in the <tt>compile-if</tt> attribute
evaluates as true (non-zero). The instruction is also compiled if
this attribute is omitted.
</dd>
</dl>
<h3 id="diagonal-stem"><diagonal-stem></h3>
<p>
Given two lines (making up a diagonal stem), makes the second line
parallel to the first, subject to the operation of the Control Value
cut-in. If one <align> element is present, the points it
contains are aligned with the second line; if there are two, the
first set of points is aligned with the first line and the second
set with the second line. You may, and often should, set a new
minimum distance value with the <tt>min-amount</tt> attribute. At
the end of this instruction the minimum distance will be reset to
its former value.
</p>
<p>
Usually it doesn't make a lot of sense to round the distance when
calling this instruction; and yet the default value of
<tt>round</tt> is <tt>yes</tt> for compatibility with other, similar
instructions. You'll probably want to set the <tt>round</tt>
attribute to <tt>no</tt>; but if you have several
<diagonal-stem> instructions together, enclose them in a
<tt><with-round-state round="no"></tt> element to turn off
rounding beforehand and on again afterwards. In this case, do not
include the <tt>round</tt> attribute with the <diagonal-stem>
elements.
</p>
<p>
By default this instruction does not set the Freedom Vector, since
the best setting of that vector varies with circumstances. If you
want the Freedom Vector to be the same as the Projection Vector, set
<tt>freedom-vector="yes"</tt>.
</p>
<p>
This instruction is not suitable for use inside a function (though
you may do so if the <line> elements contain points rather
than <tt>ref</tt> attributes). Also, I'm not sure whether it will
work if the various points are in different zones. It may, but I
don't guarantee it.
</p>
<p>
Example:
</p>
<pre>
<diagonal-stem min-distance="yes" distance="cap-thin-diag" round="no">
<line ref="left-left-line"/>
<line ref="left-right-line"/>
<align>
<point num="left-right-b"/>
<point num="left-right-c"/>
</align>
</diagonal-stem>
</pre>
<h4>Attributes</h4>
<dl>
<dt>distance</dt>
<dd>A value from a <control-value> element: this
controls the width of the diagonal stem.
</dd>
<dt>round</dt>
<dd>Whether and how to round the distance the point is to
be moved. The default value is <tt>yes</tt>, which means to
round it according to the current setting (to the grid,
if you haven't changed it). If you specify <tt>no</tt>, no
rounding will be done. The other values specify
one of the standard kinds of rounding or a custom round-state.
Setting the
round state with this attribute has no effect except
in this instruction: the round state returns to its
former value after the instruction is executed. If
several <diagonal-stem> instructions use the same round
state, it is more efficient to call <set-round-state>
before and after that group than to include a <tt>round</tt>
attribute with each one. That is also true if the
<tt>round</tt> value is to be <tt>no</tt>: in that case call
<tt><set-round-state round-state="no"/></tt> before and omit
the <tt>round</tt> attribute for the <diagonal-stem> instructions.</dd>
<dt>cut-in</dt>
<dd>Whether to use the Control Value cut-in. Legal values
are <tt>yes</tt> and <tt>no</tt>; the default is <tt>yes</tt>. If the
value of this attribute is <tt>no</tt>, the value of the
<tt>round</tt> attribute must also be <tt>no</tt>. (This is a
peculiarity of the TrueType instruction set and has
nothing to do with Xgridfit.) This attribute has an
effect only when a distance is specified.</dd>
<dt>min-distance</dt>
<dd>Whether to maintain a minimum distance between the
points in the first line and the points in the second:
legal values are <tt>yes</tt> (the default) and
<tt>no</tt>.</dd>
<dt>min-amount</dt>
<dd>The value of the minimum-distance setting in pixels. The
default value of this setting (1p) is more often than
not appropriate for vertical and horizontal stems, but
usually needs to be changed for diagonal stems to look
their best. This attribute applies only to the present
instruction. The minimum-distance setting resumes its former
value after this instruction.</dd>
<dt>color</dt>
<dd>Distance type: <tt>black</tt>, <tt>white</tt> or
<tt>gray</tt> (the default).</dd>
<dt>freedom-vector</dt>
<dd>Set this to <tt>yes</tt> if you want the Freedom Vector
to be the same as the
Projection Vector. The default is <tt>no</tt>.</dd>
<dt>save-vectors</dt>
<dd>If <tt>yes</tt>, both the Projection Vector and the Freedom Vector
are guaranteed to be the same after this intruction as they
were before. The default is <tt>no</tt>.</dd>
</dl>
<h3 id="interpolate"><interpolate></h3>
<p>
To "interpolate" a point is to move it so that its
position relative to two reference points is what it was in
the original outline. If the distance between the two
reference points is not what it was in the original
outline, the point is positioned so that its
relationship to the reference points is proportionally
correct.</p>
<p>The <interpolate> element must contain at
least one point to interpolate.
It may contain any number of <point>s and <range>s.
Like most other elements that move points, it may contain a
<reference> element; but this element must contain
two <point>s, not just one.</p>
<p>
This instruction may be nested inside a <move> element
containing a reference point, or inside a <move> nested in
another <move>, and so having an implicit reference point. In
an <interpolate> element so placed reference points are
needed; the points it contains are automatically interpolated
between the <move> element's explicit or implicit reference
point and its moved point.
</p>
<p>
Example:
</p>
<pre>
<interpolate>
<reference>
<point num="top"/>
<point num="bottom"/>
</reference>
<point num="bar-top-left"/>
</interpolate>
</pre>
<h4>Attributes</h4>
<dl>
<dt>compile-if</dt>
<dd>
The <interpolate> instruction is compiled only if the
expression in the compile-if attribute evaluates as true
(non-zero). The instruction is also compiled if this attribute is
omitted.
</dd>
<dt>round</dt>
<dd>
If this attribute is included with any value other than "no," all
points referenced by <point> elements will be aligned to the
grid after being interpolated. Points referenced by <range>
and <set> elements are unaffected. The possible values of
<tt>round</tt> are the same as those for <a
href="reference.html#set-round-state"><set-round-state> and
<with-round-state></a>. Note that the value "yes" will use
the current round state; so it is usually not necessary to specify
a round state here.
</dd>
</dl>
<h3 id="interpolate-untouched-points"><interpolate-untouched-points></h3>
<p>Interpolates all points that have not been moved or
"touched" by instructions so that they are positioned
correctly relative to points that have been moved.
Most of the time you will want to place this
instruction at the end of the program for each
glyph.</p>
<h4>Attribute</h4>
<dl>
<dt>axis</dt>
<dd>Interpolation always takes place along the
x or the y axis. If you omit this attribute,
interpolation takes place along both axes.</dd>
</dl>
<h3 id="untouch"><untouch></h3>
<p>A point that has been moved is "touched." This
untouches it so that it will be affected by
the <interpolate-untouched-points> instruction.</p>
<h3 id="align"><align></h3>
<p>
Moves one or more points along the freedom vector until aligned with
a reference point. Points are "aligned" when their distance from
each other, measured along the projection vector, is zero. When the
projection vector is "x," aligned points end up stacked vertically;
when it is "y" they end up in a horizontal line. When the projection
vector is set to a line, the aligned points end up arrayed along an
imaginary line orthogonal to the projection vector.
</p>
<p>
The <align> element must contain at least one point to align.
It may contain any number of <point>s and <range>s. An
optional <reference> element contains the point to align
with. If the reference point is omitted, the current setting of RP0
is used.
</p>
<p>
The <align> element may be nested in a <move> element,
in which case it is not necessary to include a <reference>:
the <point> of the parent <move> is implicitly the
reference point.
</p>
<p>
Example:
</p>
<pre>
<align>
<reference>
<point num="left-left-b"/>
</reference>
<range ref="knob-range"/>
</align>
</pre>
<h4>Attribute</h4>
<dl>
<dt>compile-if</dt>
<dd>
The <align> instruction is compiled only if the
expression in the compile-if attribute evaluates as true
(non-zero). The instruction is also compiled if this attribute is
omitted.
</dd>
</dl>
<h3 id="align-midway"><align-midway></h3>
<p>Must contain two <point> elements. Moves these along
the freedom vector until they are aligned midway
between their original positions. Measurement is
along the projection vector.</p>
<h3 id="shift"><shift></h3>
<p>Shifts one or more points, ranges, contours and zones
by the distance between the current position of the reference
point and its original position. Note that this does not
guarantee that the shifted elements will maintain their original
distance from the reference point (use <move> or
<mdrp> for that).</p>
<p>The <shift> element may contain points, ranges,
contours and zones in any combination and order. The following
is perfectly correct:</p>
<pre>
<shift>
<reference>
<point num="ref-pt"/>
</reference>
<point num="move-pt-1"/>
<range ref="move-rg-1"/>
<contour num="0"/>
<point num="move-pt-2"/>
<range ref="move-rg-2"/>
</shift>
</pre>
<p>But note that all the points are shifted first, then all the
ranges, then all the contours, and finally any zones. The order
of child elements in the <shift> element is not significant; but this is less confusing:</p>
<pre>
<shift>
<reference>
<point num="ref-pt"/>
</reference>
<point num="move-pt-1"/>
<point num="move-pt-2"/>
<range ref="move-rg-1"/>
<range ref="move-rg-2"/>
<contour num="0"/>
</shift>
</pre>
<p>
The <shift> element may be nested in a <move>
element, in which case it is not necessary to include a
<reference>: the <point> of the parent <move>
is implicitly the reference point.
</p>
<h4>Attributes</h4>
<dl>
<dt>reference-ptr</dt>
<dd>
Addresses a technical detail: the SHP, SHC and SHZ instructions
can use either RP1 or RP2, and this attribute determines
which. Chiefly useful if the RP you want to use has already been
set; otherwise the default (RP1) should do fine. Xgridfit
automatically sets this correctly when a <shift> instruction
is nested inside a <move> instruction.
</dd>
<dt>compile-if</dt>
<dd>
The <align> instruction is compiled only if the
expression in the compile-if attribute evaluates as true
(non-zero). The instruction is also compiled if this attribute is
omitted.
</dd>
<dt>round</dt>
<dd>
Causes any points referenced by <point> elements to be moved
to rounded positions after the shift. <set> and
<range> elements are not affected. Works like the
<tt>round</tt> attribute on the <a
href="#interpolate"><interpolate></a> element.
</dd>
</dl>
<h3 id="shift-absolute"><shift-absolute></h3>
<p>Moves one or more points along the freedom vector by
a fixed amount (expressed in pixels); it does not use the
projection vector. The <shift-absolute>
element must contain at
least one point to shift: that is, a <range> or a <point>
element.
It may contain any number of <point>s and <range>s.</p>
<h4>Attribute</h4>
<dl>
<dt>pixel-distance</dt>
<dd>The distance (in pixels) to shift
the points.</dd>
</dl>
<h3 id="move-point-to-intersection"><move-point-to-intersection></h3>
<p>Moves a point to the intersection of two lines.
Each of the lines must be wholly in
a single zone, so if specifying the zone use the <tt>zone</tt>
attribute of the <line> elements rather than the <tt>zone</tt>
attributes of the <point> elements that make up the
lines. Example:</p>
<pre>
<move-point-to-intersection>
<point num="pt"/>
<line>
<point num="line-a1"/>
<point num="line-a2"/>
</line>
<line>
<point num="line-b1"/>
<point num="line-b2"/>
</line>
</move-point-to-intersection>
</pre>
<h3 id="set-coordinate"><set-coordinate></h3>
<p>Moves a <point> to a coordinate determined by the
freedom and projection vectors. On the rare occasions when
you need a command like this one, it is probably better to
use <move> with the <tt>pixel-distance</tt> attribute.</p>
<h4>Attribute</h4>
<dl>
<dt>coordinate</dt>
<dd>The new coordinate in pixels.</dd>
</dl>
<h3 id="flip-on"><flip-off><br/><flip-on></h3>
<p>
"Flips" a range of points so that they all become either
on-line points or off-line points. The <flip-off> and
<flip-on> elements must contain a single <range>
element. The range operated upon always runs from the lowest
point to the highest. The <range> element may contain a
<tt>zone</tt> attribute, in which case the operation takes
place in the specified zone.
</p>
<h3 id="toggle-points"><toggle-points></h3>
<p>Any of the points that are on-line become off-line,
and any that are off-line become on-line.
The <toggle-points> element must contain at
least one point to toggle: that is, a <range> or a <point>
element.
It may contain any number of <point>s and <range>s.</p>
<h3 id="mirp"><mirp></h3>
<p>Corresponds to the MIRP instruction, but attempts, insofar as it
is practical, to separate rounding and the cvt cut-in. You can
specify <tt>round="no"</tt> and <tt>cut-in="yes"</tt> or both
<tt>no</tt> or both <tt>yes</tt>,
but not <tt>round="yes"</tt> and <tt>cut-in="no"</tt>.
That produces an error-message.</p>
<p>This will take care of setting RP0 beforehand if a reference point
is included.</p>
<h4>Attributes</h4>
<dl>
<dt>distance</dt>
<dd>distance (from a <control-value> element) relative to the
reference point (or to RP0 if that was set by a
previous instruction).</dd>
<dt>round</dt>
<dd>whether/how to round the distance. If <tt>yes</tt> is specified,
the round bit is set and nothing more is done: so the
current round state is used. If <tt>to-grid</tt>, <tt>to-half-grid</tt> or
to <tt>to-double-grid</tt>, the round state is set as specified, the
instruction is executed, and then the earlier round state
is restored. The default is <tt>yes</tt>.</dd>
<dt>cut-in</dt>
<dd>whether to use the cvt cut-in. If rounding is used, this
will always be <tt>yes</tt>, even if you set it to <tt>no</tt>.</dd>
<dt>min-distance</dt>
<dd>whether to observe the current minimum distance (1p
unless you set it differently using set-minimum-distance).
The default is <tt>yes</tt>.</dd>
<dt>set-rp0</dt>
<dd>whether to set reference point 0 to point at the moved point
after the instruction is executed. The default value is
<tt>no</tt>.</dd>
<dt>color</dt>
<dd>Or distance-type, or compensation for engine characteristics.
Whatever. It's got to be gray, black or white, and here
gray is the default.</dd>
</dl>
<h3 id="mdrp"><mdrp></h3>
<p>Corresponds to the MDRP instruction.</p>
<p>Similar to <mirp>. This will also take care of setting RP0 beforehand if a
reference point is supplied.</p>
<h4>Attributes</h4>
<dl>
<dt>round</dt>
<dd>Whether/how to round the distance from the reference point.</dd>
<dt>min-distance</dt>
<dd>Whether to maintain a minimum distance from the reference
point.</dd>
<dt>set-rp0</dt>
<dd>Whether to set RP0 to the moved point after the move.</dd>
<dt>color</dt>
<dd>Or distance-type, or compensation for engine characteristics.
Whatever. It's got to be gray, black or white, and here
gray is the default.</dd>
</dl>
<h3 id="miap"><miap></h3>
<p>Corresponds to the MIAP instruction.</p>
<p>As with mirp, it will try to separate rounding and the cvt cut-in.</p>
<p>Must contain one point element.</p>
<h4>Attributes</h4>
<dl>
<dt>distance</dt>
<dd>Distance relative to grid origin</dd>
<dt>round</dt>
<dd>Whether/how to round the distance</dd>
<dt>cut-in</dt>
<dd>Whether to use the cvt cut-in</dd>
</dl>
<h3 id="mdap"><mdap></h3>
<p>Corresponds to the MDAP instruction</p>
<p>Will round a point to the grid if the <tt>round</tt> attribute
is not <tt>no</tt>; otherwise
will just touch the point (i.e. mark it as moved).</p>
<h4>Attributes</h4>
<dl>
<dt>round</dt>
<dd>Whether and how to round</dd>
</dl>
</div>
</body>
</html>
|