1

My WPF application's font suddenly looks different on my PC. I am not sure if this occur after a windows update. I am using Windows 10 Version 1803, .Net 4.5 in one application and .Net 4.6.1 in the other. This is happening on my 2 WPF applications.

Here is a picture of my WPF application on other PCs (Acceptable): https://ibb.co/444D8X5

Here is a picture of same WPF application on my PC (Unacceptable): https://ibb.co/mvVHT9s

Any clue why this is happening? Looks like the characters moved a couple pixels down. Thanks in advance.

JP Garza
  • 212
  • 3
  • 16
  • To clarify, one screenshot was taken on .NET 4.5 and the other one .NET 4.6.1? Are they both the same application? What does it look like on other computers (and what about a baseline in a new Windows 10 VM instance?) – Dai Apr 22 '19 at 16:44
  • 3
    Does the font you are using exist on both machines? Also, does the user have the an increased text size set in their display settings within windows? Very nice look front end BTW. – Tronald Apr 22 '19 at 16:48
  • 3
    Probably the specified fond is not installed on PC. Windows when a font is not installed it picks the closest font that is installed base on the font type and style. The same fond is apparently not on the two machines. It has nothing to do with the version of Windows or Net version. The graphics card installed on the machine and the screen resolution may also affect the display. – jdweng Apr 22 '19 at 16:49
  • @Dai both images show same application. This application in images is .Net 4.5. but the problem also occurs on another application that runs on .Net 4.6.1. The 1st image is how it used to look on my PC and how it looks on all other PCs. The 2nd image/link is how it looks on my PC now (but it did not used to look like that) – JP Garza Apr 22 '19 at 16:53
  • @Tronald thank you. I am using Roboto. It does not appear to be available on my "Control Panel\Appearance and Personalization\Fonts" but it is also not available on the other PCs. Am I looking in the right place? is this maybe the problem, that it does not exist on any Windows 10 and so the different windows versions pick a different one. It just seems that when I select ROBOTO on WPF it actually changes to it. My font appears to look okay in the editor just not during run time. (And they do not have the increased text size set) – JP Garza Apr 22 '19 at 16:57
  • @jdweng look at previous comment to Tronald. And in it looked fine on my computer for the last 2 years. something changed and im not sure. could have been a windows update. – JP Garza Apr 22 '19 at 17:00
  • 1
    @JPGarza Roboto is not a standard Windows font. I recommend using "Segoe UI" instead as it's standard and it's designed to look better on 96dpi devices (which is typical for Windows) whereas Roboto is designed for high-DPI Android phones. – Dai Apr 22 '19 at 17:59

1 Answers1

2

So the reason your font doesn't appear at runtime is because it is not actually installed on your machine. Windows doesn't know where to find it so it goes to a default font. You should embed the font within the application.

See this post

Tronald
  • 1,520
  • 1
  • 13
  • 31