@pixldocs/canvas-renderer 0.5.142 → 0.5.145

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.
@@ -2657,7 +2657,7 @@ async function loadFontshareFont(fontFamily, slug, weights) {
2657
2657
  if (existing) return existing;
2658
2658
  const promise = (async () => {
2659
2659
  try {
2660
- const weightStr = (weights || [300, 400, 500, 700]).join(",");
2660
+ const weightStr = (weights || [300, 400, 500, 600, 700]).join(",");
2661
2661
  const url = `https://api.fontshare.com/v2/css?f[]=${slug}@${weightStr}&display=swap`;
2662
2662
  if (document.querySelector(`link[href="${url}"]`)) return true;
2663
2663
  const link = document.createElement("link");
@@ -14742,7 +14742,7 @@ async function registerRemoteFontFaceViaProxy(family, requestedWeight, styleRaw)
14742
14742
  try {
14743
14743
  const weightsToRegister = /* @__PURE__ */ new Set([actualWeight]);
14744
14744
  const requestedNum = Number.isFinite(parsed) ? Math.max(100, Math.min(900, parsed)) : 400;
14745
- weightsToRegister.add(requestedNum);
14745
+ if (requestedNum === actualWeight) weightsToRegister.add(requestedNum);
14746
14746
  for (const w of weightsToRegister) {
14747
14747
  const aliasKey = `${family}|${w}|${style}|${source}`;
14748
14748
  if (registeredRemoteFontFaces.has(aliasKey)) continue;
@@ -15956,7 +15956,7 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
15956
15956
  }
15957
15957
  return svgString;
15958
15958
  }
15959
- const PACKAGE_VERSION = "0.5.142";
15959
+ const PACKAGE_VERSION = "0.5.145";
15960
15960
  const roundParityValue = (value) => {
15961
15961
  if (typeof value !== "number") return value;
15962
15962
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -16381,7 +16381,7 @@ class PixldocsRenderer {
16381
16381
  await this.waitForCanvasScene(container, cloned, i);
16382
16382
  }
16383
16383
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
16384
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CnC7-RiI.js");
16384
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-B63qQqDW.js");
16385
16385
  const prepared = preparePagesForExport(
16386
16386
  cloned.pages,
16387
16387
  canvasWidth,
@@ -17021,6 +17021,10 @@ class PixldocsRenderer {
17021
17021
  obj.dirty = true;
17022
17022
  }
17023
17023
  };
17024
+ try {
17025
+ clearFabricCharCache();
17026
+ } catch {
17027
+ }
17024
17028
  fabricInstance.getObjects().forEach(primeCharBounds);
17025
17029
  (_a = fabricInstance.calcOffset) == null ? void 0 : _a.call(fabricInstance);
17026
17030
  (_b = fabricInstance.renderAll) == null ? void 0 : _b.call(fabricInstance);
@@ -18479,7 +18483,11 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
18479
18483
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
18480
18484
  sanitizeSvgTreeForPdf(svgToDraw);
18481
18485
  try {
18482
- const { bakeTextAnchorPositionsFromLiveSvg } = await import("./vectorPdfExport-CnC7-RiI.js");
18486
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-B63qQqDW.js");
18487
+ try {
18488
+ await logTextMeasurementDiagnostic(svgToDraw);
18489
+ } catch {
18490
+ }
18483
18491
  await bakeTextAnchorPositionsFromLiveSvg(svgToDraw);
18484
18492
  } catch (e) {
18485
18493
  console.warn("[canvas-renderer][pdf-export] anchor-bake pass failed (continuing):", e);
@@ -18824,4 +18832,4 @@ export {
18824
18832
  collectFontDescriptorsFromConfig as y,
18825
18833
  collectFontsFromConfig as z
18826
18834
  };
18827
- //# sourceMappingURL=index-MJxDhnDv.js.map
18835
+ //# sourceMappingURL=index-Br7Pk6Ol.js.map