This was an interesting bug as there were a few challenges in getting print preview to work on Windows which are Windows specific:
The problem that was originally reported seems to be caused by not passing a parent frame to the wxHtmlEasyPrinting constructor.
With that resolved, the preview was blank and I noticed the turtle graphics preview was also blank. Allowing the event loop to also process idle events appears to resolve this.
After a turtle graphics preview (even prior to this change), the key event handling doesn't seem to be properly restored to the terminal. This appears to be resolved by using the logo frame as the parent of the turtle graphics preview.
The final challenge is that the way the text is passed in to the preview appears to cause some rendering problems for all platforms. In the case of Windows, it's particularly dramatic:
On Linux and OSX, it seems to be limited to spacing problems:
This was resolved by fixing the closing tags on the HTML and replacing space characters with :
Test Environments
OSX Catalina (10.15.7) w/ wxWidgets 3.0.5
Ubuntu Bionic (18.04.5) w/ wxWidgets 3.0.5
Windows 10 Pro (19043.1766) w/ wxWidgets 3.0.5
Resolves #126
Summary
This was an interesting bug as there were a few challenges in getting print preview to work on Windows which are Windows specific:
wxHtmlEasyPrinting
constructor.The final challenge is that the way the text is passed in to the preview appears to cause some rendering problems for all platforms. In the case of Windows, it's particularly dramatic:
On Linux and OSX, it seems to be limited to spacing problems:![Screen Shot 2022-06-18 at 2 30 41 PM](https://user-images.githubusercontent.com/330202/174452682-120e7eb3-5b69-4d71-b8f8-f387f6398f8d.png)
This was resolved by fixing the closing tags on the HTML and replacing space characters with![Screen Shot 2022-06-18 at 3 01 04 PM](https://user-images.githubusercontent.com/330202/174452767-91b6b7cf-ef03-4ebc-b081-b29120c9386e.png)
:Test Environments
OSX Catalina (10.15.7) w/ wxWidgets 3.0.5 Ubuntu Bionic (18.04.5) w/ wxWidgets 3.0.5 Windows 10 Pro (19043.1766) w/ wxWidgets 3.0.5