I need to allow the user to write text on an NSImage at an angle.The user can specify the angle.
let textsize = text.size(withAttributes: textFontAttributes)
context.saveGState()
context.rotate(by: CGFloat(userangle))
text.draw(at: counterpoint, withAttributes: textFontAttributes)
context.restoreGState()
But this is not producing intended result. The following is what I'm trying to achieve