FontStyleItem.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. using PDF_Office.CustomControl.CompositeControl;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Media;
  9. namespace PDF_Office.Model.PropertyPanel.AnnotPanel
  10. {
  11. #region 自定义文字样式选项
  12. public class FontStyleItem
  13. {
  14. public string mTag { get; set; }
  15. public string mTagContent { get; set; }
  16. public int mFontSize { get; set; }
  17. public FontFamily mFontFamily { get; set; }
  18. public FontStyle mFontStyle { get; set; }
  19. public FontWeight mFontWeight { get; set; }
  20. }
  21. #endregion
  22. public class TextFont
  23. {
  24. public static List<FontStyleItem> GetPresetFontStyle()
  25. {
  26. List<FontStyleItem> fontStyleList = new List<FontStyleItem>();
  27. FontStyleItem custom = new FontStyleItem();
  28. custom.mTag = "custom";
  29. custom.mTagContent = "自定义";
  30. custom.mFontSize = 24;
  31. custom.mFontFamily = new FontFamily("Helvatica");
  32. custom.mFontStyle = FontStyles.Normal;
  33. custom.mFontWeight = FontWeights.Normal;
  34. FontStyleItem h1 = new FontStyleItem();
  35. h1.mTag = "H1";
  36. h1.mTagContent = "H1大标题";
  37. h1.mFontSize = 36;
  38. h1.mFontFamily = new FontFamily("Helvatica");
  39. h1.mFontStyle = FontStyles.Normal;
  40. h1.mFontWeight = FontWeights.Normal;
  41. FontStyleItem h2 = new FontStyleItem();
  42. h2.mTag = "H2";
  43. h2.mTagContent = "h2(标准)";
  44. h2.mFontSize = 1248;
  45. h2.mFontFamily = new FontFamily("Helvatica");
  46. h2.mFontStyle = FontStyles.Normal;
  47. h2.mFontWeight = FontWeights.Bold;
  48. FontStyleItem h3 = new FontStyleItem();
  49. h3.mTag = "H3";
  50. h3.mTagContent = "H3小标题";
  51. h3.mFontSize = 18;
  52. h3.mFontFamily = new FontFamily("Helvatica");
  53. h3.mFontStyle = FontStyles.Normal;
  54. h3.mFontWeight = FontWeights.Bold;
  55. FontStyleItem b1 = new FontStyleItem();
  56. b1.mTag = "B1";
  57. b1.mTagContent = "B1标题";
  58. b1.mFontSize = 14;
  59. b1.mFontFamily = new FontFamily("Helvatica");
  60. b1.mFontStyle = FontStyles.Normal;
  61. b1.mFontWeight = FontWeights.Normal;
  62. FontStyleItem b2 = new FontStyleItem();
  63. b2.mTag = "B2";
  64. b2.mTagContent = "B2标题";
  65. b2.mFontSize = 12;
  66. b2.mFontFamily = new FontFamily("Helvatica");
  67. b2.mFontStyle = FontStyles.Normal;
  68. b2.mFontWeight = FontWeights.Normal;
  69. FontStyleItem b3 = new FontStyleItem();
  70. b3.mTag = "B3";
  71. b3.mTagContent = "B3标题";
  72. b3.mFontSize = 11;
  73. b3.mFontFamily = new FontFamily("Helvatica");
  74. b3.mFontStyle = FontStyles.Normal;
  75. b3.mFontWeight = FontWeights.Normal;
  76. fontStyleList.Add(custom);
  77. fontStyleList.Add(h1);
  78. fontStyleList.Add(h2);
  79. fontStyleList.Add(h3);
  80. fontStyleList.Add(b1);
  81. fontStyleList.Add(b2);
  82. fontStyleList.Add(b3);
  83. return fontStyleList;
  84. }
  85. public static List<ComboDataItem> GetFontStyle()
  86. {
  87. var FontStyleItems = new List<ComboDataItem>();
  88. ComboDataItem item = new ComboDataItem("Regular", "Regular");
  89. FontStyleItems.Add(item);
  90. item = new ComboDataItem("Bold", "Bold");
  91. FontStyleItems.Add(item);
  92. item = new ComboDataItem("Italic", "Italic");
  93. FontStyleItems.Add(item);
  94. item = new ComboDataItem("Bold Italic", "Bold Italic");
  95. FontStyleItems.Add(item);
  96. return FontStyleItems;
  97. }
  98. public static List<ComboDataItem> GetFamily()
  99. {
  100. var FontFamilyItems = new List<ComboDataItem>();
  101. ComboDataItem item = new ComboDataItem("Courier", "Courier New");
  102. FontFamilyItems.Add(item);
  103. item = new ComboDataItem("Helvetica", "Helvetica");
  104. FontFamilyItems.Add(item);
  105. item = new ComboDataItem("Times-Roman", "Times New Roman");
  106. FontFamilyItems.Add(item);
  107. return FontFamilyItems;
  108. }
  109. }
  110. }