On Jun 6, 2012, at 9:25 AM, Rajendran P wrote:

> How do i specify fixed font width for an nsattributedstring (used to set 
> string to nstextfield) ?

First, perhaps you just want to use a fixed-width font instead of setting a 
fixed width on a non-fixed-width font.

Anyway, I think you use the font attribute NSFontFixedAdvanceAttribute.  So, 
you either construct a NSFontDescriptor from scratch and include that 
attribute, or you start from an NSFont, get its fontDescriptor, and then use 
-fontDescriptorByAddingAttributes: to create a new font descriptor with that 
attribute.  Then, you use +[NSFont fontWithDescriptor:size:] to get an NSFont 
and set it on the attributed string with NSFontAttributeName.

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to