Eduard Kuzmenko
4 years ago
5 changed files with 44 additions and 28 deletions
@ -0,0 +1,12 @@ |
|||||||
|
/* |
||||||
|
* https://github.com/morethanwords/tweb
|
||||||
|
* Copyright (C) 2019-2021 Eduard Kuzmenko |
||||||
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
||||||
|
*/ |
||||||
|
|
||||||
|
let promise: Promise<any>; |
||||||
|
export default function loadFonts(): Promise<void> { |
||||||
|
if(promise) return promise; |
||||||
|
// @ts-ignore
|
||||||
|
return promise = 'fonts' in document ? Promise.all(['400 1rem Roboto', '500 1rem Roboto', '500 1rem tgico'].map(font => document.fonts.load(font))) : Promise.resolve(); |
||||||
|
} |
Loading…
Reference in new issue