From 7ddf1d9609655935f14279435e45b102afd30e8e Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Tue, 30 Oct 2012 12:07:55 +0000 Subject: remove dependency on xpdyinfo --- diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index daac4fe..3b3b974 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -722,16 +722,10 @@ def _get_dmi(node): def get_screen_dpi(): - '''Looking for 'dimensions' line in xdpyinfo - dimensions: 1280x800 pixels (339x212 millimeters)''' - output = check_output('/usr/bin/xdpyinfo', 'xdpyinfo failed') - if output is not None: - strings = output[find(output, 'dimensions:'):].split() - w = int(strings[1].split('x')[0]) # e.g., 1280x800 - mm = int(strings[3][1:].split('x')[0]) # e.g., (339x212) - return int((w * 25.4 / mm) + 0.5) - else: - return 96 + ''' Return screen DPI ''' + xft_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi') + dpi = float(xft_dpi / 1024) + return dpi def check_output(command, warning): -- cgit v0.9.1