[JW Lua] FCStaffSystem:CalcHeight() and Vertical Resizing

Jan Angermüller jan at angermueller.com
Thu Apr 20 21:08:35 CEST 2017


There was an old thread by Bart from Dec. 2014 about "vertical resizing" 
in FCStaffSystem:CalcHeight().
I now had a similar problem and needed to figure out the relation 
between CalcHeight(false) and CalcHeight(true).
It seems to be this one:

CalcHeight(true) = 
(CalcHeight(false)-TopMargin)*ResultingSystemScaling+TopMargin

Code snippet for a document with 85% resulting scaling:
local staffsystemslookup=finale.FCStaffSystemsLookup ()
local staffsystems = staffsystemslookup:GetCurrentPartStaffSystems ()
local ResultingSystemScaling=0.854166 --taken from FCPageFormatPrefs
staffsystem=staffsystems:FindMeasureNumber(12)
print(staffsystem:CalcHeight(true).."="..(staffsystem:CalcHeight(false)-staffsystem.TopMargin)*ResultingSystemScaling+staffsystem.TopMargin)

But I have no idea what this relation means practically.
Why should I take out TopMargin from scaling while BottomMargin is scaled?
Anyone?

Best,
Jan


Am 04.12.2014 um 18:45 schrieb Bart Visser:
> Hi Jan,
>
> Hi Jan,
>
> The documentation says "verticalresizeIf set, the vertical resizing will be taken into account in the calculation. If not set, the returned value will be as a non-resized staff system."
>
> I took that as meaning that the Page Resize would be taken into account, but I was wrong. The page resize is set to 80%. And 80% of 320 = 256. So that should be it. Thanks!
>
> Bart
>
>
>> Op 4 dec. 2014, om 17:43 heeft Jan Angermüller <jan at angermueller.com> het volgende geschreven:
>>
>> Hi Bart,
>>
>> is the page and system scaled to 100% ?
>> Otherweise you may have to take into account
>> page or system scaling factors.
>>
>> Jan
>>
>> Am 04.12.2014 17:38, schrieb Bart Visser:
>>> Hi Jari,
>>>
>>> I would like to place a page text 1,5cm blow the last staff system of a page. In order to do this, I'm trying to calculate the sum of the height of every staff system on the page. If I use the FCStaffSystem:CalcHeight() function I get an unexpected result:
>>>
>>> local s = finale.FCStaffSystem()
>>> s:Load(2)
>>> local height = s:CalcHeight(true)
>>> print(height) --> 320 but should be ±255 (2,25 cm)
>>>
>>> Would it be possible for you to explain which parts of a StaffSystem are used in the CalcHeight-function?
>>>
>>> - BottomMargin?
>>> - TopMargin?
>>> - SpaceAbove?
>>> - StaffHeight? (with a calculation to get a EPVU32?)
>>>
>>> Thanks,
>>>
>>> Bart
>>> _______________________________________________
>>> JWLua mailing list
>>> JWLua at jwmusic.nu
>>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>>
>> -- 
>> Jan Angermüller
>> Jevenstedter Str. 80
>> 22547 Hamburg
>> Tel. 040 - 28 94 84 82
>> www.angermueller.com
>>
>>
>> _______________________________________________
>> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20170420/b567f34e/attachment.htm>


More information about the JWLua mailing list