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 

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?


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

  • There is legal issues also when use MS fonts outside. – user224082 Jun 16 '14 at 16:47
  • This issue applies for free fonts too.. – CᴴᵁᴮᴮʸNᴵᴺᴶᴬ Jun 17 '14 at 8:39

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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.