Unicode (was "Call for Tutorial Topics")
Elizabeth Dalton
dalton_runrev at gaeabooks.com
Fri Jul 9 21:24:19 EDT 2004
Jeanne A. E. DeVoto wrote:
> I guess I'm not sure what additional information you're looking for.
> The documentation entries regarding Unicode are short and don't
> explain the Unicode philosophy, but I'm not sure that's called for at
> this level.
Marian Petrides wrote:
> Might it suffice to refer people who want more background info on
> Unicode to www.unicode.org?
It's really not philosophy or history I'm looking for. My problems are
very RunRev specific. Here are the kinds of things I'm struggling to
figure out on my own, that I think a good tutorial could have helped with:
1 - I'm writing a children's online Chinese dictionary, so I want a text
field to hold multibyte characters (specifically Chinese and Japanese
characters). I'm using Mac OSX, so I can easily activate the input
method to enter the characters, but I can't seem to manipulate them in
any way. For example, I can't choose a font or size in the Property
Inspector, can't get or set the contents using the message box, etc. It
turns out that I need to manually (using script or messagebox) set the
textFont of the field to something like "Osaka,Japanese" (and you can't
have any extra spaces after the comma). That wasn't intuitively obvious.
2 - Ok, now I have double-byte text in a field, and I want to copy it
and display it somewhere else. I plan to use characters from the
dictionary stack and I want to have a Concentration card game which will
let kids practice recognizing Chinese characters. Unlike situations
involving plain text, I can't just say "put field 1 into field 2." I
have to say something like "put the unicodeText of field 1 into field
2". Oh yeah, and Field 2 had better already have its textFont property
set correctly, too, or the results will be gibberish. How would I have
known to even look for a "unicodeText" value? I think it took me about
an hour to figure out how to use it correctly, even after I found it.
3 - I have a solitaire tile game ported from Hypercard which lets you
click on matching tiles to remove them from the pattern-- very standard.
Each tile is a button, and when you click on them, the sound that goes
with the character is also played. In my original, I hand-drew all the
Japanese characters as icons, and set the icons and names of each button
with a shuffle script. Now I'd like to set the labels of the tiles
instead, to a multibyte value. Well, it's a good thing I wanted to
script this, because as I discovered while testing to find a good font
and size to use, you can't set the label to a multibyte or Unicode value
using the Property Inspector. You also can't just type the Unicode text
into a script or the messagebox. You need to put it in a file or field
which has had its textFont property set. After searching the
documentation, this list, and much trial and error, I found the command
I needed:
set the label of button "mu" to the unicodeText of line 1 of card field
"testUnicode"
But even that won't work unless one has also remembered to set the
textFont of the button itself.
I still haven't found an actual use for uniEncode and uniDecode. I
assume I'll find some situation within the next week or so for which
I'll need them, but it sure would be nice to know now where I'll use them.
My point is that the existing documentation on this subject resembles an
old joke in which a man lost in a hot air balloon tries to get help
figuring out where he is from someone in a window who turns out to be a
Microsoft tech support engineer, who tells him "you're in a hot air
balloon." Absolutely true, but not very helpful. Knowing the syntax of a
command does one little good unless one knows which command to use in a
given situation, and the docs are woefully low on context.
Then again, that's what a good tutorial should provide.
Regards,
Elizabeth Dalton
More information about the use-livecode
mailing list