Search code examples
firebasetruetypegoogle-cloud-functionshummus.js

Cloud Functions: Access System Fonts


Im am using hummusJS to manipulate PDF Files with Firebase Cloud functions.

As far as I know, Hummus requires to have access to an actual true type font file, to be able to use fonts in PDFs. In my local env I'm using this:

https://github.com/devongovett/font-manager

It has some depends on some libfontconfig-dev, its not working on cloud functions.

According to this post there is no way to use hummus without fonts:

https://github.com/galkahana/HummusJS/issues/120

I could store the needed fonts online and download it everytime into the function, but this doesn't feel right.

Any Idea how I could make this work?

edit: I'm not picky, I would use every font beside Comic Sans


Solution

  • I managed to get the TrueType File into my package.

    Just added the local file as dependency to package.json, its working on Firebase Functions.