I am using PhantomJs 1.9.2 on Centos 6.3 to for automated ui tests. When a test fails, screenshots are saved to the server.
My problem is that even though the screenshots are saved, they do not contain readable fonts.
So if the website reads like this:
חיים טכנולוגיים
the screenshot of the site will look like this:
םםםםםםםםםםםםם
So, instead of the actual letters, it renders and saves little boxes.
The system is centos 6.3. Freetype and Fontconfig are also installed.
How could I go about fixing this?
Thanks!
follow these steps:
in /usr/share/fonts/ I added a folder named arial with the arial.ttf for hebrew I ran fc-cache -vf. That's it! I did not edit or change fonts.conf or did anything else as suggested in the link.
You should use python code for taking screenshots of website. there are two module which will do whatever you want pyvirtualdisplay & selenium. Install them and write a class to create screenshot and call it with command line with your code. Best of luck...
I recently had to fix the same problem myself. I ended up doing what's suggested in the this answer. Well, sort of. I skipped some of the steps:
/usr/share/fonts/
I added a folder named arial
with the arial.ttf
for hebrewfc-cache -vf
.fonts.conf
or did anything else as suggested in the link.Granted, I still had a little trouble with parts of the page (I'm guessing it was because they were using fonts other than arial), but I ended up not needing them. Hopefully that'll be good enough for you too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With