Skip to content

Commit

Permalink
fix checkFontFace and loadFontFace
Browse files Browse the repository at this point in the history
  • Loading branch information
SeregPie committed Dec 22, 2020
1 parent af184d8 commit 22c0e71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ let Class = class extends AbstractDynamicTexture {

checkFontFace() {
try {
let {
font,
lines,
} = this;
return lines.every(text => document.fonts.check(font, text));
let {font} = this;
return document.fonts.check(font);
} catch {
// pass
}
Expand All @@ -77,11 +74,8 @@ let Class = class extends AbstractDynamicTexture {

async loadFontFace() {
try {
let {
font,
lines,
} = this;
await Promise.all(lines.map(text => document.fonts.load(font, text)));
let {font} = this;
await document.fonts.load(font);
} catch {
// pass
}
Expand Down

0 comments on commit 22c0e71

Please sign in to comment.