javascript - 画布上的字体被拉伸并压扁
问题描述
当我在画布上渲染文本时,它似乎被拉伸并挤压在一起。我怎样才能解决这个问题?(图像放大以显示字体差异。两者均为 900% 缩放)
我的代码:
this.ctx.textAlign = "left";
this.ctx.textBaseline = "middle";
this.ctx.font = "10px Verdana";
this.ctx.strokeStyle = 'black';
this.ctx.lineWidth = 1;
this.ctx.fillStyle = "rgba(204, 204, 204, 1)";
this.ctx.fillText(text, startX, startY);
解决方案
推荐阅读
- google-apps-script - 如何在 Google Scripts 中输入提示 Google Types?
- c# - Xamarin Forms Syncfusion - 异步数据绑定不适用于 SfCombobox
- node.js - 我们可以使用 PM2 来扩展节点 js 网络服务器吗?港口呢?
- html - If-else 函数不运行
- javascript - 循环NodeJS中的异步/等待不阻塞循环执行
- reactjs - Nextjs的这种保护路由解决方案是否可用?
- javascript - 控制流发出多个 if 语句
- java - 如何在 jsp 页面上仅查看我的工作表名称
- ruby-on-rails - 在设计中使用 OTP 而不是密码
- python - 标准库中最简单的可修改 Python 类/对象?