Skip to content

Commit 1bfefae

Browse files
committed
refactor: replace TTF font with WOFF2 format and update README for font conversion
1 parent 5eb375e commit 1bfefae

6 files changed

Lines changed: 46 additions & 1 deletion

File tree

astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default defineConfig({
5454
options: {
5555
variants: [
5656
{
57-
src: ["./src/assets/fonts/SymbolsNerdFontMono-Regular.ttf"],
57+
src: ["./src/assets/fonts/SymbolsNerdFontMono-Regular.woff2"],
5858
weight: "normal",
5959
style: "normal",
6060
},

fonts/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
venv

fonts/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Convert/Subset fonts to webfonts
2+
3+
Subset + convert the font to WOFF2 using fonttools:
4+
5+
- Install fonttools and brotli:
6+
```bash
7+
pip install fonttools brotli
8+
```
9+
- Subset and convert the font:
10+
```bash
11+
pyftsubset SymbolsNerdFontMono-Regular.ttf \
12+
--output-file=../src/assets/fonts/SymbolsNerdFontMono-Regular.woff2 \
13+
--flavor=woff2 \
14+
--text-file=symbols.txt \
15+
--desubroutinize
16+
```
17+
18+
**Known Issue:** The `PfEd NOT subset` warning can be ignored as it usually has no runtime impact.
File renamed without changes.

fonts/symbols.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
󰜵
4.27 KB
Binary file not shown.

0 commit comments

Comments
 (0)