Code: Select all
rule SquareLine {
SQUARE {}
SquareLine { x 3 s 0.95 *x 1.1765 }
}
It occurs to me now that I was wrong earlier when I said
Implementing scaling for size, rotation, or skew would require a huge change to the implementation. Currently Context Free parses the adjustments for each shape into affine transforms and multiplies them all together into a single affine transform matrix. But scaling isn't a parse-time affect, it is a render-time affect. Each shape rule will get rendered hundreds or thousands of times and the scaling factors will be different for each render. But the adjstments that we want to scale are gone at render-time. They have disappeared into the affine transform matrix and we can't get them back. This is basically the same problem that we have with implementing size, rotation, or skew limits.What we could do is apply the scaling concept to size, rotation, skew, x, and y (but not flip). This modifies the adjustment before it gets multiplied into the transform matrix and is lost.
The only way that we can to size, rotation, or skew scaling is if we give up on producing an affine transform matrix during the parse stage and just record all of the adjustments. Alas, because of the 'foo [x 0.5 s 0.9 x 0.5]' syntax the number of ligitimate adjustments can be unbounded. And I thought I was so clever. But this is not really an impossible task. If limiting and/or scaling of size, rotation, or skew is deemed important then we can do it.
Adding scaling or limiting to x and y translation wouldn't require such a drastic step. It is very easy to extract and manipulate the translation part of an affine transform matrix.