Windows 小工具字体错误
我在Windows 7中编写了一个Sidebar小工具,并添加了ag:textObject,后来通过variable.value更改了值。
但在 Windows Vista 中运行时,文本似乎会奇怪地自行压缩。
这段代码有什么问题吗?
var clock = document.getElementById("background").addTextObject("Time", "Nyala", 18, "white", 110, 500);
//This correctly displays the word 'Time' in the proper font.
clock.value = clock.value+"s";
//This causes the text to become "Times" but shrink.
//appending more sporadically causes the textObject to shrink as well.
使用 .value 是错误的方法吗?
I've written a Sidebar gadget in Windows 7, and added a g:textObject, and later on change the value through variable.value.
But when run in Windows Vista, the text seems to compress itself strangely.
Is there anything wrong with this code?
var clock = document.getElementById("background").addTextObject("Time", "Nyala", 18, "white", 110, 500);
//This correctly displays the word 'Time' in the proper font.
clock.value = clock.value+"s";
//This causes the text to become "Times" but shrink.
//appending more sporadically causes the textObject to shrink as well.
Is using the .value the wrong way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改文本字符串不会更新 g:text 对象的宽度或高度。这是一个已知问题,出于兼容性目的可能不会得到修复。您必须手动重置宽度和高度更改值:
Changing the text string doesn't update the width or height of the g:text object. It's a known issue that probably won't be fixed for compatibility purposes. You have to manually reset the width and height changing the value: