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
|
Transform all glyphs of the current font while in fontmode (FontEdit()).
<p>
The action sets up a 2d transformation matrix, initially an ident matrix, then
applies each transformation from the arguments to this matrix. Finally it
iterates through all glyphs and transforms drawing objects using this matrix.
The origin of the transformation is the origin of the glyph cell, which is
the top left corner (the top left grid crossing).
<p>
Transformation arguments:
<table border=1 cellspacing=0>
<tr> <th> arg <th> description
<tr> <td> move, dx, dy <td> translate coordinates by dx;dy coords
<tr> <td> shear, sx, sy <td> shear coordinates by a factor of sx;sy (floating point numbers in decimal format); arc angles are not changed, only center point is moved
<tr> <td> scale, sx, sy <td> scale coordinates by a factor of sx;sy (floating point numbers in decimal format); arc radius is not scaled, only centerpoint is moved
<tr> <td> rotate, ang <td> rotate objects by ang degrees; arc angles are not changed, only center point is rotated; positive angles rotate CCW
</table>
<p>
Example:
<pre>
FontXform(move, 0, 54mil, shear, -0.15, 0, move, 0, -54mil)
</pre>
<p>
This first moves each glyph 54 mil up, then shears them by 15% to the right
then moves them back down 54 mil. The move is used to transform the base
coordinate of the shear to the baseline of the font. But it really works
the other way around: transformations always use the top left corner as
as origin, but if glyph data is moved up, above cell top, it's the same
as if we moved the transformation down by the same amount.
<p>
<b>Note:</b> because transfomrations are applied to a matrix first, they
need to be specified in reverse order. In the above example the last
move is the one that moves everything up (negative y).
|