EditHelper.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace PDF_Master.Helper
  8. {
  9. public static class EditHelper
  10. {
  11. /// <summary>
  12. /// 字体更改失效:
  13. ///MT Extra
  14. ///Symbol
  15. ///HoloLens MDL2 Assets
  16. ///Wingdings
  17. ///Wingdings 2
  18. ///Wingdings 3
  19. ///Webdings
  20. ///ZWAdobeF
  21. ///Algerian
  22. ///Bookshelf Symbol 7
  23. ///Castellar
  24. ///Marlett
  25. ///MS Outlook(adobe、万兴没效果)
  26. ///MS Reference Specialty
  27. ///Segoe Fluent Icons(adobe、万兴没效果)
  28. ///Segoe MDL2 Assets(adobe、万兴没效果)
  29. ///Stencil
  30. /// 未选择 文本时候,暂时注释SDK 目前没有效果的字体
  31. /// </summary>
  32. public static List<string> FontFamily { get; set; } = new List<string>
  33. {
  34. "Adobe Devanagari",
  35. "Arial",
  36. "Arial Black",
  37. "Arvo",
  38. "Bahnschrift",
  39. "Bahnschrift Condensed",
  40. "Bahnschrift Light Condensed",
  41. "Bahnschrift Light SemiCondensed",
  42. "Bahnschrift SemiBold Condensed",
  43. "Bahnschrift SemiCondensed",
  44. "Bahnschrift SemiLight",
  45. "Bahnschrift SemiLight Condensed",
  46. "Calibri",
  47. "Cambria",
  48. "Cambria Math",
  49. "Candara",
  50. "Cascadia Code",
  51. "Cascadia Code SemiLight",
  52. "Cascadia Mono",
  53. "Cascadia Mono SemiLight",
  54. "Comic Sans MS",
  55. "Consolas",
  56. "Constantia",
  57. "Corbel",
  58. "Courier New",
  59. "DejaVu Math TeX Gyre",
  60. "Droid Serif",
  61. "Ebrima",
  62. "Franklin Gothic",
  63. "Gabriola",
  64. "Gadugi",
  65. "Georgia",
  66. //"HoloLens MDL2 Assets",
  67. "Impact",
  68. "Indie Flower",
  69. "Ink Free",
  70. "Javanese Text",
  71. "Leelawadee UI",
  72. "Leelawadee UI Semilight",
  73. "Lobster",
  74. "Lucida Console",
  75. "Lucida Sans Unicode",
  76. "MS Gothic",
  77. "MS PGothic",
  78. "MS UI Gothic",
  79. //"MT Extra",
  80. "MV Boli",
  81. "Malgun Gothic",
  82. "Malgun Gothic Semilight",
  83. //"Marlett",
  84. "Microsoft Himalaya",
  85. "Microsoft JhengHei",
  86. "Microsoft JhengHei UI",
  87. "Microsoft New Tai Lue",
  88. "Microsoft PhagsPa",
  89. "Microsoft Sans Serif",
  90. "Microsoft Tai Le",
  91. "Microsoft YaHei UI",
  92. "Microsoft Yi Baiti",
  93. "MingLiU-ExtB",
  94. "MingLiU_HKSCS-ExtB",
  95. "Mongolian Baiti",
  96. "Myanmar Text",
  97. "Nirmala UI",
  98. "Nirmala UI Semilight",
  99. "Open Sans",
  100. "PMingLiU-ExtB",
  101. "Palatino Linotype",
  102. "Poiret One",
  103. "Raleway",
  104. "Roboto",
  105. "Roboto Condensed",
  106. "Roboto Slab",
  107. "Sans Serif Collection",
  108. //"Segoe Fluent Icons",
  109. //"Segoe MDL2 Assets",
  110. "Segoe Print",
  111. "Segoe Script",
  112. "Segoe UI",
  113. "Segoe UI Black",
  114. "Segoe UI Emoji",
  115. "Segoe UI Historic",
  116. "Segoe UI Semilight",
  117. "Segoe UI Symbol",
  118. "Segoe UI Variable Display",
  119. "Segoe UI Variable Small",
  120. "Segoe UI Variable Text",
  121. "SimSun-ExtB",
  122. "Sitka Banner",
  123. "Sitka Display",
  124. "Sitka Heading",
  125. "Sitka Small",
  126. "Sitka Subheading",
  127. "Sitka Text",
  128. "Sylfaen",
  129. //"Symbol",
  130. "Tahoma",
  131. "Times New",
  132. "Trebuchet MS",
  133. "Verdana",
  134. //"Webdings",
  135. //"Wingdings",
  136. "Yu Gothic",
  137. "Yu Gothic UI",
  138. "Yu Gothic UI Semilight",
  139. //"ZWAdobeF",
  140. "等线",
  141. "仿宋",
  142. "黑体",
  143. "楷体",
  144. "宋体",
  145. "微软雅黑"
  146. };
  147. public static List<string> GetFontFamily()
  148. {
  149. return FontFamily.OrderBy(item => IsChinese(item)).ThenBy(item => item).ToList();
  150. }
  151. private static bool IsChinese(string str)
  152. {
  153. foreach (char c in str)
  154. {
  155. if (c >= 0x4E00 && c <= 0x9FFF)
  156. {
  157. return true;
  158. }
  159. }
  160. return false;
  161. }
  162. }
  163. }