带有自定义字体的文本框边框加载不正确

发布于 2025-01-15 15:10:37 字数 282 浏览 3 评论 0原文

我尝试将新字体加载到我的 FabricJS 画布上。但是在渲染后,文本相对于其边界框的放置不正确。然而,边界框本身的大小和位置似乎不错,内容(文本)错位了。我尝试了很多事情,包括在设置文本框的属性之前等待字体正确加载,但它并没有完全成功,所以我向 SO 寻求进一步的建议。

输入图片此处描述

I tried loading a new font to my FabricJS canvas. But when after it rendered, the text is placed incorrectly in relation to its bounding box. However, the size and positioning of the bounding box itself seem to be good, the content (text) is misplaced. I tried a number of things, including waiting for the font to properly load before setting the attributes of the textbox, but it wasn't completely successful, so I am turning to SO for further suggestions.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文