locked
how to get a list of available system fonts? RRS feed

  • Question

  • I'm trying to retrieve the current system fonts and present them to the user so he can chose one of them.


    Is this possible?

    In silverlight I think this is possible with

    System.Windows.Media.Fonts.SystemTypefaces;

    http://forums.silverlight.net/p/172793/412363.aspx

    Thanks.


    "The more difficult something became, the more rewardant it was in the end"
    http://ftduarte.blogspot.com

    Monday, April 2, 2012 2:59 PM

Answers

  • Hi ftduarte,

    The Windows Runtime doesn't provide a way to enumerate the fonts on a system, but you can enumerate the fonts with DirectWrite.  You can encapsulate this in your own WinRT component to call from JavaScript.

    There is sample code in the Font Enumeration sample which demonstrates how to use DirectWrite to do this. It isn't a Metro style sample, but the enumeration code itself should be essentially the same.

    --Rob

    Tuesday, April 3, 2012 4:41 AM
    Moderator

All replies

  • Hi ftduarte,

    The Windows Runtime doesn't provide a way to enumerate the fonts on a system, but you can enumerate the fonts with DirectWrite.  You can encapsulate this in your own WinRT component to call from JavaScript.

    There is sample code in the Font Enumeration sample which demonstrates how to use DirectWrite to do this. It isn't a Metro style sample, but the enumeration code itself should be essentially the same.

    --Rob

    Tuesday, April 3, 2012 4:41 AM
    Moderator
  • Rob thanks for the response.  Can you post a quick project explaining how this c++ could be converted to a library that we could then absorb as a component in a c# winRT app and how to quickly do that.  This would open up a huge trove of power for c# users and maybe get a few more people using c++…  also it would be a huge help for me :)

    --ragnasaur

    Sunday, May 20, 2012 4:13 AM
  • Sunday, May 20, 2012 2:19 PM
    Moderator