5

I'm trying to test a GUI application using Xvfb. The problem I'm having is that the application is sensitive to how large its text is, which is apparently different when using Xvfb. The default font and screen resolution are the same in both cases.

To be concrete, 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 a 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 for why it's bigger, or how to go about debugging it?

Geoff Bache
  • 381
  • 1
  • 2
  • 4

1 Answers1

1

The font resolution (in DPI) is different.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358