I am sub-tasked to tackle the rotated tables. This thread will describe methodology and implementation.
Types of rotation
In general the tables are rotated 90 degrees (Math.PI/2) ANTICLOCKWISE. In our coordinate system this is a POSITIVE angle. Rotation clockwise is NEGATIVE rotated 270 degrees (minus will confuse labels). Here is a typical table (
Here the whole table has been completely rotated 90 deg anticlockwise (+90 deg). By default characters will display upright ("unrotated") and so they have also been rotated. See detail of top left corner:
In general characters need special treatment in rotations. The raw SVG for the "beta" is
<text id="text306" font-style="italic" font-weight="normal" font-family="Helvetica" font-size="7.982"
y="227.309" x="190.655" transform="matrix(0.0,-1.0,1.0,0.0,-36.65369,417.96448)"
svgx:fontName="EFLEOB+BSSymbol-Italic" fill="#000000" stroke="none">β</text>
x coordinates represent the position of the character. Note that
y is DOWN the page. The transformation matrix rotates the character, and does this by:
- translation to the origin (
- rotation anticlockwise (
0, -1, 1, 0)
- translation back (
The combination of these three gives the matrix:
Therefore all rotated characters will generally include a translation for the character as well as the actual position. The precise position of the glyph will depend on the origin supplied in the font.
point of rotation of page or table.
If a table is rotated about the origin it will probably disappear into negative coordinates (for
y) so we generate a centre which keeps it on the page. If the overall page is
x, y (horiz,vertical)
then we rotate clockwise about
y/2, y/2 and anticlockwise about