Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is /* fontManager:willIncludeFont: */ broken?



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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.