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

Skip to content

BUG: Add a newline separator in fc-list call #7907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _call_fc_list():
'This may take a moment.'))
timer.start()
try:
out = subprocess.check_output([str('fc-list'), '--format=%{file}'])
out = subprocess.check_output([str('fc-list'), '--format=%{file}\\n'])
except (OSError, subprocess.CalledProcessError):
return []
finally:
Expand Down
13 changes: 8 additions & 5 deletions lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@
import six

import os

import sys
import tempfile
import warnings

from matplotlib.font_manager import (
findfont, FontProperties, fontManager, json_dump, json_load, get_font,
is_opentype_cff_font, fontManager as fm)
import os.path


get_fontconfig_fonts, is_opentype_cff_font, fontManager as fm)
from matplotlib import rc_context
from matplotlib.testing.decorators import skipif


def test_font_priority():
Expand Down Expand Up @@ -65,3 +63,8 @@ def test_otf():
with open(f, 'rb') as fd:
res = fd.read(4) == b'OTTO'
assert res == is_opentype_cff_font(f)


@skipif(sys.platform == 'win32', reason='no fontconfig on Windows')
def test_get_fontconfig_fonts():
assert len(get_fontconfig_fonts()) > 1