I thought that "Windows Forms" doesn't support OTF-Fonts. But by trying it anyways I realized the opposite.
- I just created a new "Windows Forms" project, which uses the ".NET Framework 4.8" and C# (later I made the same in VB.NET).
- I set a label and a button in a brand new form.
- I made the click event of the button open an instance of the class "System.Windows.Forms.FontDialog" and set the font of the label by the chosen font. Then I started the application, clicked on the button, chose my installed OTF-Font and looked on the result.
For me it works perfectly well, but why, when everyone says that OTF-Fonts are not supported in "Windows Forms"? I also tried different OTF-Fonts and also checked multiple times if they’re actually OTF-Fonts and it still works. And I also tried this "Windows Forms"-Application and the OTF-Fonts on a brand new virtual machine. It still works.
Has anyone an idea, what I’ve perhaps have done different than everyone else?
The reason I asked this question is that someone I know has the problem that a "Windows Forms"-Application crashes with the exception message, that only TTF-Fonts are supported, every time an OTF-Font was chosen. And I'm unable to reproduce this issue in my environment and can use OTF-Fonts in an "Windows Forms"-Application without any problems, but don't know, why.