I am trying to use a custom font for my WinForm application (Segoe UI Light font to be exact) and I have added it into my resources, as I research the internet all I find is code to load it from a file path, and other ways outside the application, I need a way to load it inside the application in case I give it to someone and they don't have it in the path I do, is there a way to do it from inside from the resources? Thanks, I have been researching all day but no hope.
I tried a PrivatwFontCollection but it only allos me to add from a file path also.
For the person who said it was duplicate, that code is broke and wont work on my app, the line
byte[] fontdata = new byte[fontStream.Length];
throw an error sayingAn unhandled exception of type 'System.NullReferenceException' occurred in HR.exe
Additional information: Object reference not set to an instance of an object.