I am building a Windows 10 universal app in C# that has to list the names of the installed fonts on the system. The app was a metro/modern ui/windows 8.1 app and I used the SharpDX 'trick' there to get the names.
SharpDX is not available (yet?) for Windows 10 UAP, so that does not work anymore.
Any other ways to achieve my goal? Should I consider a fixed list of font names as described here under recommended fonts? This seems rather limiting when on a desktop for instance.
Thanks in advance!
Same basic idea: you'll still use DirectWrite to get the font names.
You can use Win2D to get to DirectWrite from C# in both Windows 8.1 and Universal Windows Platform apps. CanvasTextFormat.GetSystemFontFamilies will return the font families:
string[] fonts = Microsoft.Graphics.Canvas.Text.CanvasTextFormat.GetSystemFontFamilies();
foreach (string font in fonts)
{
Debug.WriteLine(string.Format("Font: {0}", font));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With