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(engine-render): upgrade opentype.js to 2.0.0 (#6878)

白熱e52a2a87e0c5
diff --git a/packages/engine-render/package.json b/packages/engine-render/package.json
index 2342ef16df..8fea1b3a1b 100644
--- a/packages/engine-render/package.json
+++ b/packages/engine-render/package.json
@@ -73,7 +73,7 @@
"@univerjs/core": "workspace:*",
"cjk-regex": "^3.4.0",
"franc-min": "^6.2.0",
- "opentype.js": "^1.3.4"
+ "opentype.js": "^2.0.0"
},
"devDependencies": {
"@types/opentype.js": "^1.3.9",
diff --git a/packages/engine-render/src/components/docs/layout/shaping-engine/__tests__/text-shaping-engine.spec.ts b/packages/engine-render/src/components/docs/layout/shaping-engine/__tests__/text-shaping-engine.spec.ts
index 8613845197..086cfa477e 100644
--- a/packages/engine-render/src/components/docs/layout/shaping-engine/__tests__/text-shaping-engine.spec.ts
+++ b/packages/engine-render/src/components/docs/layout/shaping-engine/__tests__/text-shaping-engine.spec.ts
@@ -57,7 +57,7 @@ const h = vi.hoisted(() => {
};
});
-vi.mock('opentype.js/dist/opentype.module.js', () => ({
+vi.mock('opentype.js', () => ({
parse: h.parse,
}));
diff --git a/packages/engine-render/src/components/docs/layout/shaping-engine/text-shaping.ts b/packages/engine-render/src/components/docs/layout/shaping-engine/text-shaping.ts
index 008592242a..4227e6c62b 100644
--- a/packages/engine-render/src/components/docs/layout/shaping-engine/text-shaping.ts
+++ b/packages/engine-render/src/components/docs/layout/shaping-engine/text-shaping.ts
@@ -17,8 +17,7 @@
import type { IDocumentBody, IStyleBase, Nullable } from '@univerjs/core';
import type Opentype from 'opentype.js';
import { BooleanNumber } from '@univerjs/core';
-// @ts-ignore
-import { parse } from 'opentype.js/dist/opentype.module.js';
+import { parse } from 'opentype.js';
import { DEFAULT_FONTFACE_PLANE } from '../../../../basics/const';
import { getFirstGrapheme, isEmojiGrapheme } from '../../../../basics/tools';
import { fontLibrary } from './font-library';
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b3e7338cd4..1b88182855 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1399,8 +1399,8 @@ importers:
specifier: ^6.2.0
version: 6.2.0
opentype.js:
- specifier: ^1.3.4
- version: 1.3.4
+ specifier: ^2.0.0
+ version: 2.0.0
devDependencies:
'@types/opentype.js':
specifier: ^1.3.9
@@ -5409,6 +5409,13 @@ packages:
cpu: [arm]
os: [linux]
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-n7Ofp0mx+aB2cC+Sdy5YtMnXtY9lchnHbY+3Yt0uq9JsWQExf4f5Whu0tK0R8Jdc9S6RchTHjIFY7uc92puOVQ==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
'@rolldown/[email protected]':
resolution: {integrity: sha512-eBZ/u8iAK9SoHGanqe/jrPnY0JvBN6iXbVOsbO38mbz+ZJsaobExAm1Iu+rxa4S1l2FjG0qEZn4Rc6X8n+9M+w==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -5486,6 +5493,13 @@ packages:
os: [linux]
libc: [glibc]
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-Dfn7iak9BcMMePxcoJfpSbWqnEyrp/dRF63/8qW/eHBdOZov6x5aShLLEYGYdIeSJ6vMLK/XCVB+lGIxm41bQA==}
+ engines: {node: ^20.19.0 || >=22.12.0}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
'@rolldown/[email protected]':
resolution: {integrity: sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -9503,9 +9517,8 @@ packages:
resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-d2JE9RP/6uagpQAVtJoF0pJJA/fgai89Cc50Yp0EJHk+eLp6QQ7gBoblsnubRULNY132I0J1QKMJ+JTbMqz4sw==}
- engines: {node: '>= 8.0.0'}
+ resolution: {integrity: sha512-kCyjv6xdDY1W/jLWZ/L3QhhTlKUqDZMQ5+Jdlw12b3dXkKNpYBqqlMMj0YDQPShWFTMwgZI1hG14kN3XUDSg/A==}
hasBin: true
@@ -10633,9 +10646,6 @@ packages:
resolution: {integrity: sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==}
engines: {node: '>=20'}
- resolution: {integrity: sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==}
-
resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==}
engines: {node: '>= 0.4'}
@@ -10811,9 +10821,6 @@ packages:
resolution: {integrity: sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==}
engines: {node: '>=18'}
- resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==}
-
resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}
@@ -13578,6 +13585,9 @@ snapshots:
'@rolldown/[email protected]':
optional: true
+ '@rolldown/[email protected]':
+ optional: true
+
'@rolldown/[email protected]':
optional: true
@@ -13611,6 +13621,9 @@ snapshots:
'@rolldown/[email protected]':
optional: true
+ '@rolldown/[email protected]':
+ optional: true
+
'@rolldown/[email protected]':
optional: true
@@ -18133,10 +18146,7 @@ snapshots:
is-inside-container: 1.0.0
wsl-utils: 0.1.0
- dependencies:
- string.prototype.codepointat: 0.2.1
- tiny-inflate: 1.0.3
dependencies:
@@ -19148,9 +19158,11 @@ snapshots:
'@rolldown/binding-darwin-x64': 1.0.0
'@rolldown/binding-freebsd-x64': 1.0.0
'@rolldown/binding-linux-arm-gnueabihf': 1.0.0
+ '@rolldown/binding-linux-arm64-gnu': 1.0.0
'@rolldown/binding-linux-arm64-musl': 1.0.0
'@rolldown/binding-linux-ppc64-gnu': 1.0.0
'@rolldown/binding-linux-s390x-gnu': 1.0.0
+ '@rolldown/binding-linux-x64-gnu': 1.0.0
'@rolldown/binding-linux-x64-musl': 1.0.0
'@rolldown/binding-openharmony-arm64': 1.0.0
'@rolldown/binding-wasm32-wasi': 1.0.0
@@ -19544,8 +19556,6 @@ snapshots:
get-east-asian-width: 1.5.0
strip-ansi: 7.2.0
-
dependencies:
call-bind: 1.0.8
@@ -19738,8 +19748,6 @@ snapshots:
-