[Cairo] Help with rotated text

BlitzMax Forums/Brucey's Modules/[Cairo] Help with rotated text

degac(Posted 2009) [#1]
I'm using Cairo to create a PDF page.
Everything works as expected, but with only (my) problem: I'm trying to write a text (on the left side of my 'page') and it must be rotated by 90°.
I know the problem is related with the matrix (the rotation center is the 'origin' - I presume - of the canvas-page-surface) and I get wrong rotation...

Any help please?


Brucey(Posted 2009) [#2]
If you don't want to mess about with affine transformation matrices, you can always use Rotate(angle).

Perhaps something like this pseudo code :

Save
MoveTo : position
Rotate : to desired angle
ShowText
Restore

Save() and Restore() are useful because it will forget anything you have changed between them - So, if you move the pen somewhere on the page inside the Save/Restore block, the pen will return to it's original location. (likewise with colours, rotation, scale etc).

This might be useful, if you really want to use the matrix : http://en.wikipedia.org/wiki/Transformation_matrix


degac(Posted 2009) [#3]
Perfect!!!

It works as expected!

Thank you very much!