sales-frontend-utils 0.0.52 → 0.0.53
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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/utils/canvas-utils.cjs +3 -3
- package/dist/utils/canvas-utils.cjs.map +1 -1
- package/dist/utils/canvas-utils.js +3 -3
- package/dist/utils/canvas-utils.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -625,7 +625,7 @@ var convertTextToImg = ({
|
|
|
625
625
|
fontColor,
|
|
626
626
|
fontSize,
|
|
627
627
|
fontWeight,
|
|
628
|
-
fontFamily = `'
|
|
628
|
+
fontFamily = `'system-ui', 'sans-serif'`
|
|
629
629
|
}) => {
|
|
630
630
|
const canvas = document.createElement("canvas");
|
|
631
631
|
const ctx = canvas.getContext("2d");
|
|
@@ -642,8 +642,8 @@ var convertTextToImg = ({
|
|
|
642
642
|
}
|
|
643
643
|
ctx.fillStyle = fontColor ?? "black";
|
|
644
644
|
ctx.textAlign = "center";
|
|
645
|
-
ctx.font = `${fontWeight ?? "
|
|
646
|
-
console.log("font", `${fontWeight ?? "
|
|
645
|
+
ctx.font = `${fontWeight ?? "normal"} ${fontSize ?? 75}px ${fontFamily}`;
|
|
646
|
+
console.log("font", `${fontWeight ?? "normal"} ${fontSize ?? 75}px ${fontFamily}`);
|
|
647
647
|
ctx.textBaseline = "middle";
|
|
648
648
|
ctx.fillText(targetStr, canvas.width / 2, canvas.height / 2);
|
|
649
649
|
return canvas.toDataURL();
|