@@ -43,7 +43,7 @@ function smufl_load_engraving_defaults()
43
43
44
44
-- Beam spacing has to be calculated in terms of beam thickness, because the json spec
45
45
-- calls for inner distance whereas Finale is top edge to top edge. So hold the value
46
- local beamSpacingFound = 0
46
+ local beamSpacingFound
47
47
local beamWidthFound = math.floor (size_prefs .BeamThickness / efixPerEvpu + 0.5 )
48
48
49
49
-- define actions for each of the fields of font_info.engravingDefaults
@@ -114,7 +114,7 @@ function smufl_load_engraving_defaults()
114
114
for def in each (expression_defs ) do
115
115
if def .UseEnclosure then
116
116
local enclosure = def :CreateEnclosure ()
117
- if ( nil ~= enclosure ) then
117
+ if nil ~= enclosure and enclosure . LineWidth > 0 then
118
118
enclosure .LineWidth = size_prefs .EnclosureThickness
119
119
enclosure :Save ()
120
120
end
@@ -127,14 +127,14 @@ function smufl_load_engraving_defaults()
127
127
for _ , for_parts in pairs ({false , true }) do
128
128
if region :GetUseEnclosureStart (for_parts ) then
129
129
local enc_start = region :GetEnclosureStart (for_parts )
130
- if nil ~= enc_start then
130
+ if nil ~= enc_start and enc_start . LineWidth > 0 then
131
131
enc_start .LineWidth = size_prefs .EnclosureThickness
132
132
got1 = true
133
133
end
134
134
end
135
135
if region :GetUseEnclosureMultiple (for_parts ) then
136
136
local enc_multiple = region :GetEnclosureMultiple (for_parts )
137
- if nil ~= enc_multiple then
137
+ if nil ~= enc_multiple and enc_multiple . LineWidth > 0 then
138
138
enc_multiple .LineWidth = size_prefs .EnclosureThickness
139
139
got1 = true
140
140
end
@@ -149,7 +149,7 @@ function smufl_load_engraving_defaults()
149
149
for sepnum in each (separate_numbers ) do
150
150
if sepnum .UseEnclosure then
151
151
local enc_sep = sepnum :GetEnclosure ()
152
- if nil ~= enc_sep then
152
+ if nil ~= enc_sep and enc_sep . LineWidth > 0 then
153
153
enc_sep .LineWidth = size_prefs .EnclosureThickness
154
154
end
155
155
sepnum :Save ()
@@ -171,18 +171,8 @@ function smufl_load_engraving_defaults()
171
171
end
172
172
end
173
173
174
- if 0 ~= beamSpacingFound then
174
+ if beamSpacingFound then
175
175
distance_prefs .SecondaryBeamSpace = beamSpacingFound + beamWidthFound
176
-
177
- -- Currently, the json files for Finale measure beam separation from top edge to top edge
178
- -- whereas the spec specifies that it be only the distance between the inner edges. This will
179
- -- probably be corrected at some point, but for now hard-code around it. Hopefully this code will
180
- -- get a Finale version check at some point.
181
-
182
- local finale_prefix = " Finale "
183
- if finale_prefix == font_info .Name :sub (1 , # finale_prefix ) then
184
- distance_prefs .SecondaryBeamSpace = beamSpacingFound
185
- end
186
176
end
187
177
188
178
-- save new preferences
0 commit comments