[JW Lua] Measure width: different values from different methods
Jan Angermüller
jan at angermueller.com
Sat Aug 9 19:03:06 CEST 2014
Jari introduced new measure metrics in the last beta.
Below is a script that calculates three different measure widths.
I understand what the second and the third measure widths mean
(see printed text).
But I don't understand what the FCMeasure.Width means in this context.
In the online documentation it is called "relative width".
Does relative width mean, that it is more or less only important
for layout calculation, i.e. how much width the measure may take
in comparison to other measures on the same system ?
That would explain why it is sometimes bigger and sometimes smaller
than its corresponding FCCellMetrics.Width value.
Jan
--Calculating different measure widths
local region=finenv.Region()
local measure=finale.FCMeasure()
measure:Load(region.StartMeasure)
print("Measure width (how is it calculated ?):",measure.Width)
local cellmetrics=finale.FCCellMetrics()
local cell=finale.FCCell(region.StartMeasure,region.StartStaff)
cellmetrics:LoadAtCell(cell)
local cellwidth=cellmetrics.Width
print("Cell width (without clef/time sig/key sig):",cellwidth)
local spacebeforemusic=cellmetrics.MusicStartPos-cellmetrics.LeftEdge
local leftedge1=cellmetrics.LeftEdge
--get left edge from next measure
cell=finale.FCCell(region.StartMeasure+1,region.StartStaff)
cellmetrics:LoadAtCell(cell)
local leftedge2=cellmetrics.LeftEdge
print("Left edge difference (with clef/time sig/key sig):",leftedge2-leftedge1)
print("Space before music:", spacebeforemusic,", should be the same as",leftedge2-leftedge1-cellwidth)
More information about the JWLua
mailing list