Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable EPUB pagination with vertical text #423

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. Take a look

* The `Link` property key for archive-based publication assets (e.g. an EPUB/ZIP) is now `https://readium.org/webpub-manifest/properties#archive` instead of `archive`.

#### Navigator

* EPUB: The `scroll` preference is now forced to `true` when rendering vertical text (e.g. CJK vertical). [See this discussion for the rationale](https://github.com/readium/swift-toolkit/discussions/370).


## [3.0.0-alpha.1]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ public final class EPUBPreferencesEditor: StatefulPreferencesEditor<EPUBPreferen
preference: \.scroll,
setting: \.scroll,
defaultEffectiveValue: defaults.scroll ?? false,
isEffective: { [layout] _ in layout == .reflowable }
isEffective: { [layout] in
layout == .reflowable && !$0.settings.verticalText
}
)

/// Indicates if the fixed-layout publication should be rendered with a
Expand Down
14 changes: 11 additions & 3 deletions Sources/Navigator/EPUB/Preferences/EPUBSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ public struct EPUBSettings: ConfigurableSettings {
?? language?.verticalText(for: readingProgression)
?? false

var scroll = preferences.scroll
?? defaults.scroll
?? false

/// We disable pagination with vertical text, because CSS columns don't support it properly.
/// See https://github.com/readium/swift-toolkit/discussions/370
if verticalText {
scroll = true
}

self.init(
backgroundColor: preferences.backgroundColor,
columnCount: preferences.columnCount
Expand Down Expand Up @@ -157,9 +167,7 @@ public struct EPUBSettings: ConfigurableSettings {
?? defaults.publisherStyles
?? true,
readingProgression: readingProgression,
scroll: preferences.scroll
?? defaults.scroll
?? false,
scroll: scroll,
spread: preferences.spread
?? Spread(metadata.presentation.spread)
?? defaults.spread
Expand Down
Loading