dnndeveloper
dnndeveloper

Reputation: 1631

WPF Can't Find some Fonts

Why is it that Media.Fonts can't find "Arial Rounded MT Bold"?

foreach (var f in System.Windows.Media.Fonts.SystemFontFamilies)
{
    if (f.Source == "Arial Rounded MT Bold")
    {
        var x = "Not Found";
    }
}

var fc = new System.Drawing.Text.InstalledFontCollection();
foreach (var fd in fc.Families)
{
    if (fd.Name == "Arial Rounded MT Bold")
    {
        var x = "Found";
    }
}

Upvotes: 2

Views: 2695

Answers (1)

Rohit Vats
Rohit Vats

Reputation: 81233

Check in your system's Windows folder. Do u have "Arial Rounded MT Bold" font installed on your system?? You might not have the font installed on your system.. That might be the only issue for not finding it..

Ok, i got it in first loop you are looping through System Font families and for "Arial Rounded MT Bold" its font family is "Arial Rounded MT". You can check about its specification here - http://www.microsoft.com/typography/fonts/font.aspx?FMID=918

So, if you update your code like this -

foreach (var f in System.Windows.Media.Fonts.SystemFontFamilies)
{
      if (f.Source == "Arial Rounded MT")
      {
         var x = "Found";
      }
}

You will get that font which you are looking for..

Upvotes: 2

Related Questions