WPF中文 FontFamily

如图:


LanguageSpecificStringDictionary fontDics = null;

           

            foreach (FontFamily fam in Fonts.SystemFontFamilies)
            {
                fontDics = fam.FamilyNames;
                string fontName = null;
                if (fontDics.TryGetValue(XmlLanguage.GetLanguage("zh-cn"), out fontName))
                {
                    //Globals.SysFontFamily只是个string。

                    boxFamily.Add(new FontFamily(fontName));
                }
                else
                {
                    boxFamily.Add(fam);
                }
            }

你可能感兴趣的:(WPF/Sliverlight)