|
@@ -341,7 +341,23 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
weakReference = new WeakReference(this);
|
|
|
|
|
|
FontFamilyCmb.ItemsSource = CPDFFont.GetFontNameDictionary().Keys;
|
|
|
- FontFamilyCmb.SelectedIndex = 0;
|
|
|
+ // 如果存在helvetica,arial,times,则默认选择
|
|
|
+ if (FontFamilyCmb.Items.Contains("Helvetica"))
|
|
|
+ {
|
|
|
+ FontFamilyCmb.SelectedItem = "Helvetica";
|
|
|
+ }
|
|
|
+ else if (FontFamilyCmb.Items.Contains("Arial"))
|
|
|
+ {
|
|
|
+ FontFamilyCmb.SelectedItem = "Arial";
|
|
|
+ }
|
|
|
+ else if (FontFamilyCmb.Items.Contains("Times"))
|
|
|
+ {
|
|
|
+ FontFamilyCmb.SelectedItem = "Times";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ FontFamilyCmb.SelectedIndex = 0;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void InitWatermarkData(ref WatermarkData watermarkData)
|
|
@@ -514,7 +530,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
FontStyleCmb.ItemsSource = CPDFFont.GetFontNameDictionary()[FontFamilyCmb.SelectedItem.ToString()];
|
|
|
FontStyleCmb.SelectedIndex = 0;
|
|
|
string postScriptName = string.Empty;
|
|
|
- CPDFFont.GetPostScriptName(FontFamilyCmb.SelectedItem.ToString(), FontStyleCmb.SelectedItem.ToString(), ref postScriptName);
|
|
|
+ CPDFFont.GetPostScriptName(FontFamilyCmb.SelectedItem.ToString(), FontStyleCmb?.SelectedItem?.ToString(), ref postScriptName);
|
|
|
PostScriptName = postScriptName;
|
|
|
}
|
|
|
|