[python-win32] Fonts behaving differently with Py3/216

Tim Roberts timr at probo.com
Fri Mar 4 19:55:23 CET 2011


Greg Ewing wrote:
> I recently tried running PyGUI on Python 3 using
> pywin32 build 216, and a couple of things are
> not working quite the same way as they were with
> Python 2 and build 213.
>
> 1) The default font used for control labels etc.
> is slightly smaller.
>
> 2) When I calculate the width of a piece of text
> using DC.GetTextExtent() I get a value that is
> too small, and doesn't match the actual size of
> the text as it is drawn.
>
> Anyone have any idea what might have changed,
> and what I can do about it?

Are you running this on a different computer?  The default font and the
size of a "dialog unit" is based on the dots-per-inch resolution of the
monitor on that computer.  If you have a machine with a big screen where
the user has chosen a different resolution, that will affect the size of
everything in a dialog.

This is the same problem we used to refer to as "small fonts / large fonts".

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list