[英]jcanvas resize text by width and height
I'm using jcanvas and I need to resize text by width and height. 我正在使用jcanvas,我需要按宽度和高度调整文本大小。 Actually the library offers an option to scale by X and Y but I need to do the same with the width and height properties.
实际上,库提供了按X和Y缩放的选项,但我需要对width和height属性进行相同的操作。
Is it possible? 可能吗?
The only way to resize text in jCanvas is with the scaleX
, scaleY
, or scale
property. 在jCanvas中调整文本大小的唯一方法是使用
scaleX
, scaleY
或scale
属性。 The width
and height
properties (for text drawings) are read-only, so you can't change them yourself. width
和height
属性(用于文本绘图)是只读的,因此您无法自行更改它们。
$("canvas").drawText({
fillStyle: "#000",
x: 100, y: 100,
fontFamily: "sans-serif",
fontSize: 36,
text: "This text is squished",
scaleX: 0.5
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.