[JW Lua] Measurement Units

Gábor Orth orthgabor at gmail.com
Mon Aug 11 20:39:17 CEST 2014


Hi Jari,

My first name is the Gabor! :D
Thank you for your fast answer, it is  great help for me.
That you write down is clear for me, thank you again.

yours sincerely
Gabor




2014-08-11 20:28 GMT+02:00 Jari Williamsson <
jari.williamsson at mailbox.swipnet.se>:

> Orth,
>
> (Btw, are you using the Hungarian name order, so Orth is your first name?)
>
> Since Finale only uses EVPUs internally, all other units need to be
> converted to EVPUs. The FCString:GetMeasurement() function can turn a
> measurement string into EVPUs, so a solution could be a wrapper function,
> like in the example below.
> The string conversion supports the same measurement suffixes that Finale
> supports (e for EVPUs, c for centimeters, i for inches, etc). Please note
> that it currently only supports '.' as a decimal point.
>
> So if you just write the measurement as a Lua string inside a ToEvpus()
> call you would be able to use it. (The example will print 1134, which would
> be the EVPU equivalent of 10 centimeters.) If the string has no suffix, the
> current default measurement will be assumed.
>
> ---
> function ToEvpus(text)
>     local str = finale.FCString()
>     str.LuaString = text
>     return str:GetMeasurement(finale.MEASUREMENTUNIT_DEFAULT)
> end
>
> print ( ToEvpus("10c") )
> ---
>
> Best regards,
>
> Jari Williamsson
>
>
>
> On 2014-08-11 19:30, Gábor Orth wrote:
>
>>
>> Hi Jari,
>>
>> Firstly, thank you for your  hard work on the Lua language
>>
>> I able to write a simple, short script, by which I setting the positions
>> of the margins on a new score.
>> I have just one question.
>> Can I set the measurement units (EVPUs, Inches, etc) in the Lua code?
>> Or is it will a features of the future?
>>
>> Sorry for my english! I hope, You understand me!
>>
>>
>> Yours sincerely
>>
>>
>> --
>> www.kottagrafika.hu <http://www.kottagrafika.hu>
>>
>> Számítógépes kottagrafika, kotta archiválás, transzponálás
>>
>>
>> _______________________________________________
>> 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
>



-- 
www.kottagrafika.hu
Számítógépes kottagrafika, kotta archiválás, transzponálás
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20140811/231d7ef3/attachment-0002.html>


More information about the JWLua mailing list