Skip to content

Commit e29022f

Browse files
chore: autopublish 2025-07-28T19:00:36Z
1 parent dd802c4 commit e29022f

13 files changed

+2478
-1641
lines changed

dist/document_options_to_musescore.lua

Lines changed: 2346 additions & 1626 deletions
Large diffs are not rendered by default.

dist/font_map_legacy.lua

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11140,7 +11140,10 @@ context = {
1114011140
local function format_mapping(mapping)
1114111141
local codepoint_desc = "[" .. utils.format_codepoint(mapping.codepoint) .. "]"
1114211142
if mapping.glyph then
11143-
return "'" .. mapping.glyph .. "' " .. codepoint_desc
11143+
codepoint_desc = "'" .. mapping.glyph .. "' " .. codepoint_desc
11144+
end
11145+
if mapping.smuflFontName then
11146+
codepoint_desc = codepoint_desc .. "(" .. mapping.smuflFontName ..")"
1114411147
end
1114511148
return codepoint_desc
1114611149
end
@@ -11184,11 +11187,29 @@ local function set_codepoint(control, codepoint)
1118411187
end
1118511188
control:SetText(fcstr)
1118611189
end
11190+
local function on_smufl_popup(popup)
11191+
local dialog = popup:GetParent()
11192+
local smufl_box = dialog:GetControl("smufl_box")
11193+
local fcstr = finale.FCString()
11194+
popup:GetItemText(popup:GetSelectedItem(), fcstr)
11195+
smufl_box:SetFont(finale.FCFontInfo(fcstr.LuaString, 24))
11196+
end
1118711197
local function on_popup(popup)
1118811198
local legacy_codepoint = context.popup_keys[popup:GetSelectedItem() + 1] or 0
1118911199
local current_mapping = legacy_codepoint > 0 and context.current_mapping[legacy_codepoint]
1119011200
local smufl_codepoint = current_mapping and current_mapping.codepoint or 0
1119111201
local dialog = popup:GetParent()
11202+
if current_mapping and current_mapping.smuflFontName then
11203+
local smufl_list = dialog:GetControl("smufl_list")
11204+
for index = 0, smufl_list:GetCount() - 1 do
11205+
local str = finale.FCString()
11206+
smufl_list:GetItemText(index, str)
11207+
if str.LuaString == current_mapping.smuflFontName then
11208+
smufl_list:SetSelectedItem(index)
11209+
on_smufl_popup(smufl_list)
11210+
end
11211+
end
11212+
end
1119211213
set_codepoint(dialog:GetControl("legacy_box"), legacy_codepoint)
1119311214
set_codepoint(dialog:GetControl("smufl_box"), smufl_codepoint)
1119411215
end
@@ -11261,6 +11282,7 @@ local function on_select_file(control)
1126111282
t.glyph = glyph
1126211283
t.codepoint = utils.parse_codepoint(v.codepoint)
1126311284
t.nameIsMakeMusic = v.nameIsMakeMusic
11285+
t.smuflFontName = v.smuflFontName
1126411286
if t.codepoint == 0xFFFD then
1126511287
local smufl_box = dialog:GetControl("smufl_box")
1126611288
local _, info = smufl_glyphs.get_glyph_info(glyph, smufl_box:CreateFontInfo())
@@ -11294,13 +11316,6 @@ local function on_symbol_select(box)
1129411316
end
1129511317
enable_disable(dialog)
1129611318
end
11297-
local function on_smufl_popup(popup)
11298-
local dialog = popup:GetParent()
11299-
local smufl_box = dialog:GetControl("smufl_box")
11300-
local fcstr = finale.FCString()
11301-
popup:GetItemText(popup:GetSelectedItem(), fcstr)
11302-
smufl_box:SetFont(finale.FCFontInfo(fcstr.LuaString, 24))
11303-
end
1130411319
local function on_add_mapping(control)
1130511320
local dialog = control:GetParent()
1130611321
local popup = dialog:GetControl("mappings")
@@ -11314,13 +11329,17 @@ local function on_add_mapping(control)
1131411329
return
1131511330
end
1131611331
end
11332+
local font = dialog:GetControl("smufl_box"):CreateFontInfo()
1131711333
current_mapping = {codepoint = smufl_point}
11318-
local glyph, info = smufl_glyphs.get_glyph_info(smufl_point, dialog:GetControl("smufl_box"):CreateFontInfo())
11334+
local glyph, info = smufl_glyphs.get_glyph_info(smufl_point, font)
1131911335
if info then
1132011336
current_mapping.glyph = glyph
1132111337
else
1132211338
current_mapping.glyph = utils.format_codepoint(smufl_point)
1132311339
end
11340+
if font and smufl_point >= 0xF400 and smufl_point <= 0xF8FF then
11341+
current_mapping.smuflFontName = font.Name
11342+
end
1132411343
context.current_mapping[legacy_point] = current_mapping
1132511344
update_popup(popup, legacy_point)
1132611345
end
@@ -11353,6 +11372,9 @@ local function emit_json(mapping, reverse_lookup)
1135311372
else
1135411373
table.insert(parts, '\t\t"description": ' .. quote(""))
1135511374
end
11375+
if entry.smuflFontName then
11376+
table.insert(parts, '\t\t"smuflFontName": ' .. quote(entry.smuflFontName))
11377+
end
1135611378
return "{\n" .. table.concat(parts, ",\n") .. "\n\t}"
1135711379
end
1135811380
local lines = { "{" }

dist/score_create_brass_quintet.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,26 @@ package.preload["library.score"] = package.preload["library.score"] or function(
11661166
end
11671167
return is_voice_staff
11681168
end
1169+
1170+
function score.calc_has_optimized_systems()
1171+
local staff_systems = finale.FCStaffSystems()
1172+
staff_systems:LoadAll()
1173+
local scroll_view = finale.FCSystemStaves()
1174+
scroll_view:LoadScrollView()
1175+
for staff_system in each(staff_systems) do
1176+
local next_system = finale.FCSystemStaves()
1177+
next_system:LoadAllForItem(staff_system.ItemNo)
1178+
if next_system.Count ~= scroll_view.Count then
1179+
return true
1180+
end
1181+
for staff_index = 0, next_system.Count - 1 do
1182+
if next_system:GetItemAt(staff_index).Staff ~= scroll_view:GetItemAt(staff_index).Staff then
1183+
return true
1184+
end
1185+
end
1186+
end
1187+
return false
1188+
end
11691189
return score
11701190
end
11711191
package.preload["library.utils"] = package.preload["library.utils"] or function()

dist/score_create_double_wind_orchestra_score.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,26 @@ package.preload["library.score"] = package.preload["library.score"] or function(
11661166
end
11671167
return is_voice_staff
11681168
end
1169+
1170+
function score.calc_has_optimized_systems()
1171+
local staff_systems = finale.FCStaffSystems()
1172+
staff_systems:LoadAll()
1173+
local scroll_view = finale.FCSystemStaves()
1174+
scroll_view:LoadScrollView()
1175+
for staff_system in each(staff_systems) do
1176+
local next_system = finale.FCSystemStaves()
1177+
next_system:LoadAllForItem(staff_system.ItemNo)
1178+
if next_system.Count ~= scroll_view.Count then
1179+
return true
1180+
end
1181+
for staff_index = 0, next_system.Count - 1 do
1182+
if next_system:GetItemAt(staff_index).Staff ~= scroll_view:GetItemAt(staff_index).Staff then
1183+
return true
1184+
end
1185+
end
1186+
end
1187+
return false
1188+
end
11691189
return score
11701190
end
11711191
package.preload["library.utils"] = package.preload["library.utils"] or function()

dist/score_create_string_orchestra_score.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,26 @@ package.preload["library.score"] = package.preload["library.score"] or function(
11661166
end
11671167
return is_voice_staff
11681168
end
1169+
1170+
function score.calc_has_optimized_systems()
1171+
local staff_systems = finale.FCStaffSystems()
1172+
staff_systems:LoadAll()
1173+
local scroll_view = finale.FCSystemStaves()
1174+
scroll_view:LoadScrollView()
1175+
for staff_system in each(staff_systems) do
1176+
local next_system = finale.FCSystemStaves()
1177+
next_system:LoadAllForItem(staff_system.ItemNo)
1178+
if next_system.Count ~= scroll_view.Count then
1179+
return true
1180+
end
1181+
for staff_index = 0, next_system.Count - 1 do
1182+
if next_system:GetItemAt(staff_index).Staff ~= scroll_view:GetItemAt(staff_index).Staff then
1183+
return true
1184+
end
1185+
end
1186+
end
1187+
return false
1188+
end
11691189
return score
11701190
end
11711191
package.preload["library.utils"] = package.preload["library.utils"] or function()

dist/score_create_trombone_choir_score.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,26 @@ package.preload["library.score"] = package.preload["library.score"] or function(
11661166
end
11671167
return is_voice_staff
11681168
end
1169+
1170+
function score.calc_has_optimized_systems()
1171+
local staff_systems = finale.FCStaffSystems()
1172+
staff_systems:LoadAll()
1173+
local scroll_view = finale.FCSystemStaves()
1174+
scroll_view:LoadScrollView()
1175+
for staff_system in each(staff_systems) do
1176+
local next_system = finale.FCSystemStaves()
1177+
next_system:LoadAllForItem(staff_system.ItemNo)
1178+
if next_system.Count ~= scroll_view.Count then
1179+
return true
1180+
end
1181+
for staff_index = 0, next_system.Count - 1 do
1182+
if next_system:GetItemAt(staff_index).Staff ~= scroll_view:GetItemAt(staff_index).Staff then
1183+
return true
1184+
end
1185+
end
1186+
end
1187+
return false
1188+
end
11691189
return score
11701190
end
11711191
package.preload["library.utils"] = package.preload["library.utils"] or function()

docs/library/score.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- [set_all_parts_page_size(width, height)](#set_all_parts_page_size)
3434
- [apply_config(config, options)](#apply_config)
3535
- [calc_voice_staff(staff_num)](#calc_voice_staff)
36+
- [calc_has_optimized_systems()](#calc_has_optimized_systems)
3637

3738
### create_default_config
3839

@@ -554,3 +555,17 @@ Determines whether the staff is a voice instrument.
554555
| Return type | Description |
555556
| ----------- | ----------- |
556557
| `boolean` | True if the staff is a voice instrument. |
558+
559+
### calc_has_optimized_systems
560+
561+
```lua
562+
score.calc_has_optimized_systems()
563+
```
564+
565+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/score.lua#L835)
566+
567+
Deterimines if this score contains optimized systems
568+
569+
| Return type | Description |
570+
| ----------- | ----------- |
571+
| `boolean` | True if an optimized system is found |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a78c4020465f24e5713e20cb01bcdc77de493972e12542697dd6bb108e6b3d531333c8b513241ead98ef1336619aef3f30a8df1bb0858d42ad5d6c540d2d3c27 document_options_to_musescore.lua
1+
f028b1fecf13d6bb5c208703ccc5b55101933a3d6c1f727d1011c3eeaf842a84e9da21703d1191f1b6a0c7a88d53b33236efdb3b423f505f0739f0360110a845 document_options_to_musescore.lua

hash/font_map_legacy.hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fff528693c497656e1b468f3a3d3fd3361c19cf2fdf842ace775af4b13d00388d66d7e48b4e4265cd5bf549db7688e247ecb2a595459f839b0f301ee0d34ec5c font_map_legacy.lua
1+
18b15d6fd2d16db39753daf5b55e6f1ab725418eac74a02b0b8c385c04a0e4e7b3e17aafefc931cc0edb9248be2e66d02ff3ac11ee21dcb6487caaf9b57f5696 font_map_legacy.lua
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fa8cfe372c7d516c58de53c7493638b0e8624e5d8550ae38357a195716f4b6ddfd9e705564a73b2de13a2f3e89b949d056e15bcc70ebe0b04dcbf1b003c23064 score_create_brass_quintet.lua
1+
f78fcce74e8503c73b2e645472853e7cb032bcac30d9970b1fbd278271ef1e5526e3d3ab9dd45912162d202a392145fecb3f0de2db55af185cb27983da7b190a score_create_brass_quintet.lua

0 commit comments

Comments
 (0)