Re: setFontManagerFactory:

2017-01-27 Thread Raglan T. Tiger

> On Jan 27, 2017, at 1:48 AM, Alastair Houghton <alast...@alastairs-place.net> 
> wrote:
> 
> 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;


Great idea.  I did move setFontManagerFactory to main.m and still got no  hit 
on the init method.

-rags
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: setFontManagerFactory:

2017-01-27 Thread Alastair Houghton
On 26 Jan 2017, at 19:06, Raglan T. Tiger <r...@crusaderrabbit.net> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

setFontManagerFactory:

2017-01-26 Thread Raglan T. Tiger
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.

@implementation EFontManager

- (instancetype)init
{
self = [super init];
if (self)
{
NSLog ( @"EFontManager" );
}
return self;
}


So, what secret sauce am I missing for my init method to be called?





-rags



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com