This repository was archived by the owner on Apr 25, 2019. It is now read-only.

Description
When I encounter this problem, i am so surprised with the "right" code in drawing text String.
After server days, I found the key of the problem. My code are following:
-
(void) drawInContext:(CGContextRef)context {
UIGraphicsPushContext(context); // key 1
CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));
CGContextSetTextDrawingMode(context, kCGTextFill); // This is the default
CGContextSetFillColorWithColor(context, [[UIColor blackColor] CGColor]);
[self.text drawInRect:self.rect withAttributes:@{NSFontAttributeName:self.font}];
UIGraphicsPopContext(); // key 2
}