WPF找不到一些字体 [英] WPF Can't Find some Fonts

查看:249
本文介绍了WPF找不到一些字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么 Media.Fonts 找不到Arial Rounded MT Bold

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

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



$ div $解析方案

检查在您的系统的Windows文件夹中。你的系统上是否安装了Arial Rounded MT Bold字体?你可能没有安装在你的系统上的字体..这可能是唯一的问题没有找到它。



好吧,我得到它在第一个循环中循环通过系统字体家族和Arial Rounded MT Bold的字体家族是Arial Rounded MT。您可以在这里检查其规格 - http://www.microsoft.com所以,如果你像这样更新你的代码 - $ /
$ / b>



$ b

  foreach(System.Windows.Media.Fonts.SystemFontFamilies中的var f)
{
if(f.Source ==Arial Rounded MT )
{
var x =找到;




$ b你会得到你正在寻找的字体。 。


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";
    }
}

解决方案

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..

这篇关于WPF找不到一些字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆