|
@@ -215,6 +215,9 @@ import Cocoa
|
|
|
var srHanddler: KMSearchReplaceHanddler = KMSearchReplaceHanddler()
|
|
|
|
|
|
deinit {
|
|
|
+ let fontManager = NSFontManager.shared
|
|
|
+ fontManager.target = nil
|
|
|
+
|
|
|
NotificationCenter.default.removeObserver(self)
|
|
|
|
|
|
self.listView.delegate = nil
|
|
@@ -2569,8 +2572,7 @@ extension KMMainViewController {
|
|
|
extension KMMainViewController {
|
|
|
func changeFont(_ sender: NSFontManager) {
|
|
|
KMPrint("changeFont ...")
|
|
|
- if ((self.listView.activeAnnotation?.isKind(of: CPDFFreeTextAnnotation.self)) != nil) {
|
|
|
- let annotation: CPDFFreeTextAnnotation = self.listView.activeAnnotation as! CPDFFreeTextAnnotation
|
|
|
+ if let annotation = listView.activeAnnotation as? CPDFFreeTextAnnotation {
|
|
|
var font = NSFont(name: annotation.fontName() ?? "Helvetica", size: (annotation.fontSize()) )
|
|
|
font = sender.convert(font!)
|
|
|
|