mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 16:59:27 +08:00
1 parent
50898934dc
commit
f4429b126a
3 files changed
+9
-5
No files matched your search
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user