Quartz2D has an inverted y axis - convenient eh? If you use the drawRect method, you can use the following to flip the text.
CGContextTranslateCTM(context, 0.0, rect.size.height); CGContextScaleCTM(context, 1.0, -1.0);
Another way:
transform = CGAffineTransformMake(1.0,0.0,0.0,-1.0,0.0,0.0); CGContextSetTextMatrix(context, transform);
Or on one line;
CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));
Roger
source share