NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: lookang on September 26, 2009, 04:03:45 am



Title: problem with Ejs 4.2 new text objects cannot display "^o" as subscript string.
Post by: lookang on September 26, 2009, 04:03:45 am
Hi Prof,

Ejs 4.2 new text objects cannot display "^o" as subscript string, how to overcome ?

i am exploring to update to newer objects to submit the models i have made in projectile motion to http://www.compadre.org/

the codes is:

s_alpha =alphasymbol+"= "+double2String(theta,1.)+"^o" ; // to make display 2.30=vx instead of 2.3000000001

any idea how to display superscripts in Ejs 4.2 new text?


Title: Re: problem with Ejs 4.2 new text objects cannot display "^o" as subscript string.
Post by: Fu-Kwun Hwang on September 26, 2009, 06:01:10 pm
Please write down where is the code: which page/tab/...etc. so that I can find your code easily.
It seems to be a bug. I would suggest you to talk to Paco directly.
You can use two strings to display what you want (need to calculate coordinate properly).


Title: Re: problem with Ejs 4.2 new text objects cannot display "^o" as subscript string.
Post by: lookang on September 27, 2009, 08:08:27 pm
i will wait for the bug fixed for Ejs 4.2 version Ejs_4.2_010909 and later ;D

very painful to redo the codes for subscripts :P

thanks!


Title: Re: problem with Ejs 4.2 new text objects cannot display "^o" as subscript string.
Post by: fem@um.es on October 04, 2009, 06:00:32 am
Ejs 4.2 new text objects cannot display "^o" as subscript string, how to overcome ?
any idea how to display superscripts in Ejs 4.2 new text?
Text elements can only display superscripts (and subscripts) if the "Pixel Size" property is set to true. (The default is false.) The reason is that the underlying code uses some tricks with the fonts that produce the effect of superscripts. When drawing the text in world units (something that was not possible with old elements) the rendering cannot fulfill this requirement.
Solution: Set the "Pixel Size" property of text elements to true.