|
@@ -739,9 +739,9 @@ class KMEditPDFTextPropertyViewController: NSViewController {
|
|
|
// }
|
|
|
self.updateTextPresupposition(fontName: fontName, style: fontStyle, size: CGFloat(Float(sizeString)!), needChangeListView: false)
|
|
|
self.currentColor = color
|
|
|
- DispatchQueue.main.async {
|
|
|
- NSColorPanel.shared.color = color
|
|
|
- }
|
|
|
+// DispatchQueue.main.async {
|
|
|
+// NSColorPanel.shared.color = color
|
|
|
+// }
|
|
|
self.fontColorButton.image = self.swatchWithColor(color: color, size: NSSize(width: 20, height: 20))
|
|
|
self.alignment = alignment
|
|
|
self.selectAlignment(alignment: alignment)
|
|
@@ -774,11 +774,16 @@ class KMEditPDFTextPropertyViewController: NSViewController {
|
|
|
|
|
|
if let data = self.handdler?.editAreasFontStyleIsEqual(), data {
|
|
|
if let area = self.handdler?.editingTextAreas.first {
|
|
|
- if let styleName = self.listView.editingSelectionCFont(with: area)?.familyName, styleName.isEmpty == false {
|
|
|
+ if let styleName = self.listView.editingSelectionCFont(with: area)?.styleName, styleName.isEmpty == false {
|
|
|
// if let styleName = self.listView.editingSelectionCFont(byRangeEdit: area)?.styleName, styleName.isEmpty == false {
|
|
|
self.fontStyleVC?.stringValue = styleName
|
|
|
} else {
|
|
|
- self.fontStyleVC?.stringValue = "--"
|
|
|
+ let styleNames = CPDFFont.fontNames(forFamilyName: self.listView.editingSelectionCFont(with: area).familyName)
|
|
|
+ if let styleN = styleNames.first, styleN.isEmpty == false {
|
|
|
+ self.fontStyleVC?.stringValue = styleN
|
|
|
+ } else {
|
|
|
+ self.fontStyleVC?.stringValue = "Regular"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1189,6 +1194,8 @@ extension KMEditPDFTextPropertyViewController: KMSelectPopButtonDelegate {
|
|
|
let size = CGFloat(Float((obj.stringValue.replacingOccurrences(of: "pt", with: "")))!)
|
|
|
self.updateFontSize(size: size)
|
|
|
self.updatePreviewImage()
|
|
|
+
|
|
|
+ KMEditPDFPopToolBarWindow.shared.updateFontSizeButtons(enable: true)
|
|
|
} else if obj == fontStyleVC {
|
|
|
self.updateFontNameAndStyle(name: fontName, style: obj.stringValue)
|
|
|
self.updatePreviewImage()
|