shpaass / yafc-ce

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
51 stars 18 forks source link

UI Scaling on Linux #239

Open kkartaltepe opened 4 weeks ago

kkartaltepe commented 4 weeks ago

The text does not render well on a large or hidpi monitor, it would be nice to support this. It looks like the majority of text is sized based off of Yafc/Program.cs however changing these font sizes to something more reasonable results in lots of misrendering so I suspect its probably not quite free to support hidpi.

kkartaltepe commented 4 weeks ago

It looks like this is partially an issue of my own making,

https://github.com/shpaass/yafc-ce/blob/0a792f6b8996f0b92702785a1aff00b04ec7e58d/Yafc.UI/Core/Window.cs#L63-L76

Shows the dpi support which works pretty well if I chose a scaling factor manually. The issue is my display is incorrecty reported as very low dpi (60) which results in scaling down from the default (13) to a tiny (9) scale. The actual default of 13 looks pretty good on my screen and this is about right if my screen reported the correct dpi.

It would be nice to maybe take a max here to prevent scaling down, unless it is intended to scale down but finding something reporting less than 96 dpi is probably a bug like in my case.