-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathicon-font.mjs
More file actions
35 lines (29 loc) · 1.23 KB
/
icon-font.mjs
File metadata and controls
35 lines (29 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// DANGER: This file is ignored because it requires the "webfont" package, which has
// been compromised to some extent through https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised.
// Ideally, we will replace this with a safer alternative in the future, or restore when the package is fixed.
// import fs from "node:fs/promises";
// import path from "node:path";
// import { webfont } from "webfont";
// const svgsDir = path.resolve(`${import.meta.dirname}/../resources/icons`);
// const svgs = await fs
// .readdir(svgsDir)
// .then((files) => files.filter((file) => file.endsWith(".svg")))
// .then((files) => files.map((file) => `${svgsDir}/${file}`));
// const dest = `${import.meta.dirname}/../resources/fonts/localstack.woff`;
// async function generateFont() {
// try {
// const result = await webfont({
// files: svgs,
// formats: ["woff"],
// startUnicode: 0xe000,
// normalize: true,
// sort: false,
// });
// await fs.mkdir(path.dirname(dest), { recursive: true });
// await fs.writeFile(dest, result.woff, "binary");
// console.log(`Font created at ${path.relative(process.cwd(), dest)}`);
// } catch (error) {
// console.error("Font creation failed.", error);
// }
// }
// await generateFont();