• 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
Re: Trouble with outlined text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with outlined text


  • Subject: Re: Trouble with outlined text
  • From: Francesca Cuciniello <email@hidden>
  • Date: Thu, 20 Apr 2006 15:49:00 +0200

Hi Jonathon,

this is the code:

NSMutableDictionary * parametri = [[NSMutableDictionary alloc] initWithDictionary:[textView typingAttributes]];

// [sizeOutline floatValue] is a negative value
[parametri setObject:[NSNumber numberWithFloat:[sizeOutline floatValue]] forKey:NSStrokeWidthAttributeName];
[parametri setObject:[NSNumber numberWithFloat:[sizeKerning floatValue]] forKey:NSKernAttributeName];
[parametri setObject:[colorOutline color] forKey:NSStrokeColorAttributeName];
if ([sizeLineSpacing floatValue] != 0) {
NSMutableParagraphStyle* stile = [[parametri objectForKey:NSParagraphStyleAttributeName] mutableCopy];
if (stile == nil) {
stile = [[[NSMutableParagraphStyle alloc] init] autorelease];
[stile setParagraphStyle: [NSParagraphStyle defaultParagraphStyle]];
[stile setAlignment: NSLeftTextAlignment];
[stile setLineBreakMode: NSLineBreakByWordWrapping];
}
[stile setMinimumLineHeight:[sizeLineSpacing floatValue]];
[stile setMaximumLineHeight:[sizeLineSpacing floatValue]];
[parametri setObject:stile forKey:NSParagraphStyleAttributeName];
}


NSShadow* ombra = [parametri objectForKey:NSShadowAttributeName];
if (ombra != nil) {
[ombra setShadowColor:[colorOmbra color]];
[parametri setObject:ombra forKey:NSShadowAttributeName];


// [testoView setTypingAttributes:parametri];
// [testoView setNeedsDisplay:YES];
[[NSFontManager sharedFontManager] setSelectedAttributes:parametri isMultiple:NO];


NSRange selezione = [textView selectedRange];
if (selezione.length == 0)
NSMakeRange(0,[[textView string] length]);
[[textView textStorage] setAttributes:parametri range:selezione];


        }


Thanks

Francesca Cuciniello

Il giorno 20/apr/06, alle ore 15:01, Jonathon Mah ha scritto:

Hi Francesca,

On 2006-04-20, at 20:04, Francesca Cuciniello wrote:

I'm develop an application that uses NSTextView and Attributed Strings.

I need to draw text with different color for outline, foreground and shadow.

I can draw a text with different colors, but something strange appear.
Also the shadow has an outline and you can see this inside the caracter.


I've attached an example.

Any ideas?

There's no way to tell without seeing the code; can you post it?



Jonathon Mah
email@hidden





_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Trouble with outlined text (From: Francesca Cuciniello <email@hidden>)
 >Re: Trouble with outlined text (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Re: Localization
  • Next by Date: Re: Discovering where a method was called from within the method
  • Previous by thread: Re: Trouble with outlined text
  • Next by thread: Re: Trouble with outlined text
  • Index(es):
    • Date
    • Thread