asciify-engine 1.0.64 → 1.0.65

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
@@ -1170,8 +1170,13 @@ function sizeCanvasToContainer(canvas, container, aspect) {
1170
1170
  h = height;
1171
1171
  w = h * aspect;
1172
1172
  }
1173
- canvas.width = Math.round(w);
1174
- canvas.height = Math.round(h);
1173
+ const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
1174
+ const cssW = Math.round(w);
1175
+ const cssH = Math.round(h);
1176
+ canvas.width = Math.round(cssW * dpr);
1177
+ canvas.height = Math.round(cssH * dpr);
1178
+ canvas.style.width = cssW + "px";
1179
+ canvas.style.height = cssH + "px";
1175
1180
  }
1176
1181
  async function asciify(source, canvas, { fontSize = 10, artStyle = "classic", options = {} } = {}) {
1177
1182
  let el;