@@ -43,7 +43,7 @@ function smufl_load_engraving_defaults()
4343
4444 -- Beam spacing has to be calculated in terms of beam thickness, because the json spec
4545 -- calls for inner distance whereas Finale is top edge to top edge. So hold the value
46- local beamSpacingFound = 0
46+ local beamSpacingFound
4747 local beamWidthFound = math.floor (size_prefs .BeamThickness / efixPerEvpu + 0.5 )
4848
4949 -- define actions for each of the fields of font_info.engravingDefaults
@@ -114,7 +114,7 @@ function smufl_load_engraving_defaults()
114114 for def in each (expression_defs ) do
115115 if def .UseEnclosure then
116116 local enclosure = def :CreateEnclosure ()
117- if ( nil ~= enclosure ) then
117+ if nil ~= enclosure and enclosure . LineWidth > 0 then
118118 enclosure .LineWidth = size_prefs .EnclosureThickness
119119 enclosure :Save ()
120120 end
@@ -127,14 +127,14 @@ function smufl_load_engraving_defaults()
127127 for _ , for_parts in pairs ({false , true }) do
128128 if region :GetUseEnclosureStart (for_parts ) then
129129 local enc_start = region :GetEnclosureStart (for_parts )
130- if nil ~= enc_start then
130+ if nil ~= enc_start and enc_start . LineWidth > 0 then
131131 enc_start .LineWidth = size_prefs .EnclosureThickness
132132 got1 = true
133133 end
134134 end
135135 if region :GetUseEnclosureMultiple (for_parts ) then
136136 local enc_multiple = region :GetEnclosureMultiple (for_parts )
137- if nil ~= enc_multiple then
137+ if nil ~= enc_multiple and enc_multiple . LineWidth > 0 then
138138 enc_multiple .LineWidth = size_prefs .EnclosureThickness
139139 got1 = true
140140 end
@@ -149,7 +149,7 @@ function smufl_load_engraving_defaults()
149149 for sepnum in each (separate_numbers ) do
150150 if sepnum .UseEnclosure then
151151 local enc_sep = sepnum :GetEnclosure ()
152- if nil ~= enc_sep then
152+ if nil ~= enc_sep and enc_sep . LineWidth > 0 then
153153 enc_sep .LineWidth = size_prefs .EnclosureThickness
154154 end
155155 sepnum :Save ()
@@ -171,18 +171,8 @@ function smufl_load_engraving_defaults()
171171 end
172172 end
173173
174- if 0 ~= beamSpacingFound then
174+ if beamSpacingFound then
175175 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
186176 end
187177
188178 -- save new preferences
0 commit comments