I am using CGContextShowText to display text, but when rotation using CGAffineTransformation, the rotation axis is located at the left, not at the center of the drawn text, the code I am using is this:
CGContextSaveGState(context);
CGContextSelectFont(context, "Helvetica", 20, kCGEncodingMacRoman);
CGContextSetCharacterSpacing (context, 1);
CGContextSetRGBFillColor (context, 0, 0, 0, 1);
CGAffineTransform xform = CGAffineTransformMake(
sin(DegreesToRadians(angle)), cos(DegreesToRadians(angle)),
cos(DegreesToRadians(angle)), -sin(DegreesToRadians(angle)),
0, 0);
CGContextSetTextDrawingMode (context, kCGTextFill);
CGPoint degreeDisplayPoint = CGPointMake(100,100);
CGContextShowTextAtPoint(context, degreeDisplayPoint.x, degreeDisplayPoint.y, [angleStringWithDegree cStringUsingEncoding:NSMacOSRomanStringEncoding], [angleStringWithDegree length]);
CGContextRestoreGState(context);
Any ideas. Thanks for your help.