On 02/04/14 17:39, Fraser Gordon wrote:
On 2 Apr 2014, at 15:04, Richmond <richmondmathew...@gmail.com> wrote:
and so to: http://www.unicode.org/reports/tr44/#Decomposition_Type
"PropList.txt"
would I be correct in thinking that in scripting phrases that are of this sort;|
codepointProperty(c, "Diacritic")
where you have "Diacritic" one could have any one of the PropList.txt terms?
That's the idea. Terms are case-insensitive and underscores and spaces are
considered to be equivalent. So you could say
codepointProperty("é", "Decomposition_Type") -- E-Acute, if something eats the
Unicode text
and the result (in this case) would be "Canonical".
Some property types might not be implemented and will give you a "bad property
name" error - some of the listed properties don't seem to be provided by ICU (mostly
deprecated properties).
Regards,
Fraser
OK . . . now what about this?
codepointProperty((numToChar(2347)), "Diacritic")
This is slightly silly, I know, because one can just download the
Unicode tables as PDF documents (and I do, frequently)
to see what the glyphs are. However, it might be useful to determine
what category a glyph falls into, or, for that matter,
a range of glyphs:
put 2347 into KOUNT
set the useUnicode to true
repeat until count = 2447
if codepointProperty((numToChar(KOUNT)), "Diacritic") is true then
put KOUNT && "=" && "Yup!" into line (KOUNT - 2346) of fld "Wazzat"
else
put KOUNT && "=" && "Nope!" into line (KOUNT - 2346) of fld "Wazzat"
end if
put KOUNT + 1 into KOUNT
end repeat
-------------------------------
However; having just attempted to run that script in a button in 7.0.dp 1
I got a "happy"
'bad codepoint' message
at which point I discovered a GENERAL FIELD PROBLEM with 7.0.dp 1 under
UbuntuStudio 14.04 beta:
I pasted my code into the scriptEditor, but, on attempting to change the
script to something like this:
put 2347 into KOUNT
set the useUnicode to true
repeat until count = 2447
if codepointProperty( quote & (numToChar(KOUNT)) & quote,
"Diacritic") is true then
put KOUNT && "=" && "Yup!" into line (KOUNT - 2346) of fld "Wazzat"
else
put KOUNT && "=" && "Nope!" into line (KOUNT - 2346) of fld "Wazzat"
end if
put KOUNT + 1 into KOUNT
end repeat
I could not insert the cursor, so could not type the changes.
Select, Delete and so forth just don't work right now in the script editor.
Not, frankly that it mattered, because when I fiddled around and managed
to paste that second script I got this:
"codepointProperty: bad codepoint"
Something that I am missing, obviously.
Richmond.
Richmond.
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode