Permalink
Browse files

update circleci, travis, better error message

  • Loading branch information...
sdpython committed Jan 8, 2018
1 parent 416e356 commit 4027e0d18890dbece7857d925aa935dfa88f7a30
Showing with 18 additions and 2 deletions.
  1. +5 −0 .circleci/config.yml
  2. +2 −1 .travis.yml
  3. +11 −1 src/code_beatrix/faq/faq_video.py
View
@@ -21,6 +21,11 @@ jobs:
wget https://github.com/jgm/pandoc/releases/download/1.19.2.1/pandoc-1.19.2.1-1-amd64.deb
sudo dpkg -i pandoc-1.19.2.1-1-amd64.deb
- run:
name: Install freetype
command: |
sudo apt-get install -y freetype
- run:
name: Install tex
command: |
View
@@ -9,7 +9,8 @@ addons:
- ffmpeg
- gfortran
- libhdf5-serial-dev
- liblapack-dev
- liblapack-dev
- freetype
install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
@@ -23,6 +23,13 @@
from skimage.transform import rescale
class FontError(Exception):
"""
Raised when a font cannot be found.
"""
pass
##########
# youtube
##########
@@ -626,7 +633,10 @@ def video_text(text, font=None, fontsize=32, size=None,
font = "arial.ttf"
else:
font = "fnt/arial.ttf"
obj = ImageFont.truetype(font=font, size=fontsize)
try:
obj = ImageFont.truetype(font=font, size=fontsize)
except OSError as e:
raise FontError("Unable to find font '{0}'".format(font)) from e
if size is None:
size = obj.getsize(text)
elif isinstance(size, (float, int)):

0 comments on commit 4027e0d

Please sign in to comment.