I am building a Docker image with conTeXt included so that I can generate PDFs from Google App Engine. I will only be using a couple of commercial OpenType fonts in the documents.

In an effort to keep the docker image (and build times) small, I'd like to remove the standard fonts that come with Context (79MB), leaving Computer Modern as a fallback.

Is this possible, and if so, what would be the best way to go about it?

  • Depends on how you are installing context? Are you using context standalone? If so, the mtx-update.lua script simply rsyncs a bunch of files. You could filter out the fonts so that they are not downloaded in the rsync process. – Aditya Apr 5 '17 at 23:10
  • Thanks @Aditya, I figured you'd be the first to answer! :-) – derBingle Apr 6 '17 at 2:03
  • Oops, hit enter without thinking about it. I am using standalone, and already rsynced the files and COPYed them into the Dockerfile so that it doesn't have to redownload on every container build. Then I'm just calling mtx-update.lua manually, which I got from the end of first-setup.sh Thanks for pointing me in the right direction. I wasn't sure if the fonts were required by context, or where to make changes. – derBingle Apr 6 '17 at 2:12
  • 2
    If you need a fallback, I'd use Latin Modern. This is context's default, and it may act up if it can't find it. And remember to have the math fonts as well. Everything else should be optional. – Thomas Apr 6 '17 at 7:56
  • The--flags option to mtx-update is passed on to rsync. So, you can use that to exclude font files (see rsync man page for details). As an example of passing options to rsync, see this. – Aditya Apr 6 '17 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.