Re: setFontManagerFactory:
Re: setFontManagerFactory:
- Subject: Re: setFontManagerFactory:
- From: Alastair Houghton <email@hidden>
- Date: Fri, 27 Jan 2017 08:48:22 +0000
On 26 Jan 2017, at 19:06, Raglan T. Tiger <email@hidden> wrote:
>
> According to the docs if one does:
>
> [ NSFontManager setFontManagerFactory:[ EFontManager class ] ];
>
> before the main nib file is loaded and where EFontManager is a subclass of NSFontManager and EFontManager does implement init as its designated initializer.
>
> My problem is that my init method for EFontManager is never called.
Are you running any other code before your -[NSFontManager setFontManagerFactory:] invocation? Note that “any other code” may include e.g. constructor functions from libraries you’re linking with... while I wouldn’t expect system libraries to be invoking [NSFontManager sharedFontManager] at that point, it’s possible some third-party library does that.
I’d try moving it to near the start of your main() function and see if it starts working. If it does, there’s probably some code somewhere that’s asking for the font manager early on.
The other thing you could do is, in the debugger, set a breakpoint on [NSFontManager sharedFontManager] then start your program and see what the backtrace looks like (that will tell you where the first invocation is; you’re going to have to ensure that you call -setFontManager: *prior* to that somehow).
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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