File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,9 @@ class JsiSkApi : public JsiSkHostObject {
63
63
*/
64
64
JsiSkApi (jsi::Runtime &runtime, std::shared_ptr<RNSkPlatformContext> context)
65
65
: JsiSkHostObject(context) {
66
-
66
+ // We create the system font manager eagerly since it has proven to be too slow
67
+ // to do it on demand
68
+ JsiSkFontMgrFactory::getFontMgr (getContext ());
67
69
installFunction (" Font" , JsiSkFont::createCtor (context));
68
70
installFunction (" Paint" , JsiSkPaint::createCtor (context));
69
71
installFunction (" RSXform" , JsiSkRSXform::createCtor (context));
Original file line number Diff line number Diff line change 12
12
#include < JsiSkParagraphStyle.h>
13
13
#include < JsiSkTextStyle.h>
14
14
#include < JsiSkTypefaceFontProvider.h>
15
+ #include < JsiSkFontMgrFactory.h>
15
16
16
17
#pragma clang diagnostic push
17
18
#pragma clang diagnostic ignored "-Wdocumentation"
@@ -113,7 +114,8 @@ class JsiSkParagraphBuilder : public JsiSkHostObject {
113
114
sk_sp<SkFontMgr> fontManager)
114
115
: JsiSkHostObject(std::move(context)) {
115
116
_fontCollection = sk_make_sp<para::FontCollection>();
116
- _fontCollection->setDefaultFontManager (JsiSkFontMgrFactory::getFontMgr (context));
117
+ auto fontMgr = JsiSkFontMgrFactory::getFontMgr (getContext ());
118
+ _fontCollection->setDefaultFontManager (fontMgr);
117
119
if (fontManager != nullptr ) {
118
120
_fontCollection->setAssetFontManager (fontManager);
119
121
}
You can’t perform that action at this time.
0 commit comments