feat(settings): organize categories and include optional font storage

This commit is contained in:
eezd committed 2026-10-25 13:22:16 +08:00
1 parent 1408982782
commit 88492fdcde
15 files changed
+134 -59

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package web
import (
"encoding/json"
"io/fs"
)
// FontStorage 读取构建工具统计的内置可选字体大小,不包含默认 Maple。
func FontStorage() (int64, error) {
data, err := fs.ReadFile(Dist(), "font-storage.json")
if err != nil {
return 0, err
}
var sizes struct {
OptionalFontsSize int64 `json:"optionalFontsSize"`
}
if err := json.Unmarshal(data, &sizes); err != nil {
return 0, err
}
return sizes.OptionalFontsSize, nil
}