RUN python3 -c "import matplotlib.pyplot" RUN chown -R -from=root docker /home/docker & \ # give non-root user docker ownership of files Python3 -c "import matplotlib.pyplot" # generate font list cacheĮNV MPLCONFIGDIR /tmp/.config # make writeable to non-root userĪx.set_title(f"Default matplotlib settings for /.local/share/fonts/truetype/felipa" /usr/share/fonts/truetype/felipa & \ Python3 -m pip install -no-cache-dir "matplotlib~=3.3" & \ RUN python3 -m pip install -upgrade -no-cache-dir pip setuptools wheel & \ How can I programatically find and install these fonts on Ubuntu? I know that I could hunt down free versions on the internet, but if I wanted to get them on a Docker image how can I install them through a CLI API like apt-get? Minimal Failing Exampleįor the following Dockerfile FROM ubuntu:20.04 $ fc-list : family | grep -i "chancery\|textile\|sand\|script\|felipa\|cursive" This seems to be confirmed in the minimal failing example below when none of the cursive fonts can be found by matplotlib's font manager or by fc-list # on my local machine Which tells me that I don't have any of the cursive fonts that matplotlib wants to use for the cursive font family. When trying to run a script (given below in the minimal working example) on Ubuntu 20.04 that uses the cursive fonts in matplotlib I am getting the matplotlib warnings: findfont: Font family not found.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |