Jen
Jen

Reputation: 155

Running PyQt Webkit script with Xvfb from a shell script

I am trying to run a Python script that involves PyQt Webkit on a headless server using xvfb. The following command works when I run it from the command line, but not from a bash script:

# !/bin/bash

xvfb-run -a -e /path/to/error.log python script.py

The error log shows the following in both instances:

[dix] Could not init font path element /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType, removing from list!

which I read could be ignored. The script runs fine when the bash script is just:

# !/bin/bash

python script.py

aka without Xvfb. Is there something about the bash environment that would prevent the script from running with xvfb? I'm stumped!

Upvotes: 1

Views: 2348

Answers (1)

benmac
benmac

Reputation: 103

I wouldn't ignore that error. It leads to incorrectly rendered fonts if you're attempting to perform screen captures. To get rid of the error (and hopefully your larger issue), you'll need to install the TrueType fonts as follows (Ubuntu syntax here):

sudo apt-get -y install x-ttcidfont-conf cabextract ttf-mscorefonts-installer

(you'll have to enable the multiverse repo to get ttf-mscorefonts-installer)

Accept the EULA terms for ttf-mscorefonts-installer.

Then:

sudo dpkg-reconfigure x-ttcidfont-conf

(choose the freetype fonts).

You should then have cleared the error which will hopefully both fix your issue and cause fonts to render correctly.

Upvotes: 2

Related Questions