3

I have a cron which runs and takes a screenshot of a specific url. The job is:

xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/cutycapt 
--min-width=1200 --min-height=1200 --delay=1000 
--url=http://themer.mydomain.co.uk/_sh.php?id=1 
--out=/home/www/mydomain/co.uk/themer/1.png

This runs and stores the screenshot fine, and when using webfonts provided from Google they load properly.

But when we are using fonts from MS like Perpetua it doesn't render the font, just a fallback font.

So I gathered I needed to install the fonts, but this is where I am getting stuck, I made a folder called myfonts inside /usr/share/fonts/truetype/

Then I uploaded all my .ttf fonts from my Windows fonts folder.

I run sudo fc-cache -vf

/usr/share/fonts: caching, new cache contents: 0 fonts, 4 dirs
....
/usr/share/fonts/truetype/myfonts: caching, new cache contents: 1083 fonts, 0 dirs
....
fc-cache: succeeded

I reboot Ubuntu and try generate the screenshot again but it does not use the fonts.

So reading around I thought perhaps I need to install the fonts into the X11 directory, so I do the same process inside the X11 directory but it still will not use the fonts

Does anyone have any idea what I could try next?

**Update**

I've done some more research, I done:

mkfontdir /path/to/fonts/folder
mkfontscale /path/to/fonts/folder

which has created a .dir and .scale file but this still does not use the fonts

1 Answers1

1

For anyone who stumbles across this,

I had to do

mkfontdir /path/to/fonts/folder
mkfontscale /path/to/fonts/folder

and then

sudo fc-cache -vf