|
@@ -2268,14 +2268,31 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
} else if (CAnnotationTypeFreeText == self.annotationType ||
|
|
|
CAnnotationTypeSignText == self.annotationType) {
|
|
|
//保存参数
|
|
|
- KMEditPDFTextFontModel *model = [KMEditPDFTextManager.manager fetchUserDefaultDataWithTypeStringWithType:@"Commonly"];
|
|
|
- NSString *fontName = [KMEditPDFTextManager.manager fetchFontNameWithFontName:model.fontName];
|
|
|
- NSString *fontStyle = [KMEditPDFTextManager.manager fetchFontStyleWithFontName:model.fontName];
|
|
|
- CGFloat size = model.fontSize;
|
|
|
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
|
|
+ NSString *fontName = [KMEditPDFTextManager.manager fetchFontNameWithFontName: [defaults objectForKey:CFreeTextNoteFontNameKey]];
|
|
|
+ NSString *fontStyle = [KMEditPDFTextManager.manager fetchFontStyleWithFontName: [defaults objectForKey:CFreeTextNoteFontNameKey]];
|
|
|
+ CGFloat size = [[defaults objectForKey:CFreeTextNoteFontSizeKey] floatValue];
|
|
|
+ CGFloat opacity = [[defaults objectForKey:CFreeTextNoteOpacityKey] floatValue];
|
|
|
+// CGFloat size = [[defaults objectForKey:CFreeTextNoteFontSizeKey] floatValue];
|
|
|
+// defaults.safe_setColor(annotation.color, forKey: CFreeTextNoteColorKey)
|
|
|
+// defaults.safe_setColor((annotation as! CPDFFreeTextAnnotation).fontColor, forKey: CFreeTextNoteFontColorKey)
|
|
|
+// defaults.set((annotation as! CPDFFreeTextAnnotation).alignment.rawValue, forKey: CFreeTextNoteAlignmentKey)
|
|
|
+// defaults.set((annotation as! CPDFFreeTextAnnotation).fontName(), forKey: CFreeTextNoteFontNameKey)
|
|
|
+// defaults.set((annotation as! CPDFFreeTextAnnotation).fontSize(), forKey: CFreeTextNoteFontSizeKey)
|
|
|
+// defaults.set(annotation.lineWidth(), forKey: CFreeTextNoteLineWidthKey)
|
|
|
+// defaults.set(annotation.borderStyle().rawValue, forKey: CFreeTextNoteLineStyleKey)
|
|
|
+// defaults.set(annotation.dashPattern(), forKey: CFreeTextNoteDashPatternKey)
|
|
|
+
|
|
|
+
|
|
|
+// KMEditPDFTextFontModel *model = [KMEditPDFTextManager.manager fetchUserDefaultDataWithTypeStringWithType:@"Commonly"];
|
|
|
+// NSString *fontName = [KMEditPDFTextManager.manager fetchFontNameWithFontName:model.fontName];
|
|
|
+// NSString *fontStyle = [KMEditPDFTextManager.manager fetchFontStyleWithFontName:model.fontName];
|
|
|
+// CGFloat size = model.fontSize;
|
|
|
|
|
|
CPDFAnnotationModel *annotationModel = [[CPDFAnnotationModel alloc] initWithAnnotationType:self.annotationType];
|
|
|
annotationModel.fontName = [NSString stringWithFormat:@"%@-%@",fontName,fontStyle];
|
|
|
annotationModel.fontSize = size;
|
|
|
+ annotationModel.opacity = opacity;
|
|
|
|
|
|
CGFloat defaultWidth = annotationModel.fontSize;
|
|
|
CGFloat defaultHeight = annotationModel.fontSize;
|
|
@@ -2288,6 +2305,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
annotation = [self addAnnotationWithType:self.annotationType selection:nil page:page bounds:bounds];
|
|
|
if (self.annotationType == CAnnotationTypeFreeText) {
|
|
|
((CPDFFreeTextAnnotation *)annotation).font = [NSFont fontWithName:fontName size:fontSize];
|
|
|
+ annotation.opacity = opacity;
|
|
|
}
|
|
|
originalBounds = [annotation bounds];
|
|
|
if (annotation) {
|