Transform all glyphs of the current font while in fontmode (FontEdit()).
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).
Transformation arguments:
arg | description |
---|---|
move, dx, dy | translate coordinates by dx;dy coords |
shear, sx, sy | shear coordinates by a factor of sx;sy (floating point numbers in decimal format); arc angles are not changed, only center point is moved |
scale, sx, sy | scale coordinates by a factor of sx;sy (floating point numbers in decimal format); arc radius is not scaled, only centerpoint is moved |
rotate, ang | rotate objects by ang degrees; arc angles are not changed, only center point is rotated; positive angles rotate CCW |
Example:
FontXform(move, 0, 54mil, shear, -0.15, 0, move, 0, -54mil)
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.
Note: 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).