Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unicode rendering issues with toolbarbutton

0 views
Skip to first unread message

Ryan Li

unread,
Nov 11, 2009, 1:21:40 AM11/11/09
to dev-ext...@lists.mozilla.org
Hi all,

I'm now developing an extension which loads it toolbarbuttons
dynamically by JavaScript.
But some characters could not be rendered, the buttons show nothing,
while fetching their labels using JS proved that their labels are
correctly set. These characters are Unicode characters, like `©', `æ',
and `½'. However, some `simpler' Unicode characters could be displayed
correctly, like `á', `à', `é', `í', and `ñ'.
Moreover, I add these characters to a menuitem, they can also be
properly displayed. And when I manually add the items to XUL, they can
also be displayed.
In conclusion, the problem is: when you create some toolbarbuttons with
JS, and set the labels dynamically, some Unicode chars could not be
rendered.

The JS for creating toolbarbutton is something like this:

var button = document.createElement("toolbarbutton");
button.setAttribute("class", "char");
button.setAttribute("oncommand", "append(this);");
button.setAttribute("label", charset[charIndex]);
container.appendChild(charButton);


Could anyone tell me how to solve this problem?
Great thanks.

Regards,
Ryan Li

Ryan Li

unread,
Nov 17, 2009, 10:26:13 PM11/17/09
to
I've found the solution by removing the style sheet that assigns the
width of toolbarbutton to 2em.
But still have no idea of why XUL and JS behave differently.
0 new messages