Skip to content

Commit 482a2c1

Browse files
committed
Avoid warning spam when Inter is not installed on build machine
1 parent 9d73747 commit 482a2c1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎src/imgs/src/graph_render.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def gen_graph(in_path, title, out_path):
1414

1515
plt.rcParams["figure.figsize"] = [7.50, 3.50]
1616
plt.rcParams["figure.autolayout"] = True
17-
plt.rcParams["font.family"] = "Inter"
17+
plt.rcParams["font.family"] = ""
1818
# Assume fonts are installed on the machine where the SVG will be viewed
1919
# (we load Inter with the webpage so it should be there)
2020
plt.rcParams["svg.fonttype"] = "none"
@@ -60,6 +60,7 @@ def gen_graph(in_path, title, out_path):
6060
replace_style_property(soup, "text", "fill", COLOR_BASE, "var(--fg, #000)")
6161
replace_style_property(soup, "use", "stroke", COLOR_BASE, "var(--fg, #000)")
6262
replace_style_property(soup, "use", "fill", COLOR_BASE, "var(--fg, #000)")
63+
replace_style_property(soup, "text", "font-family", "", "'Inter'")
6364

6465
# Write the altered SVG file
6566
with open(out_path, "wt") as f:
@@ -96,8 +97,8 @@ def replace_style_property(
9697

9798
# CLI interface.
9899
if __name__ == "__main__":
99-
if len(argv) != 3:
100-
print("Usage: python3 graph_render.py <path/to.csv> <graph title>", file=stderr)
100+
if len(argv) != 4:
101+
print("Usage: python3 graph_render.py <path/to.csv> <graph title> <output>", file=stderr)
101102
exit(1)
102103

103-
gen_graph(argv[1], argv[2])
104+
gen_graph(argv[1], argv[2], argv[3])

0 commit comments

Comments
 (0)