|
@@ -779,7 +779,7 @@ extension KMEditPDFTextPropertyViewController {
|
|
|
}
|
|
|
|
|
|
@objc func fontAddAction(_ sender: AnyObject) {
|
|
|
- let size = Float(self.fontSizeVC?.stringValue.replacingOccurrences(of: "pt", with: "") ?? "12") ?? 12
|
|
|
+ let size = Float(self.fontSizeVC?.stringValue.replacingOccurrences(of: "pt", with: "") ?? "12") ?? 1
|
|
|
self.fontSizeVC?.stringValue = String(format: "%.0fpt", size+1)
|
|
|
self.km_comboBoxSelectionDidChange(self.fontSizeVC!)
|
|
|
|
|
@@ -787,7 +787,7 @@ extension KMEditPDFTextPropertyViewController {
|
|
|
}
|
|
|
|
|
|
@objc func fontReduceAction(_ sender: AnyObject) {
|
|
|
- let size = Float(self.fontSizeVC?.stringValue.replacingOccurrences(of: "pt", with: "") ?? "12") ?? 12
|
|
|
+ let size = Float(self.fontSizeVC?.stringValue.replacingOccurrences(of: "pt", with: "") ?? "12") ?? 1
|
|
|
if size < 1 {
|
|
|
return
|
|
|
}
|
|
@@ -992,14 +992,17 @@ extension KMEditPDFTextPropertyViewController: KMSelectPopButtonDelegate {
|
|
|
if obj == self.fontSizeVC {
|
|
|
let format = NumberFormatter()
|
|
|
format.numberStyle = .decimal
|
|
|
- let size = Float((obj.stringValue.replacingOccurrences(of: "pt", with: ""))) ?? 0
|
|
|
+ var string = obj.stringValue.replacingOccurrences(of: "pt", with: "")
|
|
|
+ string = string.replacingOccurrences(of: "p", with: "")
|
|
|
+ let size = max(Float(string) ?? 1, 1)
|
|
|
self.fontSizeVC?.stringValue = format.string(from: NSNumber(value: size)) ?? ""
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func km_controlTextDidEndEditing(_ obj: KMDesignSelect) {
|
|
|
if obj == self.fontSizeVC {
|
|
|
- let size = CGFloat(Float((obj.stringValue.replacingOccurrences(of: "pt", with: ""))) ?? 12)
|
|
|
+ let size = CGFloat(Float((obj.stringValue.replacingOccurrences(of: "pt", with: ""))) ?? 1)
|
|
|
+ let sizeValue = max(size, 1)
|
|
|
self.fontSizeVC?.stringValue = String(format: "%.0fpt", size)
|
|
|
self.updateFontSize(size: size)
|
|
|
}
|