Delivered-To: lablgtk at yquem.inria.fr Message-ID: <4739B9D3.3080105 at janestcapital.com> Date: Tue, 13 Nov 2007 09:50:59 -0500 From: Adam Chlipala MIME-Version: 1.0 To: lablgtk at yquem.inria.fr Content-Transfer-Encoding: 7bit Subject: [Lablgtk] Predicting width of rendered text Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Length: 916 I want to calculate how many pixels of width would be needed to render a string in the current default font within a lablgtk app. So far, I haven't been able to figure out how to do this. I've tried looking at the styles of various on-screen widgets to get the font that they use, but this font seems unrelated to what is really displayed, as it stays the same even when I alter my system font defaults to change the real fonts used by the widgets. I've also tried Gdk.Screen.get_pango_context and looking at the font within that context, but this font also seems to have no connection to what is really displayed. Can anyone suggest code that would let me measure the pixels needed to render a string in the font that is being used in all of my widgets? _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk