laymur 0.10.2 → 0.10.3
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.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6630,7 +6630,7 @@ function splitText(text) {
|
|
|
6630
6630
|
return text.match(/\S+|\s|\n/g) ?? [];
|
|
6631
6631
|
}
|
|
6632
6632
|
function measureTextChunk(context, chunk, style) {
|
|
6633
|
-
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;
|
|
6633
|
+
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px "${style.fontFamily}"`;
|
|
6634
6634
|
if (chunk === "\n") {
|
|
6635
6635
|
return {
|
|
6636
6636
|
width: Math.ceil(1),
|
|
@@ -6721,7 +6721,7 @@ function calculateTextSize(lines) {
|
|
|
6721
6721
|
return { width: maxLineWidth, height: totalHeight };
|
|
6722
6722
|
}
|
|
6723
6723
|
function renderText(x, y, text, style, context) {
|
|
6724
|
-
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;
|
|
6724
|
+
context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px "${style.fontFamily}"`;
|
|
6725
6725
|
if (style.enableShadow) {
|
|
6726
6726
|
context.shadowOffsetX = style.shadowOffsetX;
|
|
6727
6727
|
context.shadowOffsetY = style.shadowOffsetY;
|