Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0c2f66

Browse files
authored
Merge pull request #11185 from anntzer/pgffix
Fix undefined name error in backend_pgf.
2 parents 922c950 + 179f5f0 commit d0c2f66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ def _font_properties_str(prop):
141141
family = prop.get_family()[0]
142142
if family in families:
143143
commands.append(families[family])
144-
elif family in system_fonts and rcParams["pgf.texsystem"] != "pdflatex":
144+
elif (any(font.name == family for font in fm.fontManager.ttflist)
145+
and rcParams["pgf.texsystem"] != "pdflatex"):
145146
commands.append(r"\setmainfont{%s}\rmfamily" % family)
146147
else:
147148
pass # print warning?

0 commit comments

Comments
 (0)