Skip to content

Commit 7cc75df

Browse files
chore: autopublish 2025-06-24T16:15:42Z
1 parent 5964462 commit 7cc75df

File tree

5 files changed

+122
-18
lines changed

5 files changed

+122
-18
lines changed

docs/library/client.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ version.
6161
client.supports(feature)
6262
```
6363

64-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L130)
64+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L134)
6565

6666
Checks the client supports a given feature. Returns true if the client
6767
supports the feature, false otherwise.
@@ -84,7 +84,7 @@ For a list of valid features, see the [`features` table in the codebase](https:/
8484
client.assert_supports(feature)
8585
```
8686

87-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L151)
87+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L155)
8888

8989
Asserts that the client supports a given feature. If the client doesn't
9090
support the feature, this function will throw an friendly error then
@@ -108,7 +108,7 @@ For a list of valid features, see the [`features` table in the codebase](https:/
108108
client.encode_with_client_codepage(input_string)
109109
```
110110

111-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L180)
111+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L184)
112112

113113
If the client supports `luaosutils`, the filepath is encoded from utf8 to the current client
114114
encoding. On macOS, this is always also utf8, so the situation where the string may be re-encoded
@@ -134,7 +134,7 @@ with the client codepage.
134134
client.encode_with_utf8_codepage(input_string)
135135
```
136136

137-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L206)
137+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L210)
138138

139139
If the client supports `luaosutils`, the filepath is encoded from the current client encoding
140140
to utf8. On macOS, the client encoding is always also utf8, so the situation where the string may
@@ -160,7 +160,7 @@ with the client codepage.
160160
client.execute(command)
161161
```
162162

163-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L228)
163+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/client.lua#L232)
164164

165165
If the client supports `luaosutils`, the command is executed using `luaosutils.execute`. Otherwise it uses `io.popen`.
166166
In either case, the output from the command is returned.

docs/library/general_library.md

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
- [get_score()](#get_score)
1818
- [get_page_format_prefs()](#get_page_format_prefs)
1919
- [get_smufl_font_list()](#get_smufl_font_list)
20-
- [get_smufl_metadata_file(font_info)](#get_smufl_metadata_file)
20+
- [get_smufl_metadata_file(font_info_or_name)](#get_smufl_metadata_file)
21+
- [get_smufl_metadata_json(font_info_or_name)](#get_smufl_metadata_json)
2122
- [is_font_smufl_font(font_info)](#is_font_smufl_font)
2223
- [simple_input(title, text, default)](#simple_input)
2324
- [is_finale_object(object)](#is_finale_object)
@@ -288,26 +289,44 @@ the .json files for each font. The table is in the format:
288289
### get_smufl_metadata_file
289290

290291
```lua
291-
library.get_smufl_metadata_file(font_info)
292+
library.get_smufl_metadata_file(font_info_or_name)
292293
```
293294

294295
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L375)
295296

296297
| Input | Type | Description |
297298
| ----- | ---- | ----------- |
298-
| `font_info` (optional) | `FCFontInfo` | if non-nil, the font to search for; if nil, search for the Default Music Font |
299+
| `font_info_or_name` (optional) | `FCFontInfo` | or (string) if non-nil, the font to search for; if nil, search for the Default Music Font; if string, search for the font by name |
299300

300301
| Return type | Description |
301302
| ----------- | ----------- |
302303
| `file handle\\|nil` | |
303304

305+
### get_smufl_metadata_json
306+
307+
```lua
308+
library.get_smufl_metadata_json(font_info_or_name)
309+
```
310+
311+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L-1)
312+
313+
@ [string] the key of the subtable to return from the json
314+
315+
| Input | Type | Description |
316+
| ----- | ---- | ----------- |
317+
| `font_info_or_name` (optional) | `FCFontInfo\|string` | if non-nil, the font to search for; if nil, search for the Default Music Font; if string, search for the font by name |
318+
319+
| Return type | Description |
320+
| ----------- | ----------- |
321+
| `table\\|nil` | |
322+
304323
### is_font_smufl_font
305324

306325
```lua
307326
library.is_font_smufl_font(font_info)
308327
```
309328

310-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L400)
329+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L431)
311330

312331
| Input | Type | Description |
313332
| ----- | ---- | ----------- |
@@ -323,7 +342,7 @@ library.is_font_smufl_font(font_info)
323342
library.simple_input(title, text, default)
324343
```
325344

326-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L430)
345+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L461)
327346

328347
Creates a simple dialog box with a single 'edit' field for entering values into a script, similar to the old UserValueInput command. Will automatically resize the width to accomodate longer strings.
329348

@@ -341,7 +360,7 @@ Creates a simple dialog box with a single 'edit' field for entering values into
341360
library.is_finale_object(object)
342361
```
343362

344-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L475)
363+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L506)
345364

346365
Attempts to determine if an object is a Finale object through ducktyping
347366

@@ -359,7 +378,7 @@ Attempts to determine if an object is a Finale object through ducktyping
359378
library.get_parent_class(classname)
360379
```
361380

362-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L488)
381+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L519)
363382

364383
Returns the name of the parent of a class.
365384

@@ -377,7 +396,7 @@ Returns the name of the parent of a class.
377396
library.get_class_name(object)
378397
```
379398

380-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L523)
399+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L556)
381400

382401
Returns the real class name of a Finale object. Some classes in older JW/RGPLua versions have incorrect class names, so this function attempts to resolve them with ducktyping
383402

@@ -395,7 +414,7 @@ Returns the real class name of a Finale object. Some classes in older JW/RGPLua
395414
library.system_indent_set_to_prefs(system, page_format_prefs)
396415
```
397416

398-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L555)
417+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L588)
399418

400419
Sets the system to match the indentation in the page preferences currently in effect. (For score or part.)
401420
The page preferences may be provided optionally to avoid loading them for each call.
@@ -415,7 +434,7 @@ The page preferences may be provided optionally to avoid loading them for each c
415434
library.calc_script_filepath()
416435
```
417436

418-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L579)
437+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L612)
419438

420439
Returns the full filepath of the running script.
421440

@@ -429,7 +448,7 @@ Returns the full filepath of the running script.
429448
library.calc_script_name(include_extension)
430449
```
431450

432-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L600)
451+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L633)
433452

434453
Returns the running script name, with or without extension.
435454

@@ -447,7 +466,7 @@ Returns the running script name, with or without extension.
447466
library.get_default_music_font_name()
448467
```
449468

450-
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L622)
469+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/general_library.lua#L655)
451470

452471
Fetches the default music font from document options and processes the name into a usable format.
453472

docs/library/smufl_glyphs.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SMuFL Glyphs
2+
3+
Provides immediate Lua access to the glyph names in the SMuFL `glyphnames.json` file.
4+
The `glyphs` and `by_codepoint` tables were programmatically generated from it.
5+
6+
## Functions
7+
8+
- [get_glyph_info(codepoint_or_name, font_info_or_name)](#get_glyph_info)
9+
- [iterate_glyphs()](#iterate_glyphs)
10+
11+
### get_glyph_info
12+
13+
```lua
14+
smufl_glyphs.get_glyph_info(codepoint_or_name, font_info_or_name)
15+
```
16+
17+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/smufl_glyphs.lua#L5892)
18+
19+
Returns the SMuFL glyph name and a new table containing the `codepoint` and its `description`.
20+
21+
| Input | Type | Description |
22+
| ----- | ---- | ----------- |
23+
| `codepoint_or_name` | `string\|number` | the name or codepoint for a SMuFL glyph |
24+
| `font_info_or_name` (optional) | `string` | or (font_info) the SMuFL font to search for optional glyphs |
25+
26+
| Return type | Description |
27+
| ----------- | ----------- |
28+
| `string` | The glyph name |
29+
| `table` | The glyph information |
30+
31+
### iterate_glyphs
32+
33+
```lua
34+
smufl_glyphs.iterate_glyphs()
35+
```
36+
37+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/smufl_glyphs.lua#L5938)
38+
39+
Returns an iterator over the standard SMuFL glyphs as defined in glyphnames.json.
40+
41+
Each iteration returns:
42+
1. The glyph name (string)
43+
2. A new table with `codepoint` and `description`
44+
45+
| Return type | Description |
46+
| ----------- | ----------- |
47+
| `function` | An iterator over (string, table) |

docs/library/utils.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ A library of general Lua utility functions.
2525
- [win_mac(windows_value, mac_value)](#win_mac)
2626
- [split_file_path(full_path)](#split_file_path)
2727
- [eachfile(directory_path)](#eachfile)
28+
- [parse_codepoint(codepoint_string)](#parse_codepoint)
29+
- [format_codepoint(codepoint)](#format_codepoint)
2830

2931
### copy_table
3032

@@ -424,3 +426,39 @@ Generates a runtime error for plugin versions before RGP Lua 0.68.
424426
| Return type | Description |
425427
| ----------- | ----------- |
426428
| `function` | iterator function to be used in for loop. |
429+
430+
### parse_codepoint
431+
432+
```lua
433+
utility_functions.parse_codepoint(codepoint_string)
434+
```
435+
436+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/utils.lua#L568)
437+
438+
Returns a Unicode codepoint as a number.
439+
440+
| Input | Type | Description |
441+
| ----- | ---- | ----------- |
442+
| `codepoint_string` | `string` | A string in the form "U+FFFF" representing the codepoint |
443+
444+
| Return type | Description |
445+
| ----------- | ----------- |
446+
| `number` | the codepoint as a number |
447+
448+
### format_codepoint
449+
450+
```lua
451+
utility_functions.format_codepoint(codepoint)
452+
```
453+
454+
[View source](https://github.com/finale-lua/lua-scripts/tree/refs/heads/master/src/library/utils.lua#L580)
455+
456+
Formats a Unicode codepoint into a string like "U+FFFF"
457+
458+
| Input | Type | Description |
459+
| ----- | ---- | ----------- |
460+
| `codepoint` | `number` | A string in the form "U+FFFF" representing the codepoint |
461+
462+
| Return type | Description |
463+
| ----------- | ----------- |
464+
| `number` | the codepoint as a number |

src/lib/lib/script-data.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)