|
@@ -83,6 +83,11 @@ private let KMMarkupFontTextStringKey: KMPreferenceKey = "KMMarkupFontTextString
|
|
|
private let KMMarkupFontTextAligmentKey: KMPreferenceKey = "KMMarkupFontTextAligmentKey"
|
|
|
private let KMMarkupFontNoteStringKey: KMPreferenceKey = "KMMarkupFontNoteStringKey"
|
|
|
|
|
|
+// Tip: 新补充
|
|
|
+
|
|
|
+private let KMMarkupTextFontSizeKey: KMPreferenceKey = "KMMarkupTextFontSizeKey"
|
|
|
+private let KMMarkupNoteFontSizeKey: KMPreferenceKey = "KMMarkupNoteFontSizeKey"
|
|
|
+
|
|
|
/// 偏好设置已改变
|
|
|
private let KMPreferenceDidChangeNotificationName = "KMPreferenceDidChangeNotificationName"
|
|
|
|
|
@@ -166,6 +171,11 @@ typealias KMPreference = KMPreferenceManager
|
|
|
public static let markupFontTextAligmentKey = KMMarkupFontTextAligmentKey
|
|
|
public static let markupFontNoteStringKey = KMMarkupFontNoteStringKey
|
|
|
|
|
|
+ // Tip: - 新补充
|
|
|
+
|
|
|
+ public static let markupTextFontSizeKey = KMMarkupTextFontSizeKey
|
|
|
+ public static let markupNoteFontSizeKey = KMMarkupNoteFontSizeKey
|
|
|
+
|
|
|
override init() {
|
|
|
super.init()
|
|
|
|
|
@@ -341,7 +351,9 @@ typealias KMPreference = KMPreferenceManager
|
|
|
KMMarkupColorRectangleBorderKey,
|
|
|
KMMarkupFontTextStringKey,
|
|
|
KMMarkupFontTextAligmentKey,
|
|
|
- KMMarkupFontNoteStringKey]
|
|
|
+ KMMarkupFontNoteStringKey,
|
|
|
+ // 新补充
|
|
|
+ KMMarkupTextFontSizeKey, KMMarkupNoteFontSizeKey]
|
|
|
}
|
|
|
return []
|
|
|
}
|
|
@@ -402,7 +414,10 @@ typealias KMPreference = KMPreferenceManager
|
|
|
KMMarkupColorArrowKey : self.markupArrowColorValues,
|
|
|
KMMarkupFontTextStringKey : KMDefaultFontName,
|
|
|
KMMarkupFontTextAligmentKey : 0,
|
|
|
- KMMarkupFontNoteStringKey : KMDefaultFontName],
|
|
|
+ KMMarkupFontNoteStringKey : KMDefaultFontName,
|
|
|
+ // 新补充
|
|
|
+ KMMarkupTextFontSizeKey : self.textFontSizeDefaultValue(),
|
|
|
+ KMMarkupNoteFontSizeKey : self.noteFontSizeDefaultValue()],
|
|
|
KMPreferenceGroup.infomation.rawValue : [:],
|
|
|
KMPreferenceGroup.other.rawValue : [:]]
|
|
|
}
|
|
@@ -488,6 +503,14 @@ extension KMPreferenceManager {
|
|
|
@inline (__always) func invertBarDefaultValue() -> Bool {
|
|
|
return false
|
|
|
}
|
|
|
+
|
|
|
+ @inline (__always) func textFontSizeDefaultValue() -> Float {
|
|
|
+ return 11.0
|
|
|
+ }
|
|
|
+
|
|
|
+ @inline (__always) func noteFontSizeDefaultValue() -> Float {
|
|
|
+ return 12.0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//protocol KMPreferenceManagerColorPart: NSObjectProtocol {
|
|
@@ -1192,6 +1215,28 @@ extension KMPreferenceManager {
|
|
|
let _ = self.setColor(newValue, forKey: KMPreference.markupColorArrowKey)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ var markupTextFontSize: Float {
|
|
|
+ get {
|
|
|
+ return self.getData(forKey: KMPreference.markupTextFontSizeKey) as? Float ?? self.textFontSizeDefaultValue()
|
|
|
+ }
|
|
|
+ set {
|
|
|
+ self.syncDataToPDFView(newValue, forKey: KMPreference.markupTextFontSizeKey)
|
|
|
+
|
|
|
+ _ = self.setData(data: newValue, forKey: KMPreference.markupTextFontSizeKey)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var markupNoteFontSize: Float {
|
|
|
+ get {
|
|
|
+ return self.getData(forKey: KMPreference.markupNoteFontSizeKey) as? Float ?? self.noteFontSizeDefaultValue()
|
|
|
+ }
|
|
|
+ set {
|
|
|
+ self.syncDataToPDFView(newValue, forKey: KMPreference.markupNoteFontSizeKey)
|
|
|
+
|
|
|
+ _ = self.setData(data: newValue, forKey: KMPreference.markupNoteFontSizeKey)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// MARK: -
|
|
@@ -1312,6 +1357,12 @@ extension KMPreferenceManager {
|
|
|
UserDefaults.standard.synchronize()
|
|
|
} else if (key == KMMarkupFontNoteStringKey) {
|
|
|
// UserDefaults.standard.set(data, forKey: CFreeTextNoteAlignmentKey)
|
|
|
+// UserDefaults.standard.synchronize()
|
|
|
+ } else if (key == KMMarkupTextFontSizeKey) {
|
|
|
+ UserDefaults.standard.set(data, forKey: CFreeTextNoteFontSizeKey)
|
|
|
+ UserDefaults.standard.synchronize()
|
|
|
+ } else if (key == KMMarkupNoteFontSizeKey) {
|
|
|
+// UserDefaults.standard.set(data, forKey: CFreeTextNoteFontSizeKey)
|
|
|
// UserDefaults.standard.synchronize()
|
|
|
}
|
|
|
}
|