From 7925a32a76e086dd947b8b5f9e856d7fe29558b5 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Sat, 27 Dec 2014 17:35:47 +0100 Subject: [PATCH 1/5] Fallback to free fonts in text --- examples/pylab_examples/text_handles.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/pylab_examples/text_handles.py b/examples/pylab_examples/text_handles.py index 0cfb6f73402e..eb1fc56264fd 100644 --- a/examples/pylab_examples/text_handles.py +++ b/examples/pylab_examples/text_handles.py @@ -25,6 +25,8 @@ def f(t): xtext = xlabel('time (s)') setp(ttext, size='large', color='r', style='italic') -setp(xtext, size='medium', name='courier', weight='bold', color='g') -setp(ytext, size='medium', name='helvetica', weight='light', color='b') +setp(xtext, size='medium', name=['Courier', 'Bitstream Vera Sans Mono'], + weight='bold', color='g') +setp(ytext, size='medium', name=['Helvetica', 'Liberation Sans'], + weight='light', color='b') show() From 898b5d237db6cde5ce2041499e5c4b0045510ed6 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Sat, 27 Dec 2014 17:40:05 +0100 Subject: [PATCH 2/5] Fallback to Bitsream vera sans mono In logo example --- examples/pylab_examples/logo.py | 2 +- examples/pylab_examples/text_handles.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pylab_examples/logo.py b/examples/pylab_examples/logo.py index 120043e53275..436135cf7fa9 100755 --- a/examples/pylab_examples/logo.py +++ b/examples/pylab_examples/logo.py @@ -16,7 +16,7 @@ ax = subplot(111, axisbg='y') plot(t, x) text(0.5, 0.5, 'matplotlib', color='r', - fontsize=40, fontname='Courier', + fontsize=40, fontname=['Courier', 'Bitstream Vera Sans Mono'], horizontalalignment='center', verticalalignment='center', transform=ax.transAxes, diff --git a/examples/pylab_examples/text_handles.py b/examples/pylab_examples/text_handles.py index eb1fc56264fd..a4a28846e428 100644 --- a/examples/pylab_examples/text_handles.py +++ b/examples/pylab_examples/text_handles.py @@ -27,6 +27,6 @@ def f(t): setp(ttext, size='large', color='r', style='italic') setp(xtext, size='medium', name=['Courier', 'Bitstream Vera Sans Mono'], weight='bold', color='g') -setp(ytext, size='medium', name=['Helvetica', 'Liberation Sans'], +setp(ytext, size='medium', name=['Helvetica', 'Bitstream Vera Sans'], weight='light', color='b') show() From d507fcbefc1d33b6ee9bd802e8b71c1e111f4b86 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Sat, 27 Dec 2014 18:19:10 +0100 Subject: [PATCH 3/5] Install humor sans when building docs --- .travis.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 73a7997caebd..9b2c6b2f3807 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,17 @@ install: - pip install -q --use-mirrors nose python-dateutil $NUMPY pep8 pyparsing pillow - sudo apt-get update && sudo apt-get -qq install inkscape libav-tools gdb # We use --no-install-recommends to avoid pulling in additional large latex docs that we don't need - - if [[ $BUILD_DOCS == true ]]; then sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz; fi - - if [[ $BUILD_DOCS == true ]]; then pip install sphinx numpydoc linkchecker; fi + + # We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not + # availible in the Ubuntu version used by Travis but we can manually install the deb from a later + # version since is it basically just a .ttf file + - | + if [[ $BUILD_DOCS == true ]]; then + sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz + pip install sphinx numpydoc linkchecker + wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb + sudo dpkg -i fonts-humor-sans_1.0-1_all.deb + fi; - python setup.py install script: From 48324ee1e7856d57722c030dec893982722289e9 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Sat, 27 Dec 2014 20:21:02 +0100 Subject: [PATCH 4/5] Add Felipa to cursive fonts --- lib/matplotlib/rcsetup.py | 3 ++- matplotlibrc.template | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index 958f68d3dd60..6217f4d8480f 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -541,7 +541,8 @@ def __call__(self, s): 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif'], validate_stringlist], 'font.cursive': [['Apple Chancery', 'Textile', 'Zapf Chancery', - 'Sand', 'Script MT', 'cursive'], validate_stringlist], + 'Sand', 'Script MT', 'Felipa', 'cursive'], + validate_stringlist], 'font.fantasy': [['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact' 'Western', 'Humor Sans', 'fantasy'], validate_stringlist], diff --git a/matplotlibrc.template b/matplotlibrc.template index 215e805d144a..5ab76d245e87 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -149,7 +149,7 @@ backend : %(backend)s #font.size : 12.0 #font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif #font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif -#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, cursive +#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive #font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, Humor Sans, fantasy #font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace From ffd2628e8ac986bd27295d80645034cc8a10ddeb Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Sat, 27 Dec 2014 20:21:24 +0100 Subject: [PATCH 5/5] Install Felipa on Travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9b2c6b2f3807..fee37e4afe4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,6 +36,9 @@ install: pip install sphinx numpydoc linkchecker wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb sudo dpkg -i fonts-humor-sans_1.0-1_all.deb + wget https://googlefontdirectory.googlecode.com/hg/ofl/felipa/Felipa-Regular.ttf + sudo cp Felipa-Regular.ttf /usr/local/share/fonts/ + fc-cache -f -v fi; - python setup.py install