• 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
Is /* fontManager:willIncludeFont: */ broken?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is /* fontManager:willIncludeFont: */ broken?


  • Subject: Is /* fontManager:willIncludeFont: */ broken?
  • From: Bela Bernat Hackman <email@hidden>
  • Date: Fri, 6 Dec 2002 11:58:15 -0600

This issue has been raised before but I can't find any resolution in the archives.

This context is a font management utility which activates and deactivates fonts dynamically.
The following snippet activates a font file and updates the fonts available via Cocoa APIs.
However, the delegate method /*fontManager:willIncludeFont:*/ is never called. Why?

@interface CBFontController : NSObject
{
}
@end

@implementation CBFontController

- (void)awakeFromNib
{
// According to NSFontManager.h, fontManager:willIncludeFont: is sent to the fontPanel delegate...
[[NSFontPanel defaultFontPanel] setDelegate:self];

// but cover all the bases anyway.
[[NSFontManager sharedFontManager] setDelegate:self];
}

- (void) addFontContainer:(CBFontContainer *)inContainer
{
// CBFontContainer is, in part, a wrapper for the lower level Carbon Font Manager routines.
[inContainer activate];

// Update the Cocoa NSFontManager / NSFontPanel
[[NSFontPanel sharedFontPanel] reloadDefaultFontFamilies];

// Check if everything is inorder  it is: the delegates are correct, the fonts are added.
NSLog ( @"%@:%@\n%@\n",
[[NSFontPanel sharedFontPanel] delegate],
[[NSFontManager sharedFontManager] delegate]
[[NSFontManager sharedFontManager]availableFonts] );
}

// Never callled!
- (BOOL) fontManager:(id)sender willIncludeFont:(NSString *)fontName
{
NSLog ( @"Font panel requesting to include %@.\n", fontName);
return YES;
}

@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: [ANN] Plans for Financial Platform on Mac OS X
  • Next by Date: [repost] nonModal NSWindowController
  • Previous by thread: [ANN] Plans for Financial Platform on Mac OS X
  • Next by thread: [repost] nonModal NSWindowController
  • Index(es):
    • Date
    • Thread