• 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: Can I add my own characters to strings in text fields?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Tooltips over buttons ?
  • Next by Date: Bindings and Observing
  • Previous by thread: Re: Can I add my own characters to strings in text fields?
  • Next by thread: code folding in NSTextView
  • Index(es):
    • Date
    • Thread