|
@@ -530,6 +530,24 @@ import Cocoa
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } else if tAnnotation is CPDFTextWidgetAnnotation {
|
|
|
+ let font = NSFont(name: (annotationModel.fontName())!, size: (annotationModel.fontSize())) ?? NSFont.systemFont(ofSize: 16)
|
|
|
+ if let fontSize = font.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.size) as? Int {
|
|
|
+ let attributeFontDescriptor = NSFontDescriptor(fontAttributes: [NSFontDescriptor.AttributeName.family: familyString, NSFontDescriptor.AttributeName.face: styleString])
|
|
|
+ if let newFont = NSFont(descriptor: attributeFontDescriptor, size: CGFloat(fontSize)) {
|
|
|
+ annotationModel.setFontName(newFont.fontName)
|
|
|
+ annotationModel.setFontSize(newFont.pointSize)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let tFont = NSFont(name: (annotationModel.fontName())!, size: (annotationModel.fontSize())) ?? NSFont.systemFont(ofSize: 16)
|
|
|
+ if let family = tFont.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.family) as? String,
|
|
|
+ let style = tFont.fontDescriptor.object(forKey: NSFontDescriptor.AttributeName.face) as? String {
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ let selectedStyleIndex = self.setFontStyle(withFontName: family, currentStyle: style)
|
|
|
+ self.fontStylePopUpButton.selectItem(at: Int(selectedStyleIndex))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|