Browse Source

注释-文本设置默认属性,与偏好设置联动的问题

OYXH\oyxh 1 year ago
parent
commit
aefedd27f1

+ 2 - 2
PDF Office/ViewModels/Dialog/SettingsDialogViewModel.cs

@@ -691,7 +691,7 @@ namespace PDF_Master.ViewModels.Dialog
                 switch (value)
                 {
                     case 0:
-                        Annote.TextFontFamaily = "Courier";
+                        Annote.TextFontFamaily = "Courier New";
                         break;
                     case 1:
                         Annote.TextFontFamaily = "Helvetica";
@@ -913,7 +913,7 @@ namespace PDF_Master.ViewModels.Dialog
             }
 
             //文本注释字体
-            if(Annote.TextFontFamaily== "Courier")
+            if(Annote.TextFontFamaily== "Courier New")
             {
                 AnnoteSelectedIndex = 0;
             }

+ 14 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -771,7 +771,20 @@ namespace PDF_Master.ViewModels.Tools
                 if (annot.EventType == AnnotArgsType.AnnotFreeText)
                 {
                     var freeText = annot as FreeTextAnnotArgs;
-                    FreeTextAnnotPopMenu.SetIsChecked(freeText.FontFamily.ToString(), true);
+                    string fontFamily = freeText.FontFamily.ToString();
+                    if (fontFamily == "Arial")
+                    {
+                        fontFamily = "Helvetica";
+                    }
+                    if(fontFamily== "Courier New")
+                    {
+                        fontFamily = "Courier";
+                    }
+                    if (fontFamily == "Times New Roman")
+                    {
+                        fontFamily = "Times";
+                    }
+                    FreeTextAnnotPopMenu.SetIsChecked(fontFamily, true);
                 }
             }
         }

+ 13 - 13
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -1091,19 +1091,19 @@ namespace PDF_Master.ViewModels.Tools
                         FreeTextDefalut.BackgroundColor = freeText.BgColor;
                         FreeTextDefalut.Opacity = (annot as FreeTextAnnotArgs).Transparency;
                         SettingHelper.SetAnnotDefaultProperty(FreeTextDefalut);
-                        FreeTextAnnotArgs freeTextAnnotArgs = new FreeTextAnnotArgs()
-                        {
-                            FontColor = freeText.FontColor,
-                            FontFamily = freeText.FontFamily,
-                            Align = freeText.Align,
-                            FontSize = freeText.FontSize,
-                            FontWeight = freeText.FontWeight,
-                            FontStyle = freeText.FontStyle,
-                            BgColor = freeText.BgColor,
-                            Transparency = (annot as FreeTextAnnotArgs).Transparency
-                        };
-
-                        PDFViewer.SetToolParam(freeTextAnnotArgs);
+                        //FreeTextAnnotArgs freeTextAnnotArgs = new FreeTextAnnotArgs()
+                        //{
+                        //    FontColor = freeText.FontColor,
+                        //    FontFamily = freeText.FontFamily,
+                        //    Align = freeText.Align,
+                        //    FontSize = freeText.FontSize,
+                        //    FontWeight = freeText.FontWeight,
+                        //    FontStyle = freeText.FontStyle,
+                        //    BgColor = freeText.BgColor,
+                        //    Transparency = (annot as FreeTextAnnotArgs).Transparency
+                        //};
+
+                        //PDFViewer.SetToolParam(freeTextAnnotArgs);
                     }
                     else if (annot is StickyAnnotArgs)
                     {