I display the string by using the DrawString() method in ICanvas interface. I implemented the DrawString() method like below
void ICanvas.DrawString(
string str,
float x,
float y,
float width,
float height,
HorizontalAlignment horizontalAlignment,
VerticalAlignment verticalAlignment)
{
var ctf = _state._font._ctf;
ctf.HorizontalAlignment = TMP_ConvAlignH(horizontalAlignment);
ctf.VerticalAlignment = TMP_ConvAlignV(verticalAlignment);
using (var layout = new CanvasTextLayout(_control, str, ctf, width, height))
{
layout.SetUnderline(0,str.Length,_state._font.FontUnderline);
layout.Options = CanvasDrawTextOptions.Clip;
_session.DrawTextLayout(layout, x, y, _state._fontColor);
}
}
I need to rotate the string by particular angle. Please give me a solution?
What I have tried:
I tried to rotate by using
Matrix3x2.CreateRotation((float)-angcur - 1.570796f) *
Matrix3x2.CreateTranslation(
(float)this.RotationCenterX + (heights[i] + tradius) * (float)Math.Cos(angcur),
(float)this.RotationCenterY - (heights[i] + tradius) * (float)Math.Sin(angcur));
path.AddText(text.Substring(i, 1), font, 23, 23, m32);
before DrawString() method is invoked.