|
@@ -1,17 +1,17 @@
|
|
|
-using ImTools;
|
|
|
+using ImTools;
|
|
|
using PDF_Master.CustomControl.CompositeControl;
|
|
|
-using PDF_Master.Helper;
|
|
|
-using PDF_Master.Model.AnnotPanel;
|
|
|
+using PDF_Master.Helper;
|
|
|
+using PDF_Master.Model.AnnotPanel;
|
|
|
using PDF_Master.Properties;
|
|
|
using PDFSettings;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.Globalization;
|
|
|
+using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
-using System.Windows.Controls;
|
|
|
+using System.Windows.Controls;
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
@@ -24,9 +24,9 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
List<PresetFontItem> cacheTempList = new List<PresetFontItem>();
|
|
|
|
|
|
if (Settings.Default.PresetFontList == null)
|
|
|
- Settings.Default.PresetFontList = new PresetFontList();
|
|
|
-
|
|
|
- if (Settings.Default.PreinstallFontList == null)
|
|
|
+ Settings.Default.PresetFontList = new PresetFontList();
|
|
|
+
|
|
|
+ if (Settings.Default.PreinstallFontList == null)
|
|
|
Settings.Default.PreinstallFontList = new PreinstallFontList();
|
|
|
|
|
|
if (Settings.Default.PreinstallFontList.Count == 0/*Settings.Default.PresetFontList.Count == 0*/ )
|
|
@@ -44,7 +44,7 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
Settings.Default.PresetFontList.Add(newItem);
|
|
|
|
|
|
//复杂数据类型 , 不可本地缓存到配置文件,需要转换一下(先 string保存,再根据类型缓存)
|
|
|
- var newItem1 = new PreinstallItem();
|
|
|
+ var newItem1 = new PreinstallItem();
|
|
|
newItem1.mTag = cacheItem.mTag;
|
|
|
newItem1.mTagContent = cacheItem.mTagContent;
|
|
|
newItem1.mFontStyle = cacheItem.mFontStyle.ToString();
|
|
@@ -59,39 +59,129 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
else
|
|
|
{
|
|
|
//根据 对应的字段 内容 ,对照相对应的类型
|
|
|
- foreach (var item in Settings.Default.PreinstallFontList)
|
|
|
- {
|
|
|
+ foreach (var item in Settings.Default.PreinstallFontList)
|
|
|
+ {
|
|
|
+ var newItem = new PresetFontItem();
|
|
|
+ newItem.mTag = item.mTag;
|
|
|
+ newItem.mTagContent = item.mTagContent;
|
|
|
+ switch (item.mFontStyle)
|
|
|
+ {
|
|
|
+ case "Normal":
|
|
|
+ newItem.mFontStyle = FontStyles.Normal;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Italic":
|
|
|
+ newItem.mFontStyle = FontStyles.Italic;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Oblique":
|
|
|
+ newItem.mFontStyle = FontStyles.Oblique;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ switch (item.mFontWeight)
|
|
|
+ {
|
|
|
+ case "Bold":
|
|
|
+ newItem.mFontWeight = FontWeights.Bold;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Normal":
|
|
|
+ newItem.mFontWeight = FontWeights.Normal;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ newItem.mFontSize = item.mFontSize;
|
|
|
+ newItem.mFontFamily = new FontFamily(item.mFontFamily);
|
|
|
+
|
|
|
+ cacheTempList.Add(newItem);
|
|
|
+ }
|
|
|
+ //foreach (var item in Settings.Default.PresetFontList)
|
|
|
+ //{
|
|
|
+ // var newItem = new PresetFontItem();
|
|
|
+ // newItem.mTag = item.mTag;
|
|
|
+ // newItem.mTagContent = item.mTagContent;
|
|
|
+ // newItem.mFontStyle = item.mFontStyle;
|
|
|
+ // newItem.mFontWeight = item.mFontWeight;
|
|
|
+ // newItem.mFontSize = item.mFontSize;
|
|
|
+ // newItem.mFontFamily = item.mFontFamily;
|
|
|
+ // cacheTempList.Add(newItem);
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
+ return cacheTempList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<PresetFontItem> GetCachePresetEditFontList()
|
|
|
+ {
|
|
|
+ List<PresetFontItem> cacheTempList = new List<PresetFontItem>();
|
|
|
+
|
|
|
+ if (Settings.Default.PresetEditFontList == null)
|
|
|
+ Settings.Default.PresetEditFontList = new PresetEditFontList();
|
|
|
+
|
|
|
+ if (Settings.Default.PreinstallEditFontList == null)
|
|
|
+ Settings.Default.PreinstallEditFontList = new PreinstallEditFontList();
|
|
|
+
|
|
|
+ if (Settings.Default.PreinstallEditFontList.Count == 0/*Settings.Default.PresetFontList.Count == 0*/ )
|
|
|
+ {
|
|
|
+ cacheTempList = GetPresetFontStyle();
|
|
|
+ foreach (var cacheItem in cacheTempList)
|
|
|
+ {
|
|
|
+ var newItem = new PresetFontItem();
|
|
|
+ newItem.mTag = cacheItem.mTag;
|
|
|
+ newItem.mTagContent = cacheItem.mTagContent;
|
|
|
+ newItem.mFontStyle = cacheItem.mFontStyle;
|
|
|
+ newItem.mFontWeight = cacheItem.mFontWeight;
|
|
|
+ newItem.mFontSize = cacheItem.mFontSize;
|
|
|
+ newItem.mFontFamily = cacheItem.mFontFamily;
|
|
|
+ Settings.Default.PresetEditFontList.Add(newItem);
|
|
|
+
|
|
|
+ //复杂数据类型 , 不可本地缓存到配置文件,需要转换一下(先 string保存,再根据类型缓存)
|
|
|
+ var newItem1 = new PreinstallItem();
|
|
|
+ newItem1.mTag = cacheItem.mTag;
|
|
|
+ newItem1.mTagContent = cacheItem.mTagContent;
|
|
|
+ newItem1.mFontStyle = cacheItem.mFontStyle.ToString();
|
|
|
+ newItem1.mFontWeight = cacheItem.mFontWeight.ToString();
|
|
|
+ newItem1.mFontSize = cacheItem.mFontSize;
|
|
|
+ newItem1.mFontFamily = cacheItem.mFontFamily.Source;
|
|
|
+ Settings.Default.PreinstallEditFontList.Add(newItem1);
|
|
|
+ }
|
|
|
+
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //根据 对应的字段 内容 ,对照相对应的类型
|
|
|
+ foreach (var item in Settings.Default.PreinstallEditFontList)
|
|
|
+ {
|
|
|
var newItem = new PresetFontItem();
|
|
|
newItem.mTag = item.mTag;
|
|
|
newItem.mTagContent = item.mTagContent;
|
|
|
- switch (item.mFontStyle)
|
|
|
- {
|
|
|
- case "Normal":
|
|
|
- newItem.mFontStyle = FontStyles.Normal;
|
|
|
- break;
|
|
|
-
|
|
|
- case "Italic":
|
|
|
- newItem.mFontStyle = FontStyles.Italic;
|
|
|
- break;
|
|
|
-
|
|
|
- case "Oblique":
|
|
|
- newItem.mFontStyle = FontStyles.Oblique;
|
|
|
- break;
|
|
|
+ switch (item.mFontStyle)
|
|
|
+ {
|
|
|
+ case "Normal":
|
|
|
+ newItem.mFontStyle = FontStyles.Normal;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Italic":
|
|
|
+ newItem.mFontStyle = FontStyles.Italic;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Oblique":
|
|
|
+ newItem.mFontStyle = FontStyles.Oblique;
|
|
|
+ break;
|
|
|
}
|
|
|
- switch (item.mFontWeight)
|
|
|
- {
|
|
|
- case "Bold":
|
|
|
- newItem.mFontWeight = FontWeights.Bold;
|
|
|
- break;
|
|
|
-
|
|
|
- case "Normal":
|
|
|
- newItem.mFontWeight = FontWeights.Normal;
|
|
|
- break;
|
|
|
+ switch (item.mFontWeight)
|
|
|
+ {
|
|
|
+ case "Bold":
|
|
|
+ newItem.mFontWeight = FontWeights.Bold;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Normal":
|
|
|
+ newItem.mFontWeight = FontWeights.Normal;
|
|
|
+ break;
|
|
|
}
|
|
|
newItem.mFontSize = item.mFontSize;
|
|
|
- newItem.mFontFamily = new FontFamily(item.mFontFamily);
|
|
|
-
|
|
|
- cacheTempList.Add(newItem);
|
|
|
+ newItem.mFontFamily = new FontFamily(item.mFontFamily);
|
|
|
+
|
|
|
+ cacheTempList.Add(newItem);
|
|
|
}
|
|
|
//foreach (var item in Settings.Default.PresetFontList)
|
|
|
//{
|
|
@@ -115,11 +205,11 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
if (list == null) return;
|
|
|
|
|
|
if (Settings.Default.PresetFontList == null)
|
|
|
- Settings.Default.PresetFontList = new PresetFontList();
|
|
|
-
|
|
|
- if (Settings.Default.PreinstallFontList == null)
|
|
|
- Settings.Default.PreinstallFontList = new PreinstallFontList();
|
|
|
-
|
|
|
+ Settings.Default.PresetFontList = new PresetFontList();
|
|
|
+
|
|
|
+ if (Settings.Default.PreinstallFontList == null)
|
|
|
+ Settings.Default.PreinstallFontList = new PreinstallFontList();
|
|
|
+
|
|
|
bool isCanSave = false;
|
|
|
List<PresetFontItem> TempLists = new List<PresetFontItem>();
|
|
|
|
|
@@ -138,26 +228,90 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
isCanSave = true;
|
|
|
var index = Settings.Default.PreinstallFontList.FindIndex(temp => temp.mTag == cacheItem.mTag);
|
|
|
- if (index != -1)
|
|
|
- {
|
|
|
- Settings.Default.PreinstallFontList.Remove(cacheItem);
|
|
|
-
|
|
|
- var newItem1 = new PreinstallItem();
|
|
|
- newItem1.mTag = item.mTag;
|
|
|
- newItem1.mTagContent = item.mTagContent;
|
|
|
- newItem1.mFontStyle = item.mFontStyle.ToString();
|
|
|
- newItem1.mFontWeight = item.mFontWeight.ToString();
|
|
|
- newItem1.mFontSize = item.mFontSize;
|
|
|
- newItem1.mFontFamily = item.mFontFamily.Source;
|
|
|
- Settings.Default.PreinstallFontList.Insert(index, newItem1);
|
|
|
+ if (index != -1)
|
|
|
+ {
|
|
|
+ Settings.Default.PreinstallFontList.Remove(cacheItem);
|
|
|
+
|
|
|
+ var newItem1 = new PreinstallItem();
|
|
|
+ newItem1.mTag = item.mTag;
|
|
|
+ newItem1.mTagContent = item.mTagContent;
|
|
|
+ newItem1.mFontStyle = item.mFontStyle.ToString();
|
|
|
+ newItem1.mFontWeight = item.mFontWeight.ToString();
|
|
|
+ newItem1.mFontSize = item.mFontSize;
|
|
|
+ newItem1.mFontFamily = item.mFontFamily.Source;
|
|
|
+ Settings.Default.PreinstallFontList.Insert(index, newItem1);
|
|
|
+ }
|
|
|
+ //cacheItem.mFontFamily = new FontFamily(item.mFontFamily.Source);
|
|
|
+ //cacheItem.mFontSize = item.mFontSize;
|
|
|
+ //cacheItem.mFontStyle = item.mFontStyle;
|
|
|
+ //cacheItem.mFontWeight = item.mFontWeight;
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // TempLists.Add(item);
|
|
|
+ //}
|
|
|
+ }
|
|
|
+
|
|
|
+ //foreach (var itemTemp in TempLists)
|
|
|
+ //{
|
|
|
+ // Settings.Default.PresetFontList.Add(itemTemp);
|
|
|
+ //}
|
|
|
+
|
|
|
+ if (isCanSave)
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void SavePresetEditFontList(List<PresetFontItem> list)
|
|
|
+ {
|
|
|
+ if (list == null) return;
|
|
|
+
|
|
|
+ if (Settings.Default.PresetEditFontList == null)
|
|
|
+ Settings.Default.PresetEditFontList = new PresetEditFontList();
|
|
|
+
|
|
|
+ if (Settings.Default.PreinstallEditFontList == null)
|
|
|
+ Settings.Default.PreinstallEditFontList = new PreinstallEditFontList();
|
|
|
+
|
|
|
+ bool isCanSave = false;
|
|
|
+ List<PresetFontItem> TempLists = new List<PresetFontItem>();
|
|
|
+
|
|
|
+ foreach (var item in list)
|
|
|
+ {
|
|
|
+ //根据预设标题 ,找到 相对应数据
|
|
|
+ var cacheItem = Settings.Default.PreinstallEditFontList.FirstOrDefault(temp => temp.mTag == item.mTag);
|
|
|
+ if (cacheItem != null)
|
|
|
+ {
|
|
|
+ //比对数据,如果不一样 ,更新数据
|
|
|
+ if (cacheItem.mFontFamily != item.mFontFamily.Source ||
|
|
|
+ cacheItem.mFontSize != item.mFontSize ||
|
|
|
+ cacheItem.mFontStyle != item.mFontStyle.ToString() ||
|
|
|
+ cacheItem.mFontWeight != item.mFontWeight.ToString()
|
|
|
+ )
|
|
|
+ {
|
|
|
+ isCanSave = true;
|
|
|
+ var index = Settings.Default.PreinstallEditFontList.FindIndex(temp => temp.mTag == cacheItem.mTag);
|
|
|
+ if (index != -1)
|
|
|
+ {
|
|
|
+ Settings.Default.PreinstallEditFontList.Remove(cacheItem);
|
|
|
+
|
|
|
+ var newItem1 = new PreinstallItem();
|
|
|
+ newItem1.mTag = item.mTag;
|
|
|
+ newItem1.mTagContent = item.mTagContent;
|
|
|
+ newItem1.mFontStyle = item.mFontStyle.ToString();
|
|
|
+ newItem1.mFontWeight = item.mFontWeight.ToString();
|
|
|
+ newItem1.mFontSize = item.mFontSize;
|
|
|
+ newItem1.mFontFamily = item.mFontFamily.Source;
|
|
|
+ Settings.Default.PreinstallEditFontList.Insert(index, newItem1);
|
|
|
}
|
|
|
- //cacheItem.mFontFamily = new FontFamily(item.mFontFamily.Source);
|
|
|
- //cacheItem.mFontSize = item.mFontSize;
|
|
|
- //cacheItem.mFontStyle = item.mFontStyle;
|
|
|
- //cacheItem.mFontWeight = item.mFontWeight;
|
|
|
-
|
|
|
+ //cacheItem.mFontFamily = new FontFamily(item.mFontFamily.Source);
|
|
|
+ //cacheItem.mFontSize = item.mFontSize;
|
|
|
+ //cacheItem.mFontStyle = item.mFontStyle;
|
|
|
+ //cacheItem.mFontWeight = item.mFontWeight;
|
|
|
+
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
//else
|
|
|
//{
|
|
@@ -171,7 +325,7 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
//}
|
|
|
|
|
|
if (isCanSave)
|
|
|
- Settings.Default.Save();
|
|
|
+ Settings.Default.Save();
|
|
|
}
|
|
|
|
|
|
public static void BackDefaultPresetFontStyle(string tag)
|
|
@@ -222,8 +376,8 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
|
|
|
PresetFontItem h1 = new PresetFontItem();
|
|
|
h1.mTag = "H1";
|
|
|
- h1.mTagContent = App.MainPageLoader.GetString("PresetTextStyle_H1Title");
|
|
|
-
|
|
|
+ h1.mTagContent = App.MainPageLoader.GetString("PresetTextStyle_H1Title");
|
|
|
+
|
|
|
h1.mFontSize = 36;
|
|
|
h1.mFontFamily = new FontFamily("Arial");
|
|
|
h1.mFontStyle = FontStyles.Normal;
|
|
@@ -231,8 +385,8 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
|
|
|
PresetFontItem h2 = new PresetFontItem();
|
|
|
h2.mTag = "H2";
|
|
|
- h2.mTagContent = App.MainPageLoader.GetString("PresetTextStyle_H2Title");
|
|
|
-
|
|
|
+ h2.mTagContent = App.MainPageLoader.GetString("PresetTextStyle_H2Title");
|
|
|
+
|
|
|
h2.mFontSize = 24;
|
|
|
h2.mFontFamily = new FontFamily("Arial");
|
|
|
h2.mFontStyle = FontStyles.Normal;
|
|
@@ -298,97 +452,97 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
FontStyleItems.Add(item);
|
|
|
|
|
|
return FontStyleItems;
|
|
|
- }
|
|
|
-
|
|
|
- internal static List<ComboDataItem> GetFontSize()
|
|
|
- {
|
|
|
- var FontSizeItems = new List<ComboDataItem>();
|
|
|
- ComboDataItem item = new ComboDataItem(8);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(9);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(10);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(11);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(12);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(14);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(16);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(18);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(20);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(22);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(24);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(26);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(28);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(36);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(48);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- item = new ComboDataItem(72);
|
|
|
- FontSizeItems.Add(item);
|
|
|
- return FontSizeItems;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
+ internal static List<ComboDataItem> GetFontSize()
|
|
|
+ {
|
|
|
+ var FontSizeItems = new List<ComboDataItem>();
|
|
|
+ ComboDataItem item = new ComboDataItem(8);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(9);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(10);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(11);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(12);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(14);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(16);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(18);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(20);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(22);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(24);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(26);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(28);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(36);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(48);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ item = new ComboDataItem(72);
|
|
|
+ FontSizeItems.Add(item);
|
|
|
+ return FontSizeItems;
|
|
|
+ }
|
|
|
+
|
|
|
public static List<ComboDataItem> GetFamily()
|
|
|
- {
|
|
|
- var FontFamilyItems = new List<ComboDataItem>();
|
|
|
- ComboDataItem item = new ComboDataItem("Courier", "Courier New");
|
|
|
- FontFamilyItems.Add(item);
|
|
|
- item = new ComboDataItem("Arial", "Arial");
|
|
|
- FontFamilyItems.Add(item);
|
|
|
- item = new ComboDataItem(/*"Times-Roman"*/"Times", "Times New Roman");
|
|
|
+ {
|
|
|
+ var FontFamilyItems = new List<ComboDataItem>();
|
|
|
+ ComboDataItem item = new ComboDataItem("Courier", "Courier New");
|
|
|
+ FontFamilyItems.Add(item);
|
|
|
+ item = new ComboDataItem("Arial", "Arial");
|
|
|
FontFamilyItems.Add(item);
|
|
|
- return FontFamilyItems;
|
|
|
+ item = new ComboDataItem(/*"Times-Roman"*/"Times", "Times New Roman");
|
|
|
+ FontFamilyItems.Add(item);
|
|
|
+ return FontFamilyItems;
|
|
|
}
|
|
|
|
|
|
public static List<ComboDataItem> GetFamilyEdit()
|
|
|
- {
|
|
|
- System.Drawing.Text.InstalledFontCollection objFont = new System.Drawing.Text.InstalledFontCollection();
|
|
|
+ {
|
|
|
+ System.Drawing.Text.InstalledFontCollection objFont = new System.Drawing.Text.InstalledFontCollection();
|
|
|
var FontFamilyItems = new List<ComboDataItem>();
|
|
|
- ComboDataItem item;
|
|
|
-
|
|
|
- foreach (var itemFam in EditHelper.GetFontFamily())
|
|
|
- {
|
|
|
- string content = itemFam;
|
|
|
- if (itemFam.Equals("Informal"))
|
|
|
- {
|
|
|
- content = "Informal Roman";
|
|
|
- }
|
|
|
- //屏蔽 SDK暂时无效的字体
|
|
|
- if (itemFam.Equals("Marlett") || itemFam.Equals("MT Extra")
|
|
|
- || itemFam.Equals("Symbol") || itemFam.Equals("HoloLens MDL2 Assets")
|
|
|
- || itemFam.Equals("Wingdings") || itemFam.Equals("Wingdings 2")
|
|
|
- || itemFam.Equals("Wingdings 3") || itemFam.Equals("Webdings")
|
|
|
- || itemFam.Equals("ZWAdobeF") || itemFam.Equals("Algerian")
|
|
|
- || itemFam.Equals("Bookshelf Symbol 7") || itemFam.Equals("Castellar")
|
|
|
- || itemFam.Equals("MS Outlook") || itemFam.Equals("MS Reference Specialty")
|
|
|
- || itemFam.Equals("Segoe Fluent Icons") || itemFam.Equals("Segoe MDL2 Assets")
|
|
|
- || itemFam.Equals("Stencil"))
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- item = new ComboDataItem(DeleteCharacters(itemFam), content);
|
|
|
- item.FontFamily = new FontFamily(content);
|
|
|
- FontFamilyItems.Add(item);
|
|
|
+ ComboDataItem item;
|
|
|
+
|
|
|
+ foreach (var itemFam in EditHelper.GetFontFamily())
|
|
|
+ {
|
|
|
+ string content = itemFam;
|
|
|
+ if (itemFam.Equals("Informal"))
|
|
|
+ {
|
|
|
+ content = "Informal Roman";
|
|
|
+ }
|
|
|
+ //屏蔽 SDK暂时无效的字体
|
|
|
+ if (itemFam.Equals("Marlett") || itemFam.Equals("MT Extra")
|
|
|
+ || itemFam.Equals("Symbol") || itemFam.Equals("HoloLens MDL2 Assets")
|
|
|
+ || itemFam.Equals("Wingdings") || itemFam.Equals("Wingdings 2")
|
|
|
+ || itemFam.Equals("Wingdings 3") || itemFam.Equals("Webdings")
|
|
|
+ || itemFam.Equals("ZWAdobeF") || itemFam.Equals("Algerian")
|
|
|
+ || itemFam.Equals("Bookshelf Symbol 7") || itemFam.Equals("Castellar")
|
|
|
+ || itemFam.Equals("MS Outlook") || itemFam.Equals("MS Reference Specialty")
|
|
|
+ || itemFam.Equals("Segoe Fluent Icons") || itemFam.Equals("Segoe MDL2 Assets")
|
|
|
+ || itemFam.Equals("Stencil"))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ item = new ComboDataItem(DeleteCharacters(itemFam), content);
|
|
|
+ item.FontFamily = new FontFamily(content);
|
|
|
+ FontFamilyItems.Add(item);
|
|
|
}
|
|
|
- return FontFamilyItems;
|
|
|
- }
|
|
|
-
|
|
|
- public static string DeleteCharacters(string str)
|
|
|
- {
|
|
|
- str = str.Replace(" ", string.Empty);
|
|
|
- str = str.Replace("-", string.Empty);
|
|
|
- str = str.Replace("_", string.Empty);
|
|
|
- return str;
|
|
|
+ return FontFamilyItems;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static string DeleteCharacters(string str)
|
|
|
+ {
|
|
|
+ str = str.Replace(" ", string.Empty);
|
|
|
+ str = str.Replace("-", string.Empty);
|
|
|
+ str = str.Replace("_", string.Empty);
|
|
|
+ return str;
|
|
|
}
|
|
|
|
|
|
public static List<ComboDataItem> GetDateFormats()
|
|
@@ -434,6 +588,6 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
|
|
|
TimesItems.Add("yy-MM-dd");
|
|
|
TimesItems.Add("yyyy-MM-dd");
|
|
|
return TimesItems;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|