Browse Source

其他-Form相关的字体加粗斜体等相关内容设置

zhuyi 1 year ago
parent
commit
d901d7ac3e

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/Property/ComboBoxProperty.xaml.cs

@@ -189,7 +189,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 bool isBold = IsBold(cTextAttribute.FontName);
                 bool isItalic = IsItalic(cTextAttribute.FontName);
-                FontType fontType = GetFontType(cTextAttribute.FontName);
+                FontType fontType = GetFontType((sender as ComboBox).SelectedItem?.ToString());
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 cPDFAnnotation.UpdateFormAp();

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/Property/ListBoxProperty.xaml.cs

@@ -192,7 +192,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 bool isBold = IsBold(cTextAttribute.FontName);
                 bool isItalic = IsItalic(cTextAttribute.FontName);
-                FontType fontType = GetFontType(cTextAttribute.FontName);
+                FontType fontType = GetFontType((sender as ComboBox).SelectedItem?.ToString());
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 cPDFAnnotation.UpdateFormAp();

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/Property/PushButtonProperty.xaml.cs

@@ -204,7 +204,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 bool isBold = IsBold(cTextAttribute.FontName);
                 bool isItalic = IsItalic(cTextAttribute.FontName);
-                FontType fontType = GetFontType(cTextAttribute.FontName);
+                FontType fontType = GetFontType((sender as ComboBox).SelectedItem?.ToString());
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 cPDFAnnotation.UpdateFormAp();

+ 3 - 3
Demo/Examples/Compdfkit_Tools/Form/Property/TextFieldProperty.xaml.cs

@@ -181,7 +181,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 bool isBold = IsBold(cTextAttribute.FontName);
                 bool isItalic = IsItalic(cTextAttribute.FontName);
-                FontType fontType = GetFontType(cTextAttribute.FontName);
+                FontType fontType = GetFontType((sender as ComboBox).SelectedItem?.ToString());
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
                 cPDFAnnotation.UpdateFormAp();
@@ -201,12 +201,12 @@ namespace Compdfkit_Tools.PDFControl
                     case 0:
                         break;
                     case 1:
-                        isItalic = IsItalic(cTextAttribute.FontName);
+                        isItalic = false;
                         isBold = true;
                         break;
                     case 2:
                         isItalic = true;
-                        isBold = IsBold(cTextAttribute.FontName);
+                        isBold = false;
                         break;
                     case 3:
                         isItalic = true;