put "10²" into tCode
set the htmlText of fld "result" to tCode
The Mac does not display the superscript 2 but my Win machine does.
I see that when I create the superscript on the Mac and put the htmlText into another fld it contains the <font> </font> tag.
Now how do I get my Win machine to include the <font> tags like the Mac does?
Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Although your example doesn't seem to work for me in Revolution 4.5, it seems to work in more recent versions of LiveCode. Do you have different versions of LiveCode/Revolution installed on Win and Mac?
The following example should work on both platforms:
on mouseUp
put 102 into fld 1
set the textShift of the last char of fld 1 to -3
set the textSize of the last char of fld 1 to \
(the effective textSize of char -2 of fld 1) - 2
put the htmlText of fld 1
end mouseUp
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Sorry Klaus,
You are correct in 5.5 it does work correctly, this is for an older 4.6 app.
Mark,
The initial text is created by a user typing into a fld (on Win) that is saved as a text file and read by Mac and Win machines so I couldn't use textShift.
I had thought the htmlText property was pretty solid on both OS.
Don't suppose there is a workaround without using replace??
Thanks,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Why can't you use textShift? What kind of interface do you use for the user to enter the text? Could you use rtfText instead of htmlText and does that make a difference (I haven't tried it myself)?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
I'm not using much more then fld with a post button for an interface. Using RTFText did sort of work, the Mac displayed the superscript 2 but then the font size of the entire message was tiny. I can fix that.
Still not sure about using the TextShift, I understand how to do it just not in the context of the user entering text.
Bummer about HTMLText and LC ver < 5, ² should have been easy.
I'm good for now on this. Thanks for the help.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Please explain your interface a little more. When the user enters 102, there must be a way for the user to tell that the "2" must be superscript and apparently you don't do this by script. So, how do you do this?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
I can understand that cat and paste may cause problems, but a character map implies scripting and would allow you to use the textShift. If you'd disable the pasteKey, you'd be able to make sure that the character map is the only input method available to your users and that would solve the problem.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode