From 1e62de3d2f358e99373259600c736ca83601d2ba Mon Sep 17 00:00:00 2001 From: wbfsa Date: Thu, 1 Oct 2020 14:29:57 +0800 Subject: [PATCH] fix(menubutton.js fonts): fix bug --- src/controllers/menuButton.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index e8c33597f..b1fe9bb7c 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -4392,7 +4392,7 @@ const menuButton = { ret.example = ""; itemdata.push(ret); - if(!document.fonts.check("12px "+fItem.fontName)){ + if(document.fonts && !document.fonts.check("12px "+fItem.fontName)){ if(fItem.url){ const fontface = new FontFace(fItem.fontName, `url(${fItem.url})`); document.fonts.add(fontface); @@ -4401,7 +4401,7 @@ const menuButton = { } } - document.fonts.ready.then(function() { + document.fonts && document.fonts.ready.then(function() { // Any operation that needs to be done only after all the fonts // have finished loading can go here. console.log("font ready");