-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Load fonts from given directory. #14654
Comments
You can use |
I ended up setting HOME environment variable. Apparently phantom looks for fonts in ~/.fonts/TTF. I will switch to this as this appears to be better.` |
I am also trying to get phantomJS to load custom TTF fonts on AWS Lambda, but somehow it neither recognises |
@dominikkukacka dominikkukacka What have you stored in HOME variable. |
Thanks, I just solved it. I had to upgrade to the latest phantomjs stable. |
Hi Guys I'm having the same issue , I have set 2 environments HOME and QT_QPA_FONTDIR on my lambda function but to be honest I can read them but I do not know what to do with them later This is the command I use inside my NodeJs lambda function ./phantomjs_linux-x86_64 --debug=yes --ignore-ssl-errors=true takescreens.js "${url}" /tmp/${fileHash}.png I'm using the official package downloaded from http://phantomjs.org/download.html HOME = /var/task Any suggestions would be greatly appreciated Thanks |
Hi Guys. I found the solution and it's simple, you just need to add the HOME variable directly on your lambda function as environment variable. Thanks |
@netmanuy I'm experiencing this issue - when you say:
Do you mean in the lambda console or some other means? |
Hi @rowan-met Yes, on Lambda Console under "Environment variables" you need to set HOME as variable name and "/var/task" as value |
Still it would be great to be able to specify a custom folder with fonts. AFAIK in Google Cloud Functions for example we can't really define ENV vars. |
Which version of PhantomJS are you using? Tip: run
phantomjs --version
.version: 2.1.1
What steps will reproduce the problem?
package and run on AWS lambda
Which operating system are you using?
Linux ip---- 4.4.23-31.54.amzn1.x86_64 proxy support #1 SMP Tue Oct 18 22:02:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Did you use binary PhantomJS or did you compile it from source?
binary PhantomJS
Please provide any additional information below.
Not able to load fonts as phantomJS use root directory(system fonts) and Do not have permission in AWS lambda
Is there a way to pass an argument to phantomjs to load fonts from a given directory.
The text was updated successfully, but these errors were encountered: