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.js
CHANGED
|
@@ -618,7 +618,7 @@ var convertTextToImg = ({
|
|
|
618
618
|
fontColor,
|
|
619
619
|
fontSize,
|
|
620
620
|
fontWeight,
|
|
621
|
-
fontFamily = `'
|
|
621
|
+
fontFamily = `'system-ui', 'sans-serif'`
|
|
622
622
|
}) => {
|
|
623
623
|
const canvas = document.createElement("canvas");
|
|
624
624
|
const ctx = canvas.getContext("2d");
|
|
@@ -635,8 +635,8 @@ var convertTextToImg = ({
|
|
|
635
635
|
}
|
|
636
636
|
ctx.fillStyle = fontColor ?? "black";
|
|
637
637
|
ctx.textAlign = "center";
|
|
638
|
-
ctx.font = `${fontWeight ?? "
|
|
639
|
-
console.log("font", `${fontWeight ?? "
|
|
638
|
+
ctx.font = `${fontWeight ?? "normal"} ${fontSize ?? 75}px ${fontFamily}`;
|
|
639
|
+
console.log("font", `${fontWeight ?? "normal"} ${fontSize ?? 75}px ${fontFamily}`);
|
|
640
640
|
ctx.textBaseline = "middle";
|
|
641
641
|
ctx.fillText(targetStr, canvas.width / 2, canvas.height / 2);
|
|
642
642
|
return canvas.toDataURL();
|