开发者

how to Enumerate local fonts in silverlight 4

开发者 https://www.devze.com 2022-12-27 06:14 出处:网络
I heard about silverlight 开发者_如何学Python4 can use local fonts. So, is there a way fo enumerate them? I just want to have them shown into a listbox.Use the SystemTypefaces static property of the S

I heard about silverlight 开发者_如何学Python4 can use local fonts. So, is there a way fo enumerate them? I just want to have them shown into a listbox.


Use the SystemTypefaces static property of the System.Windows.Media.Fonts class. This provides a collection go Typeface objects listing the set of fonts found in the system font folder.


I struggled with the same issue.

I ended up using Fonts.SystemFontFamilies on the SERVER (in the PresentationCore dll), and then sending a list of strings (from the Source property) to the Silverlight app. On my machine, sending 236 font names with a service call is about 8 KB, which is not that bad.

Yes, the client might not have all the fonts installed on his machine, but this is the best I could find.

0

精彩评论

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