|
@@ -40,6 +40,122 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
|
|
|
public List<PresetFontItem> PresetFontList = new List<PresetFontItem>();
|
|
|
|
|
|
+ public List<string> FontFamily { get; protected set; } = new List<string>
|
|
|
+{
|
|
|
+ "Adobe Devanagari",
|
|
|
+ "Arial",
|
|
|
+ "Arial Black",
|
|
|
+ "Arvo",
|
|
|
+ "Bahnschrift",
|
|
|
+ "Bahnschrift Condensed",
|
|
|
+ "Bahnschrift Light Condensed",
|
|
|
+ "Bahnschrift Light SemiCondensed",
|
|
|
+ "Bahnschrift SemiBold Condensed",
|
|
|
+ "Bahnschrift SemiCondensed",
|
|
|
+ "Bahnschrift SemiLight",
|
|
|
+ "Bahnschrift SemiLight Condensed",
|
|
|
+ "Calibri",
|
|
|
+ "Cambria",
|
|
|
+ "Cambria Math",
|
|
|
+ "Candara",
|
|
|
+ "Cascadia Code",
|
|
|
+ "Cascadia Code SemiLight",
|
|
|
+ "Cascadia Mono",
|
|
|
+ "Cascadia Mono SemiLight",
|
|
|
+ "Comic Sans MS",
|
|
|
+ "Consolas",
|
|
|
+ "Constantia",
|
|
|
+ "Corbel",
|
|
|
+ "Courier New",
|
|
|
+ "DejaVu Math TeX Gyre",
|
|
|
+ "Droid Serif",
|
|
|
+ "Ebrima",
|
|
|
+ "Franklin Gothic",
|
|
|
+ "Gabriola",
|
|
|
+ "Gadugi",
|
|
|
+ "Georgia",
|
|
|
+ "HoloLens MDL2 Assets",
|
|
|
+ "Impact",
|
|
|
+ "Indie Flower",
|
|
|
+ "Ink Free",
|
|
|
+ "Javanese Text",
|
|
|
+ "Leelawadee UI",
|
|
|
+ "Leelawadee UI Semilight",
|
|
|
+ "Lobster",
|
|
|
+ "Lucida Console",
|
|
|
+ "Lucida Sans Unicode",
|
|
|
+ "MS Gothic",
|
|
|
+ "MS PGothic",
|
|
|
+ "MS UI Gothic",
|
|
|
+ "MT Extra",
|
|
|
+ "MV Boli",
|
|
|
+ "Malgun Gothic",
|
|
|
+ "Malgun Gothic Semilight",
|
|
|
+ "Marlett",
|
|
|
+ "Microsoft Himalaya",
|
|
|
+ "Microsoft JhengHei",
|
|
|
+ "Microsoft JhengHei UI",
|
|
|
+ "Microsoft New Tai Lue",
|
|
|
+ "Microsoft PhagsPa",
|
|
|
+ "Microsoft Sans Serif",
|
|
|
+ "Microsoft Tai Le",
|
|
|
+ "Microsoft YaHei UI",
|
|
|
+ "Microsoft Yi Baiti",
|
|
|
+ "MingLiU-ExtB",
|
|
|
+ "MingLiU_HKSCS-ExtB",
|
|
|
+ "Mongolian Baiti",
|
|
|
+ "Myanmar Text",
|
|
|
+ "Nirmala UI",
|
|
|
+ "Nirmala UI Semilight",
|
|
|
+ "Open Sans",
|
|
|
+ "PMingLiU-ExtB",
|
|
|
+ "Palatino Linotype",
|
|
|
+ "Poiret One",
|
|
|
+ "Raleway",
|
|
|
+ "Roboto",
|
|
|
+ "Roboto Condensed",
|
|
|
+ "Roboto Slab",
|
|
|
+ "Sans Serif Collection",
|
|
|
+ "Segoe Fluent Icons",
|
|
|
+ "Segoe MDL2 Assets",
|
|
|
+ "Segoe Print",
|
|
|
+ "Segoe Script",
|
|
|
+ "Segoe UI",
|
|
|
+ "Segoe UI Black",
|
|
|
+ "Segoe UI Emoji",
|
|
|
+ "Segoe UI Historic",
|
|
|
+ "Segoe UI Semilight",
|
|
|
+ "Segoe UI Symbol",
|
|
|
+ "Segoe UI Variable Display",
|
|
|
+ "Segoe UI Variable Small",
|
|
|
+ "Segoe UI Variable Text",
|
|
|
+ "SimSun-ExtB",
|
|
|
+ "Sitka Banner",
|
|
|
+ "Sitka Display",
|
|
|
+ "Sitka Heading",
|
|
|
+ "Sitka Small",
|
|
|
+ "Sitka Subheading",
|
|
|
+ "Sitka Text",
|
|
|
+ "Sylfaen",
|
|
|
+ "Symbol",
|
|
|
+ "Tahoma",
|
|
|
+ "Times New",
|
|
|
+ "Trebuchet MS",
|
|
|
+ "Verdana",
|
|
|
+ "Webdings",
|
|
|
+ "Wingdings",
|
|
|
+ "Yu Gothic",
|
|
|
+ "Yu Gothic UI",
|
|
|
+ "Yu Gothic UI Semilight",
|
|
|
+ "ZWAdobeF",
|
|
|
+ "等线",
|
|
|
+ "仿宋",
|
|
|
+ "黑体",
|
|
|
+ "楷体",
|
|
|
+ "宋体",
|
|
|
+ "微软雅黑"
|
|
|
+};
|
|
|
+
|
|
|
#endregion 变量
|
|
|
|
|
|
#region 初始化下拉框或列表默认的数据
|
|
@@ -164,7 +280,7 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
#region 字体样式
|
|
|
|
|
|
//下拉框列表
|
|
|
- private ComboDataItem _currentFontFamily = new ComboDataItem("Helvetica", "Helvetica");
|
|
|
+ private ComboDataItem _currentFontFamily = new ComboDataItem("Arial", "Arial");
|
|
|
|
|
|
public ComboDataItem CurrentFontFamily
|
|
|
{
|
|
@@ -175,40 +291,18 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
SetProperty(ref _currentFontFamily, value);
|
|
|
if (isChange)
|
|
|
{
|
|
|
- string str= _currentFontFamily.ValueStr;
|
|
|
- if (_currentFontFamily.ValueStr== "Times")
|
|
|
+ string str= _currentFontFamily.Content;
|
|
|
+ if (_currentFontFamily.Content== "Times New Roman")
|
|
|
{
|
|
|
str = "Times-Roman";
|
|
|
}
|
|
|
- else if(_currentFontFamily.ValueStr== "Courier")
|
|
|
- {
|
|
|
- str = "Courier New";
|
|
|
- }
|
|
|
-
|
|
|
ChangedValue?.Invoke(str, FontSetModeType.FontFamilys);
|
|
|
|
|
|
}
|
|
|
SetProperty(ref _currentFontFamily, value);
|
|
|
if (value.Content != null)
|
|
|
{
|
|
|
- switch (value.Content.ToString())
|
|
|
- {
|
|
|
- case "Courier New":
|
|
|
- FontFamilySelectedIndex = 0;
|
|
|
- break;
|
|
|
-
|
|
|
- case "Helvetica":
|
|
|
- case "Arial":
|
|
|
- FontFamilySelectedIndex = 1;
|
|
|
- break;
|
|
|
-
|
|
|
- case "Times New Roman":
|
|
|
- FontFamilySelectedIndex = 2;
|
|
|
- break;
|
|
|
- default:
|
|
|
- FontFamilySelectedIndex = -1;
|
|
|
- break;
|
|
|
- }
|
|
|
+ FontFamilySelectedIndex=FontFamilyItems.IndexOf(value);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -543,18 +637,16 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
|
|
|
protected void GetCurrentFontFamily(string fontFamily, string uiStr)
|
|
|
{
|
|
|
- if (fontFamily == "Arial")
|
|
|
- {
|
|
|
- fontFamily = "Helvetica";
|
|
|
- uiStr = "Helvetica";
|
|
|
- }
|
|
|
- if(fontFamily == "Times-Roman"|| fontFamily == "Times")
|
|
|
+ //SDK捕获到的字体会是Times-Roman
|
|
|
+ if (fontFamily == "Times-Roman")
|
|
|
{
|
|
|
uiStr = "Times New Roman";
|
|
|
}
|
|
|
- if(fontFamily == "Courier")
|
|
|
+ //WPF的UI字体不包含Helvetica
|
|
|
+ if (fontFamily == "Helvetica")
|
|
|
{
|
|
|
- uiStr = "Courier New";
|
|
|
+ fontFamily = "Arial";
|
|
|
+ uiStr = "Arial";
|
|
|
}
|
|
|
CurrentFontFamily = new ComboDataItem(fontFamily, uiStr);
|
|
|
}
|
|
@@ -690,7 +782,7 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
#region 字体样式
|
|
|
|
|
|
//下拉框列表
|
|
|
- private ComboDataItem _currentFontFamily = new ComboDataItem("Helvetica", "Helvetica");
|
|
|
+ private ComboDataItem _currentFontFamily = new ComboDataItem("Arial", "Arial");
|
|
|
|
|
|
public ComboDataItem CurrentFontFamily
|
|
|
{
|
|
@@ -704,7 +796,6 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
FontFamilySelectedIndex = 0;
|
|
|
break;
|
|
|
|
|
|
- case "Helvetica":
|
|
|
case "Arial":
|
|
|
FontFamilySelectedIndex = 1;
|
|
|
break;
|
|
@@ -712,6 +803,9 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
case "Times New Roman":
|
|
|
FontFamilySelectedIndex = 2;
|
|
|
break;
|
|
|
+ case "Adobe Devanagari":
|
|
|
+ FontFamilySelectedIndex = 3;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -994,8 +1088,20 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
{
|
|
|
if (fontFamily == "Arial")
|
|
|
{
|
|
|
- fontFamily = "Helvetica";
|
|
|
- uiStr = "Helvetica";
|
|
|
+ fontFamily = "Arial";
|
|
|
+ uiStr = "Arial";
|
|
|
+ }
|
|
|
+ if (fontFamily == "Times-Roman")
|
|
|
+ {
|
|
|
+ uiStr = "Times New Roman";
|
|
|
+ }
|
|
|
+ if (fontFamily == "CourierNew")
|
|
|
+ {
|
|
|
+ uiStr = "Courier New";
|
|
|
+ }
|
|
|
+ if (fontFamily == "AdobeDevanagari")
|
|
|
+ {
|
|
|
+ uiStr = "Adobe Devanagari";
|
|
|
}
|
|
|
CurrentFontFamily = new ComboDataItem(fontFamily, uiStr);
|
|
|
}
|
|
@@ -1012,7 +1118,7 @@ namespace PDF_Master.Model.AnnotPanel
|
|
|
foreach (var item in PresetFontList)
|
|
|
{
|
|
|
if (annot.FontSize == item.mFontSize && annot.IsBold == (item.mFontWeight==FontWeights.Bold) && annot.IsItalic == (item.mFontStyle==FontStyles.Italic)
|
|
|
- && (annot.FontName == item.mFontFamily.Source || annot.FontName == "Arial" && item.mFontFamily.Source == "Helvetica")
|
|
|
+ && (annot.FontName == item.mFontFamily.Source || annot.FontName == "Arial" && item.mFontFamily.Source == "Arial")
|
|
|
)
|
|
|
{
|
|
|
if (item.mTag != "Custom")
|