Re: Problem printing text with wxWidgets 3.2.2.1

Fulvio Senore <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Il 05/09/2023 22:55, Vadim Zeitlin ha scritto:
> On Mon, 4 Sep 2023 20:06:58 +0200 Fulvio Senore wrote:
> 
> FS> As usual I had a couple of problems caused by unexpected changes, but I
> FS> was able ti fix them.
> 
>   If you see anything not mentioned in the change log, please report it.


All these problems have been found or reported under Windows.

1) zlib symbols are now prefixed by default so using them leads to 
linker errors.

2) wxBitmapButton: if screen magnification is set to 200% the button 
becomes twice as wide and tall. If magnification is lower then 200% the 
button maintains the original size.
This screwed up the layout of a window for user with such an enlargement.

3) The color of the lines among wxGrid cells has become much lighter. I 
can understand why: now it is the same color as the color used in the 
header, but it is really very light and with high dpi screens it becomes 
almost invisible.

> 
> FS> After the upgrade to 3.2.2.1, under Windows (I don't know for other
> FS> platforms), if the screen text size is set to more that 100%,
> 
>   Do you mean the screen DPI or the separate text magnification option?


The screen magnification option: right click the desktop, then select 
"screen settings" or something similar (my Windows copy is in Italian).

> 
> FS> the program prints text smaller than the right size.
> 
>   Is this reproducible in the printing sample? If yes, please open an issue
> for it as this is supposed to work. If not, you really need to show us what
> is your code doing [differently from the sample] or, realistically, provide
> a small patch to the sample reproducing the problem.
> 


It took me some time but I was able to solve the problem.

In the printout, when doing scale computations, the sample uses

     GetPPIScreen(&ppiScreenX, &ppiScreenY);

while I used

     wxScreenDC sdc;
     ppiScreenX = sdc.GetPPI().GetWidth();
     ppiScreenY = sdc.GetPPI().GetHeight();

For some reason my code returned a higher PPI value when magnification 
is on, leading to smaller text. In wxWidgets 3.1.3 the code worked 
correctly.

As I discovered this problem I started to remember that I already had 
problems with this code. I digged in the repository and in december 2019 
I changed the code from the sample single line to the current 3 lines 
because in wxWidgets 3.1.3 I had problems with test size.
It looks like the current code was a workaround for some 3.1.3 problem 
and now I have to revert to the original code.

I still would like to know why wxPrintout::GetPPIScreen() and 
wxScreenDC::GetPPI() return different values.

In my Windows computer now wxPrintout::GetPPIScreen() always return 96.
wxScreenDC::GetPPI() return 96 with 100% magnification and 
proportionally larger values as magnification increases.

Fulvio

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/0f98dd7e-0261-2c65-c9df-7c1e11516e83%40fsoft.it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.