Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

chore: add fonts check defense (#3811)

ybzky192da796c39b
diff --git a/packages/engine-render/src/components/docs/layout/shaping-engine/font-library.ts b/packages/engine-render/src/components/docs/layout/shaping-engine/font-library.ts
index 536aff958c..a165e674a9 100644
--- a/packages/engine-render/src/components/docs/layout/shaping-engine/font-library.ts
+++ b/packages/engine-render/src/components/docs/layout/shaping-engine/font-library.ts
@@ -202,6 +202,10 @@ function compareFontInfoDistance(a: FontDistance, b: FontDistance) {
}
async function checkLocalFontsPermission() {
+ if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
+ return;
+ }
+
if (typeof window === 'undefined') {
return;
}