[JW Lua] FCShapeDefInstructions:AddDrawChar uses signed unicode value, instead of unsigned

Jan Angermüller jan at angermueller.com
Fri Nov 27 10:56:31 CET 2015


It does, but AFAIK only through Shape Def library import as the Shape 
Def dialog has no copy/paste for unicode symbols.
But these shape def libraries work fine, so internally unicode shape are 
working fine.

I tried to change my code that automatically writes a shape def library 
with ascii or unicode to automatic shape creation within Finale and 
there I noticed the behaviour. The reading/writing of the unicode shape 
def library works fine. It's only the AddDrawChar() that doesn't work 
internally.

Jan

Am 27.11.2015 um 10:37 schrieb Jari Williamsson:
> Jan,
>
> AFAIK, Shape Designer doesn't support Unicode yet?
>
>
> Best regards,
>
> Jari Williamsson
>
>
> On 2015-11-27 01:23, Jan Angermüller wrote:
>> Jari,
>>
>> when writing a unicode value (>255) with
>> FCShapeDefInstructions:AddDrawChar there seems to be an signed/unsigned
>> value conversion somewhere. If I write for example the value 57424
>> (=0xe050 unsigned), then afterwards I will read the value -8112 (=0xe050
>> signed) and the created shape remains empty.
>> This is probably a problem in JW Lua, because when I read the value from
>> a working Finale unicode shape (for example from a library import), I
>> get the correct value 57424.
>>
>> Below you find the code snippet. I shortened it for demonstration
>> purposes. All other instructions necessary for creating the final shape
>> were removed, but the result (i.e. the readable value) is the same as
>> with the full code.
>> If you replace 57424 with an ascii value (for example the value 52 =
>> number "4"), then the shape definition works fine and the "4" appears as
>> a new shape (when using the full code).
>>
>> Jan
>>
>> local shapedef=finale.FCShapeDef()
>> local instructions=shapedef:CreateInstructions()
>> instructions:AddDrawChar(57424)   --if you replace this value with an
>> ascii value (e.g. 52), then the print function below will print 52.
>> for i in each(instructions) do
>>      if i.Tag==25699 then -- =AddDrawChar tag
>>          print("Read Value",i:GetFourbyteData(0))   -- print -8112
>> instead of 57424
>>      end
>> end
>>
>>
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>
>>
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>





More information about the JWLua mailing list