CATextLayer and attributed strings
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