https://github.com/eallion/font-spider-smiley-opengraph
https://github.com/eallion/font-spider-smiley-opengraph
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eallion/font-spider-smiley-opengraph
- Owner: eallion
- Created: 2023-07-31T09:30:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-08T15:16:18.000Z (over 2 years ago)
- Last Synced: 2025-02-13T07:46:25.147Z (over 1 year ago)
- Language: HTML
- Size: 109 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Font Spider 压缩字体文件
- https://github.com/eallion/font-spider-smiley-opengraph
```bash
mkdir font-spider && cd font-spider
# 安装 Font Spider
npm install font-spider -g
# 生成 import.html 模板内容
vim import.html
# 从 Summary.json 文件中提取 Title 放入到 index.html 中
cat summary.json | jq -r '.summaries[] | "
\(.title)
"' | sed -e '//r /dev/stdin' import.html > index.html
# 生成 Title 用到的字体
font-spider index.html --no-backup --debug
```
`NotoSerifCJKsc-Regular.ttf` 字体文件放到当前目录,把生成后的字体复制到目标项目 [`Public`](https://github.com/eallion/vercel.og/tree/main/public) 中。
`summary.json` 内容来自博客仓库
`import.html` 内容:
```html
Document
@font-face {
font-family: 'import.html';
src: url('NotoSerifCJKsc-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
h1,
p {
font-family: 'import.html',sans-serif;
}
```