Skip to content

Commit f0bb0ab

Browse files
committed
Merge pull request #3950 from jenshnielsen/travis_text_fixes
DOC/TST : Ensure that fonts are present on travis when building docs.
2 parents db45436 + ffd2628 commit f0bb0ab

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

.travis.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,20 @@ install:
2626
- pip install -q --use-mirrors nose python-dateutil $NUMPY pep8 pyparsing pillow
2727
- sudo apt-get update && sudo apt-get -qq install inkscape libav-tools gdb
2828
# We use --no-install-recommends to avoid pulling in additional large latex docs that we don't need
29-
- 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
30-
- if [[ $BUILD_DOCS == true ]]; then pip install sphinx numpydoc linkchecker; fi
29+
30+
# We manually install humor sans using the package from Ubuntu 14.10. Unfortunatly humor sans is not
31+
# availible in the Ubuntu version used by Travis but we can manually install the deb from a later
32+
# version since is it basically just a .ttf file
33+
- |
34+
if [[ $BUILD_DOCS == true ]]; then
35+
sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz
36+
pip install sphinx numpydoc linkchecker
37+
wget http://mirrors.kernel.org/ubuntu/pool/universe/f/fonts-humor-sans/fonts-humor-sans_1.0-1_all.deb
38+
sudo dpkg -i fonts-humor-sans_1.0-1_all.deb
39+
wget https://googlefontdirectory.googlecode.com/hg/ofl/felipa/Felipa-Regular.ttf
40+
sudo cp Felipa-Regular.ttf /usr/local/share/fonts/
41+
fc-cache -f -v
42+
fi;
3143
- python setup.py install
3244

3345
script:

examples/pylab_examples/logo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ax = subplot(111, axisbg='y')
1717
plot(t, x)
1818
text(0.5, 0.5, 'matplotlib', color='r',
19-
fontsize=40, fontname='Courier',
19+
fontsize=40, fontname=['Courier', 'Bitstream Vera Sans Mono'],
2020
horizontalalignment='center',
2121
verticalalignment='center',
2222
transform=ax.transAxes,

examples/pylab_examples/text_handles.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def f(t):
2525
xtext = xlabel('time (s)')
2626

2727
setp(ttext, size='large', color='r', style='italic')
28-
setp(xtext, size='medium', name='courier', weight='bold', color='g')
29-
setp(ytext, size='medium', name='helvetica', weight='light', color='b')
28+
setp(xtext, size='medium', name=['Courier', 'Bitstream Vera Sans Mono'],
29+
weight='bold', color='g')
30+
setp(ytext, size='medium', name=['Helvetica', 'Bitstream Vera Sans'],
31+
weight='light', color='b')
3032
show()

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ def __call__(self, s):
541541
'Arial', 'Helvetica', 'Avant Garde', 'sans-serif'],
542542
validate_stringlist],
543543
'font.cursive': [['Apple Chancery', 'Textile', 'Zapf Chancery',
544-
'Sand', 'Script MT', 'cursive'], validate_stringlist],
544+
'Sand', 'Script MT', 'Felipa', 'cursive'],
545+
validate_stringlist],
545546
'font.fantasy': [['Comic Sans MS', 'Chicago', 'Charcoal', 'Impact'
546547
'Western', 'Humor Sans', 'fantasy'],
547548
validate_stringlist],

matplotlibrc.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ backend : %(backend)s
149149
#font.size : 12.0
150150
#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
151151
#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
152-
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, cursive
152+
#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
153153
#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, Humor Sans, fantasy
154154
#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
155155

0 commit comments

Comments
 (0)