开发者

Javascript, Can I stretch text vertically

开发者 https://www.devze.com 2023-03-12 19:26 出处:网络
Can I Stretch text in javascript? I dont want the font b开发者_如何学编程igger because that makes it appear bolder than smaller text beside it, I just want to stretch the text vertically so its kind o

Can I Stretch text in javascript? I dont want the font b开发者_如何学编程igger because that makes it appear bolder than smaller text beside it, I just want to stretch the text vertically so its kind of deformed . This would be one div id and then normal text beside it would be another div id. Any ideas?

Thanks, -Matthew

Note: I asked this question originally in the CSS section and all anyone could recommend was horizontal stretching by setting the spacing negative.


The answer is 'no' since you cannot access the glyph of a font as a graphic object. You might be able to using HTML5's canvas object, but that is not widely supported (yet.)


Perhaps this link about cross-browser CSS transforms will help? It appears that you can specify a transformation matrix to render any (?) HTML element and there are built-in functions for scaling and skewing, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消