Set the LineAlignment of the text to Center
, so it will be vertically aligned center. Then when you rotate it, it always rotates around the center:
new StringFormat(StringFormat.GenericDefault) { LineAlignment = StringAlignment.Center }
The other desired fix (as per the comments) is fixing the horizontal offset. To do so, you can calculate the offsetX, then apply a Translate to the matrix. Here is the code:
private void Form1_Paint(object sender, PaintEventArgs e)
{
using (var path = new GraphicsPath())
{
path.AddString("sample text", new FontFamily("Arial"), (int)FontStyle.Regular, 48, Position,
new StringFormat(StringFormat.GenericDefault) { LineAlignment = StringAlignment.Center});
var offsetx = path.GetBounds().Left - Position.X;
//transform
Matrix rotationMatrix = new Matrix();
rotationMatrix.RotateAt(Rotation, Position);
rotationMatrix.Translate(-offsetx, 0);
path.Transform(rotationMatrix);
var boundingRectangle = path.GetBounds();
e.Graphics.DrawPath(new Pen(Brushes.Black), path);
e.Graphics.DrawRectangles(new Pen(Brushes.Aqua), new RectangleF[] { boundingRectangle });
}
e.Graphics.DrawEllipse(new Pen(Color.Black, width: 5), new RectangleF(Position, new Size(1, 1)));
}
And you can see the result, here: