Skip to content

Commit 1acbf4a

Browse files
committed
Move each font into its own directory
* The ./fonts used to have a mix of scripts and font files. This commit re-organise it and moves each font to a dedicated directory that also includes the json metadata * The ./extract-bounding-boxes.py script is adjusted to take a single fontname parameter
1 parent b5b10e7 commit 1acbf4a

20 files changed

+6830
-10
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

fonts/Leipzig/leipzig_metadata.json

+6,820
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

fonts/extract-bounding-boxes.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,11 @@ def extract_text_font(root, metadata_file):
258258

259259
if __name__ == "__main__":
260260
# (1) Parse files
261-
font_file = os.sys.argv[1]
262-
metadata_file = os.sys.argv[2]
261+
font_name = os.sys.argv[1]
262+
font_file = f"{font_name}/{font_name}.svg"
263+
metadata_file = f"{font_name}/{font_name.lower()}_metadata.json"
264+
output_file = f"../data/{font_name}.xml"
265+
263266
(font_family, units_per_em, default_hax,
264267
glyphs) = read_svg_font_file(font_file)
265268

@@ -277,5 +280,4 @@ def extract_text_font(root, metadata_file):
277280
xml_output_content += ET.tostring(root,
278281
encoding="unicode", pretty_print=True)
279282

280-
output_file = os.sys.argv[3]
281283
write_file_content(output_file, xml_output_content)

fonts/generate_all.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ echo "Generating C++ header file ..."
99
$PYTHON generate-smufl-code.py
1010

1111
echo "Generating Bravura files ..."
12-
$PYTHON extract-bounding-boxes.py Bravura.svg json/bravura_metadata.json ../data/Bravura.xml
12+
$PYTHON extract-bounding-boxes.py Bravura
1313

1414
echo "Generating Leipzig files ..."
15-
$PYTHON extract-bounding-boxes.py Leipzig.svg json/leipzig_metadata.json ../data/Leipzig.xml
15+
$PYTHON extract-bounding-boxes.py Leipzig
1616

1717
echo "Generating Gootville files ..."
18-
$PYTHON extract-bounding-boxes.py Gootville.svg json/gootville_metadata.json ../data/Gootville.xml
18+
$PYTHON extract-bounding-boxes.py Gootville
1919

2020
echo "Generating Petaluma files ..."
21-
$PYTHON extract-bounding-boxes.py Petaluma.svg json/petaluma_metadata.json ../data/Petaluma.xml
21+
$PYTHON extract-bounding-boxes.py Petaluma
2222

2323
echo "Generating Leland files ..."
24-
$PYTHON extract-bounding-boxes.py Leland.svg json/leland_metadata.json ../data/Leland.xml
24+
$PYTHON extract-bounding-boxes.py Leland
2525

2626
echo "Done!"

fonts/json/verovio-text.json

-2
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)