<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Jari,<br>
<br>
I noticed a weird problem with CreateEnigmaStrings and unicode
fonts.<br>
It occured at a forte-fortissimo created from three "f"s with the
unicode character U+E050.<br>
<br>
When calling FCString:CreateEnigmaStrings(true) the non-enigma
commands were removed (!), when the string contained<b> 3</b><b> or
more</b> "f"s in a row. But they were split correctly when it were
only <b>1 or 2</b> "f"s.<br>
Below is the code (Bravura is used just for demonstration
purposes,it holds the violin clef on U+E050, not an "f"). The first
two splits work fine, while the next two runs return a length of
zero and an empty string.<br>
And of course, it also works fine for the non-unicode range (fifth
run).<br>
The same bug occurs if you change the unicode value to any other
character from the widespread U+EXXX range.<br>
<br>
Any ideas ?<br>
<br>
All the best,<br>
Jan<br>
<br>
function SplitEnigma(text)<br>
--Create enigma strings and print all non-enigma commands (i.e.
all texts)<br>
print("String to split:",text.LuaString)<br>
local splittext=text:CreateEnigmaStrings(true)<br>
for i in each(splittext) do<br>
if not i:IsEnigmaCommand() then<br>
print("Len:",string.len(i.LuaString),"String:",i.LuaString)<br>
end<br>
end<br>
end<br>
<br>
function UnicodeToUTF(number) --unicode to UTF conversion for
numbers between 2048 and 65535<br>
return string.char(bit32.bor(224,bit32.rshift(number,12))) ..
string.char(bit32.bor(128,bit32.band(bit32.rshift(number,6),63)))..
string.char(bit32.bor(128,bit32.band(number,63)))<br>
end<br>
<br>
local text=finale.FCString()<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)..UnicodeToUTF(57424)..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..UnicodeToUTF(57424)..UnicodeToUTF(57424)..UnicodeToUTF(57424)..UnicodeToUTF(57424)<br>
SplitEnigma(text)<br>
text.LuaString="^fontMus(Bravura,8192)^size(24)^nfx(0)"..string.char(123)..string.char(123)..string.char(123)..string.char(123)<br>
SplitEnigma(text)<br>
</body>
</html>