From c93ab96ac4e2b1df2cefa45748aa80e80aa1c6cf Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 7 Nov 2019 18:51:17 +0100 Subject: [PATCH] Note minimum supported version for fontconfig. --- INSTALL.rst | 4 +++- lib/matplotlib/font_manager.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/INSTALL.rst b/INSTALL.rst index 5535fc50ac18..474de6511585 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -150,7 +150,9 @@ etc., you can install the following: * `ImageMagick `_: for saving animated gifs; * `LaTeX `_ and `GhostScript (>=9.0) - `_ : for rendering text with LaTeX. + `_ : for rendering text with LaTeX; +* `fontconfig `_ (>= 2.7): for detection of system + fonts on Linux. FreeType and Qhull ------------------ diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index 6d56ed5954ab..0767573adc56 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -273,6 +273,10 @@ def _call_fc_list(): 'This may take a moment.')) timer.start() try: + if b'--format' not in subprocess.check_output(['fc-list', '--help']): + _log.warning( # fontconfig 2.7 implemented --format. + 'Matplotlib needs fontconfig>=2.7 to query system fonts.') + return [] out = subprocess.check_output(['fc-list', '--format=%{file}\\n']) except (OSError, subprocess.CalledProcessError): return []