Permalink
Browse files

add font to circleic and travis

  • Loading branch information...
sdpython committed Jan 8, 2018
1 parent 79ad8af commit 0e4d67d36aa14cc6d1a1910cba2bae9e702b269c
Showing with 12 additions and 11 deletions.
  1. +3 −1 .circleci/config.yml
  2. +2 −0 .travis.yml
  3. +2 −7 _doc/sphinxdoc/source/python_setup.rst
  4. +5 −3 src/code_beatrix/faq/faq_video.py
View
@@ -22,9 +22,11 @@ jobs:
sudo dpkg -i pandoc-1.19.2.1-1-amd64.deb
- run:
name: Install freetype
name: Install font
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
- run:
name: Install tex
View
@@ -17,6 +17,8 @@ install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- 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
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
@@ -11,22 +11,17 @@ sur son ordinateur.
.. contents::
:local:
Installation
============
Windows
+++++++
* Télécharger et installer `Anaconda <https://www.anaconda.com/download/>`_.
Mise à jour
===========
L'écosystème :epkg:`Python` évolue très vite, il faut
régulièrement le mettre à jour (tous les trois mois).
@@ -620,7 +620,9 @@ def video_text(text, font=None, fontsize=32, size=None,
composed with another one. The image remains wherever it is placed.
The *opacity* is a number between 0 (transparent) and 255 (opaque).
0 means the image cannot be seen. The number can be set up for each
pixel. By default, the image background is transparent (0).
pixel. By default, the image background is transparent (0). You can find
many font at `google/fonts <https://github.com/google/fonts/tree/master/ofl>`_
or `msfonts <https://github.com/caarlos0-graveyard/msfonts/tree/master/fonts>`_.
"""
if background is None:
background = (255, 255, 255, 0)
@@ -633,10 +635,10 @@ def video_text(text, font=None, fontsize=32, size=None,
if sys.platform.startswith('win'):
font = "arial.ttf"
else:
d = '/usr/share/fonts/truetype/freefont'
d = '~/.local/share/fonts'
if os.path.exists(d):
raise FileNotFoundError("Unable to find '{0}'".format(d))
font = os.path.join(d, "FreeSerif.ttf")
font = os.path.join(d, "Ubuntu-Regular.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 0e4d67d

Please sign in to comment.