|
@@ -323,24 +323,43 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
|
|
|
if (currentItem.mTag != "Custom")
|
|
|
{
|
|
|
- foreach (var item in Settings.Default.PresetFontList)
|
|
|
+ foreach (var item in FontVm.PresetFontList)
|
|
|
{
|
|
|
if (item.mTag == currentItem.mTag)
|
|
|
{
|
|
|
if (FontVm.FontWeightItem != item.mFontWeight || FontVm.FontStyleItem != item.mFontStyle)
|
|
|
- {
|
|
|
- Title = string.Format($"*{currentItem.mTagContent}");
|
|
|
+ {
|
|
|
+ string txt = string.Format($" * {currentItem.mTagContent}");
|
|
|
+
|
|
|
+ if (Title == txt)
|
|
|
+ {
|
|
|
+ Title = "";
|
|
|
+ }
|
|
|
+ Title = txt;
|
|
|
break;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (FontVm.FontWeightItem == item.mFontWeight && FontVm.FontStyleItem == item.mFontStyle && FontVm.CurrentFontSize.Value == item.mFontSize && FontVm.CurrentFontFamily.ValueStr == item.mFontFamily.Source)
|
|
|
{
|
|
|
- Title = currentItem.mTagContent;
|
|
|
+ string txt = currentItem.mTagContent;
|
|
|
+
|
|
|
+ if (Title == txt)
|
|
|
+ {
|
|
|
+ Title = "";
|
|
|
+ }
|
|
|
+ Title = txt;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bool isExist = FontVm.GetCurrentPresetFont(Annot);
|
|
|
+ if (isExist)
|
|
|
+ {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -372,76 +391,112 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
|
|
|
//设置字体大小
|
|
|
private void FontSizeChanged()
|
|
|
- {
|
|
|
+ {
|
|
|
+ if (FontVm.CurrentFontSize != null)
|
|
|
+ {
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
|
|
|
+ //if (BasicVm.IsMultiSelected == false)
|
|
|
+ // PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
|
|
|
+ }
|
|
|
if (FontVm.CurrentPresetFont != null)
|
|
|
{
|
|
|
var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
|
|
|
//var comboDataItem = FontVm.PresetFontItems.FirstOrDefault(temp => temp.ValueStr == FontVm.CurrentPresetFont.ValueStr);
|
|
|
if (currentItem.mTag != "Custom")
|
|
|
{
|
|
|
- foreach (var item in Settings.Default.PresetFontList)
|
|
|
+ foreach (var item in FontVm.PresetFontList)
|
|
|
{
|
|
|
if (item.mTag == currentItem.mTag)
|
|
|
{
|
|
|
if (FontVm.CurrentFontSize.Value != item.mFontSize)
|
|
|
{
|
|
|
- Title = string.Format($"*{currentItem.mTagContent}");
|
|
|
+ string txt = string.Format($" * {currentItem.mTagContent}");
|
|
|
+
|
|
|
+ if (Title == txt)
|
|
|
+ {
|
|
|
+ Title = "";
|
|
|
+ }
|
|
|
+ Title = txt;
|
|
|
break;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (FontVm.FontWeightItem == item.mFontWeight && FontVm.FontStyleItem == item.mFontStyle && FontVm.CurrentFontSize.Value == item.mFontSize && FontVm.CurrentFontFamily.ValueStr == item.mFontFamily.Source)
|
|
|
{
|
|
|
- Title = currentItem.mTagContent;
|
|
|
+ string txt = currentItem.mTagContent;
|
|
|
+
|
|
|
+ if (Title == txt)
|
|
|
+ {
|
|
|
+ Title = "";
|
|
|
+ }
|
|
|
+ Title = txt;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (FontVm.CurrentFontSize != null)
|
|
|
- {
|
|
|
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
|
|
|
- //if (BasicVm.IsMultiSelected == false)
|
|
|
- // PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bool isExist = FontVm.GetCurrentPresetFont(Annot);
|
|
|
+ if (isExist)
|
|
|
+ {
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//设置字体样式
|
|
|
private void FontFamilyChanged()
|
|
|
- {
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(FontVm.CurrentFontFamily.ValueStr) == false)
|
|
|
+ {
|
|
|
+ PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontFamily, new FontFamily(FontVm.CurrentFontFamily.ValueStr));
|
|
|
+ }
|
|
|
if (FontVm.CurrentPresetFont != null)
|
|
|
{
|
|
|
var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
|
|
|
//var comboDataItem = FontVm.PresetFontItems.FirstOrDefault(temp => temp.ValueStr == FontVm.CurrentPresetFont.ValueStr);
|
|
|
if (currentItem.mTag != "Custom")
|
|
|
{
|
|
|
- foreach (var item in Settings.Default.PresetFontList)
|
|
|
+ foreach (var item in FontVm.PresetFontList)
|
|
|
{
|
|
|
if (item.mTag == currentItem.mTag)
|
|
|
{
|
|
|
if (FontVm.CurrentFontFamily.ValueStr != item.mFontFamily.Source)
|
|
|
- {
|
|
|
- Title = string.Format($"*{currentItem.mTagContent}");
|
|
|
+ {
|
|
|
+ string txt = string.Format($" * {currentItem.mTagContent}");
|
|
|
+
|
|
|
+ if (Title == txt)
|
|
|
+ {
|
|
|
+ Title = "";
|
|
|
+ }
|
|
|
+ Title = txt;
|
|
|
break;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (FontVm.FontWeightItem == item.mFontWeight && FontVm.FontStyleItem == item.mFontStyle && FontVm.CurrentFontSize.Value == item.mFontSize && FontVm.CurrentFontFamily.ValueStr == item.mFontFamily.Source)
|
|
|
{
|
|
|
- Title = currentItem.mTagContent;
|
|
|
+ string txt = currentItem.mTagContent;
|
|
|
+
|
|
|
+ if (Title == txt)
|
|
|
+ {
|
|
|
+ Title = "";
|
|
|
+ }
|
|
|
+ Title = txt;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bool isExist = FontVm.GetCurrentPresetFont(Annot);
|
|
|
+ if (isExist)
|
|
|
+ {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (string.IsNullOrEmpty(FontVm.CurrentFontFamily.ValueStr) == false)
|
|
|
- {
|
|
|
- PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontFamily, new FontFamily(FontVm.CurrentFontFamily.ValueStr));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
private void SelectedFillColorChange(object obj)
|
|
@@ -524,7 +579,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
public List<PresetFontItem> FontStyleList = new List<PresetFontItem>();
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 重新定义
|
|
|
+ /// 用所选部分重新定义
|
|
|
/// </summary>
|
|
|
private void ReDefineFontStyle()
|
|
|
{
|
|
@@ -562,6 +617,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 恢复默认预设样式
|
|
|
+ /// </summary>
|
|
|
private void RestoreDefaultStyle()
|
|
|
{
|
|
|
var defaultlists = TextFont.GetPresetFontStyle();
|
|
@@ -778,7 +836,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
bool isExist = FontVm.GetCurrentPresetFont(Annot);
|
|
|
if (isExist == false)
|
|
|
{
|
|
|
- FontVm.CurrentPresetFont = new ComboDataItem("Custom", "自定义");
|
|
|
+ FontVm.CurrentPresetFont = new ComboDataItem("Custom", "Custom");
|
|
|
FontVm.GetCurrentFontSize((int)Annot.FontSize);
|
|
|
|
|
|
FontVm.GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
|