CGFontCreateWithDataProvider freezes unit test

I have a unit test to check if a font from a file is registered. When the CGFontCreateWithDataProvider is called, the check freezes (I added a breakpoint and when I go through the breakpoint it’s not connected and check that the logic does not continue). Any advice? When I run the application, this method works fine.

Thank,

CFErrorRef fonterror;
NSURL * fonturl = [NSURL fileURLWithPath:finalFolder];
CGDataProviderRef fontDataProvider = CGDataProviderCreateWithURL((__bridge CFURLRef)fonturl);
// break point    
CGFontRef newFont = CGFontCreateWithDataProvider(fontDataProvider);
// never continued.
if (newFont) {
    if (CTFontManagerRegisterGraphicsFont(newFont, &fonterror)) {
        CGFontRelease(newFont);
        ...
} else ...
} else ...
+4
source share

Source: https://habr.com/ru/post/1545362/


All Articles