아이폰어플개발정보2010. 6. 24. 14:12
Quartz2D로 한글 그리기..
폰트는 애플고딕만...

void MyDrawUnicodeText(
CGContextRef context, 
CGRect contextRect, 
NSString* str, 
int fontsize, 
CGFloat red, 
CGFloat green, 
CGFloat blue)
{

CGContextSetRGBFillColor(context, red, green, blue, 1.0);
CGContextSetRGBStrokeColor(context, red, green, blue, 1.0);
CGContextSetTextDrawingMode(context, kCGTextFill);

CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0f, contextRect.size.height);
CGContextScaleCTM(context, 1.0f, -1.0f);

UIGraphicsPushContext(context);
[str drawAtPoint:CGPointMake(contextRect.origin.x, -contextRect.origin.y) 
withFont:[UIFont systemFontOfSize:fontsize]];
UIGraphicsPopContext();

CGContextRestoreGState(context);
}


출처 : http://blog.naver.com/PostView.nhn?blogId=gonagi&logNo=150087788203
Posted by 오늘마감

댓글을 달아 주세요