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

Skip to content

Commit f111088

Browse files
committed
Add a newline separator in fc-list call
Fixes #7906.
1 parent 59478d2 commit f111088

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/matplotlib/font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def _call_fc_list():
281281
'This may take a moment.'))
282282
timer.start()
283283
try:
284-
out = subprocess.check_output([str('fc-list'), '--format=%{file}'])
284+
out = subprocess.check_output([str('fc-list'), '--format=%{file}\\n'])
285285
except (OSError, subprocess.CalledProcessError):
286286
return []
287287
finally:

lib/matplotlib/tests/test_font_manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from matplotlib.font_manager import (
1313
findfont, FontProperties, fontManager, json_dump, json_load, get_font,
14-
is_opentype_cff_font, fontManager as fm)
14+
get_fontconfig_fonts, is_opentype_cff_font, fontManager as fm)
1515
import os.path
1616

1717

@@ -65,3 +65,7 @@ def test_otf():
6565
with open(f, 'rb') as fd:
6666
res = fd.read(4) == b'OTTO'
6767
assert res == is_opentype_cff_font(f)
68+
69+
70+
def test_get_fontconfig_fonts():
71+
assert len(get_fontconfig_fonts()) > 1

0 commit comments

Comments
 (0)