fix(编辑能力): 修复字体引用隔离与资源释放
build.yaml / build (push) Successful in 49s

This commit is contained in:
xiaoqidun committed 2026-10-28 16:07:41 +08:00
1 parent 50898934dc
commit f4429b126a
3 files changed
+9 -5

No files matched your search

+2
View File
@@ -413,7 +413,9 @@ export class RichTextSession {
}
setFont(face, data, key) {
key ||= `temp-font-${crypto.randomUUID()}`;
const previous = this.faces.get(key);
this.faces.set(key, face);
if (previous && ![...this.faces.values()].includes(previous)) document.fonts.delete(previous);
if (data) this.imports.set(key, data);
document.fonts.add(face);
this.apply({ font: key });