feat(编辑字体): 优化多文档及版本字体清理
build.yaml / build (push) Successful in 47s

This commit is contained in:
xiaoqidun committed 2026-10-11 20:38:07 +08:00
1 parent 8864f6c7ba
commit 2e3809179b
3 files changed
+43 -13

No files matched your search

+11 -9
View File
@@ -546,17 +546,19 @@ func pruneExternalFontFiles(ctx context.Context, reader *Reader, candidates ...s
if len(removed) == 0 {
return nil
}
files, structures := make(map[string]bool), map[string]bool{"OFD.xml": true}
for i := range reader.DocumentCount() {
_, xmlFiles, err := reader.documentDependencies(ctx, i)
if err != nil {
if ctx.Err() != nil {
return ctx.Err()
}
return nil
indexes := make([]int, reader.DocumentCount())
for index := range indexes {
if err := ctx.Err(); err != nil {
return err
}
maps.Copy(structures, xmlFiles)
indexes[index] = index
}
_, structures, err := reader.documentDependencies(ctx, indexes...)
if err != nil {
return ctx.Err()
}
structures["OFD.xml"] = true
files := make(map[string]bool)
versions := make(map[string]*editorFontXML)
names := slices.Sorted(maps.Keys(structures))
for _, name := range slices.Sorted(maps.Keys(reader.fileNames)) {