Browse Source

编辑-文字属性面板刷新bug修复,Courier New显示bug修复

lvle 1 year ago
parent
commit
66add670cd

+ 4 - 0
PDF Office/Model/AnnotPanel/FontBoard.cs

@@ -180,6 +180,10 @@ namespace PDF_Master.Model.AnnotPanel
                     {
                         str = "Times New Roman";
                     }
+                    else if(_currentFontFamily.ValueStr== "Courier")
+                    {
+                        str = "Courier New";
+                    }
                     
                     ChangedValue?.Invoke(str, FontSetModeType.FontFamilys);
 

+ 8 - 1
PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs

@@ -992,7 +992,14 @@ namespace PDF_Master.ViewModels.PropertyPanel.PDFEdit
                 CurrentPresetFont = new ComboDataItem("Custom", "Custom");
                 GetCurrentFontSize((int)TextEditEvent.FontSize);
 
-                GetCurrentFontFamily(TextEditEvent.FontName, TextEditEvent.FontName);
+                if (TextEditEvent.FontName == ""|| TextEditEvent.FontName == null)
+                {
+                    GetCurrentFontFamily("Helvetica", "Helvetica");
+                }
+                else
+                {
+                    GetCurrentFontFamily(TextEditEvent.FontName, TextEditEvent.FontName);
+                }
                 GetFontWeights_Style(TextEditEvent.IsItalic ? FontStyles.Italic : FontStyles.Normal, TextEditEvent.IsBold ? FontWeights.Bold : FontWeights.Normal);
             }
             else