开发者

WPF Fonts.SystemFontFamilies doesn't return all expected FontFamilies

For our 开发者_开发技巧WPF property grid, we implemented a FontSelector something like what is in Word 2007. The FontFamily is in the first comboBox. I'd expect that I would be able to populate this list by using Fonts.SystemFontFamilies. This works mostly, but I end missing a number of expected entries. I.e. I only get one Arial, in the word dialog there is there is only one listing for Arial. In word, there is Arial, Arial Black, Arial Narrow, Arial Rounded MT, and Arial Unicode Ms". In another case, I expect Wing Dings, Wing Dings 2, and Wing Ding 3 but I only get Wing Dings.

So how do I work through the FontFamily 'Arial', to add in the other ones I am looking for?

(The above was for Win7, On vista I am missing some font families but the missing ones are different for vista)


As the name suggests SystemFontFamilies contains only font families that's why you are getting only "Arial" family in it. You can loop through this collection instead- System.Drawing.Text.InstalledFontCollection(); If you want to access each font in your system, take a look at this, i answered the same question here - WPF Can't Find some Fonts

It might help..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜