nsattributedstring

Showing image before text in NSButtonCell in NSMatrix

Hi all, I am displaying buttons in NSMatrix. My requirement is: to change color of button title and place an image at beginning of title, when certain condition is satisfied. To do so, I used following code: // setting attributed text NSAttributedString *selectedCellAttribute; NSFont *selectedCellFon...

Bold & Non-Bold Text In A Single UILabel?

How would it be possible to include both bold and non-bold text in a uiLabel? I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how to use that. Any ideas? Apple achieves this in several of their apps; Examples Screenshot: link text Thanks! - Dom ...

How to properly determine width of an attributed string

What I want to do: layout text using NSLayoutManager and set its NSTextContainer to the width of the widest string (glyph-wise) in an array of strings. What my problem is: The methods for determining the total 'glyph-width' seem to be incorrect because when I render the text it wraps. I did an experiment using a 32 character string wit...

How do I display a NSAttributedString on an iPhone?

I believe I understand how to set NSAttributedString values but how on earth do you actually display them in the interface? examples: UILabel, UITextView, etc. Specific instructions would be greatly appreciated/ Thanks! ...

NSForegroundColorAttributeName key in iPhone.

Hi All, I heard that NSAttributedString is added in iPhone but when I use the key NSForegroundColorAttributeName for setting the color i get an error saying "NSForegroundColorAttributeName undeclared". Am I missing anything? Please help me. Regards Yallappa ...

How can I clear the contents of an NSMutableAttributedString?

I have an ivar which is alloc-inited in the init of an object: attString = [[NSMutableAttributedString alloc] init]; On a loop, I want to clear the contents of attString and re-use it. How do I do this? Thanks! ...

iphone/ipad: How exactly use NSAttributedString?

Hi all Yes, many people are saying about Rich Text in iphone ipad and many knows about NSAttributedString. But how to use NSAttributedString please??? I searched for much time, no extract clues for this. I know how to set up a NSAttributedString, then what should I do to display a text on iphone / ipad with rich text?? the official ...

iPhone CoreText: Find the pixel coordinates of a substring

Here's a screenshot of the twitter app for reference: http://screencast.com/t/YmFmYmI4M What I want to do is place a floating pop-over on top of a substring in an NSAttributedString that could span multiple lines. NSAttributedString is a requirement for the project. In the screenshot supplied, you can see that links are background-hig...

How can I fake superscript and subscript with Core Text and an Attributed String?

I'm using an NSMutableAttribtuedString in order to build a string with formatting, which I then pass to Core Text to render into a frame. The problem is, that I need to use superscript and subscript. Unless these characters are available in the font (most fonts don't support it), then setting the property kCTSuperscriptAttributeName does...

reading binary data (rtf) to string

Hello, I've been working on a core data program for a while now. I'm trying to combine attributes of an entity in a text view for saving to PDF and Printing. One of the attributes of the entity uses binary data. When I execute this: NSData *myData = [object valueForKey:@"cueNotes"]; ...it returns this: typedstreamè@ NSMutabl...