feat(渲染编辑): 完善渲染编辑验签并优化性能
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-10-02 13:08:34 +08:00
1 parent 9c5ce1d66f
commit ac198f3351
56 files changed
+3029 -825

No files matched your search

+9 -3
View File
@@ -49,8 +49,14 @@ func (e *Editor) AddFont(file FontFile, index int) (string, error) {
if err != nil {
return "", err
}
data := parsed.Data
key := editorResourceKey{checksum: sha256.Sum256(data)}
return e.addFontResource(parsed, sha256.Sum256(parsed.Data))
}
// addFontResource 注册已解析的只读字体,各文档独立分配标识和包内路径
// 入参: parsed 字体资源, checksum 字体数据摘要
// 返回: string 字体标识, error 标识准备错误
func (e *Editor) addFontResource(parsed *FontResource, checksum [32]byte) (string, error) {
key := editorResourceKey{checksum: checksum}
if id, ok := e.resourceID[key]; ok {
return id, nil
}
@@ -62,7 +68,7 @@ func (e *Editor) AddFont(file FontFile, index int) (string, error) {
definition.ID = id
resource := editorResource{
name: e.packageName("Res/Fonts/Font_" + id + parsed.Extension),
data: data,
data: parsed.Data,
font: &definition,
}
resource.font.FontFile = "/" + resource.name