sales-frontend-utils 0.0.22 → 0.0.23

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
@@ -451,7 +451,8 @@ var convertTextToImg = ({
451
451
  backgroundColor,
452
452
  fontColor,
453
453
  fontSize,
454
- fontWeight
454
+ fontWeight,
455
+ fontFamily = `'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'sans-serif', 'Arial'`
455
456
  }) => {
456
457
  const canvas = document.createElement("canvas");
457
458
  const ctx = canvas.getContext("2d");
@@ -467,8 +468,9 @@ var convertTextToImg = ({
467
468
  ctx.fillRect(0, 0, canvas.width, canvas.height);
468
469
  }
469
470
  ctx.fillStyle = fontColor ?? "black";
470
- ctx.font = `${fontSize ?? 75}px ${fontWeight ?? "bold"}`;
471
471
  ctx.textAlign = "center";
472
+ ctx.font = `${fontWeight ?? "bold"} ${fontSize ?? 75}px ${fontFamily}`;
473
+ console.log("font", `${fontWeight ?? "bold"} ${fontSize ?? 75}px ${fontFamily}`);
472
474
  ctx.textBaseline = "middle";
473
475
  ctx.fillText(targetStr, canvas.width / 2, canvas.height / 2);
474
476
  return canvas.toDataURL();