Open Olina-Zhang opened 1 week ago
I want to add some more details:
csproj + ApplicationConfiguration.Initialize();
. If instead we set font in Program.cs
like this: Application.SetDefaultFont(new System.Drawing.Font("Calibri", 13));
- all work fine.@kirsan31 - thank you for the details!
Issue was found when testing PR #11206
.NET version
9.0.100-preview.7.24323.5
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, it cannot repro in .NET 8.0
Issue description
When setting custom ApplicationDefaultFont for Winforms .NET 9.0 application, added controls and form are not scaled well on HDPI primary monitor, especially the larger the DPI value, the more pronounced the results look
150%DPI with .NET 9.0:
225%DPI with .NET 9.0:
225%DPI with .NET 8.0:
![image](https://github.com/dotnet/winforms/assets/26474449/d6af5b03-d9c7-457c-820e-98df99ede0d7)
Steps to reproduce
<ApplicationDefaultFont>Calibri,13pt,style=regular</ApplicationDefaultFont>