Results 1 to 9 of 9

Thread: VS 2019 - fonts blurred on Windows 10, higher resolution screen

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2021
    Posts
    46

    VS 2019 - fonts blurred on Windows 10, higher resolution screen

    I have searched for this problem and find complicated answers which require messing with system files. Is this a well known problem?

    The fonts look fine on two laptops running Windows 7, but when I try to run the program on Windows 10 on another computer with a higher resolution (more pixels) screen, the fonts look blurred. What is a good solution?

    This happens for VB.net as well as VB6. I gave up VB6 thinking that VB.net will have several new and useful things but it is creating a lot of trouble. It has been made very complicated.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    What font's are you using? Can you provide us with a screenshot of the blurred font? What do you have the Form's AutoScaleMode set to?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2021
    Posts
    46

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    Quote Originally Posted by dday9 View Post
    What font's are you using? Can you provide us with a screenshot of the blurred font? What do you have the Form's AutoScaleMode set to?
    The AutoScaleMode is font. Would it help to change this?

    By default, I have Microsoft Sans Serif, but the problem is the same for all the available (200+) fonts on that computer.

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    When your monitor has a gratuitously high resolution Windows attempts to help you cope by choosing a high-DPI setting. The idea was to let you use the monitor's native resolution (very important for LCDs) while still having large enough text for you to read it. In other words it trades away screen real estate for readability by "magnifying" everything.

    Most applications run in legacy mode, so everything gets scaled up through appcompat shims. This can distort text and bitmap graphics, producing blurring and pixilation.

    Some programs can be more usable if you choose GDI Scaling for them ("System Enhanced" display appcompat), a feature in newer versions of Windows 10.

    Programming to actually handle High DPI yourself is a big topic though.

    This isn't a Windows 10 issue, it's an issue of buying too much monitor. Sadly we often don't have many options to avoid that. Otherwise display devices would be very cheap and profits too low.

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2021
    Posts
    46

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    Quote Originally Posted by dilettante View Post
    When your monitor has a gratuitously high resolution Windows attempts to help you cope by choosing a high-DPI setting. The idea was to let you use the monitor's native resolution (very important for LCDs) while still having large enough text for you to read it. In other words it trades away screen real estate for readability by "magnifying" everything.

    Most applications run in legacy mode, so everything gets scaled up through appcompat shims. This can distort text and bitmap graphics, producing blurring and pixilation.

    Some programs can be more usable if you choose GDI Scaling for them ("System Enhanced" display appcompat), a feature in newer versions of Windows 10.

    Programming to actually handle High DPI yourself is a big topic though.

    This isn't a Windows 10 issue, it's an issue of buying too much monitor. Sadly we often don't have many options to avoid that. Otherwise display devices would be very cheap and profits too low.
    Then why are all other programs appearing sharp but only VB6 and VB.net programs do not? Can we not use some settings such that the Form painting is done like in Windows Explorer?

  6. #6
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    No, there are no magic settings.

    Microsoft has been gradually improving the high-DPI experience for parts of Windows (like File Explorer) but it has been a challenge even for them.

    GDI Scaling is your best bet for a low effort approach. It isn't perfect because GDI+ doesn't participate and DIBs can't be scaled automagically either.

    Improving the high-DPI experience in GDI based Desktop Apps is one of the last writeups on this. Microsoft isn't really interested in helping developers of traditional desktop applications because UWP ("Metro reloaded") hasn't done as well as they had hoped.

    WPF can adapt to High DPI a little better, though it still has warts the programmer must work around. WinForms doesn't have much support for High DPI unless you do the work yourself. In this it is about the same as VB6's Forms3, both being based on Win32 controls and GDI.

  7. #7
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen


  8. #8

    Thread Starter
    Member
    Join Date
    Jul 2021
    Posts
    46

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    Quote Originally Posted by dilettante View Post
    No, there are no magic settings.

    Microsoft has been gradually improving the high-DPI experience for parts of Windows (like File Explorer) but it has been a challenge even for them.

    GDI Scaling is your best bet for a low effort approach. It isn't perfect because GDI+ doesn't participate and DIBs can't be scaled automagically either.

    Improving the high-DPI experience in GDI based Desktop Apps is one of the last writeups on this. Microsoft isn't really interested in helping developers of traditional desktop applications because UWP ("Metro reloaded") hasn't done as well as they had hoped.

    WPF can adapt to High DPI a little better, though it still has warts the programmer must work around. WinForms doesn't have much support for High DPI unless you do the work yourself. In this it is about the same as VB6's Forms3, both being based on Win32 controls and GDI.
    1. Is there any alternative to VB.net and Visual Studio which will produce good font appearance on smaller as well as bigger (higher resolution) screens?

    2. How does Microsoft manage to show sharp fonts in its own software on high dpi screens?

  9. #9
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,370

    Re: VS 2019 - fonts blurred on Windows 10, higher resolution screen

    dilettante eluded to it, though dismissed it, but UWP is probably more what you want. In fact, per Microsoft (here):
    To start, if you're creating a new Windows app from scratch, it is highly recommended that you create a Universal Windows Platform (UWP) application. UWP applications automatically—and dynamically—scale for each display that they're running on.

    Desktop applications using older Windows programming technologies (raw Win32 programming, Windows Forms, Windows Presentation Framework (WPF), etc.) are unable to automatically handle DPI scaling without additional developer work. Without such work, applications will appear blurry or incorrectly-sized in many common usage scenarios.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width