(name, link)
| 237 | } |
| 238 | |
| 239 | async function downloadFont(name, link) { |
| 240 | const FONT_DIR = Url.join(DATA_STORAGE, "fonts"); |
| 241 | const FONT_FILE = Url.join(FONT_DIR, name); |
| 242 | |
| 243 | const fs = fsOperation(FONT_FILE); |
| 244 | if (await fs.exists()) return FONT_FILE; |
| 245 | |
| 246 | if (!(await fsOperation(FONT_DIR).exists())) { |
| 247 | await fsOperation(DATA_STORAGE).createDirectory("fonts"); |
| 248 | } |
| 249 | |
| 250 | const font = await fsOperation(link).readFile(); |
| 251 | console.log("fonts content : ", font); |
| 252 | await fsOperation(FONT_DIR).createFile(name, font); |
| 253 | |
| 254 | return FONT_FILE; |
| 255 | } |
| 256 | |
| 257 | function injectFontFace(name) { |
| 258 | const $style = ensureStyleElement(FONT_FACE_STYLE_ID); |
no test coverage detected