summaryrefslogtreecommitdiff
path: root/pygments/formatters
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-02 11:28:29 +0100
committerGeorg Brandl <georg@python.org>2016-02-02 11:28:29 +0100
commitf4e2ea8d4fcd4abefa228ecf2ac20998cce45a6c (patch)
treee9f9f4b78ee19b208ce854425af36bebf94c51ca /pygments/formatters
parent76e9a0a6e71ff20090f88f1949e4ae33f2079259 (diff)
downloadpygments-f4e2ea8d4fcd4abefa228ecf2ac20998cce45a6c.tar.gz
Fixed image formatter font searching on Macs (closes #1188)
Diffstat (limited to 'pygments/formatters')
-rw-r--r--pygments/formatters/img.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pygments/formatters/img.py b/pygments/formatters/img.py
index a7b5d51e..c7b8e819 100644
--- a/pygments/formatters/img.py
+++ b/pygments/formatters/img.py
@@ -82,9 +82,13 @@ class FontManager(object):
stdout, _ = proc.communicate()
if proc.returncode == 0:
lines = stdout.splitlines()
- if lines:
- path = lines[0].decode().strip().strip(':')
- return path
+ for line in lines:
+ if line.startswith('Fontconfig warning:'):
+ continue
+ path = line.decode().strip().strip(':')
+ if path:
+ return path
+ return None
def _create_nix(self):
for name in STYLES['NORMAL']: