Skip to content

Commit b41d9b6

Browse files
committed
New: Generate Utility for working with font files
This commit adds a new `generate.py` script for working with the font files in Verovio. It is meant to consolidate similar functions in the older scripts, which have been moved to the `old-code` directory for reference. (These may be deleted later once we are happy that the new script works as expected.) Calling the `generate.py` script with a `--help` argument will print the sub-commands. Calling `generate.py help [sub-command]` will provide more details on how the sub-command works. It requires the `svgpathtools` Python module, and the `fontforge` binary (if you want to create woff2 and svg fonts). It no longer requires `lxml`, and uses the built-in Python ElementTree module. (The attribute ordering problem was fixed in Python 3.8). This script has been tested against the existing output for all the fonts, and has been verified to produce the same output. (The biggest difference is that, since we are using the `ElementTree` writer directly, there is a space between the last attribute and the `/>` at the end of the tag). The Gootville font was also renamed from `Gootville-1.2.otf` to `Gootville.otf` to be consistent with the naming scheme of the other fonts. A separate commit will hold the re-generated files so that they can be compared for changes.
1 parent 9b45b29 commit b41d9b6

8 files changed

+459
-8
lines changed
File renamed without changes.

fonts/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@
77
* **[Leland](https://github.com/MuseScoreFonts/Leland)** is designed by [MuseScore](https://musescore.org/) (3.6).
88

99
All fonts included in Verovio are licensed under the [SIL Open Font License](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL).
10+
11+
# Generate Script
12+
13+
The `generate.py` script is a utility for working with font files and preparing them for Verovio. Calling it with the
14+
`--help` argument will list the possible sub-commands and options for working with the font files.
15+
16+
To extract the fonts, the `svgpathtools` module is required to exist in your Python environment.
17+
18+
To generate the `woff2` and `svg` fonts you should have `fontforge` installed. The script will try to auto-detect the
19+
path to fontforge, but you can also pass a path to the binary directly.

0 commit comments

Comments
 (0)