Re: Can I add my own characters to strings in text fields?
Re: Can I add my own characters to strings in text fields?
- Subject: Re: Can I add my own characters to strings in text fields?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 25 Mar 2010 12:54:39 +0700
On 25 Mar 2010, at 10:16, Jerry Krinock <email@hidden> wrote:
> The font cascade list is mentioned briefly in "Core Text Programming Guide", but there is no clue as to how to access it.
>
> Any documentation references on these topics would be appreciated!
I have no documentation references but I do it like this:
NSFont *font = ... something...
NSString *thaiFont = [ font isFixedPitch ] ? @"Ayuthaya" : @"Thonburi";
CGFloat size = [ font pointSize ];
NSFontDescriptor *fode2 = [ NSFontDescriptor fontDescriptorWithName: thaiFont size: size ];
NSArray *fodArray = [ NSArray arrayWithObject: fode2 ];
NSDictionary *fodDict = [ NSDictionary dictionaryWithObject: fodArray forKey: NSFontCascadeListAttribute ];
NSFontDescriptor *fode1 = [ font fontDescriptor ];
NSFontDescriptor *fofo = [ fode1 fontDescriptorByAddingAttributes: fodDict ];
NSFont *aFont = [ NSFont fontWithDescriptor: fofo size: size ];
if ( aFont == nil ) ... error handling
font = aFont;
Kind regards,
Gerriet.
_______________________________________________
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