Why is text shown more in xvfb?

I am trying to test a GUI application using Xvfb. The problem I am facing is that the application is sensitive to how large its text is, which seems to be different when using Xvfb. By default, the font and screen resolution are the same in both cases.

To be specific, I have the following Python / PyGtk code running on Ubuntu 12.04:

## fontsize_gtk.py

import gtk

e = gtk.Entry()
l = e.create_pango_layout("S")
print l.get_context().get_font_description().to_string()
print l.get_pixel_size()

So, I run it using my real display and virtual display of the same size:

$ python fontsize_gtk.py 
Sans 10
(8, 17)
$ Xvfb -ac -screen 0 1366x768x24 :2 > /dev/null 2>&1
$ env DISPLAY=:2 python fontsize_gtk.py
Sans 10
(9, 17)

Any ideas why this is more, or how to debug it?

+5
source share
1 answer

The font resolution (in DPI) is different.

+1
source

All Articles