Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d12973 commit 2f80fb8Copy full SHA for 2f80fb8
lib/matplotlib/backends/backend_pgf.py
@@ -50,9 +50,14 @@ def get_fontspec():
50
for family, command in zip(families, commands):
51
# 1) Forward slashes also work on Windows, so don't mess with
52
# backslashes. 2) The dirname needs to include a separator.
53
- path = pathlib.Path(fm.findfont(family))
54
- latex_fontspec.append(r"\%s{%s}[Path=\detokenize{%s}]" % (
55
- command, path.name, path.parent.as_posix() + "/"))
+ try:
+ path = pathlib.Path(
+ fm.findfont(family, fallback_to_default=False))
56
+ except ValueError:
57
+ pass
58
+ else:
59
+ latex_fontspec.append(r"\%s{%s}[Path=\detokenize{%s}]" % (
60
+ command, path.name, path.parent.as_posix() + "/"))
61
62
return "\n".join(latex_fontspec)
63
0 commit comments