• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: David Duncan <email@hidden>
  • Date: Sun, 11 Jul 2010 18:31:08 -0700

Is the contentsScale property set correctly? For CALayers it defaults to 1.0, UIKit ensures that it is set correctly for layers that it creates, but it is your responsibility to do this for layers that you create yourself.

--
David Duncan

On Jul 11, 2010, at 4:03 PM, Carter Allen <email@hidden> wrote:

> I am trying to create an app that scales up nicely on the iPhone 4.
> Currently most of it scales up perfectly, except for one crucial
> piece: the text that I draw inside a CALayer, inside its
> drawInContext: method. Here is my code:
>
> - (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, -1.0f);
>
>     CGContextSetFillColorWithColor(context, [[UIColor blackColor] CGColor]);
>     CGContextSelectFont(context, "CardKit", 30.0f, kCGEncodingMacRoman);
>     CGContextSetTextDrawingMode(context, kCGTextFill);
>     CGContextShowText(context, "A", sizeof("A"));
>
>     UIGraphicsPopContext();
> }
>
> This short produce crisp text on both devices, but unfortunately, it
> produces blurry text on both. Here is how it appears:
> http://zcr.me/01h
> That image is taken at 100% zoom on the iPhone 4. What in the world?
> Any ideas how I can fix this?
>
> Sincerely,
> Carter Allen
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: (no subject)
  • Next by Date: Re: NSClassDescriptionNeededForClassNotification
  • Previous by thread: Re: (no subject)
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread