• 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
CATextLayer and attributed strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CATextLayer and attributed strings


  • Subject: CATextLayer and attributed strings
  • From: Albert Martin <email@hidden>
  • Date: Wed, 17 Sep 2008 19:53:28 -0400

After rewriting much of my code to transition over to Core Animation, I've run across a problem with CATextLayer and displaying attributed strings. The string I am trying to display has a stroke set using NSStrokeWidthAttributeName. Everything seems to work fine, except that the text loses it's border whenever it is displayed on the CATextLayer. Why would all the other attributes hold but this one gets ignored? Is there a way around this?

Here's a code snippet:

genericPresenterSlideTextAttrs = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSFont fontWithName:presentationFontFamily size:presentationFontSize], NSFontAttributeName,
[NSNumber numberWithFloat: -10], NSStrokeWidthAttributeName,
presenterSlideTextPara, NSParagraphStyleAttributeName,
[NSColor whiteColor],NSForegroundColorAttributeName,
nil];

presentationTextLayer = [[CATextLayer layer] retain];
presentationTextLayer.string = [[NSAttributedString alloc] initWithString: [self presentationText] attributes: genericPresenterSlideTextAttrs];
_______________________________________________


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: Re: Core Data in a framework ?
  • Next by Date: Re: NSOutlineView: Which row is selected.
  • Previous by thread: CALayer Mask Logic
  • Next by thread: Listening for changes in a table
  • Index(es):
    • Date
    • Thread