@pixldocs/canvas-renderer 0.5.138 → 0.5.140
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/dist/{index-CkbBhnZd.cjs → index-DhQsu_MH.cjs} +24 -14
- package/dist/{index-CkbBhnZd.cjs.map → index-DhQsu_MH.cjs.map} +1 -1
- package/dist/{index-D-I6bYGU.js → index-Dk-69Lq1.js} +24 -14
- package/dist/{index-D-I6bYGU.js.map → index-Dk-69Lq1.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BGqNP_R0.js → vectorPdfExport-CAZ5WjdB.js} +4 -4
- package/dist/{vectorPdfExport-BGqNP_R0.js.map → vectorPdfExport-CAZ5WjdB.js.map} +1 -1
- package/dist/{vectorPdfExport-Bw9l0p9C.cjs → vectorPdfExport-uR2FxMCo.cjs} +4 -4
- package/dist/{vectorPdfExport-Bw9l0p9C.cjs.map → vectorPdfExport-uR2FxMCo.cjs.map} +1 -1
- package/package.json +1 -1
|
@@ -14740,14 +14740,24 @@ async function registerRemoteFontFaceViaProxy(family, requestedWeight, styleRaw)
|
|
|
14740
14740
|
const dataUri = await fetchFontProxyDataUri(family, actualWeight, style, source);
|
|
14741
14741
|
if (!dataUri) continue;
|
|
14742
14742
|
try {
|
|
14743
|
-
const
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14743
|
+
const weightsToRegister = /* @__PURE__ */ new Set([actualWeight]);
|
|
14744
|
+
const requestedNum = Number.isFinite(parsed) ? Math.max(100, Math.min(900, parsed)) : 400;
|
|
14745
|
+
weightsToRegister.add(requestedNum);
|
|
14746
|
+
for (const w of weightsToRegister) {
|
|
14747
|
+
const aliasKey = `${family}|${w}|${style}|${source}`;
|
|
14748
|
+
if (registeredRemoteFontFaces.has(aliasKey)) continue;
|
|
14749
|
+
try {
|
|
14750
|
+
const face = new FontFace(family, `url("${dataUri}")`, {
|
|
14751
|
+
weight: String(w),
|
|
14752
|
+
style
|
|
14753
|
+
});
|
|
14754
|
+
await face.load();
|
|
14755
|
+
document.fonts.add(face);
|
|
14756
|
+
appendDataUriFontFaceRule(family, w, style, dataUri);
|
|
14757
|
+
registeredRemoteFontFaces.add(aliasKey);
|
|
14758
|
+
} catch {
|
|
14759
|
+
}
|
|
14760
|
+
}
|
|
14751
14761
|
return true;
|
|
14752
14762
|
} catch {
|
|
14753
14763
|
}
|
|
@@ -15939,7 +15949,7 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
15939
15949
|
}
|
|
15940
15950
|
return svgString;
|
|
15941
15951
|
}
|
|
15942
|
-
const PACKAGE_VERSION = "0.5.
|
|
15952
|
+
const PACKAGE_VERSION = "0.5.140";
|
|
15943
15953
|
const roundParityValue = (value) => {
|
|
15944
15954
|
if (typeof value !== "number") return value;
|
|
15945
15955
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -16364,7 +16374,7 @@ class PixldocsRenderer {
|
|
|
16364
16374
|
await this.waitForCanvasScene(container, cloned, i);
|
|
16365
16375
|
}
|
|
16366
16376
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
16367
|
-
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-
|
|
16377
|
+
const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CAZ5WjdB.js");
|
|
16368
16378
|
const prepared = preparePagesForExport(
|
|
16369
16379
|
cloned.pages,
|
|
16370
16380
|
canvasWidth,
|
|
@@ -16961,7 +16971,7 @@ class PixldocsRenderer {
|
|
|
16961
16971
|
maxLineWidth: lineWidths.length ? Math.max(...lineWidths) : 0
|
|
16962
16972
|
});
|
|
16963
16973
|
}
|
|
16964
|
-
if (obj
|
|
16974
|
+
if (isFabricGroupLike(obj)) {
|
|
16965
16975
|
const nextPath = [groupPath, getObjectId(obj) || obj.type || "group"].filter(Boolean).join("/");
|
|
16966
16976
|
obj.getObjects().forEach((child) => visit(child, nextPath));
|
|
16967
16977
|
}
|
|
@@ -16980,7 +16990,7 @@ class PixldocsRenderer {
|
|
|
16980
16990
|
this.logFabricTextParitySnapshot("before-stable-text-metrics", fabricInstance);
|
|
16981
16991
|
const waitForPaint = () => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
|
|
16982
16992
|
const primeCharBounds = (obj) => {
|
|
16983
|
-
if (obj
|
|
16993
|
+
if (isFabricTextboxLike(obj)) {
|
|
16984
16994
|
try {
|
|
16985
16995
|
obj.__lineWidths = [];
|
|
16986
16996
|
obj.__lineHeights = [];
|
|
@@ -18462,7 +18472,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
18462
18472
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
18463
18473
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
18464
18474
|
try {
|
|
18465
|
-
const { bakeTextAnchorPositionsFromLiveSvg } = await import("./vectorPdfExport-
|
|
18475
|
+
const { bakeTextAnchorPositionsFromLiveSvg } = await import("./vectorPdfExport-CAZ5WjdB.js");
|
|
18466
18476
|
await bakeTextAnchorPositionsFromLiveSvg(svgToDraw);
|
|
18467
18477
|
} catch (e) {
|
|
18468
18478
|
console.warn("[canvas-renderer][pdf-export] anchor-bake pass failed (continuing):", e);
|
|
@@ -18807,4 +18817,4 @@ export {
|
|
|
18807
18817
|
collectFontDescriptorsFromConfig as y,
|
|
18808
18818
|
collectFontsFromConfig as z
|
|
18809
18819
|
};
|
|
18810
|
-
//# sourceMappingURL=index-
|
|
18820
|
+
//# sourceMappingURL=index-Dk-69Lq1.js.map
|