feat(epub): complete wxread parity scope

This commit is contained in:
shen
2026-05-26 09:19:37 +08:00
parent 23182e8b5a
commit 0e7d952fe5
31 changed files with 2619 additions and 1533 deletions
@@ -21,6 +21,10 @@ public struct RDEPUBReaderConfiguration: Equatable {
public var fontSize: CGFloat
/// 1.6 1.6
public var lineHeightMultiple: CGFloat
///
public var numberOfColumns: Int
/// 20pt
public var columnGap: CGFloat
/// .pageCurl仿 .scroll
public var displayType: RDReaderView.DisplayType
///
@@ -73,6 +77,8 @@ public struct RDEPUBReaderConfiguration: Equatable {
public init(
fontSize: CGFloat = 15,
lineHeightMultiple: CGFloat = 1.6,
numberOfColumns: Int = 1,
columnGap: CGFloat = 20,
displayType: RDReaderView.DisplayType = .pageCurl,
landscapeDualPageEnabled: Bool = true,
showsTableOfContents: Bool = true,
@@ -87,6 +93,8 @@ public struct RDEPUBReaderConfiguration: Equatable {
) {
self.fontSize = fontSize
self.lineHeightMultiple = lineHeightMultiple
self.numberOfColumns = max(1, numberOfColumns)
self.columnGap = max(0, columnGap)
self.displayType = displayType
self.landscapeDualPageEnabled = landscapeDualPageEnabled
self.showsTableOfContents = showsTableOfContents
@@ -115,6 +123,8 @@ extension RDEPUBReaderConfiguration {
lineHeightMultiple: lineHeightMultiple,
reflowableContentInsets: reflowableContentInsets,
fixedContentInset: fixedContentInset,
numberOfColumns: numberOfColumns,
columnGap: columnGap,
themeBackgroundColor: theme.themeBackgroundColorCSS,
themeTextColor: theme.themeTextColorCSS,
fixedBackgroundColor: theme.themeBackgroundColorCSS,
@@ -122,4 +132,4 @@ extension RDEPUBReaderConfiguration {
fixedLayoutSpreadMode: fixedLayoutSpreadMode
)
}
}
}