Permalink
Browse files

still try to find ttf

  • Loading branch information...
sdpython committed Jan 9, 2018
1 parent 161032b commit c6ac84218b3c4a7f26e4b6fd3bf9867b775f4f6f
Showing with 5 additions and 5 deletions.
  1. +1 −1 .circleci/config.yml
  2. +1 −1 .travis.yml
  3. +3 −3 src/code_beatrix/faq/faq_video.py
View
@@ -26,7 +26,7 @@ jobs:
command: |
sudo apt-get install -y libfreetype6-dev
mkdir -p ~/.local/share/fonts
wget -nc https://github.com/google/fonts/blob/master/ufl/ubuntu/Ubuntu-Regular.ttf -O ~/.local/share/fonts/Ubuntu-Regular.ttf || true
wget -nc https://github.com/google/fonts/tree/master/apache/roboto/Roboto-Regular.ttf -O ~/.local/share/fonts/Roboto-Regular.ttf || true
- run:
name: Install tex
View
@@ -18,7 +18,7 @@ install:
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- mkdir -p ~/.local/share/fonts
- wget -nc https://github.com/google/fonts/blob/master/ufl/ubuntu/Ubuntu-Regular.ttf -O ~/.local/share/fonts/Ubuntu-Regular.ttf || true
- wget -nc https://github.com/google/fonts/tree/master/apache/roboto/Roboto-Regular.ttf -O ~/.local/share/fonts/Roboto-Regular.ttf || true
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
@@ -635,11 +635,11 @@ def video_text(text, font=None, fontsize=32, size=None,
if sys.platform.startswith('win'):
font = "arial.ttf"
else:
exp = os.path.expanduser('~')
d = os.path.join(exp, '.local', 'share', 'fonts')
exp = '/usr/share/fonts/truetype' # os.path.expanduser('~')
d = exp # os.path.join(exp, '.local', 'share', 'fonts')
if not os.path.exists(d):
raise FileNotFoundError("Unable to find '{0}'".format(d))
font = os.path.join(d, "Ubuntu-Regular.ttf")
font = os.path.join(d, "FreeSans.ttf")
if not os.path.exists(font):
raise FileNotFoundError("Unable to find font '{0}'. Available:\n{1}".format(
font, "\n".join(os.listdir(d))))

0 comments on commit c6ac842

Please sign in to comment.