satoru-render 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/core.js +3 -3
- package/dist/satoru-single.js +0 -0
- package/dist/satoru.wasm +0 -0
- package/dist/web-workers.js +5 -6
- package/dist/workers-parent.js +4 -5
- package/package.json +3 -3
package/dist/workers-parent.js
CHANGED
|
@@ -270,8 +270,7 @@ async function resolveGoogleFonts(resource, userAgent) {
|
|
|
270
270
|
let targetFamily = family;
|
|
271
271
|
let forceNormalStyle = false;
|
|
272
272
|
if (targetFamily.includes("Noto Sans JP") || targetFamily.includes("Noto Serif JP") || targetFamily.includes("CJK")) forceNormalStyle = true;
|
|
273
|
-
|
|
274
|
-
let googleFontUrl = `https://fonts.googleapis.com/css2?family=${encodeURIComponent(targetFamily)}:ital,wght@${useItalic ? "1" : "0"},${weight}&display=swap`;
|
|
273
|
+
let googleFontUrl = `https://fonts.googleapis.com/css2?family=${encodeURIComponent(targetFamily)}:ital,wght@${italic && !forceNormalStyle ? "1" : "0"},${weight}&display=swap`;
|
|
275
274
|
if (text) {
|
|
276
275
|
if (text.length < 800) googleFontUrl += `&text=${encodeURIComponent(text)}`;
|
|
277
276
|
}
|
|
@@ -389,12 +388,12 @@ var SatoruBase = class {
|
|
|
389
388
|
try {
|
|
390
389
|
const result = mod.merge_pdfs(instancePtr, pagePdfs);
|
|
391
390
|
if (!result) return new Uint8Array();
|
|
392
|
-
return new Uint8Array(result
|
|
391
|
+
return new Uint8Array(result);
|
|
393
392
|
} finally {
|
|
394
393
|
mod.destroy_instance(instancePtr);
|
|
395
394
|
}
|
|
396
395
|
}
|
|
397
|
-
|
|
396
|
+
let mod = await this.getModule();
|
|
398
397
|
const { width, height = 0, fonts, images, css, logLevel, onLog } = options;
|
|
399
398
|
if (!options.userAgent) options.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
|
|
400
399
|
if (url && !value) {
|
|
@@ -486,7 +485,7 @@ var SatoruBase = class {
|
|
|
486
485
|
return new Uint8Array();
|
|
487
486
|
}
|
|
488
487
|
if (format === "svg") return new TextDecoder().decode(result);
|
|
489
|
-
return new Uint8Array(result
|
|
488
|
+
return new Uint8Array(result);
|
|
490
489
|
} finally {
|
|
491
490
|
mod.destroy_instance(instancePtr);
|
|
492
491
|
mod.logLevel = prevLogLevel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "satoru-render",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "High-fidelity HTML/CSS to SVG/PNG/PDF converter running in WebAssembly",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
"cloudflare-workers"
|
|
123
123
|
],
|
|
124
124
|
"devDependencies": {
|
|
125
|
-
"@types/jsdom": "28.0.
|
|
125
|
+
"@types/jsdom": "28.0.1",
|
|
126
126
|
"@types/react": "^19.2.14",
|
|
127
127
|
"@types/react-dom": "^19.2.3",
|
|
128
|
-
"rolldown": "1.0.0-rc.
|
|
128
|
+
"rolldown": "1.0.0-rc.11",
|
|
129
129
|
"typescript": "^5.9.3",
|
|
130
130
|
"vitest": "^4.1.0"
|
|
131
131
|
},
|