@pixldocs/canvas-renderer 0.5.138 → 0.5.139

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.
@@ -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 face = new FontFace(family, `url("${dataUri}")`, {
14744
- weight: String(actualWeight),
14745
- style
14746
- });
14747
- await face.load();
14748
- document.fonts.add(face);
14749
- appendDataUriFontFaceRule(family, actualWeight, style, dataUri);
14750
- registeredRemoteFontFaces.add(faceKey);
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
  }
@@ -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-BGqNP_R0.js");
16377
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Cj8x52ZL.js");
16368
16378
  const prepared = preparePagesForExport(
16369
16379
  cloned.pages,
16370
16380
  canvasWidth,
@@ -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-BGqNP_R0.js");
18475
+ const { bakeTextAnchorPositionsFromLiveSvg } = await import("./vectorPdfExport-Cj8x52ZL.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-D-I6bYGU.js.map
18820
+ //# sourceMappingURL=index-O3SyxMKA.js.map