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

Skip to content

Commit fe1641b

Browse files
tacaswellQuLogic
authored andcommitted
Merge pull request #7907 from jkseppan/fc-list-format
BUG: Add a newline separator in fc-list call
1 parent c4dee7a commit fe1641b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
import six
66

77
import os
8-
import os.path
9-
from matplotlib.font_manager import (findfont, FontProperties, get_font,
10-
is_opentype_cff_font, fontManager as fm)
8+
import sys
9+
10+
from matplotlib.font_manager import (
11+
findfont, FontProperties, get_font,
12+
get_fontconfig_fonts, is_opentype_cff_font, fontManager as fm)
1113
from matplotlib import rc_context
1214

1315

@@ -36,3 +38,7 @@ def test_otf():
3638
with open(f, 'rb') as fd:
3739
res = fd.read(4) == b'OTTO'
3840
assert res == is_opentype_cff_font(f)
41+
42+
43+
def test_get_fontconfig_fonts():
44+
assert sys.platform == 'win32' or len(get_fontconfig_fonts()) > 1

0 commit comments

Comments
 (0)