Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. CGContextSelectFont(context, "Arial-BoldMT", fontSize, kCGEncodingMacRoman);
  2. CGContextSetTextPosition(context, x, y);
  3. CGContextShowText(context, [text UTF8String], text.length);
  4.  
  5. // CGContextSetTextPosition(context, x, Y);
  6. // CGContextShowText(context, [text UTF8String], text.length);
  7.  
  8. context = UIGraphicsGetCurrentContext();
  9. UIGraphicsPushContext(context);
  10. [text drawAtPoint:CGPointMake(x, Y)
  11. withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldMT" size:12]}];
  12. UIGraphicsPopContext();
  13.  
  14. // CGContextSetTextPosition(context, x, Y);
  15. // CGContextShowText(context, [text UTF8String], text.length);
  16.  
  17. context = UIGraphicsGetCurrentContext();
  18. UIGraphicsPushContext(context);
  19. [text drawAtPoint:CGPointMake(x, Y)
  20. withAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Arial-BoldMT" size:12],
  21. NSForegroundColorAttributeName: [UIColor whiteColor]}];
  22. UIGraphicsPopContext();
  23. NSLog(@"text: %@, x: %.2f, Y: %.2f", text, x, Y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement