I'm embedding a font in my app as EmbeddedResource and want to use it in a textbox. AddMemoryFont help says I have to set compatible text rendering to true to use GDI+ so my font can be used, but somehow it just won't display the right font.
in Program.cs I explicitly state : Application.SetCompatibleTextRenderingDefault(true);
So why is it not working ? Anybody got a clue ?
Okay, I figured it out thanks to the interwebs and Google.
For future reference, if anybody has this problem, the fix is : after getting your embedded font as a stream, and before calling AddMemoryFont, you have to call AddFontMemResourceEx ! (Not available in C# so you have to import it :
and then :
And presto, you'll be able to use the font. Without the AddFontMemResourceEx it wont work.