sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
221 stars 110 forks source link

[BUG] Font sizes display incorrectly #198

Open ghost opened 4 years ago

ghost commented 4 years ago

Describe the bug Fonts on soundings display incorrectly, and clip awkwardly, regardless of screen size.

To Reproduce Steps to reproduce the behavior:

  1. Launch any sounding
  2. Check font on sounding
  3. Resize window and observe font sizes changing

Expected behavior The font should be clear and concise at all times, without clipping or inhibiting reading of the sounding.

Screenshots python_2020-04-10_00-02-40 python_2020-04-10_00-02-36 python_2020-04-10_00-02-29

Versioning Information (please complete the following information):

**

Additional context Problem does not appear to exist on COD.edu's variant of SHARPpy.

wblumberg commented 4 years ago

Hi @Zazzmatazz. Thanks for filling out a bug report - this is a very clear and concise report, so I can help you out a bit. I don't think you checked the past issues enough though (that was one of the checkboxes in the bug report), but I appreciate you providing all of this information.

Admittedly, the font scaling of the program is a bit of a mess right now and probably needs to be revisited. We have a screenshot of the GUI as part of our CI testing suite, and it doesn't seem to be adequately representing the GUI users are seeing out in the wild. This is also a big problem with making the program useable by different OSes. The problem has been amplified a bit by the shift to Qt5 and PySide2. Did you look at Issue #195? That user found that changing the scaling on Windows could help with this issue. Maybe you can play with that and find a suitable font size?

ghost commented 4 years ago

Hello @wblumberg -- Issue #195 does not appear to represent the issue I'm facing here, their issue was the scaling of Windows (mine is set to the default 100%) and is resulting in all elements being blurry. In my instance, it's only the fonts which are causing the issue. ApplicationFrameHost_2020-04-10_11-10-36 ApplicationFrameHost_2020-04-10_11-10-50

ghost commented 4 years ago

Hello @wblumberg -- is there any update on this?

wblumberg commented 4 years ago

Unfortunately, I don't have any suggestions right now. I'm sorry. These scaling issues pop up every now and then. We really need to figure out a good way to restructure the text and scaling of the GUI. It's hard to troubleshoot since there are so many different configurations!

ghost commented 4 years ago

Hello @wblumberg .. I did some experimentation and found that the issue exists in 1.4.0b1 all but disappears in the 1.3.0 ("Xenia") version of SHARPpy. Something has affected the font scaling somewhere between 1.3.0 and 1.4.0b1.


1.4.0 is currently unusable due to #193

The image below is 1.4.0b1 SHARPpy_2020-05-01_11-31-00

The image below is 1.3.0 SHARPpy-1 3 0_2020-05-01_11-32-32

Both are using the same sounding, which is here:
snd.txt

This is a video of the rescaling not working: https://gfycat.com/uncommonalienatedarcherfish

Here is the log file output from SHARPpy: sharppy.log


I would like to note that this does not occur just for me, but a series of other persons I had test the bug on. This is another person utilizing Windows 10 Home: image


If I may recommend a solution, in software that I develop, we always measure the size of the text using the font we intend to use (e.g. pseudocode font->measure("Hello, World") would give me a vector (x,y) with the size of the text in pixels/texture units based on the font, its weight, and the font size). This would all but fix the issue of cut off text (enforcing a minimum size based on the string you intend to write). This should work on all platforms.