Is /* fontManager:willIncludeFont: */ broken?
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.