Skip to content

Ensure that fonts are present on travis when building docs. #3950

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 5 commits into from
Dec 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,20 @@ 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
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

script:
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions examples/pylab_examples/text_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', 'Bitstream Vera Sans'],
weight='light', color='b')
show()
3 changes: 2 additions & 1 deletion lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down