Difference between fonts and images with PhantomJS on Ubuntu / OSX

I am using PhantomJS (v1.9) to generate a PDF from a website. The output looks good in OS X, but the font looks bad when using the same script in Ubuntu.

This is a custom FontFace (Source Sans Pro), but the same happens when using other (standard) fonts. I have attached an image to show the difference. OS X on the left and Ubuntu on the right. On the left is how it should look.

Example
(source: electerious.com )

Since I'm not an expert on font rendering and differences between operating systems, let me know if you need more information.

Does anyone know how to improve rendering, or is this a common problem that cannot be fixed? Thank you.

+4


source to share


2 answers


It can be easier to get started with the system fonts supported on Ubuntu and determine which one is closest to the one you like. Moving from Ubuntu to OSX gives better results. If the font is missing in Ubuntu, you can convert your Mac.dfont files to Uttuntu.ttf files.

sudo apt-get install fondu

fondu Helvetica.dfont // This generates ttf files

/usr/share/fonts/truetype // Move fonts files into Ubuntu

      



Link: http://grasshopperpebbles.com/ubuntu/ubuntu-convert-mac-dfont-files-into-ttf-using-fondu/

0


source


It all depends on the OS fonts.

Try these options:



options= {"height": "950px",
                "width": "650px",
                "zoomFactor": "4",
                "quality": '200'};

      

https://medium.com/@stockholmux/besting-phantomjs-font-problems-ee22795f5c0b

-1


source







All Articles