0
System.Drawing.Font font = new Font("Aharoni", 20f, FontStyle.Regular);

Above code works in windows 10 but fails in windows 7. Can anyone please provide root cause why this works in windows 10?

  • Have you tried checking your font content in Windows 7? You can simply click start and type **Fonts** on your search box. This will lead you to a folder containing all the font type in the control panel and check whether **Aharoni** exist or not. – Hari Jan 23 '18 at 07:14
  • Yes, Aharoni font is available in both OS. –  Jan 23 '18 at 08:10
  • I found in my pc running on Win7, the font is **Aharoni Bold** instead of **Aharoni**. I am not sure whether this makes any difference – Hari Jan 23 '18 at 08:15
  • This will not make any difference, It throws exception message as regular font style is not supported for Aharoni in windows 7 but works in windows 10 –  Jan 23 '18 at 08:17
  • Perhaps, you can try to change the font type to **Aharoni Bold** in your code and try to run in your Windows 7 machine. Maybe you can see something... – Hari Jan 24 '18 at 00:52

1 Answers1

0

That can be missing from windows 7 here font list in windows 7

To fix the problem you can add fonts you want to Resources like

Hari
  • 718
  • 3
  • 9
  • 30
Mohamed Sa'ed
  • 781
  • 4
  • 13
  • Font is not missing. In your list see first font is Aharoni. Which works in regular style for windows 10 but not in windows 7. –  Jan 23 '18 at 12:28
  • can be missing from windows 7 that you have been tested on it ,try on another PC or you can try second choice by add font to **Resources** to run for all OS – Mohamed Sa'ed Jan 23 '18 at 12:46