chrome-aws-lambda
chrome-aws-lambda copied to clipboard
Fonts are ignored
I am trying to run a lambda with a custom image (based on public.ecr.aws/lambda/nodejs:14)
I've placed fonts/NotoColorEmoji.ttf in my folder yet I still cannot render emojis correctly.
Here's my code:
await chromium.font('/var/task/fonts/NotoColorEmoji.ttf');
browser = await chromium.puppeteer.launch(browserParams);
And still - no emojis.
I got the same issue. I've tried the minimal example as well but I don't see any changes in the font.
- Node 14 on AWS Lambda with chrome-aws-lambda layer.
I did a workaround that fixed it by following https://github.com/alixaxel/chrome-aws-lambda/issues/246 advice.
Basically, I duplicated the fonts.conf file from the aws.tar.br, added
<dir>~/.fonts</dir>
to the dir list and saved it in the main lambda directory (/var/task/). Then you need to add an environment variable FONTCONFIG_PATH: /var/task and it will work with the latest version on node 14.
@deepsyx Thanks for the tip!
I did a workaround that fixed it by following #246 advice.
Basically, I duplicated the fonts.conf file from the aws.tar.br, added
<dir>~/.fonts</dir>to the dir list and saved it in the main lambda directory (/var/task/). Then you need to add an environment variable
FONTCONFIG_PATH: /var/taskand it will work with the latest version on node 14.
How do i do it on a dockerfile?
aws.tar.br
Can you share the changed file?