大佬教程收集整理的这篇文章主要介绍了ios – 我怎么能概述文字字体?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
[text drawAtPoint:CGPointMake(0,30) withFont:[UIFont fontWithName:@"Helvetica-Bold" size:(3 * MKroadWidthAtZoomScale(zoomScalE))]
它工作正常,除了我需要文本显示轮廓.
使用kCGTextFillstroke似乎合乎逻辑,但这可能会使笔划压倒填充.如果你抚摸,然后填充,如下面的块中,你会得到可读文本背后的可见轮廓.
CGContextRef context = UIGraphicsGetCurrentContext(); CGPoint point = CGPointMake(0,30); CGFloat fontSize = (3 * MKroadWidthAtZoomScale(zoomScalE)); UIFont *font = [UIFont fontWithName:@"Helvetica-Bold" size:fontSize]; // Draw outlined text. CGContextSetTextDrawingMode(context,kCGTextstroke); // Make the thickness of the outline a function of the font size in use. CGContextSetLineWidth(context,fontSize/18); CGContextSetstrokeColorWithColor(context,[[UIColor redColor] CGColor]); [text drawAtPoint:point withFont:font]; // Draw filled text. This will make sure it's clearly readable,while leaving some outline behind it. CGContextSetTextDrawingMode(context,kCGTextFill); CGContextSetFillColorWithColor(context,[[UIColor blueColor] CGColor]); [text drawAtPoint:point withFont:font];
以上是大佬教程为你收集整理的ios – 我怎么能概述文字字体?全部内容,希望文章能够帮你解决ios – 我怎么能概述文字字体?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。