@momo-kits/native-kits 0.162.3-fontscale.3 → 0.162.3-fontscale.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import Combine
|
|
2
1
|
import CoreGraphics
|
|
3
2
|
|
|
4
|
-
/// App-wide font-scale preference for the SwiftUI kit.
|
|
5
|
-
/// (
|
|
6
|
-
///
|
|
7
|
-
/// When `useOSScaleRate` is false the kit applies `userScaleRate` instead of the
|
|
8
|
-
///
|
|
9
|
-
public final class FontScaleStore
|
|
3
|
+
/// App-wide font-scale preference for the SwiftUI kit. An exported holder the host writes once at
|
|
4
|
+
/// app startup (from the cache-backed `FontScaleProvider`); `scaleSize`/`appFont` read the snapshot.
|
|
5
|
+
/// No realtime: the SwiftUI kit has no navigation container to scope reactive updates, so a startup
|
|
6
|
+
/// snapshot is enough. When `useOSScaleRate` is false the kit applies `userScaleRate` instead of the
|
|
7
|
+
/// OS Dynamic Type factor.
|
|
8
|
+
public final class FontScaleStore {
|
|
10
9
|
public static let shared = FontScaleStore()
|
|
11
10
|
private init() {}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
public private(set) var userScaleRate: CGFloat = 1
|
|
13
|
+
public private(set) var useOSScaleRate: Bool = true
|
|
15
14
|
|
|
16
15
|
public func update(userScaleRate: CGFloat, useOSScaleRate: Bool) {
|
|
17
16
|
self.userScaleRate = userScaleRate
|