Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CGContextSelectFont(context, "Arial-BoldMT", fontSize, kCGEncodingMacRoman);
- CGContextSetTextPosition(context, x, y);
- CGContextShowText(context, [text UTF8String], text.length);
- // CGContextSetTextPosition(context, x, Y);
- // CGContextShowText(context, [text UTF8String], text.length);
- context = UIGraphicsGetCurrentContext();
- UIGraphicsPushContext(context);
- [text drawAtPoint:CGPointMake(x, Y)
- withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldMT" size:12]}];
- UIGraphicsPopContext();
- // CGContextSetTextPosition(context, x, Y);
- // CGContextShowText(context, [text UTF8String], text.length);
- context = UIGraphicsGetCurrentContext();
- UIGraphicsPushContext(context);
- [text drawAtPoint:CGPointMake(x, Y)
- withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldMT" size:12],
- NSForegroundColorAttributeName: [UIColor whiteColor]}];
- UIGraphicsPopContext();
- NSLog(@"text: %@, x: %.2f, Y: %.2f", text, x, Y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement