question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No more Microsoft Sans Serif, return actual system font from SystemFonts.DefaultFont?

See original GitHub issue

Is this a good time to fix a long-standing issue, the default use of Microsoft Sans Serif 8pt instead of Segoe UI 9pt? This is in violation of Microsoft’s design guidelines:

UI technology Target Windows version Fonts to use and optimize for
Win32 or WinForms Windows Vista or later Use the appropriate Segoe UI font.
  • Developers:

    • For elements that use fixed layout (such as Windows dialog templates and WinForms), hard code the appropriate font from the preceding table.

The only member of SystemFonts that reflects the actual system theme is the unintuitively-named SystemFonts.MessageBoxFont. Anything in SystemFonts that’s not returning Segoe UI on a default installation of Windows should either change and start returning the real value or should be obsoleted. In other words, https://docs.microsoft.com/dotnet/api/system.drawing.systemfonts#properties should line up precisely with https://docs.microsoft.com/windows/desktop/uxguide/vis-fonts#fonts-and-colors on current Windows installations. Tahoma is not okay and Microsoft Sans Serif is not okay.

These guidelines are consistent with Microsoft’s font guidelines for other UI technologies.

If Segoe UI was defaulted effortlessly, it would be a huge benefit! The fight against Microsoft Sans Serif has afflicted every Windows Forms project I’ve worked on, large and small. I also see apps being built that didn’t undertake this uphill battle and which stand out visually as less professional as a result. Here’s an example taken from the second link below:

image

History and hacks to get it working:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
merriemcgawcommented, Apr 1, 2019

@dreddy-work is going to take a look through our codebase and make sure that this approach is what we want to take. We do like the idea of moving over to a more modern font.

1reaction
wjkcommented, Mar 2, 2019

OTOH, I do support updating the DefaultFont property (only). After reading its documentation, I agree that its description is misleading. It should instead return the same value as MessageBoxFont, as the latter font is what is really recommended for dialog boxes and controls.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default font for Windows Forms application
Check out this blog entry talking about the default font in Forms which ... DefaultFont always returns Microsoft Sans Serif and not scaled....
Read more >
How to Restore Default Fonts in Windows 10 and 11?
Go to the Control Panel -> Appearance and Personalization -> Fonts. This Control Panel item can be opened by running the command: control...
Read more >
SystemFonts.DefaultFont Property (System.Drawing)
The following table describes the value returned by the DefaultFont property depending on the operating system and local culture. System and/or culture, Font...
Read more >
Protected system fonts
Just make sure you retain those that are the usual Windows fonts (Arial, Times New Roman, MS Outlook, MS Serif, MS Sans Serif)...
Read more >
Windows 10 system fonts disappeared
Click on Appearance and Personalization; then, choose Fonts. In the left pane, click on Font settings. Hit Restore default font settings.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found