小智 31
您可以在MS排版网站上找到任何给定Microsoft产品附带的所有字体列表("按产品排列的字体"):
http://www.microsoft.com/typography/fonts/
WPF 4至少需要Windows XP SP3和IE 5.01,因此您可以依赖的字体如下:
- Aharoni - Andalus - AngsanaUPC - Angsana New - Arabic Transparent - Arial - Arial Black - Batang - BrowalliaUPC - Browallia New - Comic Sans MS - CordiaUPC - Cordia New - Courier New - David - DFKai-SB - DilleniaUPC - Estrangelo Edessa - EucrosiaUPC - Fixed Miriam Transparent - Franklin Gothic - FrankRuehl - FreesiaUPC - Gautami - Georgia - Gulim - Impact - IrisUPC - JasmineUPC - KaiTi - Kartika - KodchiangUPC - Latha - Levenim MT - LilyUPC - Lucida Console - Lucida Sans - Lucida Sans Unicode - Mangal - Marlett - Microsoft Sans Serif - PMingLiU - Miriam - Miriam Fixed - MS Gothic - MS Mincho - MV Boli - Narkisim - Palatino Linotype - PMingLiU-ExtB - Raavi - Rod - Shruti - SimHei - Simplified Arabic Fixed - Simplified Arabic Fixed - SimSun-ExtB - Sylfaen - Symbol - Tahoma - Times New Roman - Traditional Arabic - Trebuchet MS - Tunga - Verdana - Vrinda - Webdings - Wingdings
(基于过滤此列表)
但是,这些页面指出可能未安装某些字体.我认为除非需要,否则通常不会安装亚洲脚本 - 也许其他人知道这里的细节?
小智 5
有一种更简单的方法可以列出所有默认字体。
using System.Windows.Media;
//...
//Somewhere inside the window's class (e.g. constructor)
var fontList = Fonts.SystemFontFamilies;
Run Code Online (Sandbox Code Playgroud)
然后您还可以将其绑定到 ComboBox,如下所示:
//...Inside of window constructor
this.DataContext = fontList
Run Code Online (Sandbox Code Playgroud)
您可以在这里找到更多详细信息:http://vbcity.com/blogs/xtab/archive/2009/11/30/wpf-how-to-list-select-and-apply-fonts.aspx