update at 2026-02-10 13:47:16

This commit is contained in:
douboer
2026-02-10 13:47:16 +08:00
parent 917f210dae
commit b6742cb13a
5 changed files with 412 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ location /api/ {
sudo nginx -t && sudo systemctl reload nginx
```
## 4. systemd可选
## 4. systemdLinux可选)
仓库内提供示例:`apiserver/font2svg-api.service.example`,可复制到:
@@ -98,7 +98,38 @@ sudo systemctl enable --now font2svg-api
sudo systemctl status font2svg-api
```
## 5. 约束
## 5. launchdmacOS可选
仓库内提供示例:`apiserver/font2svg-api.launchd.plist.example`
1. 复制并按本机路径修改(重点改 Python 路径和项目路径):
```bash
cp apiserver/font2svg-api.launchd.plist.example ~/Library/LaunchAgents/cn.biboer.font2svg-api.plist
```
2. 加载并启动:
```bash
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/cn.biboer.font2svg-api.plist
launchctl enable gui/$(id -u)/cn.biboer.font2svg-api
launchctl kickstart -k gui/$(id -u)/cn.biboer.font2svg-api
```
3. 查看状态与日志:
```bash
launchctl print gui/$(id -u)/cn.biboer.font2svg-api
tail -f /tmp/font2svg-api.log
```
4. 停止并卸载:
```bash
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/cn.biboer.font2svg-api.plist
```
## 6. 约束
- 字体解析完全基于字体清单(默认 `miniprogram/assets/fonts.json`),字体文件统一从 `<static-root>/fonts/` 读取,`fontId` 必须存在。
- 服务端启用 CORS允许小程序访问。