File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -362,13 +362,20 @@ Window::Window() {
362
362
throw Exception (" Could not initialize NanoVG" );
363
363
}
364
364
365
- // Load default UI font
365
+ // Load UI fonts
366
366
uiFont = loadFont (asset::system (" res/fonts/DejaVuSans.ttf" ));
367
- std::shared_ptr<Font> jpFont = loadFont (asset::system (" res/fonts/NotoSansJP-Medium.otf" ));
368
- nvgAddFallbackFontId (vg, uiFont->handle , jpFont->handle );
369
- std::shared_ptr<Font> emojiFont = loadFont (asset::system (" res/fonts/NotoEmoji-Medium.ttf" ));
370
- nvgAddFallbackFontId (vg, uiFont->handle , emojiFont->handle );
371
- bndSetFont (uiFont->handle );
367
+ if (uiFont) {
368
+ std::shared_ptr<Font> jpFont = loadFont (asset::system (" res/fonts/NotoSansJP-Medium.otf" ));
369
+ if (jpFont)
370
+ nvgAddFallbackFontId (vg, uiFont->handle , jpFont->handle );
371
+ std::shared_ptr<Font> scFont = loadFont (asset::system (" res/fonts/NotoSansSC-Medium.otf" ));
372
+ if (scFont)
373
+ nvgAddFallbackFontId (vg, uiFont->handle , scFont->handle );
374
+ std::shared_ptr<Font> emojiFont = loadFont (asset::system (" res/fonts/NotoEmoji-Medium.ttf" ));
375
+ if (emojiFont)
376
+ nvgAddFallbackFontId (vg, uiFont->handle , emojiFont->handle );
377
+ bndSetFont (uiFont->handle );
378
+ }
372
379
373
380
if (APP->scene ) {
374
381
widget::Widget::ContextCreateEvent e;
You can’t perform that action at this time.
0 commit comments