feat(渲染能力): 优化字体名称识别,修复字体误回退
build.yaml / build (push) Successful in 39s

This commit is contained in:
xiaoqidun committed 2026-09-10 20:37:28 +08:00
1 parent f361c61dcc
commit a3435d5d8d
12 files changed
+339 -58

No files matched your search

-9
View File
@@ -16,7 +16,6 @@ package ofdgo
import (
"fmt"
"io/fs"
"path"
"sort"
)
@@ -184,14 +183,6 @@ func (r *Renderer) fontInfo(font Font) FontInfo {
return info
}
// fontFSMatchesStyle 匹配字体文件系统中的指定样式字体文件
// 入参: fsys 字体文件系统, patterns 匹配模式列表, bold 是否粗体, italic 是否斜体
// 返回: []string 字体文件列表
func fontFSMatchesStyle(fsys fs.FS, patterns []string, bold, italic bool) []string {
names, _ := fs.Glob(fsys, "*")
return fontFileMatches(fontFileCandidates(names, path.Base), patterns, bold, italic)
}
// fontUsage 统计文档字体使用次数
// 入参: doc 文档结构, pages 页面内容列表, nil表示读取文档页面
// 返回: map[string]int 字体使用次数