|
@@ -14,7 +14,6 @@
|
14
|
14
|
* limitations under the License.
|
15
|
15
|
*/
|
16
|
16
|
|
17
|
|
-#import <CoreText/CoreText.h>
|
18
|
17
|
#import <Intents/Intents.h>
|
19
|
18
|
|
20
|
19
|
#include <mach/mach_time.h>
|
|
@@ -53,35 +52,6 @@ RCTFatalHandler _RCTFatal = ^(NSError *error) {
|
53
|
52
|
}
|
54
|
53
|
};
|
55
|
54
|
|
56
|
|
-/**
|
57
|
|
- * Helper function to dynamically load custom fonts. The `UIAppFonts` key in the
|
58
|
|
- * plist file doesn't work for frameworks, so fonts have to be manually loaded.
|
59
|
|
- */
|
60
|
|
-void loadCustomFonts(Class clazz) {
|
61
|
|
- NSBundle *bundle = [NSBundle bundleForClass:clazz];
|
62
|
|
- NSArray *fonts = [bundle objectForInfoDictionaryKey:@"JitsiMeetFonts"];
|
63
|
|
-
|
64
|
|
- for (NSString *item in fonts) {
|
65
|
|
- NSString *fontName = [item stringByDeletingPathExtension];
|
66
|
|
- NSString *fontExt = [item pathExtension];
|
67
|
|
- NSString *fontPath = [bundle pathForResource:fontName ofType:fontExt];
|
68
|
|
- NSData *inData = [NSData dataWithContentsOfFile:fontPath];
|
69
|
|
- CFErrorRef error;
|
70
|
|
- CGDataProviderRef provider
|
71
|
|
- = CGDataProviderCreateWithCFData((__bridge CFDataRef)inData);
|
72
|
|
- CGFontRef font = CGFontCreateWithDataProvider(provider);
|
73
|
|
-
|
74
|
|
- if (!CTFontManagerRegisterGraphicsFont(font, &error)) {
|
75
|
|
- CFStringRef errorDescription = CFErrorCopyDescription(error);
|
76
|
|
-
|
77
|
|
- NSLog(@"Failed to load font: %@", errorDescription);
|
78
|
|
- CFRelease(errorDescription);
|
79
|
|
- }
|
80
|
|
- CFRelease(font);
|
81
|
|
- CFRelease(provider);
|
82
|
|
- }
|
83
|
|
-}
|
84
|
|
-
|
85
|
55
|
/**
|
86
|
56
|
* Helper function to register a fatal error handler for React. Our handler
|
87
|
57
|
* won't kill the process, it will swallow JS errors and print stack traces
|
|
@@ -410,9 +380,6 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
|
410
|
380
|
= [[RCTBridgeWrapper alloc] initWithLaunchOptions:_launchOptions];
|
411
|
381
|
views = [NSMapTable strongToWeakObjectsMapTable];
|
412
|
382
|
|
413
|
|
- // Dynamically load custom bundled fonts.
|
414
|
|
- loadCustomFonts(self.class);
|
415
|
|
-
|
416
|
383
|
// Register a fatal error handler for React.
|
417
|
384
|
registerFatalErrorHandler();
|
418
|
385
|
});
|