Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(menubutton.js fonts): fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer committed Oct 1, 2020
1 parent f9a1546 commit 1e62de3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controllers/menuButton.js
Expand Up @@ -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);
Expand All @@ -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");
Expand Down

0 comments on commit 1e62de3

Please sign in to comment.