PDA

View Full Version : Windows 7 Font Magnification leads to printing differences



darthczyz
21st April 2012, 03:51
Short version: Is there a way to counteract the font magnification effects that Windows 7 offers on Qt Widgets so that all users (whether using font magnification or not) will get the same printout when rendering a QWidget to a printer?

Long version: I am printing labels to a SATO printer using Qt. The 'label' is a QWidget containing product information. There are two methods I use which produce equally nice albeit different results. One is 'draw'ing the components to the painter (i.e. drawText, and the other is rendering the QWidget using the render function. After some tweaking, I had the label printing out nicely and all was good. I gave it to someone else to use, and when she printed the label was shrunk as if everything had been scaled down. I tried a bunch of things that produced no changes.

Then I realized she was using font magnification that is available in Windows 7 through the control panel. There are 3 settings, small (default), medium (125% mag), and large (150% mag). She is using the 125% magnification, and when I use the 'drawText' method, all of the components are actually shrinking. When I use the render method, all of the components are enlarged. In both cases, information is cut off and my label no longer looks very good.

It makes sense that the widget would be magnified by the operating system if magnification is turned on, but it's annoying that it is affecting printing to a printer, and not just on screen display. Does anyone know if there is a way to check to see if this magnification is occurring or if there is a way to completely override it using Qt functions?

As one last note, I do not believe this is an issue with the Seagull Scientific driver for the printer. The TEST printout is unaffected by the magnification.

Thanks!