ASP.NET MVC 获取计算机字体
//加载计算机上可用的字体 public string LoadFonts() { try { var fontCollection = new InstalledFontCollection(); var mycomputerfonts = fontCollection.Families; if (!mycomputerfonts.Any()) return null; var list = new List<string>(0); var newfonts = mycomputerfonts.Reverse().ToList(); list.AddRange(newfonts.Select(fontFamily => fontFamily.Name)); return JsonConvert.SerializeObject(list); } catch (Exception ex) { return null; } }