@canvas-components/print-design-plugin 0.1.20 → 0.1.21

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.cjs CHANGED
@@ -8701,7 +8701,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8701
8701
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8702
8702
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8703
8703
  ctx.fillStyle = "#1677ff";
8704
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8704
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${printDesign.resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8705
8705
  ctx.textBaseline = "middle";
8706
8706
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8707
8707
  const {
@@ -8748,7 +8748,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8748
8748
  1,
8749
8749
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8750
8750
  );
8751
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8751
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${printDesign.resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8752
8752
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8753
8753
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8754
8754
  ctx.textBaseline = "middle";
@@ -9092,7 +9092,7 @@ function tableMarkup(element, data) {
9092
9092
  const textCss = (column, zone, cell) => {
9093
9093
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9094
9094
  const style = { ...columnStyle, ...cell?.textStyle };
9095
- return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9095
+ return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9096
9096
  };
9097
9097
  const cellCss = (column, cell) => {
9098
9098
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9121,7 +9121,7 @@ function tableMarkup(element, data) {
9121
9121
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9122
9122
  const style = { ...column.cellStyle, ...cell?.textStyle };
9123
9123
  const size = Math.max(1, printDesign.cssNumber(style.fontSize, fontSize));
9124
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9124
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${printDesign.resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9125
9125
  const padding = resolveTableCellPadding(column, element, cell);
9126
9126
  const contentWidth = Math.max(
9127
9127
  1,
@@ -9148,7 +9148,7 @@ function tableMarkup(element, data) {
9148
9148
  );
9149
9149
  const regionMarkup = (content, region, style) => {
9150
9150
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9151
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9151
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9152
9152
  };
9153
9153
  const lines = layout.lines.map(
9154
9154
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10200,6 +10200,7 @@ function tableCellText(element, cell, text, data) {
10200
10200
  rotation: element.rotation,
10201
10201
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10202
10202
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10203
+ fontStyle: configured?.textStyle?.fontStyle,
10203
10204
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10204
10205
  lineHeight: 1.2,
10205
10206
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
package/dist/index.js CHANGED
@@ -8699,7 +8699,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8699
8699
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8700
8700
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8701
8701
  ctx.fillStyle = "#1677ff";
8702
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8702
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8703
8703
  ctx.textBaseline = "middle";
8704
8704
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8705
8705
  const {
@@ -8746,7 +8746,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8746
8746
  1,
8747
8747
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8748
8748
  );
8749
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8749
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8750
8750
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8751
8751
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8752
8752
  ctx.textBaseline = "middle";
@@ -9090,7 +9090,7 @@ function tableMarkup(element, data) {
9090
9090
  const textCss = (column, zone, cell) => {
9091
9091
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9092
9092
  const style = { ...columnStyle, ...cell?.textStyle };
9093
- return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9093
+ return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9094
9094
  };
9095
9095
  const cellCss = (column, cell) => {
9096
9096
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9119,7 +9119,7 @@ function tableMarkup(element, data) {
9119
9119
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9120
9120
  const style = { ...column.cellStyle, ...cell?.textStyle };
9121
9121
  const size = Math.max(1, cssNumber(style.fontSize, fontSize));
9122
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9122
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9123
9123
  const padding = resolveTableCellPadding(column, element, cell);
9124
9124
  const contentWidth = Math.max(
9125
9125
  1,
@@ -9146,7 +9146,7 @@ function tableMarkup(element, data) {
9146
9146
  );
9147
9147
  const regionMarkup = (content, region, style) => {
9148
9148
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9149
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9149
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9150
9150
  };
9151
9151
  const lines = layout.lines.map(
9152
9152
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10198,6 +10198,7 @@ function tableCellText(element, cell, text, data) {
10198
10198
  rotation: element.rotation,
10199
10199
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10200
10200
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10201
+ fontStyle: configured?.textStyle?.fontStyle,
10201
10202
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10202
10203
  lineHeight: 1.2,
10203
10204
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
@@ -8730,7 +8730,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8730
8730
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8731
8731
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8732
8732
  ctx.fillStyle = "#1677ff";
8733
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8733
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${printDesign.resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8734
8734
  ctx.textBaseline = "middle";
8735
8735
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8736
8736
  const {
@@ -8777,7 +8777,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8777
8777
  1,
8778
8778
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8779
8779
  );
8780
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8780
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${printDesign.resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8781
8781
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8782
8782
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8783
8783
  ctx.textBaseline = "middle";
@@ -9121,7 +9121,7 @@ function tableMarkup(element, data) {
9121
9121
  const textCss = (column, zone, cell) => {
9122
9122
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9123
9123
  const style = { ...columnStyle, ...cell?.textStyle };
9124
- return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9124
+ return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9125
9125
  };
9126
9126
  const cellCss = (column, cell) => {
9127
9127
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9150,7 +9150,7 @@ function tableMarkup(element, data) {
9150
9150
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9151
9151
  const style = { ...column.cellStyle, ...cell?.textStyle };
9152
9152
  const size = Math.max(1, printDesign.cssNumber(style.fontSize, fontSize));
9153
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9153
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${printDesign.resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9154
9154
  const padding = resolveTableCellPadding(column, element, cell);
9155
9155
  const contentWidth = Math.max(
9156
9156
  1,
@@ -9177,7 +9177,7 @@ function tableMarkup(element, data) {
9177
9177
  );
9178
9178
  const regionMarkup = (content, region, style) => {
9179
9179
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9180
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9180
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9181
9181
  };
9182
9182
  const lines = layout.lines.map(
9183
9183
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10229,6 +10229,7 @@ function tableCellText(element, cell, text, data) {
10229
10229
  rotation: element.rotation,
10230
10230
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10231
10231
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10232
+ fontStyle: configured?.textStyle?.fontStyle,
10232
10233
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10233
10234
  lineHeight: 1.2,
10234
10235
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
@@ -8728,7 +8728,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8728
8728
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8729
8729
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8730
8730
  ctx.fillStyle = "#1677ff";
8731
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8731
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8732
8732
  ctx.textBaseline = "middle";
8733
8733
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8734
8734
  const {
@@ -8775,7 +8775,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8775
8775
  1,
8776
8776
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8777
8777
  );
8778
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8778
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8779
8779
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8780
8780
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8781
8781
  ctx.textBaseline = "middle";
@@ -9119,7 +9119,7 @@ function tableMarkup(element, data) {
9119
9119
  const textCss = (column, zone, cell) => {
9120
9120
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9121
9121
  const style = { ...columnStyle, ...cell?.textStyle };
9122
- return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9122
+ return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9123
9123
  };
9124
9124
  const cellCss = (column, cell) => {
9125
9125
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9148,7 +9148,7 @@ function tableMarkup(element, data) {
9148
9148
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9149
9149
  const style = { ...column.cellStyle, ...cell?.textStyle };
9150
9150
  const size = Math.max(1, cssNumber(style.fontSize, fontSize));
9151
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9151
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9152
9152
  const padding = resolveTableCellPadding(column, element, cell);
9153
9153
  const contentWidth = Math.max(
9154
9154
  1,
@@ -9175,7 +9175,7 @@ function tableMarkup(element, data) {
9175
9175
  );
9176
9176
  const regionMarkup = (content, region, style) => {
9177
9177
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9178
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9178
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9179
9179
  };
9180
9180
  const lines = layout.lines.map(
9181
9181
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10227,6 +10227,7 @@ function tableCellText(element, cell, text, data) {
10227
10227
  rotation: element.rotation,
10228
10228
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10229
10229
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10230
+ fontStyle: configured?.textStyle?.fontStyle,
10230
10231
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10231
10232
  lineHeight: 1.2,
10232
10233
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
package/dist/native.cjs CHANGED
@@ -8701,7 +8701,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8701
8701
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8702
8702
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8703
8703
  ctx.fillStyle = "#1677ff";
8704
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8704
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${printDesign.resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8705
8705
  ctx.textBaseline = "middle";
8706
8706
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8707
8707
  const {
@@ -8748,7 +8748,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8748
8748
  1,
8749
8749
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8750
8750
  );
8751
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8751
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${printDesign.resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8752
8752
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8753
8753
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8754
8754
  ctx.textBaseline = "middle";
@@ -9092,7 +9092,7 @@ function tableMarkup(element, data) {
9092
9092
  const textCss = (column, zone, cell) => {
9093
9093
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9094
9094
  const style = { ...columnStyle, ...cell?.textStyle };
9095
- return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9095
+ return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9096
9096
  };
9097
9097
  const cellCss = (column, cell) => {
9098
9098
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9121,7 +9121,7 @@ function tableMarkup(element, data) {
9121
9121
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9122
9122
  const style = { ...column.cellStyle, ...cell?.textStyle };
9123
9123
  const size = Math.max(1, printDesign.cssNumber(style.fontSize, fontSize));
9124
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9124
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${printDesign.resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9125
9125
  const padding = resolveTableCellPadding(column, element, cell);
9126
9126
  const contentWidth = Math.max(
9127
9127
  1,
@@ -9148,7 +9148,7 @@ function tableMarkup(element, data) {
9148
9148
  );
9149
9149
  const regionMarkup = (content, region, style) => {
9150
9150
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9151
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9151
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9152
9152
  };
9153
9153
  const lines = layout.lines.map(
9154
9154
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10200,6 +10200,7 @@ function tableCellText(element, cell, text, data) {
10200
10200
  rotation: element.rotation,
10201
10201
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10202
10202
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10203
+ fontStyle: configured?.textStyle?.fontStyle,
10203
10204
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10204
10205
  lineHeight: 1.2,
10205
10206
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
package/dist/native.js CHANGED
@@ -8699,7 +8699,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8699
8699
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8700
8700
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8701
8701
  ctx.fillStyle = "#1677ff";
8702
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8702
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8703
8703
  ctx.textBaseline = "middle";
8704
8704
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8705
8705
  const {
@@ -8746,7 +8746,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8746
8746
  1,
8747
8747
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8748
8748
  );
8749
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8749
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8750
8750
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8751
8751
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8752
8752
  ctx.textBaseline = "middle";
@@ -9090,7 +9090,7 @@ function tableMarkup(element, data) {
9090
9090
  const textCss = (column, zone, cell) => {
9091
9091
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9092
9092
  const style = { ...columnStyle, ...cell?.textStyle };
9093
- return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9093
+ return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9094
9094
  };
9095
9095
  const cellCss = (column, cell) => {
9096
9096
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9119,7 +9119,7 @@ function tableMarkup(element, data) {
9119
9119
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9120
9120
  const style = { ...column.cellStyle, ...cell?.textStyle };
9121
9121
  const size = Math.max(1, cssNumber(style.fontSize, fontSize));
9122
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9122
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9123
9123
  const padding = resolveTableCellPadding(column, element, cell);
9124
9124
  const contentWidth = Math.max(
9125
9125
  1,
@@ -9146,7 +9146,7 @@ function tableMarkup(element, data) {
9146
9146
  );
9147
9147
  const regionMarkup = (content, region, style) => {
9148
9148
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9149
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9149
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9150
9150
  };
9151
9151
  const lines = layout.lines.map(
9152
9152
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10198,6 +10198,7 @@ function tableCellText(element, cell, text, data) {
10198
10198
  rotation: element.rotation,
10199
10199
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10200
10200
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10201
+ fontStyle: configured?.textStyle?.fontStyle,
10201
10202
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10202
10203
  lineHeight: 1.2,
10203
10204
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
package/dist/react.cjs CHANGED
@@ -8726,7 +8726,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8726
8726
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8727
8727
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8728
8728
  ctx.fillStyle = "#1677ff";
8729
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8729
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${printDesign.resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8730
8730
  ctx.textBaseline = "middle";
8731
8731
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8732
8732
  const {
@@ -8773,7 +8773,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8773
8773
  1,
8774
8774
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8775
8775
  );
8776
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8776
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${printDesign.resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8777
8777
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8778
8778
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8779
8779
  ctx.textBaseline = "middle";
@@ -9117,7 +9117,7 @@ function tableMarkup(element, data) {
9117
9117
  const textCss = (column, zone, cell) => {
9118
9118
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9119
9119
  const style = { ...columnStyle, ...cell?.textStyle };
9120
- return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9120
+ return `font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9121
9121
  };
9122
9122
  const cellCss = (column, cell) => {
9123
9123
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9146,7 +9146,7 @@ function tableMarkup(element, data) {
9146
9146
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9147
9147
  const style = { ...column.cellStyle, ...cell?.textStyle };
9148
9148
  const size = Math.max(1, printDesign.cssNumber(style.fontSize, fontSize));
9149
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? printDesign.PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9149
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${printDesign.resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9150
9150
  const padding = resolveTableCellPadding(column, element, cell);
9151
9151
  const contentWidth = Math.max(
9152
9152
  1,
@@ -9173,7 +9173,7 @@ function tableMarkup(element, data) {
9173
9173
  );
9174
9174
  const regionMarkup = (content, region, style) => {
9175
9175
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9176
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9176
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, printDesign.cssNumber(style?.fontSize, fontSize))}pt;font-family:${printDesign.cssFont(printDesign.resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${printDesign.cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${printDesign.escapeHtml(content)}</span></div>`;
9177
9177
  };
9178
9178
  const lines = layout.lines.map(
9179
9179
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10225,6 +10225,7 @@ function tableCellText(element, cell, text, data) {
10225
10225
  rotation: element.rotation,
10226
10226
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10227
10227
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10228
+ fontStyle: configured?.textStyle?.fontStyle,
10228
10229
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10229
10230
  lineHeight: 1.2,
10230
10231
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
package/dist/react.js CHANGED
@@ -8724,7 +8724,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8724
8724
  ctx.fillStyle = conditional?.color ?? cell?.color ?? column[zone === "header" ? "headerStyle" : zone === "summary" ? "summaryStyle" : "cellStyle"]?.color ?? style.color ?? "#000000";
8725
8725
  if (zone === "body" && resolvePrintTableCellContentType(column, rawValue) === "link" && !conditional?.color && !cell?.color)
8726
8726
  ctx.fillStyle = "#1677ff";
8727
- ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${textStyle?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8727
+ ctx.font = `${textStyle?.fontStyle ?? "normal"} ${conditional?.fontWeight ?? textStyle?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")} ${fontSize}px ${resolvePrintDesignFontFamily(textStyle?.fontFamily ?? element.fontFamily)}`;
8728
8728
  ctx.textBaseline = "middle";
8729
8729
  ctx.textAlign = cell?.align ?? (zone === "header" ? column.headerAlign ?? column.align ?? element.cellAlign ?? "left" : column.align ?? column.cellStyle?.textAlign ?? element.cellAlign ?? "left");
8730
8730
  const {
@@ -8771,7 +8771,7 @@ function drawTableElement(element, { ctx, x, y, width, scale, data, onImageLoad
8771
8771
  1,
8772
8772
  (textStyle2?.fontSize ?? element.fontSize ?? 10) * 96 / 72
8773
8773
  );
8774
- ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${textStyle2?.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
8774
+ ctx.font = `${textStyle2?.italic ? "italic " : ""}${textStyle2?.bold ? "bold " : ""}${size}px ${resolvePrintDesignFontFamily(textStyle2?.fontFamily)}`;
8775
8775
  ctx.fillStyle = textStyle2?.color ?? defaultTextColor;
8776
8776
  ctx.textAlign = textStyle2?.textAlign ?? "center";
8777
8777
  ctx.textBaseline = "middle";
@@ -9115,7 +9115,7 @@ function tableMarkup(element, data) {
9115
9115
  const textCss = (column, zone, cell) => {
9116
9116
  const columnStyle = zone === "header" ? column.headerStyle : zone === "summary" ? column.summaryStyle : column.cellStyle;
9117
9117
  const style = { ...columnStyle, ...cell?.textStyle };
9118
- return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY)};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9118
+ return `font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily ?? element.fontFamily))};font-weight:${style?.fontWeight ?? element.fontWeight ?? (zone === "header" ? "bold" : "normal")};font-style:${style?.fontStyle ?? "normal"};`;
9119
9119
  };
9120
9120
  const cellCss = (column, cell) => {
9121
9121
  const padding = resolveTableCellPadding(column, element, cell);
@@ -9144,7 +9144,7 @@ function tableMarkup(element, data) {
9144
9144
  const text = (valueFormat ? formatPrintTableValue(value, { ...column, valueFormat }) : void 0) ?? cellText2(value);
9145
9145
  const style = { ...column.cellStyle, ...cell?.textStyle };
9146
9146
  const size = Math.max(1, cssNumber(style.fontSize, fontSize));
9147
- measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${style.fontFamily ?? element.fontFamily ?? PRINT_DESIGN_DEFAULT_FONT_FAMILY}`;
9147
+ measureContext.font = `${style.fontStyle ?? "normal"} ${conditionalWeight ?? style.fontWeight ?? element.fontWeight ?? "normal"} ${size * 96 / 72}px ${resolvePrintDesignFontFamily(style.fontFamily ?? element.fontFamily)}`;
9148
9148
  const padding = resolveTableCellPadding(column, element, cell);
9149
9149
  const contentWidth = Math.max(
9150
9150
  1,
@@ -9171,7 +9171,7 @@ function tableMarkup(element, data) {
9171
9171
  );
9172
9172
  const regionMarkup = (content, region, style) => {
9173
9173
  const polygon = region.points.map(([x, y]) => `${x * 100}% ${y * 100}%`).join(",");
9174
- return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(style?.fontFamily)};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9174
+ return `<div style="position:absolute;inset:0;clip-path:polygon(${polygon})"><span style="position:absolute;left:${region.centerX * 100}%;top:${region.centerY * 100}%;transform:translate(-50%,-50%);display:block;width:50%;max-height:36%;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;text-align:${cssAlign2(style?.textAlign)};font-size:${Math.max(1, cssNumber(style?.fontSize, fontSize))}pt;font-family:${cssFont(resolvePrintDesignFontFamily(style?.fontFamily))};font-weight:${style?.bold ? "bold" : "normal"};font-style:${style?.italic ? "italic" : "normal"};color:${cssColor(style?.color, textColor)};${hideTextOnPrint ? "opacity:0;" : ""}">${escapeHtml(content)}</span></div>`;
9175
9175
  };
9176
9176
  const lines = layout.lines.map(
9177
9177
  ([start, end]) => `<line x1="${start[0]}" y1="${start[1]}" x2="${end[0]}" y2="${end[1]}" stroke="${borderColor}" style="stroke-width:${Math.max(0.1, borderWidth)}mm" vector-effect="non-scaling-stroke"/>`
@@ -10223,6 +10223,7 @@ function tableCellText(element, cell, text, data) {
10223
10223
  rotation: element.rotation,
10224
10224
  fontSize: configured?.textStyle?.fontSize ?? column.cellStyle?.fontSize ?? element.fontSize ?? 10,
10225
10225
  fontFamily: configured?.textStyle?.fontFamily ?? column.cellStyle?.fontFamily ?? element.fontFamily,
10226
+ fontStyle: configured?.textStyle?.fontStyle,
10226
10227
  fontWeight: configured?.textStyle?.fontWeight ?? column.cellStyle?.fontWeight ?? element.fontWeight,
10227
10228
  lineHeight: 1.2,
10228
10229
  textAlign: alignment === "right" ? "right" : alignment === "center" ? "center" : "left",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canvas-components/print-design-plugin",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Native and React plugin bundle for print design.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,16 +49,16 @@
49
49
  "acorn": "^8.15.0",
50
50
  "@canvas-components/barcode": "0.2.3",
51
51
  "@canvas-components/chart": "0.3.9",
52
+ "@canvas-components/print-design": "0.1.14",
53
+ "@canvas-components/print": "0.1.1",
52
54
  "@canvas-components/icons": "0.1.2",
53
55
  "@canvas-components/qrcode": "0.2.3",
54
- "@canvas-components/print": "0.1.1",
55
- "@canvas-components/print-design": "0.1.14",
56
56
  "@canvas-components/utils": "0.2.10"
57
57
  },
58
58
  "peerDependencies": {
59
- "@canvas-components/list-table": ">=0.3.56",
60
- "@canvas-components/react-components": ">=0.3.30",
61
- "@canvas-components/react-print-design": ">=0.1.20",
59
+ "@canvas-components/list-table": ">=0.3.57",
60
+ "@canvas-components/react-components": ">=0.3.31",
61
+ "@canvas-components/react-print-design": ">=0.1.21",
62
62
  "react": ">=16.8.0",
63
63
  "react-dom": ">=16.8.0"
64
64
  },
@@ -85,9 +85,9 @@
85
85
  "devDependencies": {
86
86
  "react": "^18.3.1",
87
87
  "react-dom": "^18.3.1",
88
- "@canvas-components/list-table": "0.3.56",
89
- "@canvas-components/react-print-design": "0.1.20",
90
- "@canvas-components/react-components": "0.3.30"
88
+ "@canvas-components/list-table": "0.3.57",
89
+ "@canvas-components/react-print-design": "0.1.21",
90
+ "@canvas-components/react-components": "0.3.31"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "pnpm run check:boundaries && tsup --config tsup.config.ts",