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 1 commit
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
Next Next commit
Add a newline separator in fc-list call
Fixes #7906.
  • Loading branch information
jkseppan committed Jan 21, 2017
commit f1110889a1d1ac2d85912f387ebf8ed92d057bc8
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
6 changes: 5 additions & 1 deletion lib/matplotlib/tests/test_font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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


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


def test_get_fontconfig_fonts():
assert len(get_fontconfig_fonts()) > 1