serverless-libreoffice icon indicating copy to clipboard operation
serverless-libreoffice copied to clipboard

Is it possible to add custmoized font?

Open diy10264 opened this issue 5 years ago • 4 comments

When document containes some WordArt or special font, the result seems unapplicable. Some word and font style was lost and layout was changed.

This issues may be caused by LibreOffice. Are there any method to add own font for each convertion task?

diy10264 avatar Apr 15 '19 02:04 diy10264

Hey @diy10264

I assume it works similar way how you add fonts on Linux system, except some AWS Lambda quirks.

I don't know will it help with LibreOffice, but I've seen people adding fonts to AWS Lambda for headless Chrome: https://gist.github.com/nat-n/c3429d29f2478ccb3de243810bb12956

Let me know if you find a solution that works for you and I'll add it to the README

vladholubiev avatar Apr 15 '19 19:04 vladholubiev

Adding fonts files to instdir/share/fonts/truetype is enough.

I've added all fonts from these sources, to good effect: https://packages.ubuntu.com/bionic/ttf-mscorefonts-installer https://gist.github.com/maxwelleite/10774746

EDIT: Actually, this is the better way to get all those font files manually: https://www.linuxquestions.org/questions/mageia-97/inpossibility-to-install-ms-core-fonts-4175603366/#post5694251

These are all the more common Windows fonts, and add about 5 MB (compressed) and 17Mb (uncompressed) to the distribution.

ncruces avatar Jul 13 '19 10:07 ncruces

download fonts into the tmp folder directly, also add file font.conf(base Amazon Linux 1 file you can find here https://github.com/alixaxel/chrome-aws-lambda/issues/37#issuecomment-493646469) and variables

// process.env.FONTCONFIG_PATH = "/tmp/fonts"; // process.env.FONTCONFIG_FILE = "/var/task/fonts/font.conf"

randombluff avatar Jan 10 '20 12:01 randombluff

#19 Does adding fonts make a difference to formatting?

iamkeyur avatar Aug 24 '20 21:08 iamkeyur