我正在尝试创建一个在iPhone 4上很好地扩展的应用程序.目前,它大部分的扩展完美,除了一个关键的部分:我在一个CALayer中绘制的文本,它的drawInContext:方法.这是我的代码:
- - (void)drawInContext:(CGContextRef)context {
- UIGraphicsPushContext(context);
- CGContextSetGrayFillColor(context,1.0f,1.0f);
- CGContextFillRect(context,self.bounds);
- CGContextSetAllowsAntialiasing(context,true);
- CGContextSetShouldAntialias(context,true);
- CGContextSetAllowsFontSmoothing(context,true);
- CGContextSetShouldSmoothFonts(context,true);
- CGContextSetAllowsFontSubpixelQuantization(context,true);
- CGContextSetShouldSubpixelQuantizeFonts(context,true);
- CGContextTranslateCTM(context,0.0f,self.frame.size.height);
- CGContextScaleCTM(context,-1.0f);
- CGContextSetFillColorWithColor(context,[[UIColor blackColor] CGColor]);
- CGContextSelectFont(context,"CardKit",30.0f,kCGEncodingMacRoman);
- CGContextSetTextDrawingMode(context,kCGTextFill);
- CGContextShowText(context,"A",sizeof("A"));
- UIGraphicsPopContext();
- }
这两个设备上的短暂文本都会产生清晰的文字,但不幸的是,它们在两者上都会产生模糊的文字.这是怎么出现的:
该图像是在iPhone 4上100%放大拍摄的.世界上有哪些?任何想法如何解决这个问题?